diff --git a/playground/assets/_commonjsHelpers-C932wzq6.js b/playground/assets/_commonjsHelpers-C932wzq6.js new file mode 100644 index 0000000..4527487 --- /dev/null +++ b/playground/assets/_commonjsHelpers-C932wzq6.js @@ -0,0 +1 @@ +function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function c(e){if(e.__esModule)return e;var o=e.default;if(typeof o=="function"){var t=function r(){return this instanceof r?Reflect.construct(o,arguments,this.constructor):o.apply(this,arguments)};t.prototype=o.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var u=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,u.get?u:{enumerable:!0,get:function(){return e[r]}})}),t}export{c as a,n as g}; diff --git a/playground/assets/_commonjsHelpers-DM6icglO.js b/playground/assets/_commonjsHelpers-DM6icglO.js deleted file mode 100644 index f621c8d..0000000 --- a/playground/assets/_commonjsHelpers-DM6icglO.js +++ /dev/null @@ -1 +0,0 @@ -var u=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};function f(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function s(e){if(e.__esModule)return e;var r=e.default;if(typeof r=="function"){var t=function o(){return this instanceof o?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};t.prototype=r.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(e).forEach(function(o){var n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:function(){return e[o]}})}),t}export{s as a,u as c,f as g}; diff --git a/playground/assets/babel-BeV4PP65.js b/playground/assets/babel-BeV4PP65.js new file mode 100644 index 0000000..f96c120 --- /dev/null +++ b/playground/assets/babel-BeV4PP65.js @@ -0,0 +1,15 @@ +var Or=Object.create,Ze=Object.defineProperty,Fr=Object.getOwnPropertyDescriptor,Br=Object.getOwnPropertyNames,Rr=Object.getPrototypeOf,jr=Object.prototype.hasOwnProperty,Ur=(p,u)=>()=>(u||p((u={exports:{}}).exports,u),u.exports),_r=(p,u)=>{for(var m in u)Ze(p,m,{get:u[m],enumerable:!0})},Hr=(p,u,m,x)=>{if(u&&typeof u=="object"||typeof u=="function")for(let f of Br(u))!jr.call(p,f)&&f!==m&&Ze(p,f,{get:()=>u[f],enumerable:!(x=Fr(u,f))||x.enumerable});return p},Vt=(p,u,m)=>(m=p!=null?Or(Rr(p)):{},Hr(Ze(m,"default",{value:p,enumerable:!0}),p)),qt=Ur(p=>{Object.defineProperty(p,"__esModule",{value:!0});function u(t,e){if(t==null)return{};var s={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.includes(r))continue;s[r]=t[r]}return s}var m=class{constructor(t,e,s){this.line=void 0,this.column=void 0,this.index=void 0,this.line=t,this.column=e,this.index=s}},x=class{constructor(t,e){this.start=void 0,this.end=void 0,this.filename=void 0,this.identifierName=void 0,this.start=t,this.end=e}};function f(t,e){let{line:s,column:r,index:i}=t;return new m(s,r+e,i+e)}var E="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED",w={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:E},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:E}},F={ArrayPattern:"array destructuring pattern",AssignmentExpression:"assignment expression",AssignmentPattern:"assignment expression",ArrowFunctionExpression:"arrow function expression",ConditionalExpression:"conditional expression",CatchClause:"catch clause",ForOfStatement:"for-of statement",ForInStatement:"for-in statement",ForStatement:"for-loop",FormalParameters:"function parameter list",Identifier:"identifier",ImportSpecifier:"import specifier",ImportDefaultSpecifier:"import default specifier",ImportNamespaceSpecifier:"import namespace specifier",ObjectPattern:"object destructuring pattern",ParenthesizedExpression:"parenthesized expression",RestElement:"rest element",UpdateExpression:{true:"prefix operation",false:"postfix operation"},VariableDeclarator:"variable declaration",YieldExpression:"yield expression"},R=t=>t.type==="UpdateExpression"?F.UpdateExpression[`${t.prefix}`]:F[t.type],we={AccessorIsGenerator:({kind:t})=>`A ${t}ter cannot be a generator.`,ArgumentsInClass:"'arguments' is only allowed in functions and class methods.",AsyncFunctionInSingleStatementContext:"Async functions can only be declared at the top level or inside a block.",AwaitBindingIdentifier:"Can not use 'await' as identifier inside an async function.",AwaitBindingIdentifierInStaticBlock:"Can not use 'await' as identifier inside a static block.",AwaitExpressionFormalParameter:"'await' is not allowed in async function parameters.",AwaitUsingNotInAsyncContext:"'await using' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncContext:"'await' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncFunction:"'await' is only allowed within async functions.",BadGetterArity:"A 'get' accessor must not have any formal parameters.",BadSetterArity:"A 'set' accessor must have exactly one formal parameter.",BadSetterRestParameter:"A 'set' accessor function argument must not be a rest parameter.",ConstructorClassField:"Classes may not have a field named 'constructor'.",ConstructorClassPrivateField:"Classes may not have a private field named '#constructor'.",ConstructorIsAccessor:"Class constructor may not be an accessor.",ConstructorIsAsync:"Constructor can't be an async function.",ConstructorIsGenerator:"Constructor can't be a generator.",DeclarationMissingInitializer:({kind:t})=>`Missing initializer in ${t} declaration.`,DecoratorArgumentsOutsideParentheses:"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",DecoratorBeforeExport:"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",DecoratorsBeforeAfterExport:"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",DecoratorExportClass:"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",DecoratorSemicolon:"Decorators must not be followed by a semicolon.",DecoratorStaticBlock:"Decorators can't be used with a static block.",DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:"Deleting a private field is not allowed.",DestructureNamedImport:"ES2015 named imports do not destructure. Use another statement for destructuring after the import.",DuplicateConstructor:"Duplicate constructor in the same class.",DuplicateDefaultExport:"Only one default export allowed per module.",DuplicateExport:({exportName:t})=>`\`${t}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",DynamicImportPhaseRequiresImportExpressions:({phase:t})=>`'import.${t}(...)' can only be parsed when using the 'createImportExpressions' option.`,ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:t,exportName:e})=>`A string literal cannot be used as an exported binding without \`from\`. +- Did you mean \`export { '${t}' as '${e}' } from 'some-module'\`?`,ExportDefaultFromAsIdentifier:"'from' is not allowed as an identifier after 'export default'.",ForInOfLoopInitializer:({type:t})=>`'${t==="ForInStatement"?"for-in":"for-of"}' loop variable declaration may not have an initializer.`,ForInUsing:"For-in loop may not start with 'using' declaration.",ForOfAsync:"The left-hand side of a for-of loop may not be 'async'.",ForOfLet:"The left-hand side of a for-of loop may not start with 'let'.",GeneratorInSingleStatementContext:"Generators can only be declared at the top level or inside a block.",IllegalBreakContinue:({type:t})=>`Unsyntactic ${t==="BreakStatement"?"break":"continue"}.`,IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list.",IllegalReturn:"'return' outside of function.",ImportAttributesUseAssert:"The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedImportAssert` parser plugin to suppress this error.",ImportBindingIsString:({importName:t})=>`A string literal cannot be used as an imported binding. +- Did you mean \`import { "${t}" as foo }\`?`,ImportCallArity:"`import()` requires exactly one or two arguments.",ImportCallNotNewExpression:"Cannot use new with import(...).",ImportCallSpreadArgument:"`...` is not allowed in `import()`.",ImportJSONBindingNotDefault:"A JSON module can only be imported with `default`.",ImportReflectionHasAssertion:"`import module x` cannot have assertions.",ImportReflectionNotBinding:'Only `import module x from "./module"` is valid.',IncompatibleRegExpUVFlags:"The 'u' and 'v' regular expression flags cannot be enabled at the same time.",InvalidBigIntLiteral:"Invalid BigIntLiteral.",InvalidCodePoint:"Code point out of bounds.",InvalidCoverInitializedName:"Invalid shorthand property initializer.",InvalidDecimal:"Invalid decimal.",InvalidDigit:({radix:t})=>`Expected number in radix ${t}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:t})=>`Escape sequence in keyword ${t}.`,InvalidIdentifier:({identifierName:t})=>`Invalid identifier ${t}.`,InvalidLhs:({ancestor:t})=>`Invalid left-hand side in ${R(t)}.`,InvalidLhsBinding:({ancestor:t})=>`Binding invalid left-hand side in ${R(t)}.`,InvalidLhsOptionalChaining:({ancestor:t})=>`Invalid optional chaining in the left-hand side of ${R(t)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:t})=>`Unexpected character '${t}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:t})=>`Private name #${t} is not defined.`,InvalidPropertyBindingPattern:"Binding member expression.",InvalidRecordProperty:"Only properties and spread elements are allowed in record definitions.",InvalidRestAssignmentPattern:"Invalid rest operator's argument.",LabelRedeclaration:({labelName:t})=>`Label '${t}' is already declared.`,LetInLexicalBinding:"'let' is disallowed as a lexically bound name.",LineTerminatorBeforeArrow:"No line break is allowed before '=>'.",MalformedRegExpFlags:"Invalid regular expression flag.",MissingClassName:"A class name is required.",MissingEqInAssignment:"Only '=' operator can be used for specifying default value.",MissingSemicolon:"Missing semicolon.",MissingPlugin:({missingPlugin:t})=>`This experimental syntax requires enabling the parser plugin: ${t.map(e=>JSON.stringify(e)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:t})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${t.map(e=>JSON.stringify(e)).join(", ")}.`,MissingUnicodeEscape:"Expecting Unicode escape sequence \\uXXXX.",MixingCoalesceWithLogical:"Nullish coalescing operator(??) requires parens when mixing with logical operators.",ModuleAttributeDifferentFromType:"The only accepted module attribute is `type`.",ModuleAttributeInvalidValue:"Only string literals are allowed as module attribute values.",ModuleAttributesWithDuplicateKeys:({key:t})=>`Duplicate key "${t}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:t})=>`An export name cannot include a lone surrogate, found '\\u${t.toString(16)}'.`,ModuleExportUndefined:({localName:t})=>`Export '${t}' is not defined.`,MultipleDefaultsInSwitch:"Multiple default clauses.",NewlineAfterThrow:"Illegal newline after throw.",NoCatchOrFinally:"Missing catch or finally clause.",NumberIdentifier:"Identifier directly after number.",NumericSeparatorInEscapeSequence:"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",ObsoleteAwaitStar:"'await*' has been removed from the async functions proposal. Use Promise.all() instead.",OptionalChainingNoNew:"Constructors in/after an Optional Chain are not allowed.",OptionalChainingNoTemplate:"Tagged Template Literals are not allowed in optionalChain.",OverrideOnConstructor:"'override' modifier cannot appear on a constructor declaration.",ParamDupe:"Argument name clash.",PatternHasAccessor:"Object pattern can't contain getter or setter.",PatternHasMethod:"Object pattern can't contain methods.",PrivateInExpectedIn:({identifierName:t})=>`Private names are only allowed in property accesses (\`obj.#${t}\`) or in \`in\` expressions (\`#${t} in obj\`).`,PrivateNameRedeclaration:({identifierName:t})=>`Duplicate private name #${t}.`,RecordExpressionBarIncorrectEndSyntaxType:"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionBarIncorrectStartSyntaxType:"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionHashIncorrectStartSyntaxType:"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",RecordNoProto:"'__proto__' is not allowed in Record expressions.",RestTrailingComma:"Unexpected trailing comma after rest element.",SloppyFunction:"In non-strict mode code, functions can only be declared at top level or inside a block.",SloppyFunctionAnnexB:"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",SourcePhaseImportRequiresDefault:'Only `import source x from "./module"` is valid.',StaticPrototype:"Classes may not have static property named prototype.",SuperNotAllowed:"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",SuperPrivateField:"Private fields can't be accessed on super.",TrailingDecorator:"Decorators must be attached to a class element.",TupleExpressionBarIncorrectEndSyntaxType:"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionBarIncorrectStartSyntaxType:"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionHashIncorrectStartSyntaxType:"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",UnexpectedArgumentPlaceholder:"Unexpected argument placeholder.",UnexpectedAwaitAfterPipelineBody:'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',UnexpectedDigitAfterHash:"Unexpected digit after hash token.",UnexpectedImportExport:"'import' and 'export' may only appear at the top level.",UnexpectedKeyword:({keyword:t})=>`Unexpected keyword '${t}'.`,UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",UnexpectedLexicalDeclaration:"Lexical declaration cannot appear in a single-statement context.",UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:"A numeric separator is only allowed between two digits.",UnexpectedPrivateField:"Unexpected private name.",UnexpectedReservedWord:({reservedWord:t})=>`Unexpected reserved word '${t}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:t,unexpected:e})=>`Unexpected token${e?` '${e}'.`:""}${t?`, expected "${t}"`:""}`,UnexpectedTokenUnaryExponentiation:"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script`.",UnsupportedBind:"Binding should be performed on object property.",UnsupportedDecoratorExport:"A decorated export must export a class declaration.",UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:t,onlyValidPropertyName:e})=>`The only valid meta property for ${t} is ${t}.${e}.`,UnsupportedParameterDecorator:"Decorators cannot be used to decorate parameters.",UnsupportedPropertyDecorator:"Decorators cannot be used to decorate object literal properties.",UnsupportedSuper:"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",UnterminatedComment:"Unterminated comment.",UnterminatedRegExp:"Unterminated regular expression.",UnterminatedString:"Unterminated string constant.",UnterminatedTemplate:"Unterminated template.",UsingDeclarationExport:"Using declaration cannot be exported.",UsingDeclarationHasBindingPattern:"Using declaration cannot have destructuring patterns.",VarRedeclaration:({identifierName:t})=>`Identifier '${t}' has already been declared.`,YieldBindingIdentifier:"Can not use 'yield' as identifier inside a generator.",YieldInParameter:"Yield expression is not allowed in formal parameters.",ZeroDigitNumericSeparator:"Numeric separator can not be used after leading 0."},ss={StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:t})=>`Assigning to '${t}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:t})=>`Binding '${t}' in strict mode.`,StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block.",StrictNumericEscape:"The only valid numeric escape in strict mode is '\\0'.",StrictOctalLiteral:"Legacy octal literals are not allowed in strict mode.",StrictWith:"'with' in strict mode."},rs=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]),is={PipeBodyIsTighter:"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",PipeTopicRequiresHackPipes:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',PipeTopicUnbound:"Topic reference is unbound; it must be inside a pipe body.",PipeTopicUnconfiguredToken:({token:t})=>`Invalid topic token ${t}. In order to use ${t} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${t}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:t})=>`Hack-style pipe body cannot be an unparenthesized ${R({type:t})}; please wrap it in parentheses.`,PipelineBodyNoArrow:'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',PipelineBodySequenceExpression:"Pipeline body may not be a comma-separated sequence expression.",PipelineHeadSequenceExpression:"Pipeline head should not be a comma-separated sequence expression.",PipelineTopicUnused:"Pipeline is in topic style but does not use topic reference.",PrimaryTopicNotAllowed:"Topic reference was used in a lexical context without topic binding.",PrimaryTopicRequiresSmartPipeline:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'},as=["message"];function tt(t,e,s){Object.defineProperty(t,e,{enumerable:!1,configurable:!0,value:s})}function ns({toMessage:t,code:e,reasonCode:s,syntaxPlugin:r}){let i=s==="MissingPlugin"||s==="MissingOneOfPlugins";{let a={AccessorCannotDeclareThisParameter:"AccesorCannotDeclareThisParameter",AccessorCannotHaveTypeParameters:"AccesorCannotHaveTypeParameters",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference",SetAccessorCannotHaveOptionalParameter:"SetAccesorCannotHaveOptionalParameter",SetAccessorCannotHaveRestParameter:"SetAccesorCannotHaveRestParameter",SetAccessorCannotHaveReturnType:"SetAccesorCannotHaveReturnType"};a[s]&&(s=a[s])}return function a(n,o){let l=new SyntaxError;return l.code=e,l.reasonCode=s,l.loc=n,l.pos=n.index,l.syntaxPlugin=r,i&&(l.missingPlugin=o.missingPlugin),tt(l,"clone",function(h={}){var d;let{line:y,column:g,index:b}=(d=h.loc)!=null?d:n;return a(new m(y,g,b),Object.assign({},o,h.details))}),tt(l,"details",o),Object.defineProperty(l,"message",{configurable:!0,get(){let h=`${t(o)} (${n.line}:${n.column})`;return this.message=h,h},set(h){Object.defineProperty(this,"message",{value:h,writable:!0})}}),l}}function H(t,e){if(Array.isArray(t))return r=>H(r,t[0]);let s={};for(let r of Object.keys(t)){let i=t[r],a=typeof i=="string"?{message:()=>i}:typeof i=="function"?{message:i}:i,{message:n}=a,o=u(a,as),l=typeof n=="string"?()=>n:n;s[r]=ns(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:r,toMessage:l},e?{syntaxPlugin:e}:{},o))}return s}var c=Object.assign({},H(w),H(we),H(ss),H`pipelineOperator`(is)),{defineProperty:os}=Object,st=(t,e)=>{t&&os(t,e,{enumerable:!1,value:t[e]})};function ae(t){return st(t.loc.start,"index"),st(t.loc.end,"index"),t}var ls=t=>class extends t{parse(){let e=ae(super.parse());return this.options.tokens&&(e.tokens=e.tokens.map(ae)),e}parseRegExpLiteral({pattern:e,flags:s}){let r=null;try{r=new RegExp(e,s)}catch{}let i=this.estreeParseLiteral(r);return i.regex={pattern:e,flags:s},i}parseBigIntLiteral(e){let s;try{s=BigInt(e)}catch{s=null}let r=this.estreeParseLiteral(s);return r.bigint=String(r.value||e),r}parseDecimalLiteral(e){let s=this.estreeParseLiteral(null);return s.decimal=String(s.value||e),s}estreeParseLiteral(e){return this.parseLiteral(e,"Literal")}parseStringLiteral(e){return this.estreeParseLiteral(e)}parseNumericLiteral(e){return this.estreeParseLiteral(e)}parseNullLiteral(){return this.estreeParseLiteral(null)}parseBooleanLiteral(e){return this.estreeParseLiteral(e)}directiveToStmt(e){let s=e.value;delete e.value,s.type="Literal",s.raw=s.extra.raw,s.value=s.extra.expressionValue;let r=e;return r.type="ExpressionStatement",r.expression=s,r.directive=s.extra.rawValue,delete s.extra,r}initFunction(e,s){super.initFunction(e,s),e.expression=!1}checkDeclaration(e){e!=null&&this.isObjectProperty(e)?this.checkDeclaration(e.value):super.checkDeclaration(e)}getObjectOrClassMethodParams(e){return e.value.params}isValidDirective(e){var s;return e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&!((s=e.expression.extra)!=null&&s.parenthesized)}parseBlockBody(e,s,r,i,a){super.parseBlockBody(e,s,r,i,a);let n=e.directives.map(o=>this.directiveToStmt(o));e.body=n.concat(e.body),delete e.directives}pushClassMethod(e,s,r,i,a,n){this.parseMethod(s,r,i,a,n,"ClassMethod",!0),s.typeParameters&&(s.value.typeParameters=s.typeParameters,delete s.typeParameters),e.body.push(s)}parsePrivateName(){let e=super.parsePrivateName();return this.getPluginOption("estree","classFeatures")?this.convertPrivateNameToPrivateIdentifier(e):e}convertPrivateNameToPrivateIdentifier(e){let s=super.getPrivateNameSV(e);return e=e,delete e.id,e.name=s,e.type="PrivateIdentifier",e}isPrivateName(e){return this.getPluginOption("estree","classFeatures")?e.type==="PrivateIdentifier":super.isPrivateName(e)}getPrivateNameSV(e){return this.getPluginOption("estree","classFeatures")?e.name:super.getPrivateNameSV(e)}parseLiteral(e,s){let r=super.parseLiteral(e,s);return r.raw=r.extra.raw,delete r.extra,r}parseFunctionBody(e,s,r=!1){super.parseFunctionBody(e,s,r),e.expression=e.body.type!=="BlockStatement"}parseMethod(e,s,r,i,a,n,o=!1){let l=this.startNode();return l.kind=e.kind,l=super.parseMethod(l,s,r,i,a,n,o),l.type="FunctionExpression",delete l.kind,e.value=l,n==="ClassPrivateMethod"&&(e.computed=!1),this.finishNode(e,"MethodDefinition")}nameIsConstructor(e){return e.type==="Literal"?e.value==="constructor":super.nameIsConstructor(e)}parseClassProperty(...e){let s=super.parseClassProperty(...e);return this.getPluginOption("estree","classFeatures")&&(s.type="PropertyDefinition"),s}parseClassPrivateProperty(...e){let s=super.parseClassPrivateProperty(...e);return this.getPluginOption("estree","classFeatures")&&(s.type="PropertyDefinition",s.computed=!1),s}parseObjectMethod(e,s,r,i,a){let n=super.parseObjectMethod(e,s,r,i,a);return n&&(n.type="Property",n.kind==="method"&&(n.kind="init"),n.shorthand=!1),n}parseObjectProperty(e,s,r,i){let a=super.parseObjectProperty(e,s,r,i);return a&&(a.kind="init",a.type="Property"),a}isValidLVal(e,s,r){return e==="Property"?"value":super.isValidLVal(e,s,r)}isAssignable(e,s){return e!=null&&this.isObjectProperty(e)?this.isAssignable(e.value,s):super.isAssignable(e,s)}toAssignable(e,s=!1){if(e!=null&&this.isObjectProperty(e)){let{key:r,value:i}=e;this.isPrivateName(r)&&this.classScope.usePrivateName(this.getPrivateNameSV(r),r.loc.start),this.toAssignable(i,s)}else super.toAssignable(e,s)}toAssignableObjectExpressionProp(e,s,r){e.type==="Property"&&(e.kind==="get"||e.kind==="set")?this.raise(c.PatternHasAccessor,e.key):e.type==="Property"&&e.method?this.raise(c.PatternHasMethod,e.key):super.toAssignableObjectExpressionProp(e,s,r)}finishCallExpression(e,s){let r=super.finishCallExpression(e,s);if(r.callee.type==="Import"){var i,a;r.type="ImportExpression",r.source=r.arguments[0],r.options=(i=r.arguments[1])!=null?i:null,r.attributes=(a=r.arguments[1])!=null?a:null,delete r.arguments,delete r.callee}return r}toReferencedArguments(e){e.type!=="ImportExpression"&&super.toReferencedArguments(e)}parseExport(e,s){let r=this.state.lastTokStartLoc,i=super.parseExport(e,s);switch(i.type){case"ExportAllDeclaration":i.exported=null;break;case"ExportNamedDeclaration":i.specifiers.length===1&&i.specifiers[0].type==="ExportNamespaceSpecifier"&&(i.type="ExportAllDeclaration",i.exported=i.specifiers[0].exported,delete i.specifiers);case"ExportDefaultDeclaration":{var a;let{declaration:n}=i;(n==null?void 0:n.type)==="ClassDeclaration"&&((a=n.decorators)==null?void 0:a.length)>0&&n.start===i.start&&this.resetStartLocation(i,r)}break}return i}parseSubscript(e,s,r,i){let a=super.parseSubscript(e,s,r,i);if(i.optionalChainMember){if((a.type==="OptionalMemberExpression"||a.type==="OptionalCallExpression")&&(a.type=a.type.substring(8)),i.stop){let n=this.startNodeAtNode(a);return n.expression=a,this.finishNode(n,"ChainExpression")}}else(a.type==="MemberExpression"||a.type==="CallExpression")&&(a.optional=!1);return a}isOptionalMemberExpression(e){return e.type==="ChainExpression"?e.expression.type==="MemberExpression":super.isOptionalMemberExpression(e)}hasPropertyAsPrivateName(e){return e.type==="ChainExpression"&&(e=e.expression),super.hasPropertyAsPrivateName(e)}isObjectProperty(e){return e.type==="Property"&&e.kind==="init"&&!e.method}isObjectMethod(e){return e.type==="Property"&&(e.method||e.kind==="get"||e.kind==="set")}finishNodeAt(e,s,r){return ae(super.finishNodeAt(e,s,r))}resetStartLocation(e,s){super.resetStartLocation(e,s),ae(e)}resetEndLocation(e,s=this.state.lastTokEndLoc){super.resetEndLocation(e,s),ae(e)}},ne=class{constructor(t,e){this.token=void 0,this.preserveSpace=void 0,this.token=t,this.preserveSpace=!!e}},M={brace:new ne("{"),j_oTag:new ne("...",!0)};M.template=new ne("`",!0);var C=!0,P=!0,Ce=!0,oe=!0,J=!0,hs=!0,rt=class{constructor(t,e={}){this.label=void 0,this.keyword=void 0,this.beforeExpr=void 0,this.startsExpr=void 0,this.rightAssociative=void 0,this.isLoop=void 0,this.isAssign=void 0,this.prefix=void 0,this.postfix=void 0,this.binop=void 0,this.label=t,this.keyword=e.keyword,this.beforeExpr=!!e.beforeExpr,this.startsExpr=!!e.startsExpr,this.rightAssociative=!!e.rightAssociative,this.isLoop=!!e.isLoop,this.isAssign=!!e.isAssign,this.prefix=!!e.prefix,this.postfix=!!e.postfix,this.binop=e.binop!=null?e.binop:null,this.updateContext=null}},Ie=new Map;function v(t,e={}){e.keyword=t;let s=A(t,e);return Ie.set(t,s),s}function B(t,e){return A(t,{beforeExpr:C,binop:e})}var le=-1,z=[],Ne=[],ve=[],ke=[],Le=[],Me=[];function A(t,e={}){var s,r,i,a;return++le,Ne.push(t),ve.push((s=e.binop)!=null?s:-1),ke.push((r=e.beforeExpr)!=null?r:!1),Le.push((i=e.startsExpr)!=null?i:!1),Me.push((a=e.prefix)!=null?a:!1),z.push(new rt(t,e)),le}function I(t,e={}){var s,r,i,a;return++le,Ie.set(t,le),Ne.push(t),ve.push((s=e.binop)!=null?s:-1),ke.push((r=e.beforeExpr)!=null?r:!1),Le.push((i=e.startsExpr)!=null?i:!1),Me.push((a=e.prefix)!=null?a:!1),z.push(new rt("name",e)),le}var ps={bracketL:A("[",{beforeExpr:C,startsExpr:P}),bracketHashL:A("#[",{beforeExpr:C,startsExpr:P}),bracketBarL:A("[|",{beforeExpr:C,startsExpr:P}),bracketR:A("]"),bracketBarR:A("|]"),braceL:A("{",{beforeExpr:C,startsExpr:P}),braceBarL:A("{|",{beforeExpr:C,startsExpr:P}),braceHashL:A("#{",{beforeExpr:C,startsExpr:P}),braceR:A("}"),braceBarR:A("|}"),parenL:A("(",{beforeExpr:C,startsExpr:P}),parenR:A(")"),comma:A(",",{beforeExpr:C}),semi:A(";",{beforeExpr:C}),colon:A(":",{beforeExpr:C}),doubleColon:A("::",{beforeExpr:C}),dot:A("."),question:A("?",{beforeExpr:C}),questionDot:A("?."),arrow:A("=>",{beforeExpr:C}),template:A("template"),ellipsis:A("...",{beforeExpr:C}),backQuote:A("`",{startsExpr:P}),dollarBraceL:A("${",{beforeExpr:C,startsExpr:P}),templateTail:A("...`",{startsExpr:P}),templateNonTail:A("...${",{beforeExpr:C,startsExpr:P}),at:A("@"),hash:A("#",{startsExpr:P}),interpreterDirective:A("#!..."),eq:A("=",{beforeExpr:C,isAssign:oe}),assign:A("_=",{beforeExpr:C,isAssign:oe}),slashAssign:A("_=",{beforeExpr:C,isAssign:oe}),xorAssign:A("_=",{beforeExpr:C,isAssign:oe}),moduloAssign:A("_=",{beforeExpr:C,isAssign:oe}),incDec:A("++/--",{prefix:J,postfix:hs,startsExpr:P}),bang:A("!",{beforeExpr:C,prefix:J,startsExpr:P}),tilde:A("~",{beforeExpr:C,prefix:J,startsExpr:P}),doubleCaret:A("^^",{startsExpr:P}),doubleAt:A("@@",{startsExpr:P}),pipeline:B("|>",0),nullishCoalescing:B("??",1),logicalOR:B("||",1),logicalAND:B("&&",2),bitwiseOR:B("|",3),bitwiseXOR:B("^",4),bitwiseAND:B("&",5),equality:B("==/!=/===/!==",6),lt:B("/<=/>=",7),gt:B("/<=/>=",7),relational:B("/<=/>=",7),bitShift:B("<>/>>>",8),bitShiftL:B("<>/>>>",8),bitShiftR:B("<>/>>>",8),plusMin:A("+/-",{beforeExpr:C,binop:9,prefix:J,startsExpr:P}),modulo:A("%",{binop:10,startsExpr:P}),star:A("*",{binop:10}),slash:B("/",10),exponent:A("**",{beforeExpr:C,binop:11,rightAssociative:!0}),_in:v("in",{beforeExpr:C,binop:7}),_instanceof:v("instanceof",{beforeExpr:C,binop:7}),_break:v("break"),_case:v("case",{beforeExpr:C}),_catch:v("catch"),_continue:v("continue"),_debugger:v("debugger"),_default:v("default",{beforeExpr:C}),_else:v("else",{beforeExpr:C}),_finally:v("finally"),_function:v("function",{startsExpr:P}),_if:v("if"),_return:v("return",{beforeExpr:C}),_switch:v("switch"),_throw:v("throw",{beforeExpr:C,prefix:J,startsExpr:P}),_try:v("try"),_var:v("var"),_const:v("const"),_with:v("with"),_new:v("new",{beforeExpr:C,startsExpr:P}),_this:v("this",{startsExpr:P}),_super:v("super",{startsExpr:P}),_class:v("class",{startsExpr:P}),_extends:v("extends",{beforeExpr:C}),_export:v("export"),_import:v("import",{startsExpr:P}),_null:v("null",{startsExpr:P}),_true:v("true",{startsExpr:P}),_false:v("false",{startsExpr:P}),_typeof:v("typeof",{beforeExpr:C,prefix:J,startsExpr:P}),_void:v("void",{beforeExpr:C,prefix:J,startsExpr:P}),_delete:v("delete",{beforeExpr:C,prefix:J,startsExpr:P}),_do:v("do",{isLoop:Ce,beforeExpr:C}),_for:v("for",{isLoop:Ce}),_while:v("while",{isLoop:Ce}),_as:I("as",{startsExpr:P}),_assert:I("assert",{startsExpr:P}),_async:I("async",{startsExpr:P}),_await:I("await",{startsExpr:P}),_defer:I("defer",{startsExpr:P}),_from:I("from",{startsExpr:P}),_get:I("get",{startsExpr:P}),_let:I("let",{startsExpr:P}),_meta:I("meta",{startsExpr:P}),_of:I("of",{startsExpr:P}),_sent:I("sent",{startsExpr:P}),_set:I("set",{startsExpr:P}),_source:I("source",{startsExpr:P}),_static:I("static",{startsExpr:P}),_using:I("using",{startsExpr:P}),_yield:I("yield",{startsExpr:P}),_asserts:I("asserts",{startsExpr:P}),_checks:I("checks",{startsExpr:P}),_exports:I("exports",{startsExpr:P}),_global:I("global",{startsExpr:P}),_implements:I("implements",{startsExpr:P}),_intrinsic:I("intrinsic",{startsExpr:P}),_infer:I("infer",{startsExpr:P}),_is:I("is",{startsExpr:P}),_mixins:I("mixins",{startsExpr:P}),_proto:I("proto",{startsExpr:P}),_require:I("require",{startsExpr:P}),_satisfies:I("satisfies",{startsExpr:P}),_keyof:I("keyof",{startsExpr:P}),_readonly:I("readonly",{startsExpr:P}),_unique:I("unique",{startsExpr:P}),_abstract:I("abstract",{startsExpr:P}),_declare:I("declare",{startsExpr:P}),_enum:I("enum",{startsExpr:P}),_module:I("module",{startsExpr:P}),_namespace:I("namespace",{startsExpr:P}),_interface:I("interface",{startsExpr:P}),_type:I("type",{startsExpr:P}),_opaque:I("opaque",{startsExpr:P}),name:A("name",{startsExpr:P}),placeholder:A("%%",{startsExpr:!0}),string:A("string",{startsExpr:P}),num:A("num",{startsExpr:P}),bigint:A("bigint",{startsExpr:P}),decimal:A("decimal",{startsExpr:P}),regexp:A("regexp",{startsExpr:P}),privateName:A("#name",{startsExpr:P}),eof:A("eof"),jsxName:A("jsxName"),jsxText:A("jsxText",{beforeExpr:!0}),jsxTagStart:A("jsxTagStart",{startsExpr:!0}),jsxTagEnd:A("jsxTagEnd")};function k(t){return t>=93&&t<=133}function cs(t){return t<=92}function U(t){return t>=58&&t<=133}function it(t){return t>=58&&t<=137}function us(t){return ke[t]}function De(t){return Le[t]}function ds(t){return t>=29&&t<=33}function at(t){return t>=129&&t<=131}function ms(t){return t>=90&&t<=92}function Oe(t){return t>=58&&t<=92}function fs(t){return t>=39&&t<=59}function ys(t){return t===34}function xs(t){return Me[t]}function Ps(t){return t>=121&&t<=123}function gs(t){return t>=124&&t<=130}function W(t){return Ne[t]}function ye(t){return ve[t]}function Ts(t){return t===57}function xe(t){return t>=24&&t<=25}function V(t){return z[t]}z[8].updateContext=t=>{t.pop()},z[5].updateContext=z[7].updateContext=z[23].updateContext=t=>{t.push(M.brace)},z[22].updateContext=t=>{t[t.length-1]===M.template?t.pop():t.push(M.template)},z[143].updateContext=t=>{t.push(M.j_expr,M.j_oTag)};var Fe="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲊᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟍꟐꟑꟓꟕ-Ƛꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",nt="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࢗ-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",bs=new RegExp("["+Fe+"]"),As=new RegExp("["+Fe+nt+"]");Fe=nt=null;var ot=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],Ss=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239];function Be(t,e){let s=65536;for(let r=0,i=e.length;rt)return!1;if(s+=e[r+1],s>=t)return!0}return!1}function q(t){return t<65?t===36:t<=90?!0:t<97?t===95:t<=122?!0:t<=65535?t>=170&&bs.test(String.fromCharCode(t)):Be(t,ot)}function ee(t){return t<48?t===36:t<58?!0:t<65?!1:t<=90?!0:t<97?t===95:t<=122?!0:t<=65535?t>=170&&As.test(String.fromCharCode(t)):Be(t,ot)||Be(t,Ss)}var Re={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},Es=new Set(Re.keyword),ws=new Set(Re.strict),Cs=new Set(Re.strictBind);function lt(t,e){return e&&t==="await"||t==="enum"}function ht(t,e){return lt(t,e)||ws.has(t)}function pt(t){return Cs.has(t)}function ct(t,e){return ht(t,e)||pt(t)}function Is(t){return Es.has(t)}function Ns(t,e,s){return t===64&&e===64&&q(s)}var vs=new Set(["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete","implements","interface","let","package","private","protected","public","static","yield","eval","arguments","enum","await"]);function ks(t){return vs.has(t)}var je=class{constructor(t){this.flags=0,this.names=new Map,this.firstLexicalName="",this.flags=t}},Ue=class{constructor(t,e){this.parser=void 0,this.scopeStack=[],this.inModule=void 0,this.undefinedExports=new Map,this.parser=t,this.inModule=e}get inTopLevel(){return(this.currentScope().flags&1)>0}get inFunction(){return(this.currentVarScopeFlags()&2)>0}get allowSuper(){return(this.currentThisScopeFlags()&16)>0}get allowDirectSuper(){return(this.currentThisScopeFlags()&32)>0}get inClass(){return(this.currentThisScopeFlags()&64)>0}get inClassAndNotInNonArrowFunction(){let t=this.currentThisScopeFlags();return(t&64)>0&&(t&2)===0}get inStaticBlock(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&128)return!0;if(e&451)return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&2)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(t){return new je(t)}enter(t){this.scopeStack.push(this.createScope(t))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(t){return!!(t.flags&130||!this.parser.inModule&&t.flags&1)}declareName(t,e,s){let r=this.currentScope();if(e&8||e&16){this.checkRedeclarationInScope(r,t,e,s);let i=r.names.get(t)||0;e&16?i=i|4:(r.firstLexicalName||(r.firstLexicalName=t),i=i|2),r.names.set(t,i),e&8&&this.maybeExportDefined(r,t)}else if(e&4)for(let i=this.scopeStack.length-1;i>=0&&(r=this.scopeStack[i],this.checkRedeclarationInScope(r,t,e,s),r.names.set(t,(r.names.get(t)||0)|1),this.maybeExportDefined(r,t),!(r.flags&387));--i);this.parser.inModule&&r.flags&1&&this.undefinedExports.delete(t)}maybeExportDefined(t,e){this.parser.inModule&&t.flags&1&&this.undefinedExports.delete(e)}checkRedeclarationInScope(t,e,s,r){this.isRedeclaredInScope(t,e,s)&&this.parser.raise(c.VarRedeclaration,r,{identifierName:e})}isRedeclaredInScope(t,e,s){if(!(s&1))return!1;if(s&8)return t.names.has(e);let r=t.names.get(e);return s&16?(r&2)>0||!this.treatFunctionsAsVarInScope(t)&&(r&1)>0:(r&2)>0&&!(t.flags&8&&t.firstLexicalName===e)||!this.treatFunctionsAsVarInScope(t)&&(r&4)>0}checkLocalExport(t){let{name:e}=t;this.scopeStack[0].names.has(e)||this.undefinedExports.set(e,t.loc.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&387)return e}}currentThisScopeFlags(){for(let t=this.scopeStack.length-1;;t--){let{flags:e}=this.scopeStack[t];if(e&451&&!(e&4))return e}}},Ls=class extends je{constructor(...t){super(...t),this.declareFunctions=new Set}},Ms=class extends Ue{createScope(t){return new Ls(t)}declareName(t,e,s){let r=this.currentScope();if(e&2048){this.checkRedeclarationInScope(r,t,e,s),this.maybeExportDefined(r,t),r.declareFunctions.add(t);return}super.declareName(t,e,s)}isRedeclaredInScope(t,e,s){if(super.isRedeclaredInScope(t,e,s))return!0;if(s&2048&&!t.declareFunctions.has(e)){let r=t.names.get(e);return(r&4)>0||(r&2)>0}return!1}checkLocalExport(t){this.scopeStack[0].declareFunctions.has(t.name)||super.checkLocalExport(t)}},Ds=class{constructor(){this.sawUnambiguousESM=!1,this.ambiguousScriptDifferentAst=!1}sourceToOffsetPos(t){return t+this.startIndex}offsetToSourcePos(t){return t-this.startIndex}hasPlugin(t){if(typeof t=="string")return this.plugins.has(t);{let[e,s]=t;if(!this.hasPlugin(e))return!1;let r=this.plugins.get(e);for(let i of Object.keys(s))if((r==null?void 0:r[i])!==s[i])return!1;return!0}}getPluginOption(t,e){var s;return(s=this.plugins.get(t))==null?void 0:s[e]}};function ut(t,e){t.trailingComments===void 0?t.trailingComments=e:t.trailingComments.unshift(...e)}function Os(t,e){t.leadingComments===void 0?t.leadingComments=e:t.leadingComments.unshift(...e)}function he(t,e){t.innerComments===void 0?t.innerComments=e:t.innerComments.unshift(...e)}function pe(t,e,s){let r=null,i=e.length;for(;r===null&&i>0;)r=e[--i];r===null||r.start>s.start?he(t,s.comments):ut(r,s.comments)}var Fs=class extends Ds{addComment(t){this.filename&&(t.loc.filename=this.filename);let{commentsLen:e}=this.state;this.comments.length!==e&&(this.comments.length=e),this.comments.push(t),this.state.commentsLen++}processComment(t){let{commentStack:e}=this.state,s=e.length;if(s===0)return;let r=s-1,i=e[r];i.start===t.end&&(i.leadingNode=t,r--);let{start:a}=t;for(;r>=0;r--){let n=e[r],o=n.end;if(o>a)n.containingNode=t,this.finalizeComment(n),e.splice(r,1);else{o===a&&(n.trailingNode=t);break}}}finalizeComment(t){let{comments:e}=t;if(t.leadingNode!==null||t.trailingNode!==null)t.leadingNode!==null&&ut(t.leadingNode,e),t.trailingNode!==null&&Os(t.trailingNode,e);else{let{containingNode:s,start:r}=t;if(this.input.charCodeAt(this.offsetToSourcePos(r)-1)===44)switch(s.type){case"ObjectExpression":case"ObjectPattern":case"RecordExpression":pe(s,s.properties,t);break;case"CallExpression":case"OptionalCallExpression":pe(s,s.arguments,t);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":pe(s,s.params,t);break;case"ArrayExpression":case"ArrayPattern":case"TupleExpression":pe(s,s.elements,t);break;case"ExportNamedDeclaration":case"ImportDeclaration":pe(s,s.specifiers,t);break;default:he(s,e)}else he(s,e)}}finalizeRemainingComments(){let{commentStack:t}=this.state;for(let e=t.length-1;e>=0;e--)this.finalizeComment(t[e]);this.state.commentStack=[]}resetPreviousNodeTrailingComments(t){let{commentStack:e}=this.state,{length:s}=e;if(s===0)return;let r=e[s-1];r.leadingNode===t&&(r.leadingNode=null)}resetPreviousIdentifierLeadingComments(t){let{commentStack:e}=this.state,{length:s}=e;s!==0&&(e[s-1].trailingNode===t?e[s-1].trailingNode=null:s>=2&&e[s-2].trailingNode===t&&(e[s-2].trailingNode=null))}takeSurroundingComments(t,e,s){let{commentStack:r}=this.state,i=r.length;if(i===0)return;let a=i-1;for(;a>=0;a--){let n=r[a],o=n.end;if(n.start===s)n.leadingNode=t;else if(o===e)n.trailingNode=t;else if(o0}set strict(e){e?this.flags|=1:this.flags&=-2}init({strictMode:e,sourceType:s,startIndex:r,startLine:i,startColumn:a}){this.strict=e===!1?!1:e===!0?!0:s==="module",this.startIndex=r,this.curLine=i,this.lineStart=-a,this.startLoc=this.endLoc=new m(i,a,r)}get maybeInArrowParameters(){return(this.flags&2)>0}set maybeInArrowParameters(e){e?this.flags|=2:this.flags&=-3}get inType(){return(this.flags&4)>0}set inType(e){e?this.flags|=4:this.flags&=-5}get noAnonFunctionType(){return(this.flags&8)>0}set noAnonFunctionType(e){e?this.flags|=8:this.flags&=-9}get hasFlowComment(){return(this.flags&16)>0}set hasFlowComment(e){e?this.flags|=16:this.flags&=-17}get isAmbientContext(){return(this.flags&32)>0}set isAmbientContext(e){e?this.flags|=32:this.flags&=-33}get inAbstractClass(){return(this.flags&64)>0}set inAbstractClass(e){e?this.flags|=64:this.flags&=-65}get inDisallowConditionalTypesContext(){return(this.flags&128)>0}set inDisallowConditionalTypesContext(e){e?this.flags|=128:this.flags&=-129}get soloAwait(){return(this.flags&256)>0}set soloAwait(e){e?this.flags|=256:this.flags&=-257}get inFSharpPipelineDirectBody(){return(this.flags&512)>0}set inFSharpPipelineDirectBody(e){e?this.flags|=512:this.flags&=-513}get canStartJSXElement(){return(this.flags&1024)>0}set canStartJSXElement(e){e?this.flags|=1024:this.flags&=-1025}get containsEsc(){return(this.flags&2048)>0}set containsEsc(e){e?this.flags|=2048:this.flags&=-2049}get hasTopLevelAwait(){return(this.flags&4096)>0}set hasTopLevelAwait(e){e?this.flags|=4096:this.flags&=-4097}curPosition(){return new m(this.curLine,this.pos-this.lineStart,this.pos+this.startIndex)}clone(){let e=new $t;return e.flags=this.flags,e.startIndex=this.startIndex,e.curLine=this.curLine,e.lineStart=this.lineStart,e.startLoc=this.startLoc,e.endLoc=this.endLoc,e.errors=this.errors.slice(),e.potentialArrowAt=this.potentialArrowAt,e.noArrowAt=this.noArrowAt.slice(),e.noArrowParamsConversionAt=this.noArrowParamsConversionAt.slice(),e.topicContext=this.topicContext,e.labels=this.labels.slice(),e.commentsLen=this.commentsLen,e.commentStack=this.commentStack.slice(),e.pos=this.pos,e.type=this.type,e.value=this.value,e.start=this.start,e.end=this.end,e.lastTokEndLoc=this.lastTokEndLoc,e.lastTokStartLoc=this.lastTokStartLoc,e.context=this.context.slice(),e.firstInvalidTemplateEscapePos=this.firstInvalidTemplateEscapePos,e.strictErrors=this.strictErrors,e.tokensLength=this.tokensLength,e}},Us=function(t){return t>=48&&t<=57},mt={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},ge={bin:t=>t===48||t===49,oct:t=>t>=48&&t<=55,dec:t=>t>=48&&t<=57,hex:t=>t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102};function ft(t,e,s,r,i,a){let n=s,o=r,l=i,h="",d=null,y=s,{length:g}=e;for(;;){if(s>=g){a.unterminated(n,o,l),h+=e.slice(y,s);break}let b=e.charCodeAt(s);if(_s(t,b,e,s)){h+=e.slice(y,s);break}if(b===92){h+=e.slice(y,s);let N=Hs(e,s,r,i,t==="template",a);N.ch===null&&!d?d={pos:s,lineStart:r,curLine:i}:h+=N.ch,{pos:s,lineStart:r,curLine:i}=N,y=s}else b===8232||b===8233?(++s,++i,r=s):b===10||b===13?t==="template"?(h+=e.slice(y,s)+` +`,++s,b===13&&e.charCodeAt(s)===10&&++s,++i,y=r=s):a.unterminated(n,o,l):++s}return{pos:s,str:h,firstInvalidLoc:d,lineStart:r,curLine:i,containsInvalid:!!d}}function _s(t,e,s,r){return t==="template"?e===96||e===36&&s.charCodeAt(r+1)===123:e===(t==="double"?34:39)}function Hs(t,e,s,r,i,a){let n=!i;e++;let o=h=>({pos:e,ch:h,lineStart:s,curLine:r}),l=t.charCodeAt(e++);switch(l){case 110:return o(` +`);case 114:return o("\r");case 120:{let h;return{code:h,pos:e}=ze(t,e,s,r,2,!1,n,a),o(h===null?null:String.fromCharCode(h))}case 117:{let h;return{code:h,pos:e}=xt(t,e,s,r,n,a),o(h===null?null:String.fromCodePoint(h))}case 116:return o(" ");case 98:return o("\b");case 118:return o("\v");case 102:return o("\f");case 13:t.charCodeAt(e)===10&&++e;case 10:s=e,++r;case 8232:case 8233:return o("");case 56:case 57:if(i)return o(null);a.strictNumericEscape(e-1,s,r);default:if(l>=48&&l<=55){let h=e-1,d=/^[0-7]+/.exec(t.slice(h,e+2))[0],y=parseInt(d,8);y>255&&(d=d.slice(0,-1),y=parseInt(d,8)),e+=d.length-1;let g=t.charCodeAt(e);if(d!=="0"||g===56||g===57){if(i)return o(null);a.strictNumericEscape(h,s,r)}return o(String.fromCharCode(y))}return o(String.fromCharCode(l))}}function ze(t,e,s,r,i,a,n,o){let l=e,h;return{n:h,pos:e}=yt(t,e,s,r,16,i,a,!1,o,!n),h===null&&(n?o.invalidEscapeSequence(l,s,r):e=l-1),{code:h,pos:e}}function yt(t,e,s,r,i,a,n,o,l,h){let d=e,y=i===16?mt.hex:mt.decBinOct,g=i===16?ge.hex:i===10?ge.dec:i===8?ge.oct:ge.bin,b=!1,N=0;for(let D=0,L=a??1/0;D=97?j=O-97+10:O>=65?j=O-65+10:Us(O)?j=O-48:j=1/0,j>=i){if(j<=9&&h)return{n:null,pos:e};if(j<=9&&l.invalidDigit(e,s,r,i))j=0;else if(n)j=0,b=!0;else break}++e,N=N*i+j}return e===d||a!=null&&e-d!==a||b?{n:null,pos:e}:{n:N,pos:e}}function xt(t,e,s,r,i,a){let n=t.charCodeAt(e),o;if(n===123){if(++e,{code:o,pos:e}=ze(t,e,s,r,t.indexOf("}",e)-e,!0,i,a),++e,o!==null&&o>1114111)if(i)a.invalidCodePoint(e,s,r);else return{code:null,pos:e}}else({code:o,pos:e}=ze(t,e,s,r,4,!1,i,a));return{code:o,pos:e}}function ce(t,e,s){return new m(s,t-e,t)}var zs=new Set([103,109,115,105,121,117,100,118]),X=class{constructor(t){let e=t.startIndex||0;this.type=t.type,this.value=t.value,this.start=e+t.start,this.end=e+t.end,this.loc=new x(t.startLoc,t.endLoc)}},Vs=class extends Fs{constructor(t,e){super(),this.isLookahead=void 0,this.tokens=[],this.errorHandlers_readInt={invalidDigit:(s,r,i,a)=>this.options.errorRecovery?(this.raise(c.InvalidDigit,ce(s,r,i),{radix:a}),!0):!1,numericSeparatorInEscapeSequence:this.errorBuilder(c.NumericSeparatorInEscapeSequence),unexpectedNumericSeparator:this.errorBuilder(c.UnexpectedNumericSeparator)},this.errorHandlers_readCodePoint=Object.assign({},this.errorHandlers_readInt,{invalidEscapeSequence:this.errorBuilder(c.InvalidEscapeSequence),invalidCodePoint:this.errorBuilder(c.InvalidCodePoint)}),this.errorHandlers_readStringContents_string=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:(s,r,i)=>{this.recordStrictModeErrors(c.StrictNumericEscape,ce(s,r,i))},unterminated:(s,r,i)=>{throw this.raise(c.UnterminatedString,ce(s-1,r,i))}}),this.errorHandlers_readStringContents_template=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:this.errorBuilder(c.StrictNumericEscape),unterminated:(s,r,i)=>{throw this.raise(c.UnterminatedTemplate,ce(s,r,i))}}),this.state=new js,this.state.init(t),this.input=e,this.length=e.length,this.comments=[],this.isLookahead=!1}pushToken(t){this.tokens.length=this.state.tokensLength,this.tokens.push(t),++this.state.tokensLength}next(){this.checkKeywordEscapes(),this.options.tokens&&this.pushToken(new X(this.state)),this.state.lastTokEndLoc=this.state.endLoc,this.state.lastTokStartLoc=this.state.startLoc,this.nextToken()}eat(t){return this.match(t)?(this.next(),!0):!1}match(t){return this.state.type===t}createLookaheadState(t){return{pos:t.pos,value:null,type:t.type,start:t.start,end:t.end,context:[this.curContext()],inType:t.inType,startLoc:t.startLoc,lastTokEndLoc:t.lastTokEndLoc,curLine:t.curLine,lineStart:t.lineStart,curPosition:t.curPosition}}lookahead(){let t=this.state;this.state=this.createLookaheadState(t),this.isLookahead=!0,this.nextToken(),this.isLookahead=!1;let e=this.state;return this.state=t,e}nextTokenStart(){return this.nextTokenStartSince(this.state.pos)}nextTokenStartSince(t){return _e.lastIndex=t,_e.test(this.input)?_e.lastIndex:t}lookaheadCharCode(){return this.input.charCodeAt(this.nextTokenStart())}nextTokenInLineStart(){return this.nextTokenInLineStartSince(this.state.pos)}nextTokenInLineStartSince(t){return He.lastIndex=t,He.test(this.input)?He.lastIndex:t}lookaheadInLineCharCode(){return this.input.charCodeAt(this.nextTokenInLineStart())}codePointAtPos(t){let e=this.input.charCodeAt(t);if((e&64512)===55296&&++tthis.raise(e,s)),this.state.strictErrors.clear())}curContext(){return this.state.context[this.state.context.length-1]}nextToken(){if(this.skipSpace(),this.state.start=this.state.pos,this.isLookahead||(this.state.startLoc=this.state.curPosition()),this.state.pos>=this.length){this.finishToken(140);return}this.getTokenFromCode(this.codePointAtPos(this.state.pos))}skipBlockComment(t){let e;this.isLookahead||(e=this.state.curPosition());let s=this.state.pos,r=this.input.indexOf(t,s+2);if(r===-1)throw this.raise(c.UnterminatedComment,this.state.curPosition());for(this.state.pos=r+t.length,Pe.lastIndex=s+2;Pe.test(this.input)&&Pe.lastIndex<=r;)++this.state.curLine,this.state.lineStart=Pe.lastIndex;if(this.isLookahead)return;let i={type:"CommentBlock",value:this.input.slice(s+2,r),start:this.sourceToOffsetPos(s),end:this.sourceToOffsetPos(r+t.length),loc:new x(e,this.state.curPosition())};return this.options.tokens&&this.pushToken(i),i}skipLineComment(t){let e=this.state.pos,s;this.isLookahead||(s=this.state.curPosition());let r=this.input.charCodeAt(this.state.pos+=t);if(this.state.post)){let i=this.skipLineComment(3);i!==void 0&&(this.addComment(i),this.options.attachComment&&e.push(i))}else break e}else if(s===60&&!this.inModule&&this.options.annexB){let r=this.state.pos;if(this.input.charCodeAt(r+1)===33&&this.input.charCodeAt(r+2)===45&&this.input.charCodeAt(r+3)===45){let i=this.skipLineComment(4);i!==void 0&&(this.addComment(i),this.options.attachComment&&e.push(i))}else break e}else break e}}if(e.length>0){let s=this.state.pos,r={start:this.sourceToOffsetPos(t),end:this.sourceToOffsetPos(s),comments:e,leadingNode:null,trailingNode:null,containingNode:null};this.state.commentStack.push(r)}}finishToken(t,e){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();let s=this.state.type;this.state.type=t,this.state.value=e,this.isLookahead||this.updateContext(s)}replaceToken(t){this.state.type=t,this.updateContext()}readToken_numberSign(){if(this.state.pos===0&&this.readToken_interpreter())return;let t=this.state.pos+1,e=this.codePointAtPos(t);if(e>=48&&e<=57)throw this.raise(c.UnexpectedDigitAfterHash,this.state.curPosition());if(e===123||e===91&&this.hasPlugin("recordAndTuple")){if(this.expectPlugin("recordAndTuple"),this.getPluginOption("recordAndTuple","syntaxType")==="bar")throw this.raise(e===123?c.RecordExpressionHashIncorrectStartSyntaxType:c.TupleExpressionHashIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,e===123?this.finishToken(7):this.finishToken(1)}else q(e)?(++this.state.pos,this.finishToken(139,this.readWord1(e))):e===92?(++this.state.pos,this.finishToken(139,this.readWord1())):this.finishOp(27,1)}readToken_dot(){let t=this.input.charCodeAt(this.state.pos+1);if(t>=48&&t<=57){this.readNumber(!0);return}t===46&&this.input.charCodeAt(this.state.pos+2)===46?(this.state.pos+=3,this.finishToken(21)):(++this.state.pos,this.finishToken(16))}readToken_slash(){this.input.charCodeAt(this.state.pos+1)===61?this.finishOp(31,2):this.finishOp(56,1)}readToken_interpreter(){if(this.state.pos!==0||this.length<2)return!1;let t=this.input.charCodeAt(this.state.pos+1);if(t!==33)return!1;let e=this.state.pos;for(this.state.pos+=1;!te(t)&&++this.state.pos=48&&e<=57)?(this.state.pos+=2,this.finishToken(18)):(++this.state.pos,this.finishToken(17))}getTokenFromCode(t){switch(t){case 46:this.readToken_dot();return;case 40:++this.state.pos,this.finishToken(10);return;case 41:++this.state.pos,this.finishToken(11);return;case 59:++this.state.pos,this.finishToken(13);return;case 44:++this.state.pos,this.finishToken(12);return;case 91:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(c.TupleExpressionBarIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(2)}else++this.state.pos,this.finishToken(0);return;case 93:++this.state.pos,this.finishToken(3);return;case 123:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(c.RecordExpressionBarIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(6)}else++this.state.pos,this.finishToken(5);return;case 125:++this.state.pos,this.finishToken(8);return;case 58:this.hasPlugin("functionBind")&&this.input.charCodeAt(this.state.pos+1)===58?this.finishOp(15,2):(++this.state.pos,this.finishToken(14));return;case 63:this.readToken_question();return;case 96:this.readTemplateToken();return;case 48:{let e=this.input.charCodeAt(this.state.pos+1);if(e===120||e===88){this.readRadixNumber(16);return}if(e===111||e===79){this.readRadixNumber(8);return}if(e===98||e===66){this.readRadixNumber(2);return}}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:this.readNumber(!1);return;case 34:case 39:this.readString(t);return;case 47:this.readToken_slash();return;case 37:case 42:this.readToken_mult_modulo(t);return;case 124:case 38:this.readToken_pipe_amp(t);return;case 94:this.readToken_caret();return;case 43:case 45:this.readToken_plus_min(t);return;case 60:this.readToken_lt();return;case 62:this.readToken_gt();return;case 61:case 33:this.readToken_eq_excl(t);return;case 126:this.finishOp(36,1);return;case 64:this.readToken_atSign();return;case 35:this.readToken_numberSign();return;case 92:this.readWord();return;default:if(q(t)){this.readWord(t);return}}throw this.raise(c.InvalidOrUnexpectedToken,this.state.curPosition(),{unexpected:String.fromCodePoint(t)})}finishOp(t,e){let s=this.input.slice(this.state.pos,this.state.pos+e);this.state.pos+=e,this.finishToken(t,s)}readRegexp(){let t=this.state.startLoc,e=this.state.start+1,s,r,{pos:i}=this.state;for(;;++i){if(i>=this.length)throw this.raise(c.UnterminatedRegExp,f(t,1));let l=this.input.charCodeAt(i);if(te(l))throw this.raise(c.UnterminatedRegExp,f(t,1));if(s)s=!1;else{if(l===91)r=!0;else if(l===93&&r)r=!1;else if(l===47&&!r)break;s=l===92}}let a=this.input.slice(e,i);++i;let n="",o=()=>f(t,i+2-e);for(;i=2&&this.input.charCodeAt(e)===48;if(o){let g=this.input.slice(e,this.state.pos);if(this.recordStrictModeErrors(c.StrictOctalLiteral,s),!this.state.strict){let b=g.indexOf("_");b>0&&this.raise(c.ZeroDigitNumericSeparator,f(s,b))}n=o&&!/[89]/.test(g)}let l=this.input.charCodeAt(this.state.pos);if(l===46&&!n&&(++this.state.pos,this.readInt(10),r=!0,l=this.input.charCodeAt(this.state.pos)),(l===69||l===101)&&!n&&(l=this.input.charCodeAt(++this.state.pos),(l===43||l===45)&&++this.state.pos,this.readInt(10)===null&&this.raise(c.InvalidOrMissingExponent,s),r=!0,a=!0,l=this.input.charCodeAt(this.state.pos)),l===110&&((r||o)&&this.raise(c.InvalidBigIntLiteral,s),++this.state.pos,i=!0),l===109){this.expectPlugin("decimal",this.state.curPosition()),(a||o)&&this.raise(c.InvalidDecimal,s),++this.state.pos;var h=!0}if(q(this.codePointAtPos(this.state.pos)))throw this.raise(c.NumberIdentifier,this.state.curPosition());let d=this.input.slice(e,this.state.pos).replace(/[_mn]/g,"");if(i){this.finishToken(136,d);return}if(h){this.finishToken(137,d);return}let y=n?parseInt(d,8):parseFloat(d);this.finishToken(135,y)}readCodePoint(t){let{code:e,pos:s}=xt(this.input,this.state.pos,this.state.lineStart,this.state.curLine,t,this.errorHandlers_readCodePoint);return this.state.pos=s,e}readString(t){let{str:e,pos:s,curLine:r,lineStart:i}=ft(t===34?"double":"single",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_string);this.state.pos=s+1,this.state.lineStart=i,this.state.curLine=r,this.finishToken(134,e)}readTemplateContinuation(){this.match(8)||this.unexpected(null,8),this.state.pos--,this.readTemplateToken()}readTemplateToken(){let t=this.input[this.state.pos],{str:e,firstInvalidLoc:s,pos:r,curLine:i,lineStart:a}=ft("template",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_template);this.state.pos=r+1,this.state.lineStart=a,this.state.curLine=i,s&&(this.state.firstInvalidTemplateEscapePos=new m(s.curLine,s.pos-s.lineStart,this.sourceToOffsetPos(s.pos))),this.input.codePointAt(r)===96?this.finishToken(24,s?null:t+e+"`"):(this.state.pos++,this.finishToken(25,s?null:t+e+"${"))}recordStrictModeErrors(t,e){let s=e.index;this.state.strict&&!this.state.strictErrors.has(s)?this.raise(t,e):this.state.strictErrors.set(s,[t,e])}readWord1(t){this.state.containsEsc=!1;let e="",s=this.state.pos,r=this.state.pos;for(t!==void 0&&(this.state.pos+=t<=65535?1:2);this.state.pos=0;n--){let o=a[n];if(o.loc.index===i)return a[n]=t(r,s);if(o.loc.indexthis.hasPlugin(e)))throw this.raise(c.MissingOneOfPlugins,this.state.startLoc,{missingPlugin:t})}errorBuilder(t){return(e,s,r)=>{this.raise(t,ce(e,s,r))}}},qs=class{constructor(){this.privateNames=new Set,this.loneAccessors=new Map,this.undefinedPrivateNames=new Map}},$s=class{constructor(t){this.parser=void 0,this.stack=[],this.undefinedPrivateNames=new Map,this.parser=t}current(){return this.stack[this.stack.length-1]}enter(){this.stack.push(new qs)}exit(){let t=this.stack.pop(),e=this.current();for(let[s,r]of Array.from(t.undefinedPrivateNames))e?e.undefinedPrivateNames.has(s)||e.undefinedPrivateNames.set(s,r):this.parser.raise(c.InvalidPrivateFieldResolution,r,{identifierName:s})}declarePrivateName(t,e,s){let{privateNames:r,loneAccessors:i,undefinedPrivateNames:a}=this.current(),n=r.has(t);if(e&3){let o=n&&i.get(t);if(o){let l=o&4,h=e&4,d=o&3,y=e&3;n=d===y||l!==h,n||i.delete(t)}else n||i.set(t,e)}n&&this.parser.raise(c.PrivateNameRedeclaration,s,{identifierName:t}),r.add(t),a.delete(t)}usePrivateName(t,e){let s;for(s of this.stack)if(s.privateNames.has(t))return;s?s.undefinedPrivateNames.set(t,e):this.parser.raise(c.InvalidPrivateFieldResolution,e,{identifierName:t})}},Te=class{constructor(t=0){this.type=t}canBeArrowParameterDeclaration(){return this.type===2||this.type===1}isCertainlyParameterDeclaration(){return this.type===3}},Pt=class extends Te{constructor(t){super(t),this.declarationErrors=new Map}recordDeclarationError(t,e){let s=e.index;this.declarationErrors.set(s,[t,e])}clearDeclarationError(t){this.declarationErrors.delete(t)}iterateErrors(t){this.declarationErrors.forEach(t)}},Ks=class{constructor(t){this.parser=void 0,this.stack=[new Te],this.parser=t}enter(t){this.stack.push(t)}exit(){this.stack.pop()}recordParameterInitializerError(t,e){let s=e.loc.start,{stack:r}=this,i=r.length-1,a=r[i];for(;!a.isCertainlyParameterDeclaration();){if(a.canBeArrowParameterDeclaration())a.recordDeclarationError(t,s);else return;a=r[--i]}this.parser.raise(t,s)}recordArrowParameterBindingError(t,e){let{stack:s}=this,r=s[s.length-1],i=e.loc.start;if(r.isCertainlyParameterDeclaration())this.parser.raise(t,i);else if(r.canBeArrowParameterDeclaration())r.recordDeclarationError(t,i);else return}recordAsyncArrowParametersError(t){let{stack:e}=this,s=e.length-1,r=e[s];for(;r.canBeArrowParameterDeclaration();)r.type===2&&r.recordDeclarationError(c.AwaitBindingIdentifier,t),r=e[--s]}validateAsPattern(){let{stack:t}=this,e=t[t.length-1];e.canBeArrowParameterDeclaration()&&e.iterateErrors(([s,r])=>{this.parser.raise(s,r);let i=t.length-2,a=t[i];for(;a.canBeArrowParameterDeclaration();)a.clearDeclarationError(r.index),a=t[--i]})}};function Js(){return new Te(3)}function Ws(){return new Pt(1)}function Xs(){return new Pt(2)}function gt(){return new Te}var Gs=class{constructor(){this.stacks=[]}enter(t){this.stacks.push(t)}exit(){this.stacks.pop()}currentFlags(){return this.stacks[this.stacks.length-1]}get hasAwait(){return(this.currentFlags()&2)>0}get hasYield(){return(this.currentFlags()&1)>0}get hasReturn(){return(this.currentFlags()&4)>0}get hasIn(){return(this.currentFlags()&8)>0}};function be(t,e){return(t?2:0)|(e?1:0)}var Ys=class extends Vs{addExtra(t,e,s,r=!0){if(!t)return;let{extra:i}=t;i==null&&(i={},t.extra=i),r?i[e]=s:Object.defineProperty(i,e,{enumerable:r,value:s})}isContextual(t){return this.state.type===t&&!this.state.containsEsc}isUnparsedContextual(t,e){let s=t+e.length;if(this.input.slice(t,s)===e){let r=this.input.charCodeAt(s);return!(ee(r)||(r&64512)===55296)}return!1}isLookaheadContextual(t){let e=this.nextTokenStart();return this.isUnparsedContextual(e,t)}eatContextual(t){return this.isContextual(t)?(this.next(),!0):!1}expectContextual(t,e){if(!this.eatContextual(t)){if(e!=null)throw this.raise(e,this.state.startLoc);this.unexpected(null,t)}}canInsertSemicolon(){return this.match(140)||this.match(8)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return dt(this.input,this.offsetToSourcePos(this.state.lastTokEndLoc.index),this.state.start)}hasFollowingLineBreak(){return dt(this.input,this.state.end,this.nextTokenStart())}isLineTerminator(){return this.eat(13)||this.canInsertSemicolon()}semicolon(t=!0){(t?this.isLineTerminator():this.eat(13))||this.raise(c.MissingSemicolon,this.state.lastTokEndLoc)}expect(t,e){this.eat(t)||this.unexpected(e,t)}tryParse(t,e=this.state.clone()){let s={node:null};try{let r=t((i=null)=>{throw s.node=i,s});if(this.state.errors.length>e.errors.length){let i=this.state;return this.state=e,this.state.tokensLength=i.tokensLength,{node:r,error:i.errors[e.errors.length],thrown:!1,aborted:!1,failState:i}}return{node:r,error:null,thrown:!1,aborted:!1,failState:null}}catch(r){let i=this.state;if(this.state=e,r instanceof SyntaxError)return{node:null,error:r,thrown:!0,aborted:!1,failState:i};if(r===s)return{node:s.node,error:null,thrown:!1,aborted:!0,failState:i};throw r}}checkExpressionErrors(t,e){if(!t)return!1;let{shorthandAssignLoc:s,doubleProtoLoc:r,privateKeyLoc:i,optionalParametersLoc:a}=t,n=!!s||!!r||!!a||!!i;if(!e)return n;s!=null&&this.raise(c.InvalidCoverInitializedName,s),r!=null&&this.raise(c.DuplicateProto,r),i!=null&&this.raise(c.UnexpectedPrivateField,i),a!=null&&this.unexpected(a)}isLiteralPropertyName(){return it(this.state.type)}isPrivateName(t){return t.type==="PrivateName"}getPrivateNameSV(t){return t.id.name}hasPropertyAsPrivateName(t){return(t.type==="MemberExpression"||t.type==="OptionalMemberExpression")&&this.isPrivateName(t.property)}isObjectProperty(t){return t.type==="ObjectProperty"}isObjectMethod(t){return t.type==="ObjectMethod"}initializeScopes(t=this.options.sourceType==="module"){let e=this.state.labels;this.state.labels=[];let s=this.exportedIdentifiers;this.exportedIdentifiers=new Set;let r=this.inModule;this.inModule=t;let i=this.scope,a=this.getScopeHandler();this.scope=new a(this,t);let n=this.prodParam;this.prodParam=new Gs;let o=this.classScope;this.classScope=new $s(this);let l=this.expressionScope;return this.expressionScope=new Ks(this),()=>{this.state.labels=e,this.exportedIdentifiers=s,this.inModule=r,this.scope=i,this.prodParam=n,this.classScope=o,this.expressionScope=l}}enterInitialScopes(){let t=0;this.inModule&&(t|=2),this.scope.enter(1),this.prodParam.enter(t)}checkDestructuringPrivate(t){let{privateKeyLoc:e}=t;e!==null&&this.expectPlugin("destructuringPrivate",e)}},Ae=class{constructor(){this.shorthandAssignLoc=null,this.doubleProtoLoc=null,this.privateKeyLoc=null,this.optionalParametersLoc=null}},Se=class{constructor(t,e,s){this.type="",this.start=e,this.end=0,this.loc=new x(s),t!=null&&t.options.ranges&&(this.range=[e,0]),t!=null&&t.filename&&(this.loc.filename=t.filename)}},Ve=Se.prototype;Ve.__clone=function(){let t=new Se(void 0,this.start,this.loc.start),e=Object.keys(this);for(let s=0,r=e.length;s`Cannot overwrite reserved type ${t}.`,DeclareClassElement:"The `declare` modifier can only appear on class fields.",DeclareClassFieldInitializer:"Initializers are not allowed in fields with the `declare` modifier.",DuplicateDeclareModuleExports:"Duplicate `declare module.exports` statement.",EnumBooleanMemberNotInitialized:({memberName:t,enumName:e})=>`Boolean enum members need to be initialized. Use either \`${t} = true,\` or \`${t} = false,\` in enum \`${e}\`.`,EnumDuplicateMemberName:({memberName:t,enumName:e})=>`Enum member names need to be unique, but the name \`${t}\` has already been used before in enum \`${e}\`.`,EnumInconsistentMemberValues:({enumName:t})=>`Enum \`${t}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:t,enumName:e})=>`Enum type \`${t}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${e}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:t})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${t}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:t,memberName:e,explicitType:s})=>`Enum \`${t}\` has type \`${s}\`, so the initializer of \`${e}\` needs to be a ${s} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:t,memberName:e})=>`Symbol enum members cannot be initialized. Use \`${e},\` in enum \`${t}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:t,memberName:e})=>`The enum member initializer for \`${e}\` needs to be a literal (either a boolean, number, or string) in enum \`${t}\`.`,EnumInvalidMemberName:({enumName:t,memberName:e,suggestion:s})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${e}\`, consider using \`${s}\`, in enum \`${t}\`.`,EnumNumberMemberNotInitialized:({enumName:t,memberName:e})=>`Number enum members need to be initialized, e.g. \`${e} = 1\` in enum \`${t}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:t})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${t}\`.`,GetterMayNotHaveThisParam:"A getter cannot have a `this` parameter.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` or `typeof` keyword.",ImportTypeShorthandOnlyInPureImport:"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.",InexactInsideExact:"Explicit inexact syntax cannot appear inside an explicit exact object type.",InexactInsideNonObject:"Explicit inexact syntax cannot appear in class or interface definitions.",InexactVariance:"Explicit inexact syntax cannot have variance.",InvalidNonTypeImportInDeclareModule:"Imports within a `declare module` body must always be `import type` or `import typeof`.",MissingTypeParamDefault:"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",NestedDeclareModule:"`declare module` cannot be used inside another `declare module`.",NestedFlowComment:"Cannot have a flow comment inside another flow comment.",PatternIsOptional:Object.assign({message:"A binding pattern parameter cannot be optional in an implementation signature."},{reasonCode:"OptionalBindingPattern"}),SetterMayNotHaveThisParam:"A setter cannot have a `this` parameter.",SpreadVariance:"Spread properties cannot have variance.",ThisParamAnnotationRequired:"A type annotation is required for the `this` parameter.",ThisParamBannedInConstructor:"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",ThisParamMayNotBeOptional:"The `this` parameter cannot be optional.",ThisParamMustBeFirst:"The `this` parameter must be the first function parameter.",ThisParamNoDefault:"The `this` parameter may not have a default value.",TypeBeforeInitializer:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeCastInPattern:"The type cast expression is expected to be wrapped with parenthesis.",UnexpectedExplicitInexactInObject:"Explicit inexact syntax must appear at the end of an inexact object.",UnexpectedReservedType:({reservedType:t})=>`Unexpected reserved type ${t}.`,UnexpectedReservedUnderscore:"`_` is only allowed as a type argument to call or new.",UnexpectedSpaceBetweenModuloChecks:"Spaces between `%` and `checks` are not allowed here.",UnexpectedSpreadType:"Spread operator cannot appear in class or interface definitions.",UnexpectedSubtractionOperand:'Unexpected token, expected "number" or "bigint".',UnexpectedTokenAfterTypeParameter:"Expected an arrow function after this type parameter declaration.",UnexpectedTypeParameterBeforeAsyncArrowFunction:"Type parameters must come after the async keyword, e.g. instead of ` async () => {}`, use `async () => {}`.",UnsupportedDeclareExportKind:({unsupportedExportKind:t,suggestion:e})=>`\`declare export ${t}\` is not supported. Use \`${e}\` instead.`,UnsupportedStatementInDeclareModule:"Only declares and type imports are allowed inside declare module.",UnterminatedFlowComment:"Unterminated flow-comment."});function sr(t){return t.type==="DeclareExportAllDeclaration"||t.type==="DeclareExportDeclaration"&&(!t.declaration||t.declaration.type!=="TypeAlias"&&t.declaration.type!=="InterfaceDeclaration")}function Tt(t){return t.importKind==="type"||t.importKind==="typeof"}var rr={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};function ir(t,e){let s=[],r=[];for(let i=0;iclass extends t{constructor(...e){super(...e),this.flowPragma=void 0}getScopeHandler(){return Ms}shouldParseTypes(){return this.getPluginOption("flow","all")||this.flowPragma==="flow"}finishToken(e,s){e!==134&&e!==13&&e!==28&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(e,s)}addComment(e){if(this.flowPragma===void 0){let s=ar.exec(e.value);if(s)if(s[1]==="flow")this.flowPragma="flow";else if(s[1]==="noflow")this.flowPragma="noflow";else throw new Error("Unexpected flow pragma")}super.addComment(e)}flowParseTypeInitialiser(e){let s=this.state.inType;this.state.inType=!0,this.expect(e||14);let r=this.flowParseType();return this.state.inType=s,r}flowParsePredicate(){let e=this.startNode(),s=this.state.startLoc;return this.next(),this.expectContextual(110),this.state.lastTokStartLoc.index>s.index+1&&this.raise(S.UnexpectedSpaceBetweenModuloChecks,s),this.eat(10)?(e.value=super.parseExpression(),this.expect(11),this.finishNode(e,"DeclaredPredicate")):this.finishNode(e,"InferredPredicate")}flowParseTypeAndPredicateInitialiser(){let e=this.state.inType;this.state.inType=!0,this.expect(14);let s=null,r=null;return this.match(54)?(this.state.inType=e,r=this.flowParsePredicate()):(s=this.flowParseType(),this.state.inType=e,this.match(54)&&(r=this.flowParsePredicate())),[s,r]}flowParseDeclareClass(e){return this.next(),this.flowParseInterfaceish(e,!0),this.finishNode(e,"DeclareClass")}flowParseDeclareFunction(e){this.next();let s=e.id=this.parseIdentifier(),r=this.startNode(),i=this.startNode();this.match(47)?r.typeParameters=this.flowParseTypeParameterDeclaration():r.typeParameters=null,this.expect(10);let a=this.flowParseFunctionTypeParams();return r.params=a.params,r.rest=a.rest,r.this=a._this,this.expect(11),[r.returnType,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),i.typeAnnotation=this.finishNode(r,"FunctionTypeAnnotation"),s.typeAnnotation=this.finishNode(i,"TypeAnnotation"),this.resetEndLocation(s),this.semicolon(),this.scope.declareName(e.id.name,2048,e.id.loc.start),this.finishNode(e,"DeclareFunction")}flowParseDeclare(e,s){if(this.match(80))return this.flowParseDeclareClass(e);if(this.match(68))return this.flowParseDeclareFunction(e);if(this.match(74))return this.flowParseDeclareVariable(e);if(this.eatContextual(127))return this.match(16)?this.flowParseDeclareModuleExports(e):(s&&this.raise(S.NestedDeclareModule,this.state.lastTokStartLoc),this.flowParseDeclareModule(e));if(this.isContextual(130))return this.flowParseDeclareTypeAlias(e);if(this.isContextual(131))return this.flowParseDeclareOpaqueType(e);if(this.isContextual(129))return this.flowParseDeclareInterface(e);if(this.match(82))return this.flowParseDeclareExportDeclaration(e,s);this.unexpected()}flowParseDeclareVariable(e){return this.next(),e.id=this.flowParseTypeAnnotatableIdentifier(!0),this.scope.declareName(e.id.name,5,e.id.loc.start),this.semicolon(),this.finishNode(e,"DeclareVariable")}flowParseDeclareModule(e){this.scope.enter(0),this.match(134)?e.id=super.parseExprAtom():e.id=this.parseIdentifier();let s=e.body=this.startNode(),r=s.body=[];for(this.expect(5);!this.match(8);){let n=this.startNode();this.match(83)?(this.next(),!this.isContextual(130)&&!this.match(87)&&this.raise(S.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc),super.parseImport(n)):(this.expectContextual(125,S.UnsupportedStatementInDeclareModule),n=this.flowParseDeclare(n,!0)),r.push(n)}this.scope.exit(),this.expect(8),this.finishNode(s,"BlockStatement");let i=null,a=!1;return r.forEach(n=>{sr(n)?(i==="CommonJS"&&this.raise(S.AmbiguousDeclareModuleKind,n),i="ES"):n.type==="DeclareModuleExports"&&(a&&this.raise(S.DuplicateDeclareModuleExports,n),i==="ES"&&this.raise(S.AmbiguousDeclareModuleKind,n),i="CommonJS",a=!0)}),e.kind=i||"CommonJS",this.finishNode(e,"DeclareModule")}flowParseDeclareExportDeclaration(e,s){if(this.expect(82),this.eat(65))return this.match(68)||this.match(80)?e.declaration=this.flowParseDeclare(this.startNode()):(e.declaration=this.flowParseType(),this.semicolon()),e.default=!0,this.finishNode(e,"DeclareExportDeclaration");if(this.match(75)||this.isLet()||(this.isContextual(130)||this.isContextual(129))&&!s){let r=this.state.value;throw this.raise(S.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:r,suggestion:rr[r]})}if(this.match(74)||this.match(68)||this.match(80)||this.isContextual(131))return e.declaration=this.flowParseDeclare(this.startNode()),e.default=!1,this.finishNode(e,"DeclareExportDeclaration");if(this.match(55)||this.match(5)||this.isContextual(129)||this.isContextual(130)||this.isContextual(131))return e=this.parseExport(e,null),e.type==="ExportNamedDeclaration"&&(e.type="ExportDeclaration",e.default=!1,delete e.exportKind),e.type="Declare"+e.type,e;this.unexpected()}flowParseDeclareModuleExports(e){return this.next(),this.expectContextual(111),e.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(e,"DeclareModuleExports")}flowParseDeclareTypeAlias(e){this.next();let s=this.flowParseTypeAlias(e);return s.type="DeclareTypeAlias",s}flowParseDeclareOpaqueType(e){this.next();let s=this.flowParseOpaqueType(e,!0);return s.type="DeclareOpaqueType",s}flowParseDeclareInterface(e){return this.next(),this.flowParseInterfaceish(e,!1),this.finishNode(e,"DeclareInterface")}flowParseInterfaceish(e,s){if(e.id=this.flowParseRestrictedIdentifier(!s,!0),this.scope.declareName(e.id.name,s?17:8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.extends=[],this.eat(81))do e.extends.push(this.flowParseInterfaceExtends());while(!s&&this.eat(12));if(s){if(e.implements=[],e.mixins=[],this.eatContextual(117))do e.mixins.push(this.flowParseInterfaceExtends());while(this.eat(12));if(this.eatContextual(113))do e.implements.push(this.flowParseInterfaceExtends());while(this.eat(12))}e.body=this.flowParseObjectType({allowStatic:s,allowExact:!1,allowSpread:!1,allowProto:s,allowInexact:!1})}flowParseInterfaceExtends(){let e=this.startNode();return e.id=this.flowParseQualifiedTypeIdentifier(),this.match(47)?e.typeParameters=this.flowParseTypeParameterInstantiation():e.typeParameters=null,this.finishNode(e,"InterfaceExtends")}flowParseInterface(e){return this.flowParseInterfaceish(e,!1),this.finishNode(e,"InterfaceDeclaration")}checkNotUnderscore(e){e==="_"&&this.raise(S.UnexpectedReservedUnderscore,this.state.startLoc)}checkReservedType(e,s,r){tr.has(e)&&this.raise(r?S.AssignReservedType:S.UnexpectedReservedType,s,{reservedType:e})}flowParseRestrictedIdentifier(e,s){return this.checkReservedType(this.state.value,this.state.startLoc,s),this.parseIdentifier(e)}flowParseTypeAlias(e){return e.id=this.flowParseRestrictedIdentifier(!1,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.right=this.flowParseTypeInitialiser(29),this.semicolon(),this.finishNode(e,"TypeAlias")}flowParseOpaqueType(e,s){return this.expectContextual(130),e.id=this.flowParseRestrictedIdentifier(!0,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.supertype=null,this.match(14)&&(e.supertype=this.flowParseTypeInitialiser(14)),e.impltype=null,s||(e.impltype=this.flowParseTypeInitialiser(29)),this.semicolon(),this.finishNode(e,"OpaqueType")}flowParseTypeParameter(e=!1){let s=this.state.startLoc,r=this.startNode(),i=this.flowParseVariance(),a=this.flowParseTypeAnnotatableIdentifier();return r.name=a.name,r.variance=i,r.bound=a.typeAnnotation,this.match(29)?(this.eat(29),r.default=this.flowParseType()):e&&this.raise(S.MissingTypeParamDefault,s),this.finishNode(r,"TypeParameter")}flowParseTypeParameterDeclaration(){let e=this.state.inType,s=this.startNode();s.params=[],this.state.inType=!0,this.match(47)||this.match(143)?this.next():this.unexpected();let r=!1;do{let i=this.flowParseTypeParameter(r);s.params.push(i),i.default&&(r=!0),this.match(48)||this.expect(12)}while(!this.match(48));return this.expect(48),this.state.inType=e,this.finishNode(s,"TypeParameterDeclaration")}flowParseTypeParameterInstantiation(){let e=this.startNode(),s=this.state.inType;e.params=[],this.state.inType=!0,this.expect(47);let r=this.state.noAnonFunctionType;for(this.state.noAnonFunctionType=!1;!this.match(48);)e.params.push(this.flowParseType()),this.match(48)||this.expect(12);return this.state.noAnonFunctionType=r,this.expect(48),this.state.inType=s,this.finishNode(e,"TypeParameterInstantiation")}flowParseTypeParameterInstantiationCallOrNew(){let e=this.startNode(),s=this.state.inType;for(e.params=[],this.state.inType=!0,this.expect(47);!this.match(48);)e.params.push(this.flowParseTypeOrImplicitInstantiation()),this.match(48)||this.expect(12);return this.expect(48),this.state.inType=s,this.finishNode(e,"TypeParameterInstantiation")}flowParseInterfaceType(){let e=this.startNode();if(this.expectContextual(129),e.extends=[],this.eat(81))do e.extends.push(this.flowParseInterfaceExtends());while(this.eat(12));return e.body=this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!1,allowProto:!1,allowInexact:!1}),this.finishNode(e,"InterfaceTypeAnnotation")}flowParseObjectPropertyKey(){return this.match(135)||this.match(134)?super.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(e,s,r){return e.static=s,this.lookahead().type===14?(e.id=this.flowParseObjectPropertyKey(),e.key=this.flowParseTypeInitialiser()):(e.id=null,e.key=this.flowParseType()),this.expect(3),e.value=this.flowParseTypeInitialiser(),e.variance=r,this.finishNode(e,"ObjectTypeIndexer")}flowParseObjectTypeInternalSlot(e,s){return e.static=s,e.id=this.flowParseObjectPropertyKey(),this.expect(3),this.expect(3),this.match(47)||this.match(10)?(e.method=!0,e.optional=!1,e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start))):(e.method=!1,this.eat(17)&&(e.optional=!0),e.value=this.flowParseTypeInitialiser()),this.finishNode(e,"ObjectTypeInternalSlot")}flowParseObjectTypeMethodish(e){for(e.params=[],e.rest=null,e.typeParameters=null,e.this=null,this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(10),this.match(78)&&(e.this=this.flowParseFunctionTypeParam(!0),e.this.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)e.params.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(e.rest=this.flowParseFunctionTypeParam(!1)),this.expect(11),e.returnType=this.flowParseTypeInitialiser(),this.finishNode(e,"FunctionTypeAnnotation")}flowParseObjectTypeCallProperty(e,s){let r=this.startNode();return e.static=s,e.value=this.flowParseObjectTypeMethodish(r),this.finishNode(e,"ObjectTypeCallProperty")}flowParseObjectType({allowStatic:e,allowExact:s,allowSpread:r,allowProto:i,allowInexact:a}){let n=this.state.inType;this.state.inType=!0;let o=this.startNode();o.callProperties=[],o.properties=[],o.indexers=[],o.internalSlots=[];let l,h,d=!1;for(s&&this.match(6)?(this.expect(6),l=9,h=!0):(this.expect(5),l=8,h=!1),o.exact=h;!this.match(l);){let g=!1,b=null,N=null,D=this.startNode();if(i&&this.isContextual(118)){let O=this.lookahead();O.type!==14&&O.type!==17&&(this.next(),b=this.state.startLoc,e=!1)}if(e&&this.isContextual(106)){let O=this.lookahead();O.type!==14&&O.type!==17&&(this.next(),g=!0)}let L=this.flowParseVariance();if(this.eat(0))b!=null&&this.unexpected(b),this.eat(0)?(L&&this.unexpected(L.loc.start),o.internalSlots.push(this.flowParseObjectTypeInternalSlot(D,g))):o.indexers.push(this.flowParseObjectTypeIndexer(D,g,L));else if(this.match(10)||this.match(47))b!=null&&this.unexpected(b),L&&this.unexpected(L.loc.start),o.callProperties.push(this.flowParseObjectTypeCallProperty(D,g));else{let O="init";if(this.isContextual(99)||this.isContextual(104)){let Ke=this.lookahead();it(Ke.type)&&(O=this.state.value,this.next())}let j=this.flowParseObjectTypeProperty(D,g,b,L,O,r,a??!h);j===null?(d=!0,N=this.state.lastTokStartLoc):o.properties.push(j)}this.flowObjectTypeSemicolon(),N&&!this.match(8)&&!this.match(9)&&this.raise(S.UnexpectedExplicitInexactInObject,N)}this.expect(l),r&&(o.inexact=d);let y=this.finishNode(o,"ObjectTypeAnnotation");return this.state.inType=n,y}flowParseObjectTypeProperty(e,s,r,i,a,n,o){if(this.eat(21))return this.match(12)||this.match(13)||this.match(8)||this.match(9)?(n?o||this.raise(S.InexactInsideExact,this.state.lastTokStartLoc):this.raise(S.InexactInsideNonObject,this.state.lastTokStartLoc),i&&this.raise(S.InexactVariance,i),null):(n||this.raise(S.UnexpectedSpreadType,this.state.lastTokStartLoc),r!=null&&this.unexpected(r),i&&this.raise(S.SpreadVariance,i),e.argument=this.flowParseType(),this.finishNode(e,"ObjectTypeSpreadProperty"));{e.key=this.flowParseObjectPropertyKey(),e.static=s,e.proto=r!=null,e.kind=a;let l=!1;return this.match(47)||this.match(10)?(e.method=!0,r!=null&&this.unexpected(r),i&&this.unexpected(i.loc.start),e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start)),(a==="get"||a==="set")&&this.flowCheckGetterSetterParams(e),!n&&e.key.name==="constructor"&&e.value.this&&this.raise(S.ThisParamBannedInConstructor,e.value.this)):(a!=="init"&&this.unexpected(),e.method=!1,this.eat(17)&&(l=!0),e.value=this.flowParseTypeInitialiser(),e.variance=i),e.optional=l,this.finishNode(e,"ObjectTypeProperty")}}flowCheckGetterSetterParams(e){let s=e.kind==="get"?0:1,r=e.value.params.length+(e.value.rest?1:0);e.value.this&&this.raise(e.kind==="get"?S.GetterMayNotHaveThisParam:S.SetterMayNotHaveThisParam,e.value.this),r!==s&&this.raise(e.kind==="get"?c.BadGetterArity:c.BadSetterArity,e),e.kind==="set"&&e.value.rest&&this.raise(c.BadSetterRestParameter,e)}flowObjectTypeSemicolon(){!this.eat(13)&&!this.eat(12)&&!this.match(8)&&!this.match(9)&&this.unexpected()}flowParseQualifiedTypeIdentifier(e,s){e!=null||(e=this.state.startLoc);let r=s||this.flowParseRestrictedIdentifier(!0);for(;this.eat(16);){let i=this.startNodeAt(e);i.qualification=r,i.id=this.flowParseRestrictedIdentifier(!0),r=this.finishNode(i,"QualifiedTypeIdentifier")}return r}flowParseGenericType(e,s){let r=this.startNodeAt(e);return r.typeParameters=null,r.id=this.flowParseQualifiedTypeIdentifier(e,s),this.match(47)&&(r.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(r,"GenericTypeAnnotation")}flowParseTypeofType(){let e=this.startNode();return this.expect(87),e.argument=this.flowParsePrimaryType(),this.finishNode(e,"TypeofTypeAnnotation")}flowParseTupleType(){let e=this.startNode();for(e.types=[],this.expect(0);this.state.possuper.parseFunctionBody(e,!0,r));return}super.parseFunctionBody(e,!1,r)}parseFunctionBodyAndFinish(e,s,r=!1){if(this.match(14)){let i=this.startNode();[i.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),e.returnType=i.typeAnnotation?this.finishNode(i,"TypeAnnotation"):null}return super.parseFunctionBodyAndFinish(e,s,r)}parseStatementLike(e){if(this.state.strict&&this.isContextual(129)){let r=this.lookahead();if(U(r.type)){let i=this.startNode();return this.next(),this.flowParseInterface(i)}}else if(this.isContextual(126)){let r=this.startNode();return this.next(),this.flowParseEnumDeclaration(r)}let s=super.parseStatementLike(e);return this.flowPragma===void 0&&!this.isValidDirective(s)&&(this.flowPragma=null),s}parseExpressionStatement(e,s,r){if(s.type==="Identifier"){if(s.name==="declare"){if(this.match(80)||k(this.state.type)||this.match(68)||this.match(74)||this.match(82))return this.flowParseDeclare(e)}else if(k(this.state.type)){if(s.name==="interface")return this.flowParseInterface(e);if(s.name==="type")return this.flowParseTypeAlias(e);if(s.name==="opaque")return this.flowParseOpaqueType(e,!1)}}return super.parseExpressionStatement(e,s,r)}shouldParseExportDeclaration(){let{type:e}=this.state;return e===126||at(e)?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:e}=this.state;return e===126||at(e)?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.isContextual(126)){let e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}return super.parseExportDefaultExpression()}parseConditional(e,s,r){if(!this.match(17))return e;if(this.state.maybeInArrowParameters){let y=this.lookaheadCharCode();if(y===44||y===61||y===58||y===41)return this.setOptionalParametersError(r),e}this.expect(17);let i=this.state.clone(),a=this.state.noArrowAt,n=this.startNodeAt(s),{consequent:o,failed:l}=this.tryParseConditionalConsequent(),[h,d]=this.getArrowLikeExpressions(o);if(l||d.length>0){let y=[...a];if(d.length>0){this.state=i,this.state.noArrowAt=y;for(let g=0;g1&&this.raise(S.AmbiguousConditionalArrow,i.startLoc),l&&h.length===1&&(this.state=i,y.push(h[0].start),this.state.noArrowAt=y,{consequent:o,failed:l}=this.tryParseConditionalConsequent())}return this.getArrowLikeExpressions(o,!0),this.state.noArrowAt=a,this.expect(14),n.test=e,n.consequent=o,n.alternate=this.forwardNoArrowParamsConversionAt(n,()=>this.parseMaybeAssign(void 0,void 0)),this.finishNode(n,"ConditionalExpression")}tryParseConditionalConsequent(){this.state.noArrowParamsConversionAt.push(this.state.start);let e=this.parseMaybeAssignAllowIn(),s=!this.match(14);return this.state.noArrowParamsConversionAt.pop(),{consequent:e,failed:s}}getArrowLikeExpressions(e,s){let r=[e],i=[];for(;r.length!==0;){let a=r.pop();a.type==="ArrowFunctionExpression"&&a.body.type!=="BlockStatement"?(a.typeParameters||!a.returnType?this.finishArrowValidation(a):i.push(a),r.push(a.body)):a.type==="ConditionalExpression"&&(r.push(a.consequent),r.push(a.alternate))}return s?(i.forEach(a=>this.finishArrowValidation(a)),[i,[]]):ir(i,a=>a.params.every(n=>this.isAssignable(n,!0)))}finishArrowValidation(e){var s;this.toAssignableList(e.params,(s=e.extra)==null?void 0:s.trailingCommaLoc,!1),this.scope.enter(6),super.checkParams(e,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(e,s){let r;return this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?(this.state.noArrowParamsConversionAt.push(this.state.start),r=s(),this.state.noArrowParamsConversionAt.pop()):r=s(),r}parseParenItem(e,s){let r=super.parseParenItem(e,s);if(this.eat(17)&&(r.optional=!0,this.resetEndLocation(e)),this.match(14)){let i=this.startNodeAt(s);return i.expression=r,i.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(i,"TypeCastExpression")}return r}assertModuleNodeAllowed(e){e.type==="ImportDeclaration"&&(e.importKind==="type"||e.importKind==="typeof")||e.type==="ExportNamedDeclaration"&&e.exportKind==="type"||e.type==="ExportAllDeclaration"&&e.exportKind==="type"||super.assertModuleNodeAllowed(e)}parseExportDeclaration(e){if(this.isContextual(130)){e.exportKind="type";let s=this.startNode();return this.next(),this.match(5)?(e.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(e),null):this.flowParseTypeAlias(s)}else if(this.isContextual(131)){e.exportKind="type";let s=this.startNode();return this.next(),this.flowParseOpaqueType(s,!1)}else if(this.isContextual(129)){e.exportKind="type";let s=this.startNode();return this.next(),this.flowParseInterface(s)}else if(this.isContextual(126)){e.exportKind="value";let s=this.startNode();return this.next(),this.flowParseEnumDeclaration(s)}else return super.parseExportDeclaration(e)}eatExportStar(e){return super.eatExportStar(e)?!0:this.isContextual(130)&&this.lookahead().type===55?(e.exportKind="type",this.next(),this.next(),!0):!1}maybeParseExportNamespaceSpecifier(e){let{startLoc:s}=this.state,r=super.maybeParseExportNamespaceSpecifier(e);return r&&e.exportKind==="type"&&this.unexpected(s),r}parseClassId(e,s,r){super.parseClassId(e,s,r),this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration())}parseClassMember(e,s,r){let{startLoc:i}=this.state;if(this.isContextual(125)){if(super.parseClassMemberFromModifier(e,s))return;s.declare=!0}super.parseClassMember(e,s,r),s.declare&&(s.type!=="ClassProperty"&&s.type!=="ClassPrivateProperty"&&s.type!=="PropertyDefinition"?this.raise(S.DeclareClassElement,i):s.value&&this.raise(S.DeclareClassFieldInitializer,s.value))}isIterator(e){return e==="iterator"||e==="asyncIterator"}readIterator(){let e=super.readWord1(),s="@@"+e;(!this.isIterator(e)||!this.state.inType)&&this.raise(c.InvalidIdentifier,this.state.curPosition(),{identifierName:s}),this.finishToken(132,s)}getTokenFromCode(e){let s=this.input.charCodeAt(this.state.pos+1);e===123&&s===124?this.finishOp(6,2):this.state.inType&&(e===62||e===60)?this.finishOp(e===62?48:47,1):this.state.inType&&e===63?s===46?this.finishOp(18,2):this.finishOp(17,1):Ns(e,s,this.input.charCodeAt(this.state.pos+2))?(this.state.pos+=2,this.readIterator()):super.getTokenFromCode(e)}isAssignable(e,s){return e.type==="TypeCastExpression"?this.isAssignable(e.expression,s):super.isAssignable(e,s)}toAssignable(e,s=!1){!s&&e.type==="AssignmentExpression"&&e.left.type==="TypeCastExpression"&&(e.left=this.typeCastToParameter(e.left)),super.toAssignable(e,s)}toAssignableList(e,s,r){for(let i=0;i1||!s)&&this.raise(S.TypeCastInPattern,a.typeAnnotation)}return e}parseArrayLike(e,s,r,i){let a=super.parseArrayLike(e,s,r,i);return s&&!this.state.maybeInArrowParameters&&this.toReferencedList(a.elements),a}isValidLVal(e,s,r){return e==="TypeCastExpression"||super.isValidLVal(e,s,r)}parseClassProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassProperty(e)}parseClassPrivateProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassPrivateProperty(e)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(14)||super.isClassProperty()}isNonstaticConstructor(e){return!this.match(14)&&super.isNonstaticConstructor(e)}pushClassMethod(e,s,r,i,a,n){if(s.variance&&this.unexpected(s.variance.loc.start),delete s.variance,this.match(47)&&(s.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(e,s,r,i,a,n),s.params&&a){let o=s.params;o.length>0&&this.isThisParam(o[0])&&this.raise(S.ThisParamBannedInConstructor,s)}else if(s.type==="MethodDefinition"&&a&&s.value.params){let o=s.value.params;o.length>0&&this.isThisParam(o[0])&&this.raise(S.ThisParamBannedInConstructor,s)}}pushClassPrivateMethod(e,s,r,i){s.variance&&this.unexpected(s.variance.loc.start),delete s.variance,this.match(47)&&(s.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(e,s,r,i)}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass&&this.match(47)&&(e.superTypeParameters=this.flowParseTypeParameterInstantiation()),this.isContextual(113)){this.next();let s=e.implements=[];do{let r=this.startNode();r.id=this.flowParseRestrictedIdentifier(!0),this.match(47)?r.typeParameters=this.flowParseTypeParameterInstantiation():r.typeParameters=null,s.push(this.finishNode(r,"ClassImplements"))}while(this.eat(12))}}checkGetterSetterParams(e){super.checkGetterSetterParams(e);let s=this.getObjectOrClassMethodParams(e);if(s.length>0){let r=s[0];this.isThisParam(r)&&e.kind==="get"?this.raise(S.GetterMayNotHaveThisParam,r):this.isThisParam(r)&&this.raise(S.SetterMayNotHaveThisParam,r)}}parsePropertyNamePrefixOperator(e){e.variance=this.flowParseVariance()}parseObjPropValue(e,s,r,i,a,n,o){e.variance&&this.unexpected(e.variance.loc.start),delete e.variance;let l;this.match(47)&&!n&&(l=this.flowParseTypeParameterDeclaration(),this.match(10)||this.unexpected());let h=super.parseObjPropValue(e,s,r,i,a,n,o);return l&&((h.value||h).typeParameters=l),h}parseFunctionParamType(e){return this.eat(17)&&(e.type!=="Identifier"&&this.raise(S.PatternIsOptional,e),this.isThisParam(e)&&this.raise(S.ThisParamMayNotBeOptional,e),e.optional=!0),this.match(14)?e.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(e)&&this.raise(S.ThisParamAnnotationRequired,e),this.match(29)&&this.isThisParam(e)&&this.raise(S.ThisParamNoDefault,e),this.resetEndLocation(e),e}parseMaybeDefault(e,s){let r=super.parseMaybeDefault(e,s);return r.type==="AssignmentPattern"&&r.typeAnnotation&&r.right.startsuper.parseMaybeAssign(e,s),i),!a.error)return a.node;let{context:l}=this.state,h=l[l.length-1];(h===M.j_oTag||h===M.j_expr)&&l.pop()}if((r=a)!=null&&r.error||this.match(47)){var n,o;i=i||this.state.clone();let l,h=this.tryParse(y=>{var g;l=this.flowParseTypeParameterDeclaration();let b=this.forwardNoArrowParamsConversionAt(l,()=>{let D=super.parseMaybeAssign(e,s);return this.resetStartLocationFromNode(D,l),D});(g=b.extra)!=null&&g.parenthesized&&y();let N=this.maybeUnwrapTypeCastExpression(b);return N.type!=="ArrowFunctionExpression"&&y(),N.typeParameters=l,this.resetStartLocationFromNode(N,l),b},i),d=null;if(h.node&&this.maybeUnwrapTypeCastExpression(h.node).type==="ArrowFunctionExpression"){if(!h.error&&!h.aborted)return h.node.async&&this.raise(S.UnexpectedTypeParameterBeforeAsyncArrowFunction,l),h.node;d=h.node}if((n=a)!=null&&n.node)return this.state=a.failState,a.node;if(d)return this.state=h.failState,d;throw(o=a)!=null&&o.thrown?a.error:h.thrown?h.error:this.raise(S.UnexpectedTokenAfterTypeParameter,l)}return super.parseMaybeAssign(e,s)}parseArrow(e){if(this.match(14)){let s=this.tryParse(()=>{let r=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;let i=this.startNode();return[i.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),this.state.noAnonFunctionType=r,this.canInsertSemicolon()&&this.unexpected(),this.match(19)||this.unexpected(),i});if(s.thrown)return null;s.error&&(this.state=s.failState),e.returnType=s.node.typeAnnotation?this.finishNode(s.node,"TypeAnnotation"):null}return super.parseArrow(e)}shouldParseArrow(e){return this.match(14)||super.shouldParseArrow(e)}setArrowFunctionParameters(e,s){this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?e.params=s:super.setArrowFunctionParameters(e,s)}checkParams(e,s,r,i=!0){if(!(r&&this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start)))){for(let a=0;a0&&this.raise(S.ThisParamMustBeFirst,e.params[a]);super.checkParams(e,s,r,i)}}parseParenAndDistinguishExpression(e){return super.parseParenAndDistinguishExpression(e&&!this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start)))}parseSubscripts(e,s,r){if(e.type==="Identifier"&&e.name==="async"&&this.state.noArrowAt.includes(s.index)){this.next();let i=this.startNodeAt(s);i.callee=e,i.arguments=super.parseCallExpressionArguments(11),e=this.finishNode(i,"CallExpression")}else if(e.type==="Identifier"&&e.name==="async"&&this.match(47)){let i=this.state.clone(),a=this.tryParse(o=>this.parseAsyncArrowWithTypeParameters(s)||o(),i);if(!a.error&&!a.aborted)return a.node;let n=this.tryParse(()=>super.parseSubscripts(e,s,r),i);if(n.node&&!n.error)return n.node;if(a.node)return this.state=a.failState,a.node;if(n.node)return this.state=n.failState,n.node;throw a.error||n.error}return super.parseSubscripts(e,s,r)}parseSubscript(e,s,r,i){if(this.match(18)&&this.isLookaheadToken_lt()){if(i.optionalChainMember=!0,r)return i.stop=!0,e;this.next();let a=this.startNodeAt(s);return a.callee=e,a.typeArguments=this.flowParseTypeParameterInstantiation(),this.expect(10),a.arguments=this.parseCallExpressionArguments(11),a.optional=!0,this.finishCallExpression(a,!0)}else if(!r&&this.shouldParseTypes()&&this.match(47)){let a=this.startNodeAt(s);a.callee=e;let n=this.tryParse(()=>(a.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(10),a.arguments=super.parseCallExpressionArguments(11),i.optionalChainMember&&(a.optional=!1),this.finishCallExpression(a,i.optionalChainMember)));if(n.node)return n.error&&(this.state=n.failState),n.node}return super.parseSubscript(e,s,r,i)}parseNewCallee(e){super.parseNewCallee(e);let s=null;this.shouldParseTypes()&&this.match(47)&&(s=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node),e.typeArguments=s}parseAsyncArrowWithTypeParameters(e){let s=this.startNodeAt(e);if(this.parseFunctionParams(s,!1),!!this.parseArrow(s))return super.parseArrowExpression(s,void 0,!0)}readToken_mult_modulo(e){let s=this.input.charCodeAt(this.state.pos+1);if(e===42&&s===47&&this.state.hasFlowComment){this.state.hasFlowComment=!1,this.state.pos+=2,this.nextToken();return}super.readToken_mult_modulo(e)}readToken_pipe_amp(e){let s=this.input.charCodeAt(this.state.pos+1);if(e===124&&s===125){this.finishOp(9,2);return}super.readToken_pipe_amp(e)}parseTopLevel(e,s){let r=super.parseTopLevel(e,s);return this.state.hasFlowComment&&this.raise(S.UnterminatedFlowComment,this.state.curPosition()),r}skipBlockComment(){if(this.hasPlugin("flowComments")&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(S.NestedFlowComment,this.state.startLoc);this.hasFlowCommentCompletion();let e=this.skipFlowComment();e&&(this.state.pos+=e,this.state.hasFlowComment=!0);return}return super.skipBlockComment(this.state.hasFlowComment?"*-/":"*/")}skipFlowComment(){let{pos:e}=this.state,s=2;for(;[32,9].includes(this.input.charCodeAt(e+s));)s++;let r=this.input.charCodeAt(s+e),i=this.input.charCodeAt(s+e+1);return r===58&&i===58?s+2:this.input.slice(s+e,s+e+12)==="flow-include"?s+12:r===58&&i!==58?s:!1}hasFlowCommentCompletion(){if(this.input.indexOf("*/",this.state.pos)===-1)throw this.raise(c.UnterminatedComment,this.state.curPosition())}flowEnumErrorBooleanMemberNotInitialized(e,{enumName:s,memberName:r}){this.raise(S.EnumBooleanMemberNotInitialized,e,{memberName:r,enumName:s})}flowEnumErrorInvalidMemberInitializer(e,s){return this.raise(s.explicitType?s.explicitType==="symbol"?S.EnumInvalidMemberInitializerSymbolType:S.EnumInvalidMemberInitializerPrimaryType:S.EnumInvalidMemberInitializerUnknownType,e,s)}flowEnumErrorNumberMemberNotInitialized(e,s){this.raise(S.EnumNumberMemberNotInitialized,e,s)}flowEnumErrorStringMemberInconsistentlyInitialized(e,s){this.raise(S.EnumStringMemberInconsistentlyInitialized,e,s)}flowEnumMemberInit(){let e=this.state.startLoc,s=()=>this.match(12)||this.match(8);switch(this.state.type){case 135:{let r=this.parseNumericLiteral(this.state.value);return s()?{type:"number",loc:r.loc.start,value:r}:{type:"invalid",loc:e}}case 134:{let r=this.parseStringLiteral(this.state.value);return s()?{type:"string",loc:r.loc.start,value:r}:{type:"invalid",loc:e}}case 85:case 86:{let r=this.parseBooleanLiteral(this.match(85));return s()?{type:"boolean",loc:r.loc.start,value:r}:{type:"invalid",loc:e}}default:return{type:"invalid",loc:e}}}flowEnumMemberRaw(){let e=this.state.startLoc,s=this.parseIdentifier(!0),r=this.eat(29)?this.flowEnumMemberInit():{type:"none",loc:e};return{id:s,init:r}}flowEnumCheckExplicitTypeMismatch(e,s,r){let{explicitType:i}=s;i!==null&&i!==r&&this.flowEnumErrorInvalidMemberInitializer(e,s)}flowEnumMembers({enumName:e,explicitType:s}){let r=new Set,i={booleanMembers:[],numberMembers:[],stringMembers:[],defaultedMembers:[]},a=!1;for(;!this.match(8);){if(this.eat(21)){a=!0;break}let n=this.startNode(),{id:o,init:l}=this.flowEnumMemberRaw(),h=o.name;if(h==="")continue;/^[a-z]/.test(h)&&this.raise(S.EnumInvalidMemberName,o,{memberName:h,suggestion:h[0].toUpperCase()+h.slice(1),enumName:e}),r.has(h)&&this.raise(S.EnumDuplicateMemberName,o,{memberName:h,enumName:e}),r.add(h);let d={enumName:e,explicitType:s,memberName:h};switch(n.id=o,l.type){case"boolean":{this.flowEnumCheckExplicitTypeMismatch(l.loc,d,"boolean"),n.init=l.value,i.booleanMembers.push(this.finishNode(n,"EnumBooleanMember"));break}case"number":{this.flowEnumCheckExplicitTypeMismatch(l.loc,d,"number"),n.init=l.value,i.numberMembers.push(this.finishNode(n,"EnumNumberMember"));break}case"string":{this.flowEnumCheckExplicitTypeMismatch(l.loc,d,"string"),n.init=l.value,i.stringMembers.push(this.finishNode(n,"EnumStringMember"));break}case"invalid":throw this.flowEnumErrorInvalidMemberInitializer(l.loc,d);case"none":switch(s){case"boolean":this.flowEnumErrorBooleanMemberNotInitialized(l.loc,d);break;case"number":this.flowEnumErrorNumberMemberNotInitialized(l.loc,d);break;default:i.defaultedMembers.push(this.finishNode(n,"EnumDefaultedMember"))}}this.match(8)||this.expect(12)}return{members:i,hasUnknownMembers:a}}flowEnumStringMembers(e,s,{enumName:r}){if(e.length===0)return s;if(s.length===0)return e;if(s.length>e.length){for(let i of e)this.flowEnumErrorStringMemberInconsistentlyInitialized(i,{enumName:r});return s}else{for(let i of s)this.flowEnumErrorStringMemberInconsistentlyInitialized(i,{enumName:r});return e}}flowEnumParseExplicitType({enumName:e}){if(!this.eatContextual(102))return null;if(!k(this.state.type))throw this.raise(S.EnumInvalidExplicitTypeUnknownSupplied,this.state.startLoc,{enumName:e});let{value:s}=this.state;return this.next(),s!=="boolean"&&s!=="number"&&s!=="string"&&s!=="symbol"&&this.raise(S.EnumInvalidExplicitType,this.state.startLoc,{enumName:e,invalidEnumType:s}),s}flowEnumBody(e,s){let r=s.name,i=s.loc.start,a=this.flowEnumParseExplicitType({enumName:r});this.expect(5);let{members:n,hasUnknownMembers:o}=this.flowEnumMembers({enumName:r,explicitType:a});switch(e.hasUnknownMembers=o,a){case"boolean":return e.explicitType=!0,e.members=n.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody");case"number":return e.explicitType=!0,e.members=n.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody");case"string":return e.explicitType=!0,e.members=this.flowEnumStringMembers(n.stringMembers,n.defaultedMembers,{enumName:r}),this.expect(8),this.finishNode(e,"EnumStringBody");case"symbol":return e.members=n.defaultedMembers,this.expect(8),this.finishNode(e,"EnumSymbolBody");default:{let l=()=>(e.members=[],this.expect(8),this.finishNode(e,"EnumStringBody"));e.explicitType=!1;let h=n.booleanMembers.length,d=n.numberMembers.length,y=n.stringMembers.length,g=n.defaultedMembers.length;if(!h&&!d&&!y&&!g)return l();if(!h&&!d)return e.members=this.flowEnumStringMembers(n.stringMembers,n.defaultedMembers,{enumName:r}),this.expect(8),this.finishNode(e,"EnumStringBody");if(!d&&!y&&h>=g){for(let b of n.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(b.loc.start,{enumName:r,memberName:b.id.name});return e.members=n.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody")}else if(!h&&!y&&d>=g){for(let b of n.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(b.loc.start,{enumName:r,memberName:b.id.name});return e.members=n.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody")}else return this.raise(S.EnumInconsistentMemberValues,i,{enumName:r}),l()}}}flowParseEnumDeclaration(e){let s=this.parseIdentifier();return e.id=s,e.body=this.flowEnumBody(this.startNode(),s),this.finishNode(e,"EnumDeclaration")}isLookaheadToken_lt(){let e=this.nextTokenStart();if(this.input.charCodeAt(e)===60){let s=this.input.charCodeAt(e+1);return s!==60&&s!==61}return!1}maybeUnwrapTypeCastExpression(e){return e.type==="TypeCastExpression"?e.expression:e}},Q=H`jsx`({AttributeIsEmpty:"JSX attributes must only be assigned a non-empty expression.",MissingClosingTagElement:({openingTagName:t})=>`Expected corresponding JSX closing tag for <${t}>.`,MissingClosingTagFragment:"Expected corresponding JSX closing tag for <>.",UnexpectedSequenceExpression:"Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?",UnexpectedToken:({unexpected:t,HTMLEntity:e})=>`Unexpected token \`${t}\`. Did you mean \`${e}\` or \`{'${t}'}\`?`,UnsupportedJsxValue:"JSX value should be either an expression or a quoted JSX text.",UnterminatedJsxContent:"Unterminated JSX contents.",UnwrappedAdjacentJSXElements:"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...?"});function G(t){return t?t.type==="JSXOpeningFragment"||t.type==="JSXClosingFragment":!1}function se(t){if(t.type==="JSXIdentifier")return t.name;if(t.type==="JSXNamespacedName")return t.namespace.name+":"+t.name.name;if(t.type==="JSXMemberExpression")return se(t.object)+"."+se(t.property);throw new Error("Node had unexpected type: "+t.type)}var or=t=>class extends t{jsxReadToken(){let e="",s=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(Q.UnterminatedJsxContent,this.state.startLoc);let r=this.input.charCodeAt(this.state.pos);switch(r){case 60:case 123:if(this.state.pos===this.state.start){r===60&&this.state.canStartJSXElement?(++this.state.pos,this.finishToken(143)):super.getTokenFromCode(r);return}e+=this.input.slice(s,this.state.pos),this.finishToken(142,e);return;case 38:e+=this.input.slice(s,this.state.pos),e+=this.jsxReadEntity(),s=this.state.pos;break;case 62:case 125:default:te(r)?(e+=this.input.slice(s,this.state.pos),e+=this.jsxReadNewLine(!0),s=this.state.pos):++this.state.pos}}}jsxReadNewLine(e){let s=this.input.charCodeAt(this.state.pos),r;return++this.state.pos,s===13&&this.input.charCodeAt(this.state.pos)===10?(++this.state.pos,r=e?` +`:`\r +`):r=String.fromCharCode(s),++this.state.curLine,this.state.lineStart=this.state.pos,r}jsxReadString(e){let s="",r=++this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(c.UnterminatedString,this.state.startLoc);let i=this.input.charCodeAt(this.state.pos);if(i===e)break;i===38?(s+=this.input.slice(r,this.state.pos),s+=this.jsxReadEntity(),r=this.state.pos):te(i)?(s+=this.input.slice(r,this.state.pos),s+=this.jsxReadNewLine(!1),r=this.state.pos):++this.state.pos}s+=this.input.slice(r,this.state.pos++),this.finishToken(134,s)}jsxReadEntity(){let e=++this.state.pos;if(this.codePointAtPos(this.state.pos)===35){++this.state.pos;let s=10;this.codePointAtPos(this.state.pos)===120&&(s=16,++this.state.pos);let r=this.readInt(s,void 0,!1,"bail");if(r!==null&&this.codePointAtPos(this.state.pos)===59)return++this.state.pos,String.fromCodePoint(r)}else{let s=0,r=!1;for(;s++<10&&this.state.pos1){for(let r=0;r0){if(s&256){let i=!!(s&512),a=(r&4)>0;return i!==a}return!0}return s&128&&(r&8)>0?t.names.get(e)&2?!!(s&1):!1:s&2&&(r&1)>0?!0:super.isRedeclaredInScope(t,e,s)}checkLocalExport(t){let{name:e}=t;if(this.hasImport(e))return;let s=this.scopeStack.length;for(let r=s-1;r>=0;r--){let i=this.scopeStack[r].tsNames.get(e);if((i&1)>0||(i&16)>0)return}super.checkLocalExport(t)}},bt=t=>t.type==="ParenthesizedExpression"?bt(t.expression):t,pr=class extends er{toAssignable(t,e=!1){var s,r;let i;switch((t.type==="ParenthesizedExpression"||(s=t.extra)!=null&&s.parenthesized)&&(i=bt(t),e?i.type==="Identifier"?this.expressionScope.recordArrowParameterBindingError(c.InvalidParenthesizedAssignment,t):i.type!=="MemberExpression"&&!this.isOptionalMemberExpression(i)&&this.raise(c.InvalidParenthesizedAssignment,t):this.raise(c.InvalidParenthesizedAssignment,t)),t.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":t.type="ObjectPattern";for(let n=0,o=t.properties.length,l=o-1;nr.type!=="ObjectMethod"&&(i===s||r.type!=="SpreadElement")&&this.isAssignable(r))}case"ObjectProperty":return this.isAssignable(t.value);case"SpreadElement":return this.isAssignable(t.argument);case"ArrayExpression":return t.elements.every(s=>s===null||this.isAssignable(s));case"AssignmentExpression":return t.operator==="=";case"ParenthesizedExpression":return this.isAssignable(t.expression);case"MemberExpression":case"OptionalMemberExpression":return!e;default:return!1}}toReferencedList(t,e){return t}toReferencedListDeep(t,e){this.toReferencedList(t,e);for(let s of t)(s==null?void 0:s.type)==="ArrayExpression"&&this.toReferencedListDeep(s.elements)}parseSpread(t){let e=this.startNode();return this.next(),e.argument=this.parseMaybeAssignAllowIn(t,void 0),this.finishNode(e,"SpreadElement")}parseRestBinding(){let t=this.startNode();return this.next(),t.argument=this.parseBindingAtom(),this.finishNode(t,"RestElement")}parseBindingAtom(){switch(this.state.type){case 0:{let t=this.startNode();return this.next(),t.elements=this.parseBindingList(3,93,1),this.finishNode(t,"ArrayPattern")}case 5:return this.parseObjectLike(8,!0)}return this.parseIdentifier()}parseBindingList(t,e,s){let r=s&1,i=[],a=!0;for(;!this.eat(t);)if(a?a=!1:this.expect(12),r&&this.match(12))i.push(null);else{if(this.eat(t))break;if(this.match(21)){let n=this.parseRestBinding();if((this.hasPlugin("flow")||s&2)&&(n=this.parseFunctionParamType(n)),i.push(n),!this.checkCommaAfterRest(e)){this.expect(t);break}}else{let n=[];for(this.match(26)&&this.hasPlugin("decorators")&&this.raise(c.UnsupportedParameterDecorator,this.state.startLoc);this.match(26);)n.push(this.parseDecorator());i.push(this.parseAssignableListItem(s,n))}}return i}parseBindingRestProperty(t){return this.next(),t.argument=this.parseIdentifier(),this.checkCommaAfterRest(125),this.finishNode(t,"RestElement")}parseBindingProperty(){let{type:t,startLoc:e}=this.state;if(t===21)return this.parseBindingRestProperty(this.startNode());let s=this.startNode();return t===139?(this.expectPlugin("destructuringPrivate",e),this.classScope.usePrivateName(this.state.value,e),s.key=this.parsePrivateName()):this.parsePropertyName(s),s.method=!1,this.parseObjPropValue(s,e,!1,!1,!0,!1)}parseAssignableListItem(t,e){let s=this.parseMaybeDefault();(this.hasPlugin("flow")||t&2)&&this.parseFunctionParamType(s);let r=this.parseMaybeDefault(s.loc.start,s);return e.length&&(s.decorators=e),r}parseFunctionParamType(t){return t}parseMaybeDefault(t,e){var s;if(t!=null||(t=this.state.startLoc),e=(s=e)!=null?s:this.parseBindingAtom(),!this.eat(29))return e;let r=this.startNodeAt(t);return r.left=e,r.right=this.parseMaybeAssignAllowIn(),this.finishNode(r,"AssignmentPattern")}isValidLVal(t,e,s){switch(t){case"AssignmentPattern":return"left";case"RestElement":return"argument";case"ObjectProperty":return"value";case"ParenthesizedExpression":return"expression";case"ArrayPattern":return"elements";case"ObjectPattern":return"properties"}return!1}isOptionalMemberExpression(t){return t.type==="OptionalMemberExpression"}checkLVal(t,e,s=64,r=!1,i=!1,a=!1){var n;let o=t.type;if(this.isObjectMethod(t))return;let l=this.isOptionalMemberExpression(t);if(l||o==="MemberExpression"){l&&(this.expectPlugin("optionalChainingAssign",t.loc.start),e.type!=="AssignmentExpression"&&this.raise(c.InvalidLhsOptionalChaining,t,{ancestor:e})),s!==64&&this.raise(c.InvalidPropertyBindingPattern,t);return}if(o==="Identifier"){this.checkIdentifier(t,s,i);let{name:N}=t;r&&(r.has(N)?this.raise(c.ParamDupe,t):r.add(N));return}let h=this.isValidLVal(o,!(a||(n=t.extra)!=null&&n.parenthesized)&&e.type==="AssignmentExpression",s);if(h===!0)return;if(h===!1){let N=s===64?c.InvalidLhs:c.InvalidLhsBinding;this.raise(N,t,{ancestor:e});return}let d,y;typeof h=="string"?(d=h,y=o==="ParenthesizedExpression"):[d,y]=h;let g=o==="ArrayPattern"||o==="ObjectPattern"?{type:o}:e,b=t[d];if(Array.isArray(b))for(let N of b)N&&this.checkLVal(N,g,s,r,i,y);else b&&this.checkLVal(b,g,s,r,i,y)}checkIdentifier(t,e,s=!1){this.state.strict&&(s?ct(t.name,this.inModule):pt(t.name))&&(e===64?this.raise(c.StrictEvalArguments,t,{referenceName:t.name}):this.raise(c.StrictEvalArgumentsBinding,t,{bindingName:t.name})),e&8192&&t.name==="let"&&this.raise(c.LetInLexicalBinding,t),e&64||this.declareNameFromIdentifier(t,e)}declareNameFromIdentifier(t,e){this.scope.declareName(t.name,e,t.loc.start)}checkToRestConversion(t,e){switch(t.type){case"ParenthesizedExpression":this.checkToRestConversion(t.expression,e);break;case"Identifier":case"MemberExpression":break;case"ArrayExpression":case"ObjectExpression":if(e)break;default:this.raise(c.InvalidRestAssignmentPattern,t)}}checkCommaAfterRest(t){return this.match(12)?(this.raise(this.lookaheadCharCode()===t?c.RestTrailingComma:c.ElementAfterRest,this.state.startLoc),!0):!1}};function cr(t){if(t==null)throw new Error(`Unexpected ${t} value.`);return t}function At(t){if(!t)throw new Error("Assert fail")}var T=H`typescript`({AbstractMethodHasImplementation:({methodName:t})=>`Method '${t}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:t})=>`Property '${t}' cannot have an initializer because it is marked abstract.`,AccessorCannotBeOptional:"An 'accessor' property cannot be declared optional.",AccessorCannotDeclareThisParameter:"'get' and 'set' accessors cannot declare 'this' parameters.",AccessorCannotHaveTypeParameters:"An accessor cannot have type parameters.",ClassMethodHasDeclare:"Class methods cannot have the 'declare' modifier.",ClassMethodHasReadonly:"Class methods cannot have the 'readonly' modifier.",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",ConstructorHasTypeParameters:"Type parameters cannot appear on a constructor declaration.",DeclareAccessor:({kind:t})=>`'declare' is not allowed in ${t}ters.`,DeclareClassFieldHasInitializer:"Initializers are not allowed in ambient contexts.",DeclareFunctionHasImplementation:"An implementation cannot be declared in ambient contexts.",DuplicateAccessibilityModifier:({modifier:t})=>"Accessibility modifier already seen.",DuplicateModifier:({modifier:t})=>`Duplicate modifier: '${t}'.`,EmptyHeritageClauseType:({token:t})=>`'${t}' list cannot be empty.`,EmptyTypeArguments:"Type argument list cannot be empty.",EmptyTypeParameters:"Type parameter list cannot be empty.",ExpectedAmbientAfterExportDeclare:"'export declare' must be followed by an ambient declaration.",ImportAliasHasImportType:"An import alias can not use 'import type'.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` modifier",IncompatibleModifiers:({modifiers:t})=>`'${t[0]}' modifier cannot be used with '${t[1]}' modifier.`,IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:({modifier:t})=>`Index signatures cannot have an accessibility modifier ('${t}').`,IndexSignatureHasDeclare:"Index signatures cannot have the 'declare' modifier.",IndexSignatureHasOverride:"'override' modifier cannot appear on an index signature.",IndexSignatureHasStatic:"Index signatures cannot have the 'static' modifier.",InitializerNotAllowedInAmbientContext:"Initializers are not allowed in ambient contexts.",InvalidModifierOnTypeMember:({modifier:t})=>`'${t}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:t})=>`'${t}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:t})=>`'${t}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifiersOrder:({orderedModifiers:t})=>`'${t[0]}' modifier must precede '${t[1]}' modifier.`,InvalidPropertyAccessAfterInstantiationExpression:"Invalid property access after an instantiation expression. You can either wrap the instantiation expression in parentheses, or delete the type arguments.",InvalidTupleMemberLabel:"Tuple members must be labeled with a simple identifier.",MissingInterfaceName:"'interface' declarations must be followed by an identifier.",NonAbstractClassHasAbstractMethod:"Abstract methods can only appear within an abstract class.",NonClassMethodPropertyHasAbstractModifer:"'abstract' modifier can only appear on a class, method, or property declaration.",OptionalTypeBeforeRequired:"A required element cannot follow an optional element.",OverrideNotInSubClass:"This member cannot have an 'override' modifier because its containing class does not extend another class.",PatternIsOptional:"A binding pattern parameter cannot be optional in an implementation signature.",PrivateElementHasAbstract:"Private elements cannot have the 'abstract' modifier.",PrivateElementHasAccessibility:({modifier:t})=>`Private elements cannot have an accessibility modifier ('${t}').`,ReadonlyForMethodSignature:"'readonly' modifier can only appear on a property declaration or index signature.",ReservedArrowTypeParam:"This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `() => ...`.",ReservedTypeAssertion:"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",SetAccessorCannotHaveOptionalParameter:"A 'set' accessor cannot have an optional parameter.",SetAccessorCannotHaveRestParameter:"A 'set' accessor cannot have rest parameter.",SetAccessorCannotHaveReturnType:"A 'set' accessor cannot have a return type annotation.",SingleTypeParameterWithoutTrailingComma:({typeParameterName:t})=>`Single type parameter ${t} should have a trailing comma. Example usage: <${t},>.`,StaticBlockCannotHaveModifier:"Static class blocks cannot have any modifier.",TupleOptionalAfterType:"A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).",TypeAnnotationAfterAssign:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeImportCannotSpecifyDefaultAndNamed:"A type-only import can specify a default import or named bindings, but not both.",TypeModifierIsUsedInTypeExports:"The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.",TypeModifierIsUsedInTypeImports:"The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.",UnexpectedParameterModifier:"A parameter property is only allowed in a constructor implementation.",UnexpectedReadonly:"'readonly' type modifier is only permitted on array and tuple literal types.",UnexpectedTypeAnnotation:"Did not expect a type annotation here.",UnexpectedTypeCastInParameter:"Unexpected type cast in parameter position.",UnsupportedImportTypeArgument:"Argument in a type import must be a string literal.",UnsupportedParameterPropertyKind:"A parameter property may not be declared using a binding pattern.",UnsupportedSignatureParameterKind:({type:t})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${t}.`});function ur(t){switch(t){case"any":return"TSAnyKeyword";case"boolean":return"TSBooleanKeyword";case"bigint":return"TSBigIntKeyword";case"never":return"TSNeverKeyword";case"number":return"TSNumberKeyword";case"object":return"TSObjectKeyword";case"string":return"TSStringKeyword";case"symbol":return"TSSymbolKeyword";case"undefined":return"TSUndefinedKeyword";case"unknown":return"TSUnknownKeyword";default:return}}function St(t){return t==="private"||t==="public"||t==="protected"}function dr(t){return t==="in"||t==="out"}var mr=t=>class extends t{constructor(...e){super(...e),this.tsParseInOutModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out"],disallowedModifiers:["const","public","private","protected","readonly","declare","abstract","override"],errorTemplate:T.InvalidModifierOnTypeParameter}),this.tsParseConstModifier=this.tsParseModifiers.bind(this,{allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:T.InvalidModifierOnTypeParameterPositions}),this.tsParseInOutConstModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out","const"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:T.InvalidModifierOnTypeParameter})}getScopeHandler(){return hr}tsIsIdentifier(){return k(this.state.type)}tsTokenCanFollowModifier(){return this.match(0)||this.match(5)||this.match(55)||this.match(21)||this.match(139)||this.isLiteralPropertyName()}tsNextTokenOnSameLineAndCanFollowModifier(){return this.next(),this.hasPrecedingLineBreak()?!1:this.tsTokenCanFollowModifier()}tsNextTokenCanFollowModifier(){return this.match(106)?(this.next(),this.tsTokenCanFollowModifier()):this.tsNextTokenOnSameLineAndCanFollowModifier()}tsParseModifier(e,s){if(!k(this.state.type)&&this.state.type!==58&&this.state.type!==75)return;let r=this.state.value;if(e.includes(r)){if(s&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return r}}tsParseModifiers({allowedModifiers:e,disallowedModifiers:s,stopOnStartOfClassStaticBlock:r,errorTemplate:i=T.InvalidModifierOnTypeMember},a){let n=(l,h,d,y)=>{h===d&&a[y]&&this.raise(T.InvalidModifiersOrder,l,{orderedModifiers:[d,y]})},o=(l,h,d,y)=>{(a[d]&&h===y||a[y]&&h===d)&&this.raise(T.IncompatibleModifiers,l,{modifiers:[d,y]})};for(;;){let{startLoc:l}=this.state,h=this.tsParseModifier(e.concat(s??[]),r);if(!h)break;St(h)?a.accessibility?this.raise(T.DuplicateAccessibilityModifier,l,{modifier:h}):(n(l,h,h,"override"),n(l,h,h,"static"),n(l,h,h,"readonly"),a.accessibility=h):dr(h)?(a[h]&&this.raise(T.DuplicateModifier,l,{modifier:h}),a[h]=!0,n(l,h,"in","out")):(hasOwnProperty.call(a,h)?this.raise(T.DuplicateModifier,l,{modifier:h}):(n(l,h,"static","readonly"),n(l,h,"static","override"),n(l,h,"override","readonly"),n(l,h,"abstract","override"),o(l,h,"declare","override"),o(l,h,"static","abstract")),a[h]=!0),s!=null&&s.includes(h)&&this.raise(i,l,{modifier:h})}}tsIsListTerminator(e){switch(e){case"EnumMembers":case"TypeMembers":return this.match(8);case"HeritageClauseElement":return this.match(5);case"TupleElementTypes":return this.match(3);case"TypeParametersOrArguments":return this.match(48)}}tsParseList(e,s){let r=[];for(;!this.tsIsListTerminator(e);)r.push(s());return r}tsParseDelimitedList(e,s,r){return cr(this.tsParseDelimitedListWorker(e,s,!0,r))}tsParseDelimitedListWorker(e,s,r,i){let a=[],n=-1;for(;!this.tsIsListTerminator(e);){n=-1;let o=s();if(o==null)return;if(a.push(o),this.eat(12)){n=this.state.lastTokStartLoc.index;continue}if(this.tsIsListTerminator(e))break;r&&this.expect(12);return}return i&&(i.value=n),a}tsParseBracketedList(e,s,r,i,a){i||(r?this.expect(0):this.expect(47));let n=this.tsParseDelimitedList(e,s,a);return r?this.expect(3):this.expect(48),n}tsParseImportType(){let e=this.startNode();return this.expect(83),this.expect(10),this.match(134)||this.raise(T.UnsupportedImportTypeArgument,this.state.startLoc),e.argument=super.parseExprAtom(),this.eat(12)&&!this.match(11)?(e.options=super.parseMaybeAssignAllowIn(),this.eat(12)):e.options=null,this.expect(11),this.eat(16)&&(e.qualifier=this.tsParseEntityName()),this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSImportType")}tsParseEntityName(e=!0){let s=this.parseIdentifier(e);for(;this.eat(16);){let r=this.startNodeAtNode(s);r.left=s,r.right=this.parseIdentifier(e),s=this.finishNode(r,"TSQualifiedName")}return s}tsParseTypeReference(){let e=this.startNode();return e.typeName=this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeReference")}tsParseThisTypePredicate(e){this.next();let s=this.startNodeAtNode(e);return s.parameterName=e,s.typeAnnotation=this.tsParseTypeAnnotation(!1),s.asserts=!1,this.finishNode(s,"TSTypePredicate")}tsParseThisTypeNode(){let e=this.startNode();return this.next(),this.finishNode(e,"TSThisType")}tsParseTypeQuery(){let e=this.startNode();return this.expect(87),this.match(83)?e.exprName=this.tsParseImportType():e.exprName=this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeQuery")}tsParseTypeParameter(e){let s=this.startNode();return e(s),s.name=this.tsParseTypeParameterName(),s.constraint=this.tsEatThenParseType(81),s.default=this.tsEatThenParseType(29),this.finishNode(s,"TSTypeParameter")}tsTryParseTypeParameters(e){if(this.match(47))return this.tsParseTypeParameters(e)}tsParseTypeParameters(e){let s=this.startNode();this.match(47)||this.match(143)?this.next():this.unexpected();let r={value:-1};return s.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,e),!1,!0,r),s.params.length===0&&this.raise(T.EmptyTypeParameters,s),r.value!==-1&&this.addExtra(s,"trailingComma",r.value),this.finishNode(s,"TSTypeParameterDeclaration")}tsFillSignature(e,s){let r=e===19,i="parameters",a="typeAnnotation";s.typeParameters=this.tsTryParseTypeParameters(this.tsParseConstModifier),this.expect(10),s[i]=this.tsParseBindingListForSignature(),r?s[a]=this.tsParseTypeOrTypePredicateAnnotation(e):this.match(e)&&(s[a]=this.tsParseTypeOrTypePredicateAnnotation(e))}tsParseBindingListForSignature(){let e=super.parseBindingList(11,41,2);for(let s of e){let{type:r}=s;(r==="AssignmentPattern"||r==="TSParameterProperty")&&this.raise(T.UnsupportedSignatureParameterKind,s,{type:r})}return e}tsParseTypeMemberSemicolon(){!this.eat(12)&&!this.isLineTerminator()&&this.expect(13)}tsParseSignatureMember(e,s){return this.tsFillSignature(14,s),this.tsParseTypeMemberSemicolon(),this.finishNode(s,e)}tsIsUnambiguouslyIndexSignature(){return this.next(),k(this.state.type)?(this.next(),this.match(14)):!1}tsTryParseIndexSignature(e){if(!(this.match(0)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(0);let s=this.parseIdentifier();s.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(s),this.expect(3),e.parameters=[s];let r=this.tsTryParseTypeAnnotation();return r&&(e.typeAnnotation=r),this.tsParseTypeMemberSemicolon(),this.finishNode(e,"TSIndexSignature")}tsParsePropertyOrMethodSignature(e,s){this.eat(17)&&(e.optional=!0);let r=e;if(this.match(10)||this.match(47)){s&&this.raise(T.ReadonlyForMethodSignature,e);let i=r;i.kind&&this.match(47)&&this.raise(T.AccessorCannotHaveTypeParameters,this.state.curPosition()),this.tsFillSignature(14,i),this.tsParseTypeMemberSemicolon();let a="parameters",n="typeAnnotation";if(i.kind==="get")i[a].length>0&&(this.raise(c.BadGetterArity,this.state.curPosition()),this.isThisParam(i[a][0])&&this.raise(T.AccessorCannotDeclareThisParameter,this.state.curPosition()));else if(i.kind==="set"){if(i[a].length!==1)this.raise(c.BadSetterArity,this.state.curPosition());else{let o=i[a][0];this.isThisParam(o)&&this.raise(T.AccessorCannotDeclareThisParameter,this.state.curPosition()),o.type==="Identifier"&&o.optional&&this.raise(T.SetAccessorCannotHaveOptionalParameter,this.state.curPosition()),o.type==="RestElement"&&this.raise(T.SetAccessorCannotHaveRestParameter,this.state.curPosition())}i[n]&&this.raise(T.SetAccessorCannotHaveReturnType,i[n])}else i.kind="method";return this.finishNode(i,"TSMethodSignature")}else{let i=r;s&&(i.readonly=!0);let a=this.tsTryParseTypeAnnotation();return a&&(i.typeAnnotation=a),this.tsParseTypeMemberSemicolon(),this.finishNode(i,"TSPropertySignature")}}tsParseTypeMember(){let e=this.startNode();if(this.match(10)||this.match(47))return this.tsParseSignatureMember("TSCallSignatureDeclaration",e);if(this.match(77)){let r=this.startNode();return this.next(),this.match(10)||this.match(47)?this.tsParseSignatureMember("TSConstructSignatureDeclaration",e):(e.key=this.createIdentifier(r,"new"),this.tsParsePropertyOrMethodSignature(e,!1))}return this.tsParseModifiers({allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]},e),this.tsTryParseIndexSignature(e)||(super.parsePropertyName(e),!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.tsTokenCanFollowModifier()&&(e.kind=e.key.name,super.parsePropertyName(e)),this.tsParsePropertyOrMethodSignature(e,!!e.readonly))}tsParseTypeLiteral(){let e=this.startNode();return e.members=this.tsParseObjectTypeMembers(),this.finishNode(e,"TSTypeLiteral")}tsParseObjectTypeMembers(){this.expect(5);let e=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(8),e}tsIsStartOfMappedType(){return this.next(),this.eat(53)?this.isContextual(122):(this.isContextual(122)&&this.next(),!this.match(0)||(this.next(),!this.tsIsIdentifier())?!1:(this.next(),this.match(58)))}tsParseMappedType(){let e=this.startNode();this.expect(5),this.match(53)?(e.readonly=this.state.value,this.next(),this.expectContextual(122)):this.eatContextual(122)&&(e.readonly=!0),this.expect(0);{let s=this.startNode();s.name=this.tsParseTypeParameterName(),s.constraint=this.tsExpectThenParseType(58),e.typeParameter=this.finishNode(s,"TSTypeParameter")}return e.nameType=this.eatContextual(93)?this.tsParseType():null,this.expect(3),this.match(53)?(e.optional=this.state.value,this.next(),this.expect(17)):this.eat(17)&&(e.optional=!0),e.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(8),this.finishNode(e,"TSMappedType")}tsParseTupleType(){let e=this.startNode();e.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let s=!1;return e.elementTypes.forEach(r=>{let{type:i}=r;s&&i!=="TSRestType"&&i!=="TSOptionalType"&&!(i==="TSNamedTupleMember"&&r.optional)&&this.raise(T.OptionalTypeBeforeRequired,r),s||(s=i==="TSNamedTupleMember"&&r.optional||i==="TSOptionalType")}),this.finishNode(e,"TSTupleType")}tsParseTupleElementType(){let{startLoc:e}=this.state,s=this.eat(21),r,i,a,n,o=U(this.state.type)?this.lookaheadCharCode():null;if(o===58)r=!0,a=!1,i=this.parseIdentifier(!0),this.expect(14),n=this.tsParseType();else if(o===63){a=!0;let l=this.state.startLoc,h=this.state.value,d=this.tsParseNonArrayType();this.lookaheadCharCode()===58?(r=!0,i=this.createIdentifier(this.startNodeAt(l),h),this.expect(17),this.expect(14),n=this.tsParseType()):(r=!1,n=d,this.expect(17))}else n=this.tsParseType(),a=this.eat(17),r=this.eat(14);if(r){let l;i?(l=this.startNodeAtNode(i),l.optional=a,l.label=i,l.elementType=n,this.eat(17)&&(l.optional=!0,this.raise(T.TupleOptionalAfterType,this.state.lastTokStartLoc))):(l=this.startNodeAtNode(n),l.optional=a,this.raise(T.InvalidTupleMemberLabel,n),l.label=n,l.elementType=this.tsParseType()),n=this.finishNode(l,"TSNamedTupleMember")}else if(a){let l=this.startNodeAtNode(n);l.typeAnnotation=n,n=this.finishNode(l,"TSOptionalType")}if(s){let l=this.startNodeAt(e);l.typeAnnotation=n,n=this.finishNode(l,"TSRestType")}return n}tsParseParenthesizedType(){let e=this.startNode();return this.expect(10),e.typeAnnotation=this.tsParseType(),this.expect(11),this.finishNode(e,"TSParenthesizedType")}tsParseFunctionOrConstructorType(e,s){let r=this.startNode();return e==="TSConstructorType"&&(r.abstract=!!s,s&&this.next(),this.next()),this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(19,r)),this.finishNode(r,e)}tsParseLiteralTypeNode(){let e=this.startNode();switch(this.state.type){case 135:case 136:case 134:case 85:case 86:e.literal=super.parseExprAtom();break;default:this.unexpected()}return this.finishNode(e,"TSLiteralType")}tsParseTemplateLiteralType(){let e=this.startNode();return e.literal=super.parseTemplate(!1),this.finishNode(e,"TSLiteralType")}parseTemplateSubstitution(){return this.state.inType?this.tsParseType():super.parseTemplateSubstitution()}tsParseThisTypeOrThisTypePredicate(){let e=this.tsParseThisTypeNode();return this.isContextual(116)&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(e):e}tsParseNonArrayType(){switch(this.state.type){case 134:case 135:case 136:case 85:case 86:return this.tsParseLiteralTypeNode();case 53:if(this.state.value==="-"){let e=this.startNode(),s=this.lookahead();return s.type!==135&&s.type!==136&&this.unexpected(),e.literal=this.parseMaybeUnary(),this.finishNode(e,"TSLiteralType")}break;case 78:return this.tsParseThisTypeOrThisTypePredicate();case 87:return this.tsParseTypeQuery();case 83:return this.tsParseImportType();case 5:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case 0:return this.tsParseTupleType();case 10:return this.tsParseParenthesizedType();case 25:case 24:return this.tsParseTemplateLiteralType();default:{let{type:e}=this.state;if(k(e)||e===88||e===84){let s=e===88?"TSVoidKeyword":e===84?"TSNullKeyword":ur(this.state.value);if(s!==void 0&&this.lookaheadCharCode()!==46){let r=this.startNode();return this.next(),this.finishNode(r,s)}return this.tsParseTypeReference()}}}this.unexpected()}tsParseArrayTypeOrHigher(){let e=this.tsParseNonArrayType();for(;!this.hasPrecedingLineBreak()&&this.eat(0);)if(this.match(3)){let s=this.startNodeAtNode(e);s.elementType=e,this.expect(3),e=this.finishNode(s,"TSArrayType")}else{let s=this.startNodeAtNode(e);s.objectType=e,s.indexType=this.tsParseType(),this.expect(3),e=this.finishNode(s,"TSIndexedAccessType")}return e}tsParseTypeOperator(){let e=this.startNode(),s=this.state.value;return this.next(),e.operator=s,e.typeAnnotation=this.tsParseTypeOperatorOrHigher(),s==="readonly"&&this.tsCheckTypeAnnotationForReadOnly(e),this.finishNode(e,"TSTypeOperator")}tsCheckTypeAnnotationForReadOnly(e){switch(e.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(T.UnexpectedReadonly,e)}}tsParseInferType(){let e=this.startNode();this.expectContextual(115);let s=this.startNode();return s.name=this.tsParseTypeParameterName(),s.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),e.typeParameter=this.finishNode(s,"TSTypeParameter"),this.finishNode(e,"TSInferType")}tsParseConstraintForInferType(){if(this.eat(81)){let e=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.state.inDisallowConditionalTypesContext||!this.match(17))return e}}tsParseTypeOperatorOrHigher(){return Ps(this.state.type)&&!this.state.containsEsc?this.tsParseTypeOperator():this.isContextual(115)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseUnionOrIntersectionType(e,s,r){let i=this.startNode(),a=this.eat(r),n=[];do n.push(s());while(this.eat(r));return n.length===1&&!a?n[0]:(i.types=n,this.finishNode(i,e))}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),45)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),43)}tsIsStartOfFunctionType(){return this.match(47)?!0:this.match(10)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsSkipParameterStart(){if(k(this.state.type)||this.match(78))return this.next(),!0;if(this.match(5)){let{errors:e}=this.state,s=e.length;try{return this.parseObjectLike(8,!0),e.length===s}catch{return!1}}if(this.match(0)){this.next();let{errors:e}=this.state,s=e.length;try{return super.parseBindingList(3,93,1),e.length===s}catch{return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){return this.next(),!!(this.match(11)||this.match(21)||this.tsSkipParameterStart()&&(this.match(14)||this.match(12)||this.match(17)||this.match(29)||this.match(11)&&(this.next(),this.match(19))))}tsParseTypeOrTypePredicateAnnotation(e){return this.tsInType(()=>{let s=this.startNode();this.expect(e);let r=this.startNode(),i=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(i&&this.match(78)){let o=this.tsParseThisTypeOrThisTypePredicate();return o.type==="TSThisType"?(r.parameterName=o,r.asserts=!0,r.typeAnnotation=null,o=this.finishNode(r,"TSTypePredicate")):(this.resetStartLocationFromNode(o,r),o.asserts=!0),s.typeAnnotation=o,this.finishNode(s,"TSTypeAnnotation")}let a=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!a)return i?(r.parameterName=this.parseIdentifier(),r.asserts=i,r.typeAnnotation=null,s.typeAnnotation=this.finishNode(r,"TSTypePredicate"),this.finishNode(s,"TSTypeAnnotation")):this.tsParseTypeAnnotation(!1,s);let n=this.tsParseTypeAnnotation(!1);return r.parameterName=a,r.typeAnnotation=n,r.asserts=i,s.typeAnnotation=this.finishNode(r,"TSTypePredicate"),this.finishNode(s,"TSTypeAnnotation")})}tsTryParseTypeOrTypePredicateAnnotation(){if(this.match(14))return this.tsParseTypeOrTypePredicateAnnotation(14)}tsTryParseTypeAnnotation(){if(this.match(14))return this.tsParseTypeAnnotation()}tsTryParseType(){return this.tsEatThenParseType(14)}tsParseTypePredicatePrefix(){let e=this.parseIdentifier();if(this.isContextual(116)&&!this.hasPrecedingLineBreak())return this.next(),e}tsParseTypePredicateAsserts(){if(this.state.type!==109)return!1;let e=this.state.containsEsc;return this.next(),!k(this.state.type)&&!this.match(78)?!1:(e&&this.raise(c.InvalidEscapedReservedWord,this.state.lastTokStartLoc,{reservedWord:"asserts"}),!0)}tsParseTypeAnnotation(e=!0,s=this.startNode()){return this.tsInType(()=>{e&&this.expect(14),s.typeAnnotation=this.tsParseType()}),this.finishNode(s,"TSTypeAnnotation")}tsParseType(){At(this.state.inType);let e=this.tsParseNonConditionalType();if(this.state.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(81))return e;let s=this.startNodeAtNode(e);return s.checkType=e,s.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(17),s.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(14),s.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(s,"TSConditionalType")}isAbstractConstructorSignature(){return this.isContextual(124)&&this.lookahead().type===77}tsParseNonConditionalType(){return this.tsIsStartOfFunctionType()?this.tsParseFunctionOrConstructorType("TSFunctionType"):this.match(77)?this.tsParseFunctionOrConstructorType("TSConstructorType"):this.isAbstractConstructorSignature()?this.tsParseFunctionOrConstructorType("TSConstructorType",!0):this.tsParseUnionTypeOrHigher()}tsParseTypeAssertion(){this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(T.ReservedTypeAssertion,this.state.startLoc);let e=this.startNode();return e.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?this.tsParseTypeReference():this.tsParseType())),this.expect(48),e.expression=this.parseMaybeUnary(),this.finishNode(e,"TSTypeAssertion")}tsParseHeritageClause(e){let s=this.state.startLoc,r=this.tsParseDelimitedList("HeritageClauseElement",()=>{let i=this.startNode();return i.expression=this.tsParseEntityName(),this.match(47)&&(i.typeParameters=this.tsParseTypeArguments()),this.finishNode(i,"TSExpressionWithTypeArguments")});return r.length||this.raise(T.EmptyHeritageClauseType,s,{token:e}),r}tsParseInterfaceDeclaration(e,s={}){if(this.hasFollowingLineBreak())return null;this.expectContextual(129),s.declare&&(e.declare=!0),k(this.state.type)?(e.id=this.parseIdentifier(),this.checkIdentifier(e.id,130)):(e.id=null,this.raise(T.MissingInterfaceName,this.state.startLoc)),e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers),this.eat(81)&&(e.extends=this.tsParseHeritageClause("extends"));let r=this.startNode();return r.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),e.body=this.finishNode(r,"TSInterfaceBody"),this.finishNode(e,"TSInterfaceDeclaration")}tsParseTypeAliasDeclaration(e){return e.id=this.parseIdentifier(),this.checkIdentifier(e.id,2),e.typeAnnotation=this.tsInType(()=>{if(e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers),this.expect(29),this.isContextual(114)&&this.lookahead().type!==16){let s=this.startNode();return this.next(),this.finishNode(s,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(e,"TSTypeAliasDeclaration")}tsInNoContext(e){let s=this.state.context;this.state.context=[s[0]];try{return e()}finally{this.state.context=s}}tsInType(e){let s=this.state.inType;this.state.inType=!0;try{return e()}finally{this.state.inType=s}}tsInDisallowConditionalTypesContext(e){let s=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!0;try{return e()}finally{this.state.inDisallowConditionalTypesContext=s}}tsInAllowConditionalTypesContext(e){let s=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!1;try{return e()}finally{this.state.inDisallowConditionalTypesContext=s}}tsEatThenParseType(e){if(this.match(e))return this.tsNextThenParseType()}tsExpectThenParseType(e){return this.tsInType(()=>(this.expect(e),this.tsParseType()))}tsNextThenParseType(){return this.tsInType(()=>(this.next(),this.tsParseType()))}tsParseEnumMember(){let e=this.startNode();return e.id=this.match(134)?super.parseStringLiteral(this.state.value):this.parseIdentifier(!0),this.eat(29)&&(e.initializer=super.parseMaybeAssignAllowIn()),this.finishNode(e,"TSEnumMember")}tsParseEnumDeclaration(e,s={}){return s.const&&(e.const=!0),s.declare&&(e.declare=!0),this.expectContextual(126),e.id=this.parseIdentifier(),this.checkIdentifier(e.id,e.const?8971:8459),this.expect(5),e.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(8),this.finishNode(e,"TSEnumDeclaration")}tsParseModuleBlock(){let e=this.startNode();return this.scope.enter(0),this.expect(5),super.parseBlockOrModuleBlockBody(e.body=[],void 0,!0,8),this.scope.exit(),this.finishNode(e,"TSModuleBlock")}tsParseModuleOrNamespaceDeclaration(e,s=!1){if(e.id=this.parseIdentifier(),s||this.checkIdentifier(e.id,1024),this.eat(16)){let r=this.startNode();this.tsParseModuleOrNamespaceDeclaration(r,!0),e.body=r}else this.scope.enter(256),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit();return this.finishNode(e,"TSModuleDeclaration")}tsParseAmbientExternalModuleDeclaration(e){return this.isContextual(112)?(e.kind="global",e.global=!0,e.id=this.parseIdentifier()):this.match(134)?(e.kind="module",e.id=super.parseStringLiteral(this.state.value)):this.unexpected(),this.match(5)?(this.scope.enter(256),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit()):this.semicolon(),this.finishNode(e,"TSModuleDeclaration")}tsParseImportEqualsDeclaration(e,s,r){e.isExport=r||!1,e.id=s||this.parseIdentifier(),this.checkIdentifier(e.id,4096),this.expect(29);let i=this.tsParseModuleReference();return e.importKind==="type"&&i.type!=="TSExternalModuleReference"&&this.raise(T.ImportAliasHasImportType,i),e.moduleReference=i,this.semicolon(),this.finishNode(e,"TSImportEqualsDeclaration")}tsIsExternalModuleReference(){return this.isContextual(119)&&this.lookaheadCharCode()===40}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(!1)}tsParseExternalModuleReference(){let e=this.startNode();return this.expectContextual(119),this.expect(10),this.match(134)||this.unexpected(),e.expression=super.parseExprAtom(),this.expect(11),this.sawUnambiguousESM=!0,this.finishNode(e,"TSExternalModuleReference")}tsLookAhead(e){let s=this.state.clone(),r=e();return this.state=s,r}tsTryParseAndCatch(e){let s=this.tryParse(r=>e()||r());if(!(s.aborted||!s.node))return s.error&&(this.state=s.failState),s.node}tsTryParse(e){let s=this.state.clone(),r=e();if(r!==void 0&&r!==!1)return r;this.state=s}tsTryParseDeclare(e){if(this.isLineTerminator())return;let s=this.state.type,r;return this.isContextual(100)&&(s=74,r="let"),this.tsInAmbientContext(()=>{switch(s){case 68:return e.declare=!0,super.parseFunctionStatement(e,!1,!1);case 80:return e.declare=!0,this.parseClass(e,!0,!1);case 126:return this.tsParseEnumDeclaration(e,{declare:!0});case 112:return this.tsParseAmbientExternalModuleDeclaration(e);case 75:case 74:return!this.match(75)||!this.isLookaheadContextual("enum")?(e.declare=!0,this.parseVarStatement(e,r||this.state.value,!0)):(this.expect(75),this.tsParseEnumDeclaration(e,{const:!0,declare:!0}));case 129:{let i=this.tsParseInterfaceDeclaration(e,{declare:!0});if(i)return i}default:if(k(s))return this.tsParseDeclaration(e,this.state.value,!0,null)}})}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.state.value,!0,null)}tsParseExpressionStatement(e,s,r){switch(s.name){case"declare":{let i=this.tsTryParseDeclare(e);return i&&(i.declare=!0),i}case"global":if(this.match(5)){this.scope.enter(256),this.prodParam.enter(0);let i=e;return i.kind="global",i.global=!0,i.id=s,i.body=this.tsParseModuleBlock(),this.scope.exit(),this.prodParam.exit(),this.finishNode(i,"TSModuleDeclaration")}break;default:return this.tsParseDeclaration(e,s.name,!1,r)}}tsParseDeclaration(e,s,r,i){switch(s){case"abstract":if(this.tsCheckLineTerminator(r)&&(this.match(80)||k(this.state.type)))return this.tsParseAbstractDeclaration(e,i);break;case"module":if(this.tsCheckLineTerminator(r)){if(this.match(134))return this.tsParseAmbientExternalModuleDeclaration(e);if(k(this.state.type))return e.kind="module",this.tsParseModuleOrNamespaceDeclaration(e)}break;case"namespace":if(this.tsCheckLineTerminator(r)&&k(this.state.type))return e.kind="namespace",this.tsParseModuleOrNamespaceDeclaration(e);break;case"type":if(this.tsCheckLineTerminator(r)&&k(this.state.type))return this.tsParseTypeAliasDeclaration(e);break}}tsCheckLineTerminator(e){return e?this.hasFollowingLineBreak()?!1:(this.next(),!0):!this.isLineTerminator()}tsTryParseGenericAsyncArrowFunction(e){if(!this.match(47))return;let s=this.state.maybeInArrowParameters;this.state.maybeInArrowParameters=!0;let r=this.tsTryParseAndCatch(()=>{let i=this.startNodeAt(e);return i.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(i),i.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(19),i});if(this.state.maybeInArrowParameters=s,!!r)return super.parseArrowExpression(r,null,!0)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()===47)return this.tsParseTypeArguments()}tsParseTypeArguments(){let e=this.startNode();return e.params=this.tsInType(()=>this.tsInNoContext(()=>(this.expect(47),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))))),e.params.length===0?this.raise(T.EmptyTypeArguments,e):!this.state.inType&&this.curContext()===M.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(e,"TSTypeParameterInstantiation")}tsIsDeclarationStart(){return gs(this.state.type)}isExportDefaultSpecifier(){return this.tsIsDeclarationStart()?!1:super.isExportDefaultSpecifier()}parseAssignableListItem(e,s){let r=this.state.startLoc,i={};this.tsParseModifiers({allowedModifiers:["public","private","protected","override","readonly"]},i);let a=i.accessibility,n=i.override,o=i.readonly;!(e&4)&&(a||o||n)&&this.raise(T.UnexpectedParameterModifier,r);let l=this.parseMaybeDefault();e&2&&this.parseFunctionParamType(l);let h=this.parseMaybeDefault(l.loc.start,l);if(a||o||n){let d=this.startNodeAt(r);return s.length&&(d.decorators=s),a&&(d.accessibility=a),o&&(d.readonly=o),n&&(d.override=n),h.type!=="Identifier"&&h.type!=="AssignmentPattern"&&this.raise(T.UnsupportedParameterPropertyKind,d),d.parameter=h,this.finishNode(d,"TSParameterProperty")}return s.length&&(l.decorators=s),h}isSimpleParameter(e){return e.type==="TSParameterProperty"&&super.isSimpleParameter(e.parameter)||super.isSimpleParameter(e)}tsDisallowOptionalPattern(e){for(let s of e.params)s.type!=="Identifier"&&s.optional&&!this.state.isAmbientContext&&this.raise(T.PatternIsOptional,s)}setArrowFunctionParameters(e,s,r){super.setArrowFunctionParameters(e,s,r),this.tsDisallowOptionalPattern(e)}parseFunctionBodyAndFinish(e,s,r=!1){this.match(14)&&(e.returnType=this.tsParseTypeOrTypePredicateAnnotation(14));let i=s==="FunctionDeclaration"?"TSDeclareFunction":s==="ClassMethod"||s==="ClassPrivateMethod"?"TSDeclareMethod":void 0;return i&&!this.match(5)&&this.isLineTerminator()?this.finishNode(e,i):i==="TSDeclareFunction"&&this.state.isAmbientContext&&(this.raise(T.DeclareFunctionHasImplementation,e),e.declare)?super.parseFunctionBodyAndFinish(e,i,r):(this.tsDisallowOptionalPattern(e),super.parseFunctionBodyAndFinish(e,s,r))}registerFunctionStatementId(e){!e.body&&e.id?this.checkIdentifier(e.id,1024):super.registerFunctionStatementId(e)}tsCheckForInvalidTypeCasts(e){e.forEach(s=>{(s==null?void 0:s.type)==="TSTypeCastExpression"&&this.raise(T.UnexpectedTypeAnnotation,s.typeAnnotation)})}toReferencedList(e,s){return this.tsCheckForInvalidTypeCasts(e),e}parseArrayLike(e,s,r,i){let a=super.parseArrayLike(e,s,r,i);return a.type==="ArrayExpression"&&this.tsCheckForInvalidTypeCasts(a.elements),a}parseSubscript(e,s,r,i){if(!this.hasPrecedingLineBreak()&&this.match(35)){this.state.canStartJSXElement=!1,this.next();let n=this.startNodeAt(s);return n.expression=e,this.finishNode(n,"TSNonNullExpression")}let a=!1;if(this.match(18)&&this.lookaheadCharCode()===60){if(r)return i.stop=!0,e;i.optionalChainMember=a=!0,this.next()}if(this.match(47)||this.match(51)){let n,o=this.tsTryParseAndCatch(()=>{if(!r&&this.atPossibleAsyncArrow(e)){let y=this.tsTryParseGenericAsyncArrowFunction(s);if(y)return y}let l=this.tsParseTypeArgumentsInExpression();if(!l)return;if(a&&!this.match(10)){n=this.state.curPosition();return}if(xe(this.state.type)){let y=super.parseTaggedTemplateExpression(e,s,i);return y.typeParameters=l,y}if(!r&&this.eat(10)){let y=this.startNodeAt(s);return y.callee=e,y.arguments=this.parseCallExpressionArguments(11),this.tsCheckForInvalidTypeCasts(y.arguments),y.typeParameters=l,i.optionalChainMember&&(y.optional=a),this.finishCallExpression(y,i.optionalChainMember)}let h=this.state.type;if(h===48||h===52||h!==10&&De(h)&&!this.hasPrecedingLineBreak())return;let d=this.startNodeAt(s);return d.expression=e,d.typeParameters=l,this.finishNode(d,"TSInstantiationExpression")});if(n&&this.unexpected(n,10),o)return o.type==="TSInstantiationExpression"&&(this.match(16)||this.match(18)&&this.lookaheadCharCode()!==40)&&this.raise(T.InvalidPropertyAccessAfterInstantiationExpression,this.state.startLoc),o}return super.parseSubscript(e,s,r,i)}parseNewCallee(e){var s;super.parseNewCallee(e);let{callee:r}=e;r.type==="TSInstantiationExpression"&&!((s=r.extra)!=null&&s.parenthesized)&&(e.typeParameters=r.typeParameters,e.callee=r.expression)}parseExprOp(e,s,r){let i;if(ye(58)>r&&!this.hasPrecedingLineBreak()&&(this.isContextual(93)||(i=this.isContextual(120)))){let a=this.startNodeAt(s);return a.expression=e,a.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?(i&&this.raise(c.UnexpectedKeyword,this.state.startLoc,{keyword:"const"}),this.tsParseTypeReference()):this.tsParseType())),this.finishNode(a,i?"TSSatisfiesExpression":"TSAsExpression"),this.reScan_lt_gt(),this.parseExprOp(a,s,r)}return super.parseExprOp(e,s,r)}checkReservedWord(e,s,r,i){this.state.isAmbientContext||super.checkReservedWord(e,s,r,i)}checkImportReflection(e){super.checkImportReflection(e),e.module&&e.importKind!=="value"&&this.raise(T.ImportReflectionHasImportType,e.specifiers[0].loc.start)}checkDuplicateExports(){}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(130)){let s=this.lookaheadCharCode();return e?s===123||s===42:s!==61}return!e&&this.isContextual(87)}applyImportPhase(e,s,r,i){super.applyImportPhase(e,s,r,i),s?e.exportKind=r==="type"?"type":"value":e.importKind=r==="type"||r==="typeof"?r:"value"}parseImport(e){if(this.match(134))return e.importKind="value",super.parseImport(e);let s;if(k(this.state.type)&&this.lookaheadCharCode()===61)return e.importKind="value",this.tsParseImportEqualsDeclaration(e);if(this.isContextual(130)){let r=this.parseMaybeImportPhase(e,!1);if(this.lookaheadCharCode()===61)return this.tsParseImportEqualsDeclaration(e,r);s=super.parseImportSpecifiersAndAfter(e,r)}else s=super.parseImport(e);return s.importKind==="type"&&s.specifiers.length>1&&s.specifiers[0].type==="ImportDefaultSpecifier"&&this.raise(T.TypeImportCannotSpecifyDefaultAndNamed,s),s}parseExport(e,s){if(this.match(83)){this.next();let r=e,i=null;return this.isContextual(130)&&this.isPotentialImportPhase(!1)?i=this.parseMaybeImportPhase(r,!1):r.importKind="value",this.tsParseImportEqualsDeclaration(r,i,!0)}else if(this.eat(29)){let r=e;return r.expression=super.parseExpression(),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(r,"TSExportAssignment")}else if(this.eatContextual(93)){let r=e;return this.expectContextual(128),r.id=this.parseIdentifier(),this.semicolon(),this.finishNode(r,"TSNamespaceExportDeclaration")}else return super.parseExport(e,s)}isAbstractClass(){return this.isContextual(124)&&this.lookahead().type===80}parseExportDefaultExpression(){if(this.isAbstractClass()){let e=this.startNode();return this.next(),e.abstract=!0,this.parseClass(e,!0,!0)}if(this.match(129)){let e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return e}return super.parseExportDefaultExpression()}parseVarStatement(e,s,r=!1){let{isAmbientContext:i}=this.state,a=super.parseVarStatement(e,s,r||i);if(!i)return a;for(let{id:n,init:o}of a.declarations)o&&(s!=="const"||n.typeAnnotation?this.raise(T.InitializerNotAllowedInAmbientContext,o):yr(o,this.hasPlugin("estree"))||this.raise(T.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference,o));return a}parseStatementContent(e,s){if(this.match(75)&&this.isLookaheadContextual("enum")){let r=this.startNode();return this.expect(75),this.tsParseEnumDeclaration(r,{const:!0})}if(this.isContextual(126))return this.tsParseEnumDeclaration(this.startNode());if(this.isContextual(129)){let r=this.tsParseInterfaceDeclaration(this.startNode());if(r)return r}return super.parseStatementContent(e,s)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}tsHasSomeModifiers(e,s){return s.some(r=>St(r)?e.accessibility===r:!!e[r])}tsIsStartOfStaticBlocks(){return this.isContextual(106)&&this.lookaheadCharCode()===123}parseClassMember(e,s,r){let i=["declare","private","public","protected","override","abstract","readonly","static"];this.tsParseModifiers({allowedModifiers:i,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:T.InvalidModifierOnTypeParameterPositions},s);let a=()=>{this.tsIsStartOfStaticBlocks()?(this.next(),this.next(),this.tsHasSomeModifiers(s,i)&&this.raise(T.StaticBlockCannotHaveModifier,this.state.curPosition()),super.parseClassStaticBlock(e,s)):this.parseClassMemberWithIsStatic(e,s,r,!!s.static)};s.declare?this.tsInAmbientContext(a):a()}parseClassMemberWithIsStatic(e,s,r,i){let a=this.tsTryParseIndexSignature(s);if(a){e.body.push(a),s.abstract&&this.raise(T.IndexSignatureHasAbstract,s),s.accessibility&&this.raise(T.IndexSignatureHasAccessibility,s,{modifier:s.accessibility}),s.declare&&this.raise(T.IndexSignatureHasDeclare,s),s.override&&this.raise(T.IndexSignatureHasOverride,s);return}!this.state.inAbstractClass&&s.abstract&&this.raise(T.NonAbstractClassHasAbstractMethod,s),s.override&&(r.hadSuperClass||this.raise(T.OverrideNotInSubClass,s)),super.parseClassMemberWithIsStatic(e,s,r,i)}parsePostMemberNameModifiers(e){this.eat(17)&&(e.optional=!0),e.readonly&&this.match(10)&&this.raise(T.ClassMethodHasReadonly,e),e.declare&&this.match(10)&&this.raise(T.ClassMethodHasDeclare,e)}parseExpressionStatement(e,s,r){return(s.type==="Identifier"?this.tsParseExpressionStatement(e,s,r):void 0)||super.parseExpressionStatement(e,s,r)}shouldParseExportDeclaration(){return this.tsIsDeclarationStart()?!0:super.shouldParseExportDeclaration()}parseConditional(e,s,r){if(!this.state.maybeInArrowParameters||!this.match(17))return super.parseConditional(e,s,r);let i=this.tryParse(()=>super.parseConditional(e,s));return i.node?(i.error&&(this.state=i.failState),i.node):(i.error&&super.setOptionalParametersError(r,i.error),e)}parseParenItem(e,s){let r=super.parseParenItem(e,s);if(this.eat(17)&&(r.optional=!0,this.resetEndLocation(e)),this.match(14)){let i=this.startNodeAt(s);return i.expression=e,i.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(i,"TSTypeCastExpression")}return e}parseExportDeclaration(e){if(!this.state.isAmbientContext&&this.isContextual(125))return this.tsInAmbientContext(()=>this.parseExportDeclaration(e));let s=this.state.startLoc,r=this.eatContextual(125);if(r&&(this.isContextual(125)||!this.shouldParseExportDeclaration()))throw this.raise(T.ExpectedAmbientAfterExportDeclare,this.state.startLoc);let i=k(this.state.type)&&this.tsTryParseExportDeclaration()||super.parseExportDeclaration(e);return i?((i.type==="TSInterfaceDeclaration"||i.type==="TSTypeAliasDeclaration"||r)&&(e.exportKind="type"),r&&(this.resetStartLocation(i,s),i.declare=!0),i):null}parseClassId(e,s,r,i){if((!s||r)&&this.isContextual(113))return;super.parseClassId(e,s,r,e.declare?1024:8331);let a=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);a&&(e.typeParameters=a)}parseClassPropertyAnnotation(e){e.optional||(this.eat(35)?e.definite=!0:this.eat(17)&&(e.optional=!0));let s=this.tsTryParseTypeAnnotation();s&&(e.typeAnnotation=s)}parseClassProperty(e){if(this.parseClassPropertyAnnotation(e),this.state.isAmbientContext&&!(e.readonly&&!e.typeAnnotation)&&this.match(29)&&this.raise(T.DeclareClassFieldHasInitializer,this.state.startLoc),e.abstract&&this.match(29)){let{key:s}=e;this.raise(T.AbstractPropertyHasInitializer,this.state.startLoc,{propertyName:s.type==="Identifier"&&!e.computed?s.name:`[${this.input.slice(this.offsetToSourcePos(s.start),this.offsetToSourcePos(s.end))}]`})}return super.parseClassProperty(e)}parseClassPrivateProperty(e){return e.abstract&&this.raise(T.PrivateElementHasAbstract,e),e.accessibility&&this.raise(T.PrivateElementHasAccessibility,e,{modifier:e.accessibility}),this.parseClassPropertyAnnotation(e),super.parseClassPrivateProperty(e)}parseClassAccessorProperty(e){return this.parseClassPropertyAnnotation(e),e.optional&&this.raise(T.AccessorCannotBeOptional,e),super.parseClassAccessorProperty(e)}pushClassMethod(e,s,r,i,a,n){let o=this.tsTryParseTypeParameters(this.tsParseConstModifier);o&&a&&this.raise(T.ConstructorHasTypeParameters,o);let{declare:l=!1,kind:h}=s;l&&(h==="get"||h==="set")&&this.raise(T.DeclareAccessor,s,{kind:h}),o&&(s.typeParameters=o),super.pushClassMethod(e,s,r,i,a,n)}pushClassPrivateMethod(e,s,r,i){let a=this.tsTryParseTypeParameters(this.tsParseConstModifier);a&&(s.typeParameters=a),super.pushClassPrivateMethod(e,s,r,i)}declareClassPrivateMethodInScope(e,s){e.type!=="TSDeclareMethod"&&(e.type==="MethodDefinition"&&!hasOwnProperty.call(e.value,"body")||super.declareClassPrivateMethodInScope(e,s))}parseClassSuper(e){super.parseClassSuper(e),e.superClass&&(this.match(47)||this.match(51))&&(e.superTypeParameters=this.tsParseTypeArgumentsInExpression()),this.eatContextual(113)&&(e.implements=this.tsParseHeritageClause("implements"))}parseObjPropValue(e,s,r,i,a,n,o){let l=this.tsTryParseTypeParameters(this.tsParseConstModifier);return l&&(e.typeParameters=l),super.parseObjPropValue(e,s,r,i,a,n,o)}parseFunctionParams(e,s){let r=this.tsTryParseTypeParameters(this.tsParseConstModifier);r&&(e.typeParameters=r),super.parseFunctionParams(e,s)}parseVarId(e,s){super.parseVarId(e,s),e.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.eat(35)&&(e.definite=!0);let r=this.tsTryParseTypeAnnotation();r&&(e.id.typeAnnotation=r,this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,s){return this.match(14)&&(e.returnType=this.tsParseTypeAnnotation()),super.parseAsyncArrowFromCallExpression(e,s)}parseMaybeAssign(e,s){var r,i,a,n,o;let l,h,d;if(this.hasPlugin("jsx")&&(this.match(143)||this.match(47))){if(l=this.state.clone(),h=this.tryParse(()=>super.parseMaybeAssign(e,s),l),!h.error)return h.node;let{context:b}=this.state,N=b[b.length-1];(N===M.j_oTag||N===M.j_expr)&&b.pop()}if(!((r=h)!=null&&r.error)&&!this.match(47))return super.parseMaybeAssign(e,s);(!l||l===this.state)&&(l=this.state.clone());let y,g=this.tryParse(b=>{var N,D;y=this.tsParseTypeParameters(this.tsParseConstModifier);let L=super.parseMaybeAssign(e,s);return(L.type!=="ArrowFunctionExpression"||(N=L.extra)!=null&&N.parenthesized)&&b(),((D=y)==null?void 0:D.params.length)!==0&&this.resetStartLocationFromNode(L,y),L.typeParameters=y,L},l);if(!g.error&&!g.aborted)return y&&this.reportReservedArrowTypeParam(y),g.node;if(!h&&(At(!this.hasPlugin("jsx")),d=this.tryParse(()=>super.parseMaybeAssign(e,s),l),!d.error))return d.node;if((i=h)!=null&&i.node)return this.state=h.failState,h.node;if(g.node)return this.state=g.failState,y&&this.reportReservedArrowTypeParam(y),g.node;if((a=d)!=null&&a.node)return this.state=d.failState,d.node;throw((n=h)==null?void 0:n.error)||g.error||((o=d)==null?void 0:o.error)}reportReservedArrowTypeParam(e){var s;e.params.length===1&&!e.params[0].constraint&&!((s=e.extra)!=null&&s.trailingComma)&&this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(T.ReservedArrowTypeParam,e)}parseMaybeUnary(e,s){return!this.hasPlugin("jsx")&&this.match(47)?this.tsParseTypeAssertion():super.parseMaybeUnary(e,s)}parseArrow(e){if(this.match(14)){let s=this.tryParse(r=>{let i=this.tsParseTypeOrTypePredicateAnnotation(14);return(this.canInsertSemicolon()||!this.match(19))&&r(),i});if(s.aborted)return;s.thrown||(s.error&&(this.state=s.failState),e.returnType=s.node)}return super.parseArrow(e)}parseFunctionParamType(e){this.eat(17)&&(e.optional=!0);let s=this.tsTryParseTypeAnnotation();return s&&(e.typeAnnotation=s),this.resetEndLocation(e),e}isAssignable(e,s){switch(e.type){case"TSTypeCastExpression":return this.isAssignable(e.expression,s);case"TSParameterProperty":return!0;default:return super.isAssignable(e,s)}}toAssignable(e,s=!1){switch(e.type){case"ParenthesizedExpression":this.toAssignableParenthesizedExpression(e,s);break;case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":s?this.expressionScope.recordArrowParameterBindingError(T.UnexpectedTypeCastInParameter,e):this.raise(T.UnexpectedTypeCastInParameter,e),this.toAssignable(e.expression,s);break;case"AssignmentExpression":!s&&e.left.type==="TSTypeCastExpression"&&(e.left=this.typeCastToParameter(e.left));default:super.toAssignable(e,s)}}toAssignableParenthesizedExpression(e,s){switch(e.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":this.toAssignable(e.expression,s);break;default:super.toAssignable(e,s)}}checkToRestConversion(e,s){switch(e.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":this.checkToRestConversion(e.expression,!1);break;default:super.checkToRestConversion(e,s)}}isValidLVal(e,s,r){switch(e){case"TSTypeCastExpression":return!0;case"TSParameterProperty":return"parameter";case"TSNonNullExpression":case"TSInstantiationExpression":return"expression";case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return(r!==64||!s)&&["expression",!0];default:return super.isValidLVal(e,s,r)}}parseBindingAtom(){return this.state.type===78?this.parseIdentifier(!0):super.parseBindingAtom()}parseMaybeDecoratorArguments(e){if(this.match(47)||this.match(51)){let s=this.tsParseTypeArgumentsInExpression();if(this.match(10)){let r=super.parseMaybeDecoratorArguments(e);return r.typeParameters=s,r}this.unexpected(null,10)}return super.parseMaybeDecoratorArguments(e)}checkCommaAfterRest(e){return this.state.isAmbientContext&&this.match(12)&&this.lookaheadCharCode()===e?(this.next(),!1):super.checkCommaAfterRest(e)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(35)||this.match(14)||super.isClassProperty()}parseMaybeDefault(e,s){let r=super.parseMaybeDefault(e,s);return r.type==="AssignmentPattern"&&r.typeAnnotation&&r.right.startthis.isAssignable(s,!0)):super.shouldParseArrow(e)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}canHaveLeadingDecorator(){return super.canHaveLeadingDecorator()||this.isAbstractClass()}jsxParseOpeningElementAfterName(e){if(this.match(47)||this.match(51)){let s=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());s&&(e.typeParameters=s)}return super.jsxParseOpeningElementAfterName(e)}getGetterSetterExpectedParamCount(e){let s=super.getGetterSetterExpectedParamCount(e),r=this.getObjectOrClassMethodParams(e)[0];return r&&this.isThisParam(r)?s+1:s}parseCatchClauseParam(){let e=super.parseCatchClauseParam(),s=this.tsTryParseTypeAnnotation();return s&&(e.typeAnnotation=s,this.resetEndLocation(e)),e}tsInAmbientContext(e){let{isAmbientContext:s,strict:r}=this.state;this.state.isAmbientContext=!0,this.state.strict=!1;try{return e()}finally{this.state.isAmbientContext=s,this.state.strict=r}}parseClass(e,s,r){let i=this.state.inAbstractClass;this.state.inAbstractClass=!!e.abstract;try{return super.parseClass(e,s,r)}finally{this.state.inAbstractClass=i}}tsParseAbstractDeclaration(e,s){if(this.match(80))return e.abstract=!0,this.maybeTakeDecorators(s,this.parseClass(e,!0,!1));if(this.isContextual(129)){if(!this.hasFollowingLineBreak())return e.abstract=!0,this.raise(T.NonClassMethodPropertyHasAbstractModifer,e),this.tsParseInterfaceDeclaration(e)}else this.unexpected(null,80)}parseMethod(e,s,r,i,a,n,o){let l=super.parseMethod(e,s,r,i,a,n,o);if(l.abstract&&(this.hasPlugin("estree")?l.value.body:l.body)){let{key:h}=l;this.raise(T.AbstractMethodHasImplementation,l,{methodName:h.type==="Identifier"&&!l.computed?h.name:`[${this.input.slice(this.offsetToSourcePos(h.start),this.offsetToSourcePos(h.end))}]`})}return l}tsParseTypeParameterName(){return this.parseIdentifier().name}shouldParseAsAmbientContext(){return!!this.getPluginOption("typescript","dts")}parse(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.parse()}getExpression(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.getExpression()}parseExportSpecifier(e,s,r,i){return!s&&i?(this.parseTypeOnlyImportExportSpecifier(e,!1,r),this.finishNode(e,"ExportSpecifier")):(e.exportKind="value",super.parseExportSpecifier(e,s,r,i))}parseImportSpecifier(e,s,r,i,a){return!s&&i?(this.parseTypeOnlyImportExportSpecifier(e,!0,r),this.finishNode(e,"ImportSpecifier")):(e.importKind="value",super.parseImportSpecifier(e,s,r,i,r?4098:4096))}parseTypeOnlyImportExportSpecifier(e,s,r){let i=s?"imported":"local",a=s?"local":"exported",n=e[i],o,l=!1,h=!0,d=n.loc.start;if(this.isContextual(93)){let g=this.parseIdentifier();if(this.isContextual(93)){let b=this.parseIdentifier();U(this.state.type)?(l=!0,n=g,o=s?this.parseIdentifier():this.parseModuleExportName(),h=!1):(o=b,h=!1)}else U(this.state.type)?(h=!1,o=s?this.parseIdentifier():this.parseModuleExportName()):(l=!0,n=g)}else U(this.state.type)&&(l=!0,s?(n=this.parseIdentifier(!0),this.isContextual(93)||this.checkReservedWord(n.name,n.loc.start,!0,!0)):n=this.parseModuleExportName());l&&r&&this.raise(s?T.TypeModifierIsUsedInTypeImports:T.TypeModifierIsUsedInTypeExports,d),e[i]=n,e[a]=o;let y=s?"importKind":"exportKind";e[y]=l?"type":"value",h&&this.eatContextual(93)&&(e[a]=s?this.parseIdentifier():this.parseModuleExportName()),e[a]||(e[a]=$(e[i])),s&&this.checkIdentifier(e[a],l?4098:4096)}};function fr(t){if(t.type!=="MemberExpression")return!1;let{computed:e,property:s}=t;return e&&s.type!=="StringLiteral"&&(s.type!=="TemplateLiteral"||s.expressions.length>0)?!1:wt(t.object)}function yr(t,e){var s;let{type:r}=t;if((s=t.extra)!=null&&s.parenthesized)return!1;if(e){if(r==="Literal"){let{value:i}=t;if(typeof i=="string"||typeof i=="boolean")return!0}}else if(r==="StringLiteral"||r==="BooleanLiteral")return!0;return!!(Et(t,e)||xr(t,e)||r==="TemplateLiteral"&&t.expressions.length===0||fr(t))}function Et(t,e){return e?t.type==="Literal"&&(typeof t.value=="number"||"bigint"in t):t.type==="NumericLiteral"||t.type==="BigIntLiteral"}function xr(t,e){if(t.type==="UnaryExpression"){let{operator:s,argument:r}=t;if(s==="-"&&Et(r,e))return!0}return!1}function wt(t){return t.type==="Identifier"?!0:t.type!=="MemberExpression"||t.computed?!1:wt(t.object)}var Ct=H`placeholders`({ClassNameIsRequired:"A class name is required.",UnexpectedSpace:"Unexpected space in placeholder."}),Pr=t=>class extends t{parsePlaceholder(e){if(this.match(133)){let s=this.startNode();return this.next(),this.assertNoSpace(),s.name=super.parseIdentifier(!0),this.assertNoSpace(),this.expect(133),this.finishPlaceholder(s,e)}}finishPlaceholder(e,s){let r=e;return(!r.expectedNode||!r.type)&&(r=this.finishNode(r,"Placeholder")),r.expectedNode=s,r}getTokenFromCode(e){e===37&&this.input.charCodeAt(this.state.pos+1)===37?this.finishOp(133,2):super.getTokenFromCode(e)}parseExprAtom(e){return this.parsePlaceholder("Expression")||super.parseExprAtom(e)}parseIdentifier(e){return this.parsePlaceholder("Identifier")||super.parseIdentifier(e)}checkReservedWord(e,s,r,i){e!==void 0&&super.checkReservedWord(e,s,r,i)}parseBindingAtom(){return this.parsePlaceholder("Pattern")||super.parseBindingAtom()}isValidLVal(e,s,r){return e==="Placeholder"||super.isValidLVal(e,s,r)}toAssignable(e,s){e&&e.type==="Placeholder"&&e.expectedNode==="Expression"?e.expectedNode="Pattern":super.toAssignable(e,s)}chStartsBindingIdentifier(e,s){return!!(super.chStartsBindingIdentifier(e,s)||this.lookahead().type===133)}verifyBreakContinue(e,s){e.label&&e.label.type==="Placeholder"||super.verifyBreakContinue(e,s)}parseExpressionStatement(e,s){var r;if(s.type!=="Placeholder"||(r=s.extra)!=null&&r.parenthesized)return super.parseExpressionStatement(e,s);if(this.match(14)){let a=e;return a.label=this.finishPlaceholder(s,"Identifier"),this.next(),a.body=super.parseStatementOrSloppyAnnexBFunctionDeclaration(),this.finishNode(a,"LabeledStatement")}this.semicolon();let i=e;return i.name=s.name,this.finishPlaceholder(i,"Statement")}parseBlock(e,s,r){return this.parsePlaceholder("BlockStatement")||super.parseBlock(e,s,r)}parseFunctionId(e){return this.parsePlaceholder("Identifier")||super.parseFunctionId(e)}parseClass(e,s,r){let i=s?"ClassDeclaration":"ClassExpression";this.next();let a=this.state.strict,n=this.parsePlaceholder("Identifier");if(n)if(this.match(81)||this.match(133)||this.match(5))e.id=n;else{if(r||!s)return e.id=null,e.body=this.finishPlaceholder(n,"ClassBody"),this.finishNode(e,i);throw this.raise(Ct.ClassNameIsRequired,this.state.startLoc)}else this.parseClassId(e,s,r);return super.parseClassSuper(e),e.body=this.parsePlaceholder("ClassBody")||super.parseClassBody(!!e.superClass,a),this.finishNode(e,i)}parseExport(e,s){let r=this.parsePlaceholder("Identifier");if(!r)return super.parseExport(e,s);let i=e;if(!this.isContextual(98)&&!this.match(12))return i.specifiers=[],i.source=null,i.declaration=this.finishPlaceholder(r,"Declaration"),this.finishNode(i,"ExportNamedDeclaration");this.expectPlugin("exportDefaultFrom");let a=this.startNode();return a.exported=r,i.specifiers=[this.finishNode(a,"ExportDefaultSpecifier")],super.parseExport(i,s)}isExportDefaultSpecifier(){if(this.match(65)){let e=this.nextTokenStart();if(this.isUnparsedContextual(e,"from")&&this.input.startsWith(W(133),this.nextTokenStartSince(e+4)))return!0}return super.isExportDefaultSpecifier()}maybeParseExportDefaultSpecifier(e,s){var r;return(r=e.specifiers)!=null&&r.length?!0:super.maybeParseExportDefaultSpecifier(e,s)}checkExport(e){let{specifiers:s}=e;s!=null&&s.length&&(e.specifiers=s.filter(r=>r.exported.type==="Placeholder")),super.checkExport(e),e.specifiers=s}parseImport(e){let s=this.parsePlaceholder("Identifier");if(!s)return super.parseImport(e);if(e.specifiers=[],!this.isContextual(98)&&!this.match(12))return e.source=this.finishPlaceholder(s,"StringLiteral"),this.semicolon(),this.finishNode(e,"ImportDeclaration");let r=this.startNodeAtNode(s);return r.local=s,e.specifiers.push(this.finishNode(r,"ImportDefaultSpecifier")),this.eat(12)&&(this.maybeParseStarImportSpecifier(e)||this.parseNamedImportSpecifiers(e)),this.expectContextual(98),e.source=this.parseImportSource(),this.semicolon(),this.finishNode(e,"ImportDeclaration")}parseImportSource(){return this.parsePlaceholder("StringLiteral")||super.parseImportSource()}assertNoSpace(){this.state.start>this.offsetToSourcePos(this.state.lastTokEndLoc.index)&&this.raise(Ct.UnexpectedSpace,this.state.lastTokEndLoc)}},gr=t=>class extends t{parseV8Intrinsic(){if(this.match(54)){let e=this.state.startLoc,s=this.startNode();if(this.next(),k(this.state.type)){let r=this.parseIdentifierName(),i=this.createIdentifier(s,r);if(i.type="V8IntrinsicIdentifier",this.match(10))return i}this.unexpected(e)}}parseExprAtom(e){return this.parseV8Intrinsic()||super.parseExprAtom(e)}},It=["minimal","fsharp","hack","smart"],Nt=["^^","@@","^","%","#"];function Tr(t){if(t.has("decorators")){if(t.has("decorators-legacy"))throw new Error("Cannot use the decorators and decorators-legacy plugin together");let s=t.get("decorators").decoratorsBeforeExport;if(s!=null&&typeof s!="boolean")throw new Error("'decoratorsBeforeExport' must be a boolean, if specified.");let r=t.get("decorators").allowCallParenthesized;if(r!=null&&typeof r!="boolean")throw new Error("'allowCallParenthesized' must be a boolean.")}if(t.has("flow")&&t.has("typescript"))throw new Error("Cannot combine flow and typescript plugins.");if(t.has("placeholders")&&t.has("v8intrinsic"))throw new Error("Cannot combine placeholders and v8intrinsic plugins.");if(t.has("pipelineOperator")){var e;let s=t.get("pipelineOperator").proposal;if(!It.includes(s)){let i=It.map(a=>`"${a}"`).join(", ");throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${i}.`)}let r=((e=t.get("recordAndTuple"))==null?void 0:e.syntaxType)==="hash";if(s==="hack"){if(t.has("placeholders"))throw new Error("Cannot combine placeholders plugin and Hack-style pipes.");if(t.has("v8intrinsic"))throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");let i=t.get("pipelineOperator").topicToken;if(!Nt.includes(i)){let a=Nt.map(n=>`"${n}"`).join(", ");throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${a}.`)}if(i==="#"&&r)throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "hack", topicToken: "#" }]\` and \`${JSON.stringify(["recordAndTuple",t.get("recordAndTuple")])}\`.`)}else if(s==="smart"&&r)throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "smart" }]\` and \`${JSON.stringify(["recordAndTuple",t.get("recordAndTuple")])}\`.`)}if(t.has("moduleAttributes")){if(t.has("deprecatedImportAssert")||t.has("importAssertions"))throw new Error("Cannot combine importAssertions, deprecatedImportAssert and moduleAttributes plugins.");if(t.get("moduleAttributes").version!=="may-2020")throw new Error("The 'moduleAttributes' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is 'may-2020'.")}if(t.has("importAssertions")&&t.has("deprecatedImportAssert"))throw new Error("Cannot combine importAssertions and deprecatedImportAssert plugins.");if(!t.has("deprecatedImportAssert")&&t.has("importAttributes")&&t.get("importAttributes").deprecatedAssertSyntax&&t.set("deprecatedImportAssert",{}),t.has("recordAndTuple")){let s=t.get("recordAndTuple").syntaxType;if(s!=null){let r=["hash","bar"];if(!r.includes(s))throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: "+r.map(i=>`'${i}'`).join(", "))}}if(t.has("asyncDoExpressions")&&!t.has("doExpressions")){let s=new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.");throw s.missingPlugins="doExpressions",s}if(t.has("optionalChainingAssign")&&t.get("optionalChainingAssign").version!=="2023-07")throw new Error("The 'optionalChainingAssign' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is '2023-07'.")}var vt={estree:ls,jsx:or,flow:nr,typescript:mr,v8intrinsic:gr,placeholders:Pr},br=Object.keys(vt);function Ar(){return{sourceType:"script",sourceFilename:void 0,startIndex:0,startColumn:0,startLine:1,allowAwaitOutsideFunction:!1,allowReturnOutsideFunction:!1,allowNewTargetOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,allowUndeclaredExports:!1,plugins:[],strictMode:null,ranges:!1,tokens:!1,createImportExpressions:!1,createParenthesizedExpressions:!1,errorRecovery:!1,attachComment:!0,annexB:!0}}function Sr(t){let e=Ar();if(t==null)return e;if(t.annexB!=null&&t.annexB!==!1)throw new Error("The `annexB` option can only be set to `false`.");for(let s of Object.keys(e))t[s]!=null&&(e[s]=t[s]);if(e.startLine===1)t.startIndex==null&&e.startColumn>0?e.startIndex=e.startColumn:t.startColumn==null&&e.startIndex>0&&(e.startColumn=e.startIndex);else if((t.startColumn==null||t.startIndex==null)&&t.startIndex!=null)throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");return e}var Er=class extends pr{checkProto(t,e,s,r){if(t.type==="SpreadElement"||this.isObjectMethod(t)||t.computed||t.shorthand)return;let i=t.key;if((i.type==="Identifier"?i.name:i.value)==="__proto__"){if(e){this.raise(c.RecordNoProto,i);return}s.used&&(r?r.doubleProtoLoc===null&&(r.doubleProtoLoc=i.loc.start):this.raise(c.DuplicateProto,i)),s.used=!0}}shouldExitDescending(t,e){return t.type==="ArrowFunctionExpression"&&this.offsetToSourcePos(t.start)===e}getExpression(){this.enterInitialScopes(),this.nextToken();let t=this.parseExpression();return this.match(140)||this.unexpected(),this.finalizeRemainingComments(),t.comments=this.comments,t.errors=this.state.errors,this.options.tokens&&(t.tokens=this.tokens),t}parseExpression(t,e){return t?this.disallowInAnd(()=>this.parseExpressionBase(e)):this.allowInAnd(()=>this.parseExpressionBase(e))}parseExpressionBase(t){let e=this.state.startLoc,s=this.parseMaybeAssign(t);if(this.match(12)){let r=this.startNodeAt(e);for(r.expressions=[s];this.eat(12);)r.expressions.push(this.parseMaybeAssign(t));return this.toReferencedList(r.expressions),this.finishNode(r,"SequenceExpression")}return s}parseMaybeAssignDisallowIn(t,e){return this.disallowInAnd(()=>this.parseMaybeAssign(t,e))}parseMaybeAssignAllowIn(t,e){return this.allowInAnd(()=>this.parseMaybeAssign(t,e))}setOptionalParametersError(t,e){var s;t.optionalParametersLoc=(s=e==null?void 0:e.loc)!=null?s:this.state.startLoc}parseMaybeAssign(t,e){let s=this.state.startLoc;if(this.isContextual(108)&&this.prodParam.hasYield){let n=this.parseYield();return e&&(n=e.call(this,n,s)),n}let r;t?r=!1:(t=new Ae,r=!0);let{type:i}=this.state;(i===10||k(i))&&(this.state.potentialArrowAt=this.state.start);let a=this.parseMaybeConditional(t);if(e&&(a=e.call(this,a,s)),ds(this.state.type)){let n=this.startNodeAt(s),o=this.state.value;if(n.operator=o,this.match(29)){this.toAssignable(a,!0),n.left=a;let l=s.index;t.doubleProtoLoc!=null&&t.doubleProtoLoc.index>=l&&(t.doubleProtoLoc=null),t.shorthandAssignLoc!=null&&t.shorthandAssignLoc.index>=l&&(t.shorthandAssignLoc=null),t.privateKeyLoc!=null&&t.privateKeyLoc.index>=l&&(this.checkDestructuringPrivate(t),t.privateKeyLoc=null)}else n.left=a;return this.next(),n.right=this.parseMaybeAssign(),this.checkLVal(a,this.finishNode(n,"AssignmentExpression")),n}else r&&this.checkExpressionErrors(t,!0);return a}parseMaybeConditional(t){let e=this.state.startLoc,s=this.state.potentialArrowAt,r=this.parseExprOps(t);return this.shouldExitDescending(r,s)?r:this.parseConditional(r,e,t)}parseConditional(t,e,s){if(this.eat(17)){let r=this.startNodeAt(e);return r.test=t,r.consequent=this.parseMaybeAssignAllowIn(),this.expect(14),r.alternate=this.parseMaybeAssign(),this.finishNode(r,"ConditionalExpression")}return t}parseMaybeUnaryOrPrivate(t){return this.match(139)?this.parsePrivateName():this.parseMaybeUnary(t)}parseExprOps(t){let e=this.state.startLoc,s=this.state.potentialArrowAt,r=this.parseMaybeUnaryOrPrivate(t);return this.shouldExitDescending(r,s)?r:this.parseExprOp(r,e,-1)}parseExprOp(t,e,s){if(this.isPrivateName(t)){let i=this.getPrivateNameSV(t);(s>=ye(58)||!this.prodParam.hasIn||!this.match(58))&&this.raise(c.PrivateInExpectedIn,t,{identifierName:i}),this.classScope.usePrivateName(i,t.loc.start)}let r=this.state.type;if(fs(r)&&(this.prodParam.hasIn||!this.match(58))){let i=ye(r);if(i>s){if(r===39){if(this.expectPlugin("pipelineOperator"),this.state.inFSharpPipelineDirectBody)return t;this.checkPipelineAtInfixOperator(t,e)}let a=this.startNodeAt(e);a.left=t,a.operator=this.state.value;let n=r===41||r===42,o=r===40;if(o&&(i=ye(42)),this.next(),r===39&&this.hasPlugin(["pipelineOperator",{proposal:"minimal"}])&&this.state.type===96&&this.prodParam.hasAwait)throw this.raise(c.UnexpectedAwaitAfterPipelineBody,this.state.startLoc);a.right=this.parseExprOpRightExpr(r,i);let l=this.finishNode(a,n||o?"LogicalExpression":"BinaryExpression"),h=this.state.type;if(o&&(h===41||h===42)||n&&h===40)throw this.raise(c.MixingCoalesceWithLogical,this.state.startLoc);return this.parseExprOp(l,e,s)}}return t}parseExprOpRightExpr(t,e){let s=this.state.startLoc;switch(t){case 39:switch(this.getPluginOption("pipelineOperator","proposal")){case"hack":return this.withTopicBindingContext(()=>this.parseHackPipeBody());case"smart":return this.withTopicBindingContext(()=>{if(this.prodParam.hasYield&&this.isContextual(108))throw this.raise(c.PipeBodyIsTighter,this.state.startLoc);return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(t,e),s)});case"fsharp":return this.withSoloAwaitPermittingContext(()=>this.parseFSharpPipelineBody(e))}default:return this.parseExprOpBaseRightExpr(t,e)}}parseExprOpBaseRightExpr(t,e){let s=this.state.startLoc;return this.parseExprOp(this.parseMaybeUnaryOrPrivate(),s,Ts(t)?e-1:e)}parseHackPipeBody(){var t;let{startLoc:e}=this.state,s=this.parseMaybeAssign();return rs.has(s.type)&&!((t=s.extra)!=null&&t.parenthesized)&&this.raise(c.PipeUnparenthesizedBody,e,{type:s.type}),this.topicReferenceWasUsedInCurrentContext()||this.raise(c.PipeTopicUnused,e),s}checkExponentialAfterUnary(t){this.match(57)&&this.raise(c.UnexpectedTokenUnaryExponentiation,t.argument)}parseMaybeUnary(t,e){let s=this.state.startLoc,r=this.isContextual(96);if(r&&this.recordAwaitIfAllowed()){this.next();let o=this.parseAwait(s);return e||this.checkExponentialAfterUnary(o),o}let i=this.match(34),a=this.startNode();if(xs(this.state.type)){a.operator=this.state.value,a.prefix=!0,this.match(72)&&this.expectPlugin("throwExpressions");let o=this.match(89);if(this.next(),a.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(t,!0),this.state.strict&&o){let l=a.argument;l.type==="Identifier"?this.raise(c.StrictDelete,a):this.hasPropertyAsPrivateName(l)&&this.raise(c.DeletePrivateField,a)}if(!i)return e||this.checkExponentialAfterUnary(a),this.finishNode(a,"UnaryExpression")}let n=this.parseUpdate(a,i,t);if(r){let{type:o}=this.state;if((this.hasPlugin("v8intrinsic")?De(o):De(o)&&!this.match(54))&&!this.isAmbiguousAwait())return this.raiseOverwrite(c.AwaitNotInAsyncContext,s),this.parseAwait(s)}return n}parseUpdate(t,e,s){if(e){let a=t;return this.checkLVal(a.argument,this.finishNode(a,"UpdateExpression")),t}let r=this.state.startLoc,i=this.parseExprSubscripts(s);if(this.checkExpressionErrors(s,!1))return i;for(;ys(this.state.type)&&!this.canInsertSemicolon();){let a=this.startNodeAt(r);a.operator=this.state.value,a.prefix=!1,a.argument=i,this.next(),this.checkLVal(i,i=this.finishNode(a,"UpdateExpression"))}return i}parseExprSubscripts(t){let e=this.state.startLoc,s=this.state.potentialArrowAt,r=this.parseExprAtom(t);return this.shouldExitDescending(r,s)?r:this.parseSubscripts(r,e)}parseSubscripts(t,e,s){let r={optionalChainMember:!1,maybeAsyncArrow:this.atPossibleAsyncArrow(t),stop:!1};do t=this.parseSubscript(t,e,s,r),r.maybeAsyncArrow=!1;while(!r.stop);return t}parseSubscript(t,e,s,r){let{type:i}=this.state;if(!s&&i===15)return this.parseBind(t,e,s,r);if(xe(i))return this.parseTaggedTemplateExpression(t,e,r);let a=!1;if(i===18){if(s&&(this.raise(c.OptionalChainingNoNew,this.state.startLoc),this.lookaheadCharCode()===40))return r.stop=!0,t;r.optionalChainMember=a=!0,this.next()}if(!s&&this.match(10))return this.parseCoverCallAndAsyncArrowHead(t,e,r,a);{let n=this.eat(0);return n||a||this.eat(16)?this.parseMember(t,e,r,n,a):(r.stop=!0,t)}}parseMember(t,e,s,r,i){let a=this.startNodeAt(e);return a.object=t,a.computed=r,r?(a.property=this.parseExpression(),this.expect(3)):this.match(139)?(t.type==="Super"&&this.raise(c.SuperPrivateField,e),this.classScope.usePrivateName(this.state.value,this.state.startLoc),a.property=this.parsePrivateName()):a.property=this.parseIdentifier(!0),s.optionalChainMember?(a.optional=i,this.finishNode(a,"OptionalMemberExpression")):this.finishNode(a,"MemberExpression")}parseBind(t,e,s,r){let i=this.startNodeAt(e);return i.object=t,this.next(),i.callee=this.parseNoCallExpr(),r.stop=!0,this.parseSubscripts(this.finishNode(i,"BindExpression"),e,s)}parseCoverCallAndAsyncArrowHead(t,e,s,r){let i=this.state.maybeInArrowParameters,a=null;this.state.maybeInArrowParameters=!0,this.next();let n=this.startNodeAt(e);n.callee=t;let{maybeAsyncArrow:o,optionalChainMember:l}=s;o&&(this.expressionScope.enter(Xs()),a=new Ae),l&&(n.optional=r),r?n.arguments=this.parseCallExpressionArguments(11):n.arguments=this.parseCallExpressionArguments(11,t.type!=="Super",n,a);let h=this.finishCallExpression(n,l);return o&&this.shouldParseAsyncArrow()&&!r?(s.stop=!0,this.checkDestructuringPrivate(a),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),h=this.parseAsyncArrowFromCallExpression(this.startNodeAt(e),h)):(o&&(this.checkExpressionErrors(a,!0),this.expressionScope.exit()),this.toReferencedArguments(h)),this.state.maybeInArrowParameters=i,h}toReferencedArguments(t,e){this.toReferencedListDeep(t.arguments,e)}parseTaggedTemplateExpression(t,e,s){let r=this.startNodeAt(e);return r.tag=t,r.quasi=this.parseTemplate(!0),s.optionalChainMember&&this.raise(c.OptionalChainingNoTemplate,e),this.finishNode(r,"TaggedTemplateExpression")}atPossibleAsyncArrow(t){return t.type==="Identifier"&&t.name==="async"&&this.state.lastTokEndLoc.index===t.end&&!this.canInsertSemicolon()&&t.end-t.start===5&&this.offsetToSourcePos(t.start)===this.state.potentialArrowAt}finishCallExpression(t,e){if(t.callee.type==="Import")if(t.arguments.length===0||t.arguments.length>2)this.raise(c.ImportCallArity,t);else for(let s of t.arguments)s.type==="SpreadElement"&&this.raise(c.ImportCallSpreadArgument,s);return this.finishNode(t,e?"OptionalCallExpression":"CallExpression")}parseCallExpressionArguments(t,e,s,r){let i=[],a=!0,n=this.state.inFSharpPipelineDirectBody;for(this.state.inFSharpPipelineDirectBody=!1;!this.eat(t);){if(a)a=!1;else if(this.expect(12),this.match(t)){s&&this.addTrailingCommaExtraToNode(s),this.next();break}i.push(this.parseExprListItem(!1,r,e))}return this.state.inFSharpPipelineDirectBody=n,i}shouldParseAsyncArrow(){return this.match(19)&&!this.canInsertSemicolon()}parseAsyncArrowFromCallExpression(t,e){var s;return this.resetPreviousNodeTrailingComments(e),this.expect(19),this.parseArrowExpression(t,e.arguments,!0,(s=e.extra)==null?void 0:s.trailingCommaLoc),e.innerComments&&he(t,e.innerComments),e.callee.trailingComments&&he(t,e.callee.trailingComments),t}parseNoCallExpr(){let t=this.state.startLoc;return this.parseSubscripts(this.parseExprAtom(),t,!0)}parseExprAtom(t){let e,s=null,{type:r}=this.state;switch(r){case 79:return this.parseSuper();case 83:return e=this.startNode(),this.next(),this.match(16)?this.parseImportMetaProperty(e):this.match(10)?this.options.createImportExpressions?this.parseImportCall(e):this.finishNode(e,"Import"):(this.raise(c.UnsupportedImport,this.state.lastTokStartLoc),this.finishNode(e,"Import"));case 78:return e=this.startNode(),this.next(),this.finishNode(e,"ThisExpression");case 90:return this.parseDo(this.startNode(),!1);case 56:case 31:return this.readRegexp(),this.parseRegExpLiteral(this.state.value);case 135:return this.parseNumericLiteral(this.state.value);case 136:return this.parseBigIntLiteral(this.state.value);case 134:return this.parseStringLiteral(this.state.value);case 84:return this.parseNullLiteral();case 85:return this.parseBooleanLiteral(!0);case 86:return this.parseBooleanLiteral(!1);case 10:{let i=this.state.potentialArrowAt===this.state.start;return this.parseParenAndDistinguishExpression(i)}case 2:case 1:return this.parseArrayLike(this.state.type===2?4:3,!1,!0);case 0:return this.parseArrayLike(3,!0,!1,t);case 6:case 7:return this.parseObjectLike(this.state.type===6?9:8,!1,!0);case 5:return this.parseObjectLike(8,!1,!1,t);case 68:return this.parseFunctionOrFunctionSent();case 26:s=this.parseDecorators();case 80:return this.parseClass(this.maybeTakeDecorators(s,this.startNode()),!1);case 77:return this.parseNewOrNewTarget();case 25:case 24:return this.parseTemplate(!1);case 15:{e=this.startNode(),this.next(),e.object=null;let i=e.callee=this.parseNoCallExpr();if(i.type==="MemberExpression")return this.finishNode(e,"BindExpression");throw this.raise(c.UnsupportedBind,i)}case 139:return this.raise(c.PrivateInExpectedIn,this.state.startLoc,{identifierName:this.state.value}),this.parsePrivateName();case 33:return this.parseTopicReferenceThenEqualsSign(54,"%");case 32:return this.parseTopicReferenceThenEqualsSign(44,"^");case 37:case 38:return this.parseTopicReference("hack");case 44:case 54:case 27:{let i=this.getPluginOption("pipelineOperator","proposal");if(i)return this.parseTopicReference(i);this.unexpected();break}case 47:{let i=this.input.codePointAt(this.nextTokenStart());q(i)||i===62?this.expectOnePlugin(["jsx","flow","typescript"]):this.unexpected();break}default:if(r===137)return this.parseDecimalLiteral(this.state.value);if(k(r)){if(this.isContextual(127)&&this.lookaheadInLineCharCode()===123)return this.parseModuleExpression();let i=this.state.potentialArrowAt===this.state.start,a=this.state.containsEsc,n=this.parseIdentifier();if(!a&&n.name==="async"&&!this.canInsertSemicolon()){let{type:o}=this.state;if(o===68)return this.resetPreviousNodeTrailingComments(n),this.next(),this.parseAsyncFunctionExpression(this.startNodeAtNode(n));if(k(o))return this.lookaheadCharCode()===61?this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(n)):n;if(o===90)return this.resetPreviousNodeTrailingComments(n),this.parseDo(this.startNodeAtNode(n),!0)}return i&&this.match(19)&&!this.canInsertSemicolon()?(this.next(),this.parseArrowExpression(this.startNodeAtNode(n),[n],!1)):n}else this.unexpected()}}parseTopicReferenceThenEqualsSign(t,e){let s=this.getPluginOption("pipelineOperator","proposal");if(s)return this.state.type=t,this.state.value=e,this.state.pos--,this.state.end--,this.state.endLoc=f(this.state.endLoc,-1),this.parseTopicReference(s);this.unexpected()}parseTopicReference(t){let e=this.startNode(),s=this.state.startLoc,r=this.state.type;return this.next(),this.finishTopicReference(e,s,t,r)}finishTopicReference(t,e,s,r){if(this.testTopicReferenceConfiguration(s,e,r)){let i=s==="smart"?"PipelinePrimaryTopicReference":"TopicReference";return this.topicReferenceIsAllowedInCurrentContext()||this.raise(s==="smart"?c.PrimaryTopicNotAllowed:c.PipeTopicUnbound,e),this.registerTopicReference(),this.finishNode(t,i)}else throw this.raise(c.PipeTopicUnconfiguredToken,e,{token:W(r)})}testTopicReferenceConfiguration(t,e,s){switch(t){case"hack":return this.hasPlugin(["pipelineOperator",{topicToken:W(s)}]);case"smart":return s===27;default:throw this.raise(c.PipeTopicRequiresHackPipes,e)}}parseAsyncArrowUnaryFunction(t){this.prodParam.enter(be(!0,this.prodParam.hasYield));let e=[this.parseIdentifier()];return this.prodParam.exit(),this.hasPrecedingLineBreak()&&this.raise(c.LineTerminatorBeforeArrow,this.state.curPosition()),this.expect(19),this.parseArrowExpression(t,e,!0)}parseDo(t,e){this.expectPlugin("doExpressions"),e&&this.expectPlugin("asyncDoExpressions"),t.async=e,this.next();let s=this.state.labels;return this.state.labels=[],e?(this.prodParam.enter(2),t.body=this.parseBlock(),this.prodParam.exit()):t.body=this.parseBlock(),this.state.labels=s,this.finishNode(t,"DoExpression")}parseSuper(){let t=this.startNode();return this.next(),this.match(10)&&!this.scope.allowDirectSuper&&!this.options.allowSuperOutsideMethod?this.raise(c.SuperNotAllowed,t):!this.scope.allowSuper&&!this.options.allowSuperOutsideMethod&&this.raise(c.UnexpectedSuper,t),!this.match(10)&&!this.match(0)&&!this.match(16)&&this.raise(c.UnsupportedSuper,t),this.finishNode(t,"Super")}parsePrivateName(){let t=this.startNode(),e=this.startNodeAt(f(this.state.startLoc,1)),s=this.state.value;return this.next(),t.id=this.createIdentifier(e,s),this.finishNode(t,"PrivateName")}parseFunctionOrFunctionSent(){let t=this.startNode();if(this.next(),this.prodParam.hasYield&&this.match(16)){let e=this.createIdentifier(this.startNodeAtNode(t),"function");return this.next(),this.match(103)?this.expectPlugin("functionSent"):this.hasPlugin("functionSent")||this.unexpected(),this.parseMetaProperty(t,e,"sent")}return this.parseFunction(t)}parseMetaProperty(t,e,s){t.meta=e;let r=this.state.containsEsc;return t.property=this.parseIdentifier(!0),(t.property.name!==s||r)&&this.raise(c.UnsupportedMetaProperty,t.property,{target:e.name,onlyValidPropertyName:s}),this.finishNode(t,"MetaProperty")}parseImportMetaProperty(t){let e=this.createIdentifier(this.startNodeAtNode(t),"import");if(this.next(),this.isContextual(101))this.inModule||this.raise(c.ImportMetaOutsideModule,e),this.sawUnambiguousESM=!0;else if(this.isContextual(105)||this.isContextual(97)){let s=this.isContextual(105);if(s||this.unexpected(),this.expectPlugin(s?"sourcePhaseImports":"deferredImportEvaluation"),!this.options.createImportExpressions)throw this.raise(c.DynamicImportPhaseRequiresImportExpressions,this.state.startLoc,{phase:this.state.value});return this.next(),t.phase=s?"source":"defer",this.parseImportCall(t)}return this.parseMetaProperty(t,e,"meta")}parseLiteralAtNode(t,e,s){return this.addExtra(s,"rawValue",t),this.addExtra(s,"raw",this.input.slice(this.offsetToSourcePos(s.start),this.state.end)),s.value=t,this.next(),this.finishNode(s,e)}parseLiteral(t,e){let s=this.startNode();return this.parseLiteralAtNode(t,e,s)}parseStringLiteral(t){return this.parseLiteral(t,"StringLiteral")}parseNumericLiteral(t){return this.parseLiteral(t,"NumericLiteral")}parseBigIntLiteral(t){return this.parseLiteral(t,"BigIntLiteral")}parseDecimalLiteral(t){return this.parseLiteral(t,"DecimalLiteral")}parseRegExpLiteral(t){let e=this.startNode();return this.addExtra(e,"raw",this.input.slice(this.offsetToSourcePos(e.start),this.state.end)),e.pattern=t.pattern,e.flags=t.flags,this.next(),this.finishNode(e,"RegExpLiteral")}parseBooleanLiteral(t){let e=this.startNode();return e.value=t,this.next(),this.finishNode(e,"BooleanLiteral")}parseNullLiteral(){let t=this.startNode();return this.next(),this.finishNode(t,"NullLiteral")}parseParenAndDistinguishExpression(t){let e=this.state.startLoc,s;this.next(),this.expressionScope.enter(Ws());let r=this.state.maybeInArrowParameters,i=this.state.inFSharpPipelineDirectBody;this.state.maybeInArrowParameters=!0,this.state.inFSharpPipelineDirectBody=!1;let a=this.state.startLoc,n=[],o=new Ae,l=!0,h,d;for(;!this.match(11);){if(l)l=!1;else if(this.expect(12,o.optionalParametersLoc===null?null:o.optionalParametersLoc),this.match(11)){d=this.state.startLoc;break}if(this.match(21)){let b=this.state.startLoc;if(h=this.state.startLoc,n.push(this.parseParenItem(this.parseRestBinding(),b)),!this.checkCommaAfterRest(41))break}else n.push(this.parseMaybeAssignAllowIn(o,this.parseParenItem))}let y=this.state.lastTokEndLoc;this.expect(11),this.state.maybeInArrowParameters=r,this.state.inFSharpPipelineDirectBody=i;let g=this.startNodeAt(e);return t&&this.shouldParseArrow(n)&&(g=this.parseArrow(g))?(this.checkDestructuringPrivate(o),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),this.parseArrowExpression(g,n,!1),g):(this.expressionScope.exit(),n.length||this.unexpected(this.state.lastTokStartLoc),d&&this.unexpected(d),h&&this.unexpected(h),this.checkExpressionErrors(o,!0),this.toReferencedListDeep(n,!0),n.length>1?(s=this.startNodeAt(a),s.expressions=n,this.finishNode(s,"SequenceExpression"),this.resetEndLocation(s,y)):s=n[0],this.wrapParenthesis(e,s))}wrapParenthesis(t,e){if(!this.options.createParenthesizedExpressions)return this.addExtra(e,"parenthesized",!0),this.addExtra(e,"parenStart",t.index),this.takeSurroundingComments(e,t.index,this.state.lastTokEndLoc.index),e;let s=this.startNodeAt(t);return s.expression=e,this.finishNode(s,"ParenthesizedExpression")}shouldParseArrow(t){return!this.canInsertSemicolon()}parseArrow(t){if(this.eat(19))return t}parseParenItem(t,e){return t}parseNewOrNewTarget(){let t=this.startNode();if(this.next(),this.match(16)){let e=this.createIdentifier(this.startNodeAtNode(t),"new");this.next();let s=this.parseMetaProperty(t,e,"target");return!this.scope.inNonArrowFunction&&!this.scope.inClass&&!this.options.allowNewTargetOutsideFunction&&this.raise(c.UnexpectedNewTarget,s),s}return this.parseNew(t)}parseNew(t){if(this.parseNewCallee(t),this.eat(10)){let e=this.parseExprList(11);this.toReferencedList(e),t.arguments=e}else t.arguments=[];return this.finishNode(t,"NewExpression")}parseNewCallee(t){let e=this.match(83),s=this.parseNoCallExpr();t.callee=s,e&&(s.type==="Import"||s.type==="ImportExpression")&&this.raise(c.ImportCallNotNewExpression,s)}parseTemplateElement(t){let{start:e,startLoc:s,end:r,value:i}=this.state,a=e+1,n=this.startNodeAt(f(s,1));i===null&&(t||this.raise(c.InvalidEscapeSequenceTemplate,f(this.state.firstInvalidTemplateEscapePos,1)));let o=this.match(24),l=o?-1:-2,h=r+l;n.value={raw:this.input.slice(a,h).replace(/\r\n?/g,` +`),cooked:i===null?null:i.slice(1,l)},n.tail=o,this.next();let d=this.finishNode(n,"TemplateElement");return this.resetEndLocation(d,f(this.state.lastTokEndLoc,l)),d}parseTemplate(t){let e=this.startNode(),s=this.parseTemplateElement(t),r=[s],i=[];for(;!s.tail;)i.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),r.push(s=this.parseTemplateElement(t));return e.expressions=i,e.quasis=r,this.finishNode(e,"TemplateLiteral")}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(t,e,s,r){s&&this.expectPlugin("recordAndTuple");let i=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let a=Object.create(null),n=!0,o=this.startNode();for(o.properties=[],this.next();!this.match(t);){if(n)n=!1;else if(this.expect(12),this.match(t)){this.addTrailingCommaExtraToNode(o);break}let h;e?h=this.parseBindingProperty():(h=this.parsePropertyDefinition(r),this.checkProto(h,s,a,r)),s&&!this.isObjectProperty(h)&&h.type!=="SpreadElement"&&this.raise(c.InvalidRecordProperty,h),h.shorthand&&this.addExtra(h,"shorthand",!0),o.properties.push(h)}this.next(),this.state.inFSharpPipelineDirectBody=i;let l="ObjectExpression";return e?l="ObjectPattern":s&&(l="RecordExpression"),this.finishNode(o,l)}addTrailingCommaExtraToNode(t){this.addExtra(t,"trailingComma",this.state.lastTokStartLoc.index),this.addExtra(t,"trailingCommaLoc",this.state.lastTokStartLoc,!1)}maybeAsyncOrAccessorProp(t){return!t.computed&&t.key.type==="Identifier"&&(this.isLiteralPropertyName()||this.match(0)||this.match(55))}parsePropertyDefinition(t){let e=[];if(this.match(26))for(this.hasPlugin("decorators")&&this.raise(c.UnsupportedPropertyDecorator,this.state.startLoc);this.match(26);)e.push(this.parseDecorator());let s=this.startNode(),r=!1,i=!1,a;if(this.match(21))return e.length&&this.unexpected(),this.parseSpread();e.length&&(s.decorators=e,e=[]),s.method=!1,t&&(a=this.state.startLoc);let n=this.eat(55);this.parsePropertyNamePrefixOperator(s);let o=this.state.containsEsc;if(this.parsePropertyName(s,t),!n&&!o&&this.maybeAsyncOrAccessorProp(s)){let{key:l}=s,h=l.name;h==="async"&&!this.hasPrecedingLineBreak()&&(r=!0,this.resetPreviousNodeTrailingComments(l),n=this.eat(55),this.parsePropertyName(s)),(h==="get"||h==="set")&&(i=!0,this.resetPreviousNodeTrailingComments(l),s.kind=h,this.match(55)&&(n=!0,this.raise(c.AccessorIsGenerator,this.state.curPosition(),{kind:h}),this.next()),this.parsePropertyName(s))}return this.parseObjPropValue(s,a,n,r,!1,i,t)}getGetterSetterExpectedParamCount(t){return t.kind==="get"?0:1}getObjectOrClassMethodParams(t){return t.params}checkGetterSetterParams(t){var e;let s=this.getGetterSetterExpectedParamCount(t),r=this.getObjectOrClassMethodParams(t);r.length!==s&&this.raise(t.kind==="get"?c.BadGetterArity:c.BadSetterArity,t),t.kind==="set"&&((e=r[r.length-1])==null?void 0:e.type)==="RestElement"&&this.raise(c.BadSetterRestParameter,t)}parseObjectMethod(t,e,s,r,i){if(i){let a=this.parseMethod(t,e,!1,!1,!1,"ObjectMethod");return this.checkGetterSetterParams(a),a}if(s||e||this.match(10))return r&&this.unexpected(),t.kind="method",t.method=!0,this.parseMethod(t,e,s,!1,!1,"ObjectMethod")}parseObjectProperty(t,e,s,r){if(t.shorthand=!1,this.eat(14))return t.value=s?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowIn(r),this.finishNode(t,"ObjectProperty");if(!t.computed&&t.key.type==="Identifier"){if(this.checkReservedWord(t.key.name,t.key.loc.start,!0,!1),s)t.value=this.parseMaybeDefault(e,$(t.key));else if(this.match(29)){let i=this.state.startLoc;r!=null?r.shorthandAssignLoc===null&&(r.shorthandAssignLoc=i):this.raise(c.InvalidCoverInitializedName,i),t.value=this.parseMaybeDefault(e,$(t.key))}else t.value=$(t.key);return t.shorthand=!0,this.finishNode(t,"ObjectProperty")}}parseObjPropValue(t,e,s,r,i,a,n){let o=this.parseObjectMethod(t,s,r,i,a)||this.parseObjectProperty(t,e,i,n);return o||this.unexpected(),o}parsePropertyName(t,e){if(this.eat(0))t.computed=!0,t.key=this.parseMaybeAssignAllowIn(),this.expect(3);else{let{type:s,value:r}=this.state,i;if(U(s))i=this.parseIdentifier(!0);else switch(s){case 135:i=this.parseNumericLiteral(r);break;case 134:i=this.parseStringLiteral(r);break;case 136:i=this.parseBigIntLiteral(r);break;case 139:{let a=this.state.startLoc;e!=null?e.privateKeyLoc===null&&(e.privateKeyLoc=a):this.raise(c.UnexpectedPrivateField,a),i=this.parsePrivateName();break}default:if(s===137){i=this.parseDecimalLiteral(r);break}this.unexpected()}t.key=i,s!==139&&(t.computed=!1)}}initFunction(t,e){t.id=null,t.generator=!1,t.async=e}parseMethod(t,e,s,r,i,a,n=!1){this.initFunction(t,s),t.generator=e,this.scope.enter(18|(n?64:0)|(i?32:0)),this.prodParam.enter(be(s,t.generator)),this.parseFunctionParams(t,r);let o=this.parseFunctionBodyAndFinish(t,a,!0);return this.prodParam.exit(),this.scope.exit(),o}parseArrayLike(t,e,s,r){s&&this.expectPlugin("recordAndTuple");let i=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let a=this.startNode();return this.next(),a.elements=this.parseExprList(t,!s,r,a),this.state.inFSharpPipelineDirectBody=i,this.finishNode(a,s?"TupleExpression":"ArrayExpression")}parseArrowExpression(t,e,s,r){this.scope.enter(6);let i=be(s,!1);!this.match(5)&&this.prodParam.hasIn&&(i|=8),this.prodParam.enter(i),this.initFunction(t,s);let a=this.state.maybeInArrowParameters;return e&&(this.state.maybeInArrowParameters=!0,this.setArrowFunctionParameters(t,e,r)),this.state.maybeInArrowParameters=!1,this.parseFunctionBody(t,!0),this.prodParam.exit(),this.scope.exit(),this.state.maybeInArrowParameters=a,this.finishNode(t,"ArrowFunctionExpression")}setArrowFunctionParameters(t,e,s){this.toAssignableList(e,s,!1),t.params=e}parseFunctionBodyAndFinish(t,e,s=!1){return this.parseFunctionBody(t,!1,s),this.finishNode(t,e)}parseFunctionBody(t,e,s=!1){let r=e&&!this.match(5);if(this.expressionScope.enter(gt()),r)t.body=this.parseMaybeAssign(),this.checkParams(t,!1,e,!1);else{let i=this.state.strict,a=this.state.labels;this.state.labels=[],this.prodParam.enter(this.prodParam.currentFlags()|4),t.body=this.parseBlock(!0,!1,n=>{let o=!this.isSimpleParamList(t.params);n&&o&&this.raise(c.IllegalLanguageModeDirective,(t.kind==="method"||t.kind==="constructor")&&t.key?t.key.loc.end:t);let l=!i&&this.state.strict;this.checkParams(t,!this.state.strict&&!e&&!s&&!o,e,l),this.state.strict&&t.id&&this.checkIdentifier(t.id,65,l)}),this.prodParam.exit(),this.state.labels=a}this.expressionScope.exit()}isSimpleParameter(t){return t.type==="Identifier"}isSimpleParamList(t){for(let e=0,s=t.length;e10||!ks(t))){if(s&&Is(t)){this.raise(c.UnexpectedKeyword,e,{keyword:t});return}if((this.state.strict?r?ct:ht:lt)(t,this.inModule)){this.raise(c.UnexpectedReservedWord,e,{reservedWord:t});return}else if(t==="yield"){if(this.prodParam.hasYield){this.raise(c.YieldBindingIdentifier,e);return}}else if(t==="await"){if(this.prodParam.hasAwait){this.raise(c.AwaitBindingIdentifier,e);return}if(this.scope.inStaticBlock){this.raise(c.AwaitBindingIdentifierInStaticBlock,e);return}this.expressionScope.recordAsyncArrowParametersError(e)}else if(t==="arguments"&&this.scope.inClassAndNotInNonArrowFunction){this.raise(c.ArgumentsInClass,e);return}}}recordAwaitIfAllowed(){let t=this.prodParam.hasAwait||this.options.allowAwaitOutsideFunction&&!this.scope.inFunction;return t&&!this.scope.inFunction&&(this.state.hasTopLevelAwait=!0),t}parseAwait(t){let e=this.startNodeAt(t);return this.expressionScope.recordParameterInitializerError(c.AwaitExpressionFormalParameter,e),this.eat(55)&&this.raise(c.ObsoleteAwaitStar,e),!this.scope.inFunction&&!this.options.allowAwaitOutsideFunction&&(this.isAmbiguousAwait()?this.ambiguousScriptDifferentAst=!0:this.sawUnambiguousESM=!0),this.state.soloAwait||(e.argument=this.parseMaybeUnary(null,!0)),this.finishNode(e,"AwaitExpression")}isAmbiguousAwait(){if(this.hasPrecedingLineBreak())return!0;let{type:t}=this.state;return t===53||t===10||t===0||xe(t)||t===102&&!this.state.containsEsc||t===138||t===56||this.hasPlugin("v8intrinsic")&&t===54}parseYield(){let t=this.startNode();this.expressionScope.recordParameterInitializerError(c.YieldInParameter,t),this.next();let e=!1,s=null;if(!this.hasPrecedingLineBreak())switch(e=this.eat(55),this.state.type){case 13:case 140:case 8:case 11:case 3:case 9:case 14:case 12:if(!e)break;default:s=this.parseMaybeAssign()}return t.delegate=e,t.argument=s,this.finishNode(t,"YieldExpression")}parseImportCall(t){if(this.next(),t.source=this.parseMaybeAssignAllowIn(),t.options=null,this.eat(12)&&!this.match(11)&&(t.options=this.parseMaybeAssignAllowIn(),this.eat(12)&&!this.match(11))){do this.parseMaybeAssignAllowIn();while(this.eat(12)&&!this.match(11));this.raise(c.ImportCallArity,t)}return this.expect(11),this.finishNode(t,"ImportExpression")}checkPipelineAtInfixOperator(t,e){this.hasPlugin(["pipelineOperator",{proposal:"smart"}])&&t.type==="SequenceExpression"&&this.raise(c.PipelineHeadSequenceExpression,e)}parseSmartPipelineBodyInStyle(t,e){if(this.isSimpleReference(t)){let s=this.startNodeAt(e);return s.callee=t,this.finishNode(s,"PipelineBareFunction")}else{let s=this.startNodeAt(e);return this.checkSmartPipeTopicBodyEarlyErrors(e),s.expression=t,this.finishNode(s,"PipelineTopicExpression")}}isSimpleReference(t){switch(t.type){case"MemberExpression":return!t.computed&&this.isSimpleReference(t.object);case"Identifier":return!0;default:return!1}}checkSmartPipeTopicBodyEarlyErrors(t){if(this.match(19))throw this.raise(c.PipelineBodyNoArrow,this.state.startLoc);this.topicReferenceWasUsedInCurrentContext()||this.raise(c.PipelineTopicUnused,t)}withTopicBindingContext(t){let e=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:1,maxTopicIndex:null};try{return t()}finally{this.state.topicContext=e}}withSmartMixTopicForbiddingContext(t){if(this.hasPlugin(["pipelineOperator",{proposal:"smart"}])){let e=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null};try{return t()}finally{this.state.topicContext=e}}else return t()}withSoloAwaitPermittingContext(t){let e=this.state.soloAwait;this.state.soloAwait=!0;try{return t()}finally{this.state.soloAwait=e}}allowInAnd(t){let e=this.prodParam.currentFlags();if(8&~e){this.prodParam.enter(e|8);try{return t()}finally{this.prodParam.exit()}}return t()}disallowInAnd(t){let e=this.prodParam.currentFlags();if(8&e){this.prodParam.enter(e&-9);try{return t()}finally{this.prodParam.exit()}}return t()}registerTopicReference(){this.state.topicContext.maxTopicIndex=0}topicReferenceIsAllowedInCurrentContext(){return this.state.topicContext.maxNumOfResolvableTopics>=1}topicReferenceWasUsedInCurrentContext(){return this.state.topicContext.maxTopicIndex!=null&&this.state.topicContext.maxTopicIndex>=0}parseFSharpPipelineBody(t){let e=this.state.startLoc;this.state.potentialArrowAt=this.state.start;let s=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!0;let r=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),e,t);return this.state.inFSharpPipelineDirectBody=s,r}parseModuleExpression(){this.expectPlugin("moduleBlocks");let t=this.startNode();this.next(),this.match(5)||this.unexpected(null,5);let e=this.startNodeAt(this.state.endLoc);this.next();let s=this.initializeScopes(!0);this.enterInitialScopes();try{t.body=this.parseProgram(e,8,"module")}finally{s()}return this.finishNode(t,"ModuleExpression")}parsePropertyNamePrefixOperator(t){}},qe={kind:1},wr={kind:2},Cr=/[\uD800-\uDFFF]/u,$e=/in(?:stanceof)?/y;function Ir(t,e,s){for(let r=0;r0)for(let[i,a]of Array.from(this.scope.undefinedExports))this.raise(c.ModuleExportUndefined,a,{localName:i});this.addExtra(t,"topLevelAwait",this.state.hasTopLevelAwait)}let r;return e===140?r=this.finishNode(t,"Program"):r=this.finishNodeAt(t,"Program",f(this.state.startLoc,-1)),r}stmtToDirective(t){let e=t;e.type="Directive",e.value=e.expression,delete e.expression;let s=e.value,r=s.value,i=this.input.slice(this.offsetToSourcePos(s.start),this.offsetToSourcePos(s.end)),a=s.value=i.slice(1,-1);return this.addExtra(s,"raw",i),this.addExtra(s,"rawValue",a),this.addExtra(s,"expressionValue",r),s.type="DirectiveLiteral",e}parseInterpreterDirective(){if(!this.match(28))return null;let t=this.startNode();return t.value=this.state.value,this.next(),this.finishNode(t,"InterpreterDirective")}isLet(){return this.isContextual(100)?this.hasFollowingBindingAtom():!1}chStartsBindingIdentifier(t,e){if(q(t)){if($e.lastIndex=e,$e.test(this.input)){let s=this.codePointAtPos($e.lastIndex);if(!ee(s)&&s!==92)return!1}return!0}else return t===92}chStartsBindingPattern(t){return t===91||t===123}hasFollowingBindingAtom(){let t=this.nextTokenStart(),e=this.codePointAtPos(t);return this.chStartsBindingPattern(e)||this.chStartsBindingIdentifier(e,t)}hasInLineFollowingBindingIdentifierOrBrace(){let t=this.nextTokenInLineStart(),e=this.codePointAtPos(t);return e===123||this.chStartsBindingIdentifier(e,t)}startsUsingForOf(){let{type:t,containsEsc:e}=this.lookahead();if(t===102&&!e)return!1;if(k(t)&&!this.hasFollowingLineBreak())return this.expectPlugin("explicitResourceManagement"),!0}startsAwaitUsing(){let t=this.nextTokenInLineStart();if(this.isUnparsedContextual(t,"using")){t=this.nextTokenInLineStartSince(t+5);let e=this.codePointAtPos(t);if(this.chStartsBindingIdentifier(e,t))return this.expectPlugin("explicitResourceManagement"),!0}return!1}parseModuleItem(){return this.parseStatementLike(15)}parseStatementListItem(){return this.parseStatementLike(6|(!this.options.annexB||this.state.strict?0:8))}parseStatementOrSloppyAnnexBFunctionDeclaration(t=!1){let e=0;return this.options.annexB&&!this.state.strict&&(e|=4,t&&(e|=8)),this.parseStatementLike(e)}parseStatement(){return this.parseStatementLike(0)}parseStatementLike(t){let e=null;return this.match(26)&&(e=this.parseDecorators(!0)),this.parseStatementContent(t,e)}parseStatementContent(t,e){let s=this.state.type,r=this.startNode(),i=!!(t&2),a=!!(t&4),n=t&1;switch(s){case 60:return this.parseBreakContinueStatement(r,!0);case 63:return this.parseBreakContinueStatement(r,!1);case 64:return this.parseDebuggerStatement(r);case 90:return this.parseDoWhileStatement(r);case 91:return this.parseForStatement(r);case 68:if(this.lookaheadCharCode()===46)break;return a||this.raise(this.state.strict?c.StrictFunction:this.options.annexB?c.SloppyFunctionAnnexB:c.SloppyFunction,this.state.startLoc),this.parseFunctionStatement(r,!1,!i&&a);case 80:return i||this.unexpected(),this.parseClass(this.maybeTakeDecorators(e,r),!0);case 69:return this.parseIfStatement(r);case 70:return this.parseReturnStatement(r);case 71:return this.parseSwitchStatement(r);case 72:return this.parseThrowStatement(r);case 73:return this.parseTryStatement(r);case 96:if(!this.state.containsEsc&&this.startsAwaitUsing())return this.recordAwaitIfAllowed()?i||this.raise(c.UnexpectedLexicalDeclaration,r):this.raise(c.AwaitUsingNotInAsyncContext,r),this.next(),this.parseVarStatement(r,"await using");break;case 107:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifierOrBrace())break;return this.expectPlugin("explicitResourceManagement"),!this.scope.inModule&&this.scope.inTopLevel?this.raise(c.UnexpectedUsingDeclaration,this.state.startLoc):i||this.raise(c.UnexpectedLexicalDeclaration,this.state.startLoc),this.parseVarStatement(r,"using");case 100:{if(this.state.containsEsc)break;let h=this.nextTokenStart(),d=this.codePointAtPos(h);if(d!==91&&(!i&&this.hasFollowingLineBreak()||!this.chStartsBindingIdentifier(d,h)&&d!==123))break}case 75:i||this.raise(c.UnexpectedLexicalDeclaration,this.state.startLoc);case 74:{let h=this.state.value;return this.parseVarStatement(r,h)}case 92:return this.parseWhileStatement(r);case 76:return this.parseWithStatement(r);case 5:return this.parseBlock();case 13:return this.parseEmptyStatement(r);case 83:{let h=this.lookaheadCharCode();if(h===40||h===46)break}case 82:{!this.options.allowImportExportEverywhere&&!n&&this.raise(c.UnexpectedImportExport,this.state.startLoc),this.next();let h;return s===83?(h=this.parseImport(r),h.type==="ImportDeclaration"&&(!h.importKind||h.importKind==="value")&&(this.sawUnambiguousESM=!0)):(h=this.parseExport(r,e),(h.type==="ExportNamedDeclaration"&&(!h.exportKind||h.exportKind==="value")||h.type==="ExportAllDeclaration"&&(!h.exportKind||h.exportKind==="value")||h.type==="ExportDefaultDeclaration")&&(this.sawUnambiguousESM=!0)),this.assertModuleNodeAllowed(h),h}default:if(this.isAsyncFunction())return i||this.raise(c.AsyncFunctionInSingleStatementContext,this.state.startLoc),this.next(),this.parseFunctionStatement(r,!0,!i&&a)}let o=this.state.value,l=this.parseExpression();return k(s)&&l.type==="Identifier"&&this.eat(14)?this.parseLabeledStatement(r,o,l,t):this.parseExpressionStatement(r,l,e)}assertModuleNodeAllowed(t){!this.options.allowImportExportEverywhere&&!this.inModule&&this.raise(c.ImportOutsideModule,t)}decoratorsEnabledBeforeExport(){return this.hasPlugin("decorators-legacy")?!0:this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")!==!1}maybeTakeDecorators(t,e,s){return t&&(e.decorators&&e.decorators.length>0?(typeof this.getPluginOption("decorators","decoratorsBeforeExport")!="boolean"&&this.raise(c.DecoratorsBeforeAfterExport,e.decorators[0]),e.decorators.unshift(...t)):e.decorators=t,this.resetStartLocationFromNode(e,t[0]),s&&this.resetStartLocationFromNode(s,e)),e}canHaveLeadingDecorator(){return this.match(80)}parseDecorators(t){let e=[];do e.push(this.parseDecorator());while(this.match(26));if(this.match(82))t||this.unexpected(),this.decoratorsEnabledBeforeExport()||this.raise(c.DecoratorExportClass,this.state.startLoc);else if(!this.canHaveLeadingDecorator())throw this.raise(c.UnexpectedLeadingDecorator,this.state.startLoc);return e}parseDecorator(){this.expectOnePlugin(["decorators","decorators-legacy"]);let t=this.startNode();if(this.next(),this.hasPlugin("decorators")){let e=this.state.startLoc,s;if(this.match(10)){let r=this.state.startLoc;this.next(),s=this.parseExpression(),this.expect(11),s=this.wrapParenthesis(r,s);let i=this.state.startLoc;t.expression=this.parseMaybeDecoratorArguments(s),this.getPluginOption("decorators","allowCallParenthesized")===!1&&t.expression!==s&&this.raise(c.DecoratorArgumentsOutsideParentheses,i)}else{for(s=this.parseIdentifier(!1);this.eat(16);){let r=this.startNodeAt(e);r.object=s,this.match(139)?(this.classScope.usePrivateName(this.state.value,this.state.startLoc),r.property=this.parsePrivateName()):r.property=this.parseIdentifier(!0),r.computed=!1,s=this.finishNode(r,"MemberExpression")}t.expression=this.parseMaybeDecoratorArguments(s)}}else t.expression=this.parseExprSubscripts();return this.finishNode(t,"Decorator")}parseMaybeDecoratorArguments(t){if(this.eat(10)){let e=this.startNodeAtNode(t);return e.callee=t,e.arguments=this.parseCallExpressionArguments(11),this.toReferencedList(e.arguments),this.finishNode(e,"CallExpression")}return t}parseBreakContinueStatement(t,e){return this.next(),this.isLineTerminator()?t.label=null:(t.label=this.parseIdentifier(),this.semicolon()),this.verifyBreakContinue(t,e),this.finishNode(t,e?"BreakStatement":"ContinueStatement")}verifyBreakContinue(t,e){let s;for(s=0;sthis.parseStatement()),this.state.labels.pop(),this.expect(92),t.test=this.parseHeaderExpression(),this.eat(13),this.finishNode(t,"DoWhileStatement")}parseForStatement(t){this.next(),this.state.labels.push(qe);let e=null;if(this.isContextual(96)&&this.recordAwaitIfAllowed()&&(e=this.state.startLoc,this.next()),this.scope.enter(0),this.expect(10),this.match(13))return e!==null&&this.unexpected(e),this.parseFor(t,null);let s=this.isContextual(100);{let o=this.isContextual(96)&&this.startsAwaitUsing(),l=o||this.isContextual(107)&&this.startsUsingForOf(),h=s&&this.hasFollowingBindingAtom()||l;if(this.match(74)||this.match(75)||h){let d=this.startNode(),y;o?(y="await using",this.recordAwaitIfAllowed()||this.raise(c.AwaitUsingNotInAsyncContext,this.state.startLoc),this.next()):y=this.state.value,this.next(),this.parseVar(d,!0,y);let g=this.finishNode(d,"VariableDeclaration"),b=this.match(58);return b&&l&&this.raise(c.ForInUsing,g),(b||this.isContextual(102))&&g.declarations.length===1?this.parseForIn(t,g,e):(e!==null&&this.unexpected(e),this.parseFor(t,g))}}let r=this.isContextual(95),i=new Ae,a=this.parseExpression(!0,i),n=this.isContextual(102);if(n&&(s&&this.raise(c.ForOfLet,a),e===null&&r&&a.type==="Identifier"&&this.raise(c.ForOfAsync,a)),n||this.match(58)){this.checkDestructuringPrivate(i),this.toAssignable(a,!0);let o=n?"ForOfStatement":"ForInStatement";return this.checkLVal(a,{type:o}),this.parseForIn(t,a,e)}else this.checkExpressionErrors(i,!0);return e!==null&&this.unexpected(e),this.parseFor(t,a)}parseFunctionStatement(t,e,s){return this.next(),this.parseFunction(t,1|(s?2:0)|(e?8:0))}parseIfStatement(t){return this.next(),t.test=this.parseHeaderExpression(),t.consequent=this.parseStatementOrSloppyAnnexBFunctionDeclaration(),t.alternate=this.eat(66)?this.parseStatementOrSloppyAnnexBFunctionDeclaration():null,this.finishNode(t,"IfStatement")}parseReturnStatement(t){return!this.prodParam.hasReturn&&!this.options.allowReturnOutsideFunction&&this.raise(c.IllegalReturn,this.state.startLoc),this.next(),this.isLineTerminator()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")}parseSwitchStatement(t){this.next(),t.discriminant=this.parseHeaderExpression();let e=t.cases=[];this.expect(5),this.state.labels.push(wr),this.scope.enter(0);let s;for(let r;!this.match(8);)if(this.match(61)||this.match(65)){let i=this.match(61);s&&this.finishNode(s,"SwitchCase"),e.push(s=this.startNode()),s.consequent=[],this.next(),i?s.test=this.parseExpression():(r&&this.raise(c.MultipleDefaultsInSwitch,this.state.lastTokStartLoc),r=!0,s.test=null),this.expect(14)}else s?s.consequent.push(this.parseStatementListItem()):this.unexpected();return this.scope.exit(),s&&this.finishNode(s,"SwitchCase"),this.next(),this.state.labels.pop(),this.finishNode(t,"SwitchStatement")}parseThrowStatement(t){return this.next(),this.hasPrecedingLineBreak()&&this.raise(c.NewlineAfterThrow,this.state.lastTokEndLoc),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")}parseCatchClauseParam(){let t=this.parseBindingAtom();return this.scope.enter(this.options.annexB&&t.type==="Identifier"?8:0),this.checkLVal(t,{type:"CatchClause"},9),t}parseTryStatement(t){if(this.next(),t.block=this.parseBlock(),t.handler=null,this.match(62)){let e=this.startNode();this.next(),this.match(10)?(this.expect(10),e.param=this.parseCatchClauseParam(),this.expect(11)):(e.param=null,this.scope.enter(0)),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseBlock(!1,!1)),this.scope.exit(),t.handler=this.finishNode(e,"CatchClause")}return t.finalizer=this.eat(67)?this.parseBlock():null,!t.handler&&!t.finalizer&&this.raise(c.NoCatchOrFinally,t),this.finishNode(t,"TryStatement")}parseVarStatement(t,e,s=!1){return this.next(),this.parseVar(t,!1,e,s),this.semicolon(),this.finishNode(t,"VariableDeclaration")}parseWhileStatement(t){return this.next(),t.test=this.parseHeaderExpression(),this.state.labels.push(qe),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.finishNode(t,"WhileStatement")}parseWithStatement(t){return this.state.strict&&this.raise(c.StrictWith,this.state.startLoc),this.next(),t.object=this.parseHeaderExpression(),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.finishNode(t,"WithStatement")}parseEmptyStatement(t){return this.next(),this.finishNode(t,"EmptyStatement")}parseLabeledStatement(t,e,s,r){for(let a of this.state.labels)a.name===e&&this.raise(c.LabelRedeclaration,s,{labelName:e});let i=ms(this.state.type)?1:this.match(71)?2:null;for(let a=this.state.labels.length-1;a>=0;a--){let n=this.state.labels[a];if(n.statementStart===t.start)n.statementStart=this.sourceToOffsetPos(this.state.start),n.kind=i;else break}return this.state.labels.push({name:e,kind:i,statementStart:this.sourceToOffsetPos(this.state.start)}),t.body=r&8?this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):this.parseStatement(),this.state.labels.pop(),t.label=s,this.finishNode(t,"LabeledStatement")}parseExpressionStatement(t,e,s){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")}parseBlock(t=!1,e=!0,s){let r=this.startNode();return t&&this.state.strictErrors.clear(),this.expect(5),e&&this.scope.enter(0),this.parseBlockBody(r,t,!1,8,s),e&&this.scope.exit(),this.finishNode(r,"BlockStatement")}isValidDirective(t){return t.type==="ExpressionStatement"&&t.expression.type==="StringLiteral"&&!t.expression.extra.parenthesized}parseBlockBody(t,e,s,r,i){let a=t.body=[],n=t.directives=[];this.parseBlockOrModuleBlockBody(a,e?n:void 0,s,r,i)}parseBlockOrModuleBlockBody(t,e,s,r,i){let a=this.state.strict,n=!1,o=!1;for(;!this.match(r);){let l=s?this.parseModuleItem():this.parseStatementListItem();if(e&&!o){if(this.isValidDirective(l)){let h=this.stmtToDirective(l);e.push(h),!n&&h.value.value==="use strict"&&(n=!0,this.setStrict(!0));continue}o=!0,this.state.strictErrors.clear()}t.push(l)}i==null||i.call(this,n),a||this.setStrict(!1),this.next()}parseFor(t,e){return t.init=e,this.semicolon(!1),t.test=this.match(13)?null:this.parseExpression(),this.semicolon(!1),t.update=this.match(11)?null:this.parseExpression(),this.expect(11),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(t,"ForStatement")}parseForIn(t,e,s){let r=this.match(58);return this.next(),r?s!==null&&this.unexpected(s):t.await=s!==null,e.type==="VariableDeclaration"&&e.declarations[0].init!=null&&(!r||!this.options.annexB||this.state.strict||e.kind!=="var"||e.declarations[0].id.type!=="Identifier")&&this.raise(c.ForInOfLoopInitializer,e,{type:r?"ForInStatement":"ForOfStatement"}),e.type==="AssignmentPattern"&&this.raise(c.InvalidLhs,e,{ancestor:{type:"ForStatement"}}),t.left=e,t.right=r?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(11),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(t,r?"ForInStatement":"ForOfStatement")}parseVar(t,e,s,r=!1){let i=t.declarations=[];for(t.kind=s;;){let a=this.startNode();if(this.parseVarId(a,s),a.init=this.eat(29)?e?this.parseMaybeAssignDisallowIn():this.parseMaybeAssignAllowIn():null,a.init===null&&!r&&(a.id.type!=="Identifier"&&!(e&&(this.match(58)||this.isContextual(102)))?this.raise(c.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:"destructuring"}):(s==="const"||s==="using"||s==="await using")&&!(this.match(58)||this.isContextual(102))&&this.raise(c.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:s})),i.push(this.finishNode(a,"VariableDeclarator")),!this.eat(12))break}return t}parseVarId(t,e){let s=this.parseBindingAtom();(e==="using"||e==="await using")&&(s.type==="ArrayPattern"||s.type==="ObjectPattern")&&this.raise(c.UsingDeclarationHasBindingPattern,s.loc.start),this.checkLVal(s,{type:"VariableDeclarator"},e==="var"?5:8201),t.id=s}parseAsyncFunctionExpression(t){return this.parseFunction(t,8)}parseFunction(t,e=0){let s=e&2,r=!!(e&1),i=r&&!(e&4),a=!!(e&8);this.initFunction(t,a),this.match(55)&&(s&&this.raise(c.GeneratorInSingleStatementContext,this.state.startLoc),this.next(),t.generator=!0),r&&(t.id=this.parseFunctionId(i));let n=this.state.maybeInArrowParameters;return this.state.maybeInArrowParameters=!1,this.scope.enter(2),this.prodParam.enter(be(a,t.generator)),r||(t.id=this.parseFunctionId()),this.parseFunctionParams(t,!1),this.withSmartMixTopicForbiddingContext(()=>{this.parseFunctionBodyAndFinish(t,r?"FunctionDeclaration":"FunctionExpression")}),this.prodParam.exit(),this.scope.exit(),r&&!s&&this.registerFunctionStatementId(t),this.state.maybeInArrowParameters=n,t}parseFunctionId(t){return t||k(this.state.type)?this.parseIdentifier():null}parseFunctionParams(t,e){this.expect(10),this.expressionScope.enter(Js()),t.params=this.parseBindingList(11,41,2|(e?4:0)),this.expressionScope.exit()}registerFunctionStatementId(t){t.id&&this.scope.declareName(t.id.name,!this.options.annexB||this.state.strict||t.generator||t.async?this.scope.treatFunctionsAsVar?5:8201:17,t.id.loc.start)}parseClass(t,e,s){this.next();let r=this.state.strict;return this.state.strict=!0,this.parseClassId(t,e,s),this.parseClassSuper(t),t.body=this.parseClassBody(!!t.superClass,r),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")}isClassProperty(){return this.match(29)||this.match(13)||this.match(8)}isClassMethod(){return this.match(10)}nameIsConstructor(t){return t.type==="Identifier"&&t.name==="constructor"||t.type==="StringLiteral"&&t.value==="constructor"}isNonstaticConstructor(t){return!t.computed&&!t.static&&this.nameIsConstructor(t.key)}parseClassBody(t,e){this.classScope.enter();let s={hadConstructor:!1,hadSuperClass:t},r=[],i=this.startNode();if(i.body=[],this.expect(5),this.withSmartMixTopicForbiddingContext(()=>{for(;!this.match(8);){if(this.eat(13)){if(r.length>0)throw this.raise(c.DecoratorSemicolon,this.state.lastTokEndLoc);continue}if(this.match(26)){r.push(this.parseDecorator());continue}let a=this.startNode();r.length&&(a.decorators=r,this.resetStartLocationFromNode(a,r[0]),r=[]),this.parseClassMember(i,a,s),a.kind==="constructor"&&a.decorators&&a.decorators.length>0&&this.raise(c.DecoratorConstructor,a)}}),this.state.strict=e,this.next(),r.length)throw this.raise(c.TrailingDecorator,this.state.startLoc);return this.classScope.exit(),this.finishNode(i,"ClassBody")}parseClassMemberFromModifier(t,e){let s=this.parseIdentifier(!0);if(this.isClassMethod()){let r=e;return r.kind="method",r.computed=!1,r.key=s,r.static=!1,this.pushClassMethod(t,r,!1,!1,!1,!1),!0}else if(this.isClassProperty()){let r=e;return r.computed=!1,r.key=s,r.static=!1,t.body.push(this.parseClassProperty(r)),!0}return this.resetPreviousNodeTrailingComments(s),!1}parseClassMember(t,e,s){let r=this.isContextual(106);if(r){if(this.parseClassMemberFromModifier(t,e))return;if(this.eat(5)){this.parseClassStaticBlock(t,e);return}}this.parseClassMemberWithIsStatic(t,e,s,r)}parseClassMemberWithIsStatic(t,e,s,r){let i=e,a=e,n=e,o=e,l=e,h=i,d=i;if(e.static=r,this.parsePropertyNamePrefixOperator(e),this.eat(55)){h.kind="method";let L=this.match(139);if(this.parseClassElementName(h),L){this.pushClassPrivateMethod(t,a,!0,!1);return}this.isNonstaticConstructor(i)&&this.raise(c.ConstructorIsGenerator,i.key),this.pushClassMethod(t,i,!0,!1,!1,!1);return}let y=!this.state.containsEsc&&k(this.state.type),g=this.parseClassElementName(e),b=y?g.name:null,N=this.isPrivateName(g),D=this.state.startLoc;if(this.parsePostMemberNameModifiers(d),this.isClassMethod()){if(h.kind="method",N){this.pushClassPrivateMethod(t,a,!1,!1);return}let L=this.isNonstaticConstructor(i),O=!1;L&&(i.kind="constructor",s.hadConstructor&&!this.hasPlugin("typescript")&&this.raise(c.DuplicateConstructor,g),L&&this.hasPlugin("typescript")&&e.override&&this.raise(c.OverrideOnConstructor,g),s.hadConstructor=!0,O=s.hadSuperClass),this.pushClassMethod(t,i,!1,!1,L,O)}else if(this.isClassProperty())N?this.pushClassPrivateProperty(t,o):this.pushClassProperty(t,n);else if(b==="async"&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(g);let L=this.eat(55);d.optional&&this.unexpected(D),h.kind="method";let O=this.match(139);this.parseClassElementName(h),this.parsePostMemberNameModifiers(d),O?this.pushClassPrivateMethod(t,a,L,!0):(this.isNonstaticConstructor(i)&&this.raise(c.ConstructorIsAsync,i.key),this.pushClassMethod(t,i,L,!0,!1,!1))}else if((b==="get"||b==="set")&&!(this.match(55)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(g),h.kind=b;let L=this.match(139);this.parseClassElementName(i),L?this.pushClassPrivateMethod(t,a,!1,!1):(this.isNonstaticConstructor(i)&&this.raise(c.ConstructorIsAccessor,i.key),this.pushClassMethod(t,i,!1,!1,!1,!1)),this.checkGetterSetterParams(i)}else if(b==="accessor"&&!this.isLineTerminator()){this.expectPlugin("decoratorAutoAccessors"),this.resetPreviousNodeTrailingComments(g);let L=this.match(139);this.parseClassElementName(n),this.pushClassAccessorProperty(t,l,L)}else this.isLineTerminator()?N?this.pushClassPrivateProperty(t,o):this.pushClassProperty(t,n):this.unexpected()}parseClassElementName(t){let{type:e,value:s}=this.state;if((e===132||e===134)&&t.static&&s==="prototype"&&this.raise(c.StaticPrototype,this.state.startLoc),e===139){s==="constructor"&&this.raise(c.ConstructorClassPrivateField,this.state.startLoc);let r=this.parsePrivateName();return t.key=r,r}return this.parsePropertyName(t),t.key}parseClassStaticBlock(t,e){var s;this.scope.enter(208);let r=this.state.labels;this.state.labels=[],this.prodParam.enter(0);let i=e.body=[];this.parseBlockOrModuleBlockBody(i,void 0,!1,8),this.prodParam.exit(),this.scope.exit(),this.state.labels=r,t.body.push(this.finishNode(e,"StaticBlock")),(s=e.decorators)!=null&&s.length&&this.raise(c.DecoratorStaticBlock,e)}pushClassProperty(t,e){!e.computed&&this.nameIsConstructor(e.key)&&this.raise(c.ConstructorClassField,e.key),t.body.push(this.parseClassProperty(e))}pushClassPrivateProperty(t,e){let s=this.parseClassPrivateProperty(e);t.body.push(s),this.classScope.declarePrivateName(this.getPrivateNameSV(s.key),0,s.key.loc.start)}pushClassAccessorProperty(t,e,s){!s&&!e.computed&&this.nameIsConstructor(e.key)&&this.raise(c.ConstructorClassField,e.key);let r=this.parseClassAccessorProperty(e);t.body.push(r),s&&this.classScope.declarePrivateName(this.getPrivateNameSV(r.key),0,r.key.loc.start)}pushClassMethod(t,e,s,r,i,a){t.body.push(this.parseMethod(e,s,r,i,a,"ClassMethod",!0))}pushClassPrivateMethod(t,e,s,r){let i=this.parseMethod(e,s,r,!1,!1,"ClassPrivateMethod",!0);t.body.push(i);let a=i.kind==="get"?i.static?6:2:i.kind==="set"?i.static?5:1:0;this.declareClassPrivateMethodInScope(i,a)}declareClassPrivateMethodInScope(t,e){this.classScope.declarePrivateName(this.getPrivateNameSV(t.key),e,t.key.loc.start)}parsePostMemberNameModifiers(t){}parseClassPrivateProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassPrivateProperty")}parseClassProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassProperty")}parseClassAccessorProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassAccessorProperty")}parseInitializer(t){this.scope.enter(80),this.expressionScope.enter(gt()),this.prodParam.enter(0),t.value=this.eat(29)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(t,e,s,r=8331){if(k(this.state.type))t.id=this.parseIdentifier(),e&&this.declareNameFromIdentifier(t.id,r);else if(s||!e)t.id=null;else throw this.raise(c.MissingClassName,this.state.startLoc)}parseClassSuper(t){t.superClass=this.eat(81)?this.parseExprSubscripts():null}parseExport(t,e){let s=this.parseMaybeImportPhase(t,!0),r=this.maybeParseExportDefaultSpecifier(t,s),i=!r||this.eat(12),a=i&&this.eatExportStar(t),n=a&&this.maybeParseExportNamespaceSpecifier(t),o=i&&(!n||this.eat(12)),l=r||a;if(a&&!n){if(r&&this.unexpected(),e)throw this.raise(c.UnsupportedDecoratorExport,t);return this.parseExportFrom(t,!0),this.finishNode(t,"ExportAllDeclaration")}let h=this.maybeParseExportNamedSpecifiers(t);r&&i&&!a&&!h&&this.unexpected(null,5),n&&o&&this.unexpected(null,98);let d;if(l||h){if(d=!1,e)throw this.raise(c.UnsupportedDecoratorExport,t);this.parseExportFrom(t,l)}else d=this.maybeParseExportDeclaration(t);if(l||h||d){var y;let g=t;if(this.checkExport(g,!0,!1,!!g.source),((y=g.declaration)==null?void 0:y.type)==="ClassDeclaration")this.maybeTakeDecorators(e,g.declaration,g);else if(e)throw this.raise(c.UnsupportedDecoratorExport,t);return this.finishNode(g,"ExportNamedDeclaration")}if(this.eat(65)){let g=t,b=this.parseExportDefaultExpression();if(g.declaration=b,b.type==="ClassDeclaration")this.maybeTakeDecorators(e,b,g);else if(e)throw this.raise(c.UnsupportedDecoratorExport,t);return this.checkExport(g,!0,!0),this.finishNode(g,"ExportDefaultDeclaration")}this.unexpected(null,5)}eatExportStar(t){return this.eat(55)}maybeParseExportDefaultSpecifier(t,e){if(e||this.isExportDefaultSpecifier()){this.expectPlugin("exportDefaultFrom",e==null?void 0:e.loc.start);let s=e||this.parseIdentifier(!0),r=this.startNodeAtNode(s);return r.exported=s,t.specifiers=[this.finishNode(r,"ExportDefaultSpecifier")],!0}return!1}maybeParseExportNamespaceSpecifier(t){if(this.isContextual(93)){var e;(e=t).specifiers!=null||(e.specifiers=[]);let s=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),s.exported=this.parseModuleExportName(),t.specifiers.push(this.finishNode(s,"ExportNamespaceSpecifier")),!0}return!1}maybeParseExportNamedSpecifiers(t){if(this.match(5)){let e=t;e.specifiers||(e.specifiers=[]);let s=e.exportKind==="type";return e.specifiers.push(...this.parseExportSpecifiers(s)),e.source=null,e.declaration=null,this.hasPlugin("importAssertions")&&(e.assertions=[]),!0}return!1}maybeParseExportDeclaration(t){return this.shouldParseExportDeclaration()?(t.specifiers=[],t.source=null,this.hasPlugin("importAssertions")&&(t.assertions=[]),t.declaration=this.parseExportDeclaration(t),!0):!1}isAsyncFunction(){if(!this.isContextual(95))return!1;let t=this.nextTokenInLineStart();return this.isUnparsedContextual(t,"function")}parseExportDefaultExpression(){let t=this.startNode();if(this.match(68))return this.next(),this.parseFunction(t,5);if(this.isAsyncFunction())return this.next(),this.next(),this.parseFunction(t,13);if(this.match(80))return this.parseClass(t,!0,!0);if(this.match(26))return this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(c.DecoratorBeforeExport,this.state.startLoc),this.parseClass(this.maybeTakeDecorators(this.parseDecorators(!1),this.startNode()),!0,!0);if(this.match(75)||this.match(74)||this.isLet())throw this.raise(c.UnsupportedDefaultExport,this.state.startLoc);let e=this.parseMaybeAssignAllowIn();return this.semicolon(),e}parseExportDeclaration(t){return this.match(80)?this.parseClass(this.startNode(),!0,!1):this.parseStatementListItem()}isExportDefaultSpecifier(){let{type:t}=this.state;if(k(t)){if(t===95&&!this.state.containsEsc||t===100)return!1;if((t===130||t===129)&&!this.state.containsEsc){let{type:r}=this.lookahead();if(k(r)&&r!==98||r===5)return this.expectOnePlugin(["flow","typescript"]),!1}}else if(!this.match(65))return!1;let e=this.nextTokenStart(),s=this.isUnparsedContextual(e,"from");if(this.input.charCodeAt(e)===44||k(this.state.type)&&s)return!0;if(this.match(65)&&s){let r=this.input.charCodeAt(this.nextTokenStartSince(e+4));return r===34||r===39}return!1}parseExportFrom(t,e){this.eatContextual(98)?(t.source=this.parseImportSource(),this.checkExport(t),this.maybeParseImportAttributes(t),this.checkJSONModuleImport(t)):e&&this.unexpected(),this.semicolon()}shouldParseExportDeclaration(){let{type:t}=this.state;return t===26&&(this.expectOnePlugin(["decorators","decorators-legacy"]),this.hasPlugin("decorators"))?(this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(c.DecoratorBeforeExport,this.state.startLoc),!0):this.isContextual(107)?(this.raise(c.UsingDeclarationExport,this.state.startLoc),!0):this.isContextual(96)&&this.startsAwaitUsing()?(this.raise(c.UsingDeclarationExport,this.state.startLoc),!0):t===74||t===75||t===68||t===80||this.isLet()||this.isAsyncFunction()}checkExport(t,e,s,r){if(e){var i;if(s){if(this.checkDuplicateExports(t,"default"),this.hasPlugin("exportDefaultFrom")){var a;let n=t.declaration;n.type==="Identifier"&&n.name==="from"&&n.end-n.start===4&&!((a=n.extra)!=null&&a.parenthesized)&&this.raise(c.ExportDefaultFromAsIdentifier,n)}}else if((i=t.specifiers)!=null&&i.length)for(let n of t.specifiers){let{exported:o}=n,l=o.type==="Identifier"?o.name:o.value;if(this.checkDuplicateExports(n,l),!r&&n.local){let{local:h}=n;h.type!=="Identifier"?this.raise(c.ExportBindingIsString,n,{localName:h.value,exportName:l}):(this.checkReservedWord(h.name,h.loc.start,!0,!1),this.scope.checkLocalExport(h))}}else if(t.declaration){let n=t.declaration;if(n.type==="FunctionDeclaration"||n.type==="ClassDeclaration"){let{id:o}=n;if(!o)throw new Error("Assertion failure");this.checkDuplicateExports(t,o.name)}else if(n.type==="VariableDeclaration")for(let o of n.declarations)this.checkDeclaration(o.id)}}}checkDeclaration(t){if(t.type==="Identifier")this.checkDuplicateExports(t,t.name);else if(t.type==="ObjectPattern")for(let e of t.properties)this.checkDeclaration(e);else if(t.type==="ArrayPattern")for(let e of t.elements)e&&this.checkDeclaration(e);else t.type==="ObjectProperty"?this.checkDeclaration(t.value):t.type==="RestElement"?this.checkDeclaration(t.argument):t.type==="AssignmentPattern"&&this.checkDeclaration(t.left)}checkDuplicateExports(t,e){this.exportedIdentifiers.has(e)&&(e==="default"?this.raise(c.DuplicateDefaultExport,t):this.raise(c.DuplicateExport,t,{exportName:e})),this.exportedIdentifiers.add(e)}parseExportSpecifiers(t){let e=[],s=!0;for(this.expect(5);!this.eat(8);){if(s)s=!1;else if(this.expect(12),this.eat(8))break;let r=this.isContextual(130),i=this.match(134),a=this.startNode();a.local=this.parseModuleExportName(),e.push(this.parseExportSpecifier(a,i,t,r))}return e}parseExportSpecifier(t,e,s,r){return this.eatContextual(93)?t.exported=this.parseModuleExportName():e?t.exported=Zs(t.local):t.exported||(t.exported=$(t.local)),this.finishNode(t,"ExportSpecifier")}parseModuleExportName(){if(this.match(134)){let t=this.parseStringLiteral(this.state.value),e=Cr.exec(t.value);return e&&this.raise(c.ModuleExportNameHasLoneSurrogate,t,{surrogateCharCode:e[0].charCodeAt(0)}),t}return this.parseIdentifier(!0)}isJSONModuleImport(t){return t.assertions!=null?t.assertions.some(({key:e,value:s})=>s.value==="json"&&(e.type==="Identifier"?e.name==="type":e.value==="type")):!1}checkImportReflection(t){let{specifiers:e}=t,s=e.length===1?e[0].type:null;if(t.phase==="source")s!=="ImportDefaultSpecifier"&&this.raise(c.SourcePhaseImportRequiresDefault,e[0].loc.start);else if(t.phase==="defer")s!=="ImportNamespaceSpecifier"&&this.raise(c.DeferImportRequiresNamespace,e[0].loc.start);else if(t.module){var r;s!=="ImportDefaultSpecifier"&&this.raise(c.ImportReflectionNotBinding,e[0].loc.start),((r=t.assertions)==null?void 0:r.length)>0&&this.raise(c.ImportReflectionHasAssertion,e[0].loc.start)}}checkJSONModuleImport(t){if(this.isJSONModuleImport(t)&&t.type!=="ExportAllDeclaration"){let{specifiers:e}=t;if(e!=null){let s=e.find(r=>{let i;if(r.type==="ExportSpecifier"?i=r.local:r.type==="ImportSpecifier"&&(i=r.imported),i!==void 0)return i.type==="Identifier"?i.name!=="default":i.value!=="default"});s!==void 0&&this.raise(c.ImportJSONBindingNotDefault,s.loc.start)}}}isPotentialImportPhase(t){return t?!1:this.isContextual(105)||this.isContextual(97)||this.isContextual(127)}applyImportPhase(t,e,s,r){e||(s==="module"?(this.expectPlugin("importReflection",r),t.module=!0):this.hasPlugin("importReflection")&&(t.module=!1),s==="source"?(this.expectPlugin("sourcePhaseImports",r),t.phase="source"):s==="defer"?(this.expectPlugin("deferredImportEvaluation",r),t.phase="defer"):this.hasPlugin("sourcePhaseImports")&&(t.phase=null))}parseMaybeImportPhase(t,e){if(!this.isPotentialImportPhase(e))return this.applyImportPhase(t,e,null),null;let s=this.parseIdentifier(!0),{type:r}=this.state;return(U(r)?r!==98||this.lookaheadCharCode()===102:r!==12)?(this.resetPreviousIdentifierLeadingComments(s),this.applyImportPhase(t,e,s.name,s.loc.start),null):(this.applyImportPhase(t,e,null),s)}isPrecedingIdImportPhase(t){let{type:e}=this.state;return k(e)?e!==98||this.lookaheadCharCode()===102:e!==12}parseImport(t){return this.match(134)?this.parseImportSourceAndAttributes(t):this.parseImportSpecifiersAndAfter(t,this.parseMaybeImportPhase(t,!1))}parseImportSpecifiersAndAfter(t,e){t.specifiers=[];let s=!this.maybeParseDefaultImportSpecifier(t,e)||this.eat(12),r=s&&this.maybeParseStarImportSpecifier(t);return s&&!r&&this.parseNamedImportSpecifiers(t),this.expectContextual(98),this.parseImportSourceAndAttributes(t)}parseImportSourceAndAttributes(t){return t.specifiers!=null||(t.specifiers=[]),t.source=this.parseImportSource(),this.maybeParseImportAttributes(t),this.checkImportReflection(t),this.checkJSONModuleImport(t),this.semicolon(),this.finishNode(t,"ImportDeclaration")}parseImportSource(){return this.match(134)||this.unexpected(),this.parseExprAtom()}parseImportSpecifierLocal(t,e,s){e.local=this.parseIdentifier(),t.specifiers.push(this.finishImportSpecifier(e,s))}finishImportSpecifier(t,e,s=8201){return this.checkLVal(t.local,{type:e},s),this.finishNode(t,e)}parseImportAttributes(){this.expect(5);let t=[],e=new Set;do{if(this.match(8))break;let s=this.startNode(),r=this.state.value;if(e.has(r)&&this.raise(c.ModuleAttributesWithDuplicateKeys,this.state.startLoc,{key:r}),e.add(r),this.match(134)?s.key=this.parseStringLiteral(r):s.key=this.parseIdentifier(!0),this.expect(14),!this.match(134))throw this.raise(c.ModuleAttributeInvalidValue,this.state.startLoc);s.value=this.parseStringLiteral(this.state.value),t.push(this.finishNode(s,"ImportAttribute"))}while(this.eat(12));return this.expect(8),t}parseModuleAttributes(){let t=[],e=new Set;do{let s=this.startNode();if(s.key=this.parseIdentifier(!0),s.key.name!=="type"&&this.raise(c.ModuleAttributeDifferentFromType,s.key),e.has(s.key.name)&&this.raise(c.ModuleAttributesWithDuplicateKeys,s.key,{key:s.key.name}),e.add(s.key.name),this.expect(14),!this.match(134))throw this.raise(c.ModuleAttributeInvalidValue,this.state.startLoc);s.value=this.parseStringLiteral(this.state.value),t.push(this.finishNode(s,"ImportAttribute"))}while(this.eat(12));return t}maybeParseImportAttributes(t){let e;var s=!1;if(this.match(76)){if(this.hasPrecedingLineBreak()&&this.lookaheadCharCode()===40)return;this.next(),this.hasPlugin("moduleAttributes")?e=this.parseModuleAttributes():e=this.parseImportAttributes(),s=!0}else this.isContextual(94)&&!this.hasPrecedingLineBreak()?(!this.hasPlugin("deprecatedImportAssert")&&!this.hasPlugin("importAssertions")&&this.raise(c.ImportAttributesUseAssert,this.state.startLoc),this.hasPlugin("importAssertions")||this.addExtra(t,"deprecatedAssertSyntax",!0),this.next(),e=this.parseImportAttributes()):e=[];!s&&this.hasPlugin("importAssertions")?t.assertions=e:t.attributes=e}maybeParseDefaultImportSpecifier(t,e){if(e){let s=this.startNodeAtNode(e);return s.local=e,t.specifiers.push(this.finishImportSpecifier(s,"ImportDefaultSpecifier")),!0}else if(U(this.state.type))return this.parseImportSpecifierLocal(t,this.startNode(),"ImportDefaultSpecifier"),!0;return!1}maybeParseStarImportSpecifier(t){if(this.match(55)){let e=this.startNode();return this.next(),this.expectContextual(93),this.parseImportSpecifierLocal(t,e,"ImportNamespaceSpecifier"),!0}return!1}parseNamedImportSpecifiers(t){let e=!0;for(this.expect(5);!this.eat(8);){if(e)e=!1;else{if(this.eat(14))throw this.raise(c.DestructureNamedImport,this.state.startLoc);if(this.expect(12),this.eat(8))break}let s=this.startNode(),r=this.match(134),i=this.isContextual(130);s.imported=this.parseModuleExportName();let a=this.parseImportSpecifier(s,r,t.importKind==="type"||t.importKind==="typeof",i,void 0);t.specifiers.push(a)}}parseImportSpecifier(t,e,s,r,i){if(this.eatContextual(93))t.local=this.parseIdentifier();else{let{imported:a}=t;if(e)throw this.raise(c.ImportBindingIsString,t,{importName:a.value});this.checkReservedWord(a.name,t.loc.start,!0,!0),t.local||(t.local=$(a))}return this.finishImportSpecifier(t,"ImportSpecifier",i)}isThisParam(t){return t.type==="Identifier"&&t.name==="this"}},kt=class extends Nr{constructor(t,e,s){t=Sr(t),super(t,e),this.options=t,this.initializeScopes(),this.plugins=s,this.filename=t.sourceFilename,this.startIndex=t.startIndex}getScopeHandler(){return Ue}parse(){this.enterInitialScopes();let t=this.startNode(),e=this.startNode();return this.nextToken(),t.errors=null,this.parseTopLevel(t,e),t.errors=this.state.errors,t.comments.length=this.state.commentsLen,t}};function vr(t,e){var s;if(((s=e)==null?void 0:s.sourceType)==="unambiguous"){e=Object.assign({},e);try{e.sourceType="module";let r=ue(e,t),i=r.parse();if(r.sawUnambiguousESM)return i;if(r.ambiguousScriptDifferentAst)try{return e.sourceType="script",ue(e,t).parse()}catch{}else i.program.sourceType="script";return i}catch(r){try{return e.sourceType="script",ue(e,t).parse()}catch{}throw r}}else return ue(e,t).parse()}function kr(t,e){let s=ue(e,t);return s.options.strictMode&&(s.state.strict=!0),s.getExpression()}function Lr(t){let e={};for(let s of Object.keys(t))e[s]=V(t[s]);return e}var Mr=Lr(ps);function ue(t,e){let s=kt,r=new Map;if(t!=null&&t.plugins){for(let i of t.plugins){let a,n;typeof i=="string"?a=i:[a,n]=i,r.has(a)||r.set(a,n||{})}Tr(r),s=Dr(r)}return new s(t,e,r)}var Lt=new Map;function Dr(t){let e=[];for(let i of br)t.has(i)&&e.push(i);let s=e.join("|"),r=Lt.get(s);if(!r){r=kt;for(let i of e)r=vt[i](r);Lt.set(s,r)}return r}p.parse=vr,p.parseExpression=kr,p.tokTypes=Mr}),Kt={};_r(Kt,{parsers:()=>Ji});var Mt=Vt(qt());function Jt(p){return(u,m,x)=>{let f=!!(x!=null&&x.backwards);if(m===!1)return!1;let{length:E}=u,w=m;for(;w>=0&&w{if(!(p&&u==null))return Array.isArray(u)||typeof u=="string"?u[m<0?u.length+m:m]:u.at(m)},Dt=ti;function si(p){return Array.isArray(p)&&p.length>0}var et=si;function _(p){var u,m,x;let f=((u=p.range)==null?void 0:u[0])??p.start,E=(x=((m=p.declaration)==null?void 0:m.decorators)??p.decorators)==null?void 0:x[0];return E?Math.min(_(E),f):f}function Z(p){var u;return((u=p.range)==null?void 0:u[1])??p.end}function ri(p){let u=new Set(p);return m=>u.has(m==null?void 0:m.type)}var ii=ri,ai=ii(["Block","CommentBlock","MultiLine"]),Ge=ai;function ni(p){let u=`*${p.value}*`.split(` +`);return u.length>1&&u.every(m=>m.trimStart()[0]==="*")}var Ot=ni;function oi(p){return Ge(p)&&p.value[0]==="*"&&/@(?:type|satisfies)\b/u.test(p.value)}var li=oi,de=null;function fe(p){if(de!==null&&typeof de.property){let u=de;return de=fe.prototype=null,u}return de=fe.prototype=p??Object.create(null),new fe}var hi=10;for(let p=0;p<=hi;p++)fe();function pi(p){return fe(p)}function ci(p,u="type"){pi(p);function m(x){let f=x[u],E=p[f];if(!Array.isArray(E))throw Object.assign(new Error(`Missing visitor keys for '${f}'.`),{node:x});return E}return m}var ui=ci,di={ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","arguments","typeParameters","typeArguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","typeParameters","params","returnType","body","predicate"],FunctionExpression:["id","typeParameters","params","returnType","body"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","arguments","typeParameters","typeArguments"],Program:["directives","body"],ObjectExpression:["properties"],ObjectMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectProperty:["key","value","decorators"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["typeParameters","params","returnType","body","predicate"],ClassBody:["body"],ClassExpression:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ClassDeclaration:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ExportAllDeclaration:["source","attributes","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","attributes"],ExportSpecifier:["local","exported"],ForOfStatement:["left","right","body"],ImportDeclaration:["specifiers","source","attributes"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],ImportExpression:["source","options"],MetaProperty:["meta","property"],ClassMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectPattern:["properties","typeAnnotation","decorators"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","typeParameters","quasi","typeArguments"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","arguments","typeParameters","typeArguments"],ClassProperty:["decorators","key","typeAnnotation","value","variance"],ClassAccessorProperty:["decorators","key","typeAnnotation","value"],ClassPrivateProperty:["decorators","key","typeAnnotation","value","variance"],ClassPrivateMethod:["decorators","key","typeParameters","params","returnType","body"],PrivateName:["id"],StaticBlock:["body"],AnyTypeAnnotation:[],ArrayTypeAnnotation:["elementType"],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:["id","typeParameters"],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareFunction:["id","predicate"],DeclareInterface:["id","typeParameters","extends","body"],DeclareModule:["id","body"],DeclareModuleExports:["typeAnnotation"],DeclareTypeAlias:["id","typeParameters","right"],DeclareOpaqueType:["id","typeParameters","supertype"],DeclareVariable:["id"],DeclareExportDeclaration:["declaration","specifiers","source","attributes"],DeclareExportAllDeclaration:["source","attributes"],DeclaredPredicate:["value"],ExistsTypeAnnotation:[],FunctionTypeAnnotation:["typeParameters","params","rest","returnType","this"],FunctionTypeParam:["name","typeAnnotation"],GenericTypeAnnotation:["id","typeParameters"],InferredPredicate:[],InterfaceExtends:["id","typeParameters"],InterfaceDeclaration:["id","typeParameters","extends","body"],InterfaceTypeAnnotation:["extends","body"],IntersectionTypeAnnotation:["types"],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:["typeAnnotation"],NumberLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeInternalSlot:["id","value"],ObjectTypeCallProperty:["value"],ObjectTypeIndexer:["variance","id","key","value"],ObjectTypeProperty:["key","value","variance"],ObjectTypeSpreadProperty:["argument"],OpaqueType:["id","typeParameters","supertype","impltype"],QualifiedTypeIdentifier:["qualification","id"],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:["types","elementTypes"],TypeofTypeAnnotation:["argument","typeArguments"],TypeAlias:["id","typeParameters","right"],TypeAnnotation:["typeAnnotation"],TypeCastExpression:["expression","typeAnnotation"],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:["params"],TypeParameterInstantiation:["params"],UnionTypeAnnotation:["types"],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:["id","body"],EnumBooleanBody:["members"],EnumNumberBody:["members"],EnumStringBody:["members"],EnumSymbolBody:["members"],EnumBooleanMember:["id","init"],EnumNumberMember:["id","init"],EnumStringMember:["id","init"],EnumDefaultedMember:["id"],IndexedAccessType:["objectType","indexType"],OptionalIndexedAccessType:["objectType","indexType"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXSpreadChild:["expression"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","attributes","typeArguments","typeParameters"],JSXSpreadAttribute:["argument"],JSXText:[],JSXFragment:["openingFragment","children","closingFragment"],JSXOpeningFragment:[],JSXClosingFragment:[],Noop:[],Placeholder:[],V8IntrinsicIdentifier:[],ArgumentPlaceholder:[],BindExpression:["object","callee"],ImportAttribute:["key","value"],Decorator:["expression"],DoExpression:["body"],ExportDefaultSpecifier:["exported"],RecordExpression:["properties"],TupleExpression:["elements"],ModuleExpression:["body"],TopicReference:[],PipelineTopicExpression:["expression"],PipelineBareFunction:["callee"],PipelinePrimaryTopicReference:[],TSParameterProperty:["parameter","decorators"],TSDeclareFunction:["id","typeParameters","params","returnType","body"],TSDeclareMethod:["decorators","key","typeParameters","params","returnType"],TSQualifiedName:["left","right"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation","params","returnType"],TSIndexSignature:["parameters","typeAnnotation"],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructorType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSTypeReference:["typeName","typeParameters","typeArguments"],TSTypePredicate:["parameterName","typeAnnotation"],TSTypeQuery:["exprName","typeParameters","typeArguments"],TSTypeLiteral:["members"],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSNamedTupleMember:["label","elementType"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["typeParameter","nameType","typeAnnotation"],TSLiteralType:["literal"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSInstantiationExpression:["expression","typeParameters","typeArguments"],TSAsExpression:["expression","typeAnnotation"],TSSatisfiesExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSEnumDeclaration:["id","members"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body"],TSModuleBlock:["body"],TSImportType:["argument","qualifier","typeParameters","typeArguments"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSNonNullExpression:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterInstantiation:["params"],TSTypeParameterDeclaration:["params"],TSTypeParameter:["constraint","default","name"],ChainExpression:["expression"],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],Literal:[],MethodDefinition:["decorators","key","value"],PrivateIdentifier:[],Property:["key","value"],PropertyDefinition:["decorators","key","typeAnnotation","value","variance"],AccessorProperty:["decorators","key","typeAnnotation","value"],TSAbstractAccessorProperty:["decorators","key","typeAnnotation"],TSAbstractKeyword:[],TSAbstractMethodDefinition:["key","value"],TSAbstractPropertyDefinition:["decorators","key","typeAnnotation"],TSAsyncKeyword:[],TSClassImplements:["expression","typeArguments","typeParameters"],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSEnumBody:["members"],TSExportKeyword:[],TSInterfaceHeritage:["expression","typeArguments","typeParameters"],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],TSTemplateLiteralType:["quasis","types"],AsConstExpression:["expression"],AsExpression:["expression","typeAnnotation"],BigIntLiteralTypeAnnotation:[],BigIntTypeAnnotation:[],ComponentDeclaration:["id","params","body","typeParameters","rendersType"],ComponentParameter:["name","local"],ComponentTypeAnnotation:["params","rest","typeParameters","rendersType"],ComponentTypeParameter:["name","typeAnnotation"],ConditionalTypeAnnotation:["checkType","extendsType","trueType","falseType"],DeclareComponent:["id","params","rest","typeParameters","rendersType"],DeclareEnum:["id","body"],DeclareHook:["id"],DeclareNamespace:["id","body"],EnumBigIntBody:["members"],EnumBigIntMember:["id","init"],HookDeclaration:["id","params","body","typeParameters","returnType"],HookTypeAnnotation:["params","returnType","rest","typeParameters"],InferTypeAnnotation:["typeParameter"],KeyofTypeAnnotation:["argument"],ObjectTypeMappedTypeProperty:["keyTparam","propType","sourceType","variance"],QualifiedTypeofIdentifier:["qualification","id"],TupleTypeLabeledElement:["label","elementType","variance"],TupleTypeSpreadElement:["label","typeAnnotation"],TypeOperator:["typeAnnotation"],TypePredicate:["parameterName","typeAnnotation","asserts"],NGRoot:["node"],NGPipeExpression:["left","right","arguments"],NGChainedExpression:["expressions"],NGEmptyExpression:[],NGMicrosyntax:["body"],NGMicrosyntaxKey:[],NGMicrosyntaxExpression:["expression","alias"],NGMicrosyntaxKeyedExpression:["key","expression"],NGMicrosyntaxLet:["key","value"],NGMicrosyntaxAs:["key","alias"],JsExpressionRoot:["node"],JsonRoot:["node"],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:["typeAnnotation"],TSJSDocNonNullableType:["typeAnnotation"],NeverTypeAnnotation:[],UndefinedTypeAnnotation:[],UnknownTypeAnnotation:[],SatisfiesExpression:["expression","typeAnnotation"]},mi=ui(di),fi=mi;function Ye(p,u){if(!(p!==null&&typeof p=="object"))return p;if(Array.isArray(p)){for(let x=0;x{var w;(w=E.leadingComments)!=null&&w.some(li)&&f.add(_(E))}),p=We(p,E=>{if(E.type==="ParenthesizedExpression"){let{expression:w}=E;if(w.type==="TypeCastExpression")return w.range=[...E.range],w;let F=_(E);if(!f.has(F))return w.extra={...w.extra,parenthesized:!0},w}})}if(p=We(p,f=>{switch(f.type){case"LogicalExpression":if(Xt(f))return Qe(f);break;case"VariableDeclaration":{let E=Dt(!1,f.declarations,-1);E!=null&&E.init&&x[Z(E)]!==";"&&(f.range=[_(f),Z(E)]);break}case"TSParenthesizedType":return f.typeAnnotation;case"TSTypeParameter":if(typeof f.name=="string"){let E=_(f);f.name={type:"Identifier",name:f.name,range:[E,E+f.name.length]}}break;case"TopicReference":p.extra={...p.extra,__isUsingHackPipeline:!0};break;case"TSUnionType":case"TSIntersectionType":if(f.types.length===1)return f.types[0];break}}),et(p.comments)){let f=Dt(!1,p.comments,-1);for(let E=p.comments.length-2;E>=0;E--){let w=p.comments[E];Z(w)===_(f)&&Ge(w)&&Ge(f)&&Ot(w)&&Ot(f)&&(p.comments.splice(E+1,1),w.value+="*//*"+f.value,w.range=[_(w),Z(f)]),f=w}}return p.type==="Program"&&(p.range=[0,x.length]),p}function Xt(p){return p.type==="LogicalExpression"&&p.right.type==="LogicalExpression"&&p.operator===p.right.operator}function Qe(p){return Xt(p)?Qe({type:"LogicalExpression",operator:p.operator,left:Qe({type:"LogicalExpression",operator:p.operator,left:p.left,right:p.right.left,range:[_(p.left),Z(p.right.left)]}),right:p.right.right,range:[_(p),Z(p)]}):p}var xi=yi;function Pi(p,u){let m=new SyntaxError(p+" ("+u.loc.start.line+":"+u.loc.start.column+")");return Object.assign(m,u)}var Gt=Pi;function gi(p){let{message:u,loc:{line:m,column:x},reasonCode:f}=p,E=p;(f==="MissingPlugin"||f==="MissingOneOfPlugins")&&(u="Unexpected token.",E=void 0);let w=` (${m}:${x})`;return u.endsWith(w)&&(u=u.slice(0,-w.length)),Gt(u,{loc:{start:{line:m,column:x+1}},cause:E})}var Yt=gi,Ti=(p,u,m,x)=>{if(!(p&&u==null))return u.replaceAll?u.replaceAll(m,x):m.global?u.replace(m,x):u.split(m).join(x)},Ee=Ti,bi=/\*\/$/,Ai=/^\/\*\*?/,Si=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,Ei=/(^|\s+)\/\/([^\n\r]*)/g,Ft=/^(\r?\n)+/,wi=/(?:^|\r?\n) *(@[^\n\r]*?) *\r?\n *(?![^\n\r@]*\/\/[^]*)([^\s@][^\n\r@]+?) *\r?\n/g,Bt=/(?:^|\r?\n) *@(\S+) *([^\n\r]*)/g,Ci=/(\r?\n|^) *\* ?/g,Ii=[];function Ni(p){let u=p.match(Si);return u?u[0].trimStart():""}function vi(p){let u=` +`;p=Ee(!1,p.replace(Ai,"").replace(bi,""),Ci,"$1");let m="";for(;m!==p;)m=p,p=Ee(!1,p,wi,`${u}$1 $2${u}`);p=p.replace(Ft,"").trimEnd();let x=Object.create(null),f=Ee(!1,p,Bt,"").replace(Ft,"").trimEnd(),E;for(;E=Bt.exec(p);){let w=Ee(!1,E[2],Ei,"");if(typeof x[E[1]]=="string"||Array.isArray(x[E[1]])){let F=x[E[1]];x[E[1]]=[...Ii,...Array.isArray(F)?F:[F],w]}else x[E[1]]=w}return{comments:f,pragmas:x}}function ki(p){let u=Wt(p);u&&(p=p.slice(u.length+1));let m=Ni(p),{pragmas:x,comments:f}=vi(m);return{shebang:u,text:p,pragmas:x,comments:f}}function Li(p){let{pragmas:u}=ki(p);return Object.prototype.hasOwnProperty.call(u,"prettier")||Object.prototype.hasOwnProperty.call(u,"format")}function Mi(p){return p=typeof p=="function"?{parse:p}:p,{astFormat:"estree",hasPragma:Li,locStart:_,locEnd:Z,...p}}var me=Mi;function Di(p){let{filepath:u}=p;if(u){if(u=u.toLowerCase(),u.endsWith(".cjs")||u.endsWith(".cts"))return"script";if(u.endsWith(".mjs")||u.endsWith(".mts"))return"module"}}var Oi=Di;function Fi(p,u){let{type:m="JsExpressionRoot",rootMarker:x,text:f}=u,{tokens:E,comments:w}=p;return delete p.tokens,delete p.comments,{tokens:E,comments:w,type:m,node:p,range:[0,f.length],rootMarker:x}}var Qt=Fi,ie=p=>me(_i(p)),Bi={sourceType:"module",allowImportExportEverywhere:!0,allowReturnOutsideFunction:!0,allowNewTargetOutsideFunction:!0,allowSuperOutsideMethod:!0,allowUndeclaredExports:!0,errorRecovery:!0,createParenthesizedExpressions:!0,createImportExpressions:!0,plugins:["doExpressions","exportDefaultFrom","functionBind","functionSent","throwExpressions","partialApplication","decorators","moduleBlocks","asyncDoExpressions","destructuringPrivate","decoratorAutoAccessors","explicitResourceManagement","sourcePhaseImports","deferredImportEvaluation",["optionalChainingAssign",{version:"2023-07"}],"recordAndTuple"],tokens:!0,ranges:!0},Rt="v8intrinsic",jt=[["pipelineOperator",{proposal:"hack",topicToken:"%"}],["pipelineOperator",{proposal:"fsharp"}]],K=(p,u=Bi)=>({...u,plugins:[...u.plugins,...p]}),Ri=/@(?:no)?flow\b/u;function ji(p,u){var m;if((m=u.filepath)!=null&&m.endsWith(".js.flow"))return!0;let x=Wt(p);x&&(p=p.slice(x.length));let f=Yr(p,0);return f!==!1&&(p=p.slice(0,f)),Ri.test(p)}function Ui(p,u,m){let x=p(u,m),f=x.errors.find(E=>!Hi.has(E.reasonCode));if(f)throw f;return x}function _i({isExpression:p=!1,optionsCombinations:u}){return(m,x={})=>{if((x.parser==="babel"||x.parser==="__babel_estree")&&ji(m,x))return x.parser="babel-flow",es.parse(m,x);let f=u;(x.__babelSourceType??Oi(x))==="script"&&(f=f.map(R=>({...R,sourceType:"script"})));let E=/%[A-Z]/u.test(m);m.includes("|>")?f=(E?[...jt,Rt]:jt).flatMap(R=>f.map(we=>K([R],we))):E&&(f=f.map(R=>K([Rt],R)));let w=p?Mt.parseExpression:Mt.parse,F;try{F=Zr(f.map(R=>()=>Ui(w,m,R)))}catch({errors:[R]}){throw Yt(R)}return p&&(F=Qt(F,{text:m,rootMarker:x.rootMarker})),xi(F,{parser:"babel",text:m})}}var Hi=new Set(["StrictNumericEscape","StrictWith","StrictOctalLiteral","StrictDelete","StrictEvalArguments","StrictEvalArgumentsBinding","StrictFunction","ForInOfLoopInitializer","EmptyTypeArguments","EmptyTypeParameters","ConstructorHasTypeParameters","UnsupportedParameterPropertyKind","DecoratorExportClass","ParamDupe","InvalidDecimal","RestTrailingComma","UnsupportedParameterDecorator","UnterminatedJsxContent","UnexpectedReservedWord","ModuleAttributesWithDuplicateKeys","LineTerminatorBeforeArrow","InvalidEscapeSequenceTemplate","NonAbstractClassHasAbstractMethod","OptionalTypeBeforeRequired","PatternIsOptional","OptionalBindingPattern","DeclareClassFieldHasInitializer","TypeImportCannotSpecifyDefaultAndNamed","ConstructorClassField","VarRedeclaration","InvalidPrivateFieldResolution","DuplicateExport","ImportAttributesUseAssert"]),Zt=[K(["jsx"])],Ut=ie({optionsCombinations:Zt}),_t=ie({optionsCombinations:[K(["jsx","typescript"]),K(["typescript"])]}),Ht=ie({isExpression:!0,optionsCombinations:[K(["jsx"])]}),zt=ie({isExpression:!0,optionsCombinations:[K(["typescript"])]}),es=ie({optionsCombinations:[K(["jsx",["flow",{all:!0}],"flowComments"])]}),zi=ie({optionsCombinations:Zt.map(p=>K(["estree"],p))}),Vi={babel:Ut,"babel-flow":es,"babel-ts":_t,__js_expression:Ht,__ts_expression:zt,__vue_expression:Ht,__vue_ts_expression:zt,__vue_event_binding:Ut,__vue_ts_event_binding:_t,__babel_estree:zi},qi=Vt(qt());function ts(p={}){let{allowComments:u=!0}=p;return function(m){let x;try{x=(0,qi.parseExpression)(m,{tokens:!0,ranges:!0,attachComment:!1})}catch(f){throw Yt(f)}if(!u&&et(x.comments))throw Y(x.comments[0],"Comment");return re(x),Qt(x,{type:"JsonRoot",text:m})}}function Y(p,u){let[m,x]=[p.loc.start,p.loc.end].map(({line:f,column:E})=>({line:f,column:E+1}));return Gt(`${u} is not allowed in JSON.`,{loc:{start:m,end:x}})}function re(p){switch(p.type){case"ArrayExpression":for(let u of p.elements)u!==null&&re(u);return;case"ObjectExpression":for(let u of p.properties)re(u);return;case"ObjectProperty":if(p.computed)throw Y(p.key,"Computed key");if(p.shorthand)throw Y(p.key,"Shorthand property");p.key.type!=="Identifier"&&re(p.key),re(p.value);return;case"UnaryExpression":{let{operator:u,argument:m}=p;if(u!=="+"&&u!=="-")throw Y(p,`Operator '${p.operator}'`);if(m.type==="NumericLiteral"||m.type==="Identifier"&&(m.name==="Infinity"||m.name==="NaN"))return;throw Y(m,`Operator '${u}' before '${m.type}'`)}case"Identifier":if(p.name!=="Infinity"&&p.name!=="NaN"&&p.name!=="undefined")throw Y(p,`Identifier '${p.name}'`);return;case"TemplateLiteral":if(et(p.expressions))throw Y(p.expressions[0],"'TemplateLiteral' with expression");for(let u of p.quasis)re(u);return;case"NullLiteral":case"BooleanLiteral":case"NumericLiteral":case"StringLiteral":case"TemplateElement":return;default:throw Y(p,`'${p.type}'`)}}var Xe=ts(),$i={json:me({parse:Xe,hasPragma(){return!0}}),json5:me(Xe),jsonc:me(Xe),"json-stringify":me({parse:ts({allowComments:!1}),astFormat:"estree-json"})},Ki=$i,Ji={...Vi,...Ki},Wi=Kt;export{Wi as default,Ji as parsers}; diff --git a/playground/assets/estree-CXuZGlbU.js b/playground/assets/estree-CXuZGlbU.js new file mode 100644 index 0000000..58bc6da --- /dev/null +++ b/playground/assets/estree-CXuZGlbU.js @@ -0,0 +1,36 @@ +var Ha=Object.defineProperty;var za=(e,t,n)=>t in e?Ha(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Jt=(e,t,n)=>za(e,typeof t!="symbol"?t+"":t,n);var Qa=Object.defineProperty,Lr=e=>{throw TypeError(e)},Zt=(e,t)=>{for(var n in t)Qa(e,n,{get:t[n],enumerable:!0})},Mr=(e,t,n)=>t.has(e)||Lr("Cannot "+n),Ne=(e,t,n)=>(Mr(e,t,"read from private field"),t.get(e)),Ya=(e,t,n)=>t.has(e)?Lr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Za=(e,t,n,r)=>(Mr(e,t,"write to private field"),t.set(e,n),n),Or={};Zt(Or,{languages:()=>lD,options:()=>iD,printers:()=>pD});var es=[{linguistLanguageId:183,name:"JavaScript",type:"programming",tmScope:"source.js",aceMode:"javascript",codemirrorMode:"javascript",codemirrorMimeType:"text/javascript",color:"#f1e05a",aliases:["js","node"],extensions:[".js","._js",".bones",".cjs",".es",".es6",".frag",".gs",".jake",".javascript",".jsb",".jscad",".jsfl",".jslib",".jsm",".jspre",".jss",".mjs",".njs",".pac",".sjs",".ssjs",".xsjs",".xsjslib",".wxs"],filenames:["Jakefile"],interpreters:["chakra","d8","gjs","js","node","nodejs","qjs","rhino","v8","v8-shell","zx"],parsers:["babel","acorn","espree","meriyah","babel-flow","babel-ts","flow","typescript"],vscodeLanguageIds:["javascript","mongo"]},{linguistLanguageId:183,name:"Flow",type:"programming",tmScope:"source.js",aceMode:"javascript",codemirrorMode:"javascript",codemirrorMimeType:"text/javascript",color:"#f1e05a",aliases:[],extensions:[".js.flow"],filenames:[],interpreters:["chakra","d8","gjs","js","node","nodejs","qjs","rhino","v8","v8-shell"],parsers:["flow","babel-flow"],vscodeLanguageIds:["javascript"]},{linguistLanguageId:183,name:"JSX",type:"programming",tmScope:"source.js.jsx",aceMode:"javascript",codemirrorMode:"jsx",codemirrorMimeType:"text/jsx",color:void 0,aliases:void 0,extensions:[".jsx"],filenames:void 0,interpreters:void 0,parsers:["babel","babel-flow","babel-ts","flow","typescript","espree","meriyah"],vscodeLanguageIds:["javascriptreact"],group:"JavaScript"},{linguistLanguageId:378,name:"TypeScript",type:"programming",color:"#3178c6",aliases:["ts"],interpreters:["deno","ts-node"],extensions:[".ts",".cts",".mts"],tmScope:"source.ts",aceMode:"typescript",codemirrorMode:"javascript",codemirrorMimeType:"application/typescript",parsers:["typescript","babel-ts"],vscodeLanguageIds:["typescript"]},{linguistLanguageId:94901924,name:"TSX",type:"programming",color:"#3178c6",group:"TypeScript",extensions:[".tsx"],tmScope:"source.tsx",aceMode:"javascript",codemirrorMode:"jsx",codemirrorMimeType:"text/jsx",parsers:["typescript","babel-ts"],vscodeLanguageIds:["typescriptreact"]}],Jr={};Zt(Jr,{canAttachComment:()=>ii,embed:()=>Hi,experimentalFeatures:()=>Zc,getCommentChildNodes:()=>pi,getVisitorKeys:()=>_r,handleComments:()=>lu,insertPragma:()=>ip,isBlockComment:()=>De,isGap:()=>li,massageAstNode:()=>ao,print:()=>Yc,printComment:()=>So,willPrintOwnComments:()=>gu});var ts=(e,t,n,r)=>{if(!(e&&t==null))return t.replaceAll?t.replaceAll(n,r):n.global?t.replace(n,r):t.split(n).join(r)},H=ts,ns=(e,t,n)=>{if(!(e&&t==null))return Array.isArray(t)||typeof t=="string"?t[n<0?t.length+n:n]:t.at(n)},M=ns;function rs(e){return e!==null&&typeof e=="object"}var us=rs;function*as(e,t){let{getVisitorKeys:n,filter:r=()=>!0}=t,u=a=>us(a)&&r(a);for(let a of n(e)){let s=e[a];if(Array.isArray(s))for(let o of s)u(o)&&(yield o);else u(s)&&(yield s)}}function*ss(e,t){let n=[e];for(let r=0;r/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function ps(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function ls(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}var cs=e=>!(ps(e)||ls(e)),Ds=/[^\x20-\x7F]/u;function ys(e){if(!e)return 0;if(!Ds.test(e))return e.length;e=e.replace(is()," ");let t=0;for(let n of e){let r=n.codePointAt(0);r<=31||r>=127&&r<=159||r>=768&&r<=879||(t+=cs(r)?1:2)}return t}var ot=ys;function Mn(e){return(t,n,r)=>{let u=!!(r!=null&&r.backwards);if(n===!1)return!1;let{length:a}=t,s=n;for(;s>=0&&s0}var O=xs,qr=new Proxy(()=>{},{get:()=>qr}),Xn=qr,qt="'",pr='"';function Cs(e,t){let n=t===!0||t===qt?qt:pr,r=n===qt?pr:qt,u=0,a=0;for(let s of e)s===n?u++:s===r&&a++;return u>a?r:n}var Xr=Cs;function Ts(e,t,n){let r=t==='"'?"'":'"',u=H(!1,e,/\\(.)|(["'])/gsu,(a,s,o)=>s===r?s:o===t?"\\"+o:o||(n&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(s)?s:"\\"+s));return t+u+t}var hs=Ts;function Ss(e,t){Xn(/^(?["']).*\k$/su.test(e));let n=e.slice(1,-1),r=t.parser==="json"||t.parser==="jsonc"||t.parser==="json5"&&t.quoteProps==="preserve"&&!t.singleQuote?'"':t.__isInHtmlAttribute?"'":Xr(n,t.singleQuote);return e.charAt(0)===r?e:hs(n,r,!1)}var lt=Ss;function U(e){var t,n,r;let u=((t=e.range)==null?void 0:t[0])??e.start,a=(r=((n=e.declaration)==null?void 0:n.decorators)??e.decorators)==null?void 0:r[0];return a?Math.min(U(a),u):u}function j(e){var t;return((t=e.range)==null?void 0:t[1])??e.end}function en(e,t){let n=U(e);return Number.isInteger(n)&&n===U(t)}function bs(e,t){let n=j(e);return Number.isInteger(n)&&n===j(t)}function Bs(e,t){return en(e,t)&&bs(e,t)}var ht=null;function bt(e){if(ht!==null&&typeof ht.property){let t=ht;return ht=bt.prototype=null,t}return ht=bt.prototype=e??Object.create(null),new bt}var vs=10;for(let e=0;e<=vs;e++)bt();function ks(e){return bt(e)}function Ps(e,t="type"){ks(e);function n(r){let u=r[t],a=e[u];if(!Array.isArray(a))throw Object.assign(new Error(`Missing visitor keys for '${u}'.`),{node:r});return a}return n}var Rr=Ps,ws={ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","arguments","typeParameters","typeArguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","typeParameters","params","returnType","body","predicate"],FunctionExpression:["id","typeParameters","params","returnType","body"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","arguments","typeParameters","typeArguments"],Program:["directives","body"],ObjectExpression:["properties"],ObjectMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectProperty:["key","value","decorators"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["typeParameters","params","returnType","body","predicate"],ClassBody:["body"],ClassExpression:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ClassDeclaration:["decorators","id","typeParameters","superClass","superTypeParameters","mixins","implements","body","superTypeArguments"],ExportAllDeclaration:["source","attributes","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","attributes"],ExportSpecifier:["local","exported"],ForOfStatement:["left","right","body"],ImportDeclaration:["specifiers","source","attributes"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],ImportExpression:["source","options"],MetaProperty:["meta","property"],ClassMethod:["decorators","key","typeParameters","params","returnType","body"],ObjectPattern:["properties","typeAnnotation","decorators"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","typeParameters","quasi","typeArguments"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","arguments","typeParameters","typeArguments"],ClassProperty:["decorators","key","typeAnnotation","value","variance"],ClassAccessorProperty:["decorators","key","typeAnnotation","value"],ClassPrivateProperty:["decorators","key","typeAnnotation","value","variance"],ClassPrivateMethod:["decorators","key","typeParameters","params","returnType","body"],PrivateName:["id"],StaticBlock:["body"],AnyTypeAnnotation:[],ArrayTypeAnnotation:["elementType"],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:["id","typeParameters"],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareFunction:["id","predicate"],DeclareInterface:["id","typeParameters","extends","body"],DeclareModule:["id","body"],DeclareModuleExports:["typeAnnotation"],DeclareTypeAlias:["id","typeParameters","right"],DeclareOpaqueType:["id","typeParameters","supertype"],DeclareVariable:["id"],DeclareExportDeclaration:["declaration","specifiers","source","attributes"],DeclareExportAllDeclaration:["source","attributes"],DeclaredPredicate:["value"],ExistsTypeAnnotation:[],FunctionTypeAnnotation:["typeParameters","params","rest","returnType","this"],FunctionTypeParam:["name","typeAnnotation"],GenericTypeAnnotation:["id","typeParameters"],InferredPredicate:[],InterfaceExtends:["id","typeParameters"],InterfaceDeclaration:["id","typeParameters","extends","body"],InterfaceTypeAnnotation:["extends","body"],IntersectionTypeAnnotation:["types"],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:["typeAnnotation"],NumberLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeInternalSlot:["id","value"],ObjectTypeCallProperty:["value"],ObjectTypeIndexer:["variance","id","key","value"],ObjectTypeProperty:["key","value","variance"],ObjectTypeSpreadProperty:["argument"],OpaqueType:["id","typeParameters","supertype","impltype"],QualifiedTypeIdentifier:["qualification","id"],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:["types","elementTypes"],TypeofTypeAnnotation:["argument","typeArguments"],TypeAlias:["id","typeParameters","right"],TypeAnnotation:["typeAnnotation"],TypeCastExpression:["expression","typeAnnotation"],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:["params"],TypeParameterInstantiation:["params"],UnionTypeAnnotation:["types"],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:["id","body"],EnumBooleanBody:["members"],EnumNumberBody:["members"],EnumStringBody:["members"],EnumSymbolBody:["members"],EnumBooleanMember:["id","init"],EnumNumberMember:["id","init"],EnumStringMember:["id","init"],EnumDefaultedMember:["id"],IndexedAccessType:["objectType","indexType"],OptionalIndexedAccessType:["objectType","indexType"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXSpreadChild:["expression"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","attributes","typeArguments","typeParameters"],JSXSpreadAttribute:["argument"],JSXText:[],JSXFragment:["openingFragment","children","closingFragment"],JSXOpeningFragment:[],JSXClosingFragment:[],Noop:[],Placeholder:[],V8IntrinsicIdentifier:[],ArgumentPlaceholder:[],BindExpression:["object","callee"],ImportAttribute:["key","value"],Decorator:["expression"],DoExpression:["body"],ExportDefaultSpecifier:["exported"],RecordExpression:["properties"],TupleExpression:["elements"],ModuleExpression:["body"],TopicReference:[],PipelineTopicExpression:["expression"],PipelineBareFunction:["callee"],PipelinePrimaryTopicReference:[],TSParameterProperty:["parameter","decorators"],TSDeclareFunction:["id","typeParameters","params","returnType","body"],TSDeclareMethod:["decorators","key","typeParameters","params","returnType"],TSQualifiedName:["left","right"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation","params","returnType"],TSIndexSignature:["parameters","typeAnnotation"],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructorType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSTypeReference:["typeName","typeParameters","typeArguments"],TSTypePredicate:["parameterName","typeAnnotation"],TSTypeQuery:["exprName","typeParameters","typeArguments"],TSTypeLiteral:["members"],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSNamedTupleMember:["label","elementType"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["typeParameter","nameType","typeAnnotation"],TSLiteralType:["literal"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSInstantiationExpression:["expression","typeParameters","typeArguments"],TSAsExpression:["expression","typeAnnotation"],TSSatisfiesExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSEnumDeclaration:["id","members"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body"],TSModuleBlock:["body"],TSImportType:["argument","qualifier","typeParameters","typeArguments"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSNonNullExpression:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterInstantiation:["params"],TSTypeParameterDeclaration:["params"],TSTypeParameter:["constraint","default","name"],ChainExpression:["expression"],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],Literal:[],MethodDefinition:["decorators","key","value"],PrivateIdentifier:[],Property:["key","value"],PropertyDefinition:["decorators","key","typeAnnotation","value","variance"],AccessorProperty:["decorators","key","typeAnnotation","value"],TSAbstractAccessorProperty:["decorators","key","typeAnnotation"],TSAbstractKeyword:[],TSAbstractMethodDefinition:["key","value"],TSAbstractPropertyDefinition:["decorators","key","typeAnnotation"],TSAsyncKeyword:[],TSClassImplements:["expression","typeArguments","typeParameters"],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSEnumBody:["members"],TSExportKeyword:[],TSInterfaceHeritage:["expression","typeArguments","typeParameters"],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],TSTemplateLiteralType:["quasis","types"],AsConstExpression:["expression"],AsExpression:["expression","typeAnnotation"],BigIntLiteralTypeAnnotation:[],BigIntTypeAnnotation:[],ComponentDeclaration:["id","params","body","typeParameters","rendersType"],ComponentParameter:["name","local"],ComponentTypeAnnotation:["params","rest","typeParameters","rendersType"],ComponentTypeParameter:["name","typeAnnotation"],ConditionalTypeAnnotation:["checkType","extendsType","trueType","falseType"],DeclareComponent:["id","params","rest","typeParameters","rendersType"],DeclareEnum:["id","body"],DeclareHook:["id"],DeclareNamespace:["id","body"],EnumBigIntBody:["members"],EnumBigIntMember:["id","init"],HookDeclaration:["id","params","body","typeParameters","returnType"],HookTypeAnnotation:["params","returnType","rest","typeParameters"],InferTypeAnnotation:["typeParameter"],KeyofTypeAnnotation:["argument"],ObjectTypeMappedTypeProperty:["keyTparam","propType","sourceType","variance"],QualifiedTypeofIdentifier:["qualification","id"],TupleTypeLabeledElement:["label","elementType","variance"],TupleTypeSpreadElement:["label","typeAnnotation"],TypeOperator:["typeAnnotation"],TypePredicate:["parameterName","typeAnnotation","asserts"],NGRoot:["node"],NGPipeExpression:["left","right","arguments"],NGChainedExpression:["expressions"],NGEmptyExpression:[],NGMicrosyntax:["body"],NGMicrosyntaxKey:[],NGMicrosyntaxExpression:["expression","alias"],NGMicrosyntaxKeyedExpression:["key","expression"],NGMicrosyntaxLet:["key","value"],NGMicrosyntaxAs:["key","alias"],JsExpressionRoot:["node"],JsonRoot:["node"],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:["typeAnnotation"],TSJSDocNonNullableType:["typeAnnotation"],NeverTypeAnnotation:[],UndefinedTypeAnnotation:[],UnknownTypeAnnotation:[],SatisfiesExpression:["expression","typeAnnotation"]},Ns=Rr(ws),_r=Ns;function Is(e){let t=new Set(e);return n=>t.has(n==null?void 0:n.type)}var X=Is,js=X(["Block","CommentBlock","MultiLine"]),De=js,Ls=X(["AnyTypeAnnotation","ThisTypeAnnotation","NumberTypeAnnotation","VoidTypeAnnotation","BooleanTypeAnnotation","BigIntTypeAnnotation","SymbolTypeAnnotation","StringTypeAnnotation","NeverTypeAnnotation","UndefinedTypeAnnotation","UnknownTypeAnnotation","EmptyTypeAnnotation","MixedTypeAnnotation"]),$r=Ls;function Ms(e,t){let n=t.split(".");for(let r=n.length-1;r>=0;r--){let u=n[r];if(r===0)return e.type==="Identifier"&&e.name===u;if(e.type!=="MemberExpression"||e.optional||e.computed||e.property.type!=="Identifier"||e.property.name!==u)return!1;e=e.object}}function Os(e,t){return t.some(n=>Ms(e,n))}var Js=Os;function qs({type:e}){return e.startsWith("TS")&&e.endsWith("Keyword")}var Ur=qs;function xn(e,t){return t(e)||os(e,{getVisitorKeys:_r,predicate:t})}function Rn(e){return e.type==="AssignmentExpression"||e.type==="BinaryExpression"||e.type==="LogicalExpression"||e.type==="NGPipeExpression"||e.type==="ConditionalExpression"||L(e)||W(e)||e.type==="SequenceExpression"||e.type==="TaggedTemplateExpression"||e.type==="BindExpression"||e.type==="UpdateExpression"&&!e.prefix||xe(e)||e.type==="TSNonNullExpression"||e.type==="ChainExpression"}function Xs(e){return e.expressions?e.expressions[0]:e.left??e.test??e.callee??e.object??e.tag??e.argument??e.expression}function Wr(e){if(e.expressions)return["expressions",0];if(e.left)return["left"];if(e.test)return["test"];if(e.object)return["object"];if(e.callee)return["callee"];if(e.tag)return["tag"];if(e.argument)return["argument"];if(e.expression)return["expression"];throw new Error("Unexpected node has no left side.")}var yt=X(["Line","CommentLine","SingleLine","HashbangComment","HTMLOpen","HTMLClose","Hashbang","InterpreterDirective"]),Rs=X(["ExportDefaultDeclaration","DeclareExportDeclaration","ExportNamedDeclaration","ExportAllDeclaration","DeclareExportAllDeclaration"]),Q=X(["ArrayExpression","TupleExpression"]),Fe=X(["ObjectExpression","RecordExpression"]);function _s(e){return e.type==="LogicalExpression"&&e.operator==="??"}function be(e){return e.type==="NumericLiteral"||e.type==="Literal"&&typeof e.value=="number"}function Gr(e){return e.type==="UnaryExpression"&&(e.operator==="+"||e.operator==="-")&&be(e.argument)}function ue(e){return!!(e&&(e.type==="StringLiteral"||e.type==="Literal"&&typeof e.value=="string"))}function Vr(e){return e.type==="RegExpLiteral"||e.type==="Literal"&&!!e.regex}var _n=X(["Literal","BooleanLiteral","BigIntLiteral","DirectiveLiteral","NullLiteral","NumericLiteral","RegExpLiteral","StringLiteral"]),$s=X(["Identifier","ThisExpression","Super","PrivateName","PrivateIdentifier"]),je=X(["ObjectTypeAnnotation","TSTypeLiteral","TSMappedType"]),kt=X(["FunctionExpression","ArrowFunctionExpression"]);function Us(e){return e.type==="FunctionExpression"||e.type==="ArrowFunctionExpression"&&e.body.type==="BlockStatement"}function ln(e){return L(e)&&e.callee.type==="Identifier"&&["async","inject","fakeAsync","waitForAsync"].includes(e.callee.name)}var K=X(["JSXElement","JSXFragment"]);function tn(e){return e.method&&e.kind==="init"||e.kind==="get"||e.kind==="set"}function Kr(e){return(e.type==="ObjectTypeProperty"||e.type==="ObjectTypeInternalSlot")&&!e.static&&!e.method&&e.kind!=="get"&&e.kind!=="set"&&e.value.type==="FunctionTypeAnnotation"}function Ws(e){return(e.type==="TypeAnnotation"||e.type==="TSTypeAnnotation")&&e.typeAnnotation.type==="FunctionTypeAnnotation"&&!e.static&&!en(e,e.typeAnnotation)}var Be=X(["BinaryExpression","LogicalExpression","NGPipeExpression"]);function ut(e){return W(e)||e.type==="BindExpression"&&!!e.object}var Gs=X(["TSThisType","NullLiteralTypeAnnotation","BooleanLiteralTypeAnnotation","StringLiteralTypeAnnotation","BigIntLiteralTypeAnnotation","NumberLiteralTypeAnnotation","TSLiteralType","TSTemplateLiteralType"]);function $n(e){return Ur(e)||$r(e)||Gs(e)||(e.type==="GenericTypeAnnotation"||e.type==="TSTypeReference")&&!e.typeParameters&&!e.typeArguments}function Vs(e){return e.type==="Identifier"&&(e.name==="beforeEach"||e.name==="beforeAll"||e.name==="afterEach"||e.name==="afterAll")}var Ks=["it","it.only","it.skip","describe","describe.only","describe.skip","test","test.only","test.skip","test.step","test.describe","test.describe.only","test.describe.parallel","test.describe.parallel.only","test.describe.serial","test.describe.serial.only","skip","xit","xdescribe","xtest","fit","fdescribe","ftest"];function Hs(e){return Js(e,Ks)}function nn(e,t){if((e==null?void 0:e.type)!=="CallExpression"||e.optional)return!1;let n=ye(e);if(n.length===1){if(ln(e)&&nn(t))return kt(n[0]);if(Vs(e.callee))return ln(n[0])}else if((n.length===2||n.length===3)&&(n[0].type==="TemplateLiteral"||ue(n[0]))&&Hs(e.callee))return n[2]&&!be(n[2])?!1:(n.length===2?kt(n[1]):Us(n[1])&&Z(n[1]).length<=1)||ln(n[1]);return!1}var Hr=e=>t=>((t==null?void 0:t.type)==="ChainExpression"&&(t=t.expression),e(t)),L=Hr(X(["CallExpression","OptionalCallExpression"])),W=Hr(X(["MemberExpression","OptionalMemberExpression"]));function lr(e,t=5){return zr(e,t)<=t}function zr(e,t){let n=0;for(let r in e){let u=e[r];if(u&&typeof u=="object"&&typeof u.type=="string"&&(n++,n+=zr(u,t-n)),n>t)return n}return n}var zs=.25;function Un(e,t){let{printWidth:n}=t;if(C(e))return!1;let r=n*zs;if(e.type==="ThisExpression"||e.type==="Identifier"&&e.name.length<=r||Gr(e)&&!C(e.argument))return!0;let u=e.type==="Literal"&&"regex"in e&&e.regex.pattern||e.type==="RegExpLiteral"&&e.pattern;return u?u.length<=r:ue(e)?lt(pe(e),t).length<=r:e.type==="TemplateLiteral"?e.expressions.length===0&&e.quasis[0].value.raw.length<=r&&!e.quasis[0].value.raw.includes(` +`):e.type==="UnaryExpression"?Un(e.argument,{printWidth:n}):e.type==="CallExpression"&&e.arguments.length===0&&e.callee.type==="Identifier"?e.callee.name.length<=r-2:_n(e)}function Ue(e,t){return K(t)?rn(t):C(t,h.Leading,n=>oe(e,j(n)))}function cr(e){return e.quasis.some(t=>t.value.raw.includes(` +`))}function Qr(e,t){return(e.type==="TemplateLiteral"&&cr(e)||e.type==="TaggedTemplateExpression"&&cr(e.quasi))&&!oe(t,U(e),{backwards:!0})}function Yr(e){if(!C(e))return!1;let t=M(!1,st(e,h.Dangling),-1);return t&&!De(t)}function Qs(e){if(e.length<=1)return!1;let t=0;for(let n of e)if(kt(n)){if(t+=1,t>1)return!0}else if(L(n)){for(let r of ye(n))if(kt(r))return!0}return!1}function Zr(e){let{node:t,parent:n,key:r}=e;return r==="callee"&&L(t)&&L(n)&&n.arguments.length>0&&t.arguments.length>n.arguments.length}var Ys=new Set(["!","-","+","~"]);function fe(e,t=2){if(t<=0)return!1;if(e.type==="ChainExpression"||e.type==="TSNonNullExpression")return fe(e.expression,t);let n=r=>fe(r,t-1);if(Vr(e))return ot(e.pattern??e.regex.pattern)<=5;if(_n(e)||$s(e)||e.type==="ArgumentPlaceholder")return!0;if(e.type==="TemplateLiteral")return e.quasis.every(r=>!r.value.raw.includes(` +`))&&e.expressions.every(n);if(Fe(e))return e.properties.every(r=>!r.computed&&(r.shorthand||r.value&&n(r.value)));if(Q(e))return e.elements.every(r=>r===null||n(r));if(ct(e)){if(e.type==="ImportExpression"||fe(e.callee,t)){let r=ye(e);return r.length<=t&&r.every(n)}return!1}return W(e)?fe(e.object,t)&&fe(e.property,t):e.type==="UnaryExpression"&&Ys.has(e.operator)||e.type==="UpdateExpression"?fe(e.argument,t):!1}function pe(e){var t;return((t=e.extra)==null?void 0:t.raw)??e.raw}function Zs(e){return e}function ke(e,t="es5"){return e.trailingComma==="es5"&&t==="es5"||e.trailingComma==="all"&&(t==="all"||t==="es5")}function ee(e,t){switch(e.type){case"BinaryExpression":case"LogicalExpression":case"AssignmentExpression":case"NGPipeExpression":return ee(e.left,t);case"MemberExpression":case"OptionalMemberExpression":return ee(e.object,t);case"TaggedTemplateExpression":return e.tag.type==="FunctionExpression"?!1:ee(e.tag,t);case"CallExpression":case"OptionalCallExpression":return e.callee.type==="FunctionExpression"?!1:ee(e.callee,t);case"ConditionalExpression":return ee(e.test,t);case"UpdateExpression":return!e.prefix&&ee(e.argument,t);case"BindExpression":return e.object&&ee(e.object,t);case"SequenceExpression":return ee(e.expressions[0],t);case"ChainExpression":case"TSSatisfiesExpression":case"TSAsExpression":case"TSNonNullExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":return ee(e.expression,t);default:return t(e)}}var Dr={"==":!0,"!=":!0,"===":!0,"!==":!0},Xt={"*":!0,"/":!0,"%":!0},Cn={">>":!0,">>>":!0,"<<":!0};function Wn(e,t){return!(Kt(t)!==Kt(e)||e==="**"||Dr[e]&&Dr[t]||t==="%"&&Xt[e]||e==="%"&&Xt[t]||t!==e&&Xt[t]&&Xt[e]||Cn[e]&&Cn[t])}var eo=new Map([["|>"],["??"],["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"],["**"]].flatMap((e,t)=>e.map(n=>[n,t])));function Kt(e){return eo.get(e)}function to(e){return!!Cn[e]||e==="|"||e==="^"||e==="&"}function no(e){var t;if(e.rest)return!0;let n=Z(e);return((t=M(!1,n,-1))==null?void 0:t.type)==="RestElement"}var cn=new WeakMap;function Z(e){if(cn.has(e))return cn.get(e);let t=[];return e.this&&t.push(e.this),Array.isArray(e.parameters)?t.push(...e.parameters):Array.isArray(e.params)&&t.push(...e.params),e.rest&&t.push(e.rest),cn.set(e,t),t}function ro(e,t){let{node:n}=e,r=0,u=a=>t(a,r++);n.this&&e.call(u,"this"),Array.isArray(n.parameters)?e.each(u,"parameters"):Array.isArray(n.params)&&e.each(u,"params"),n.rest&&e.call(u,"rest")}var Dn=new WeakMap;function ye(e){if(Dn.has(e))return Dn.get(e);if(e.type==="ChainExpression")return ye(e.expression);let t=e.arguments;return e.type==="ImportExpression"&&(t=[e.source],e.options&&t.push(e.options)),Dn.set(e,t),t}function Ht(e,t){let{node:n}=e;if(n.type==="ChainExpression")return e.call(()=>Ht(e,t),"expression");n.type==="ImportExpression"?(e.call(r=>t(r,0),"source"),n.options&&e.call(r=>t(r,1),"options")):e.each(t,"arguments")}function yr(e,t){let n=[];if(e.type==="ChainExpression"&&(e=e.expression,n.push("expression")),e.type==="ImportExpression"){if(t===0||t===(e.options?-2:-1))return[...n,"source"];if(e.options&&(t===1||t===-1))return[...n,"options"];throw new RangeError("Invalid argument index")}if(t<0&&(t=e.arguments.length+t),t<0||t>=e.arguments.length)throw new RangeError("Invalid argument index");return[...n,"arguments",t]}function zt(e){return e.value.trim()==="prettier-ignore"&&!e.unignore}function rn(e){return(e==null?void 0:e.prettierIgnore)||C(e,h.PrettierIgnore)}var h={Leading:2,Trailing:4,Dangling:8,Block:16,Line:32,PrettierIgnore:64,First:128,Last:256},eu=(e,t)=>{if(typeof e=="function"&&(t=e,e=0),e||t)return(n,r,u)=>!(e&h.Leading&&!n.leading||e&h.Trailing&&!n.trailing||e&h.Dangling&&(n.leading||n.trailing)||e&h.Block&&!De(n)||e&h.Line&&!yt(n)||e&h.First&&r!==0||e&h.Last&&r!==u.length-1||e&h.PrettierIgnore&&!zt(n)||t&&!t(n))};function C(e,t,n){if(!O(e==null?void 0:e.comments))return!1;let r=eu(t,n);return r?e.comments.some(r):!0}function st(e,t,n){if(!Array.isArray(e==null?void 0:e.comments))return[];let r=eu(t,n);return r?e.comments.filter(r):e.comments}var Pe=(e,{originalText:t})=>qn(t,j(e));function ct(e){return L(e)||e.type==="NewExpression"||e.type==="ImportExpression"}function we(e){return e&&(e.type==="ObjectProperty"||e.type==="Property"&&!tn(e))}var xe=X(["TSAsExpression","TSSatisfiesExpression","AsExpression","AsConstExpression","SatisfiesExpression"]),We=X(["UnionTypeAnnotation","TSUnionType"]),tu=X(["IntersectionTypeAnnotation","TSIntersectionType"]),uo=new Set(["range","raw","comments","leadingComments","trailingComments","innerComments","extra","start","end","loc","flags","errors","tokens"]),rt=e=>{for(let t of e.quasis)delete t.value};function nu(e,t,n){var r,u;if(e.type==="Program"&&delete t.sourceType,(e.type==="BigIntLiteral"||e.type==="BigIntLiteralTypeAnnotation")&&e.value&&(t.value=e.value.toLowerCase()),(e.type==="BigIntLiteral"||e.type==="Literal")&&e.bigint&&(t.bigint=e.bigint.toLowerCase()),e.type==="EmptyStatement"||e.type==="JSXText"||e.type==="JSXExpressionContainer"&&(e.expression.type==="Literal"||e.expression.type==="StringLiteral")&&e.expression.value===" ")return null;if((e.type==="Property"||e.type==="ObjectProperty"||e.type==="MethodDefinition"||e.type==="ClassProperty"||e.type==="ClassMethod"||e.type==="PropertyDefinition"||e.type==="TSDeclareMethod"||e.type==="TSPropertySignature"||e.type==="ObjectTypeProperty"||e.type==="ImportAttribute")&&e.key&&!e.computed){let{key:s}=e;ue(s)||be(s)?t.key=String(s.value):s.type==="Identifier"&&(t.key=s.name)}if(e.type==="JSXElement"&&e.openingElement.name.name==="style"&&e.openingElement.attributes.some(s=>s.type==="JSXAttribute"&&s.name.name==="jsx"))for(let{type:s,expression:o}of t.children)s==="JSXExpressionContainer"&&o.type==="TemplateLiteral"&&rt(o);e.type==="JSXAttribute"&&e.name.name==="css"&&e.value.type==="JSXExpressionContainer"&&e.value.expression.type==="TemplateLiteral"&&rt(t.value.expression),e.type==="JSXAttribute"&&((r=e.value)==null?void 0:r.type)==="Literal"&&/["']|"|'/u.test(e.value.value)&&(t.value.value=H(!1,e.value.value,/["']|"|'/gu,'"'));let a=e.expression||e.callee;if(e.type==="Decorator"&&a.type==="CallExpression"&&a.callee.name==="Component"&&a.arguments.length===1){let s=e.expression.arguments[0].properties;for(let[o,i]of t.expression.arguments[0].properties.entries())switch(s[o].key.name){case"styles":Q(i.value)&&rt(i.value.elements[0]);break;case"template":i.value.type==="TemplateLiteral"&&rt(i.value);break}}e.type==="TaggedTemplateExpression"&&(e.tag.type==="MemberExpression"||e.tag.type==="Identifier"&&(e.tag.name==="gql"||e.tag.name==="graphql"||e.tag.name==="css"||e.tag.name==="md"||e.tag.name==="markdown"||e.tag.name==="html")||e.tag.type==="CallExpression")&&rt(t.quasi),e.type==="TemplateLiteral"&&((u=e.leadingComments)!=null&&u.some(s=>De(s)&&["GraphQL","HTML"].some(o=>s.value===` ${o} `))||n.type==="CallExpression"&&n.callee.name==="graphql"||!e.leadingComments)&&rt(t),e.type==="ChainExpression"&&e.expression.type==="TSNonNullExpression"&&(t.type="TSNonNullExpression",t.expression.type="ChainExpression"),e.type==="TSMappedType"&&(delete t.key,delete t.constraint),e.type==="TSEnumDeclaration"&&delete t.body}nu.ignoredProperties=uo;var ao=nu,dt="string",Le="array",mt="cursor",Ke="indent",He="align",ft="trim",le="group",Oe="fill",Ce="if-break",ze="indent-if-break",Qe="line-suffix",Ye="line-suffix-boundary",ie="line",Je="label",qe="break-parent",ru=new Set([mt,Ke,He,ft,le,Oe,Ce,ze,Qe,Ye,ie,Je,qe]);function so(e){if(typeof e=="string")return dt;if(Array.isArray(e))return Le;if(!e)return;let{type:t}=e;if(ru.has(t))return t}var Et=so,oo=e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e);function io(e){let t=e===null?"null":typeof e;if(t!=="string"&&t!=="object")return`Unexpected doc '${t}', +Expected it to be 'string' or 'object'.`;if(Et(e))throw new Error("doc is valid.");let n=Object.prototype.toString.call(e);if(n!=="[object Object]")return`Unexpected doc '${n}'.`;let r=oo([...ru].map(u=>`'${u}'`));return`Unexpected doc.type '${e.type}'. +Expected it to be ${r}.`}var po=class extends Error{constructor(t){super(io(t));Jt(this,"name","InvalidDocError");this.doc=t}},Pt=po,dr={};function lo(e,t,n,r){let u=[e];for(;u.length>0;){let a=u.pop();if(a===dr){n(u.pop());continue}n&&u.push(a,dr);let s=Et(a);if(!s)throw new Pt(a);if((t==null?void 0:t(a))!==!1)switch(s){case Le:case Oe:{let o=s===Le?a:a.parts;for(let i=o.length,l=i-1;l>=0;--l)u.push(o[l]);break}case Ce:u.push(a.flatContents,a.breakContents);break;case le:if(r&&a.expandedStates)for(let o=a.expandedStates.length,i=o-1;i>=0;--i)u.push(a.expandedStates[i]);else u.push(a.contents);break;case He:case Ke:case ze:case Je:case Qe:u.push(a.contents);break;case dt:case mt:case ft:case Ye:case ie:case qe:break;default:throw new Pt(a)}}}var uu=lo,co=()=>{},Do=co;function A(e){return{type:Ke,contents:e}}function Te(e,t){return{type:He,contents:t,n:e}}function m(e,t={}){return Do(t.expandedStates),{type:le,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function yo(e){return Te(Number.NEGATIVE_INFINITY,e)}function au(e){return Te(-1,e)}function $e(e,t){return m(e[0],{...t,expandedStates:e})}function su(e){return{type:Oe,parts:e}}function w(e,t="",n={}){return{type:Ce,breakContents:e,flatContents:t,groupId:n.groupId}}function un(e,t){return{type:ze,contents:e,groupId:t.groupId,negate:t.negate}}function mr(e){return{type:Qe,contents:e}}var ve={type:Ye},he={type:qe},ou={type:ie,hard:!0},mo={type:ie,hard:!0,literal:!0},T={type:ie},f={type:ie,soft:!0},E=[ou,he],iu=[mo,he],Rt={type:mt};function I(e,t){let n=[];for(let r=0;r0){for(let u=0;u0){let t=M(!1,e,-1);!t.expandedStates&&!t.break&&(t.break="propagated")}return null}function Fo(e){let t=new Set,n=[];function r(a){if(a.type===qe&&fr(n),a.type===le){if(n.push(a),t.has(a))return!1;t.add(a)}}function u(a){a.type===le&&n.pop().break&&fr(n)}uu(e,r,u,!0)}function Ao(e){return e.type===ie&&!e.hard?e.soft?"":" ":e.type===Ce?e.flatContents:e}function Tn(e){return Ft(e,Ao)}function go(e){switch(Et(e)){case Oe:if(e.parts.every(t=>t===""))return"";break;case le:if(!e.contents&&!e.id&&!e.break&&!e.expandedStates)return"";if(e.contents.type===le&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case He:case Ke:case ze:case Qe:if(!e.contents)return"";break;case Ce:if(!e.flatContents&&!e.breakContents)return"";break;case Le:{let t=[];for(let n of e){if(!n)continue;let[r,...u]=Array.isArray(n)?n:[n];typeof r=="string"&&typeof M(!1,t,-1)=="string"?t[t.length-1]+=r:t.push(r),t.push(...u)}return t.length===0?"":t.length===1?t[0]:t}case dt:case mt:case ft:case Ye:case ie:case Je:case qe:break;default:throw new Pt(e)}return e}function Gn(e){return Ft(e,t=>go(t))}function Ge(e,t=iu){return Ft(e,n=>typeof n=="string"?I(t,n.split(` +`)):n)}function xo(e){if(e.type===ie)return!0}function Co(e){return pu(e,xo,!1)}function hn(e,t){return e.type===Je?{...e,contents:t(e.contents)}:t(e)}function To(e){let t=`*${e.value}*`.split(` +`);return t.length>1&&t.every(n=>n.trimStart()[0]==="*")}var ho=To;function So(e,t){let n=e.node;if(yt(n))return t.originalText.slice(U(n),j(n)).trimEnd();if(De(n))return ho(n)?bo(n):["/*",Ge(n.value),"*/"];throw new Error("Not a comment: "+JSON.stringify(n))}function bo(e){let t=e.value.split(` +`);return["/*",I(E,t.map((n,r)=>r===0?n.trimEnd():" "+(rjo,ownLine:()=>Io,remaining:()=>Lo});function Bo(e){let t=e.type||e.kind||"(unknown type)",n=String(e.name||e.id&&(typeof e.id=="object"?e.id.name:e.id)||e.key&&(typeof e.key=="object"?e.key.name:e.key)||e.value&&(typeof e.value=="object"?"":String(e.value))||e.operator||"");return n.length>20&&(n=n.slice(0,19)+"…"),t+(n?" "+n:"")}function Vn(e,t){(e.comments??(e.comments=[])).push(t),t.printed=!1,t.nodeDescription=Bo(e)}function Y(e,t){t.leading=!0,t.trailing=!1,Vn(e,t)}function ce(e,t,n){t.leading=!1,t.trailing=!1,n&&(t.marker=n),Vn(e,t)}function $(e,t){t.leading=!1,t.trailing=!0,Vn(e,t)}function vo(e,t){let n=null,r=t;for(;r!==n;)n=r,r=it(e,r),r=On(e,r),r=Jn(e,r),r=pt(e,r);return r}var At=vo;function ko(e,t){let n=At(e,t);return n===!1?"":e.charAt(n)}var Ae=ko;function Po(e,t,n){for(let r=t;rt(e))}function jo(e){return[Mo,mu,Du,Eu,Kn,Hn,cu,yu,fu,Vo,Ho,Qn,ei,zn,ri,ui,si].some(t=>t(e))}function Lo(e){return[Fu,Kn,Hn,qo,Wo,du,Qn,Uo,$o,ni,zn,ti].some(t=>t(e))}function Ze(e,t){let n=(e.body||e.properties).find(({type:r})=>r!=="EmptyStatement");n?Y(n,t):ce(e,t)}function Sn(e,t){e.type==="BlockStatement"?Ze(e,t):Y(e,t)}function Mo({comment:e,followingNode:t}){return t&&No(e)?(Y(t,e),!0):!1}function Kn({comment:e,precedingNode:t,enclosingNode:n,followingNode:r,text:u}){if((n==null?void 0:n.type)!=="IfStatement"||!r)return!1;if(Ae(u,j(e))===")")return $(t,e),!0;if(t===n.consequent&&r===n.alternate){let a=At(u,j(n.consequent));if(U(e)"?(ce(t,e),!0):!1}function Wo({comment:e,enclosingNode:t,text:n}){return Ae(n,j(e))!==")"?!1:t&&(Au(t)&&Z(t).length===0||ct(t)&&ye(t).length===0)?(ce(t,e),!0):((t==null?void 0:t.type)==="MethodDefinition"||(t==null?void 0:t.type)==="TSAbstractMethodDefinition")&&Z(t.value).length===0?(ce(t.value,e),!0):!1}function Go({comment:e,precedingNode:t,enclosingNode:n,followingNode:r,text:u}){return(t==null?void 0:t.type)==="ComponentTypeParameter"&&((n==null?void 0:n.type)==="DeclareComponent"||(n==null?void 0:n.type)==="ComponentTypeAnnotation")&&(r==null?void 0:r.type)!=="ComponentTypeParameter"||((t==null?void 0:t.type)==="ComponentParameter"||(t==null?void 0:t.type)==="RestElement")&&(n==null?void 0:n.type)==="ComponentDeclaration"&&Ae(u,j(e))===")"?($(t,e),!0):!1}function mu({comment:e,precedingNode:t,enclosingNode:n,followingNode:r,text:u}){return(t==null?void 0:t.type)==="FunctionTypeParam"&&(n==null?void 0:n.type)==="FunctionTypeAnnotation"&&(r==null?void 0:r.type)!=="FunctionTypeParam"||((t==null?void 0:t.type)==="Identifier"||(t==null?void 0:t.type)==="AssignmentPattern"||(t==null?void 0:t.type)==="ObjectPattern"||(t==null?void 0:t.type)==="ArrayPattern"||(t==null?void 0:t.type)==="RestElement"||(t==null?void 0:t.type)==="TSParameterProperty")&&Au(n)&&Ae(u,j(e))===")"?($(t,e),!0):!De(e)&&((n==null?void 0:n.type)==="FunctionDeclaration"||(n==null?void 0:n.type)==="FunctionExpression"||(n==null?void 0:n.type)==="ObjectMethod")&&(r==null?void 0:r.type)==="BlockStatement"&&n.body===r&&At(u,j(e))===U(r)?(Ze(r,e),!0):!1}function fu({comment:e,enclosingNode:t}){return(t==null?void 0:t.type)==="LabeledStatement"?(Y(t,e),!0):!1}function zn({comment:e,enclosingNode:t}){return((t==null?void 0:t.type)==="ContinueStatement"||(t==null?void 0:t.type)==="BreakStatement")&&!t.label?($(t,e),!0):!1}function Vo({comment:e,precedingNode:t,enclosingNode:n}){return L(n)&&t&&n.callee===t&&n.arguments.length>0?(Y(n.arguments[0],e),!0):!1}function Ko({comment:e,precedingNode:t,enclosingNode:n,followingNode:r}){return We(n)?(zt(e)&&(r.prettierIgnore=!0,e.unignore=!0),t?($(t,e),!0):!1):(We(r)&&zt(e)&&(r.types[0].prettierIgnore=!0,e.unignore=!0),!1)}function Ho({comment:e,enclosingNode:t}){return we(t)?(Y(t,e),!0):!1}function Qn({comment:e,enclosingNode:t,ast:n,isLastComment:r}){var u;return((u=n==null?void 0:n.body)==null?void 0:u.length)===0?(r?ce(n,e):Y(n,e),!0):(t==null?void 0:t.type)==="Program"&&t.body.length===0&&!O(t.directives)?(r?ce(t,e):Y(t,e),!0):!1}function zo({comment:e,enclosingNode:t}){return(t==null?void 0:t.type)==="ForInStatement"||(t==null?void 0:t.type)==="ForOfStatement"?(Y(t,e),!0):!1}function Eu({comment:e,precedingNode:t,enclosingNode:n,text:r}){if((n==null?void 0:n.type)==="ImportSpecifier"||(n==null?void 0:n.type)==="ExportSpecifier")return Y(n,e),!0;let u=(t==null?void 0:t.type)==="ImportSpecifier"&&(n==null?void 0:n.type)==="ImportDeclaration",a=(t==null?void 0:t.type)==="ExportSpecifier"&&(n==null?void 0:n.type)==="ExportNamedDeclaration";return(u||a)&&oe(r,j(e))?($(t,e),!0):!1}function Qo({comment:e,enclosingNode:t}){return(t==null?void 0:t.type)==="AssignmentPattern"?(Y(t,e),!0):!1}var Yo=new Set(["VariableDeclarator","AssignmentExpression","TypeAlias","TSTypeAliasDeclaration"]),Zo=new Set(["ObjectExpression","RecordExpression","ArrayExpression","TupleExpression","TemplateLiteral","TaggedTemplateExpression","ObjectTypeAnnotation","TSTypeLiteral"]);function ei({comment:e,enclosingNode:t,followingNode:n}){return Yo.has(t==null?void 0:t.type)&&n&&(Zo.has(n.type)||De(e))?(Y(n,e),!0):!1}function ti({comment:e,enclosingNode:t,followingNode:n,text:r}){return!n&&((t==null?void 0:t.type)==="TSMethodSignature"||(t==null?void 0:t.type)==="TSDeclareFunction"||(t==null?void 0:t.type)==="TSAbstractMethodDefinition")&&Ae(r,j(e))===";"?($(t,e),!0):!1}function Fu({comment:e,enclosingNode:t,followingNode:n}){if(zt(e)&&(t==null?void 0:t.type)==="TSMappedType"&&(n==null?void 0:n.type)==="TSTypeParameter"&&n.constraint)return t.prettierIgnore=!0,e.unignore=!0,!0}function ni({comment:e,precedingNode:t,enclosingNode:n,followingNode:r}){return(n==null?void 0:n.type)!=="TSMappedType"?!1:(r==null?void 0:r.type)==="TSTypeParameter"&&r.name?(Y(r.name,e),!0):(t==null?void 0:t.type)==="TSTypeParameter"&&t.constraint?($(t.constraint,e),!0):!1}function ri({comment:e,enclosingNode:t,followingNode:n}){return!t||t.type!=="SwitchCase"||t.test||!n||n!==t.consequent[0]?!1:(n.type==="BlockStatement"&&yt(e)?Ze(n,e):ce(t,e),!0)}function ui({comment:e,precedingNode:t,enclosingNode:n,followingNode:r}){return We(t)&&((n.type==="TSArrayType"||n.type==="ArrayTypeAnnotation")&&!r||tu(n))?($(M(!1,t.types,-1),e),!0):!1}function ai({comment:e,enclosingNode:t,precedingNode:n,followingNode:r}){if(((t==null?void 0:t.type)==="ObjectPattern"||(t==null?void 0:t.type)==="ArrayPattern")&&(r==null?void 0:r.type)==="TSTypeAnnotation")return n?$(n,e):ce(t,e),!0}function si({comment:e,precedingNode:t,enclosingNode:n,followingNode:r}){var u;if(!r&&(n==null?void 0:n.type)==="UnaryExpression"&&((t==null?void 0:t.type)==="LogicalExpression"||(t==null?void 0:t.type)==="BinaryExpression")){let a=((u=n.argument.loc)==null?void 0:u.start.line)!==t.right.loc.start.line,s=yt(e)||e.loc.start.line===e.loc.end.line,o=e.loc.start.line===t.right.loc.start.line;if(a&&s&&o)return $(t.right,e),!0}return!1}var Au=X(["ArrowFunctionExpression","FunctionExpression","FunctionDeclaration","ObjectMethod","ClassMethod","TSDeclareFunction","TSCallSignatureDeclaration","TSConstructSignatureDeclaration","TSMethodSignature","TSConstructorType","TSFunctionType","TSDeclareMethod"]),oi=new Set(["EmptyStatement","TemplateElement","TSEmptyBodyFunctionExpression","ChainExpression"]);function ii(e){return!oi.has(e.type)}function pi(e,t){var n;if((t.parser==="typescript"||t.parser==="flow"||t.parser==="acorn"||t.parser==="espree"||t.parser==="meriyah"||t.parser==="__babel_estree")&&e.type==="MethodDefinition"&&((n=e.value)==null?void 0:n.type)==="FunctionExpression"&&Z(e.value).length===0&&!e.value.returnType&&!O(e.value.typeParameters)&&e.value.body)return[...e.decorators||[],e.key,e.value.body]}function gu(e){let{node:t,parent:n}=e;return(K(t)||n&&(n.type==="JSXSpreadAttribute"||n.type==="JSXSpreadChild"||We(n)||(n.type==="ClassDeclaration"||n.type==="ClassExpression")&&n.superClass===t))&&(!rn(t)||We(n))}function li(e,{parser:t}){if(t==="flow"||t==="babel-flow")return e=H(!1,e,/[\s(]/gu,""),e===""||e==="/*"||e==="/*::"}function ci(e){switch(e){case"cr":return"\r";case"crlf":return`\r +`;default:return` +`}}var re=Symbol("MODE_BREAK"),ge=Symbol("MODE_FLAT"),at=Symbol("cursor"),Er=Symbol("DOC_FILL_PRINTED_LENGTH");function xu(){return{value:"",length:0,queue:[]}}function Di(e,t){return bn(e,{type:"indent"},t)}function yi(e,t,n){return t===Number.NEGATIVE_INFINITY?e.root||xu():t<0?bn(e,{type:"dedent"},n):t?t.type==="root"?{...e,root:e}:bn(e,{type:typeof t=="string"?"stringAlign":"numberAlign",n:t},n):e}function bn(e,t,n){let r=t.type==="dedent"?e.queue.slice(0,-1):[...e.queue,t],u="",a=0,s=0,o=0;for(let y of r)switch(y.type){case"indent":d(),n.useTabs?i(1):l(n.tabWidth);break;case"stringAlign":d(),u+=y.n,a+=y.n.length;break;case"numberAlign":s+=1,o+=y.n;break;default:throw new Error(`Unexpected type '${y.type}'`)}return D(),{...e,value:u,length:a,queue:r};function i(y){u+=" ".repeat(y),a+=n.tabWidth*y}function l(y){u+=" ".repeat(y),a+=y}function d(){n.useTabs?c():D()}function c(){s>0&&i(s),p()}function D(){o>0&&l(o),p()}function p(){s=0,o=0}}function Bn(e){let t=0,n=0,r=e.length;e:for(;r--;){let u=e[r];if(u===at){n++;continue}for(let a=u.length-1;a>=0;a--){let s=u[a];if(s===" "||s===" ")t++;else{e[r]=u.slice(0,a+1);break e}}}if(t>0||n>0)for(e.length=r+1;n-- >0;)e.push(at);return t}function _t(e,t,n,r,u,a){if(n===Number.POSITIVE_INFINITY)return!0;let s=t.length,o=[e],i=[];for(;n>=0;){if(o.length===0){if(s===0)return!0;o.push(t[--s]);continue}let{mode:l,doc:d}=o.pop(),c=Et(d);switch(c){case dt:i.push(d),n-=ot(d);break;case Le:case Oe:{let D=c===Le?d:d.parts;for(let p=D.length-1;p>=0;p--)o.push({mode:l,doc:D[p]});break}case Ke:case He:case ze:case Je:o.push({mode:l,doc:d.contents});break;case ft:n+=Bn(i);break;case le:{if(a&&d.break)return!1;let D=d.break?re:l,p=d.expandedStates&&D===re?M(!1,d.expandedStates,-1):d.contents;o.push({mode:D,doc:p});break}case Ce:{let D=(d.groupId?u[d.groupId]||ge:l)===re?d.breakContents:d.flatContents;D&&o.push({mode:l,doc:D});break}case ie:if(l===re||d.hard)return!0;d.soft||(i.push(" "),n--);break;case Qe:r=!0;break;case Ye:if(r)return!1;break}}return!1}function Cu(e,t){let n={},r=t.printWidth,u=ci(t.endOfLine),a=0,s=[{ind:xu(),mode:re,doc:e}],o=[],i=!1,l=[],d=0;for(Fo(e);s.length>0;){let{ind:D,mode:p,doc:y}=s.pop();switch(Et(y)){case dt:{let F=u!==` +`?H(!1,y,` +`,u):y;o.push(F),s.length>0&&(a+=ot(F));break}case Le:for(let F=y.length-1;F>=0;F--)s.push({ind:D,mode:p,doc:y[F]});break;case mt:if(d>=2)throw new Error("There are too many 'cursor' in doc.");o.push(at),d++;break;case Ke:s.push({ind:Di(D,t),mode:p,doc:y.contents});break;case He:s.push({ind:yi(D,y.n,t),mode:p,doc:y.contents});break;case ft:a-=Bn(o);break;case le:switch(p){case ge:if(!i){s.push({ind:D,mode:y.break?re:ge,doc:y.contents});break}case re:{i=!1;let F={ind:D,mode:ge,doc:y.contents},g=r-a,S=l.length>0;if(!y.break&&_t(F,s,g,S,n))s.push(F);else if(y.expandedStates){let b=M(!1,y.expandedStates,-1);if(y.break){s.push({ind:D,mode:re,doc:b});break}else for(let x=1;x=y.expandedStates.length){s.push({ind:D,mode:re,doc:b});break}else{let N=y.expandedStates[x],v={ind:D,mode:ge,doc:N};if(_t(v,s,g,S,n)){s.push(v);break}}}else s.push({ind:D,mode:re,doc:y.contents});break}}y.id&&(n[y.id]=M(!1,s,-1).mode);break;case Oe:{let F=r-a,g=y[Er]??0,{parts:S}=y,b=S.length-g;if(b===0)break;let x=S[g+0],N=S[g+1],v={ind:D,mode:ge,doc:x},B={ind:D,mode:re,doc:x},q=_t(v,[],F,l.length>0,n,!0);if(b===1){q?s.push(v):s.push(B);break}let k={ind:D,mode:ge,doc:N},J={ind:D,mode:re,doc:N};if(b===2){q?s.push(k,v):s.push(J,B);break}let V=S[g+2],R={ind:D,mode:p,doc:{...y,[Er]:g+2}};_t({ind:D,mode:ge,doc:[x,N,V]},[],F,l.length>0,n,!0)?s.push(R,k,v):q?s.push(R,J,v):s.push(R,J,B);break}case Ce:case ze:{let F=y.groupId?n[y.groupId]:p;if(F===re){let g=y.type===Ce?y.breakContents:y.negate?y.contents:A(y.contents);g&&s.push({ind:D,mode:p,doc:g})}if(F===ge){let g=y.type===Ce?y.flatContents:y.negate?A(y.contents):y.contents;g&&s.push({ind:D,mode:p,doc:g})}break}case Qe:l.push({ind:D,mode:p,doc:y.contents});break;case Ye:l.length>0&&s.push({ind:D,mode:p,doc:ou});break;case ie:switch(p){case ge:if(y.hard)i=!0;else{y.soft||(o.push(" "),a+=1);break}case re:if(l.length>0){s.push({ind:D,mode:p,doc:y},...l.reverse()),l.length=0;break}y.literal?D.root?(o.push(u,D.root.value),a=D.root.length):(o.push(u),a=0):(a-=Bn(o),o.push(u+D.value),a=D.length);break}break;case Je:s.push({ind:D,mode:p,doc:y.contents});break;case qe:break;default:throw new Pt(y)}s.length===0&&l.length>0&&(s.push(...l.reverse()),l.length=0)}let c=o.indexOf(at);if(c!==-1){let D=o.indexOf(at,c+1);if(D===-1)return{formatted:o.filter(g=>g!==at).join("")};let p=o.slice(0,c).join(""),y=o.slice(c+1,D).join(""),F=o.slice(D+1).join("");return{formatted:p+y+F,cursorNodeStart:p.length,cursorNodeText:y}}return{formatted:o.join("")}}function di(e,t,n=0){let r=0;for(let u=n;u{if(a.push(t()),l.tail)return;let{tabWidth:d}=n,c=l.value.raw,D=c.includes(` +`)?Ei(c,d):o;o=D;let p=s[i],y=r[u][i],F=Me(n.originalText,j(l),U(r.quasis[i+1]));if(!F){let S=Cu(p,{...n,printWidth:Number.POSITIVE_INFINITY}).formatted;S.includes(` +`)?F=!0:p=S}F&&(C(y)||y.type==="Identifier"||W(y)||y.type==="ConditionalExpression"||y.type==="SequenceExpression"||xe(y)||Be(y))&&(p=[A([f,p]),f]);let g=D===0&&c.endsWith(` +`)?Te(Number.NEGATIVE_INFINITY,p):fo(p,D,d);a.push(m(["${",g,ve,"}"]))},"quasis"),a.push("`"),a}function Fi(e,t){let n=t("quasi");return It(n.label&&{tagged:!0,...n.label},[t("tag"),t(e.node.typeArguments?"typeArguments":"typeParameters"),ve,n])}function Ai(e,t,n){let{node:r}=e,u=r.quasis[0].value.raw.trim().split(/\s*\|\s*/u);if(u.length>1||u.some(a=>a.length>0)){t.__inJestEach=!0;let a=e.map(n,"expressions");t.__inJestEach=!1;let s=[],o=a.map(D=>"${"+Cu(D,{...t,printWidth:Number.POSITIVE_INFINITY,endOfLine:"lf"}).formatted+"}"),i=[{hasLineBreak:!1,cells:[]}];for(let D=1;DD.cells.length)),d=Array.from({length:l}).fill(0),c=[{cells:u},...i.filter(D=>D.cells.length>0)];for(let{cells:D}of c.filter(p=>!p.hasLineBreak))for(let[p,y]of D.entries())d[p]=Math.max(d[p],ot(y));return s.push(ve,"`",A([E,I(E,c.map(D=>I(" | ",D.cells.map((p,y)=>D.hasLineBreak?p:p+" ".repeat(d[y]-ot(p))))))]),E,"`"),s}}function gi(e,t){let{node:n}=e,r=t();return C(n)&&(r=m([A([f,r]),f])),["${",r,ve,"}"]}function Yn(e,t){return e.map(n=>gi(n,t),"expressions")}function hu(e,t){return Ft(e,n=>typeof n=="string"?t?H(!1,n,/(\\*)`/gu,"$1$1\\`"):Su(n):n)}function Su(e){return H(!1,e,/([\\`]|\$\{)/gu,String.raw`\$1`)}function xi({node:e,parent:t}){let n=/^[fx]?(?:describe|it|test)$/u;return t.type==="TaggedTemplateExpression"&&t.quasi===e&&t.tag.type==="MemberExpression"&&t.tag.property.type==="Identifier"&&t.tag.property.name==="each"&&(t.tag.object.type==="Identifier"&&n.test(t.tag.object.name)||t.tag.object.type==="MemberExpression"&&t.tag.object.property.type==="Identifier"&&(t.tag.object.property.name==="only"||t.tag.object.property.name==="skip")&&t.tag.object.object.type==="Identifier"&&n.test(t.tag.object.object.name))}var vn=[(e,t)=>e.type==="ObjectExpression"&&t==="properties",(e,t)=>e.type==="CallExpression"&&e.callee.type==="Identifier"&&e.callee.name==="Component"&&t==="arguments",(e,t)=>e.type==="Decorator"&&t==="expression"];function Ci(e){let t=r=>r.type==="TemplateLiteral",n=(r,u)=>we(r)&&!r.computed&&r.key.type==="Identifier"&&r.key.name==="styles"&&u==="value";return e.match(t,(r,u)=>Q(r)&&u==="elements",n,...vn)||e.match(t,n,...vn)}function Ti(e){return e.match(t=>t.type==="TemplateLiteral",(t,n)=>we(t)&&!t.computed&&t.key.type==="Identifier"&&t.key.name==="template"&&n==="value",...vn)}function yn(e,t){return C(e,h.Block|h.Leading,({value:n})=>n===` ${t} `)}function bu({node:e,parent:t},n){return yn(e,n)||hi(t)&&yn(t,n)||t.type==="ExpressionStatement"&&yn(t,n)}function hi(e){return e.type==="AsConstExpression"||e.type==="TSAsExpression"&&e.typeAnnotation.type==="TSTypeReference"&&e.typeAnnotation.typeName.type==="Identifier"&&e.typeAnnotation.typeName.name==="const"}async function Si(e,t,n){let{node:r}=n,u=r.quasis.map(d=>d.value.raw),a=0,s=u.reduce((d,c,D)=>D===0?c:d+"@prettier-placeholder-"+a+++"-id"+c,""),o=await e(s,{parser:"scss"}),i=Yn(n,t),l=bi(o,i);if(!l)throw new Error("Couldn't insert all the expressions");return["`",A([E,l]),f,"`"]}function bi(e,t){if(!O(t))return e;let n=0,r=Ft(Gn(e),u=>typeof u!="string"||!u.includes("@prettier-placeholder")?u:u.split(/@prettier-placeholder-(\d+)-id/u).map((a,s)=>s%2===0?Ge(a):(n++,t[a])));return t.length===n?r:null}function Bi({node:e,parent:t,grandparent:n}){return n&&e.quasis&&t.type==="JSXExpressionContainer"&&n.type==="JSXElement"&&n.openingElement.name.name==="style"&&n.openingElement.attributes.some(r=>r.type==="JSXAttribute"&&r.name.name==="jsx")||(t==null?void 0:t.type)==="TaggedTemplateExpression"&&t.tag.type==="Identifier"&&t.tag.name==="css"||(t==null?void 0:t.type)==="TaggedTemplateExpression"&&t.tag.type==="MemberExpression"&&t.tag.object.name==="css"&&(t.tag.property.name==="global"||t.tag.property.name==="resolve")}function $t(e){return e.type==="Identifier"&&e.name==="styled"}function Fr(e){return/^[A-Z]/u.test(e.object.name)&&e.property.name==="extend"}function vi({parent:e}){if(!e||e.type!=="TaggedTemplateExpression")return!1;let t=e.tag.type==="ParenthesizedExpression"?e.tag.expression:e.tag;switch(t.type){case"MemberExpression":return $t(t.object)||Fr(t);case"CallExpression":return $t(t.callee)||t.callee.type==="MemberExpression"&&(t.callee.object.type==="MemberExpression"&&($t(t.callee.object.object)||Fr(t.callee.object))||t.callee.object.type==="CallExpression"&&$t(t.callee.object.callee));case"Identifier":return t.name==="css";default:return!1}}function ki({parent:e,grandparent:t}){return(t==null?void 0:t.type)==="JSXAttribute"&&e.type==="JSXExpressionContainer"&&t.name.type==="JSXIdentifier"&&t.name.name==="css"}function Pi(e){if(Bi(e)||vi(e)||ki(e)||Ci(e))return Si}var wi=Pi;async function Ni(e,t,n){let{node:r}=n,u=r.quasis.length,a=Yn(n,t),s=[];for(let o=0;o2&&D[0].trim()===""&&D[1].trim()==="",g=p>2&&D[p-1].trim()===""&&D[p-2].trim()==="",S=D.every(x=>/^\s*(?:#[^\n\r]*)?$/u.test(x));if(!d&&/#[^\n\r]*$/u.test(D[p-1]))return null;let b=null;S?b=Ii(D):b=await e(c,{parser:"graphql"}),b?(b=hu(b,!1),!l&&F&&s.push(""),s.push(b),!d&&g&&s.push("")):!l&&!d&&F&&s.push(""),y&&s.push(y)}return["`",A([E,I(E,s)]),E,"`"]}function Ii(e){let t=[],n=!1,r=e.map(u=>u.trim());for(let[u,a]of r.entries())a!==""&&(r[u-1]===""&&n?t.push([E,a]):t.push(a),n=!0);return t.length===0?null:I(E,t)}function ji({node:e,parent:t}){return bu({node:e,parent:t},"GraphQL")||t&&(t.type==="TaggedTemplateExpression"&&(t.tag.type==="MemberExpression"&&t.tag.object.name==="graphql"&&t.tag.property.name==="experimental"||t.tag.type==="Identifier"&&(t.tag.name==="gql"||t.tag.name==="graphql"))||t.type==="CallExpression"&&t.callee.type==="Identifier"&&t.callee.name==="graphql")}function Li(e){if(ji(e))return Ni}var Mi=Li,dn=0;async function Bu(e,t,n,r,u){let{node:a}=r,s=dn;dn=dn+1>>>0;let o=S=>`PRETTIER_HTML_PLACEHOLDER_${S}_${s}_IN_JS`,i=a.quasis.map((S,b,x)=>b===x.length-1?S.value.cooked:S.value.cooked+o(b)).join(""),l=Yn(r,n),d=new RegExp(o(String.raw`(\d+)`),"gu"),c=0,D=await t(i,{parser:e,__onHtmlRoot(S){c=S.children.length}}),p=Ft(D,S=>{if(typeof S!="string")return S;let b=[],x=S.split(d);for(let N=0;N1?A(m(p)):m(p),F,"`"]))}function Oi(e){return bu(e,"HTML")||e.match(t=>t.type==="TemplateLiteral",(t,n)=>t.type==="TaggedTemplateExpression"&&t.tag.type==="Identifier"&&t.tag.name==="html"&&n==="quasi")}var Ji=Bu.bind(void 0,"html"),qi=Bu.bind(void 0,"angular");function Xi(e){if(Oi(e))return Ji;if(Ti(e))return qi}var Ri=Xi;async function _i(e,t,n){let{node:r}=n,u=H(!1,r.quasis[0].value.raw,/((?:\\\\)*)\\`/gu,(i,l)=>"\\".repeat(l.length/2)+"`"),a=$i(u),s=a!=="";s&&(u=H(!1,u,new RegExp(`^${a}`,"gmu"),""));let o=hu(await e(u,{parser:"markdown",__inJsTemplate:!0}),!0);return["`",s?A([f,o]):[iu,yo(o)],f,"`"]}function $i(e){let t=e.match(/^([^\S\n]*)\S/mu);return t===null?"":t[1]}function Ui(e){if(Wi(e))return _i}function Wi({node:e,parent:t}){return(t==null?void 0:t.type)==="TaggedTemplateExpression"&&e.quasis.length===1&&t.tag.type==="Identifier"&&(t.tag.name==="md"||t.tag.name==="markdown")}var Gi=Ui;function Vi(e){let{node:t}=e;if(t.type!=="TemplateLiteral"||Ki(t))return;let n;for(let r of[wi,Mi,Ri,Gi])if(n=r(e),!!n)return t.quasis.length===1&&t.quasis[0].value.raw.trim()===""?"``":async(...u)=>{let a=await n(...u);return a&&It({embed:!0,...a.label},a)}}function Ki({quasis:e}){return e.some(({value:{cooked:t}})=>t===null)}var Hi=Vi,zi=/\*\/$/,Qi=/^\/\*\*?/,vu=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,Yi=/(^|\s+)\/\/([^\n\r]*)/g,Ar=/^(\r?\n)+/,Zi=/(?:^|\r?\n) *(@[^\n\r]*?) *\r?\n *(?![^\n\r@]*\/\/[^]*)([^\s@][^\n\r@]+?) *\r?\n/g,gr=/(?:^|\r?\n) *@(\S+) *([^\n\r]*)/g,ep=/(\r?\n|^) *\* ?/g,ku=[];function tp(e){let t=e.match(vu);return t?t[0].trimStart():""}function np(e){let t=e.match(vu),n=t==null?void 0:t[0];return n==null?e:e.slice(n.length)}function rp(e){let t=` +`;e=H(!1,e.replace(Qi,"").replace(zi,""),ep,"$1");let n="";for(;n!==e;)n=e,e=H(!1,e,Zi,`${t}$1 $2${t}`);e=e.replace(Ar,"").trimEnd();let r=Object.create(null),u=H(!1,e,gr,"").replace(Ar,"").trimEnd(),a;for(;a=gr.exec(e);){let s=H(!1,a[2],Yi,"");if(typeof r[a[1]]=="string"||Array.isArray(r[a[1]])){let o=r[a[1]];r[a[1]]=[...ku,...Array.isArray(o)?o:[o],s]}else r[a[1]]=s}return{comments:u,pragmas:r}}function up({comments:e="",pragmas:t={}}){let n=` +`,r="/**",u=" *",a=" */",s=Object.keys(t),o=s.flatMap(l=>xr(l,t[l])).map(l=>`${u} ${l}${n}`).join("");if(!e){if(s.length===0)return"";if(s.length===1&&!Array.isArray(t[s[0]])){let l=t[s[0]];return`${r} ${xr(s[0],l)[0]}${a}`}}let i=e.split(n).map(l=>`${u} ${l}`).join(n)+n;return r+n+(e?i:"")+(e&&s.length>0?u+n:"")+o+a}function xr(e,t){return[...ku,...Array.isArray(t)?t:[t]].map(n=>`@${e} ${n}`.trim())}function ap(e){if(!e.startsWith("#!"))return"";let t=e.indexOf(` +`);return t===-1?e:e.slice(0,t)}var sp=ap;function op(e){let t=sp(e);t&&(e=e.slice(t.length+1));let n=tp(e),{pragmas:r,comments:u}=rp(n);return{shebang:t,text:e,pragmas:r,comments:u}}function ip(e){let{shebang:t,text:n,pragmas:r,comments:u}=op(e),a=np(n),s=up({pragmas:{format:"",...r},comments:u.trimStart()});return(t?`${t} +`:"")+s+(a.startsWith(` +`)?` +`:` + +`)+a}function pp(e,t){let{originalText:n,[Symbol.for("comments")]:r,locStart:u,locEnd:a,[Symbol.for("printedComments")]:s}=t,{node:o}=e,i=u(o),l=a(o);for(let d of r)u(d)>=i&&a(d)<=l&&s.add(d);return n.slice(i,l)}var lp=pp;function kn(e,t){var n,r,u,a,s,o,i,l,d;if(e.isRoot)return!1;let{node:c,key:D,parent:p}=e;if(t.__isInHtmlInterpolation&&!t.bracketSpacing&&dp(c)&&St(e))return!0;if(cp(c))return!1;if(c.type==="Identifier"){if((n=c.extra)!=null&&n.parenthesized&&/^PRETTIER_HTML_PLACEHOLDER_\d+_\d+_IN_JS$/u.test(c.name)||D==="left"&&(c.name==="async"&&!p.await||c.name==="let")&&p.type==="ForOfStatement")return!0;if(c.name==="let"){let y=(r=e.findAncestor(F=>F.type==="ForOfStatement"))==null?void 0:r.left;if(y&&ee(y,F=>F===c))return!0}if(D==="object"&&c.name==="let"&&p.type==="MemberExpression"&&p.computed&&!p.optional){let y=e.findAncestor(g=>g.type==="ExpressionStatement"||g.type==="ForStatement"||g.type==="ForInStatement"),F=y?y.type==="ExpressionStatement"?y.expression:y.type==="ForStatement"?y.init:y.left:void 0;if(F&&ee(F,g=>g===c))return!0}if(D==="expression")switch(c.name){case"await":case"interface":case"module":case"using":case"yield":case"let":case"component":case"hook":case"type":{let y=e.findAncestor(F=>!xe(F));if(y!==p&&y.type==="ExpressionStatement")return!0}}return!1}if(c.type==="ObjectExpression"||c.type==="FunctionExpression"||c.type==="ClassExpression"||c.type==="DoExpression"){let y=(u=e.findAncestor(F=>F.type==="ExpressionStatement"))==null?void 0:u.expression;if(y&&ee(y,F=>F===c))return!0}if(c.type==="ObjectExpression"){let y=(a=e.findAncestor(F=>F.type==="ArrowFunctionExpression"))==null?void 0:a.body;if(y&&y.type!=="SequenceExpression"&&y.type!=="AssignmentExpression"&&ee(y,F=>F===c))return!0}switch(p.type){case"ParenthesizedExpression":return!1;case"ClassDeclaration":case"ClassExpression":if(D==="superClass"&&(c.type==="ArrowFunctionExpression"||c.type==="AssignmentExpression"||c.type==="AwaitExpression"||c.type==="BinaryExpression"||c.type==="ConditionalExpression"||c.type==="LogicalExpression"||c.type==="NewExpression"||c.type==="ObjectExpression"||c.type==="SequenceExpression"||c.type==="TaggedTemplateExpression"||c.type==="UnaryExpression"||c.type==="UpdateExpression"||c.type==="YieldExpression"||c.type==="TSNonNullExpression"||c.type==="ClassExpression"&&O(c.decorators)))return!0;break;case"ExportDefaultDeclaration":return Pu(e,t)||c.type==="SequenceExpression";case"Decorator":if(D==="expression"&&!fp(c))return!0;break;case"TypeAnnotation":if(e.match(void 0,void 0,(y,F)=>F==="returnType"&&y.type==="ArrowFunctionExpression")&&yp(c))return!0;break;case"BinaryExpression":if(D==="left"&&(p.operator==="in"||p.operator==="instanceof")&&c.type==="UnaryExpression")return!0;break;case"VariableDeclarator":if(D==="init"&&e.match(void 0,void 0,(y,F)=>F==="declarations"&&y.type==="VariableDeclaration",(y,F)=>F==="left"&&y.type==="ForInStatement"))return!0;break}switch(c.type){case"UpdateExpression":if(p.type==="UnaryExpression")return c.prefix&&(c.operator==="++"&&p.operator==="+"||c.operator==="--"&&p.operator==="-");case"UnaryExpression":switch(p.type){case"UnaryExpression":return c.operator===p.operator&&(c.operator==="+"||c.operator==="-");case"BindExpression":return!0;case"MemberExpression":case"OptionalMemberExpression":return D==="object";case"TaggedTemplateExpression":return!0;case"NewExpression":case"CallExpression":case"OptionalCallExpression":return D==="callee";case"BinaryExpression":return D==="left"&&p.operator==="**";case"TSNonNullExpression":return!0;default:return!1}case"BinaryExpression":if(p.type==="UpdateExpression"||c.operator==="in"&&Dp(e))return!0;if(c.operator==="|>"&&(s=c.extra)!=null&&s.parenthesized){let y=e.grandparent;if(y.type==="BinaryExpression"&&y.operator==="|>")return!0}case"TSTypeAssertion":case"TSAsExpression":case"TSSatisfiesExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":case"LogicalExpression":switch(p.type){case"TSAsExpression":case"TSSatisfiesExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":return!xe(c);case"ConditionalExpression":return xe(c)||_s(c);case"CallExpression":case"NewExpression":case"OptionalCallExpression":return D==="callee";case"ClassExpression":case"ClassDeclaration":return D==="superClass";case"TSTypeAssertion":case"TaggedTemplateExpression":case"UnaryExpression":case"JSXSpreadAttribute":case"SpreadElement":case"BindExpression":case"AwaitExpression":case"TSNonNullExpression":case"UpdateExpression":return!0;case"MemberExpression":case"OptionalMemberExpression":return D==="object";case"AssignmentExpression":case"AssignmentPattern":return D==="left"&&(c.type==="TSTypeAssertion"||xe(c));case"LogicalExpression":if(c.type==="LogicalExpression")return p.operator!==c.operator;case"BinaryExpression":{let{operator:y,type:F}=c;if(!y&&F!=="TSTypeAssertion")return!0;let g=Kt(y),S=p.operator,b=Kt(S);return b>g||D==="right"&&b===g||b===g&&!Wn(S,y)?!0:b");default:return!1}case"TSFunctionType":if(e.match(y=>y.type==="TSFunctionType",(y,F)=>F==="typeAnnotation"&&y.type==="TSTypeAnnotation",(y,F)=>F==="returnType"&&y.type==="ArrowFunctionExpression"))return!0;case"TSConditionalType":case"TSConstructorType":if(D==="extendsType"&&p.type==="TSConditionalType"){if(c.type==="TSConditionalType")return!0;let{typeAnnotation:y}=c.returnType||c.typeAnnotation;if(y.type==="TSTypePredicate"&&y.typeAnnotation&&(y=y.typeAnnotation.typeAnnotation),y.type==="TSInferType"&&y.typeParameter.constraint)return!0}if(D==="checkType"&&p.type==="TSConditionalType")return!0;case"TSUnionType":case"TSIntersectionType":if((p.type==="TSUnionType"||p.type==="TSIntersectionType")&&p.types.length>1&&(!c.types||c.types.length>1))return!0;case"TSInferType":if(c.type==="TSInferType"){if(p.type==="TSRestType")return!1;if(D==="types"&&(p.type==="TSUnionType"||p.type==="TSIntersectionType")&&c.typeParameter.type==="TSTypeParameter"&&c.typeParameter.constraint)return!0}case"TSTypeOperator":return p.type==="TSArrayType"||p.type==="TSOptionalType"||p.type==="TSRestType"||D==="objectType"&&p.type==="TSIndexedAccessType"||p.type==="TSTypeOperator"||p.type==="TSTypeAnnotation"&&e.grandparent.type.startsWith("TSJSDoc");case"TSTypeQuery":return D==="objectType"&&p.type==="TSIndexedAccessType"||D==="elementType"&&p.type==="TSArrayType";case"TypeOperator":return p.type==="ArrayTypeAnnotation"||p.type==="NullableTypeAnnotation"||D==="objectType"&&(p.type==="IndexedAccessType"||p.type==="OptionalIndexedAccessType")||p.type==="TypeOperator";case"TypeofTypeAnnotation":return D==="objectType"&&(p.type==="IndexedAccessType"||p.type==="OptionalIndexedAccessType")||D==="elementType"&&p.type==="ArrayTypeAnnotation";case"ArrayTypeAnnotation":return p.type==="NullableTypeAnnotation";case"IntersectionTypeAnnotation":case"UnionTypeAnnotation":return p.type==="TypeOperator"||p.type==="ArrayTypeAnnotation"||p.type==="NullableTypeAnnotation"||p.type==="IntersectionTypeAnnotation"||p.type==="UnionTypeAnnotation"||D==="objectType"&&(p.type==="IndexedAccessType"||p.type==="OptionalIndexedAccessType");case"InferTypeAnnotation":case"NullableTypeAnnotation":return p.type==="ArrayTypeAnnotation"||D==="objectType"&&(p.type==="IndexedAccessType"||p.type==="OptionalIndexedAccessType");case"ComponentTypeAnnotation":case"FunctionTypeAnnotation":{if(c.type==="ComponentTypeAnnotation"&&(c.rendersType===null||c.rendersType===void 0))return!1;if(e.match(void 0,(F,g)=>g==="typeAnnotation"&&F.type==="TypeAnnotation",(F,g)=>g==="returnType"&&F.type==="ArrowFunctionExpression")||e.match(void 0,(F,g)=>g==="typeAnnotation"&&F.type==="TypePredicate",(F,g)=>g==="typeAnnotation"&&F.type==="TypeAnnotation",(F,g)=>g==="returnType"&&F.type==="ArrowFunctionExpression"))return!0;let y=p.type==="NullableTypeAnnotation"?e.grandparent:p;return y.type==="UnionTypeAnnotation"||y.type==="IntersectionTypeAnnotation"||y.type==="ArrayTypeAnnotation"||D==="objectType"&&(y.type==="IndexedAccessType"||y.type==="OptionalIndexedAccessType")||D==="checkType"&&p.type==="ConditionalTypeAnnotation"||D==="extendsType"&&p.type==="ConditionalTypeAnnotation"&&((o=c.returnType)==null?void 0:o.type)==="InferTypeAnnotation"&&((i=c.returnType)==null?void 0:i.typeParameter.bound)||y.type==="NullableTypeAnnotation"||p.type==="FunctionTypeParam"&&p.name===null&&Z(c).some(F=>{var g;return((g=F.typeAnnotation)==null?void 0:g.type)==="NullableTypeAnnotation"})}case"ConditionalTypeAnnotation":if(D==="extendsType"&&p.type==="ConditionalTypeAnnotation"&&c.type==="ConditionalTypeAnnotation"||D==="checkType"&&p.type==="ConditionalTypeAnnotation")return!0;case"OptionalIndexedAccessType":return D==="objectType"&&p.type==="IndexedAccessType";case"StringLiteral":case"NumericLiteral":case"Literal":if(typeof c.value=="string"&&p.type==="ExpressionStatement"&&!p.directive){let y=e.grandparent;return y.type==="Program"||y.type==="BlockStatement"}return D==="object"&&p.type==="MemberExpression"&&typeof c.value=="number";case"AssignmentExpression":{let y=e.grandparent;return D==="body"&&p.type==="ArrowFunctionExpression"?!0:D==="key"&&(p.type==="ClassProperty"||p.type==="PropertyDefinition")&&p.computed||(D==="init"||D==="update")&&p.type==="ForStatement"?!1:p.type==="ExpressionStatement"?c.left.type==="ObjectPattern":!(D==="key"&&p.type==="TSPropertySignature"||p.type==="AssignmentExpression"||p.type==="SequenceExpression"&&y.type==="ForStatement"&&(y.init===p||y.update===p)||D==="value"&&p.type==="Property"&&y.type==="ObjectPattern"&&y.properties.includes(p)||p.type==="NGChainedExpression"||D==="node"&&p.type==="JsExpressionRoot")}case"ConditionalExpression":switch(p.type){case"TaggedTemplateExpression":case"UnaryExpression":case"SpreadElement":case"BinaryExpression":case"LogicalExpression":case"NGPipeExpression":case"ExportDefaultDeclaration":case"AwaitExpression":case"JSXSpreadAttribute":case"TSTypeAssertion":case"TypeCastExpression":case"TSAsExpression":case"TSSatisfiesExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":case"TSNonNullExpression":return!0;case"NewExpression":case"CallExpression":case"OptionalCallExpression":return D==="callee";case"ConditionalExpression":return t.experimentalTernaries?!1:D==="test";case"MemberExpression":case"OptionalMemberExpression":return D==="object";default:return!1}case"FunctionExpression":switch(p.type){case"NewExpression":case"CallExpression":case"OptionalCallExpression":return D==="callee";case"TaggedTemplateExpression":return!0;default:return!1}case"ArrowFunctionExpression":switch(p.type){case"BinaryExpression":return p.operator!=="|>"||((l=c.extra)==null?void 0:l.parenthesized);case"NewExpression":case"CallExpression":case"OptionalCallExpression":return D==="callee";case"MemberExpression":case"OptionalMemberExpression":return D==="object";case"TSAsExpression":case"TSSatisfiesExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":case"TSNonNullExpression":case"BindExpression":case"TaggedTemplateExpression":case"UnaryExpression":case"LogicalExpression":case"AwaitExpression":case"TSTypeAssertion":return!0;case"ConditionalExpression":return D==="test";default:return!1}case"ClassExpression":switch(p.type){case"NewExpression":return D==="callee";default:return!1}case"OptionalMemberExpression":case"OptionalCallExpression":case"CallExpression":case"MemberExpression":if(mp(e))return!0;case"TaggedTemplateExpression":case"TSNonNullExpression":if(D==="callee"&&(p.type==="BindExpression"||p.type==="NewExpression")){let y=c;for(;y;)switch(y.type){case"CallExpression":case"OptionalCallExpression":return!0;case"MemberExpression":case"OptionalMemberExpression":case"BindExpression":y=y.object;break;case"TaggedTemplateExpression":y=y.tag;break;case"TSNonNullExpression":y=y.expression;break;default:return!1}}return!1;case"BindExpression":return D==="callee"&&(p.type==="BindExpression"||p.type==="NewExpression")||D==="object"&&W(p);case"NGPipeExpression":return!(p.type==="NGRoot"||p.type==="NGMicrosyntaxExpression"||p.type==="ObjectProperty"&&!((d=c.extra)!=null&&d.parenthesized)||Q(p)||D==="arguments"&&L(p)||D==="right"&&p.type==="NGPipeExpression"||D==="property"&&p.type==="MemberExpression"||p.type==="AssignmentExpression");case"JSXFragment":case"JSXElement":return D==="callee"||D==="left"&&p.type==="BinaryExpression"&&p.operator==="<"||!Q(p)&&p.type!=="ArrowFunctionExpression"&&p.type!=="AssignmentExpression"&&p.type!=="AssignmentPattern"&&p.type!=="BinaryExpression"&&p.type!=="NewExpression"&&p.type!=="ConditionalExpression"&&p.type!=="ExpressionStatement"&&p.type!=="JsExpressionRoot"&&p.type!=="JSXAttribute"&&p.type!=="JSXElement"&&p.type!=="JSXExpressionContainer"&&p.type!=="JSXFragment"&&p.type!=="LogicalExpression"&&!L(p)&&!we(p)&&p.type!=="ReturnStatement"&&p.type!=="ThrowStatement"&&p.type!=="TypeCastExpression"&&p.type!=="VariableDeclarator"&&p.type!=="YieldExpression";case"TSInstantiationExpression":return D==="object"&&W(p)}return!1}var cp=X(["BlockStatement","BreakStatement","ComponentDeclaration","ClassBody","ClassDeclaration","ClassMethod","ClassProperty","PropertyDefinition","ClassPrivateProperty","ContinueStatement","DebuggerStatement","DeclareComponent","DeclareClass","DeclareExportAllDeclaration","DeclareExportDeclaration","DeclareFunction","DeclareHook","DeclareInterface","DeclareModule","DeclareModuleExports","DeclareNamespace","DeclareVariable","DeclareEnum","DoWhileStatement","EnumDeclaration","ExportAllDeclaration","ExportDefaultDeclaration","ExportNamedDeclaration","ExpressionStatement","ForInStatement","ForOfStatement","ForStatement","FunctionDeclaration","HookDeclaration","IfStatement","ImportDeclaration","InterfaceDeclaration","LabeledStatement","MethodDefinition","ReturnStatement","SwitchStatement","ThrowStatement","TryStatement","TSDeclareFunction","TSEnumDeclaration","TSImportEqualsDeclaration","TSInterfaceDeclaration","TSModuleDeclaration","TSNamespaceExportDeclaration","TypeAlias","VariableDeclaration","WhileStatement","WithStatement"]);function Dp(e){let t=0,{node:n}=e;for(;n;){let r=e.getParentNode(t++);if((r==null?void 0:r.type)==="ForStatement"&&r.init===n)return!0;n=r}return!1}function yp(e){return xn(e,t=>t.type==="ObjectTypeAnnotation"&&xn(t,n=>n.type==="FunctionTypeAnnotation"))}function dp(e){return Fe(e)}function St(e){let{parent:t,key:n}=e;switch(t.type){case"NGPipeExpression":if(n==="arguments"&&e.isLast)return e.callParent(St);break;case"ObjectProperty":if(n==="value")return e.callParent(()=>e.key==="properties"&&e.isLast);break;case"BinaryExpression":case"LogicalExpression":if(n==="right")return e.callParent(St);break;case"ConditionalExpression":if(n==="alternate")return e.callParent(St);break;case"UnaryExpression":if(t.prefix)return e.callParent(St);break}return!1}function Pu(e,t){let{node:n,parent:r}=e;return n.type==="FunctionExpression"||n.type==="ClassExpression"?r.type==="ExportDefaultDeclaration"||!kn(e,t):!Rn(n)||r.type!=="ExportDefaultDeclaration"&&kn(e,t)?!1:e.call(()=>Pu(e,t),...Wr(n))}function mp(e){return!!(e.match(void 0,(t,n)=>n==="expression"&&t.type==="ChainExpression",(t,n)=>n==="tag"&&t.type==="TaggedTemplateExpression")||e.match(t=>t.type==="OptionalCallExpression"||t.type==="OptionalMemberExpression",(t,n)=>n==="tag"&&t.type==="TaggedTemplateExpression")||e.match(t=>t.type==="OptionalCallExpression"||t.type==="OptionalMemberExpression",(t,n)=>n==="expression"&&t.type==="TSNonNullExpression",(t,n)=>n==="tag"&&t.type==="TaggedTemplateExpression")||e.match(void 0,(t,n)=>n==="expression"&&t.type==="ChainExpression",(t,n)=>n==="expression"&&t.type==="TSNonNullExpression",(t,n)=>n==="tag"&&t.type==="TaggedTemplateExpression")||e.match(void 0,(t,n)=>n==="expression"&&t.type==="TSNonNullExpression",(t,n)=>n==="expression"&&t.type==="ChainExpression",(t,n)=>n==="tag"&&t.type==="TaggedTemplateExpression")||e.match(t=>t.type==="OptionalMemberExpression"||t.type==="OptionalCallExpression",(t,n)=>n==="object"&&t.type==="MemberExpression"||n==="callee"&&(t.type==="CallExpression"||t.type==="NewExpression"))||e.match(t=>t.type==="OptionalMemberExpression"||t.type==="OptionalCallExpression",(t,n)=>n==="expression"&&t.type==="TSNonNullExpression",(t,n)=>n==="object"&&t.type==="MemberExpression"||n==="callee"&&t.type==="CallExpression")||e.match(t=>t.type==="CallExpression"||t.type==="MemberExpression",(t,n)=>n==="expression"&&t.type==="ChainExpression")&&(e.match(void 0,void 0,(t,n)=>n==="callee"&&(t.type==="CallExpression"&&!t.optional||t.type==="NewExpression")||n==="object"&&t.type==="MemberExpression"&&!t.optional)||e.match(void 0,void 0,(t,n)=>n==="expression"&&t.type==="TSNonNullExpression",(t,n)=>n==="object"&&t.type==="MemberExpression"||n==="callee"&&t.type==="CallExpression"))||e.match(t=>t.type==="CallExpression"||t.type==="MemberExpression",(t,n)=>n==="expression"&&t.type==="TSNonNullExpression",(t,n)=>n==="expression"&&t.type==="ChainExpression",(t,n)=>n==="object"&&t.type==="MemberExpression"||n==="callee"&&t.type==="CallExpression"))}function Pn(e){return e.type==="Identifier"?!0:W(e)?!e.computed&&!e.optional&&e.property.type==="Identifier"&&Pn(e.object):!1}function fp(e){return e.type==="ChainExpression"&&(e=e.expression),Pn(e)||L(e)&&!e.optional&&Pn(e.callee)}var et=kn;function Ep(e,t){let n=t-1;n=it(e,n,{backwards:!0}),n=pt(e,n,{backwards:!0}),n=it(e,n,{backwards:!0});let r=pt(e,n,{backwards:!0});return n!==r}var Fp=Ep,Ap=()=>!0;function Zn(e,t){let n=e.node;return n.printed=!0,t.printer.printComment(e,t)}function gp(e,t){var n;let r=e.node,u=[Zn(e,t)],{printer:a,originalText:s,locStart:o,locEnd:i}=t;if((n=a.isBlockComment)!=null&&n.call(a,r)){let d=oe(s,i(r))?oe(s,o(r),{backwards:!0})?E:T:" ";u.push(d)}else u.push(E);let l=pt(s,it(s,i(r)));return l!==!1&&oe(s,l)&&u.push(E),u}function xp(e,t,n){var r;let u=e.node,a=Zn(e,t),{printer:s,originalText:o,locStart:i}=t,l=(r=s.isBlockComment)==null?void 0:r.call(s,u);if(n!=null&&n.hasLineSuffix&&!(n!=null&&n.isBlock)||oe(o,i(u),{backwards:!0})){let d=Fp(o,i(u));return{doc:mr([E,d?E:"",a]),isBlock:l,hasLineSuffix:!0}}return!l||n!=null&&n.hasLineSuffix?{doc:[mr([" ",a]),he],isBlock:l,hasLineSuffix:!0}:{doc:[" ",a],isBlock:l,hasLineSuffix:!1}}function _(e,t,n={}){let{node:r}=e;if(!O(r==null?void 0:r.comments))return"";let{indent:u=!1,marker:a,filter:s=Ap}=n,o=[];if(e.each(({node:l})=>{l.leading||l.trailing||l.marker!==a||!s(l)||o.push(Zn(e,t))},"comments"),o.length===0)return"";let i=I(E,o);return u?A([E,i]):i}function wu(e,t){let n=e.node;if(!n)return{};let r=t[Symbol.for("printedComments")];if((n.comments||[]).filter(o=>!r.has(o)).length===0)return{leading:"",trailing:""};let u=[],a=[],s;return e.each(()=>{let o=e.node;if(r!=null&&r.has(o))return;let{leading:i,trailing:l}=o;i?u.push(gp(e,t)):l&&(s=xp(e,t,s),a.push(s.doc))},"comments"),{leading:u,trailing:a}}function Ee(e,t,n){let{leading:r,trailing:u}=wu(e,n);return!r&&!u?t:hn(t,a=>[r,a,u])}var Cp=class extends Error{constructor(t,n,r="type"){super(`Unexpected ${n} node ${r}: ${JSON.stringify(t[r])}.`);Jt(this,"name","UnexpectedNodeError");this.node=t}},gt=Cp;function Tp(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var me,hp=class{constructor(e){Ya(this,me),Za(this,me,new Set(e))}getLeadingWhitespaceCount(e){let t=Ne(this,me),n=0;for(let r=0;r=0&&t.has(e.charAt(r));r--)n++;return n}getLeadingWhitespace(e){let t=this.getLeadingWhitespaceCount(e);return e.slice(0,t)}getTrailingWhitespace(e){let t=this.getTrailingWhitespaceCount(e);return e.slice(e.length-t)}hasLeadingWhitespace(e){return Ne(this,me).has(e.charAt(0))}hasTrailingWhitespace(e){return Ne(this,me).has(M(!1,e,-1))}trimStart(e){let t=this.getLeadingWhitespaceCount(e);return e.slice(t)}trimEnd(e){let t=this.getTrailingWhitespaceCount(e);return e.slice(0,e.length-t)}trim(e){return this.trimEnd(this.trimStart(e))}split(e,t=!1){let n=`[${Tp([...Ne(this,me)].join(""))}]+`,r=new RegExp(t?`(${n})`:n,"u");return e.split(r)}hasWhitespaceCharacter(e){let t=Ne(this,me);return Array.prototype.some.call(e,n=>t.has(n))}hasNonWhitespaceCharacter(e){let t=Ne(this,me);return Array.prototype.some.call(e,n=>!t.has(n))}isWhitespaceOnly(e){let t=Ne(this,me);return Array.prototype.every.call(e,n=>t.has(n))}};me=new WeakMap;var Sp=hp,Wt=new Sp(` +\r `),mn=e=>e===""||e===T||e===E||e===f;function bp(e,t,n){var r,u,a,s,o;let{node:i}=e;if(i.type==="JSXElement"&&Rp(i))return[n("openingElement"),n("closingElement")];let l=i.type==="JSXElement"?n("openingElement"):n("openingFragment"),d=i.type==="JSXElement"?n("closingElement"):n("closingFragment");if(i.children.length===1&&i.children[0].type==="JSXExpressionContainer"&&(i.children[0].expression.type==="TemplateLiteral"||i.children[0].expression.type==="TaggedTemplateExpression"))return[l,...e.map(n,"children"),d];i.children=i.children.map(k=>_p(k)?{type:"JSXText",value:" ",raw:" "}:k);let c=i.children.some(K),D=i.children.filter(k=>k.type==="JSXExpressionContainer").length>1,p=i.type==="JSXElement"&&i.openingElement.attributes.length>1,y=te(l)||c||p||D,F=e.parent.rootMarker==="mdx",g=t.singleQuote?"{' '}":'{" "}',S=F?" ":w([g,f]," "),b=((u=(r=i.openingElement)==null?void 0:r.name)==null?void 0:u.name)==="fbt",x=Bp(e,t,n,S,b),N=i.children.some(k=>wt(k));for(let k=x.length-2;k>=0;k--){let J=x[k]===""&&x[k+1]==="",V=x[k]===E&&x[k+1]===""&&x[k+2]===E,R=(x[k]===f||x[k]===E)&&x[k+1]===""&&x[k+2]===S,nt=x[k]===S&&x[k+1]===""&&(x[k+2]===f||x[k+2]===E),Xe=x[k]===S&&x[k+1]===""&&x[k+2]===S,P=x[k]===f&&x[k+1]===""&&x[k+2]===E||x[k]===E&&x[k+1]===""&&x[k+2]===f;V&&N||J||R||Xe||P?x.splice(k,2):nt&&x.splice(k+1,2)}for(;x.length>0&&mn(M(!1,x,-1));)x.pop();for(;x.length>1&&mn(x[0])&&mn(x[1]);)x.shift(),x.shift();let v=[];for(let[k,J]of x.entries()){if(J===S){if(k===1&&x[k-1]===""){if(x.length===2){v.push(g);continue}v.push([g,E]);continue}else if(k===x.length-1){v.push(g);continue}else if(x[k-1]===""&&x[k-2]===E){v.push(g);continue}}v.push(J),te(J)&&(y=!0)}let B=N?su(v):m(v,{shouldBreak:!0});if(((a=t.cursorNode)==null?void 0:a.type)==="JSXText"&&i.children.includes(t.cursorNode)?B=[Rt,B,Rt]:((s=t.nodeBeforeCursor)==null?void 0:s.type)==="JSXText"&&i.children.includes(t.nodeBeforeCursor)?B=[Rt,B]:((o=t.nodeAfterCursor)==null?void 0:o.type)==="JSXText"&&i.children.includes(t.nodeAfterCursor)&&(B=[B,Rt]),F)return B;let q=m([l,A([E,B]),E,d]);return y?q:$e([m([l,...x,d]),q])}function Bp(e,t,n,r,u){let a=[];return e.each(({node:s,next:o})=>{if(s.type==="JSXText"){let i=pe(s);if(wt(s)){let l=Wt.split(i,!0);l[0]===""&&(a.push(""),l.shift(),/\n/u.test(l[0])?a.push(Tr(u,l[1],s,o)):a.push(r),l.shift());let d;if(M(!1,l,-1)===""&&(l.pop(),d=l.pop()),l.length===0)return;for(let[c,D]of l.entries())c%2===1?a.push(T):a.push(D);d!==void 0?/\n/u.test(d)?a.push(Tr(u,M(!1,a,-1),s,o)):a.push(r):a.push(Cr(u,M(!1,a,-1),s,o))}else/\n/u.test(i)?i.match(/\n/gu).length>1&&a.push("",E):a.push("",r)}else{let i=n();if(a.push(i),o&&wt(o)){let l=Wt.trim(pe(o)),[d]=Wt.split(l);a.push(Cr(u,d,s,o))}else a.push(E)}},"children"),a}function Cr(e,t,n,r){return e?"":n.type==="JSXElement"&&!n.closingElement||(r==null?void 0:r.type)==="JSXElement"&&!r.closingElement?t.length===1?f:E:f}function Tr(e,t,n,r){return e?E:t.length===1?n.type==="JSXElement"&&!n.closingElement||(r==null?void 0:r.type)==="JSXElement"&&!r.closingElement?E:f:E}var vp=new Set(["ArrayExpression","TupleExpression","JSXAttribute","JSXElement","JSXExpressionContainer","JSXFragment","ExpressionStatement","CallExpression","OptionalCallExpression","ConditionalExpression","JsExpressionRoot"]);function kp(e,t,n){let{parent:r}=e;if(vp.has(r.type))return t;let u=e.match(void 0,s=>s.type==="ArrowFunctionExpression",L,s=>s.type==="JSXExpressionContainer"),a=et(e,n);return m([a?"":w("("),A([f,t]),f,a?"":w(")")],{shouldBreak:u})}function Pp(e,t,n){let{node:r}=e,u=[];if(u.push(n("name")),r.value){let a;if(ue(r.value)){let s=pe(r.value),o=H(!1,H(!1,s.slice(1,-1),"'","'"),""",'"'),i=Xr(o,t.jsxSingleQuote);o=i==='"'?H(!1,o,'"',"""):H(!1,o,"'","'"),a=e.call(()=>Ee(e,Ge(i+o+i),t),"value")}else a=n("value");u.push("=",a)}return u}function wp(e,t,n){let{node:r}=e,u=(a,s)=>a.type==="JSXEmptyExpression"||!C(a)&&(Q(a)||Fe(a)||a.type==="ArrowFunctionExpression"||a.type==="AwaitExpression"&&(u(a.argument,a)||a.argument.type==="JSXElement")||L(a)||a.type==="ChainExpression"&&L(a.expression)||a.type==="FunctionExpression"||a.type==="TemplateLiteral"||a.type==="TaggedTemplateExpression"||a.type==="DoExpression"||K(s)&&(a.type==="ConditionalExpression"||Be(a)));return u(r.expression,e.parent)?m(["{",n("expression"),ve,"}"]):m(["{",A([f,n("expression")]),f,ve,"}"])}function Np(e,t,n){var r,u;let{node:a}=e,s=C(a.name)||C(a.typeParameters)||C(a.typeArguments);if(a.selfClosing&&a.attributes.length===0&&!s)return["<",n("name"),a.typeArguments?n("typeArguments"):n("typeParameters")," />"];if(((r=a.attributes)==null?void 0:r.length)===1&&ue(a.attributes[0].value)&&!a.attributes[0].value.value.includes(` +`)&&!s&&!C(a.attributes[0]))return m(["<",n("name"),a.typeArguments?n("typeArguments"):n("typeParameters")," ",...e.map(n,"attributes"),a.selfClosing?" />":">"]);let o=(u=a.attributes)==null?void 0:u.some(l=>ue(l.value)&&l.value.value.includes(` +`)),i=t.singleAttributePerLine&&a.attributes.length>1?E:T;return m(["<",n("name"),a.typeArguments?n("typeArguments"):n("typeParameters"),A(e.map(()=>[i,n()],"attributes")),...Ip(a,t,s)],{shouldBreak:o})}function Ip(e,t,n){return e.selfClosing?[T,"/>"]:jp(e,t,n)?[">"]:[f,">"]}function jp(e,t,n){let r=e.attributes.length>0&&C(M(!1,e.attributes,-1),h.Trailing);return e.attributes.length===0&&!n||(t.bracketSameLine||t.jsxBracketSameLine)&&(!n||e.attributes.length>0)&&!r}function Lp(e,t,n){let{node:r}=e,u=[];u.push(""),u}function Mp(e,t){let{node:n}=e,r=C(n),u=C(n,h.Line),a=n.type==="JSXOpeningFragment";return[a?"<":""]}function Op(e,t,n){let r=Ee(e,bp(e,t,n),t);return kp(e,r,t)}function Jp(e,t){let{node:n}=e,r=C(n,h.Line);return[_(e,t,{indent:r}),r?E:""]}function qp(e,t,n){let{node:r}=e;return["{",e.call(({node:u})=>{let a=["...",n()];return!C(u)||!gu(e)?a:[A([f,Ee(e,a,t)]),f]},r.type==="JSXSpreadAttribute"?"argument":"expression"),"}"]}function Xp(e,t,n){let{node:r}=e;if(r.type.startsWith("JSX"))switch(r.type){case"JSXAttribute":return Pp(e,t,n);case"JSXIdentifier":return r.name;case"JSXNamespacedName":return I(":",[n("namespace"),n("name")]);case"JSXMemberExpression":return I(".",[n("object"),n("property")]);case"JSXSpreadAttribute":case"JSXSpreadChild":return qp(e,t,n);case"JSXExpressionContainer":return wp(e,t,n);case"JSXFragment":case"JSXElement":return Op(e,t,n);case"JSXOpeningElement":return Np(e,t,n);case"JSXClosingElement":return Lp(e,t,n);case"JSXOpeningFragment":case"JSXClosingFragment":return Mp(e,t);case"JSXEmptyExpression":return Jp(e,t);case"JSXText":throw new Error("JSXText should be handled by JSXElement");default:throw new gt(r,"JSX")}}function Rp(e){if(e.children.length===0)return!0;if(e.children.length>1)return!1;let t=e.children[0];return t.type==="JSXText"&&!wt(t)}function wt(e){return e.type==="JSXText"&&(Wt.hasNonWhitespaceCharacter(pe(e))||!/\n/u.test(pe(e)))}function _p(e){return e.type==="JSXExpressionContainer"&&ue(e.expression)&&e.expression.value===" "&&!C(e.expression)}function $p(e){let{node:t,parent:n}=e;if(!K(t)||!K(n))return!1;let{index:r,siblings:u}=e,a;for(let s=r;s>0;s--){let o=u[s-1];if(!(o.type==="JSXText"&&!wt(o))){a=o;break}}return(a==null?void 0:a.type)==="JSXExpressionContainer"&&a.expression.type==="JSXEmptyExpression"&&rn(a.expression)}function Up(e){return rn(e.node)||$p(e)}var Nu=Up,Wp=0;function Iu(e,t,n){var r;let{node:u,parent:a,grandparent:s,key:o}=e,i=o!=="body"&&(a.type==="IfStatement"||a.type==="WhileStatement"||a.type==="SwitchStatement"||a.type==="DoWhileStatement"),l=u.operator==="|>"&&((r=e.root.extra)==null?void 0:r.__isUsingHackPipeline),d=wn(e,n,t,!1,i);if(i)return d;if(l)return m(d);if(L(a)&&a.callee===u||a.type==="UnaryExpression"||W(a)&&!a.computed)return m([A([f,...d]),f]);let c=a.type==="ReturnStatement"||a.type==="ThrowStatement"||a.type==="JSXExpressionContainer"&&s.type==="JSXAttribute"||u.operator!=="|"&&a.type==="JsExpressionRoot"||u.type!=="NGPipeExpression"&&(a.type==="NGRoot"&&t.parser==="__ng_binding"||a.type==="NGMicrosyntaxExpression"&&s.type==="NGMicrosyntax"&&s.body.length===1)||u===a.body&&a.type==="ArrowFunctionExpression"||u!==a.body&&a.type==="ForStatement"||a.type==="ConditionalExpression"&&s.type!=="ReturnStatement"&&s.type!=="ThrowStatement"&&!L(s)||a.type==="TemplateLiteral",D=a.type==="AssignmentExpression"||a.type==="VariableDeclarator"||a.type==="ClassProperty"||a.type==="PropertyDefinition"||a.type==="TSAbstractPropertyDefinition"||a.type==="ClassPrivateProperty"||we(a),p=Be(u.left)&&Wn(u.operator,u.left.operator);if(c||Nt(u)&&!p||!Nt(u)&&D)return m(d);if(d.length===0)return"";let y=K(u.right),F=d.findIndex(v=>typeof v!="string"&&!Array.isArray(v)&&v.type===le),g=d.slice(0,F===-1?1:F+1),S=d.slice(g.length,y?-1:void 0),b=Symbol("logicalChain-"+ ++Wp),x=m([...g,A(S)],{id:b});if(!y)return x;let N=M(!1,d,-1);return m([x,un(N,{groupId:b})])}function wn(e,t,n,r,u){var a;let{node:s}=e;if(!Be(s))return[m(t())];let o=[];Wn(s.operator,s.left.operator)?o=e.call(g=>wn(g,t,n,!0,u),"left"):o.push(m(t("left")));let i=Nt(s),l=(s.operator==="|>"||s.type==="NGPipeExpression"||Gp(e,n))&&!Ue(n.originalText,s.right),d=s.type==="NGPipeExpression"?"|":s.operator,c=s.type==="NGPipeExpression"&&s.arguments.length>0?m(A([f,": ",I([T,": "],e.map(()=>Te(2,m(t())),"arguments"))])):"",D;if(i)D=[d," ",t("right"),c];else{let g=d==="|>"&&((a=e.root.extra)!=null&&a.__isUsingHackPipeline)?e.call(S=>wn(S,t,n,!0,u),"right"):t("right");D=[l?T:"",d,l?" ":T,g,c]}let{parent:p}=e,y=C(s.left,h.Trailing|h.Line),F=y||!(u&&s.type==="LogicalExpression")&&p.type!==s.type&&s.left.type!==s.type&&s.right.type!==s.type;if(o.push(l?"":" ",F?m(D,{shouldBreak:y}):D),r&&C(s)){let g=Gn(Ee(e,o,n));return g.type===Oe?g.parts:Array.isArray(g)?g:[g]}return o}function Nt(e){return e.type!=="LogicalExpression"?!1:!!(Fe(e.right)&&e.right.properties.length>0||Q(e.right)&&e.right.elements.length>0||K(e.right))}var hr=e=>e.type==="BinaryExpression"&&e.operator==="|";function Gp(e,t){return(t.parser==="__vue_expression"||t.parser==="__vue_ts_expression")&&hr(e.node)&&!e.hasAncestor(n=>!hr(n)&&n.type!=="JsExpressionRoot")}function Vp(e,t,n){let{node:r}=e;if(r.type.startsWith("NG"))switch(r.type){case"NGRoot":return[n("node"),C(r.node)?" //"+st(r.node)[0].value.trimEnd():""];case"NGPipeExpression":return Iu(e,t,n);case"NGChainedExpression":return m(I([";",T],e.map(()=>Hp(e)?n():["(",n(),")"],"expressions")));case"NGEmptyExpression":return"";case"NGMicrosyntax":return e.map(()=>[e.isFirst?"":Sr(e)?" ":[";",T],n()],"body");case"NGMicrosyntaxKey":return/^[$_a-z][\w$]*(?:-[$_a-z][\w$])*$/iu.test(r.name)?r.name:JSON.stringify(r.name);case"NGMicrosyntaxExpression":return[n("expression"),r.alias===null?"":[" as ",n("alias")]];case"NGMicrosyntaxKeyedExpression":{let{index:u,parent:a}=e,s=Sr(e)||(u===1&&(r.key.name==="then"||r.key.name==="else"||r.key.name==="as")||(u===2||u===3)&&(r.key.name==="else"&&a.body[u-1].type==="NGMicrosyntaxKeyedExpression"&&a.body[u-1].key.name==="then"||r.key.name==="track"))&&a.body[0].type==="NGMicrosyntaxExpression";return[n("key"),s?" ":": ",n("expression")]}case"NGMicrosyntaxLet":return["let ",n("key"),r.value===null?"":[" = ",n("value")]];case"NGMicrosyntaxAs":return[n("key")," as ",n("alias")];default:throw new gt(r,"Angular")}}function Sr({node:e,index:t}){return e.type==="NGMicrosyntaxKeyedExpression"&&e.key.name==="of"&&t===1}var Kp=X(["CallExpression","OptionalCallExpression","AssignmentExpression"]);function Hp({node:e}){return xn(e,Kp)}function ju(e,t,n){let{node:r}=e;return m([I(T,e.map(n,"decorators")),Lu(r,t)?E:T])}function zp(e,t,n){return Mu(e.node)?[I(E,e.map(n,"declaration","decorators")),E]:""}function Qp(e,t,n){let{node:r,parent:u}=e,{decorators:a}=r;if(!O(a)||Mu(u)||Nu(e))return"";let s=r.type==="ClassExpression"||r.type==="ClassDeclaration"||Lu(r,t);return[e.key==="declaration"&&Rs(u)?E:s?he:"",I(T,e.map(n,"decorators")),T]}function Lu(e,t){return e.decorators.some(n=>oe(t.originalText,j(n)))}function Mu(e){var t;if(e.type!=="ExportDefaultDeclaration"&&e.type!=="ExportNamedDeclaration"&&e.type!=="DeclareExportDeclaration")return!1;let n=(t=e.declaration)==null?void 0:t.decorators;return O(n)&&en(e,n[0])}var Qt=class extends Error{constructor(){super(...arguments);Jt(this,"name","ArgExpansionBailout")}};function Yp(e,t,n){let{node:r}=e,u=ye(r);if(u.length===0)return["(",_(e,t),")"];let a=u.length-1;if(tl(u)){let c=["("];return Ht(e,(D,p)=>{c.push(n()),p!==a&&c.push(", ")}),c.push(")"),c}let s=!1,o=[];Ht(e,({node:c},D)=>{let p=n();D===a||(Pe(c,t)?(s=!0,p=[p,",",E,E]):p=[p,",",T]),o.push(p)});let i=!t.parser.startsWith("__ng_")&&r.type!=="ImportExpression"&&ke(t,"all")?",":"";function l(){return m(["(",A([T,...o]),i,T,")"],{shouldBreak:!0})}if(s||e.parent.type!=="Decorator"&&Qs(u))return l();if(el(u)){let c=o.slice(1);if(c.some(te))return l();let D;try{D=n(yr(r,0),{expandFirstArg:!0})}catch(p){if(p instanceof Qt)return l();throw p}return te(D)?[he,$e([["(",m(D,{shouldBreak:!0}),", ",...c,")"],l()])]:$e([["(",D,", ",...c,")"],["(",m(D,{shouldBreak:!0}),", ",...c,")"],l()])}if(Zp(u,o,t)){let c=o.slice(0,-1);if(c.some(te))return l();let D;try{D=n(yr(r,-1),{expandLastArg:!0})}catch(p){if(p instanceof Qt)return l();throw p}return te(D)?[he,$e([["(",...c,m(D,{shouldBreak:!0}),")"],l()])]:$e([["(",...c,D,")"],["(",...c,m(D,{shouldBreak:!0}),")"],l()])}let d=["(",A([f,...o]),w(i),f,")"];return Zr(e)?d:m(d,{shouldBreak:o.some(te)||s})}function Bt(e,t=!1){return Fe(e)&&(e.properties.length>0||C(e))||Q(e)&&(e.elements.length>0||C(e))||e.type==="TSTypeAssertion"&&Bt(e.expression)||xe(e)&&Bt(e.expression)||e.type==="FunctionExpression"||e.type==="ArrowFunctionExpression"&&(!e.returnType||!e.returnType.typeAnnotation||e.returnType.typeAnnotation.type!=="TSTypeReference"||nl(e.body))&&(e.body.type==="BlockStatement"||e.body.type==="ArrowFunctionExpression"&&Bt(e.body,!0)||Fe(e.body)||Q(e.body)||!t&&(L(e.body)||e.body.type==="ConditionalExpression")||K(e.body))||e.type==="DoExpression"||e.type==="ModuleExpression"}function Zp(e,t,n){var r,u;let a=M(!1,e,-1);if(e.length===1){let o=M(!1,t,-1);if((r=o.label)!=null&&r.embed&&((u=o.label)==null?void 0:u.hug)!==!1)return!0}let s=M(!1,e,-2);return!C(a,h.Leading)&&!C(a,h.Trailing)&&Bt(a)&&(!s||s.type!==a.type)&&(e.length!==2||s.type!=="ArrowFunctionExpression"||!Q(a))&&!(e.length>1&&ia(a,n))}function el(e){if(e.length!==2)return!1;let[t,n]=e;return t.type==="ModuleExpression"&&rl(n)?!0:!C(t)&&(t.type==="FunctionExpression"||t.type==="ArrowFunctionExpression"&&t.body.type==="BlockStatement")&&n.type!=="FunctionExpression"&&n.type!=="ArrowFunctionExpression"&&n.type!=="ConditionalExpression"&&Ou(n)&&!Bt(n)}function Ou(e){if(e.type==="ParenthesizedExpression")return Ou(e.expression);if(xe(e)||e.type==="TypeCastExpression"){let{typeAnnotation:t}=e;if(t.type==="TypeAnnotation"&&(t=t.typeAnnotation),t.type==="TSArrayType"&&(t=t.elementType,t.type==="TSArrayType"&&(t=t.elementType)),t.type==="GenericTypeAnnotation"||t.type==="TSTypeReference"){let n=t.typeArguments??t.typeParameters;(n==null?void 0:n.params.length)===1&&(t=n.params[0])}return $n(t)&&fe(e.expression,1)}return ct(e)&&ye(e).length>1?!1:Be(e)?fe(e.left,1)&&fe(e.right,1):Vr(e)||fe(e)}function tl(e){return e.length===2?br(e,0):e.length===3?e[0].type==="Identifier"&&br(e,1):!1}function br(e,t){let n=e[t],r=e[t+1];return n.type==="ArrowFunctionExpression"&&Z(n).length===0&&n.body.type==="BlockStatement"&&r.type==="ArrayExpression"&&!e.some(u=>C(u))}function nl(e){return e.type==="BlockStatement"&&(e.body.some(t=>t.type!=="EmptyStatement")||C(e,h.Dangling))}function rl(e){return e.type==="ObjectExpression"&&e.properties.length===1&&we(e.properties[0])&&e.properties[0].key.type==="Identifier"&&e.properties[0].key.name==="type"&&ue(e.properties[0].value)&&e.properties[0].value.value==="module"}var Nn=Yp,ul=e=>((e.type==="ChainExpression"||e.type==="TSNonNullExpression")&&(e=e.expression),L(e)&&ye(e).length>0);function al(e,t,n){var r;let u=n("object"),a=Ju(e,t,n),{node:s}=e,o=e.findAncestor(d=>!(W(d)||d.type==="TSNonNullExpression")),i=e.findAncestor(d=>!(d.type==="ChainExpression"||d.type==="TSNonNullExpression")),l=o&&(o.type==="NewExpression"||o.type==="BindExpression"||o.type==="AssignmentExpression"&&o.left.type!=="Identifier")||s.computed||s.object.type==="Identifier"&&s.property.type==="Identifier"&&!W(i)||(i.type==="AssignmentExpression"||i.type==="VariableDeclarator")&&(ul(s.object)||((r=u.label)==null?void 0:r.memberChain));return It(u.label,[u,l?a:m(A([f,a]))])}function Ju(e,t,n){let r=n("property"),{node:u}=e,a=ne(e);return u.computed?!u.property||be(u.property)?[a,"[",r,"]"]:m([a,"[",A([f,r]),f,"]"]):[a,".",r]}function qu(e,t,n){if(e.node.type==="ChainExpression")return e.call(()=>qu(e,t,n),"expression");let{parent:r}=e,u=!r||r.type==="ExpressionStatement",a=[];function s(P){let{originalText:G}=t,se=At(G,j(P));return G.charAt(se)===")"?se!==!1&&qn(G,se+1):Pe(P,t)}function o(){let{node:P}=e;if(P.type==="ChainExpression")return e.call(o,"expression");if(L(P)&&(ut(P.callee)||L(P.callee))){let G=s(P);a.unshift({node:P,hasTrailingEmptyLine:G,printed:[Ee(e,[ne(e),Ve(e,t,n),Nn(e,t,n)],t),G?E:""]}),e.call(o,"callee")}else ut(P)?(a.unshift({node:P,needsParens:et(e,t),printed:Ee(e,W(P)?Ju(e,t,n):sa(e,t,n),t)}),e.call(o,"object")):P.type==="TSNonNullExpression"?(a.unshift({node:P,printed:Ee(e,"!",t)}),e.call(o,"expression")):a.unshift({node:P,printed:n()})}let{node:i}=e;a.unshift({node:i,printed:[ne(e),Ve(e,t,n),Nn(e,t,n)]}),i.callee&&e.call(o,"callee");let l=[],d=[a[0]],c=1;for(;c0&&l.push(d);function p(P){return/^[A-Z]|^[$_]+$/u.test(P)}function y(P){return P.length<=t.tabWidth}function F(P){var G;let se=(G=P[1][0])==null?void 0:G.node.computed;if(P[0].length===1){let Re=P[0][0].node;return Re.type==="ThisExpression"||Re.type==="Identifier"&&(p(Re.name)||u&&y(Re.name)||se)}let Se=M(!1,P[0],-1).node;return W(Se)&&Se.property.type==="Identifier"&&(p(Se.property.name)||se)}let g=l.length>=2&&!C(l[1][0].node)&&F(l);function S(P){let G=P.map(se=>se.printed);return P.length>0&&M(!1,P,-1).needsParens?["(",...G,")"]:G}function b(P){return P.length===0?"":A([E,I(E,P.map(S))])}let x=l.map(S),N=x,v=g?3:2,B=l.flat(),q=B.slice(1,-1).some(P=>C(P.node,h.Leading))||B.slice(0,-1).some(P=>C(P.node,h.Trailing))||l[v]&&C(l[v][0].node,h.Leading);if(l.length<=v&&!q&&!l.some(P=>M(!1,P,-1).hasTrailingEmptyLine))return Zr(e)?N:m(N);let k=M(!1,l[g?1:0],-1).node,J=!L(k)&&s(k),V=[S(l[0]),g?l.slice(1,2).map(S):"",J?E:"",b(l.slice(g?2:1))],R=a.map(({node:P})=>P).filter(L);function nt(){let P=M(!1,M(!1,l,-1),-1).node,G=M(!1,x,-1);return L(P)&&te(G)&&R.slice(0,-1).some(se=>se.arguments.some(kt))}let Xe;return q||R.length>2&&R.some(P=>!P.arguments.every(G=>fe(G)))||x.slice(0,-1).some(te)||nt()?Xe=m(V):Xe=[te(N)||J?he:"",$e([N,V])],It({memberChain:!0},Xe)}var sl=qu;function Xu(e,t,n){var r;let{node:u}=e,a=u.type==="NewExpression",s=u.type==="ImportExpression",o=ne(e),i=ye(u),l=i.length===1&&Qr(i[0],t.originalText);if(l||ol(e)||nn(u,e.parent)){let c=[];if(Ht(e,()=>{c.push(n())}),!(l&&(r=c[0].label)!=null&&r.embed))return[a?"new ":"",Br(e,n),o,Ve(e,t,n),"(",I(", ",c),")"]}if(!s&&!a&&ut(u.callee)&&!e.call(c=>et(c,t),"callee",...u.callee.type==="ChainExpression"?["expression"]:[]))return sl(e,t,n);let d=[a?"new ":"",Br(e,n),o,Ve(e,t,n),Nn(e,t,n)];return s||L(u.callee)?m(d):d}function Br(e,t){let{node:n}=e;return n.type==="ImportExpression"?`import${n.phase?`.${n.phase}`:""}`:t("callee")}function ol(e){let{node:t}=e;if(t.type!=="CallExpression"||t.optional||t.callee.type!=="Identifier")return!1;let n=ye(t);return t.callee.name==="require"?n.length===1&&ue(n[0])||n.length>1:t.callee.name==="define"&&e.parent.type==="ExpressionStatement"?n.length===1||n.length===2&&n[0].type==="ArrayExpression"||n.length===3&&ue(n[0])&&n[1].type==="ArrayExpression":!1}function jt(e,t,n,r,u,a){let s=ll(e,t,n,r,a),o=a?n(a,{assignmentLayout:s}):"";switch(s){case"break-after-operator":return m([m(r),u,m(A([T,o]))]);case"never-break-after-operator":return m([m(r),u," ",o]);case"fluid":{let i=Symbol("assignment");return m([m(r),u,m(A(T),{id:i}),ve,un(o,{groupId:i})])}case"break-lhs":return m([r,u," ",m(o)]);case"chain":return[m(r),u,T,o];case"chain-tail":return[m(r),u,A([T,o])];case"chain-tail-arrow-chain":return[m(r),u,o];case"only-left":return r}}function il(e,t,n){let{node:r}=e;return jt(e,t,n,n("left"),[" ",r.operator],"right")}function pl(e,t,n){return jt(e,t,n,n("id")," =","init")}function ll(e,t,n,r,u){let{node:a}=e,s=a[u];if(!s)return"only-left";let o=!Gt(s);if(e.match(Gt,Ru,d=>!o||d.type!=="ExpressionStatement"&&d.type!=="VariableDeclaration"))return o?s.type==="ArrowFunctionExpression"&&s.body.type==="ArrowFunctionExpression"?"chain-tail-arrow-chain":"chain-tail":"chain";if(!o&&Gt(s.right)||Ue(t.originalText,s))return"break-after-operator";if(a.type==="ImportAttribute"||s.type==="CallExpression"&&s.callee.name==="require"||t.parser==="json5"||t.parser==="jsonc"||t.parser==="json")return"never-break-after-operator";let i=Co(r);if(Dl(a)||fl(a)||_u(a)&&i)return"break-lhs";let l=Fl(a,r,t);return e.call(()=>cl(e,t,n,l),u)?"break-after-operator":yl(a)?"break-lhs":!i&&(l||s.type==="TemplateLiteral"||s.type==="TaggedTemplateExpression"||s.type==="BooleanLiteral"||be(s)||s.type==="ClassExpression")?"never-break-after-operator":"fluid"}function cl(e,t,n,r){let u=e.node;if(Be(u)&&!Nt(u))return!0;switch(u.type){case"StringLiteralTypeAnnotation":case"SequenceExpression":return!0;case"TSConditionalType":case"ConditionalTypeAnnotation":if(!t.experimentalTernaries&&!xl(u))break;return!0;case"ConditionalExpression":{if(!t.experimentalTernaries){let{test:l}=u;return Be(l)&&!Nt(l)}let{consequent:o,alternate:i}=u;return o.type==="ConditionalExpression"||i.type==="ConditionalExpression"}case"ClassExpression":return O(u.decorators)}if(r)return!1;let a=u,s=[];for(;;)if(a.type==="UnaryExpression"||a.type==="AwaitExpression"||a.type==="YieldExpression"&&a.argument!==null)a=a.argument,s.push("argument");else if(a.type==="TSNonNullExpression")a=a.expression,s.push("expression");else break;return!!(ue(a)||e.call(()=>$u(e,t,n),...s))}function Dl(e){if(Ru(e)){let t=e.left||e.id;return t.type==="ObjectPattern"&&t.properties.length>2&&t.properties.some(n=>{var r;return we(n)&&(!n.shorthand||((r=n.value)==null?void 0:r.type)==="AssignmentPattern")})}return!1}function Gt(e){return e.type==="AssignmentExpression"}function Ru(e){return Gt(e)||e.type==="VariableDeclarator"}function yl(e){let t=ml(e);if(O(t)){let n=e.type==="TSTypeAliasDeclaration"?"constraint":"bound";if(t.length>1&&t.some(r=>r[n]||r.default))return!0}return!1}var dl=X(["TSTypeAliasDeclaration","TypeAlias"]);function ml(e){var t;if(dl(e))return(t=e.typeParameters)==null?void 0:t.params}function fl(e){if(e.type!=="VariableDeclarator")return!1;let{typeAnnotation:t}=e.id;if(!t||!t.typeAnnotation)return!1;let n=vr(t.typeAnnotation);return O(n)&&n.length>1&&n.some(r=>O(vr(r))||r.type==="TSConditionalType")}function _u(e){var t;return e.type==="VariableDeclarator"&&((t=e.init)==null?void 0:t.type)==="ArrowFunctionExpression"}var El=X(["TSTypeReference","GenericTypeAnnotation"]);function vr(e){var t;if(El(e))return(t=e.typeArguments??e.typeParameters)==null?void 0:t.params}function $u(e,t,n,r=!1){var u;let{node:a}=e,s=()=>$u(e,t,n,!0);if(a.type==="ChainExpression"||a.type==="TSNonNullExpression")return e.call(s,"expression");if(L(a)){if((u=Xu(e,t,n).label)!=null&&u.memberChain)return!1;let o=ye(a);return!(o.length===0||o.length===1&&Un(o[0],t))||Al(a,n)?!1:e.call(s,"callee")}return W(a)?e.call(s,"object"):r&&(a.type==="Identifier"||a.type==="ThisExpression")}function Fl(e,t,n){return we(e)?(t=Gn(t),typeof t=="string"&&ot(t)1)return!0;if(n.length===1){let u=n[0];if(We(u)||tu(u)||u.type==="TSTypeLiteral"||u.type==="ObjectTypeAnnotation")return!0}let r=e.typeParameters?"typeParameters":"typeArguments";if(te(t(r)))return!0}return!1}function gl(e){var t;return(t=e.typeParameters??e.typeArguments)==null?void 0:t.params}function xl(e){function t(n){switch(n.type){case"FunctionTypeAnnotation":case"GenericTypeAnnotation":case"TSFunctionType":return!!n.typeParameters;case"TSTypeReference":return!!(n.typeArguments??n.typeParameters);default:return!1}}return t(e.checkType)||t(e.extendsType)}function tt(e,t,n,r,u){let a=e.node,s=Z(a),o=u?Ve(e,n,t):"";if(s.length===0)return[o,"(",_(e,n,{filter:p=>Ae(n.originalText,j(p))===")"}),")"];let{parent:i}=e,l=nn(i),d=Uu(a),c=[];if(ro(e,(p,y)=>{let F=y===s.length-1;F&&a.rest&&c.push("..."),c.push(t()),!F&&(c.push(","),l||d?c.push(" "):Pe(s[y],n)?c.push(E,E):c.push(T))}),r&&!Tl(e)){if(te(o)||te(c))throw new Qt;return m([Tn(o),"(",Tn(c),")"])}let D=s.every(p=>!O(p.decorators));return d&&D?[o,"(",...c,")"]:l?[o,"(",...c,")"]:(Kr(i)||Ws(i)||i.type==="TypeAlias"||i.type==="UnionTypeAnnotation"||i.type==="IntersectionTypeAnnotation"||i.type==="FunctionTypeAnnotation"&&i.returnType===a)&&s.length===1&&s[0].name===null&&a.this!==s[0]&&s[0].typeAnnotation&&a.typeParameters===null&&$n(s[0].typeAnnotation)&&!a.rest?n.arrowParens==="always"||a.type==="HookTypeAnnotation"?["(",...c,")"]:c:[o,"(",A([f,...c]),w(!no(a)&&ke(n,"all")?",":""),f,")"]}function Uu(e){if(!e)return!1;let t=Z(e);if(t.length!==1)return!1;let[n]=t;return!C(n)&&(n.type==="ObjectPattern"||n.type==="ArrayPattern"||n.type==="Identifier"&&n.typeAnnotation&&(n.typeAnnotation.type==="TypeAnnotation"||n.typeAnnotation.type==="TSTypeAnnotation")&&je(n.typeAnnotation.typeAnnotation)||n.type==="FunctionTypeParam"&&je(n.typeAnnotation)&&n!==e.rest||n.type==="AssignmentPattern"&&(n.left.type==="ObjectPattern"||n.left.type==="ArrayPattern")&&(n.right.type==="Identifier"||Fe(n.right)&&n.right.properties.length===0||Q(n.right)&&n.right.elements.length===0))}function Cl(e){let t;return e.returnType?(t=e.returnType,t.typeAnnotation&&(t=t.typeAnnotation)):e.typeAnnotation&&(t=e.typeAnnotation),t}function xt(e,t){var n;let r=Cl(e);if(!r)return!1;let u=(n=e.typeParameters)==null?void 0:n.params;if(u){if(u.length>1)return!1;if(u.length===1){let a=u[0];if(a.constraint||a.default)return!1}}return Z(e).length===1&&(je(r)||te(t))}function Tl(e){return e.match(t=>t.type==="ArrowFunctionExpression"&&t.body.type==="BlockStatement",(t,n)=>{if(t.type==="CallExpression"&&n==="arguments"&&t.arguments.length===1&&t.callee.type==="CallExpression"){let r=t.callee.callee;return r.type==="Identifier"||r.type==="MemberExpression"&&!r.computed&&r.object.type==="Identifier"&&r.property.type==="Identifier"}return!1},(t,n)=>t.type==="VariableDeclarator"&&n==="init"||t.type==="ExportDefaultDeclaration"&&n==="declaration"||t.type==="TSExportAssignment"&&n==="expression"||t.type==="AssignmentExpression"&&n==="right"&&t.left.type==="MemberExpression"&&t.left.object.type==="Identifier"&&t.left.object.name==="module"&&t.left.property.type==="Identifier"&&t.left.property.name==="exports",t=>t.type!=="VariableDeclaration"||t.kind==="const"&&t.declarations.length===1)}function hl(e){let t=Z(e);return t.length>1&&t.some(n=>n.type==="TSParameterProperty")}var Sl=X(["VoidTypeAnnotation","TSVoidKeyword","NullLiteralTypeAnnotation","TSNullKeyword"]),bl=X(["ObjectTypeAnnotation","TSTypeLiteral","GenericTypeAnnotation","TSTypeReference"]);function Bl(e){let{types:t}=e;if(t.some(r=>C(r)))return!1;let n=t.find(r=>bl(r));return n?t.every(r=>r===n||Sl(r)):!1}function Wu(e){return $n(e)||je(e)?!0:We(e)?Bl(e):!1}function vl(e,t,n){let r=t.semi?";":"",{node:u}=e,a=[ae(e),"opaque type ",n("id"),n("typeParameters")];return u.supertype&&a.push(": ",n("supertype")),u.impltype&&a.push(" = ",n("impltype")),a.push(r),a}function Gu(e,t,n){let r=t.semi?";":"",{node:u}=e,a=[ae(e)];a.push("type ",n("id"),n("typeParameters"));let s=u.type==="TSTypeAliasDeclaration"?"typeAnnotation":"right";return[jt(e,t,n,a," =",s),r]}function Vu(e,t,n){let r=!1;return m(e.map(({isFirst:u,previous:a,node:s,index:o})=>{let i=n();if(u)return i;let l=je(s),d=je(a);return d&&l?[" & ",r?A(i):i]:!d&&!l?A([" &",T,i]):(o>1&&(r=!0),[" & ",o>1?A(i):i])},"types"))}function Ku(e,t,n){let{node:r}=e,{parent:u}=e,a=u.type!=="TypeParameterInstantiation"&&(u.type!=="TSConditionalType"||!t.experimentalTernaries)&&(u.type!=="ConditionalTypeAnnotation"||!t.experimentalTernaries)&&u.type!=="TSTypeParameterInstantiation"&&u.type!=="GenericTypeAnnotation"&&u.type!=="TSTypeReference"&&u.type!=="TSTypeAssertion"&&u.type!=="TupleTypeAnnotation"&&u.type!=="TSTupleType"&&!(u.type==="FunctionTypeParam"&&!u.name&&e.grandparent.this!==u)&&!((u.type==="TypeAlias"||u.type==="VariableDeclarator"||u.type==="TSTypeAliasDeclaration")&&Ue(t.originalText,r)),s=Wu(r),o=e.map(d=>{let c=n();return s||(c=Te(2,c)),Ee(d,c,t)},"types");if(s)return I(" | ",o);let i=a&&!Ue(t.originalText,r),l=[w([i?T:"","| "]),I([T,"| "],o)];return et(e,t)?m([A(l),f]):(u.type==="TupleTypeAnnotation"||u.type==="TSTupleType")&&u[u.type==="TupleTypeAnnotation"&&u.types?"types":"elementTypes"].length>1?m([A([w(["(",f]),l]),f,w(")")]):m(a?A(l):l)}function kl(e){var t;let{node:n,parent:r}=e;return n.type==="FunctionTypeAnnotation"&&(Kr(r)||!((r.type==="ObjectTypeProperty"||r.type==="ObjectTypeInternalSlot")&&!r.variance&&!r.optional&&en(r,n)||r.type==="ObjectTypeCallProperty"||((t=e.getParentNode(2))==null?void 0:t.type)==="DeclareFunction"))}function Hu(e,t,n){let{node:r}=e,u=[an(e)];(r.type==="TSConstructorType"||r.type==="TSConstructSignatureDeclaration")&&u.push("new ");let a=tt(e,n,t,!1,!0),s=[];return r.type==="FunctionTypeAnnotation"?s.push(kl(e)?" => ":": ",n("returnType")):s.push(z(e,n,r.returnType?"returnType":"typeAnnotation")),xt(r,s)&&(a=m(a)),u.push(a,s),m(u)}function zu(e,t,n){return[n("objectType"),ne(e),"[",n("indexType"),"]"]}function Qu(e,t,n){return["infer ",n("typeParameter")]}function kr(e,t,n){let{node:r}=e;return[r.postfix?"":n,z(e,t),r.postfix?n:""]}function Yu(e,t,n){let{node:r}=e;return["...",...r.type==="TupleTypeSpreadElement"&&r.label?[n("label"),": "]:[],n("typeAnnotation")]}function Zu(e,t,n){let{node:r}=e;return[r.variance?n("variance"):"",n("label"),r.optional?"?":"",": ",n("elementType")]}var Pl=new WeakSet;function z(e,t,n="typeAnnotation"){let{node:{[n]:r}}=e;if(!r)return"";let u=!1;if(r.type==="TSTypeAnnotation"||r.type==="TypeAnnotation"){let a=e.call(ea,n);(a==="=>"||a===":"&&C(r,h.Leading))&&(u=!0),Pl.add(r)}return u?[" ",t(n)]:t(n)}var ea=e=>e.match(t=>t.type==="TSTypeAnnotation",(t,n)=>(n==="returnType"||n==="typeAnnotation")&&(t.type==="TSFunctionType"||t.type==="TSConstructorType"))?"=>":e.match(t=>t.type==="TSTypeAnnotation",(t,n)=>n==="typeAnnotation"&&(t.type==="TSJSDocNullableType"||t.type==="TSJSDocNonNullableType"||t.type==="TSTypePredicate"))||e.match(t=>t.type==="TypeAnnotation",(t,n)=>n==="typeAnnotation"&&t.type==="Identifier",(t,n)=>n==="id"&&t.type==="DeclareFunction")||e.match(t=>t.type==="TypeAnnotation",(t,n)=>n==="typeAnnotation"&&t.type==="Identifier",(t,n)=>n==="id"&&t.type==="DeclareHook")||e.match(t=>t.type==="TypeAnnotation",(t,n)=>n==="bound"&&t.type==="TypeParameter"&&t.usesExtendsBound)?"":":";function ta(e,t,n){let r=ea(e);return r?[r," ",n("typeAnnotation")]:n("typeAnnotation")}function na(e){return[e("elementType"),"[]"]}function ra({node:e},t){let n=e.type==="TSTypeQuery"?"exprName":"argument",r=e.type==="TypeofTypeAnnotation"||e.typeArguments?"typeArguments":"typeParameters";return["typeof ",t(n),t(r)]}function ua(e,t){let{node:n}=e;return[n.type==="TSTypePredicate"&&n.asserts?"asserts ":n.type==="TypePredicate"&&n.kind?`${n.kind} `:"",t("parameterName"),n.typeAnnotation?[" is ",z(e,t)]:""]}function ne(e){let{node:t}=e;return!t.optional||t.type==="Identifier"&&t===e.parent.key?"":L(t)||W(t)&&t.computed||t.type==="OptionalIndexedAccessType"?"?.":"?"}function aa(e){return e.node.definite||e.match(void 0,(t,n)=>n==="id"&&t.type==="VariableDeclarator"&&t.definite)?"!":""}var wl=new Set(["DeclareClass","DeclareComponent","DeclareFunction","DeclareHook","DeclareVariable","DeclareExportDeclaration","DeclareExportAllDeclaration","DeclareOpaqueType","DeclareTypeAlias","DeclareEnum","DeclareInterface"]);function ae(e){let{node:t}=e;return t.declare||wl.has(t.type)&&e.parent.type!=="DeclareExportDeclaration"?"declare ":""}var Nl=new Set(["TSAbstractMethodDefinition","TSAbstractPropertyDefinition","TSAbstractAccessorProperty"]);function an({node:e}){return e.abstract||Nl.has(e.type)?"abstract ":""}function Ve(e,t,n){let r=e.node;return r.typeArguments?n("typeArguments"):r.typeParameters?n("typeParameters"):""}function sa(e,t,n){return["::",n("callee")]}function Ie(e,t,n){return e.type==="EmptyStatement"?";":e.type==="BlockStatement"||n?[" ",t]:A([T,t])}function oa(e,t){return["...",t("argument"),z(e,t)]}function Yt(e){return e.accessibility?e.accessibility+" ":""}function Il(e,t,n,r){let{node:u}=e,a=u.inexact?"...":"";return C(u,h.Dangling)?m([n,a,_(e,t,{indent:!0}),f,r]):[n,a,r]}function er(e,t,n){let{node:r}=e,u=[],a=r.type==="TupleExpression"?"#[":"[",s="]",o=r.type==="TupleTypeAnnotation"&&r.types?"types":r.type==="TSTupleType"||r.type==="TupleTypeAnnotation"?"elementTypes":"elements",i=r[o];if(i.length===0)u.push(Il(e,t,a,s));else{let l=M(!1,i,-1),d=(l==null?void 0:l.type)!=="RestElement"&&!r.inexact,c=l===null,D=Symbol("array"),p=!t.__inJestEach&&i.length>1&&i.every((g,S,b)=>{let x=g==null?void 0:g.type;if(!Q(g)&&!Fe(g))return!1;let N=b[S+1];if(N&&x!==N.type)return!1;let v=Q(g)?"elements":"properties";return g[v]&&g[v].length>1}),y=ia(r,t),F=d?c?",":ke(t)?y?w(",","",{groupId:D}):w(","):"":"";u.push(m([a,A([f,y?Ll(e,t,n,F):[jl(e,t,o,r.inexact,n),F],_(e,t)]),f,s],{shouldBreak:p,id:D}))}return u.push(ne(e),z(e,n)),u}function ia(e,t){return Q(e)&&e.elements.length>1&&e.elements.every(n=>n&&(be(n)||Gr(n)&&!C(n.argument))&&!C(n,h.Trailing|h.Line,r=>!oe(t.originalText,U(r),{backwards:!0})))}function pa({node:e},{originalText:t}){let n=u=>On(t,Jn(t,u)),r=u=>t[u]===","?u:r(n(u+1));return qn(t,r(j(e)))}function jl(e,t,n,r,u){let a=[];return e.each(({node:s,isLast:o})=>{a.push(s?m(u()):""),(!o||r)&&a.push([",",T,s&&pa(e,t)?f:""])},n),r&&a.push("..."),a}function Ll(e,t,n,r){let u=[];return e.each(({isLast:a,next:s})=>{u.push([n(),a?r:","]),a||u.push(pa(e,t)?[E,E]:C(s,h.Leading|h.Line)?E:T)},"elements"),su(u)}var Ml=/^[\$A-Z_a-z\xAA\xB5\xBA\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\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\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\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\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-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\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-\uAB65\uAB70-\uABE2\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\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC][\$0-9A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]*$/,Ol=e=>Ml.test(e),Jl=Ol;function ql(e){return e.length===1?e:e.toLowerCase().replace(/^([+-]?[\d.]+e)(?:\+|(-))?0*(?=\d)/u,"$1$2").replace(/^([+-]?[\d.]+)e[+-]?0+$/u,"$1").replace(/^([+-])?\./u,"$10.").replace(/(\.\d+?)0+(?=e|$)/u,"$1").replace(/\.(?=e|$)/u,"")}var Dt=ql,Vt=new WeakMap;function la(e){return/^(?:\d+|\d+\.\d+)$/u.test(e)}function Pr(e,t){return t.parser==="json"||t.parser==="jsonc"||!ue(e.key)||lt(pe(e.key),t).slice(1,-1)!==e.key.value?!1:!!(Jl(e.key.value)&&!(t.parser==="babel-ts"&&e.type==="ClassProperty"||t.parser==="typescript"&&e.type==="PropertyDefinition")||la(e.key.value)&&String(Number(e.key.value))===e.key.value&&e.type!=="ImportAttribute"&&(t.parser==="babel"||t.parser==="acorn"||t.parser==="espree"||t.parser==="meriyah"||t.parser==="__babel_estree"))}function Xl(e,t){let{key:n}=e.node;return(n.type==="Identifier"||be(n)&&la(Dt(pe(n)))&&String(n.value)===Dt(pe(n))&&!(t.parser==="typescript"||t.parser==="babel-ts"))&&(t.parser==="json"||t.parser==="jsonc"||t.quoteProps==="consistent"&&Vt.get(e.parent))}function Lt(e,t,n){let{node:r}=e;if(r.computed)return["[",n("key"),"]"];let{parent:u}=e,{key:a}=r;if(t.quoteProps==="consistent"&&!Vt.has(u)){let s=e.siblings.some(o=>!o.computed&&ue(o.key)&&!Pr(o,t));Vt.set(u,s)}if(Xl(e,t)){let s=lt(JSON.stringify(a.type==="Identifier"?a.name:a.value.toString()),t);return e.call(o=>Ee(o,s,t),"key")}return Pr(r,t)&&(t.quoteProps==="as-needed"||t.quoteProps==="consistent"&&!Vt.get(u))?e.call(s=>Ee(s,/^\d/u.test(a.value)?Dt(a.value):a.value,t),"key"):n("key")}function fn(e,t,n){let{node:r}=e;return r.shorthand?n("value"):jt(e,t,n,Lt(e,t,n),":","value")}var Rl=({node:e,key:t,parent:n})=>t==="value"&&e.type==="FunctionExpression"&&(n.type==="ObjectMethod"||n.type==="ClassMethod"||n.type==="ClassPrivateMethod"||n.type==="MethodDefinition"||n.type==="TSAbstractMethodDefinition"||n.type==="TSDeclareMethod"||n.type==="Property"&&tn(n));function ca(e,t,n,r){if(Rl(e))return tr(e,n,t);let{node:u}=e,a=!1;if((u.type==="FunctionDeclaration"||u.type==="FunctionExpression")&&r!=null&&r.expandLastArg){let{parent:d}=e;L(d)&&(ye(d).length>1||Z(u).every(c=>c.type==="Identifier"&&!c.typeAnnotation))&&(a=!0)}let s=[ae(e),u.async?"async ":"",`function${u.generator?"*":""} `,u.id?t("id"):""],o=tt(e,t,n,a),i=sn(e,t),l=xt(u,i);return s.push(Ve(e,n,t),m([l?m(o):o,i]),u.body?" ":"",t("body")),n.semi&&(u.declare||!u.body)&&s.push(";"),s}function In(e,t,n){let{node:r}=e,{kind:u}=r,a=r.value||r,s=[];return!u||u==="init"||u==="method"||u==="constructor"?a.async&&s.push("async "):(Xn.ok(u==="get"||u==="set"),s.push(u," ")),a.generator&&s.push("*"),s.push(Lt(e,t,n),r.optional||r.key.optional?"?":"",r===a?tr(e,t,n):n("value")),s}function tr(e,t,n){let{node:r}=e,u=tt(e,n,t),a=sn(e,n),s=hl(r),o=xt(r,a),i=[Ve(e,t,n),m([s?m(u,{shouldBreak:!0}):o?m(u):u,a])];return r.body?i.push(" ",n("body")):i.push(t.semi?";":""),i}function _l(e){let t=Z(e);return t.length===1&&!e.typeParameters&&!C(e,h.Dangling)&&t[0].type==="Identifier"&&!t[0].typeAnnotation&&!C(t[0])&&!t[0].optional&&!e.predicate&&!e.returnType}function Da(e,t){if(t.arrowParens==="always")return!1;if(t.arrowParens==="avoid"){let{node:n}=e;return _l(n)}return!1}function sn(e,t){let{node:n}=e,r=[z(e,t,"returnType")];return n.predicate&&r.push(t("predicate")),r}function ya(e,t,n){let{node:r}=e,u=t.semi?";":"",a=[];if(r.argument){let i=n("argument");Wl(t,r.argument)?i=["(",A([E,i]),E,")"]:(Be(r.argument)||r.argument.type==="SequenceExpression"||t.experimentalTernaries&&r.argument.type==="ConditionalExpression"&&(r.argument.consequent.type==="ConditionalExpression"||r.argument.alternate.type==="ConditionalExpression"))&&(i=m([w("("),A([f,i]),f,w(")")])),a.push(" ",i)}let s=C(r,h.Dangling),o=u&&s&&C(r,h.Last|h.Line);return o&&a.push(u),s&&a.push(" ",_(e,t)),o||a.push(u),a}function $l(e,t,n){return["return",ya(e,t,n)]}function Ul(e,t,n){return["throw",ya(e,t,n)]}function Wl(e,t){if(Ue(e.originalText,t)||C(t,h.Leading,n=>Me(e.originalText,U(n),j(n)))&&!K(t))return!0;if(Rn(t)){let n=t,r;for(;r=Xs(n);)if(n=r,Ue(e.originalText,n))return!0}return!1}var En=new WeakMap;function da(e){return En.has(e)||En.set(e,e.type==="ConditionalExpression"&&!ee(e,t=>t.type==="ObjectExpression")),En.get(e)}var ma=e=>e.type==="SequenceExpression";function Gl(e,t,n,r={}){let u=[],a,s=[],o=!1,i=!r.expandLastArg&&e.node.body.type==="ArrowFunctionExpression",l;(function S(){let{node:b}=e,x=Vl(e,t,n,r);if(u.length===0)u.push(x);else{let{leading:N,trailing:v}=wu(e,t);u.push([N,x]),s.unshift(v)}i&&(o||(o=b.returnType&&Z(b).length>0||b.typeParameters||Z(b).some(N=>N.type!=="Identifier"))),!i||b.body.type!=="ArrowFunctionExpression"?(a=n("body",r),l=b.body):e.call(S,"body")})();let d=!Ue(t.originalText,l)&&(ma(l)||Kl(l,a,t)||!o&&da(l)),c=e.key==="callee"&&ct(e.parent),D=Symbol("arrow-chain"),p=Hl(e,r,{signatureDocs:u,shouldBreak:o}),y=!1,F=!1,g=!1;return i&&(c||r.assignmentLayout)&&(F=!0,g=!C(e.node,h.Leading&h.Line),y=r.assignmentLayout==="chain-tail-arrow-chain"||c&&!d),a=zl(e,t,r,{bodyDoc:a,bodyComments:s,functionBody:l,shouldPutBodyOnSameLine:d}),m([m(F?A([g?f:"",p]):p,{shouldBreak:y,id:D})," =>",i?un(a,{groupId:D}):m(a),i&&c?w(f,"",{groupId:D}):""])}function Vl(e,t,n,r){let{node:u}=e,a=[];if(u.async&&a.push("async "),Da(e,t))a.push(n(["params",0]));else{let o=r.expandLastArg||r.expandFirstArg,i=sn(e,n);if(o){if(te(i))throw new Qt;i=m(Tn(i))}a.push(m([tt(e,n,t,o,!0),i]))}let s=_(e,t,{filter(o){let i=At(t.originalText,j(o));return i!==!1&&t.originalText.slice(i,i+2)==="=>"}});return s&&a.push(" ",s),a}function Kl(e,t,n){var r,u;return Q(e)||Fe(e)||e.type==="ArrowFunctionExpression"||e.type==="DoExpression"||e.type==="BlockStatement"||K(e)||((r=t.label)==null?void 0:r.hug)!==!1&&(((u=t.label)==null?void 0:u.embed)||Qr(e,n.originalText))}function Hl(e,t,{signatureDocs:n,shouldBreak:r}){if(n.length===1)return n[0];let{parent:u,key:a}=e;return a!=="callee"&&ct(u)||Be(u)?m([n[0]," =>",A([T,I([" =>",T],n.slice(1))])],{shouldBreak:r}):a==="callee"&&ct(u)||t.assignmentLayout?m(I([" =>",T],n),{shouldBreak:r}):m(A(I([" =>",T],n)),{shouldBreak:r})}function zl(e,t,n,{bodyDoc:r,bodyComments:u,functionBody:a,shouldPutBodyOnSameLine:s}){let{node:o,parent:i}=e,l=n.expandLastArg&&ke(t,"all")?w(","):"",d=(n.expandLastArg||i.type==="JSXExpressionContainer")&&!C(o)?f:"";return s&&da(a)?[" ",m([w("","("),A([f,r]),w("",")"),l,d]),u]:(ma(a)&&(r=m(["(",A([f,r]),f,")"])),s?[" ",r,u]:[A([T,r,u]),l,d])}var Ql=(e,t,n)=>{if(!(e&&t==null)){if(t.findLast)return t.findLast(n);for(let r=t.length-1;r>=0;r--){let u=t[r];if(n(u,r,t))return u}}},Yl=Ql;function jn(e,t,n,r){let{node:u}=e,a=[],s=Yl(!1,u[r],o=>o.type!=="EmptyStatement");return e.each(({node:o})=>{o.type!=="EmptyStatement"&&(a.push(n()),o!==s&&(a.push(E),Pe(o,t)&&a.push(E)))},r),a}function fa(e,t,n){let r=Zl(e,t,n),{node:u,parent:a}=e;if(u.type==="Program"&&(a==null?void 0:a.type)!=="ModuleExpression")return r?[r,E]:"";let s=[];if(u.type==="StaticBlock"&&s.push("static "),s.push("{"),r)s.push(A([E,r]),E);else{let o=e.grandparent;a.type==="ArrowFunctionExpression"||a.type==="FunctionExpression"||a.type==="FunctionDeclaration"||a.type==="ComponentDeclaration"||a.type==="HookDeclaration"||a.type==="ObjectMethod"||a.type==="ClassMethod"||a.type==="ClassPrivateMethod"||a.type==="ForStatement"||a.type==="WhileStatement"||a.type==="DoWhileStatement"||a.type==="DoExpression"||a.type==="ModuleExpression"||a.type==="CatchClause"&&!o.finalizer||a.type==="TSModuleDeclaration"||u.type==="StaticBlock"||s.push(E)}return s.push("}"),s}function Zl(e,t,n){let{node:r}=e,u=O(r.directives),a=r.body.some(i=>i.type!=="EmptyStatement"),s=C(r,h.Dangling);if(!u&&!a&&!s)return"";let o=[];return u&&(o.push(jn(e,t,n,"directives")),(a||s)&&(o.push(E),Pe(M(!1,r.directives,-1),t)&&o.push(E))),a&&o.push(jn(e,t,n,"body")),s&&o.push(_(e,t)),o}function ec(e){let t=new WeakMap;return function(n){return t.has(n)||t.set(n,Symbol(e)),t.get(n)}}var Ea=ec;function tc(e){switch(e){case null:return"";case"PlusOptional":return"+?";case"MinusOptional":return"-?";case"Optional":return"?"}}function nc(e,t,n){let{node:r}=e;return m([r.variance?n("variance"):"","[",A([n("keyTparam")," in ",n("sourceType")]),"]",tc(r.optional),": ",n("propType")])}function Fa(e,t){return e==="+"||e==="-"?e+t:t}function rc(e,t,n){let{node:r}=e,u=Me(t.originalText,U(r),U(r.typeParameter));return m(["{",A([t.bracketSpacing?T:f,m([n("typeParameter"),r.optional?Fa(r.optional,"?"):"",r.typeAnnotation?": ":"",n("typeAnnotation")]),t.semi?w(";"):""]),_(e,t),t.bracketSpacing?T:f,"}"],{shouldBreak:u})}var nr=Ea("typeParameters");function uc(e,t,n){let{node:r}=e;return Z(r).length===1&&r.type.startsWith("TS")&&!r[n][0].constraint&&e.parent.type==="ArrowFunctionExpression"&&!(t.filepath&&/\.ts$/u.test(t.filepath))}function vt(e,t,n,r){let{node:u}=e;if(!u[r])return"";if(!Array.isArray(u[r]))return n(r);let a=nn(e.grandparent),s=e.match(i=>!(i[r].length===1&&je(i[r][0])),void 0,(i,l)=>l==="typeAnnotation",i=>i.type==="Identifier",_u);if(u[r].length===0||!s&&(a||u[r].length===1&&(u[r][0].type==="NullableTypeAnnotation"||Wu(u[r][0]))))return["<",I(", ",e.map(n,r)),ac(e,t),">"];let o=u.type==="TSTypeParameterInstantiation"?"":uc(e,t,r)?",":ke(t)?w(","):"";return m(["<",A([f,I([",",T],e.map(n,r))]),o,f,">"],{id:nr(u)})}function ac(e,t){let{node:n}=e;if(!C(n,h.Dangling))return"";let r=!C(n,h.Line),u=_(e,t,{indent:!r});return r?u:[u,E]}function Aa(e,t,n){let{node:r,parent:u}=e,a=[r.type==="TSTypeParameter"&&r.const?"const ":""],s=r.type==="TSTypeParameter"?n("name"):r.name;if(u.type==="TSMappedType")return u.readonly&&a.push(Fa(u.readonly,"readonly")," "),a.push("[",s),r.constraint&&a.push(" in ",n("constraint")),u.nameType&&a.push(" as ",e.callParent(()=>n("nameType"))),a.push("]"),a;if(r.variance&&a.push(n("variance")),r.in&&a.push("in "),r.out&&a.push("out "),a.push(s),r.bound&&(r.usesExtendsBound&&a.push(" extends "),a.push(z(e,n,"bound"))),r.constraint){let o=Symbol("constraint");a.push(" extends",m(A(T),{id:o}),ve,un(n("constraint"),{groupId:o}))}return r.default&&a.push(" = ",n("default")),m(a)}var ga=X(["ClassProperty","PropertyDefinition","ClassPrivateProperty","ClassAccessorProperty","AccessorProperty","TSAbstractPropertyDefinition","TSAbstractAccessorProperty"]);function xa(e,t,n){let{node:r}=e,u=[ae(e),an(e),"class"],a=C(r.id,h.Trailing)||C(r.typeParameters,h.Trailing)||C(r.superClass)||O(r.extends)||O(r.mixins)||O(r.implements),s=[],o=[];if(r.id&&s.push(" ",n("id")),s.push(n("typeParameters")),r.superClass){let d=[ic(e,t,n),n(r.superTypeArguments?"superTypeArguments":"superTypeParameters")],c=e.call(D=>["extends ",Ee(D,d,t)],"superClass");a?o.push(T,m(c)):o.push(" ",c)}else o.push(Fn(e,t,n,"extends"));o.push(Fn(e,t,n,"mixins"),Fn(e,t,n,"implements"));let i;if(a){let d;Ta(r)?d=[...s,A(o)]:d=A([...s,o]),i=Ca(r),u.push(m(d,{id:i}))}else u.push(...s,...o);let l=r.body;return a&&O(l.body)?u.push(w(E," ",{groupId:i})):u.push(" "),u.push(n("body")),u}var Ca=Ea("heritageGroup");function sc(e){return w(E,"",{groupId:Ca(e)})}function oc(e){return["extends","mixins","implements"].reduce((t,n)=>t+(Array.isArray(e[n])?e[n].length:0),e.superClass?1:0)>1}function Ta(e){return e.typeParameters&&!C(e.typeParameters,h.Trailing|h.Line)&&!oc(e)}function Fn(e,t,n,r){let{node:u}=e;if(!O(u[r]))return"";let a=_(e,t,{marker:r});return[Ta(u)?w(" ",T,{groupId:nr(u.typeParameters)}):T,a,a&&E,r,m(A([T,I([",",T],e.map(n,r))]))]}function ic(e,t,n){let r=n("superClass"),{parent:u}=e;return u.type==="AssignmentExpression"?m(w(["(",A([f,r]),f,")"],r)):r}function ha(e,t,n){let{node:r}=e,u=[];return O(r.decorators)&&u.push(ju(e,t,n)),u.push(Yt(r)),r.static&&u.push("static "),u.push(an(e)),r.override&&u.push("override "),u.push(In(e,t,n)),u}function Sa(e,t,n){let{node:r}=e,u=[],a=t.semi?";":"";O(r.decorators)&&u.push(ju(e,t,n)),u.push(ae(e),Yt(r)),r.static&&u.push("static "),u.push(an(e)),r.override&&u.push("override "),r.readonly&&u.push("readonly "),r.variance&&u.push(n("variance")),(r.type==="ClassAccessorProperty"||r.type==="AccessorProperty"||r.type==="TSAbstractAccessorProperty")&&u.push("accessor "),u.push(Lt(e,t,n),ne(e),aa(e),z(e,n));let s=r.type==="TSAbstractPropertyDefinition"||r.type==="TSAbstractAccessorProperty";return[jt(e,t,n,u," =",s?void 0:"value"),a]}function pc(e,t,n){let{node:r}=e,u=[];return e.each(({node:a,next:s,isLast:o})=>{u.push(n()),!t.semi&&ga(a)&&lc(a,s)&&u.push(";"),o||(u.push(E),Pe(a,t)&&u.push(E))},"body"),C(r,h.Dangling)&&u.push(_(e,t)),["{",u.length>0?[A([E,u]),E]:"","}"]}function lc(e,t){var n;let{type:r,name:u}=e.key;if(!e.computed&&r==="Identifier"&&(u==="static"||u==="get"||u==="set")&&!e.value&&!e.typeAnnotation)return!0;if(!t||t.static||t.accessibility||t.readonly)return!1;if(!t.computed){let a=(n=t.key)==null?void 0:n.name;if(a==="in"||a==="instanceof")return!0}if(ga(t)&&t.variance&&!t.static&&!t.declare)return!0;switch(t.type){case"ClassProperty":case"PropertyDefinition":case"TSAbstractPropertyDefinition":return t.computed;case"MethodDefinition":case"TSAbstractMethodDefinition":case"ClassMethod":case"ClassPrivateMethod":{if((t.value?t.value.async:t.async)||t.kind==="get"||t.kind==="set")return!1;let a=t.value?t.value.generator:t.generator;return!!(t.computed||a)}case"TSIndexSignature":return!0}return!1}var cc=X(["TSAsExpression","TSTypeAssertion","TSNonNullExpression","TSInstantiationExpression","TSSatisfiesExpression"]);function ba(e){return cc(e)?ba(e.expression):e}var Dc=X(["FunctionExpression","ArrowFunctionExpression"]);function yc(e){return e.type==="MemberExpression"||e.type==="OptionalMemberExpression"||e.type==="Identifier"&&e.name!=="undefined"}function dc(e,t){if(t.semi||va(e,t)||ka(e,t))return!1;let{node:n,key:r,parent:u}=e;return!!(n.type==="ExpressionStatement"&&(r==="body"&&(u.type==="Program"||u.type==="BlockStatement"||u.type==="StaticBlock"||u.type==="TSModuleBlock")||r==="consequent"&&u.type==="SwitchCase")&&e.call(()=>Ba(e,t),"expression"))}function Ba(e,t){let{node:n}=e;switch(n.type){case"ParenthesizedExpression":case"TypeCastExpression":case"ArrayExpression":case"ArrayPattern":case"TemplateLiteral":case"TemplateElement":case"RegExpLiteral":return!0;case"ArrowFunctionExpression":if(!Da(e,t))return!0;break;case"UnaryExpression":{let{prefix:r,operator:u}=n;if(r&&(u==="+"||u==="-"))return!0;break}case"BindExpression":if(!n.object)return!0;break;case"Literal":if(n.regex)return!0;break;default:if(K(n))return!0}return et(e,t)?!0:Rn(n)?e.call(()=>Ba(e,t),...Wr(n)):!1}function va({node:e,parent:t},n){return(n.parentParser==="markdown"||n.parentParser==="mdx")&&e.type==="ExpressionStatement"&&K(e.expression)&&t.type==="Program"&&t.body.length===1}function ka({node:e,parent:t},n){return(n.parser==="__vue_event_binding"||n.parser==="__vue_ts_event_binding")&&e.type==="ExpressionStatement"&&t.type==="Program"&&t.body.length===1}function mc(e,t,n){let r=[n("expression")];if(ka(e,t)){let u=ba(e.node.expression);(Dc(u)||yc(u))&&r.push(";")}else va(e,t)||t.semi&&r.push(";");return r}function fc(e,t,n){if(t.__isVueBindings||t.__isVueForBindingLeft){let r=e.map(n,"program","body",0,"params");if(r.length===1)return r[0];let u=I([",",T],r);return t.__isVueForBindingLeft?["(",A([f,m(u)]),f,")"]:u}if(t.__isEmbeddedTypescriptGenericParameters){let r=e.map(n,"program","body",0,"typeParameters","params");return I([",",T],r)}}function Ec(e,t){let{node:n}=e;switch(n.type){case"RegExpLiteral":return wr(n);case"BigIntLiteral":return Ln(n.extra.raw);case"NumericLiteral":return Dt(n.extra.raw);case"StringLiteral":return Ge(lt(n.extra.raw,t));case"NullLiteral":return"null";case"BooleanLiteral":return String(n.value);case"DirectiveLiteral":return Nr(n.extra.raw,t);case"Literal":{if(n.regex)return wr(n.regex);if(n.bigint)return Ln(n.raw);let{value:r}=n;return typeof r=="number"?Dt(n.raw):typeof r=="string"?Fc(e)?Nr(n.raw,t):Ge(lt(n.raw,t)):String(r)}}}function Fc(e){if(e.key!=="expression")return;let{parent:t}=e;return t.type==="ExpressionStatement"&&t.directive}function Ln(e){return e.toLowerCase()}function wr({pattern:e,flags:t}){return t=[...t].sort().join(""),`/${e}/${t}`}function Nr(e,t){let n=e.slice(1,-1);if(n.includes('"')||n.includes("'"))return e;let r=t.singleQuote?"'":'"';return r+n+r}function Ac(e,t,n){let r=e.originalText.slice(t,n);for(let u of e[Symbol.for("comments")]){let a=U(u);if(a>n)break;let s=j(u);if(se.type==="ExportDefaultDeclaration"||e.type==="DeclareExportDeclaration"&&e.default;function Na(e,t,n){let{node:r}=e,u=[zp(e,t,n),ae(e),"export",wa(r)?" default":""],{declaration:a,exported:s}=r;return C(r,h.Dangling)&&(u.push(" ",_(e,t)),Yr(r)&&u.push(E)),a?u.push(" ",n("declaration")):(u.push(Tc(r)),r.type==="ExportAllDeclaration"||r.type==="DeclareExportAllDeclaration"?(u.push(" *"),s&&u.push(" as ",n("exported"))):u.push(La(e,t,n)),u.push(ja(e,t,n),Oa(e,t,n))),u.push(Cc(r,t)),u}var xc=X(["ClassDeclaration","ComponentDeclaration","FunctionDeclaration","TSInterfaceDeclaration","DeclareClass","DeclareComponent","DeclareFunction","DeclareHook","HookDeclaration","TSDeclareFunction","EnumDeclaration"]);function Cc(e,t){return t.semi&&(!e.declaration||wa(e)&&!xc(e.declaration))?";":""}function rr(e,t=!0){return e&&e!=="value"?`${t?" ":""}${e}${t?"":" "}`:""}function Ia(e,t){return rr(e.importKind,t)}function Tc(e){return rr(e.exportKind)}function ja(e,t,n){let{node:r}=e;if(!r.source)return"";let u=[];return Ma(r,t)&&u.push(" from"),u.push(" ",n("source")),u}function La(e,t,n){let{node:r}=e;if(!Ma(r,t))return"";let u=[" "];if(O(r.specifiers)){let a=[],s=[];e.each(()=>{let o=e.node.type;if(o==="ExportNamespaceSpecifier"||o==="ExportDefaultSpecifier"||o==="ImportNamespaceSpecifier"||o==="ImportDefaultSpecifier")a.push(n());else if(o==="ExportSpecifier"||o==="ImportSpecifier")s.push(n());else throw new gt(r,"specifier")},"specifiers"),u.push(I(", ",a)),s.length>0&&(a.length>0&&u.push(", "),s.length>1||a.length>0||r.specifiers.some(o=>C(o))?u.push(m(["{",A([t.bracketSpacing?T:f,I([",",T],s)]),w(ke(t)?",":""),t.bracketSpacing?T:f,"}"])):u.push(["{",t.bracketSpacing?" ":"",...s,t.bracketSpacing?" ":"","}"]))}else u.push("{}");return u}function Ma(e,t){return e.type!=="ImportDeclaration"||O(e.specifiers)||e.importKind==="type"?!0:Pa(t,U(e),U(e.source)).trimEnd().endsWith("from")}function hc(e,t){var n,r;if((n=e.extra)!=null&&n.deprecatedAssertSyntax)return"assert";let u=Pa(t,j(e.source),(r=e.attributes)!=null&&r[0]?U(e.attributes[0]):j(e)).trimStart();return u.startsWith("assert")?"assert":u.startsWith("with")||O(e.attributes)?"with":void 0}function Oa(e,t,n){let{node:r}=e;if(!r.source)return"";let u=hc(r,t);if(!u)return"";let a=[` ${u} {`];return O(r.attributes)&&(t.bracketSpacing&&a.push(" "),a.push(I(", ",e.map(n,"attributes"))),t.bracketSpacing&&a.push(" ")),a.push("}"),a}function Sc(e,t,n){let{node:r}=e,{type:u}=r,a=u.startsWith("Import"),s=a?"imported":"local",o=a?"local":"exported",i=r[s],l=r[o],d="",c="";return u==="ExportNamespaceSpecifier"||u==="ImportNamespaceSpecifier"?d="*":i&&(d=n(s)),l&&!bc(r)&&(c=n(o)),[rr(u==="ImportSpecifier"?r.importKind:r.exportKind,!1),d,d&&c?" as ":"",c]}function bc(e){if(e.type!=="ImportSpecifier"&&e.type!=="ExportSpecifier")return!1;let{local:t,[e.type==="ImportSpecifier"?"imported":"exported"]:n}=e;if(t.type!==n.type||!Bs(t,n))return!1;if(ue(t))return t.value===n.value&&pe(t)===pe(n);switch(t.type){case"Identifier":return t.name===n.name;default:return!1}}function on(e,t,n){var r;let u=t.semi?";":"",{node:a}=e,s=a.type==="ObjectTypeAnnotation",o=a.type==="TSEnumDeclaration"||a.type==="EnumBooleanBody"||a.type==="EnumNumberBody"||a.type==="EnumBigIntBody"||a.type==="EnumStringBody"||a.type==="EnumSymbolBody",i=[a.type==="TSTypeLiteral"||o?"members":a.type==="TSInterfaceBody"?"body":"properties"];s&&i.push("indexers","callProperties","internalSlots");let l=i.flatMap(B=>e.map(({node:q})=>({node:q,printed:n(),loc:U(q)}),B));i.length>1&&l.sort((B,q)=>B.loc-q.loc);let{parent:d,key:c}=e,D=s&&c==="body"&&(d.type==="InterfaceDeclaration"||d.type==="DeclareInterface"||d.type==="DeclareClass"),p=a.type==="TSInterfaceBody"||o||D||a.type==="ObjectPattern"&&d.type!=="FunctionDeclaration"&&d.type!=="FunctionExpression"&&d.type!=="ArrowFunctionExpression"&&d.type!=="ObjectMethod"&&d.type!=="ClassMethod"&&d.type!=="ClassPrivateMethod"&&d.type!=="AssignmentPattern"&&d.type!=="CatchClause"&&a.properties.some(B=>B.value&&(B.value.type==="ObjectPattern"||B.value.type==="ArrayPattern"))||a.type!=="ObjectPattern"&&l.length>0&&Me(t.originalText,U(a),l[0].loc),y=D?";":a.type==="TSInterfaceBody"||a.type==="TSTypeLiteral"?w(u,";"):",",F=a.type==="RecordExpression"?"#{":a.exact?"{|":"{",g=a.exact?"|}":"}",S=[],b=l.map(B=>{let q=[...S,m(B.printed)];return S=[y,T],(B.node.type==="TSPropertySignature"||B.node.type==="TSMethodSignature"||B.node.type==="TSConstructSignatureDeclaration"||B.node.type==="TSCallSignatureDeclaration")&&C(B.node,h.PrettierIgnore)&&S.shift(),Pe(B.node,t)&&S.push(E),q});if(a.inexact||a.hasUnknownMembers){let B;if(C(a,h.Dangling)){let q=C(a,h.Line);B=[_(e,t),q||oe(t.originalText,j(M(!1,st(a),-1)))?E:T,"..."]}else B=["..."];b.push([...S,...B])}let x=(r=M(!1,l,-1))==null?void 0:r.node,N=!(a.inexact||a.hasUnknownMembers||x&&(x.type==="RestElement"||(x.type==="TSPropertySignature"||x.type==="TSCallSignatureDeclaration"||x.type==="TSMethodSignature"||x.type==="TSConstructSignatureDeclaration")&&C(x,h.PrettierIgnore))),v;if(b.length===0){if(!C(a,h.Dangling))return[F,g,z(e,n)];v=m([F,_(e,t,{indent:!0}),f,g,ne(e),z(e,n)])}else v=[D&&O(a.properties)?sc(d):"",F,A([t.bracketSpacing?T:f,...b]),w(N&&(y!==","||ke(t))?y:""),t.bracketSpacing?T:f,g,ne(e),z(e,n)];return e.match(B=>B.type==="ObjectPattern"&&!O(B.decorators),An)||je(a)&&(e.match(void 0,(B,q)=>q==="typeAnnotation",(B,q)=>q==="typeAnnotation",An)||e.match(void 0,(B,q)=>B.type==="FunctionTypeParam"&&q==="typeAnnotation",An))||!p&&e.match(B=>B.type==="ObjectPattern",B=>B.type==="AssignmentExpression"||B.type==="VariableDeclarator")?v:m(v,{shouldBreak:p})}function An(e,t){return(t==="params"||t==="parameters"||t==="this"||t==="rest")&&Uu(e)}function Bc(e){let t=[e];for(let n=0;nD[J]===r),y=D.type===r.type&&!p,F,g,S=0;do g=F||r,F=e.getParentNode(S),S++;while(F&&F.type===r.type&&o.every(J=>F[J]!==g));let b=F||D,x=g;if(u&&(K(r[o[0]])||K(i)||K(l)||Bc(x))){c=!0,y=!0;let J=R=>[w("("),A([f,R]),f,w(")")],V=R=>R.type==="NullLiteral"||R.type==="Literal"&&R.value===null||R.type==="Identifier"&&R.name==="undefined";d.push(" ? ",V(i)?n(a):J(n(a))," : ",l.type===r.type||V(l)?n(s):J(n(s)))}else{let J=R=>t.useTabs?A(n(R)):Te(2,n(R)),V=[T,"? ",i.type===r.type?w("","("):"",J(a),i.type===r.type?w("",")"):"",T,": ",J(s)];d.push(D.type!==r.type||D[s]===r||p?V:t.useTabs?au(A(V)):Te(Math.max(0,t.tabWidth-2),V))}let N=[a,s,...o].some(J=>C(r[J],V=>De(V)&&Me(t.originalText,U(V),j(V)))),v=J=>D===b?m(J,{shouldBreak:N}):N?[J,he]:J,B=!c&&(W(D)||D.type==="NGPipeExpression"&&D.left===r)&&!D.computed,q=Pc(e),k=v([vc(e,t,n),y?d:A(d),u&&B&&!q?f:""]);return p||q?m([A([f,k]),f]):k}function Nc(e,t){return(W(t)||t.type==="NGPipeExpression"&&t.left===e)&&!t.computed}function Ic(e,t,n,r){return[...e.map(u=>st(u)),st(t),st(n)].flat().some(u=>De(u)&&Me(r.originalText,U(u),j(u)))}var jc=new Map([["AssignmentExpression","right"],["VariableDeclarator","init"],["ReturnStatement","argument"],["ThrowStatement","argument"],["UnaryExpression","argument"],["YieldExpression","argument"],["AwaitExpression","argument"]]);function Lc(e){let{node:t}=e;if(t.type!=="ConditionalExpression")return!1;let n,r=t;for(let u=0;!n;u++){let a=e.getParentNode(u);if(a.type==="ChainExpression"&&a.expression===r||L(a)&&a.callee===r||W(a)&&a.object===r||a.type==="TSNonNullExpression"&&a.expression===r){r=a;continue}a.type==="NewExpression"&&a.callee===r||xe(a)&&a.expression===r?(n=e.getParentNode(u+1),r=a):n=a}return r===t?!1:n[jc.get(n.type)]===r}var gn=e=>[w("("),A([f,e]),f,w(")")];function ur(e,t,n,r){if(!t.experimentalTernaries)return wc(e,t,n);let{node:u}=e,a=u.type==="ConditionalExpression",s=u.type==="TSConditionalType"||u.type==="ConditionalTypeAnnotation",o=a?"consequent":"trueType",i=a?"alternate":"falseType",l=a?["test"]:["checkType","extendsType"],d=u[o],c=u[i],D=l.map(de=>u[de]),{parent:p}=e,y=p.type===u.type,F=y&&l.some(de=>p[de]===u),g=y&&p[i]===u,S=d.type===u.type,b=c.type===u.type,x=b||g,N=t.tabWidth>2||t.useTabs,v,B,q=0;do B=v||u,v=e.getParentNode(q),q++;while(v&&v.type===u.type&&l.every(de=>v[de]!==B));let k=v||p,J=r&&r.assignmentLayout&&r.assignmentLayout!=="break-after-operator"&&(p.type==="AssignmentExpression"||p.type==="VariableDeclarator"||p.type==="ClassProperty"||p.type==="PropertyDefinition"||p.type==="ClassPrivateProperty"||p.type==="ObjectProperty"||p.type==="Property"),V=(p.type==="ReturnStatement"||p.type==="ThrowStatement")&&!(S||b),R=a&&k.type==="JSXExpressionContainer"&&e.grandparent.type!=="JSXAttribute",nt=Lc(e),Xe=Nc(u,p),P=s&&et(e,t),G=N?t.useTabs?" ":" ".repeat(t.tabWidth-1):"",se=Ic(D,d,c,t)||S||b,Se=!x&&!y&&!s&&(R?d.type==="NullLiteral"||d.type==="Literal"&&d.value===null:Un(d,t)&&lr(u.test,3)),Re=x||g||s&&!y||y&&a&&lr(u.test,1)||Se,ar=[];!S&&C(d,h.Dangling)&&e.call(de=>{ar.push(_(de,t),E)},"consequent");let Ct=[];C(u.test,h.Dangling)&&e.call(de=>{Ct.push(_(de,t))},"test"),!b&&C(c,h.Dangling)&&e.call(de=>{Ct.push(_(de,t))},"alternate"),C(u,h.Dangling)&&Ct.push(_(e,t));let sr=Symbol("test"),Wa=Symbol("consequent"),Mt=Symbol("test-and-consequent"),Ga=a?[gn(n("test")),u.test.type==="ConditionalExpression"?he:""]:[n("checkType")," ","extends"," ",u.extendsType.type==="TSConditionalType"||u.extendsType.type==="ConditionalTypeAnnotation"||u.extendsType.type==="TSMappedType"?n("extendsType"):m(gn(n("extendsType")))],or=m([Ga," ?"],{id:sr}),Va=n(o),Ot=A([S||R&&(K(d)||y||x)?E:T,ar,Va]),Ka=Re?m([or,x?Ot:w(Ot,m(Ot,{id:Wa}),{groupId:sr})],{id:Mt}):[or,Ot],pn=n(i),ir=Se?w(pn,au(gn(pn)),{groupId:Mt}):pn,Tt=[Ka,Ct.length>0?[A([E,Ct]),E]:b?E:Se?w(T," ",{groupId:Mt}):T,":",b?" ":N?Re?w(G,w(x||Se?" ":G," "),{groupId:Mt}):w(G," "):" ",b?ir:m([A(ir),R&&!Se?f:""]),Xe&&!nt?f:"",se?he:""];return J&&!se?m(A([f,m(Tt)])):J||V?m(A(Tt)):nt||s&&F?m([A([f,Tt]),P?f:""]):p===k?m(Tt):Tt}function Mc(e,t,n,r){let{node:u}=e;if(_n(u))return Ec(e,t);let a=t.semi?";":"",s=[];switch(u.type){case"JsExpressionRoot":return n("node");case"JsonRoot":return[n("node"),E];case"File":return fc(e,t,n)??n("program");case"EmptyStatement":return"";case"ExpressionStatement":return mc(e,t,n);case"ChainExpression":return n("expression");case"ParenthesizedExpression":return!C(u.expression)&&(Fe(u.expression)||Q(u.expression))?["(",n("expression"),")"]:m(["(",A([f,n("expression")]),f,")"]);case"AssignmentExpression":return il(e,t,n);case"VariableDeclarator":return pl(e,t,n);case"BinaryExpression":case"LogicalExpression":return Iu(e,t,n);case"AssignmentPattern":return[n("left")," = ",n("right")];case"OptionalMemberExpression":case"MemberExpression":return al(e,t,n);case"MetaProperty":return[n("meta"),".",n("property")];case"BindExpression":return u.object&&s.push(n("object")),s.push(m(A([f,sa(e,t,n)]))),s;case"Identifier":return[u.name,ne(e),aa(e),z(e,n)];case"V8IntrinsicIdentifier":return["%",u.name];case"SpreadElement":case"SpreadElementPattern":case"SpreadPropertyPattern":case"RestElement":return oa(e,n);case"FunctionDeclaration":case"FunctionExpression":return ca(e,n,t,r);case"ArrowFunctionExpression":return Gl(e,t,n,r);case"YieldExpression":return s.push("yield"),u.delegate&&s.push("*"),u.argument&&s.push(" ",n("argument")),s;case"AwaitExpression":if(s.push("await"),u.argument){s.push(" ",n("argument"));let{parent:o}=e;if(L(o)&&o.callee===u||W(o)&&o.object===u){s=[A([f,...s]),f];let i=e.findAncestor(l=>l.type==="AwaitExpression"||l.type==="BlockStatement");if((i==null?void 0:i.type)!=="AwaitExpression"||!ee(i.argument,l=>l===u))return m(s)}}return s;case"ExportDefaultDeclaration":case"ExportNamedDeclaration":case"ExportAllDeclaration":return Na(e,t,n);case"ImportDeclaration":return gc(e,t,n);case"ImportSpecifier":case"ExportSpecifier":case"ImportNamespaceSpecifier":case"ExportNamespaceSpecifier":case"ImportDefaultSpecifier":case"ExportDefaultSpecifier":return Sc(e,t,n);case"ImportAttribute":return fn(e,t,n);case"Program":case"BlockStatement":case"StaticBlock":return fa(e,t,n);case"ClassBody":return pc(e,t,n);case"ThrowStatement":return Ul(e,t,n);case"ReturnStatement":return $l(e,t,n);case"NewExpression":case"ImportExpression":case"OptionalCallExpression":case"CallExpression":return Xu(e,t,n);case"ObjectExpression":case"ObjectPattern":case"RecordExpression":return on(e,t,n);case"Property":return tn(u)?In(e,t,n):fn(e,t,n);case"ObjectProperty":return fn(e,t,n);case"ObjectMethod":return In(e,t,n);case"Decorator":return["@",n("expression")];case"ArrayExpression":case"ArrayPattern":case"TupleExpression":return er(e,t,n);case"SequenceExpression":{let{parent:o}=e;if(o.type==="ExpressionStatement"||o.type==="ForStatement"){let i=[];return e.each(({isFirst:l})=>{l?i.push(n()):i.push(",",A([T,n()]))},"expressions"),m(i)}return m(I([",",T],e.map(n,"expressions")))}case"ThisExpression":return"this";case"Super":return"super";case"Directive":return[n("value"),a];case"UnaryExpression":return s.push(u.operator),/[a-z]$/u.test(u.operator)&&s.push(" "),C(u.argument)?s.push(m(["(",A([f,n("argument")]),f,")"])):s.push(n("argument")),s;case"UpdateExpression":return[u.prefix?u.operator:"",n("argument"),u.prefix?"":u.operator];case"ConditionalExpression":return ur(e,t,n,r);case"VariableDeclaration":{let o=e.map(n,"declarations"),i=e.parent,l=i.type==="ForStatement"||i.type==="ForInStatement"||i.type==="ForOfStatement",d=u.declarations.some(D=>D.init),c;return o.length===1&&!C(u.declarations[0])?c=o[0]:o.length>0&&(c=A(o[0])),s=[ae(e),u.kind,c?[" ",c]:"",A(o.slice(1).map(D=>[",",d&&!l?E:T,D]))],l&&i.body!==u||s.push(a),m(s)}case"WithStatement":return m(["with (",n("object"),")",Ie(u.body,n("body"))]);case"IfStatement":{let o=Ie(u.consequent,n("consequent")),i=m(["if (",m([A([f,n("test")]),f]),")",o]);if(s.push(i),u.alternate){let l=C(u.consequent,h.Trailing|h.Line)||Yr(u),d=u.consequent.type==="BlockStatement"&&!l;s.push(d?" ":E),C(u,h.Dangling)&&s.push(_(e,t),l?E:" "),s.push("else",m(Ie(u.alternate,n("alternate"),u.alternate.type==="IfStatement")))}return s}case"ForStatement":{let o=Ie(u.body,n("body")),i=_(e,t),l=i?[i,f]:"";return!u.init&&!u.test&&!u.update?[l,m(["for (;;)",o])]:[l,m(["for (",m([A([f,n("init"),";",T,n("test"),";",T,n("update")]),f]),")",o])]}case"WhileStatement":return m(["while (",m([A([f,n("test")]),f]),")",Ie(u.body,n("body"))]);case"ForInStatement":return m(["for (",n("left")," in ",n("right"),")",Ie(u.body,n("body"))]);case"ForOfStatement":return m(["for",u.await?" await":""," (",n("left")," of ",n("right"),")",Ie(u.body,n("body"))]);case"DoWhileStatement":{let o=Ie(u.body,n("body"));return s=[m(["do",o])],u.body.type==="BlockStatement"?s.push(" "):s.push(E),s.push("while (",m([A([f,n("test")]),f]),")",a),s}case"DoExpression":return[u.async?"async ":"","do ",n("body")];case"BreakStatement":case"ContinueStatement":return s.push(u.type==="BreakStatement"?"break":"continue"),u.label&&s.push(" ",n("label")),s.push(a),s;case"LabeledStatement":return u.body.type==="EmptyStatement"?[n("label"),":;"]:[n("label"),": ",n("body")];case"TryStatement":return["try ",n("block"),u.handler?[" ",n("handler")]:"",u.finalizer?[" finally ",n("finalizer")]:""];case"CatchClause":if(u.param){let o=C(u.param,l=>!De(l)||l.leading&&oe(t.originalText,j(l))||l.trailing&&oe(t.originalText,U(l),{backwards:!0})),i=n("param");return["catch ",o?["(",A([f,i]),f,") "]:["(",i,") "],n("body")]}return["catch ",n("body")];case"SwitchStatement":return[m(["switch (",A([f,n("discriminant")]),f,")"])," {",u.cases.length>0?A([E,I(E,e.map(({node:o,isLast:i})=>[n(),!i&&Pe(o,t)?E:""],"cases"))]):"",E,"}"];case"SwitchCase":{u.test?s.push("case ",n("test"),":"):s.push("default:"),C(u,h.Dangling)&&s.push(" ",_(e,t));let o=u.consequent.filter(i=>i.type!=="EmptyStatement");if(o.length>0){let i=jn(e,t,n,"consequent");s.push(o.length===1&&o[0].type==="BlockStatement"?[" ",i]:A([E,i]))}return s}case"DebuggerStatement":return["debugger",a];case"ClassDeclaration":case"ClassExpression":return xa(e,t,n);case"ClassMethod":case"ClassPrivateMethod":case"MethodDefinition":return ha(e,t,n);case"ClassProperty":case"PropertyDefinition":case"ClassPrivateProperty":case"ClassAccessorProperty":case"AccessorProperty":return Sa(e,t,n);case"TemplateElement":return Ge(u.value.raw);case"TemplateLiteral":return Tu(e,n,t);case"TaggedTemplateExpression":return Fi(e,n);case"PrivateIdentifier":return["#",u.name];case"PrivateName":return["#",n("id")];case"TopicReference":return"%";case"ArgumentPlaceholder":return"?";case"ModuleExpression":return["module ",n("body")];case"InterpreterDirective":default:throw new gt(u,"ESTree")}}function Ja(e,t,n){let{parent:r,node:u,key:a}=e,s=[n("expression")];switch(u.type){case"AsConstExpression":s.push(" as const");break;case"AsExpression":case"TSAsExpression":s.push(" as ",n("typeAnnotation"));break;case"SatisfiesExpression":case"TSSatisfiesExpression":s.push(" satisfies ",n("typeAnnotation"));break}return a==="callee"&&L(r)||a==="object"&&W(r)?m([A([f,...s]),f]):s}function Oc(e,t,n){let{node:r}=e,u=[ae(e),"component"];r.id&&u.push(" ",n("id")),u.push(n("typeParameters"));let a=Jc(e,n,t);return r.rendersType?u.push(m([a," ",n("rendersType")])):u.push(m([a])),r.body&&u.push(" ",n("body")),t.semi&&r.type==="DeclareComponent"&&u.push(";"),u}function Jc(e,t,n){let{node:r}=e,u=r.params;if(r.rest&&(u=[...u,r.rest]),u.length===0)return["(",_(e,n,{filter:s=>Ae(n.originalText,j(s))===")"}),")"];let a=[];return Xc(e,(s,o)=>{let i=o===u.length-1;i&&r.rest&&a.push("..."),a.push(t()),!i&&(a.push(","),Pe(u[o],n)?a.push(E,E):a.push(T))}),["(",A([f,...a]),w(ke(n,"all")&&!qc(r,u)?",":""),f,")"]}function qc(e,t){var n;return e.rest||((n=M(!1,t,-1))==null?void 0:n.type)==="RestElement"}function Xc(e,t){let{node:n}=e,r=0,u=a=>t(a,r++);e.each(u,"params"),n.rest&&e.call(u,"rest")}function Rc(e,t,n){let{node:r}=e;return r.shorthand?n("local"):[n("name")," as ",n("local")]}function _c(e,t,n){let{node:r}=e,u=[];return r.name&&u.push(n("name"),r.optional?"?: ":": "),u.push(n("typeAnnotation")),u}function qa(e,t,n){return on(e,n,t)}function Xa(e,t){let{node:n}=e,r=t("id");n.computed&&(r=["[",r,"]"]);let u="";return n.initializer&&(u=t("initializer")),n.init&&(u=t("init")),u?[r," = ",u]:r}function $c(e,t,n){let{node:r}=e,u;if(r.type==="EnumSymbolBody"||r.explicitType)switch(r.type){case"EnumBooleanBody":u="boolean";break;case"EnumNumberBody":u="number";break;case"EnumBigIntBody":u="bigint";break;case"EnumStringBody":u="string";break;case"EnumSymbolBody":u="symbol";break}return[u?`of ${u} `:"",qa(e,t,n)]}function Ra(e,t,n){let{node:r}=e;return[ae(e),r.const?"const ":"","enum ",t("id")," ",r.type==="TSEnumDeclaration"?qa(e,t,n):t("body")]}function Uc(e,t,n){let{node:r}=e,u=["hook"];r.id&&u.push(" ",n("id"));let a=tt(e,n,t,!1,!0),s=sn(e,n),o=xt(r,s);return u.push(m([o?m(a):a,s]),r.body?" ":"",n("body")),u}function Wc(e,t,n){let{node:r}=e,u=[ae(e),"hook"];return r.id&&u.push(" ",n("id")),t.semi&&u.push(";"),u}function Ir(e){var t;let{node:n}=e;return n.type==="HookTypeAnnotation"&&((t=e.getParentNode(2))==null?void 0:t.type)==="DeclareHook"}function Gc(e,t,n){let{node:r}=e,u=[];u.push(Ir(e)?"":"hook ");let a=tt(e,n,t,!1,!0),s=[];return s.push(Ir(e)?": ":" => ",n("returnType")),xt(r,s)&&(a=m(a)),u.push(a,s),m(u)}function _a(e,t,n){let{node:r}=e,u=[ae(e),"interface"],a=[],s=[];r.type!=="InterfaceTypeAnnotation"&&a.push(" ",n("id"),n("typeParameters"));let o=r.typeParameters&&!C(r.typeParameters,h.Trailing|h.Line);return O(r.extends)&&s.push(o?w(" ",T,{groupId:nr(r.typeParameters)}):T,"extends ",(r.extends.length===1?Zs:A)(I([",",T],e.map(n,"extends")))),C(r.id,h.Trailing)||O(r.extends)?o?u.push(m([...a,A(s)])):u.push(m(A([...a,...s]))):u.push(...a,...s),u.push(" ",n("body")),m(u)}function Vc(e,t,n){let{node:r}=e;if($r(r))return r.type.slice(0,-14).toLowerCase();let u=t.semi?";":"";switch(r.type){case"ComponentDeclaration":case"DeclareComponent":case"ComponentTypeAnnotation":return Oc(e,t,n);case"ComponentParameter":return Rc(e,t,n);case"ComponentTypeParameter":return _c(e,t,n);case"HookDeclaration":return Uc(e,t,n);case"DeclareHook":return Wc(e,t,n);case"HookTypeAnnotation":return Gc(e,t,n);case"DeclareClass":return xa(e,t,n);case"DeclareFunction":return[ae(e),"function ",n("id"),n("predicate"),u];case"DeclareModule":return["declare module ",n("id")," ",n("body")];case"DeclareModuleExports":return["declare module.exports",z(e,n),u];case"DeclareNamespace":return["declare namespace ",n("id")," ",n("body")];case"DeclareVariable":return[ae(e),r.kind??"var"," ",n("id"),u];case"DeclareExportDeclaration":case"DeclareExportAllDeclaration":return Na(e,t,n);case"DeclareOpaqueType":case"OpaqueType":return vl(e,t,n);case"DeclareTypeAlias":case"TypeAlias":return Gu(e,t,n);case"IntersectionTypeAnnotation":return Vu(e,t,n);case"UnionTypeAnnotation":return Ku(e,t,n);case"ConditionalTypeAnnotation":return ur(e,t,n);case"InferTypeAnnotation":return Qu(e,t,n);case"FunctionTypeAnnotation":return Hu(e,t,n);case"TupleTypeAnnotation":return er(e,t,n);case"TupleTypeLabeledElement":return Zu(e,t,n);case"TupleTypeSpreadElement":return Yu(e,t,n);case"GenericTypeAnnotation":return[n("id"),vt(e,t,n,"typeParameters")];case"IndexedAccessType":case"OptionalIndexedAccessType":return zu(e,t,n);case"TypeAnnotation":return ta(e,t,n);case"TypeParameter":return Aa(e,t,n);case"TypeofTypeAnnotation":return ra(e,n);case"ExistsTypeAnnotation":return"*";case"ArrayTypeAnnotation":return na(n);case"DeclareEnum":case"EnumDeclaration":return Ra(e,n,t);case"EnumBooleanBody":case"EnumNumberBody":case"EnumBigIntBody":case"EnumStringBody":case"EnumSymbolBody":return $c(e,n,t);case"EnumBooleanMember":case"EnumNumberMember":case"EnumBigIntMember":case"EnumStringMember":case"EnumDefaultedMember":return Xa(e,n);case"FunctionTypeParam":{let a=r.name?n("name"):e.parent.this===r?"this":"";return[a,ne(e),a?": ":"",n("typeAnnotation")]}case"DeclareInterface":case"InterfaceDeclaration":case"InterfaceTypeAnnotation":return _a(e,t,n);case"ClassImplements":case"InterfaceExtends":return[n("id"),n("typeParameters")];case"NullableTypeAnnotation":return["?",n("typeAnnotation")];case"Variance":{let{kind:a}=r;return Xn.ok(a==="plus"||a==="minus"),a==="plus"?"+":"-"}case"KeyofTypeAnnotation":return["keyof ",n("argument")];case"ObjectTypeCallProperty":return[r.static?"static ":"",n("value")];case"ObjectTypeMappedTypeProperty":return nc(e,t,n);case"ObjectTypeIndexer":return[r.static?"static ":"",r.variance?n("variance"):"","[",n("id"),r.id?": ":"",n("key"),"]: ",n("value")];case"ObjectTypeProperty":{let a="";return r.proto?a="proto ":r.static&&(a="static "),[a,r.kind!=="init"?r.kind+" ":"",r.variance?n("variance"):"",Lt(e,t,n),ne(e),tn(r)?"":": ",n("value")]}case"ObjectTypeAnnotation":return on(e,t,n);case"ObjectTypeInternalSlot":return[r.static?"static ":"","[[",n("id"),"]]",ne(e),r.method?"":": ",n("value")];case"ObjectTypeSpreadProperty":return oa(e,n);case"QualifiedTypeofIdentifier":case"QualifiedTypeIdentifier":return[n("qualification"),".",n("id")];case"NullLiteralTypeAnnotation":return"null";case"BooleanLiteralTypeAnnotation":return String(r.value);case"StringLiteralTypeAnnotation":return Ge(lt(pe(r),t));case"NumberLiteralTypeAnnotation":return Dt(r.raw??r.extra.raw);case"BigIntLiteralTypeAnnotation":return Ln(r.raw??r.extra.raw);case"TypeCastExpression":return["(",n("expression"),z(e,n),")"];case"TypePredicate":return ua(e,n);case"TypeOperator":return[r.operator," ",n("typeAnnotation")];case"TypeParameterDeclaration":case"TypeParameterInstantiation":return vt(e,t,n,"params");case"InferredPredicate":case"DeclaredPredicate":return[e.key==="predicate"&&e.parent.type!=="DeclareFunction"&&!e.parent.returnType?": ":" ","%checks",...r.type==="DeclaredPredicate"?["(",n("value"),")"]:[]];case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":return Ja(e,t,n)}}function Kc(e,t,n){var r;let{node:u}=e;if(!u.type.startsWith("TS"))return;if(Ur(u))return u.type.slice(2,-7).toLowerCase();let a=t.semi?";":"",s=[];switch(u.type){case"TSThisType":return"this";case"TSTypeAssertion":{let o=!(Q(u.expression)||Fe(u.expression)),i=m(["<",A([f,n("typeAnnotation")]),f,">"]),l=[w("("),A([f,n("expression")]),f,w(")")];return o?$e([[i,n("expression")],[i,m(l,{shouldBreak:!0})],[i,n("expression")]]):m([i,n("expression")])}case"TSDeclareFunction":return ca(e,n,t);case"TSExportAssignment":return["export = ",n("expression"),a];case"TSModuleBlock":return fa(e,t,n);case"TSInterfaceBody":case"TSTypeLiteral":return on(e,t,n);case"TSTypeAliasDeclaration":return Gu(e,t,n);case"TSQualifiedName":return[n("left"),".",n("right")];case"TSAbstractMethodDefinition":case"TSDeclareMethod":return ha(e,t,n);case"TSAbstractAccessorProperty":case"TSAbstractPropertyDefinition":return Sa(e,t,n);case"TSInterfaceHeritage":case"TSClassImplements":case"TSExpressionWithTypeArguments":case"TSInstantiationExpression":return[n("expression"),n(u.typeArguments?"typeArguments":"typeParameters")];case"TSTemplateLiteralType":return Tu(e,n,t);case"TSNamedTupleMember":return Zu(e,t,n);case"TSRestType":return Yu(e,t,n);case"TSOptionalType":return[n("typeAnnotation"),"?"];case"TSInterfaceDeclaration":return _a(e,t,n);case"TSTypeParameterDeclaration":case"TSTypeParameterInstantiation":return vt(e,t,n,"params");case"TSTypeParameter":return Aa(e,t,n);case"TSAsExpression":case"TSSatisfiesExpression":return Ja(e,t,n);case"TSArrayType":return na(n);case"TSPropertySignature":return[u.readonly?"readonly ":"",Lt(e,t,n),ne(e),z(e,n)];case"TSParameterProperty":return[Yt(u),u.static?"static ":"",u.override?"override ":"",u.readonly?"readonly ":"",n("parameter")];case"TSTypeQuery":return ra(e,n);case"TSIndexSignature":{let o=u.parameters.length>1?w(ke(t)?",":""):"",i=m([A([f,I([", ",f],e.map(n,"parameters"))]),o,f]),l=e.parent.type==="ClassBody"&&e.key==="body";return[l&&u.static?"static ":"",u.readonly?"readonly ":"","[",u.parameters?i:"","]",z(e,n),l?a:""]}case"TSTypePredicate":return ua(e,n);case"TSNonNullExpression":return[n("expression"),"!"];case"TSImportType":return[u.isTypeOf?"typeof ":"","import(",n("argument"),")",u.qualifier?[".",n("qualifier")]:"",vt(e,t,n,u.typeArguments?"typeArguments":"typeParameters")];case"TSLiteralType":return n("literal");case"TSIndexedAccessType":return zu(e,t,n);case"TSTypeOperator":return[u.operator," ",n("typeAnnotation")];case"TSMappedType":return rc(e,t,n);case"TSMethodSignature":{let o=u.kind&&u.kind!=="method"?`${u.kind} `:"";s.push(Yt(u),o,u.computed?"[":"",n("key"),u.computed?"]":"",ne(e));let i=tt(e,n,t,!1,!0),l=u.returnType?"returnType":"typeAnnotation",d=u[l],c=d?z(e,n,l):"",D=xt(u,c);return s.push(D?m(i):i),d&&s.push(m(c)),m(s)}case"TSNamespaceExportDeclaration":return["export as namespace ",n("id"),t.semi?";":""];case"TSEnumDeclaration":return Ra(e,n,t);case"TSEnumMember":return Xa(e,n);case"TSImportEqualsDeclaration":return[u.isExport?"export ":"","import ",Ia(u,!1),n("id")," = ",n("moduleReference"),t.semi?";":""];case"TSExternalModuleReference":return["require(",n("expression"),")"];case"TSModuleDeclaration":{let{parent:o}=e,i=o.type==="TSModuleDeclaration",l=((r=u.body)==null?void 0:r.type)==="TSModuleDeclaration";return i?s.push("."):(s.push(ae(e)),u.kind!=="global"&&s.push(u.kind," ")),s.push(n("id")),l?s.push(n("body")):u.body?s.push(" ",m(n("body"))):s.push(a),s}case"TSConditionalType":return ur(e,t,n);case"TSInferType":return Qu(e,t,n);case"TSIntersectionType":return Vu(e,t,n);case"TSUnionType":return Ku(e,t,n);case"TSFunctionType":case"TSCallSignatureDeclaration":case"TSConstructorType":case"TSConstructSignatureDeclaration":return Hu(e,t,n);case"TSTupleType":return er(e,t,n);case"TSTypeReference":return[n("typeName"),vt(e,t,n,u.typeArguments?"typeArguments":"typeParameters")];case"TSTypeAnnotation":return ta(e,t,n);case"TSEmptyBodyFunctionExpression":return tr(e,t,n);case"TSJSDocAllType":return"*";case"TSJSDocUnknownType":return"?";case"TSJSDocNullableType":return kr(e,n,"?");case"TSJSDocNonNullableType":return kr(e,n,"!");case"TSParenthesizedType":default:throw new gt(u,"TypeScript")}}function Hc(e,t,n,r){if(Nu(e))return lp(e,t);for(let u of[Vp,Xp,Vc,Kc,Mc]){let a=u(e,t,n,r);if(a!==void 0)return a}}var zc=X(["ClassMethod","ClassPrivateMethod","ClassProperty","ClassAccessorProperty","AccessorProperty","TSAbstractAccessorProperty","PropertyDefinition","TSAbstractPropertyDefinition","ClassPrivateProperty","MethodDefinition","TSAbstractMethodDefinition","TSDeclareMethod"]);function Qc(e,t,n,r){var u;e.isRoot&&((u=t.__onHtmlBindingRoot)==null||u.call(t,e.node,t));let a=Hc(e,t,n,r);if(!a)return"";let{node:s}=e;if(zc(s))return a;let o=O(s.decorators),i=Qp(e,t,n),l=s.type==="ClassExpression";if(o&&!l)return hn(a,D=>m([i,D]));let d=et(e,t),c=dc(e,t);return!i&&!d&&!c?a:hn(a,D=>[c?";":"",d?"(":"",d&&l&&o?[A([T,i,D]),T]:[i,D],d?")":""])}var Yc=Qc,Zc={avoidAstMutation:!0},eD=[{linguistLanguageId:174,name:"JSON.stringify",type:"data",color:"#292929",tmScope:"source.json",aceMode:"json",codemirrorMode:"javascript",codemirrorMimeType:"application/json",aliases:["geojson","jsonl","topojson"],extensions:[".importmap"],filenames:["package.json","package-lock.json","composer.json"],parsers:["json-stringify"],vscodeLanguageIds:["json"]},{linguistLanguageId:174,name:"JSON",type:"data",color:"#292929",tmScope:"source.json",aceMode:"json",codemirrorMode:"javascript",codemirrorMimeType:"application/json",aliases:["geojson","jsonl","topojson"],extensions:[".json",".4DForm",".4DProject",".avsc",".geojson",".gltf",".har",".ice",".JSON-tmLanguage",".mcmeta",".tfstate",".tfstate.backup",".topojson",".webapp",".webmanifest",".yy",".yyp"],filenames:[".all-contributorsrc",".arcconfig",".auto-changelog",".c8rc",".htmlhintrc",".imgbotconfig",".nycrc",".tern-config",".tern-project",".watchmanconfig","Pipfile.lock","composer.lock","flake.lock","mcmod.info",".babelrc",".jscsrc",".jshintrc",".jslintrc",".swcrc"],parsers:["json"],vscodeLanguageIds:["json"]},{linguistLanguageId:423,name:"JSON with Comments",type:"data",color:"#292929",group:"JSON",tmScope:"source.js",aceMode:"javascript",codemirrorMode:"javascript",codemirrorMimeType:"text/javascript",aliases:["jsonc"],extensions:[".jsonc",".code-snippets",".code-workspace",".sublime-build",".sublime-commands",".sublime-completions",".sublime-keymap",".sublime-macro",".sublime-menu",".sublime-mousemap",".sublime-project",".sublime-settings",".sublime-theme",".sublime-workspace",".sublime_metrics",".sublime_session"],filenames:[],parsers:["jsonc"],vscodeLanguageIds:["jsonc"]},{linguistLanguageId:175,name:"JSON5",type:"data",color:"#267CB9",extensions:[".json5"],tmScope:"source.js",aceMode:"javascript",codemirrorMode:"javascript",codemirrorMimeType:"application/json",parsers:["json5"],vscodeLanguageIds:["json5"]}],$a={};Zt($a,{getVisitorKeys:()=>uD,massageAstNode:()=>Ua,print:()=>aD});var tD={JsonRoot:["node"],ArrayExpression:["elements"],ObjectExpression:["properties"],ObjectProperty:["key","value"],UnaryExpression:["argument"],NullLiteral:[],BooleanLiteral:[],StringLiteral:[],NumericLiteral:[],Identifier:[],TemplateLiteral:["quasis"],TemplateElement:[]},nD=tD,rD=Rr(nD),uD=rD;function aD(e,t,n){let{node:r}=e;switch(r.type){case"JsonRoot":return[n("node"),E];case"ArrayExpression":{if(r.elements.length===0)return"[]";let u=e.map(()=>e.node===null?"null":n(),"elements");return["[",A([E,I([",",E],u)]),E,"]"]}case"ObjectExpression":return r.properties.length===0?"{}":["{",A([E,I([",",E],e.map(n,"properties"))]),E,"}"];case"ObjectProperty":return[n("key"),": ",n("value")];case"UnaryExpression":return[r.operator==="+"?"":r.operator,n("argument")];case"NullLiteral":return"null";case"BooleanLiteral":return r.value?"true":"false";case"StringLiteral":return JSON.stringify(r.value);case"NumericLiteral":return jr(e)?JSON.stringify(String(r.value)):JSON.stringify(r.value);case"Identifier":return jr(e)?JSON.stringify(r.name):r.name;case"TemplateLiteral":return n(["quasis",0]);case"TemplateElement":return JSON.stringify(r.value.cooked);default:throw new gt(r,"JSON")}}function jr(e){return e.key==="key"&&e.parent.type==="ObjectProperty"}var sD=new Set(["start","end","extra","loc","comments","leadingComments","trailingComments","innerComments","errors","range","tokens"]);function Ua(e,t){let{type:n}=e;if(n==="ObjectProperty"){let{key:r}=e;r.type==="Identifier"?t.key={type:"StringLiteral",value:r.name}:r.type==="NumericLiteral"&&(t.key={type:"StringLiteral",value:String(r.value)});return}if(n==="UnaryExpression"&&e.operator==="+")return t.argument;if(n==="ArrayExpression"){for(let[r,u]of e.elements.entries())u===null&&t.elements.splice(r,0,{type:"NullLiteral"});return}if(n==="TemplateLiteral")return{type:"StringLiteral",value:e.quasis[0].value.cooked}}Ua.ignoredProperties=sD;var Ut={bracketSpacing:{category:"Common",type:"boolean",default:!0,description:"Print spaces between brackets.",oppositeDescription:"Do not print spaces between brackets."},singleQuote:{category:"Common",type:"boolean",default:!1,description:"Use single quotes instead of double quotes."},proseWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap prose.",choices:[{value:"always",description:"Wrap prose if it exceeds the print width."},{value:"never",description:"Do not wrap prose."},{value:"preserve",description:"Wrap prose as-is."}]},bracketSameLine:{category:"Common",type:"boolean",default:!1,description:"Put > of opening tags on the last line instead of on a new line."},singleAttributePerLine:{category:"Common",type:"boolean",default:!1,description:"Enforce single attribute per line in HTML, Vue and JSX."}},_e="JavaScript",oD={arrowParens:{category:_e,type:"choice",default:"always",description:"Include parentheses around a sole arrow function parameter.",choices:[{value:"always",description:"Always include parens. Example: `(x) => x`"},{value:"avoid",description:"Omit parens when possible. Example: `x => x`"}]},bracketSameLine:Ut.bracketSameLine,bracketSpacing:Ut.bracketSpacing,jsxBracketSameLine:{category:_e,type:"boolean",description:"Put > on the last line instead of at a new line.",deprecated:"2.4.0"},semi:{category:_e,type:"boolean",default:!0,description:"Print semicolons.",oppositeDescription:"Do not print semicolons, except at the beginning of lines which may need them."},experimentalTernaries:{category:_e,type:"boolean",default:!1,description:"Use curious ternaries, with the question mark after the condition.",oppositeDescription:"Default behavior of ternaries; keep question marks on the same line as the consequent."},singleQuote:Ut.singleQuote,jsxSingleQuote:{category:_e,type:"boolean",default:!1,description:"Use single quotes in JSX."},quoteProps:{category:_e,type:"choice",default:"as-needed",description:"Change when properties in objects are quoted.",choices:[{value:"as-needed",description:"Only add quotes around object properties where required."},{value:"consistent",description:"If at least one property in an object requires quotes, quote all properties."},{value:"preserve",description:"Respect the input use of quotes in object properties."}]},trailingComma:{category:_e,type:"choice",default:"all",description:"Print trailing commas wherever possible when multi-line.",choices:[{value:"all",description:"Trailing commas wherever possible (including function arguments)."},{value:"es5",description:"Trailing commas where valid in ES5 (objects, arrays, etc.)"},{value:"none",description:"No trailing commas."}]},singleAttributePerLine:Ut.singleAttributePerLine},iD=oD,pD={estree:Jr,"estree-json":$a},lD=[...es,...eD],DD=Or;export{DD as default,lD as languages,iD as options,pD as printers}; diff --git a/playground/assets/index-5ps_llgo.js b/playground/assets/index-5ps_llgo.js new file mode 100644 index 0000000..c016edc --- /dev/null +++ b/playground/assets/index-5ps_llgo.js @@ -0,0 +1,2 @@ +import{A as J,L as K}from"./index-D15XeWB2.js";import{b as Q}from"./index-CJAFAeH3.js";import{L as B}from"./__vite-browser-external-D80GqXp3.js";import{R as A}from"./remoteFile-_ulnNXZo.js";import{u as z,L as H,a as Z}from"./long-eu6Hf4GH.js";import"./_commonjsHelpers-C932wzq6.js";function j(o){if(o.greaterThan(Number.MAX_SAFE_INTEGER)||o.lessThan(Number.MIN_SAFE_INTEGER))throw new Error("integer overflow");return o.toNumber()}class ee extends Error{}function L(o){if(o&&o.aborted){if(typeof DOMException<"u")throw new DOMException("aborted","AbortError");{const e=new ee("aborted");throw e.code="ERR_ABORTED",e}}}function te(o,e){return e.minv.blockPosition-o.maxv.blockPosition<65e3&&e.maxv.blockPosition-o.minv.blockPosition<5e6}function X(o,e){const t=[];let n=null;return o.length===0?o:(o.sort(function(i,a){const r=i.minv.blockPosition-a.minv.blockPosition;return r!==0?r:i.minv.dataPosition-a.minv.dataPosition}),o.forEach(i=>{(!e||i.maxv.compareTo(e)>0)&&(n===null?(t.push(i),n=i):te(n,i)?i.maxv.compareTo(n.maxv)>0&&(n.maxv=i.maxv):(t.push(i),n=i))}),t)}class V{constructor(e,t){this.blockPosition=e,this.dataPosition=t}toString(){return`${this.blockPosition}:${this.dataPosition}`}compareTo(e){return this.blockPosition-e.blockPosition||this.dataPosition-e.dataPosition}}function T(o,e=0,t=!1){if(t)throw new Error("big-endian virtual file offsets not implemented");return new V(o[e+7]*1099511627776+o[e+6]*4294967296+o[e+5]*16777216+o[e+4]*65536+o[e+3]*256+o[e+2],o[e+1]<<8|o[e])}class D{constructor(e,t,n,i=void 0){this.minv=e,this.maxv=t,this.bin=n,this._fetchedSize=i}toUniqueString(){return`${this.minv}..${this.maxv} (bin ${this.bin}, fetchedSize ${this.fetchedSize()})`}toString(){return this.toUniqueString()}compareTo(e){return this.minv.compareTo(e.minv)||this.maxv.compareTo(e.maxv)||this.bin-e.bin}fetchedSize(){return this._fetchedSize!==void 0?this._fetchedSize:this.maxv.blockPosition+65536-this.minv.blockPosition}}class W{constructor({filehandle:e,renameRefSeqs:t=n=>n}){this.filehandle=e,this.renameRefSeq=t}async getMetadata(e={}){const{indices:t,...n}=await this.parse(e);return n}_findFirstData(e,t){return e?e.compareTo(t)>0?t:e:t}async parse(e={}){return this.parseP||(this.parseP=this._parse(e).catch(t=>{throw this.parseP=void 0,t})),this.parseP}async hasRefSeq(e,t={}){var n;return!!(!((n=(await this.parse(t)).indices[e])===null||n===void 0)&&n.binIndex)}}const ne=21578324,U=14;function ie(o,e){return o+=1,e-=1,[[0,0],[1+(o>>26),1+(e>>26)],[9+(o>>23),9+(e>>23)],[73+(o>>20),73+(e>>20)],[585+(o>>17),585+(e>>17)],[4681+(o>>14),4681+(e>>14)]]}class k extends W{async lineCount(e,t={}){const n=await this.parse(t),i=n.refNameToId[e];if(i===void 0||!n.indices[i])return-1;const{stats:r}=n.indices[i];return r?r.lineCount:-1}async _parse(e={}){const t=await this.filehandle.readFile(e),n=await z(t);if(L(e.signal),n.readUInt32LE(0)!==ne)throw new Error("Not a TBI file");const i=n.readInt32LE(4),a=n.readInt32LE(8),r=a&65536?"zero-based-half-open":"1-based-closed",d={0:"generic",1:"SAM",2:"VCF"}[a&15];if(!d)throw new Error(`invalid Tabix preset format flags ${a}`);const l={ref:n.readInt32LE(12),start:n.readInt32LE(16),end:n.readInt32LE(20)},u=n.readInt32LE(24),c=5,f=((1<<(c+1)*3)-1)/7,I=2**(14+c*3),w=u?String.fromCharCode(u):null,m=n.readInt32LE(28),b=n.readInt32LE(32),{refNameToId:p,refIdToName:x}=this._parseNameBytes(n.slice(36,36+b));let h=36+b,g;return{indices:new Array(i).fill(0).map(()=>{const y=n.readInt32LE(h);h+=4;const S={};let v;for(let C=0;Cf+1)throw new Error("tabix index contains too many bins, please use a CSI index");if(_===f+1){const N=n.readInt32LE(h);h+=4,N===2&&(v=this.parsePseudoBin(n,h)),h+=16*N}else{const N=n.readInt32LE(h);h+=4;const O=new Array(N);for(let F=0;F>U>=s.linearIndex.length?s.linearIndex.length-1:t>>U]:new V(0,0))||console.warn("querying outside of possible tabix range");const l=ie(t,n),u=[];for(const[m,b]of l)for(let p=m;p<=b;p++)if(s.binIndex[p])for(const x of s.binIndex[p])u.push(new D(x.minv,x.maxv,p));const c=s.linearIndex.length;let f=null;const I=Math.min(t>>14,c-1),w=Math.min(n>>14,c-1);for(let m=I;m<=w;++m){const b=s.linearIndex[m];b&&(!f||b.compareTo(f)<0)&&(f=b)}return X(u,f)}}const re=21582659,se=38359875;function ae(o,e){return o*2**e}function G(o,e){return Math.floor(o/2**e)}class M extends W{constructor(e){super(e),this.maxBinNumber=0,this.depth=0,this.minShift=0}async lineCount(e,t={}){const n=await this.parse(t),i=n.refNameToId[e];if(i===void 0||!n.indices[i])return-1;const{stats:r}=n.indices[i];return r?r.lineCount:-1}indexCov(){throw new Error("CSI indexes do not support indexcov")}parseAuxData(e,t){const n=e.readInt32LE(t),i=n&65536?"zero-based-half-open":"1-based-closed",a={0:"generic",1:"SAM",2:"VCF"}[n&15];if(!a)throw new Error(`invalid Tabix preset format flags ${n}`);const r={ref:e.readInt32LE(t+4),start:e.readInt32LE(t+8),end:e.readInt32LE(t+12)},s=e.readInt32LE(t+16),d=s?String.fromCharCode(s):null,l=e.readInt32LE(t+20),u=e.readInt32LE(t+24),{refIdToName:c,refNameToId:f}=this._parseNameBytes(e.slice(t+28,t+28+u));return{refIdToName:c,refNameToId:f,skipLines:l,metaChar:d,columnNumbers:r,format:a,coordinateType:i}}_parseNameBytes(e){let t=0,n=0;const i=[],a={};for(let r=0;r=30?this.parseAuxData(t,16):{refIdToName:[],refNameToId:{},metaChar:null,columnNumbers:{ref:0,start:1,end:2},coordinateType:"zero-based-half-open",format:"generic"},s=t.readInt32LE(16+a);let d,l=16+a+4;const u=new Array(s).fill(0).map(()=>{const c=t.readInt32LE(l);l+=4;const f={};let I;for(let w=0;wthis.maxBinNumber)I=this.parsePseudoBin(t,l+4),l+=48;else{const b=T(t,l+4);d=this._findFirstData(d,b);const p=t.readInt32LE(l+12);l+=16;const x=new Array(p);for(let h=0;h2**50&&(t=2**34),t-=1;let n=0,i=0,a=this.minShift+this.depth*3;const r=[];for(;n<=this.depth;a-=3,i+=ae(1,n*3),n+=1){const s=i+G(e,a),d=i+G(t,a);if(d-s+r.length>this.maxBinNumber)throw new Error(`query ${e}-${t} is too large for current binning scheme (shift ${this.minShift}, depth ${this.depth}), try a smaller query or a coarser index binning scheme`);r.push([s,d])}return r}}const $=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function oe(o){return new Promise(e=>setTimeout(e,o))}class me{constructor({path:e,filehandle:t,url:n,tbiPath:i,tbiUrl:a,tbiFilehandle:r,csiPath:s,csiUrl:d,csiFilehandle:l,yieldTime:u=500,renameRefSeqs:c=I=>I,chunkCacheSize:f=5*2**20}){if(t)this.filehandle=t;else if(e)this.filehandle=new B(e);else if(n)this.filehandle=new A(n);else throw new TypeError("must provide either filehandle or path");if(r)this.index=new k({filehandle:r,renameRefSeqs:c});else if(l)this.index=new M({filehandle:l,renameRefSeqs:c});else if(i)this.index=new k({filehandle:new B(i),renameRefSeqs:c});else if(s)this.index=new M({filehandle:new B(s),renameRefSeqs:c});else if(e)this.index=new k({filehandle:new B(`${e}.tbi`),renameRefSeqs:c});else if(d)this.index=new M({filehandle:new A(d)});else if(a)this.index=new k({filehandle:new A(a)});else if(n)this.index=new k({filehandle:new A(`${n}.tbi`)});else throw new TypeError("must provide one of tbiFilehandle, tbiPath, csiFilehandle, csiPath, tbiUrl, csiUrl");this.renameRefSeq=c,this.yieldTime=u,this.chunkCache=new J({cache:new K({maxSize:Math.floor(f/65536)}),fill:(I,w)=>this.readChunk(I,{signal:w})})}async getLines(e,t,n,i){var a;let r,s={},d;typeof i=="function"?d=i:(s=i,d=i.lineCallback,r=i.signal);const l=await this.index.getMetadata(s);L(r);const u=t??0,c=n??l.maxRefLength;if(!(u<=c))throw new TypeError("invalid start and end coordinates. start must be less than or equal to end");if(u===c)return;const f=await this.index.blocksForRange(e,u,c,s);L(r);let I=Date.now();for(const w of f){let m;const{buffer:b,cpositions:p,dpositions:x}=await this.chunkCache.get(w.toString(),w,r);L(r);let h=0,g=0;for(;h=x[g++];);g--}const{startCoordinate:v,overlaps:P}=this.checkLine(l,e,u,c,S);if(m!==void 0&&v!==void 0&&m>v)throw new Error(`Lines not sorted by start coordinate (${m} > ${v}), this file is not usable with Tabix.`);if(m=v,P)d(S.trim(),p[g]*256+(h-x[g])+w.minv.dataPosition+1);else if(v!==void 0&&v>=c)return;this.yieldTime&&I-Date.now()>this.yieldTime&&(I=Date.now(),L(r),await oe(1)),h=E+1}}}async getMetadata(e={}){return this.index.getMetadata(e)}async getHeaderBuffer(e={}){const{firstDataLine:t,metaChar:n,maxBlockSize:i}=await this.getMetadata(e);L(e.signal);const a=((t==null?void 0:t.blockPosition)||0)+i,r=await this._readRegion(0,a,e),s=await z(r);if(n){let d=-1;const l=10,u=n.charCodeAt(0);for(let c=0;c=i)return{startCoordinate:p,overlaps:!1};if((f===0||f===c)&&p+1<=n)return{startCoordinate:p,overlaps:!1}}else if(l==="VCF"&&w===4)b=a.slice(m,x);else if(w===f&&(l==="VCF"?this._getVcfEnd(p,b,a.slice(m,x)):parseInt(a.slice(m,x),10))<=n)return{overlaps:!1};if(m=x+1,w+=1,w>I)break}return{startCoordinate:p,overlaps:!0}}_getVcfEnd(e,t,n){let i=e+t.length;const a=n.includes("SVTYPE=TRA");if(n[0]!=="."&&!a){let r=";";for(let s=0;si.map(i=>d[i]); -var XY=Object.defineProperty;var r5=n=>{throw TypeError(n)};var QY=(n,e,t)=>e in n?XY(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var zi=(n,e,t)=>QY(n,typeof e!="symbol"?e+"":e,t),hk=(n,e,t)=>e.has(n)||r5("Cannot "+t);var X=(n,e,t)=>(hk(n,e,"read from private field"),t?t.call(n):e.get(n)),Oe=(n,e,t)=>e.has(n)?r5("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),ut=(n,e,t,i)=>(hk(n,e,"write to private field"),i?i.call(n,t):e.set(n,t),t),Le=(n,e,t)=>(hk(n,e,"access private method"),t);var a5=(n,e,t,i)=>({set _(s){ut(n,e,s,t)},get _(){return X(n,e,i)}});(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).observe(document,{childList:!0,subtree:!0});function t(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(s){if(s.ep)return;s.ep=!0;const o=t(s);fetch(s.href,o)}})();/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-CJAFAeH3.js","./_commonjsHelpers-C932wzq6.js","./index-ClLbYkVu.js","./__vite-browser-external-D80GqXp3.js","./long-eu6Hf4GH.js","./index-C8ZlFX0-.js","./remoteFile-_ulnNXZo.js","./index-BoBOlxMr.js","./index-D15XeWB2.js","./index-CRu-ZoZD.js","./index-N9VUB_9p.js","./index-5ps_llgo.js","./index-bwxybPiq.js"])))=>i.map(i=>d[i]); +var QY=Object.defineProperty;var n5=n=>{throw TypeError(n)};var JY=(n,e,t)=>e in n?QY(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Ei=(n,e,t)=>JY(n,typeof e!="symbol"?e+"":e,t),ok=(n,e,t)=>e.has(n)||n5("Cannot "+t);var X=(n,e,t)=>(ok(n,e,"read from private field"),t?t.call(n):e.get(n)),Pe=(n,e,t)=>e.has(n)?n5("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),dt=(n,e,t,i)=>(ok(n,e,"write to private field"),i?i.call(n,t):e.set(n,t),t),xe=(n,e,t)=>(ok(n,e,"access private method"),t);var s5=(n,e,t,i)=>({set _(s){dt(n,e,s,t)},get _(){return X(n,e,i)}});(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).observe(document,{childList:!0,subtree:!0});function t(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(s){if(s.ep)return;s.ep=!0;const o=t(s);fetch(s.href,o)}})();const eZ="modulepreload",tZ=function(n,e){return new URL(n,e).href},o5={},Zn=function(e,t,i){let s=Promise.resolve();if(t&&t.length>0){const r=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=Promise.allSettled(t.map(c=>{if(c=tZ(c,i),c in o5)return;o5[c]=!0;const d=c.endsWith(".css"),u=d?'[rel="stylesheet"]':"";if(!!i)for(let g=r.length-1;g>=0;g--){const p=r[g];if(p.href===c&&(!d||p.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${u}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":eZ,d||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),d)return new Promise((g,p)=>{f.addEventListener("load",g),f.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}function o(r){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=r,window.dispatchEvent(a),!a.defaultPrevented)throw r}return s.then(r=>{for(const a of r||[])a.status==="rejected"&&o(a.reason);return e().catch(o)})};/** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const Qw=globalThis,tM=Qw.ShadowRoot&&(Qw.ShadyCSS===void 0||Qw.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,QB=Symbol(),l5=new WeakMap;let JY=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==QB)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(tM&&e===void 0){const i=t!==void 0&&t.length===1;i&&(e=l5.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&l5.set(t,e))}return e}toString(){return this.cssText}};const eZ=n=>new JY(typeof n=="string"?n:n+"",void 0,QB),tZ=(n,e)=>{if(tM)n.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const i=document.createElement("style"),s=Qw.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=t.cssText,n.appendChild(i)}},c5=tM?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return eZ(t)})(n):n;/** + */const qw=globalThis,JR=qw.ShadowRoot&&(qw.ShadyCSS===void 0||qw.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,eM=Symbol(),r5=new WeakMap;let KB=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==eM)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(JR&&e===void 0){const i=t!==void 0&&t.length===1;i&&(e=r5.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&r5.set(t,e))}return e}toString(){return this.cssText}};const iZ=n=>new KB(typeof n=="string"?n:n+"",void 0,eM),nZ=(n,...e)=>{const t=n.length===1?n[0]:e.reduce((i,s,o)=>i+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+n[o+1],n[0]);return new KB(t,n,eM)},sZ=(n,e)=>{if(JR)n.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const i=document.createElement("style"),s=qw.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=t.cssText,n.appendChild(i)}},a5=JR?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return iZ(t)})(n):n;/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const{is:iZ,defineProperty:nZ,getOwnPropertyDescriptor:sZ,getOwnPropertyNames:oZ,getOwnPropertySymbols:rZ,getPrototypeOf:aZ}=Object,Sd=globalThis,d5=Sd.trustedTypes,lZ=d5?d5.emptyScript:"",fk=Sd.reactiveElementPolyfillSupport,C_=(n,e)=>n,AE={toAttribute(n,e){switch(e){case Boolean:n=n?lZ:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let t=n;switch(e){case Boolean:t=n!==null;break;case Number:t=n===null?null:Number(n);break;case Object:case Array:try{t=JSON.parse(n)}catch{t=null}}return t}},JB=(n,e)=>!iZ(n,e),u5={attribute:!0,type:String,converter:AE,reflect:!1,hasChanged:JB};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Sd.litPropertyMetadata??(Sd.litPropertyMetadata=new WeakMap);class Lg extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=u5){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(e,i,t);s!==void 0&&nZ(this.prototype,e,s)}}static getPropertyDescriptor(e,t,i){const{get:s,set:o}=sZ(this.prototype,e)??{get(){return this[t]},set(r){this[t]=r}};return{get(){return s==null?void 0:s.call(this)},set(r){const a=s==null?void 0:s.call(this);o.call(this,r),this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??u5}static _$Ei(){if(this.hasOwnProperty(C_("elementProperties")))return;const e=aZ(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(C_("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(C_("properties"))){const t=this.properties,i=[...oZ(t),...rZ(t)];for(const s of i)this.createProperty(s,t[s])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[i,s]of t)this.elementProperties.set(i,s)}this._$Eh=new Map;for(const[t,i]of this.elementProperties){const s=this._$Eu(t,i);s!==void 0&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const s of i)t.unshift(c5(s))}else e!==void 0&&t.push(c5(e));return t}static _$Eu(e,t){const i=t.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return tZ(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var i;return(i=t.hostConnected)==null?void 0:i.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var i;return(i=t.hostDisconnected)==null?void 0:i.call(t)})}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EC(e,t){var o;const i=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,i);if(s!==void 0&&i.reflect===!0){const r=(((o=i.converter)==null?void 0:o.toAttribute)!==void 0?i.converter:AE).toAttribute(t,i.type);this._$Em=e,r==null?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null}}_$AK(e,t){var o;const i=this.constructor,s=i._$Eh.get(e);if(s!==void 0&&this._$Em!==s){const r=i.getPropertyOptions(s),a=typeof r.converter=="function"?{fromAttribute:r.converter}:((o=r.converter)==null?void 0:o.fromAttribute)!==void 0?r.converter:AE;this._$Em=s,this[s]=a.fromAttribute(t,r.type),this._$Em=null}}requestUpdate(e,t,i){if(e!==void 0){if(i??(i=this.constructor.getPropertyOptions(e)),!(i.hasChanged??JB)(this[e],t))return;this.P(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,i){this._$AL.has(e)||this._$AL.set(e,t),i.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[o,r]of this._$Ep)this[o]=r;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[o,r]of s)r.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.P(o,this[o],r)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(i=this._$EO)==null||i.forEach(s=>{var o;return(o=s.hostUpdate)==null?void 0:o.call(s)}),this.update(t)):this._$EU()}catch(s){throw e=!1,this._$EU(),s}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(i=>{var s;return(s=i.hostUpdated)==null?void 0:s.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(t=>this._$EC(t,this[t]))),this._$EU()}updated(e){}firstUpdated(e){}}Lg.elementStyles=[],Lg.shadowRootOptions={mode:"open"},Lg[C_("elementProperties")]=new Map,Lg[C_("finalized")]=new Map,fk==null||fk({ReactiveElement:Lg}),(Sd.reactiveElementVersions??(Sd.reactiveElementVersions=[])).push("2.0.4");/** + */const{is:oZ,defineProperty:rZ,getOwnPropertyDescriptor:aZ,getOwnPropertyNames:lZ,getOwnPropertySymbols:cZ,getPrototypeOf:dZ}=Object,xd=globalThis,l5=xd.trustedTypes,uZ=l5?l5.emptyScript:"",rk=xd.reactiveElementPolyfillSupport,k_=(n,e)=>n,xE={toAttribute(n,e){switch(e){case Boolean:n=n?uZ:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let t=n;switch(e){case Boolean:t=n!==null;break;case Number:t=n===null?null:Number(n);break;case Object:case Array:try{t=JSON.parse(n)}catch{t=null}}return t}},YB=(n,e)=>!oZ(n,e),c5={attribute:!0,type:String,converter:xE,reflect:!1,hasChanged:YB};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),xd.litPropertyMetadata??(xd.litPropertyMetadata=new WeakMap);class Eg extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=c5){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(e,i,t);s!==void 0&&rZ(this.prototype,e,s)}}static getPropertyDescriptor(e,t,i){const{get:s,set:o}=aZ(this.prototype,e)??{get(){return this[t]},set(r){this[t]=r}};return{get(){return s==null?void 0:s.call(this)},set(r){const a=s==null?void 0:s.call(this);o.call(this,r),this.requestUpdate(e,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??c5}static _$Ei(){if(this.hasOwnProperty(k_("elementProperties")))return;const e=dZ(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(k_("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(k_("properties"))){const t=this.properties,i=[...lZ(t),...cZ(t)];for(const s of i)this.createProperty(s,t[s])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[i,s]of t)this.elementProperties.set(i,s)}this._$Eh=new Map;for(const[t,i]of this.elementProperties){const s=this._$Eu(t,i);s!==void 0&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const s of i)t.unshift(a5(s))}else e!==void 0&&t.push(a5(e));return t}static _$Eu(e,t){const i=t.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const i of t.keys())this.hasOwnProperty(i)&&(e.set(i,this[i]),delete this[i]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return sZ(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var i;return(i=t.hostConnected)==null?void 0:i.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var i;return(i=t.hostDisconnected)==null?void 0:i.call(t)})}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$EC(e,t){var o;const i=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,i);if(s!==void 0&&i.reflect===!0){const r=(((o=i.converter)==null?void 0:o.toAttribute)!==void 0?i.converter:xE).toAttribute(t,i.type);this._$Em=e,r==null?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null}}_$AK(e,t){var o;const i=this.constructor,s=i._$Eh.get(e);if(s!==void 0&&this._$Em!==s){const r=i.getPropertyOptions(s),a=typeof r.converter=="function"?{fromAttribute:r.converter}:((o=r.converter)==null?void 0:o.fromAttribute)!==void 0?r.converter:xE;this._$Em=s,this[s]=a.fromAttribute(t,r.type),this._$Em=null}}requestUpdate(e,t,i){if(e!==void 0){if(i??(i=this.constructor.getPropertyOptions(e)),!(i.hasChanged??YB)(this[e],t))return;this.P(e,t,i)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,i){this._$AL.has(e)||this._$AL.set(e,t),i.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[o,r]of this._$Ep)this[o]=r;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[o,r]of s)r.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.P(o,this[o],r)}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(i=this._$EO)==null||i.forEach(s=>{var o;return(o=s.hostUpdate)==null?void 0:o.call(s)}),this.update(t)):this._$EU()}catch(s){throw e=!1,this._$EU(),s}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(i=>{var s;return(s=i.hostUpdated)==null?void 0:s.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(t=>this._$EC(t,this[t]))),this._$EU()}updated(e){}firstUpdated(e){}}Eg.elementStyles=[],Eg.shadowRootOptions={mode:"open"},Eg[k_("elementProperties")]=new Map,Eg[k_("finalized")]=new Map,rk==null||rk({ReactiveElement:Eg}),(xd.reactiveElementVersions??(xd.reactiveElementVersions=[])).push("2.0.4");/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const S_=globalThis,$C=S_.trustedTypes,h5=$C?$C.createPolicy("lit-html",{createHTML:n=>n}):void 0,eW="$lit$",Zc=`lit$${Math.random().toFixed(9).slice(2)}$`,tW="?"+Zc,cZ=`<${tW}>`,rf=document,tb=()=>rf.createComment(""),ib=n=>n===null||typeof n!="object"&&typeof n!="function",iW=Array.isArray,dZ=n=>iW(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",gk=`[ -\f\r]`,g0=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,f5=/-->/g,g5=/>/g,Vu=RegExp(`>|${gk}(?:([^\\s"'>=/]+)(${gk}*=${gk}*(?:[^ -\f\r"'\`<>=]|("|')|))|$)`,"g"),p5=/'/g,m5=/"/g,nW=/^(?:script|style|textarea|title)$/i,uZ=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),It=uZ(1),af=Symbol.for("lit-noChange"),$i=Symbol.for("lit-nothing"),_5=new WeakMap,bh=rf.createTreeWalker(rf,129);function sW(n,e){if(!Array.isArray(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return h5!==void 0?h5.createHTML(e):e}const hZ=(n,e)=>{const t=n.length-1,i=[];let s,o=e===2?"":"",r=g0;for(let a=0;a"?(r=s??g0,u=-1):d[1]===void 0?u=-2:(u=r.lastIndex-d[2].length,c=d[1],r=d[3]===void 0?Vu:d[3]==='"'?m5:p5):r===m5||r===p5?r=Vu:r===f5||r===g5?r=g0:(r=Vu,s=void 0);const f=r===Vu&&n[a+1].startsWith("/>")?" ":"";o+=r===g0?l+cZ:u>=0?(i.push(c),l.slice(0,u)+eW+l.slice(u)+Zc+f):l+Zc+(u===-2?a:f)}return[sW(n,o+(n[t]||"")+(e===2?"":"")),i]};class nb{constructor({strings:e,_$litType$:t},i){let s;this.parts=[];let o=0,r=0;const a=e.length-1,l=this.parts,[c,d]=hZ(e,t);if(this.el=nb.createElement(c,i),bh.currentNode=this.el.content,t===2){const u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(s=bh.nextNode())!==null&&l.length0){s.textContent=$C?$C.emptyScript:"";for(let f=0;f2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=$i}_$AI(e,t=this,i,s){const o=this.strings;let r=!1;if(o===void 0)e=Xp(this,e,t,0),r=!ib(e)||e!==this._$AH&&e!==af,r&&(this._$AH=e);else{const a=e;let l,c;for(e=o[0],l=0;l{const i=(t==null?void 0:t.renderBefore)??e;let s=i._$litPart$;if(s===void 0){const o=(t==null?void 0:t.renderBefore)??null;i._$litPart$=s=new d1(e.insertBefore(tb(),o),o,void 0,t??{})}return s._$AI(n),s};/** + */const E_=globalThis,FC=E_.trustedTypes,d5=FC?FC.createPolicy("lit-html",{createHTML:n=>n}):void 0,ZB="$lit$",Zc=`lit$${Math.random().toFixed(9).slice(2)}$`,XB="?"+Zc,hZ=`<${XB}>`,cf=document,rb=()=>cf.createComment(""),ab=n=>n===null||typeof n!="object"&&typeof n!="function",tM=Array.isArray,fZ=n=>tM(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",ak=`[ +\f\r]`,b0=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,u5=/-->/g,h5=/>/g,zu=RegExp(`>|${ak}(?:([^\\s"'>=/]+)(${ak}*=${ak}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),f5=/'/g,g5=/"/g,QB=/^(?:script|style|textarea|title)$/i,gZ=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),Lt=gZ(1),df=Symbol.for("lit-noChange"),zi=Symbol.for("lit-nothing"),p5=new WeakMap,yh=cf.createTreeWalker(cf,129);function JB(n,e){if(!tM(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return d5!==void 0?d5.createHTML(e):e}const pZ=(n,e)=>{const t=n.length-1,i=[];let s,o=e===2?"":e===3?"":"",r=b0;for(let a=0;a"?(r=s??b0,u=-1):d[1]===void 0?u=-2:(u=r.lastIndex-d[2].length,c=d[1],r=d[3]===void 0?zu:d[3]==='"'?g5:f5):r===g5||r===f5?r=zu:r===u5||r===h5?r=b0:(r=zu,s=void 0);const f=r===zu&&n[a+1].startsWith("/>")?" ":"";o+=r===b0?l+hZ:u>=0?(i.push(c),l.slice(0,u)+ZB+l.slice(u)+Zc+f):l+Zc+(u===-2?a:f)}return[JB(n,o+(n[t]||"")+(e===2?"":e===3?"":"")),i]};class lb{constructor({strings:e,_$litType$:t},i){let s;this.parts=[];let o=0,r=0;const a=e.length-1,l=this.parts,[c,d]=pZ(e,t);if(this.el=lb.createElement(c,i),yh.currentNode=this.el.content,t===2||t===3){const u=this.el.content.firstChild;u.replaceWith(...u.childNodes)}for(;(s=yh.nextNode())!==null&&l.length0){s.textContent=FC?FC.emptyScript:"";for(let f=0;f2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=zi}_$AI(e,t=this,i,s){const o=this.strings;let r=!1;if(o===void 0)e=Jp(this,e,t,0),r=!ab(e)||e!==this._$AH&&e!==df,r&&(this._$AH=e);else{const a=e;let l,c;for(e=o[0],l=0;l{const i=(t==null?void 0:t.renderBefore)??e;let s=i._$litPart$;if(s===void 0){const o=(t==null?void 0:t.renderBefore)??null;i._$litPart$=s=new f1(e.insertBefore(rb(),o),o,void 0,t??{})}return s._$AI(n),s};/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */let rp=class extends Lg{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Qp(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return af}};var ZB;rp._$litElement$=!0,rp.finalized=!0,(ZB=globalThis.litElementHydrateSupport)==null||ZB.call(globalThis,{LitElement:rp});const mk=globalThis.litElementPolyfillSupport;mk==null||mk({LitElement:rp});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.5");/** + */let zh=class extends Eg{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=em(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return df}};var qB;zh._$litElement$=!0,zh.finalized=!0,(qB=globalThis.litElementHydrateSupport)==null||qB.call(globalThis,{LitElement:zh});const ck=globalThis.litElementPolyfillSupport;ck==null||ck({LitElement:zh});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.1");/** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const bZ=n=>n.strings===void 0;/** + */const wZ=n=>n.strings===void 0;/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const oW={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},rW=n=>(...e)=>({_$litDirective$:n,values:e});let aW=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};/** + */const eW={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},tW=n=>(...e)=>({_$litDirective$:n,values:e});let iW=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const x_=(n,e)=>{var i;const t=n._$AN;if(t===void 0)return!1;for(const s of t)(i=s._$AO)==null||i.call(s,e,!1),x_(s,e);return!0},UC=n=>{let e,t;do{if((e=n._$AM)===void 0)break;t=e._$AN,t.delete(n),n=e}while((t==null?void 0:t.size)===0)},lW=n=>{for(let e;e=n._$AM;n=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(n))break;t.add(n),wZ(e)}};function vZ(n){this._$AN!==void 0?(UC(this),this._$AM=n,lW(this)):this._$AM=n}function yZ(n,e=!1,t=0){const i=this._$AH,s=this._$AN;if(s!==void 0&&s.size!==0)if(e)if(Array.isArray(i))for(let o=t;o{n.type==oW.CHILD&&(n._$AP??(n._$AP=yZ),n._$AQ??(n._$AQ=vZ))};class CZ extends aW{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,i){super._$AT(e,t,i),lW(this),this.isConnected=e._$AU}_$AO(e,t=!0){var i,s;e!==this.isConnected&&(this.isConnected=e,e?(i=this.reconnected)==null||i.call(this):(s=this.disconnected)==null||s.call(this)),t&&(x_(this,e),UC(this))}setValue(e){if(bZ(this._$Ct))this._$Ct._$AI(e,this);else{const t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}}/** + */const A_=(n,e)=>{var i;const t=n._$AN;if(t===void 0)return!1;for(const s of t)(i=s._$AO)==null||i.call(s,e,!1),A_(s,e);return!0},BC=n=>{let e,t;do{if((e=n._$AM)===void 0)break;t=e._$AN,t.delete(n),n=e}while((t==null?void 0:t.size)===0)},nW=n=>{for(let e;e=n._$AM;n=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(n))break;t.add(n),xZ(e)}};function CZ(n){this._$AN!==void 0?(BC(this),this._$AM=n,nW(this)):this._$AM=n}function SZ(n,e=!1,t=0){const i=this._$AH,s=this._$AN;if(s!==void 0&&s.size!==0)if(e)if(Array.isArray(i))for(let o=t;o{n.type==eW.CHILD&&(n._$AP??(n._$AP=SZ),n._$AQ??(n._$AQ=CZ))};class LZ extends iW{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,i){super._$AT(e,t,i),nW(this),this.isConnected=e._$AU}_$AO(e,t=!0){var i,s;e!==this.isConnected&&(this.isConnected=e,e?(i=this.reconnected)==null||i.call(this):(s=this.disconnected)==null||s.call(this)),t&&(A_(this,e),BC(this))}setValue(e){if(wZ(this._$Ct))this._$Ct._$AI(e,this);else{const t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}}/** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const cW=()=>new SZ;let SZ=class{};const _k=new WeakMap,b5=rW(class extends CZ{render(n){return $i}update(n,[e]){var i;const t=e!==this.Y;return t&&this.Y!==void 0&&this.rt(void 0),(t||this.lt!==this.ct)&&(this.Y=e,this.ht=(i=n.options)==null?void 0:i.host,this.rt(this.ct=n.element)),$i}rt(n){if(typeof this.Y=="function"){const e=this.ht??globalThis;let t=_k.get(e);t===void 0&&(t=new WeakMap,_k.set(e,t)),t.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),t.set(this.Y,n),n!==void 0&&this.Y.call(this.ht,n)}else this.Y.value=n}get lt(){var n,e;return typeof this.Y=="function"?(n=_k.get(this.ht??globalThis))==null?void 0:n.get(this.Y):(e=this.Y)==null?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});function v5(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,i)}return t}function Me(n){for(var e=1;en.length)&&(e=n.length);for(var t=0,i=new Array(e);t-1;s--){var o=t[s],r=(o.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(r)>-1&&(i=o)}return Bi.head.insertBefore(e,i),n}}var YZ="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function lb(){for(var n=12,e="";n-- >0;)e+=YZ[Math.random()*62|0];return e}function jm(n){for(var e=[],t=(n||[]).length>>>0;t--;)e[t]=n[t];return e}function aM(n){return n.classList?jm(n.classList):(n.getAttribute("class")||"").split(" ").filter(function(e){return e})}function wW(n){return"".concat(n).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function ZZ(n){return Object.keys(n||{}).reduce(function(e,t){return e+"".concat(t,'="').concat(wW(n[t]),'" ')},"").trim()}function Xx(n){return Object.keys(n||{}).reduce(function(e,t){return e+"".concat(t,": ").concat(n[t].trim(),";")},"")}function lM(n){return n.size!==Fa.size||n.x!==Fa.x||n.y!==Fa.y||n.rotate!==Fa.rotate||n.flipX||n.flipY}function XZ(n){var e=n.transform,t=n.containerWidth,i=n.iconWidth,s={transform:"translate(".concat(t/2," 256)")},o="translate(".concat(e.x*32,", ").concat(e.y*32,") "),r="scale(".concat(e.size/16*(e.flipX?-1:1),", ").concat(e.size/16*(e.flipY?-1:1),") "),a="rotate(".concat(e.rotate," 0 0)"),l={transform:"".concat(o," ").concat(r," ").concat(a)},c={transform:"translate(".concat(i/2*-1," -256)")};return{outer:s,inner:l,path:c}}function QZ(n){var e=n.transform,t=n.width,i=t===void 0?TE:t,s=n.height,o=s===void 0?TE:s,r=n.startCentered,a=r===void 0?!1:r,l="";return a&&gW?l+="translate(".concat(e.x/Tc-i/2,"em, ").concat(e.y/Tc-o/2,"em) "):a?l+="translate(calc(-50% + ".concat(e.x/Tc,"em), calc(-50% + ").concat(e.y/Tc,"em)) "):l+="translate(".concat(e.x/Tc,"em, ").concat(e.y/Tc,"em) "),l+="scale(".concat(e.size/Tc*(e.flipX?-1:1),", ").concat(e.size/Tc*(e.flipY?-1:1),") "),l+="rotate(".concat(e.rotate,"deg) "),l}var JZ=`:root, :host { - --fa-font-solid: normal 900 1em/1 "Font Awesome 6 Solid"; - --fa-font-regular: normal 400 1em/1 "Font Awesome 6 Regular"; - --fa-font-light: normal 300 1em/1 "Font Awesome 6 Light"; - --fa-font-thin: normal 100 1em/1 "Font Awesome 6 Thin"; + */const sW=()=>new DZ;let DZ=class{};const dk=new WeakMap,m5=tW(class extends LZ{render(n){return zi}update(n,[e]){var i;const t=e!==this.Y;return t&&this.Y!==void 0&&this.rt(void 0),(t||this.lt!==this.ct)&&(this.Y=e,this.ht=(i=n.options)==null?void 0:i.host,this.rt(this.ct=n.element)),zi}rt(n){if(this.isConnected||(n=void 0),typeof this.Y=="function"){const e=this.ht??globalThis;let t=dk.get(e);t===void 0&&(t=new WeakMap,dk.set(e,t)),t.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),t.set(this.Y,n),n!==void 0&&this.Y.call(this.ht,n)}else this.Y.value=n}get lt(){var n,e;return typeof this.Y=="function"?(n=dk.get(this.ht??globalThis))==null?void 0:n.get(this.Y):(e=this.Y)==null?void 0:e.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),_5=()=>{};let iM={},oW={},rW=null,aW={mark:_5,measure:_5};try{typeof window<"u"&&(iM=window),typeof document<"u"&&(oW=document),typeof MutationObserver<"u"&&(rW=MutationObserver),typeof performance<"u"&&(aW=performance)}catch{}const{userAgent:b5=""}=iM.navigator||{},zd=iM,Fi=oW,v5=rW,Sy=aW;zd.document;const vc=!!Fi.documentElement&&!!Fi.head&&typeof Fi.addEventListener=="function"&&typeof Fi.createElement=="function",lW=~b5.indexOf("MSIE")||~b5.indexOf("Trident/");var $i="classic",cW="duotone",Bo="sharp",Wo="sharp-duotone",kZ=[$i,cW,Bo,Wo],EZ={classic:{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},sharp:{900:"fass",400:"fasr",300:"fasl",100:"fast"},"sharp-duotone":{900:"fasds"}},y5={kit:{fak:"kit","fa-kit":"kit"},"kit-duotone":{fakd:"kit-duotone","fa-kit-duotone":"kit-duotone"}},AZ=["kit"],IZ=/fa(s|r|l|t|d|b|k|kd|ss|sr|sl|st|sds)?[\-\ ]/,TZ=/Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp Duotone|Sharp|Kit)?.*/i,NZ={"Font Awesome 5 Free":{900:"fas",400:"far"},"Font Awesome 5 Pro":{900:"fas",400:"far",normal:"far",300:"fal"},"Font Awesome 5 Brands":{400:"fab",normal:"fab"},"Font Awesome 5 Duotone":{900:"fad"}},RZ={"Font Awesome 6 Free":{900:"fas",400:"far"},"Font Awesome 6 Pro":{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},"Font Awesome 6 Brands":{400:"fab",normal:"fab"},"Font Awesome 6 Duotone":{900:"fad"},"Font Awesome 6 Sharp":{900:"fass",400:"fasr",normal:"fasr",300:"fasl",100:"fast"},"Font Awesome 6 Sharp Duotone":{900:"fasds"}},MZ={classic:{"fa-brands":"fab","fa-duotone":"fad","fa-light":"fal","fa-regular":"far","fa-solid":"fas","fa-thin":"fat"},sharp:{"fa-solid":"fass","fa-regular":"fasr","fa-light":"fasl","fa-thin":"fast"},"sharp-duotone":{"fa-solid":"fasds"}},PZ={classic:["fas","far","fal","fat"],sharp:["fass","fasr","fasl","fast"],"sharp-duotone":["fasds"]},OZ={classic:{fab:"fa-brands",fad:"fa-duotone",fal:"fa-light",far:"fa-regular",fas:"fa-solid",fat:"fa-thin"},sharp:{fass:"fa-solid",fasr:"fa-regular",fasl:"fa-light",fast:"fa-thin"},"sharp-duotone":{fasds:"fa-solid"}},FZ={classic:{solid:"fas",regular:"far",light:"fal",thin:"fat",duotone:"fad",brands:"fab"},sharp:{solid:"fass",regular:"fasr",light:"fasl",thin:"fast"},"sharp-duotone":{solid:"fasds"}},dW={classic:{fa:"solid",fas:"solid","fa-solid":"solid",far:"regular","fa-regular":"regular",fal:"light","fa-light":"light",fat:"thin","fa-thin":"thin",fad:"duotone","fa-duotone":"duotone",fab:"brands","fa-brands":"brands"},sharp:{fa:"solid",fass:"solid","fa-solid":"solid",fasr:"regular","fa-regular":"regular",fasl:"light","fa-light":"light",fast:"thin","fa-thin":"thin"},"sharp-duotone":{fa:"solid",fasds:"solid","fa-solid":"solid"}},BZ=["solid","regular","light","thin","duotone","brands"],uW=[1,2,3,4,5,6,7,8,9,10],WZ=uW.concat([11,12,13,14,15,16,17,18,19,20]),Q0={GROUP:"duotone-group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},VZ=[...Object.keys(PZ),...BZ,"2xs","xs","sm","lg","xl","2xl","beat","border","fade","beat-fade","bounce","flip-both","flip-horizontal","flip-vertical","flip","fw","inverse","layers-counter","layers-text","layers","li","pull-left","pull-right","pulse","rotate-180","rotate-270","rotate-90","rotate-by","shake","spin-pulse","spin-reverse","spin","stack-1x","stack-2x","stack","ul",Q0.GROUP,Q0.SWAP_OPACITY,Q0.PRIMARY,Q0.SECONDARY].concat(uW.map(n=>"".concat(n,"x"))).concat(WZ.map(n=>"w-".concat(n))),zZ={"Font Awesome Kit":{400:"fak",normal:"fak"},"Font Awesome Kit Duotone":{400:"fakd",normal:"fakd"}},HZ={kit:{"fa-kit":"fak"},"kit-duotone":{"fa-kit-duotone":"fakd"}},$Z={kit:{fak:"fa-kit"},"kit-duotone":{fakd:"fa-kit-duotone"}},w5={kit:{kit:"fak"},"kit-duotone":{"kit-duotone":"fakd"}};const hc="___FONT_AWESOME___",LE=16,hW="fa",fW="svg-inline--fa",uf="data-fa-i2svg",DE="data-fa-pseudo-element",UZ="data-fa-pseudo-element-pending",nM="data-prefix",sM="data-icon",C5="fontawesome-i2svg",jZ="async",qZ=["HTML","HEAD","STYLE","SCRIPT"],gW=(()=>{try{return!0}catch{return!1}})(),pW=[$i,Bo,Wo];function g1(n){return new Proxy(n,{get(e,t){return t in e?e[t]:e[$i]}})}const mW={...dW};mW[$i]={...dW[$i],...y5.kit,...y5["kit-duotone"]};const Hh=g1(mW),kE={...FZ};kE[$i]={...kE[$i],...w5.kit,...w5["kit-duotone"]};const cb=g1(kE),EE={...OZ};EE[$i]={...EE[$i],...$Z.kit};const $h=g1(EE),AE={...MZ};AE[$i]={...AE[$i],...HZ.kit};const GZ=g1(AE),KZ=IZ,_W="fa-layers-text",YZ=TZ,ZZ={...EZ};g1(ZZ);const XZ=["class","data-prefix","data-icon","data-fa-transform","data-fa-mask"],uk=Q0,tm=new Set;Object.keys(cb[$i]).map(tm.add.bind(tm));Object.keys(cb[Bo]).map(tm.add.bind(tm));Object.keys(cb[Wo]).map(tm.add.bind(tm));const QZ=[...AZ,...VZ],I_=zd.FontAwesomeConfig||{};function JZ(n){var e=Fi.querySelector("script["+n+"]");if(e)return e.getAttribute(n)}function eX(n){return n===""?!0:n==="false"?!1:n==="true"?!0:n}Fi&&typeof Fi.querySelector=="function"&&[["data-family-prefix","familyPrefix"],["data-css-prefix","cssPrefix"],["data-family-default","familyDefault"],["data-style-default","styleDefault"],["data-replacement-class","replacementClass"],["data-auto-replace-svg","autoReplaceSvg"],["data-auto-add-css","autoAddCss"],["data-auto-a11y","autoA11y"],["data-search-pseudo-elements","searchPseudoElements"],["data-observe-mutations","observeMutations"],["data-mutate-approach","mutateApproach"],["data-keep-original-source","keepOriginalSource"],["data-measure-performance","measurePerformance"],["data-show-missing-icons","showMissingIcons"]].forEach(e=>{let[t,i]=e;const s=eX(JZ(t));s!=null&&(I_[i]=s)});const bW={styleDefault:"solid",familyDefault:"classic",cssPrefix:hW,replacementClass:fW,autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0};I_.familyPrefix&&(I_.cssPrefix=I_.familyPrefix);const im={...bW,...I_};im.autoReplaceSvg||(im.observeMutations=!1);const Be={};Object.keys(bW).forEach(n=>{Object.defineProperty(Be,n,{enumerable:!0,set:function(e){im[n]=e,T_.forEach(t=>t(Be))},get:function(){return im[n]}})});Object.defineProperty(Be,"familyPrefix",{enumerable:!0,set:function(n){im.cssPrefix=n,T_.forEach(e=>e(Be))},get:function(){return im.cssPrefix}});zd.FontAwesomeConfig=Be;const T_=[];function tX(n){return T_.push(n),()=>{T_.splice(T_.indexOf(n),1)}}const Tc=LE,Pa={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function iX(n){if(!n||!vc)return;const e=Fi.createElement("style");e.setAttribute("type","text/css"),e.innerHTML=n;const t=Fi.head.childNodes;let i=null;for(let s=t.length-1;s>-1;s--){const o=t[s],r=(o.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(r)>-1&&(i=o)}return Fi.head.insertBefore(e,i),n}const nX="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function db(){let n=12,e="";for(;n-- >0;)e+=nX[Math.random()*62|0];return e}function Ym(n){const e=[];for(let t=(n||[]).length>>>0;t--;)e[t]=n[t];return e}function oM(n){return n.classList?Ym(n.classList):(n.getAttribute("class")||"").split(" ").filter(e=>e)}function vW(n){return"".concat(n).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function sX(n){return Object.keys(n||{}).reduce((e,t)=>e+"".concat(t,'="').concat(vW(n[t]),'" '),"").trim()}function Ux(n){return Object.keys(n||{}).reduce((e,t)=>e+"".concat(t,": ").concat(n[t].trim(),";"),"")}function rM(n){return n.size!==Pa.size||n.x!==Pa.x||n.y!==Pa.y||n.rotate!==Pa.rotate||n.flipX||n.flipY}function oX(n){let{transform:e,containerWidth:t,iconWidth:i}=n;const s={transform:"translate(".concat(t/2," 256)")},o="translate(".concat(e.x*32,", ").concat(e.y*32,") "),r="scale(".concat(e.size/16*(e.flipX?-1:1),", ").concat(e.size/16*(e.flipY?-1:1),") "),a="rotate(".concat(e.rotate," 0 0)"),l={transform:"".concat(o," ").concat(r," ").concat(a)},c={transform:"translate(".concat(i/2*-1," -256)")};return{outer:s,inner:l,path:c}}function rX(n){let{transform:e,width:t=LE,height:i=LE,startCentered:s=!1}=n,o="";return s&&lW?o+="translate(".concat(e.x/Tc-t/2,"em, ").concat(e.y/Tc-i/2,"em) "):s?o+="translate(calc(-50% + ".concat(e.x/Tc,"em), calc(-50% + ").concat(e.y/Tc,"em)) "):o+="translate(".concat(e.x/Tc,"em, ").concat(e.y/Tc,"em) "),o+="scale(".concat(e.size/Tc*(e.flipX?-1:1),", ").concat(e.size/Tc*(e.flipY?-1:1),") "),o+="rotate(".concat(e.rotate,"deg) "),o}var aX=`:root, :host { + --fa-font-solid: normal 900 1em/1 "Font Awesome 6 Free"; + --fa-font-regular: normal 400 1em/1 "Font Awesome 6 Free"; + --fa-font-light: normal 300 1em/1 "Font Awesome 6 Pro"; + --fa-font-thin: normal 100 1em/1 "Font Awesome 6 Pro"; --fa-font-duotone: normal 900 1em/1 "Font Awesome 6 Duotone"; + --fa-font-brands: normal 400 1em/1 "Font Awesome 6 Brands"; --fa-font-sharp-solid: normal 900 1em/1 "Font Awesome 6 Sharp"; --fa-font-sharp-regular: normal 400 1em/1 "Font Awesome 6 Sharp"; --fa-font-sharp-light: normal 300 1em/1 "Font Awesome 6 Sharp"; --fa-font-sharp-thin: normal 100 1em/1 "Font Awesome 6 Sharp"; - --fa-font-brands: normal 400 1em/1 "Font Awesome 6 Brands"; + --fa-font-sharp-duotone-solid: normal 900 1em/1 "Font Awesome 6 Sharp Duotone"; } svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa { @@ -117,17 +116,14 @@ svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa { width: 1em; } .fa-layers svg.svg-inline--fa { - -webkit-transform-origin: center center; - transform-origin: center center; + transform-origin: center center; } .fa-layers-text { left: 50%; top: 50%; - -webkit-transform: translate(-50%, -50%); - transform: translate(-50%, -50%); - -webkit-transform-origin: center center; - transform-origin: center center; + transform: translate(-50%, -50%); + transform-origin: center center; } .fa-layers-counter { @@ -143,20 +139,16 @@ svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa { right: var(--fa-right, 0); text-overflow: ellipsis; top: var(--fa-top, 0); - -webkit-transform: scale(var(--fa-counter-scale, 0.25)); - transform: scale(var(--fa-counter-scale, 0.25)); - -webkit-transform-origin: top right; - transform-origin: top right; + transform: scale(var(--fa-counter-scale, 0.25)); + transform-origin: top right; } .fa-layers-bottom-right { bottom: var(--fa-bottom, 0); right: var(--fa-right, 0); top: auto; - -webkit-transform: scale(var(--fa-layers-scale, 0.25)); - transform: scale(var(--fa-layers-scale, 0.25)); - -webkit-transform-origin: bottom right; - transform-origin: bottom right; + transform: scale(var(--fa-layers-scale, 0.25)); + transform-origin: bottom right; } .fa-layers-bottom-left { @@ -164,29 +156,23 @@ svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa { left: var(--fa-left, 0); right: auto; top: auto; - -webkit-transform: scale(var(--fa-layers-scale, 0.25)); - transform: scale(var(--fa-layers-scale, 0.25)); - -webkit-transform-origin: bottom left; - transform-origin: bottom left; + transform: scale(var(--fa-layers-scale, 0.25)); + transform-origin: bottom left; } .fa-layers-top-right { top: var(--fa-top, 0); right: var(--fa-right, 0); - -webkit-transform: scale(var(--fa-layers-scale, 0.25)); - transform: scale(var(--fa-layers-scale, 0.25)); - -webkit-transform-origin: top right; - transform-origin: top right; + transform: scale(var(--fa-layers-scale, 0.25)); + transform-origin: top right; } .fa-layers-top-left { left: var(--fa-left, 0); right: auto; top: var(--fa-top, 0); - -webkit-transform: scale(var(--fa-layers-scale, 0.25)); - transform: scale(var(--fa-layers-scale, 0.25)); - -webkit-transform-origin: top left; - transform-origin: top left; + transform: scale(var(--fa-layers-scale, 0.25)); + transform-origin: top left; } .fa-1x { @@ -280,7 +266,7 @@ svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa { } .fa-li { - left: calc(var(--fa-li-width, 2em) * -1); + left: calc(-1 * var(--fa-li-width, 2em)); position: absolute; text-align: center; width: var(--fa-li-width, 2em); @@ -306,108 +292,66 @@ svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa { } .fa-beat { - -webkit-animation-name: fa-beat; - animation-name: fa-beat; - -webkit-animation-delay: var(--fa-animation-delay, 0s); - animation-delay: var(--fa-animation-delay, 0s); - -webkit-animation-direction: var(--fa-animation-direction, normal); - animation-direction: var(--fa-animation-direction, normal); - -webkit-animation-duration: var(--fa-animation-duration, 1s); - animation-duration: var(--fa-animation-duration, 1s); - -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); - animation-iteration-count: var(--fa-animation-iteration-count, infinite); - -webkit-animation-timing-function: var(--fa-animation-timing, ease-in-out); - animation-timing-function: var(--fa-animation-timing, ease-in-out); + animation-name: fa-beat; + animation-delay: var(--fa-animation-delay, 0s); + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 1s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, ease-in-out); } .fa-bounce { - -webkit-animation-name: fa-bounce; - animation-name: fa-bounce; - -webkit-animation-delay: var(--fa-animation-delay, 0s); - animation-delay: var(--fa-animation-delay, 0s); - -webkit-animation-direction: var(--fa-animation-direction, normal); - animation-direction: var(--fa-animation-direction, normal); - -webkit-animation-duration: var(--fa-animation-duration, 1s); - animation-duration: var(--fa-animation-duration, 1s); - -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); - animation-iteration-count: var(--fa-animation-iteration-count, infinite); - -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1)); - animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1)); + animation-name: fa-bounce; + animation-delay: var(--fa-animation-delay, 0s); + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 1s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1)); } .fa-fade { - -webkit-animation-name: fa-fade; - animation-name: fa-fade; - -webkit-animation-delay: var(--fa-animation-delay, 0s); - animation-delay: var(--fa-animation-delay, 0s); - -webkit-animation-direction: var(--fa-animation-direction, normal); - animation-direction: var(--fa-animation-direction, normal); - -webkit-animation-duration: var(--fa-animation-duration, 1s); - animation-duration: var(--fa-animation-duration, 1s); - -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); - animation-iteration-count: var(--fa-animation-iteration-count, infinite); - -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); - animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); + animation-name: fa-fade; + animation-delay: var(--fa-animation-delay, 0s); + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 1s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); } .fa-beat-fade { - -webkit-animation-name: fa-beat-fade; - animation-name: fa-beat-fade; - -webkit-animation-delay: var(--fa-animation-delay, 0s); - animation-delay: var(--fa-animation-delay, 0s); - -webkit-animation-direction: var(--fa-animation-direction, normal); - animation-direction: var(--fa-animation-direction, normal); - -webkit-animation-duration: var(--fa-animation-duration, 1s); - animation-duration: var(--fa-animation-duration, 1s); - -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); - animation-iteration-count: var(--fa-animation-iteration-count, infinite); - -webkit-animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); - animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); + animation-name: fa-beat-fade; + animation-delay: var(--fa-animation-delay, 0s); + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 1s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); } .fa-flip { - -webkit-animation-name: fa-flip; - animation-name: fa-flip; - -webkit-animation-delay: var(--fa-animation-delay, 0s); - animation-delay: var(--fa-animation-delay, 0s); - -webkit-animation-direction: var(--fa-animation-direction, normal); - animation-direction: var(--fa-animation-direction, normal); - -webkit-animation-duration: var(--fa-animation-duration, 1s); - animation-duration: var(--fa-animation-duration, 1s); - -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); - animation-iteration-count: var(--fa-animation-iteration-count, infinite); - -webkit-animation-timing-function: var(--fa-animation-timing, ease-in-out); - animation-timing-function: var(--fa-animation-timing, ease-in-out); + animation-name: fa-flip; + animation-delay: var(--fa-animation-delay, 0s); + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 1s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, ease-in-out); } .fa-shake { - -webkit-animation-name: fa-shake; - animation-name: fa-shake; - -webkit-animation-delay: var(--fa-animation-delay, 0s); - animation-delay: var(--fa-animation-delay, 0s); - -webkit-animation-direction: var(--fa-animation-direction, normal); - animation-direction: var(--fa-animation-direction, normal); - -webkit-animation-duration: var(--fa-animation-duration, 1s); - animation-duration: var(--fa-animation-duration, 1s); - -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); - animation-iteration-count: var(--fa-animation-iteration-count, infinite); - -webkit-animation-timing-function: var(--fa-animation-timing, linear); - animation-timing-function: var(--fa-animation-timing, linear); + animation-name: fa-shake; + animation-delay: var(--fa-animation-delay, 0s); + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 1s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, linear); } .fa-spin { - -webkit-animation-name: fa-spin; - animation-name: fa-spin; - -webkit-animation-delay: var(--fa-animation-delay, 0s); - animation-delay: var(--fa-animation-delay, 0s); - -webkit-animation-direction: var(--fa-animation-direction, normal); - animation-direction: var(--fa-animation-direction, normal); - -webkit-animation-duration: var(--fa-animation-duration, 2s); - animation-duration: var(--fa-animation-duration, 2s); - -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); - animation-iteration-count: var(--fa-animation-iteration-count, infinite); - -webkit-animation-timing-function: var(--fa-animation-timing, linear); - animation-timing-function: var(--fa-animation-timing, linear); + animation-name: fa-spin; + animation-delay: var(--fa-animation-delay, 0s); + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 2s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, linear); } .fa-spin-reverse { @@ -416,16 +360,11 @@ svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa { .fa-pulse, .fa-spin-pulse { - -webkit-animation-name: fa-spin; - animation-name: fa-spin; - -webkit-animation-direction: var(--fa-animation-direction, normal); - animation-direction: var(--fa-animation-direction, normal); - -webkit-animation-duration: var(--fa-animation-duration, 1s); - animation-duration: var(--fa-animation-duration, 1s); - -webkit-animation-iteration-count: var(--fa-animation-iteration-count, infinite); - animation-iteration-count: var(--fa-animation-iteration-count, infinite); - -webkit-animation-timing-function: var(--fa-animation-timing, steps(8)); - animation-timing-function: var(--fa-animation-timing, steps(8)); + animation-name: fa-spin; + animation-direction: var(--fa-animation-direction, normal); + animation-duration: var(--fa-animation-duration, 1s); + animation-iteration-count: var(--fa-animation-iteration-count, infinite); + animation-timing-function: var(--fa-animation-timing, steps(8)); } @media (prefers-reduced-motion: reduce) { @@ -438,101 +377,42 @@ svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa { .fa-shake, .fa-spin, .fa-spin-pulse { - -webkit-animation-delay: -1ms; - animation-delay: -1ms; - -webkit-animation-duration: 1ms; - animation-duration: 1ms; - -webkit-animation-iteration-count: 1; - animation-iteration-count: 1; - -webkit-transition-delay: 0s; - transition-delay: 0s; - -webkit-transition-duration: 0s; - transition-duration: 0s; - } -} -@-webkit-keyframes fa-beat { - 0%, 90% { - -webkit-transform: scale(1); - transform: scale(1); - } - 45% { - -webkit-transform: scale(var(--fa-beat-scale, 1.25)); - transform: scale(var(--fa-beat-scale, 1.25)); + animation-delay: -1ms; + animation-duration: 1ms; + animation-iteration-count: 1; + transition-delay: 0s; + transition-duration: 0s; } } @keyframes fa-beat { 0%, 90% { - -webkit-transform: scale(1); - transform: scale(1); + transform: scale(1); } 45% { - -webkit-transform: scale(var(--fa-beat-scale, 1.25)); - transform: scale(var(--fa-beat-scale, 1.25)); - } -} -@-webkit-keyframes fa-bounce { - 0% { - -webkit-transform: scale(1, 1) translateY(0); - transform: scale(1, 1) translateY(0); - } - 10% { - -webkit-transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); - transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); - } - 30% { - -webkit-transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); - transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); - } - 50% { - -webkit-transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); - transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); - } - 57% { - -webkit-transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); - transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); - } - 64% { - -webkit-transform: scale(1, 1) translateY(0); - transform: scale(1, 1) translateY(0); - } - 100% { - -webkit-transform: scale(1, 1) translateY(0); - transform: scale(1, 1) translateY(0); + transform: scale(var(--fa-beat-scale, 1.25)); } } @keyframes fa-bounce { 0% { - -webkit-transform: scale(1, 1) translateY(0); - transform: scale(1, 1) translateY(0); + transform: scale(1, 1) translateY(0); } 10% { - -webkit-transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); - transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); + transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); } 30% { - -webkit-transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); - transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); + transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); } 50% { - -webkit-transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); - transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); + transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); } 57% { - -webkit-transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); - transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); + transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); } 64% { - -webkit-transform: scale(1, 1) translateY(0); - transform: scale(1, 1) translateY(0); + transform: scale(1, 1) translateY(0); } 100% { - -webkit-transform: scale(1, 1) translateY(0); - transform: scale(1, 1) translateY(0); - } -} -@-webkit-keyframes fa-fade { - 50% { - opacity: var(--fa-fade-opacity, 0.4); + transform: scale(1, 1) translateY(0); } } @keyframes fa-fade { @@ -540,172 +420,85 @@ svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa { opacity: var(--fa-fade-opacity, 0.4); } } -@-webkit-keyframes fa-beat-fade { - 0%, 100% { - opacity: var(--fa-beat-fade-opacity, 0.4); - -webkit-transform: scale(1); - transform: scale(1); - } - 50% { - opacity: 1; - -webkit-transform: scale(var(--fa-beat-fade-scale, 1.125)); - transform: scale(var(--fa-beat-fade-scale, 1.125)); - } -} @keyframes fa-beat-fade { 0%, 100% { opacity: var(--fa-beat-fade-opacity, 0.4); - -webkit-transform: scale(1); - transform: scale(1); + transform: scale(1); } 50% { opacity: 1; - -webkit-transform: scale(var(--fa-beat-fade-scale, 1.125)); - transform: scale(var(--fa-beat-fade-scale, 1.125)); - } -} -@-webkit-keyframes fa-flip { - 50% { - -webkit-transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); - transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); + transform: scale(var(--fa-beat-fade-scale, 1.125)); } } @keyframes fa-flip { 50% { - -webkit-transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); - transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); - } -} -@-webkit-keyframes fa-shake { - 0% { - -webkit-transform: rotate(-15deg); - transform: rotate(-15deg); - } - 4% { - -webkit-transform: rotate(15deg); - transform: rotate(15deg); - } - 8%, 24% { - -webkit-transform: rotate(-18deg); - transform: rotate(-18deg); - } - 12%, 28% { - -webkit-transform: rotate(18deg); - transform: rotate(18deg); - } - 16% { - -webkit-transform: rotate(-22deg); - transform: rotate(-22deg); - } - 20% { - -webkit-transform: rotate(22deg); - transform: rotate(22deg); - } - 32% { - -webkit-transform: rotate(-12deg); - transform: rotate(-12deg); - } - 36% { - -webkit-transform: rotate(12deg); - transform: rotate(12deg); - } - 40%, 100% { - -webkit-transform: rotate(0deg); - transform: rotate(0deg); + transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); } } @keyframes fa-shake { 0% { - -webkit-transform: rotate(-15deg); - transform: rotate(-15deg); + transform: rotate(-15deg); } 4% { - -webkit-transform: rotate(15deg); - transform: rotate(15deg); + transform: rotate(15deg); } 8%, 24% { - -webkit-transform: rotate(-18deg); - transform: rotate(-18deg); + transform: rotate(-18deg); } 12%, 28% { - -webkit-transform: rotate(18deg); - transform: rotate(18deg); + transform: rotate(18deg); } 16% { - -webkit-transform: rotate(-22deg); - transform: rotate(-22deg); + transform: rotate(-22deg); } 20% { - -webkit-transform: rotate(22deg); - transform: rotate(22deg); + transform: rotate(22deg); } 32% { - -webkit-transform: rotate(-12deg); - transform: rotate(-12deg); + transform: rotate(-12deg); } 36% { - -webkit-transform: rotate(12deg); - transform: rotate(12deg); + transform: rotate(12deg); } 40%, 100% { - -webkit-transform: rotate(0deg); - transform: rotate(0deg); - } -} -@-webkit-keyframes fa-spin { - 0% { - -webkit-transform: rotate(0deg); - transform: rotate(0deg); - } - 100% { - -webkit-transform: rotate(360deg); - transform: rotate(360deg); + transform: rotate(0deg); } } @keyframes fa-spin { 0% { - -webkit-transform: rotate(0deg); - transform: rotate(0deg); + transform: rotate(0deg); } 100% { - -webkit-transform: rotate(360deg); - transform: rotate(360deg); + transform: rotate(360deg); } } .fa-rotate-90 { - -webkit-transform: rotate(90deg); - transform: rotate(90deg); + transform: rotate(90deg); } .fa-rotate-180 { - -webkit-transform: rotate(180deg); - transform: rotate(180deg); + transform: rotate(180deg); } .fa-rotate-270 { - -webkit-transform: rotate(270deg); - transform: rotate(270deg); + transform: rotate(270deg); } .fa-flip-horizontal { - -webkit-transform: scale(-1, 1); - transform: scale(-1, 1); + transform: scale(-1, 1); } .fa-flip-vertical { - -webkit-transform: scale(1, -1); - transform: scale(1, -1); + transform: scale(1, -1); } .fa-flip-both, .fa-flip-horizontal.fa-flip-vertical { - -webkit-transform: scale(-1, -1); - transform: scale(-1, -1); + transform: scale(-1, -1); } .fa-rotate-by { - -webkit-transform: rotate(var(--fa-rotate-angle, 0)); - transform: rotate(var(--fa-rotate-angle, 0)); + transform: rotate(var(--fa-rotate-angle, 0)); } .fa-stack { @@ -792,18 +585,18 @@ svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa { .fad.fa-inverse, .fa-duotone.fa-inverse { color: var(--fa-inverse, #fff); -}`;function CW(){var n=pW,e=mW,t=ze.cssPrefix,i=ze.replacementClass,s=JZ;if(t!==n||i!==e){var o=new RegExp("\\.".concat(n,"\\-"),"g"),r=new RegExp("\\--".concat(n,"\\-"),"g"),a=new RegExp("\\.".concat(e),"g");s=s.replace(o,".".concat(t,"-")).replace(r,"--".concat(t,"-")).replace(a,".".concat(i))}return s}var L5=!1;function bk(){ze.autoAddCss&&!L5&&(KZ(CW()),L5=!0)}var eX={mixout:function(){return{dom:{css:CW,insertCss:bk}}},hooks:function(){return{beforeDOMElementCreation:function(){bk()},beforeI2svg:function(){bk()}}}},hc=Vd||{};hc[uc]||(hc[uc]={});hc[uc].styles||(hc[uc].styles={});hc[uc].hooks||(hc[uc].hooks={});hc[uc].shims||(hc[uc].shims=[]);var ea=hc[uc],SW=[],tX=function n(){Bi.removeEventListener("DOMContentLoaded",n),qC=1,SW.map(function(e){return e()})},qC=!1;vc&&(qC=(Bi.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(Bi.readyState),qC||Bi.addEventListener("DOMContentLoaded",tX));function iX(n){vc&&(qC?setTimeout(n,0):SW.push(n))}function f1(n){var e=n.tag,t=n.attributes,i=t===void 0?{}:t,s=n.children,o=s===void 0?[]:s;return typeof n=="string"?wW(n):"<".concat(e," ").concat(ZZ(i),">").concat(o.map(f1).join(""),"")}function D5(n,e,t){if(n&&n[e]&&n[e][t])return{prefix:e,iconName:t,icon:n[e][t]}}var vk=function(e,t,i,s){var o=Object.keys(e),r=o.length,a=t,l,c,d;for(i===void 0?(l=1,d=e[o[0]]):(l=0,d=i);l=55296&&s<=56319&&t=55296&&i<=56319&&t>e+1&&(s=n.charCodeAt(e+1),s>=56320&&s<=57343)?(i-55296)*1024+s-56320+65536:i}function k5(n){return Object.keys(n).reduce(function(e,t){var i=n[t],s=!!i.icon;return s?e[i.iconName]=i.icon:e[t]=i,e},{})}function ME(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=t.skipHooks,s=i===void 0?!1:i,o=k5(e);typeof ea.hooks.addPack=="function"&&!s?ea.hooks.addPack(n,k5(e)):ea.styles[n]=Me(Me({},ea.styles[n]||{}),o),n==="fas"&&ME("fa",e)}var ky,Ey,Ay,Tg=ea.styles,oX=ea.shims,rX=(ky={},Fn(ky,Pi,Object.values(rb[Pi])),Fn(ky,nn,Object.values(rb[nn])),ky),cM=null,xW={},LW={},DW={},kW={},EW={},aX=(Ey={},Fn(Ey,Pi,Object.keys(sb[Pi])),Fn(Ey,nn,Object.keys(sb[nn])),Ey);function lX(n){return~$Z.indexOf(n)}function cX(n,e){var t=e.split("-"),i=t[0],s=t.slice(1).join("-");return i===n&&s!==""&&!lX(s)?s:null}var AW=function(){var e=function(o){return vk(Tg,function(r,a,l){return r[l]=vk(a,o,{}),r},{})};xW=e(function(s,o,r){if(o[3]&&(s[o[3]]=r),o[2]){var a=o[2].filter(function(l){return typeof l=="number"});a.forEach(function(l){s[l.toString(16)]=r})}return s}),LW=e(function(s,o,r){if(s[r]=r,o[2]){var a=o[2].filter(function(l){return typeof l=="string"});a.forEach(function(l){s[l]=r})}return s}),EW=e(function(s,o,r){var a=o[2];return s[r]=r,a.forEach(function(l){s[l]=r}),s});var t="far"in Tg||ze.autoFetchSvg,i=vk(oX,function(s,o){var r=o[0],a=o[1],l=o[2];return a==="far"&&!t&&(a="fas"),typeof r=="string"&&(s.names[r]={prefix:a,iconName:l}),typeof r=="number"&&(s.unicodes[r.toString(16)]={prefix:a,iconName:l}),s},{names:{},unicodes:{}});DW=i.names,kW=i.unicodes,cM=Qx(ze.styleDefault,{family:ze.familyDefault})};GZ(function(n){cM=Qx(n.styleDefault,{family:ze.familyDefault})});AW();function dM(n,e){return(xW[n]||{})[e]}function dX(n,e){return(LW[n]||{})[e]}function yh(n,e){return(EW[n]||{})[e]}function IW(n){return DW[n]||{prefix:null,iconName:null}}function uX(n){var e=kW[n],t=dM("fas",n);return e||(t?{prefix:"fas",iconName:t}:null)||{prefix:null,iconName:null}}function zd(){return cM}var uM=function(){return{prefix:null,iconName:null,rest:[]}};function Qx(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.family,i=t===void 0?Pi:t,s=sb[i][n],o=ob[i][n]||ob[i][s],r=n in ea.styles?n:null;return o||r||null}var E5=(Ay={},Fn(Ay,Pi,Object.keys(rb[Pi])),Fn(Ay,nn,Object.keys(rb[nn])),Ay);function Jx(n){var e,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=t.skipLookups,s=i===void 0?!1:i,o=(e={},Fn(e,Pi,"".concat(ze.cssPrefix,"-").concat(Pi)),Fn(e,nn,"".concat(ze.cssPrefix,"-").concat(nn)),e),r=null,a=Pi;(n.includes(o[Pi])||n.some(function(c){return E5[Pi].includes(c)}))&&(a=Pi),(n.includes(o[nn])||n.some(function(c){return E5[nn].includes(c)}))&&(a=nn);var l=n.reduce(function(c,d){var u=cX(ze.cssPrefix,d);if(Tg[d]?(d=rX[a].includes(d)?FZ[a][d]:d,r=d,c.prefix=d):aX[a].indexOf(d)>-1?(r=d,c.prefix=Qx(d,{family:a})):u?c.iconName=u:d!==ze.replacementClass&&d!==o[Pi]&&d!==o[nn]&&c.rest.push(d),!s&&c.prefix&&c.iconName){var h=r==="fa"?IW(c.iconName):{},f=yh(c.prefix,c.iconName);h.prefix&&(r=null),c.iconName=h.iconName||f||c.iconName,c.prefix=h.prefix||c.prefix,c.prefix==="far"&&!Tg.far&&Tg.fas&&!ze.autoFetchSvg&&(c.prefix="fas")}return c},uM());return(n.includes("fa-brands")||n.includes("fab"))&&(l.prefix="fab"),(n.includes("fa-duotone")||n.includes("fad"))&&(l.prefix="fad"),!l.prefix&&a===nn&&(Tg.fass||ze.autoFetchSvg)&&(l.prefix="fass",l.iconName=yh(l.prefix,l.iconName)||l.iconName),(l.prefix==="fa"||r==="fa")&&(l.prefix=zd()||"fas"),l}var hX=function(){function n(){xZ(this,n),this.definitions={}}return DZ(n,[{key:"add",value:function(){for(var t=this,i=arguments.length,s=new Array(i),o=0;o0&&d.forEach(function(u){typeof u=="string"&&(t[a][u]=c)}),t[a][l]=c}),t}}]),n}(),A5=[],Ng={},ap={},fX=Object.keys(ap);function gX(n,e){var t=e.mixoutsTo;return A5=n,Ng={},Object.keys(ap).forEach(function(i){fX.indexOf(i)===-1&&delete ap[i]}),A5.forEach(function(i){var s=i.mixout?i.mixout():{};if(Object.keys(s).forEach(function(r){typeof s[r]=="function"&&(t[r]=s[r]),jC(s[r])==="object"&&Object.keys(s[r]).forEach(function(a){t[r]||(t[r]={}),t[r][a]=s[r][a]})}),i.hooks){var o=i.hooks();Object.keys(o).forEach(function(r){Ng[r]||(Ng[r]=[]),Ng[r].push(o[r])})}i.provides&&i.provides(ap)}),t}function PE(n,e){for(var t=arguments.length,i=new Array(t>2?t-2:0),s=2;s1?e-1:0),i=1;i0&&arguments[0]!==void 0?arguments[0]:{};return vc?(cf("beforeI2svg",e),fc("pseudoElements2svg",e),fc("i2svg",e)):Promise.reject("Operation requires a DOM of some kind.")},watch:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.autoReplaceSvgRoot;ze.autoReplaceSvg===!1&&(ze.autoReplaceSvg=!0),ze.observeMutations=!0,iX(function(){bX({autoReplaceSvgRoot:t}),cf("watch",e)})}},_X={icon:function(e){if(e===null)return null;if(jC(e)==="object"&&e.prefix&&e.iconName)return{prefix:e.prefix,iconName:yh(e.prefix,e.iconName)||e.iconName};if(Array.isArray(e)&&e.length===2){var t=e[1].indexOf("fa-")===0?e[1].slice(3):e[1],i=Qx(e[0]);return{prefix:i,iconName:yh(i,t)||t}}if(typeof e=="string"&&(e.indexOf("".concat(ze.cssPrefix,"-"))>-1||e.match(BZ))){var s=Jx(e.split(" "),{skipLookups:!0});return{prefix:s.prefix||zd(),iconName:yh(s.prefix,s.iconName)||s.iconName}}if(typeof e=="string"){var o=zd();return{prefix:o,iconName:yh(o,e)||e}}}},Zo={noAuto:pX,config:ze,dom:mX,parse:_X,library:TW,findIconDefinition:OE,toHtml:f1},bX=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.autoReplaceSvgRoot,i=t===void 0?Bi:t;(Object.keys(ea.styles).length>0||ze.autoFetchSvg)&&vc&&ze.autoReplaceSvg&&Zo.dom.i2svg({node:i})};function eL(n,e){return Object.defineProperty(n,"abstract",{get:e}),Object.defineProperty(n,"html",{get:function(){return n.abstract.map(function(i){return f1(i)})}}),Object.defineProperty(n,"node",{get:function(){if(vc){var i=Bi.createElement("div");return i.innerHTML=n.html,i.children}}}),n}function vX(n){var e=n.children,t=n.main,i=n.mask,s=n.attributes,o=n.styles,r=n.transform;if(lM(r)&&t.found&&!i.found){var a=t.width,l=t.height,c={x:a/l/2,y:.5};s.style=Xx(Me(Me({},o),{},{"transform-origin":"".concat(c.x+r.x/16,"em ").concat(c.y+r.y/16,"em")}))}return[{tag:"svg",attributes:s,children:e}]}function yX(n){var e=n.prefix,t=n.iconName,i=n.children,s=n.attributes,o=n.symbol,r=o===!0?"".concat(e,"-").concat(ze.cssPrefix,"-").concat(t):o;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:Me(Me({},s),{},{id:r}),children:i}]}]}function hM(n){var e=n.icons,t=e.main,i=e.mask,s=n.prefix,o=n.iconName,r=n.transform,a=n.symbol,l=n.title,c=n.maskId,d=n.titleId,u=n.extra,h=n.watchable,f=h===void 0?!1:h,g=i.found?i:t,p=g.width,_=g.height,v=s==="fak",b=[ze.replacementClass,o?"".concat(ze.cssPrefix,"-").concat(o):""].filter(function(k){return u.classes.indexOf(k)===-1}).filter(function(k){return k!==""||!!k}).concat(u.classes).join(" "),y={children:[],attributes:Me(Me({},u.attributes),{},{"data-prefix":s,"data-icon":o,class:b,role:u.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(p," ").concat(_)})},w=v&&!~u.classes.indexOf("fa-fw")?{width:"".concat(p/_*16*.0625,"em")}:{};f&&(y.attributes[lf]=""),l&&(y.children.push({tag:"title",attributes:{id:y.attributes["aria-labelledby"]||"title-".concat(d||lb())},children:[l]}),delete y.attributes.title);var C=Me(Me({},y),{},{prefix:s,iconName:o,main:t,mask:i,maskId:c,transform:r,symbol:a,styles:Me(Me({},w),u.styles)}),L=i.found&&t.found?fc("generateAbstractMask",C)||{children:[],attributes:{}}:fc("generateAbstractIcon",C)||{children:[],attributes:{}},x=L.children,D=L.attributes;return C.children=x,C.attributes=D,a?yX(C):vX(C)}function I5(n){var e=n.content,t=n.width,i=n.height,s=n.transform,o=n.title,r=n.extra,a=n.watchable,l=a===void 0?!1:a,c=Me(Me(Me({},r.attributes),o?{title:o}:{}),{},{class:r.classes.join(" ")});l&&(c[lf]="");var d=Me({},r.styles);lM(s)&&(d.transform=QZ({transform:s,startCentered:!0,width:t,height:i}),d["-webkit-transform"]=d.transform);var u=Xx(d);u.length>0&&(c.style=u);var h=[];return h.push({tag:"span",attributes:c,children:[e]}),o&&h.push({tag:"span",attributes:{class:"sr-only"},children:[o]}),h}function wX(n){var e=n.content,t=n.title,i=n.extra,s=Me(Me(Me({},i.attributes),t?{title:t}:{}),{},{class:i.classes.join(" ")}),o=Xx(i.styles);o.length>0&&(s.style=o);var r=[];return r.push({tag:"span",attributes:s,children:[e]}),t&&r.push({tag:"span",attributes:{class:"sr-only"},children:[t]}),r}var yk=ea.styles;function FE(n){var e=n[0],t=n[1],i=n.slice(4),s=iM(i,1),o=s[0],r=null;return Array.isArray(o)?r={tag:"g",attributes:{class:"".concat(ze.cssPrefix,"-").concat(vh.GROUP)},children:[{tag:"path",attributes:{class:"".concat(ze.cssPrefix,"-").concat(vh.SECONDARY),fill:"currentColor",d:o[0]}},{tag:"path",attributes:{class:"".concat(ze.cssPrefix,"-").concat(vh.PRIMARY),fill:"currentColor",d:o[1]}}]}:r={tag:"path",attributes:{fill:"currentColor",d:o}},{found:!0,width:e,height:t,icon:r}}var CX={found:!1,width:512,height:512};function SX(n,e){!_W&&!ze.showMissingIcons&&n&&console.error('Icon with name "'.concat(n,'" and prefix "').concat(e,'" is missing.'))}function BE(n,e){var t=e;return e==="fa"&&ze.styleDefault!==null&&(e=zd()),new Promise(function(i,s){if(fc("missingIconAbstract"),t==="fa"){var o=IW(n)||{};n=o.iconName||n,e=o.prefix||e}if(n&&e&&yk[e]&&yk[e][n]){var r=yk[e][n];return i(FE(r))}SX(n,e),i(Me(Me({},CX),{},{icon:ze.showMissingIcons&&n?fc("missingIconAbstract")||{}:{}}))})}var T5=function(){},WE=ze.measurePerformance&&wy&&wy.mark&&wy.measure?wy:{mark:T5,measure:T5},K0='FA "6.5.2"',xX=function(e){return WE.mark("".concat(K0," ").concat(e," begins")),function(){return NW(e)}},NW=function(e){WE.mark("".concat(K0," ").concat(e," ends")),WE.measure("".concat(K0," ").concat(e),"".concat(K0," ").concat(e," begins"),"".concat(K0," ").concat(e," ends"))},fM={begin:xX,end:NW},Jw=function(){};function N5(n){var e=n.getAttribute?n.getAttribute(lf):null;return typeof e=="string"}function LX(n){var e=n.getAttribute?n.getAttribute(sM):null,t=n.getAttribute?n.getAttribute(oM):null;return e&&t}function DX(n){return n&&n.classList&&n.classList.contains&&n.classList.contains(ze.replacementClass)}function kX(){if(ze.autoReplaceSvg===!0)return eC.replace;var n=eC[ze.autoReplaceSvg];return n||eC.replace}function EX(n){return Bi.createElementNS("http://www.w3.org/2000/svg",n)}function AX(n){return Bi.createElement(n)}function RW(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.ceFn,i=t===void 0?n.tag==="svg"?EX:AX:t;if(typeof n=="string")return Bi.createTextNode(n);var s=i(n.tag);Object.keys(n.attributes||[]).forEach(function(r){s.setAttribute(r,n.attributes[r])});var o=n.children||[];return o.forEach(function(r){s.appendChild(RW(r,{ceFn:i}))}),s}function IX(n){var e=" ".concat(n.outerHTML," ");return e="".concat(e,"Font Awesome fontawesome.com "),e}var eC={replace:function(e){var t=e[0];if(t.parentNode)if(e[1].forEach(function(s){t.parentNode.insertBefore(RW(s),t)}),t.getAttribute(lf)===null&&ze.keepOriginalSource){var i=Bi.createComment(IX(t));t.parentNode.replaceChild(i,t)}else t.remove()},nest:function(e){var t=e[0],i=e[1];if(~aM(t).indexOf(ze.replacementClass))return eC.replace(e);var s=new RegExp("".concat(ze.cssPrefix,"-.*"));if(delete i[0].attributes.id,i[0].attributes.class){var o=i[0].attributes.class.split(" ").reduce(function(a,l){return l===ze.replacementClass||l.match(s)?a.toSvg.push(l):a.toNode.push(l),a},{toNode:[],toSvg:[]});i[0].attributes.class=o.toSvg.join(" "),o.toNode.length===0?t.removeAttribute("class"):t.setAttribute("class",o.toNode.join(" "))}var r=i.map(function(a){return f1(a)}).join(` -`);t.setAttribute(lf,""),t.innerHTML=r}};function R5(n){n()}function MW(n,e){var t=typeof e=="function"?e:Jw;if(n.length===0)t();else{var i=R5;ze.mutateApproach===PZ&&(i=Vd.requestAnimationFrame||R5),i(function(){var s=kX(),o=fM.begin("mutate");n.map(s),o(),t()})}}var gM=!1;function PW(){gM=!0}function VE(){gM=!1}var GC=null;function M5(n){if(S5&&ze.observeMutations){var e=n.treeCallback,t=e===void 0?Jw:e,i=n.nodeCallback,s=i===void 0?Jw:i,o=n.pseudoElementsCallback,r=o===void 0?Jw:o,a=n.observeMutationsRoot,l=a===void 0?Bi:a;GC=new S5(function(c){if(!gM){var d=zd();jm(c).forEach(function(u){if(u.type==="childList"&&u.addedNodes.length>0&&!N5(u.addedNodes[0])&&(ze.searchPseudoElements&&r(u.target),t(u.target)),u.type==="attributes"&&u.target.parentNode&&ze.searchPseudoElements&&r(u.target.parentNode),u.type==="attributes"&&N5(u.target)&&~HZ.indexOf(u.attributeName))if(u.attributeName==="class"&&LX(u.target)){var h=Jx(aM(u.target)),f=h.prefix,g=h.iconName;u.target.setAttribute(sM,f||d),g&&u.target.setAttribute(oM,g)}else DX(u.target)&&s(u.target)})}}),vc&&GC.observe(l,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}}function TX(){GC&&GC.disconnect()}function NX(n){var e=n.getAttribute("style"),t=[];return e&&(t=e.split(";").reduce(function(i,s){var o=s.split(":"),r=o[0],a=o.slice(1);return r&&a.length>0&&(i[r]=a.join(":").trim()),i},{})),t}function RX(n){var e=n.getAttribute("data-prefix"),t=n.getAttribute("data-icon"),i=n.innerText!==void 0?n.innerText.trim():"",s=Jx(aM(n));return s.prefix||(s.prefix=zd()),e&&t&&(s.prefix=e,s.iconName=t),s.iconName&&s.prefix||(s.prefix&&i.length>0&&(s.iconName=dX(s.prefix,n.innerText)||dM(s.prefix,RE(n.innerText))),!s.iconName&&ze.autoFetchSvg&&n.firstChild&&n.firstChild.nodeType===Node.TEXT_NODE&&(s.iconName=n.firstChild.data)),s}function MX(n){var e=jm(n.attributes).reduce(function(s,o){return s.name!=="class"&&s.name!=="style"&&(s[o.name]=o.value),s},{}),t=n.getAttribute("title"),i=n.getAttribute("data-fa-title-id");return ze.autoA11y&&(t?e["aria-labelledby"]="".concat(ze.replacementClass,"-title-").concat(i||lb()):(e["aria-hidden"]="true",e.focusable="false")),e}function PX(){return{iconName:null,title:null,titleId:null,prefix:null,transform:Fa,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}}}function P5(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{styleParser:!0},t=RX(n),i=t.iconName,s=t.prefix,o=t.rest,r=MX(n),a=PE("parseNodeAttributes",{},n),l=e.styleParser?NX(n):[];return Me({iconName:i,title:n.getAttribute("title"),titleId:n.getAttribute("data-fa-title-id"),prefix:s,transform:Fa,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:o,styles:l,attributes:r}},a)}var OX=ea.styles;function OW(n){var e=ze.autoReplaceSvg==="nest"?P5(n,{styleParser:!1}):P5(n);return~e.extra.classes.indexOf(bW)?fc("generateLayersText",n,e):fc("generateSvgReplacementMutation",n,e)}var Hd=new Set;rM.map(function(n){Hd.add("fa-".concat(n))});Object.keys(sb[Pi]).map(Hd.add.bind(Hd));Object.keys(sb[nn]).map(Hd.add.bind(Hd));Hd=u1(Hd);function O5(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!vc)return Promise.resolve();var t=Bi.documentElement.classList,i=function(u){return t.add("".concat(x5,"-").concat(u))},s=function(u){return t.remove("".concat(x5,"-").concat(u))},o=ze.autoFetchSvg?Hd:rM.map(function(d){return"fa-".concat(d)}).concat(Object.keys(OX));o.includes("fa")||o.push("fa");var r=[".".concat(bW,":not([").concat(lf,"])")].concat(o.map(function(d){return".".concat(d,":not([").concat(lf,"])")})).join(", ");if(r.length===0)return Promise.resolve();var a=[];try{a=jm(n.querySelectorAll(r))}catch{}if(a.length>0)i("pending"),s("complete");else return Promise.resolve();var l=fM.begin("onTree"),c=a.reduce(function(d,u){try{var h=OW(u);h&&d.push(h)}catch(f){_W||f.name==="MissingIcon"&&console.error(f)}return d},[]);return new Promise(function(d,u){Promise.all(c).then(function(h){MW(h,function(){i("active"),i("complete"),s("pending"),typeof e=="function"&&e(),l(),d()})}).catch(function(h){l(),u(h)})})}function FX(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;OW(n).then(function(t){t&&MW([t],e)})}function BX(n){return function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=(e||{}).icon?e:OE(e||{}),s=t.mask;return s&&(s=(s||{}).icon?s:OE(s||{})),n(i,Me(Me({},t),{},{mask:s}))}}var WX=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=t.transform,s=i===void 0?Fa:i,o=t.symbol,r=o===void 0?!1:o,a=t.mask,l=a===void 0?null:a,c=t.maskId,d=c===void 0?null:c,u=t.title,h=u===void 0?null:u,f=t.titleId,g=f===void 0?null:f,p=t.classes,_=p===void 0?[]:p,v=t.attributes,b=v===void 0?{}:v,y=t.styles,w=y===void 0?{}:y;if(e){var C=e.prefix,L=e.iconName,x=e.icon;return eL(Me({type:"icon"},e),function(){return cf("beforeDOMElementCreation",{iconDefinition:e,params:t}),ze.autoA11y&&(h?b["aria-labelledby"]="".concat(ze.replacementClass,"-title-").concat(g||lb()):(b["aria-hidden"]="true",b.focusable="false")),hM({icons:{main:FE(x),mask:l?FE(l.icon):{found:!1,width:null,height:null,icon:{}}},prefix:C,iconName:L,transform:Me(Me({},Fa),s),symbol:r,title:h,maskId:d,titleId:g,extra:{attributes:b,styles:w,classes:_}})})}},VX={mixout:function(){return{icon:BX(WX)}},hooks:function(){return{mutationObserverCallbacks:function(t){return t.treeCallback=O5,t.nodeCallback=FX,t}}},provides:function(e){e.i2svg=function(t){var i=t.node,s=i===void 0?Bi:i,o=t.callback,r=o===void 0?function(){}:o;return O5(s,r)},e.generateSvgReplacementMutation=function(t,i){var s=i.iconName,o=i.title,r=i.titleId,a=i.prefix,l=i.transform,c=i.symbol,d=i.mask,u=i.maskId,h=i.extra;return new Promise(function(f,g){Promise.all([BE(s,a),d.iconName?BE(d.iconName,d.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then(function(p){var _=iM(p,2),v=_[0],b=_[1];f([t,hM({icons:{main:v,mask:b},prefix:a,iconName:s,transform:l,symbol:c,maskId:u,title:o,titleId:r,extra:h,watchable:!0})])}).catch(g)})},e.generateAbstractIcon=function(t){var i=t.children,s=t.attributes,o=t.main,r=t.transform,a=t.styles,l=Xx(a);l.length>0&&(s.style=l);var c;return lM(r)&&(c=fc("generateAbstractTransformGrouping",{main:o,transform:r,containerWidth:o.width,iconWidth:o.width})),i.push(c||o.icon),{children:i,attributes:s}}}},zX={mixout:function(){return{layer:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=i.classes,o=s===void 0?[]:s;return eL({type:"layer"},function(){cf("beforeDOMElementCreation",{assembler:t,params:i});var r=[];return t(function(a){Array.isArray(a)?a.map(function(l){r=r.concat(l.abstract)}):r=r.concat(a.abstract)}),[{tag:"span",attributes:{class:["".concat(ze.cssPrefix,"-layers")].concat(u1(o)).join(" ")},children:r}]})}}}},HX={mixout:function(){return{counter:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=i.title,o=s===void 0?null:s,r=i.classes,a=r===void 0?[]:r,l=i.attributes,c=l===void 0?{}:l,d=i.styles,u=d===void 0?{}:d;return eL({type:"counter",content:t},function(){return cf("beforeDOMElementCreation",{content:t,params:i}),wX({content:t.toString(),title:o,extra:{attributes:c,styles:u,classes:["".concat(ze.cssPrefix,"-layers-counter")].concat(u1(a))}})})}}}},$X={mixout:function(){return{text:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=i.transform,o=s===void 0?Fa:s,r=i.title,a=r===void 0?null:r,l=i.classes,c=l===void 0?[]:l,d=i.attributes,u=d===void 0?{}:d,h=i.styles,f=h===void 0?{}:h;return eL({type:"text",content:t},function(){return cf("beforeDOMElementCreation",{content:t,params:i}),I5({content:t,transform:Me(Me({},Fa),o),title:a,extra:{attributes:u,styles:f,classes:["".concat(ze.cssPrefix,"-layers-text")].concat(u1(c))}})})}}},provides:function(e){e.generateLayersText=function(t,i){var s=i.title,o=i.transform,r=i.extra,a=null,l=null;if(gW){var c=parseInt(getComputedStyle(t).fontSize,10),d=t.getBoundingClientRect();a=d.width/c,l=d.height/c}return ze.autoA11y&&!s&&(r.attributes["aria-hidden"]="true"),Promise.resolve([t,I5({content:t.innerHTML,width:a,height:l,transform:o,title:s,extra:r,watchable:!0})])}}},UX=new RegExp('"',"ug"),F5=[1105920,1112319];function jX(n){var e=n.replace(UX,""),t=sX(e,0),i=t>=F5[0]&&t<=F5[1],s=e.length===2?e[0]===e[1]:!1;return{value:RE(s?e[0]:e),isSecondary:i||s}}function B5(n,e){var t="".concat(MZ).concat(e.replace(":","-"));return new Promise(function(i,s){if(n.getAttribute(t)!==null)return i();var o=jm(n.children),r=o.filter(function(x){return x.getAttribute(NE)===e})[0],a=Vd.getComputedStyle(n,e),l=a.getPropertyValue("font-family").match(WZ),c=a.getPropertyValue("font-weight"),d=a.getPropertyValue("content");if(r&&!l)return n.removeChild(r),i();if(l&&d!=="none"&&d!==""){var u=a.getPropertyValue("content"),h=~["Sharp"].indexOf(l[2])?nn:Pi,f=~["Solid","Regular","Light","Thin","Duotone","Brands","Kit"].indexOf(l[2])?ob[h][l[2].toLowerCase()]:VZ[h][c],g=jX(u),p=g.value,_=g.isSecondary,v=l[0].startsWith("FontAwesome"),b=dM(f,p),y=b;if(v){var w=uX(p);w.iconName&&w.prefix&&(b=w.iconName,f=w.prefix)}if(b&&!_&&(!r||r.getAttribute(sM)!==f||r.getAttribute(oM)!==y)){n.setAttribute(t,y),r&&n.removeChild(r);var C=PX(),L=C.extra;L.attributes[NE]=e,BE(b,f).then(function(x){var D=hM(Me(Me({},C),{},{icons:{main:x,mask:uM()},prefix:f,iconName:y,extra:L,watchable:!0})),k=Bi.createElementNS("http://www.w3.org/2000/svg","svg");e==="::before"?n.insertBefore(k,n.firstChild):n.appendChild(k),k.outerHTML=D.map(function(P){return f1(P)}).join(` -`),n.removeAttribute(t),i()}).catch(s)}else i()}else i()})}function qX(n){return Promise.all([B5(n,"::before"),B5(n,"::after")])}function GX(n){return n.parentNode!==document.head&&!~OZ.indexOf(n.tagName.toUpperCase())&&!n.getAttribute(NE)&&(!n.parentNode||n.parentNode.tagName!=="svg")}function W5(n){if(vc)return new Promise(function(e,t){var i=jm(n.querySelectorAll("*")).filter(GX).map(qX),s=fM.begin("searchPseudoElements");PW(),Promise.all(i).then(function(){s(),VE(),e()}).catch(function(){s(),VE(),t()})})}var KX={hooks:function(){return{mutationObserverCallbacks:function(t){return t.pseudoElementsCallback=W5,t}}},provides:function(e){e.pseudoElements2svg=function(t){var i=t.node,s=i===void 0?Bi:i;ze.searchPseudoElements&&W5(s)}}},V5=!1,YX={mixout:function(){return{dom:{unwatch:function(){PW(),V5=!0}}}},hooks:function(){return{bootstrap:function(){M5(PE("mutationObserverCallbacks",{}))},noAuto:function(){TX()},watch:function(t){var i=t.observeMutationsRoot;V5?VE():M5(PE("mutationObserverCallbacks",{observeMutationsRoot:i}))}}}},z5=function(e){var t={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return e.toLowerCase().split(" ").reduce(function(i,s){var o=s.toLowerCase().split("-"),r=o[0],a=o.slice(1).join("-");if(r&&a==="h")return i.flipX=!0,i;if(r&&a==="v")return i.flipY=!0,i;if(a=parseFloat(a),isNaN(a))return i;switch(r){case"grow":i.size=i.size+a;break;case"shrink":i.size=i.size-a;break;case"left":i.x=i.x-a;break;case"right":i.x=i.x+a;break;case"up":i.y=i.y-a;break;case"down":i.y=i.y+a;break;case"rotate":i.rotate=i.rotate+a;break}return i},t)},ZX={mixout:function(){return{parse:{transform:function(t){return z5(t)}}}},hooks:function(){return{parseNodeAttributes:function(t,i){var s=i.getAttribute("data-fa-transform");return s&&(t.transform=z5(s)),t}}},provides:function(e){e.generateAbstractTransformGrouping=function(t){var i=t.main,s=t.transform,o=t.containerWidth,r=t.iconWidth,a={transform:"translate(".concat(o/2," 256)")},l="translate(".concat(s.x*32,", ").concat(s.y*32,") "),c="scale(".concat(s.size/16*(s.flipX?-1:1),", ").concat(s.size/16*(s.flipY?-1:1),") "),d="rotate(".concat(s.rotate," 0 0)"),u={transform:"".concat(l," ").concat(c," ").concat(d)},h={transform:"translate(".concat(r/2*-1," -256)")},f={outer:a,inner:u,path:h};return{tag:"g",attributes:Me({},f.outer),children:[{tag:"g",attributes:Me({},f.inner),children:[{tag:i.icon.tag,children:i.icon.children,attributes:Me(Me({},i.icon.attributes),f.path)}]}]}}}},wk={x:0,y:0,width:"100%",height:"100%"};function H5(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return n.attributes&&(n.attributes.fill||e)&&(n.attributes.fill="black"),n}function XX(n){return n.tag==="g"?n.children:[n]}var QX={hooks:function(){return{parseNodeAttributes:function(t,i){var s=i.getAttribute("data-fa-mask"),o=s?Jx(s.split(" ").map(function(r){return r.trim()})):uM();return o.prefix||(o.prefix=zd()),t.mask=o,t.maskId=i.getAttribute("data-fa-mask-id"),t}}},provides:function(e){e.generateAbstractMask=function(t){var i=t.children,s=t.attributes,o=t.main,r=t.mask,a=t.maskId,l=t.transform,c=o.width,d=o.icon,u=r.width,h=r.icon,f=XZ({transform:l,containerWidth:u,iconWidth:c}),g={tag:"rect",attributes:Me(Me({},wk),{},{fill:"white"})},p=d.children?{children:d.children.map(H5)}:{},_={tag:"g",attributes:Me({},f.inner),children:[H5(Me({tag:d.tag,attributes:Me(Me({},d.attributes),f.path)},p))]},v={tag:"g",attributes:Me({},f.outer),children:[_]},b="mask-".concat(a||lb()),y="clip-".concat(a||lb()),w={tag:"mask",attributes:Me(Me({},wk),{},{id:b,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[g,v]},C={tag:"defs",children:[{tag:"clipPath",attributes:{id:y},children:XX(h)},w]};return i.push(C,{tag:"rect",attributes:Me({fill:"currentColor","clip-path":"url(#".concat(y,")"),mask:"url(#".concat(b,")")},wk)}),{children:i,attributes:s}}}},JX={provides:function(e){var t=!1;Vd.matchMedia&&(t=Vd.matchMedia("(prefers-reduced-motion: reduce)").matches),e.missingIconAbstract=function(){var i=[],s={fill:"currentColor"},o={attributeType:"XML",repeatCount:"indefinite",dur:"2s"};i.push({tag:"path",attributes:Me(Me({},s),{},{d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"})});var r=Me(Me({},o),{},{attributeName:"opacity"}),a={tag:"circle",attributes:Me(Me({},s),{},{cx:"256",cy:"364",r:"28"}),children:[]};return t||a.children.push({tag:"animate",attributes:Me(Me({},o),{},{attributeName:"r",values:"28;14;28;28;14;28;"})},{tag:"animate",attributes:Me(Me({},r),{},{values:"1;0;1;1;0;1;"})}),i.push(a),i.push({tag:"path",attributes:Me(Me({},s),{},{opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"}),children:t?[]:[{tag:"animate",attributes:Me(Me({},r),{},{values:"1;0;0;0;0;1;"})}]}),t||i.push({tag:"path",attributes:Me(Me({},s),{},{opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"}),children:[{tag:"animate",attributes:Me(Me({},r),{},{values:"0;0;1;1;0;0;"})}]}),{tag:"g",attributes:{class:"missing"},children:i}}}},eQ={hooks:function(){return{parseNodeAttributes:function(t,i){var s=i.getAttribute("data-fa-symbol"),o=s===null?!1:s===""?!0:s;return t.symbol=o,t}}}},tQ=[eX,VX,zX,HX,$X,KX,YX,ZX,QX,JX,eQ];gX(tQ,{mixoutsTo:Zo});Zo.noAuto;Zo.config;Zo.library;Zo.dom;Zo.parse;Zo.findIconDefinition;Zo.toHtml;var $5=Zo.icon;Zo.layer;Zo.text;Zo.counter;var iQ={prefix:"fas",iconName:"table-columns",icon:[512,512,["columns"],"f0db","M0 96C0 60.7 28.7 32 64 32H448c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96zm64 64V416H224V160H64zm384 0H288V416H448V160z"]},nQ=iQ,sQ={prefix:"fas",iconName:"circle-question",icon:[512,512,[62108,"question-circle"],"f059","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM169.8 165.3c7.9-22.3 29.1-37.3 52.8-37.3h58.3c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L280 264.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24V250.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1H222.6c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]},oQ=sQ;function uu(n,e,t){return n.fields=e||[],n.fname=t,n}function rQ(n){return n==null?null:n.fname}function aQ(n){return n==null?null:n.fields}function lQ(n){return n.length===1?cQ(n[0]):dQ(n)}const cQ=n=>function(e){return e[n]},dQ=n=>{const e=n.length;return function(t){for(let i=0;ir?c():r=a+1:l==="["?(a>r&&c(),s=r=a+1):l==="]"&&(s||Nn("Access path missing open bracket: "+n),s>0&&c(),s=0,r=a+1)}return s&&Nn("Access path missing closing bracket: "+n),i&&Nn("Access path missing closing quote: "+n),a>r&&(a++,c()),e}function tL(n,e,t){const i=uQ(n);return n=i.length===1?i[0]:n,uu((t&&t.get||lQ)(i),[n],e||n)}tL("id");const iL=uu(n=>n,[],"identity");uu(()=>0,[],"zero");uu(()=>1,[],"one");uu(()=>!0,[],"true");uu(()=>!1,[],"false");var Ps=Array.isArray;function Os(n){return n===Object(n)}function sa(n){return n[n.length-1]}function cb(n){return n==null||n===""?null:+n}const FW=n=>e=>n*Math.exp(e),BW=n=>e=>Math.log(n*e),hQ=n=>e=>Math.sign(e)*Math.log1p(Math.abs(e/n)),fQ=n=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*n,KC=n=>e=>e<0?-Math.pow(-e,n):Math.pow(e,n);function pM(n,e,t,i){const s=t(n[0]),o=t(sa(n)),r=(o-s)*e;return[i(s-r),i(o-r)]}function gQ(n,e){return pM(n,e,cb,iL)}function pQ(n,e){var t=Math.sign(n[0]);return pM(n,e,BW(t),FW(t))}function mQ(n,e,t){return pM(n,e,KC(t),KC(1/t))}function nL(n,e,t,i,s){const o=i(n[0]),r=i(sa(n)),a=e!=null?i(e):(o+r)/2;return[s(a+(o-a)*t),s(a+(r-a)*t)]}function WW(n,e,t){return nL(n,e,t,cb,iL)}function VW(n,e,t){const i=Math.sign(n[0]);return nL(n,e,t,BW(i),FW(i))}function zE(n,e,t,i){return nL(n,e,t,KC(i),KC(1/i))}function _Q(n,e,t,i){return nL(n,e,t,hQ(i),fQ(i))}function HE(n){return n!=null?Ps(n)?n:[n]:[]}function bQ(n,e,t){let i=n[0],s=n[1],o;return s=t-e?[e,t]:[i=Math.min(Math.max(i,e),t-o),i+o]}function gr(n){return typeof n=="function"}const vQ="descending";function zW(n,e,t){t=t||{},e=HE(e)||[];const i=[],s=[],o={},r=t.comparator||yQ;return HE(n).forEach((a,l)=>{a!=null&&(i.push(e[l]===vQ?-1:1),s.push(a=gr(a)?a:tL(a,null,t)),(aQ(a)||[]).forEach(c=>o[c]=1))}),s.length===0?null:uu(r(s,i),Object.keys(o))}const HW=(n,e)=>(ne||e==null)&&n!=null?1:(e=e instanceof Date?+e:e,(n=n instanceof Date?+n:n)!==n&&e===e?-1:e!==e&&n===n?1:0),yQ=(n,e)=>n.length===1?wQ(n[0],e[0]):CQ(n,e,n.length),wQ=(n,e)=>function(t,i){return HW(n(t),n(i))*e},CQ=(n,e,t)=>(e.push(0),function(i,s){let o,r=0,a=-1;for(;r===0&&++ato(n)||LQ(n)?n:Date.parse(n);function IQ(n,e){return e=e||AQ,n==null||n===""?null:e(n)}function TQ(n){return n==null||n===""?null:n+""}function ZC(n){const e={},t=n.length;for(let i=0;i9999?"+"+fo(n,6):fo(n,4)}function MQ(n){var e=n.getUTCHours(),t=n.getUTCMinutes(),i=n.getUTCSeconds(),s=n.getUTCMilliseconds();return isNaN(n)?"Invalid Date":RQ(n.getUTCFullYear())+"-"+fo(n.getUTCMonth()+1,2)+"-"+fo(n.getUTCDate(),2)+(s?"T"+fo(e,2)+":"+fo(t,2)+":"+fo(i,2)+"."+fo(s,3)+"Z":i?"T"+fo(e,2)+":"+fo(t,2)+":"+fo(i,2)+"Z":t||e?"T"+fo(e,2)+":"+fo(t,2)+"Z":"")}function jW(n){var e=new RegExp('["'+n+` -\r]`),t=n.charCodeAt(0);function i(u,h){var f,g,p=s(u,function(_,v){if(f)return f(_,v-1);g=_,f=h?NQ(_,h):UW(_)});return p.columns=g||[],p}function s(u,h){var f=[],g=u.length,p=0,_=0,v,b=g<=0,y=!1;u.charCodeAt(g-1)===p0&&--g,u.charCodeAt(g-1)===xk&&--g;function w(){if(b)return Ck;if(y)return y=!1,U5;var L,x=p,D;if(u.charCodeAt(x)===Sk){for(;p++=g?b=!0:(D=u.charCodeAt(p++))===p0?y=!0:D===xk&&(y=!0,u.charCodeAt(p)===p0&&++p),u.slice(x+1,L-1).replace(/""/g,'"')}for(;pn())};let WC=!1;vc&&(WC=(Fi.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(Fi.readyState),WC||Fi.addEventListener("DOMContentLoaded",CW));function cX(n){vc&&(WC?setTimeout(n,0):wW.push(n))}function p1(n){const{tag:e,attributes:t={},children:i=[]}=n;return typeof n=="string"?vW(n):"<".concat(e," ").concat(sX(t),">").concat(i.map(p1).join(""),"")}function x5(n,e,t){if(n&&n[e]&&n[e][t])return{prefix:e,iconName:t,icon:n[e][t]}}var fk=function(e,t,i,s){var o=Object.keys(e),r=o.length,a=t,l,c,d;for(i===void 0?(l=1,d=e[o[0]]):(l=0,d=i);l=55296&&s<=56319&&t=55296&&i<=56319&&t>e+1&&(s=n.charCodeAt(e+1),s>=56320&&s<=57343)?(i-55296)*1024+s-56320+65536:i}function L5(n){return Object.keys(n).reduce((e,t)=>{const i=n[t];return!!i.icon?e[i.iconName]=i.icon:e[t]=i,e},{})}function TE(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{skipHooks:i=!1}=t,s=L5(e);typeof Oa.hooks.addPack=="function"&&!i?Oa.hooks.addPack(n,L5(e)):Oa.styles[n]={...Oa.styles[n]||{},...s},n==="fas"&&TE("fa",e)}const{styles:ah,shims:hX}=Oa,fX={[$i]:Object.values($h[$i]),[Bo]:Object.values($h[Bo]),[Wo]:Object.values($h[Wo])};let aM=null,SW={},xW={},LW={},DW={},kW={};const gX={[$i]:Object.keys(Hh[$i]),[Bo]:Object.keys(Hh[Bo]),[Wo]:Object.keys(Hh[Wo])};function pX(n){return~QZ.indexOf(n)}function mX(n,e){const t=e.split("-"),i=t[0],s=t.slice(1).join("-");return i===n&&s!==""&&!pX(s)?s:null}const EW=()=>{const n=i=>fk(ah,(s,o,r)=>(s[r]=fk(o,i,{}),s),{});SW=n((i,s,o)=>(s[3]&&(i[s[3]]=o),s[2]&&s[2].filter(a=>typeof a=="number").forEach(a=>{i[a.toString(16)]=o}),i)),xW=n((i,s,o)=>(i[o]=o,s[2]&&s[2].filter(a=>typeof a=="string").forEach(a=>{i[a]=o}),i)),kW=n((i,s,o)=>{const r=s[2];return i[o]=o,r.forEach(a=>{i[a]=o}),i});const e="far"in ah||Be.autoFetchSvg,t=fk(hX,(i,s)=>{const o=s[0];let r=s[1];const a=s[2];return r==="far"&&!e&&(r="fas"),typeof o=="string"&&(i.names[o]={prefix:r,iconName:a}),typeof o=="number"&&(i.unicodes[o.toString(16)]={prefix:r,iconName:a}),i},{names:{},unicodes:{}});LW=t.names,DW=t.unicodes,aM=jx(Be.styleDefault,{family:Be.familyDefault})};tX(n=>{aM=jx(n.styleDefault,{family:Be.familyDefault})});EW();function lM(n,e){return(SW[n]||{})[e]}function _X(n,e){return(xW[n]||{})[e]}function ad(n,e){return(kW[n]||{})[e]}function AW(n){return LW[n]||{prefix:null,iconName:null}}function bX(n){const e=DW[n],t=lM("fas",n);return e||(t?{prefix:"fas",iconName:t}:null)||{prefix:null,iconName:null}}function Hd(){return aM}const cM=()=>({prefix:null,iconName:null,rest:[]});function jx(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{family:t=$i}=e,i=Hh[t][n],s=cb[t][n]||cb[t][i],o=n in Oa.styles?n:null;return s||o||null}const vX={[$i]:Object.keys($h[$i]),[Bo]:Object.keys($h[Bo]),[Wo]:Object.keys($h[Wo])};function qx(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{skipLookups:t=!1}=e,i={[$i]:"".concat(Be.cssPrefix,"-").concat($i),[Bo]:"".concat(Be.cssPrefix,"-").concat(Bo),[Wo]:"".concat(Be.cssPrefix,"-").concat(Wo)};let s=null,o=$i;const r=kZ.filter(l=>l!==cW);r.forEach(l=>{(n.includes(i[l])||n.some(c=>vX[l].includes(c)))&&(o=l)});const a=n.reduce((l,c)=>{const d=mX(Be.cssPrefix,c);if(ah[c]?(c=fX[o].includes(c)?GZ[o][c]:c,s=c,l.prefix=c):gX[o].indexOf(c)>-1?(s=c,l.prefix=jx(c,{family:o})):d?l.iconName=d:c!==Be.replacementClass&&!r.some(u=>c===i[u])&&l.rest.push(c),!t&&l.prefix&&l.iconName){const u=s==="fa"?AW(l.iconName):{},h=ad(l.prefix,l.iconName);u.prefix&&(s=null),l.iconName=u.iconName||h||l.iconName,l.prefix=u.prefix||l.prefix,l.prefix==="far"&&!ah.far&&ah.fas&&!Be.autoFetchSvg&&(l.prefix="fas")}return l},cM());return(n.includes("fa-brands")||n.includes("fab"))&&(a.prefix="fab"),(n.includes("fa-duotone")||n.includes("fad"))&&(a.prefix="fad"),!a.prefix&&o===Bo&&(ah.fass||Be.autoFetchSvg)&&(a.prefix="fass",a.iconName=ad(a.prefix,a.iconName)||a.iconName),!a.prefix&&o===Wo&&(ah.fasds||Be.autoFetchSvg)&&(a.prefix="fasds",a.iconName=ad(a.prefix,a.iconName)||a.iconName),(a.prefix==="fa"||s==="fa")&&(a.prefix=Hd()||"fas"),a}class yX{constructor(){this.definitions={}}add(){for(var e=arguments.length,t=new Array(e),i=0;i{this.definitions[o]={...this.definitions[o]||{},...s[o]},TE(o,s[o]);const r=$h[$i][o];r&&TE(r,s[o]),EW()})}reset(){this.definitions={}}_pullDefinitions(e,t){const i=t.prefix&&t.iconName&&t.icon?{0:t}:t;return Object.keys(i).map(s=>{const{prefix:o,iconName:r,icon:a}=i[s],l=a[2];e[o]||(e[o]={}),l.length>0&&l.forEach(c=>{typeof c=="string"&&(e[o][c]=a)}),e[o][r]=a}),e}}let D5=[],Mg={};const cp={},wX=Object.keys(cp);function CX(n,e){let{mixoutsTo:t}=e;return D5=n,Mg={},Object.keys(cp).forEach(i=>{wX.indexOf(i)===-1&&delete cp[i]}),D5.forEach(i=>{const s=i.mixout?i.mixout():{};if(Object.keys(s).forEach(o=>{typeof s[o]=="function"&&(t[o]=s[o]),typeof s[o]=="object"&&Object.keys(s[o]).forEach(r=>{t[o]||(t[o]={}),t[o][r]=s[o][r]})}),i.hooks){const o=i.hooks();Object.keys(o).forEach(r=>{Mg[r]||(Mg[r]=[]),Mg[r].push(o[r])})}i.provides&&i.provides(cp)}),t}function NE(n,e){for(var t=arguments.length,i=new Array(t>2?t-2:0),s=2;s{e=r.apply(null,[e,...i])}),e}function hf(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i{o.apply(null,t)})}function $d(){const n=arguments[0],e=Array.prototype.slice.call(arguments,1);return cp[n]?cp[n].apply(null,e):void 0}function RE(n){n.prefix==="fa"&&(n.prefix="fas");let{iconName:e}=n;const t=n.prefix||Hd();if(e)return e=ad(t,e)||e,x5(IW.definitions,t,e)||x5(Oa.styles,t,e)}const IW=new yX,SX=()=>{Be.autoReplaceSvg=!1,Be.observeMutations=!1,hf("noAuto")},xX={i2svg:function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return vc?(hf("beforeI2svg",n),$d("pseudoElements2svg",n),$d("i2svg",n)):Promise.reject(new Error("Operation requires a DOM of some kind."))},watch:function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{autoReplaceSvgRoot:e}=n;Be.autoReplaceSvg===!1&&(Be.autoReplaceSvg=!0),Be.observeMutations=!0,cX(()=>{DX({autoReplaceSvgRoot:e}),hf("watch",n)})}},LX={icon:n=>{if(n===null)return null;if(typeof n=="object"&&n.prefix&&n.iconName)return{prefix:n.prefix,iconName:ad(n.prefix,n.iconName)||n.iconName};if(Array.isArray(n)&&n.length===2){const e=n[1].indexOf("fa-")===0?n[1].slice(3):n[1],t=jx(n[0]);return{prefix:t,iconName:ad(t,e)||e}}if(typeof n=="string"&&(n.indexOf("".concat(Be.cssPrefix,"-"))>-1||n.match(KZ))){const e=qx(n.split(" "),{skipLookups:!0});return{prefix:e.prefix||Hd(),iconName:ad(e.prefix,e.iconName)||e.iconName}}if(typeof n=="string"){const e=Hd();return{prefix:e,iconName:ad(e,n)||n}}}},Yo={noAuto:SX,config:Be,dom:xX,parse:LX,library:IW,findIconDefinition:RE,toHtml:p1},DX=function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{autoReplaceSvgRoot:e=Fi}=n;(Object.keys(Oa.styles).length>0||Be.autoFetchSvg)&&vc&&Be.autoReplaceSvg&&Yo.dom.i2svg({node:e})};function Gx(n,e){return Object.defineProperty(n,"abstract",{get:e}),Object.defineProperty(n,"html",{get:function(){return n.abstract.map(t=>p1(t))}}),Object.defineProperty(n,"node",{get:function(){if(!vc)return;const t=Fi.createElement("div");return t.innerHTML=n.html,t.children}}),n}function kX(n){let{children:e,main:t,mask:i,attributes:s,styles:o,transform:r}=n;if(rM(r)&&t.found&&!i.found){const{width:a,height:l}=t,c={x:a/l/2,y:.5};s.style=Ux({...o,"transform-origin":"".concat(c.x+r.x/16,"em ").concat(c.y+r.y/16,"em")})}return[{tag:"svg",attributes:s,children:e}]}function EX(n){let{prefix:e,iconName:t,children:i,attributes:s,symbol:o}=n;const r=o===!0?"".concat(e,"-").concat(Be.cssPrefix,"-").concat(t):o;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:{...s,id:r},children:i}]}]}function dM(n){const{icons:{main:e,mask:t},prefix:i,iconName:s,transform:o,symbol:r,title:a,maskId:l,titleId:c,extra:d,watchable:u=!1}=n,{width:h,height:f}=t.found?t:e,g=i==="fak",p=[Be.replacementClass,s?"".concat(Be.cssPrefix,"-").concat(s):""].filter(S=>d.classes.indexOf(S)===-1).filter(S=>S!==""||!!S).concat(d.classes).join(" ");let _={children:[],attributes:{...d.attributes,"data-prefix":i,"data-icon":s,class:p,role:d.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(h," ").concat(f)}};const v=g&&!~d.classes.indexOf("fa-fw")?{width:"".concat(h/f*16*.0625,"em")}:{};u&&(_.attributes[uf]=""),a&&(_.children.push({tag:"title",attributes:{id:_.attributes["aria-labelledby"]||"title-".concat(c||db())},children:[a]}),delete _.attributes.title);const b={..._,prefix:i,iconName:s,main:e,mask:t,maskId:l,transform:o,symbol:r,styles:{...v,...d.styles}},{children:y,attributes:w}=t.found&&e.found?$d("generateAbstractMask",b)||{children:[],attributes:{}}:$d("generateAbstractIcon",b)||{children:[],attributes:{}};return b.children=y,b.attributes=w,r?EX(b):kX(b)}function k5(n){const{content:e,width:t,height:i,transform:s,title:o,extra:r,watchable:a=!1}=n,l={...r.attributes,...o?{title:o}:{},class:r.classes.join(" ")};a&&(l[uf]="");const c={...r.styles};rM(s)&&(c.transform=rX({transform:s,startCentered:!0,width:t,height:i}),c["-webkit-transform"]=c.transform);const d=Ux(c);d.length>0&&(l.style=d);const u=[];return u.push({tag:"span",attributes:l,children:[e]}),o&&u.push({tag:"span",attributes:{class:"sr-only"},children:[o]}),u}function AX(n){const{content:e,title:t,extra:i}=n,s={...i.attributes,...t?{title:t}:{},class:i.classes.join(" ")},o=Ux(i.styles);o.length>0&&(s.style=o);const r=[];return r.push({tag:"span",attributes:s,children:[e]}),t&&r.push({tag:"span",attributes:{class:"sr-only"},children:[t]}),r}const{styles:gk}=Oa;function ME(n){const e=n[0],t=n[1],[i]=n.slice(4);let s=null;return Array.isArray(i)?s={tag:"g",attributes:{class:"".concat(Be.cssPrefix,"-").concat(uk.GROUP)},children:[{tag:"path",attributes:{class:"".concat(Be.cssPrefix,"-").concat(uk.SECONDARY),fill:"currentColor",d:i[0]}},{tag:"path",attributes:{class:"".concat(Be.cssPrefix,"-").concat(uk.PRIMARY),fill:"currentColor",d:i[1]}}]}:s={tag:"path",attributes:{fill:"currentColor",d:i}},{found:!0,width:e,height:t,icon:s}}const IX={found:!1,width:512,height:512};function TX(n,e){!gW&&!Be.showMissingIcons&&n&&console.error('Icon with name "'.concat(n,'" and prefix "').concat(e,'" is missing.'))}function PE(n,e){let t=e;return e==="fa"&&Be.styleDefault!==null&&(e=Hd()),new Promise((i,s)=>{if(t==="fa"){const o=AW(n)||{};n=o.iconName||n,e=o.prefix||e}if(n&&e&&gk[e]&&gk[e][n]){const o=gk[e][n];return i(ME(o))}TX(n,e),i({...IX,icon:Be.showMissingIcons&&n?$d("missingIconAbstract")||{}:{}})})}const E5=()=>{},OE=Be.measurePerformance&&Sy&&Sy.mark&&Sy.measure?Sy:{mark:E5,measure:E5},J0='FA "6.6.0"',NX=n=>(OE.mark("".concat(J0," ").concat(n," begins")),()=>TW(n)),TW=n=>{OE.mark("".concat(J0," ").concat(n," ends")),OE.measure("".concat(J0," ").concat(n),"".concat(J0," ").concat(n," begins"),"".concat(J0," ").concat(n," ends"))};var uM={begin:NX,end:TW};const Gw=()=>{};function A5(n){return typeof(n.getAttribute?n.getAttribute(uf):null)=="string"}function RX(n){const e=n.getAttribute?n.getAttribute(nM):null,t=n.getAttribute?n.getAttribute(sM):null;return e&&t}function MX(n){return n&&n.classList&&n.classList.contains&&n.classList.contains(Be.replacementClass)}function PX(){return Be.autoReplaceSvg===!0?Kw.replace:Kw[Be.autoReplaceSvg]||Kw.replace}function OX(n){return Fi.createElementNS("http://www.w3.org/2000/svg",n)}function FX(n){return Fi.createElement(n)}function NW(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{ceFn:t=n.tag==="svg"?OX:FX}=e;if(typeof n=="string")return Fi.createTextNode(n);const i=t(n.tag);return Object.keys(n.attributes||[]).forEach(function(o){i.setAttribute(o,n.attributes[o])}),(n.children||[]).forEach(function(o){i.appendChild(NW(o,{ceFn:t}))}),i}function BX(n){let e=" ".concat(n.outerHTML," ");return e="".concat(e,"Font Awesome fontawesome.com "),e}const Kw={replace:function(n){const e=n[0];if(e.parentNode)if(n[1].forEach(t=>{e.parentNode.insertBefore(NW(t),e)}),e.getAttribute(uf)===null&&Be.keepOriginalSource){let t=Fi.createComment(BX(e));e.parentNode.replaceChild(t,e)}else e.remove()},nest:function(n){const e=n[0],t=n[1];if(~oM(e).indexOf(Be.replacementClass))return Kw.replace(n);const i=new RegExp("".concat(Be.cssPrefix,"-.*"));if(delete t[0].attributes.id,t[0].attributes.class){const o=t[0].attributes.class.split(" ").reduce((r,a)=>(a===Be.replacementClass||a.match(i)?r.toSvg.push(a):r.toNode.push(a),r),{toNode:[],toSvg:[]});t[0].attributes.class=o.toSvg.join(" "),o.toNode.length===0?e.removeAttribute("class"):e.setAttribute("class",o.toNode.join(" "))}const s=t.map(o=>p1(o)).join(` +`);e.setAttribute(uf,""),e.innerHTML=s}};function I5(n){n()}function RW(n,e){const t=typeof e=="function"?e:Gw;if(n.length===0)t();else{let i=I5;Be.mutateApproach===jZ&&(i=zd.requestAnimationFrame||I5),i(()=>{const s=PX(),o=uM.begin("mutate");n.map(s),o(),t()})}}let hM=!1;function MW(){hM=!0}function FE(){hM=!1}let VC=null;function T5(n){if(!v5||!Be.observeMutations)return;const{treeCallback:e=Gw,nodeCallback:t=Gw,pseudoElementsCallback:i=Gw,observeMutationsRoot:s=Fi}=n;VC=new v5(o=>{if(hM)return;const r=Hd();Ym(o).forEach(a=>{if(a.type==="childList"&&a.addedNodes.length>0&&!A5(a.addedNodes[0])&&(Be.searchPseudoElements&&i(a.target),e(a.target)),a.type==="attributes"&&a.target.parentNode&&Be.searchPseudoElements&&i(a.target.parentNode),a.type==="attributes"&&A5(a.target)&&~XZ.indexOf(a.attributeName))if(a.attributeName==="class"&&RX(a.target)){const{prefix:l,iconName:c}=qx(oM(a.target));a.target.setAttribute(nM,l||r),c&&a.target.setAttribute(sM,c)}else MX(a.target)&&t(a.target)})}),vc&&VC.observe(s,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}function WX(){VC&&VC.disconnect()}function VX(n){const e=n.getAttribute("style");let t=[];return e&&(t=e.split(";").reduce((i,s)=>{const o=s.split(":"),r=o[0],a=o.slice(1);return r&&a.length>0&&(i[r]=a.join(":").trim()),i},{})),t}function zX(n){const e=n.getAttribute("data-prefix"),t=n.getAttribute("data-icon"),i=n.innerText!==void 0?n.innerText.trim():"";let s=qx(oM(n));return s.prefix||(s.prefix=Hd()),e&&t&&(s.prefix=e,s.iconName=t),s.iconName&&s.prefix||(s.prefix&&i.length>0&&(s.iconName=_X(s.prefix,n.innerText)||lM(s.prefix,IE(n.innerText))),!s.iconName&&Be.autoFetchSvg&&n.firstChild&&n.firstChild.nodeType===Node.TEXT_NODE&&(s.iconName=n.firstChild.data)),s}function HX(n){const e=Ym(n.attributes).reduce((s,o)=>(s.name!=="class"&&s.name!=="style"&&(s[o.name]=o.value),s),{}),t=n.getAttribute("title"),i=n.getAttribute("data-fa-title-id");return Be.autoA11y&&(t?e["aria-labelledby"]="".concat(Be.replacementClass,"-title-").concat(i||db()):(e["aria-hidden"]="true",e.focusable="false")),e}function $X(){return{iconName:null,title:null,titleId:null,prefix:null,transform:Pa,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}}}function N5(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{styleParser:!0};const{iconName:t,prefix:i,rest:s}=zX(n),o=HX(n),r=NE("parseNodeAttributes",{},n);let a=e.styleParser?VX(n):[];return{iconName:t,title:n.getAttribute("title"),titleId:n.getAttribute("data-fa-title-id"),prefix:i,transform:Pa,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:s,styles:a,attributes:o},...r}}const{styles:UX}=Oa;function PW(n){const e=Be.autoReplaceSvg==="nest"?N5(n,{styleParser:!1}):N5(n);return~e.extra.classes.indexOf(_W)?$d("generateLayersText",n,e):$d("generateSvgReplacementMutation",n,e)}let Qa=new Set;pW.map(n=>{Qa.add("fa-".concat(n))});Object.keys(Hh[$i]).map(Qa.add.bind(Qa));Object.keys(Hh[Bo]).map(Qa.add.bind(Qa));Object.keys(Hh[Wo]).map(Qa.add.bind(Qa));Qa=[...Qa];function R5(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!vc)return Promise.resolve();const t=Fi.documentElement.classList,i=d=>t.add("".concat(C5,"-").concat(d)),s=d=>t.remove("".concat(C5,"-").concat(d)),o=Be.autoFetchSvg?Qa:pW.map(d=>"fa-".concat(d)).concat(Object.keys(UX));o.includes("fa")||o.push("fa");const r=[".".concat(_W,":not([").concat(uf,"])")].concat(o.map(d=>".".concat(d,":not([").concat(uf,"])"))).join(", ");if(r.length===0)return Promise.resolve();let a=[];try{a=Ym(n.querySelectorAll(r))}catch{}if(a.length>0)i("pending"),s("complete");else return Promise.resolve();const l=uM.begin("onTree"),c=a.reduce((d,u)=>{try{const h=PW(u);h&&d.push(h)}catch(h){gW||h.name==="MissingIcon"&&console.error(h)}return d},[]);return new Promise((d,u)=>{Promise.all(c).then(h=>{RW(h,()=>{i("active"),i("complete"),s("pending"),typeof e=="function"&&e(),l(),d()})}).catch(h=>{l(),u(h)})})}function jX(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;PW(n).then(t=>{t&&RW([t],e)})}function qX(n){return function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const i=(e||{}).icon?e:RE(e||{});let{mask:s}=t;return s&&(s=(s||{}).icon?s:RE(s||{})),n(i,{...t,mask:s})}}const GX=function(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{transform:t=Pa,symbol:i=!1,mask:s=null,maskId:o=null,title:r=null,titleId:a=null,classes:l=[],attributes:c={},styles:d={}}=e;if(!n)return;const{prefix:u,iconName:h,icon:f}=n;return Gx({type:"icon",...n},()=>(hf("beforeDOMElementCreation",{iconDefinition:n,params:e}),Be.autoA11y&&(r?c["aria-labelledby"]="".concat(Be.replacementClass,"-title-").concat(a||db()):(c["aria-hidden"]="true",c.focusable="false")),dM({icons:{main:ME(f),mask:s?ME(s.icon):{found:!1,width:null,height:null,icon:{}}},prefix:u,iconName:h,transform:{...Pa,...t},symbol:i,title:r,maskId:o,titleId:a,extra:{attributes:c,styles:d,classes:l}})))};var KX={mixout(){return{icon:qX(GX)}},hooks(){return{mutationObserverCallbacks(n){return n.treeCallback=R5,n.nodeCallback=jX,n}}},provides(n){n.i2svg=function(e){const{node:t=Fi,callback:i=()=>{}}=e;return R5(t,i)},n.generateSvgReplacementMutation=function(e,t){const{iconName:i,title:s,titleId:o,prefix:r,transform:a,symbol:l,mask:c,maskId:d,extra:u}=t;return new Promise((h,f)=>{Promise.all([PE(i,r),c.iconName?PE(c.iconName,c.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then(g=>{let[p,_]=g;h([e,dM({icons:{main:p,mask:_},prefix:r,iconName:i,transform:a,symbol:l,maskId:d,title:s,titleId:o,extra:u,watchable:!0})])}).catch(f)})},n.generateAbstractIcon=function(e){let{children:t,attributes:i,main:s,transform:o,styles:r}=e;const a=Ux(r);a.length>0&&(i.style=a);let l;return rM(o)&&(l=$d("generateAbstractTransformGrouping",{main:s,transform:o,containerWidth:s.width,iconWidth:s.width})),t.push(l||s.icon),{children:t,attributes:i}}}},YX={mixout(){return{layer(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{classes:t=[]}=e;return Gx({type:"layer"},()=>{hf("beforeDOMElementCreation",{assembler:n,params:e});let i=[];return n(s=>{Array.isArray(s)?s.map(o=>{i=i.concat(o.abstract)}):i=i.concat(s.abstract)}),[{tag:"span",attributes:{class:["".concat(Be.cssPrefix,"-layers"),...t].join(" ")},children:i}]})}}}},ZX={mixout(){return{counter(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{title:t=null,classes:i=[],attributes:s={},styles:o={}}=e;return Gx({type:"counter",content:n},()=>(hf("beforeDOMElementCreation",{content:n,params:e}),AX({content:n.toString(),title:t,extra:{attributes:s,styles:o,classes:["".concat(Be.cssPrefix,"-layers-counter"),...i]}})))}}}},XX={mixout(){return{text(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{transform:t=Pa,title:i=null,classes:s=[],attributes:o={},styles:r={}}=e;return Gx({type:"text",content:n},()=>(hf("beforeDOMElementCreation",{content:n,params:e}),k5({content:n,transform:{...Pa,...t},title:i,extra:{attributes:o,styles:r,classes:["".concat(Be.cssPrefix,"-layers-text"),...s]}})))}}},provides(n){n.generateLayersText=function(e,t){const{title:i,transform:s,extra:o}=t;let r=null,a=null;if(lW){const l=parseInt(getComputedStyle(e).fontSize,10),c=e.getBoundingClientRect();r=c.width/l,a=c.height/l}return Be.autoA11y&&!i&&(o.attributes["aria-hidden"]="true"),Promise.resolve([e,k5({content:e.innerHTML,width:r,height:a,transform:s,title:i,extra:o,watchable:!0})])}}};const QX=new RegExp('"',"ug"),M5=[1105920,1112319],P5={FontAwesome:{normal:"fas",400:"fas"},...RZ,...NZ,...zZ},BE=Object.keys(P5).reduce((n,e)=>(n[e.toLowerCase()]=P5[e],n),{}),JX=Object.keys(BE).reduce((n,e)=>{const t=BE[e];return n[e]=t[900]||[...Object.entries(t)][0][1],n},{});function eQ(n){const e=n.replace(QX,""),t=uX(e,0),i=t>=M5[0]&&t<=M5[1],s=e.length===2?e[0]===e[1]:!1;return{value:IE(s?e[0]:e),isSecondary:i||s}}function tQ(n,e){const t=n.replace(/^['"]|['"]$/g,"").toLowerCase(),i=parseInt(e),s=isNaN(i)?"normal":i;return(BE[t]||{})[s]||JX[t]}function O5(n,e){const t="".concat(UZ).concat(e.replace(":","-"));return new Promise((i,s)=>{if(n.getAttribute(t)!==null)return i();const r=Ym(n.children).filter(h=>h.getAttribute(DE)===e)[0],a=zd.getComputedStyle(n,e),l=a.getPropertyValue("font-family"),c=l.match(YZ),d=a.getPropertyValue("font-weight"),u=a.getPropertyValue("content");if(r&&!c)return n.removeChild(r),i();if(c&&u!=="none"&&u!==""){const h=a.getPropertyValue("content");let f=tQ(l,d);const{value:g,isSecondary:p}=eQ(h),_=c[0].startsWith("FontAwesome");let v=lM(f,g),b=v;if(_){const y=bX(g);y.iconName&&y.prefix&&(v=y.iconName,f=y.prefix)}if(v&&!p&&(!r||r.getAttribute(nM)!==f||r.getAttribute(sM)!==b)){n.setAttribute(t,b),r&&n.removeChild(r);const y=$X(),{extra:w}=y;w.attributes[DE]=e,PE(v,f).then(S=>{const L=dM({...y,icons:{main:S,mask:cM()},prefix:f,iconName:b,extra:w,watchable:!0}),x=Fi.createElementNS("http://www.w3.org/2000/svg","svg");e==="::before"?n.insertBefore(x,n.firstChild):n.appendChild(x),x.outerHTML=L.map(D=>p1(D)).join(` +`),n.removeAttribute(t),i()}).catch(s)}else i()}else i()})}function iQ(n){return Promise.all([O5(n,"::before"),O5(n,"::after")])}function nQ(n){return n.parentNode!==document.head&&!~qZ.indexOf(n.tagName.toUpperCase())&&!n.getAttribute(DE)&&(!n.parentNode||n.parentNode.tagName!=="svg")}function F5(n){if(vc)return new Promise((e,t)=>{const i=Ym(n.querySelectorAll("*")).filter(nQ).map(iQ),s=uM.begin("searchPseudoElements");MW(),Promise.all(i).then(()=>{s(),FE(),e()}).catch(()=>{s(),FE(),t()})})}var sQ={hooks(){return{mutationObserverCallbacks(n){return n.pseudoElementsCallback=F5,n}}},provides(n){n.pseudoElements2svg=function(e){const{node:t=Fi}=e;Be.searchPseudoElements&&F5(t)}}};let B5=!1;var oQ={mixout(){return{dom:{unwatch(){MW(),B5=!0}}}},hooks(){return{bootstrap(){T5(NE("mutationObserverCallbacks",{}))},noAuto(){WX()},watch(n){const{observeMutationsRoot:e}=n;B5?FE():T5(NE("mutationObserverCallbacks",{observeMutationsRoot:e}))}}}};const W5=n=>{let e={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return n.toLowerCase().split(" ").reduce((t,i)=>{const s=i.toLowerCase().split("-"),o=s[0];let r=s.slice(1).join("-");if(o&&r==="h")return t.flipX=!0,t;if(o&&r==="v")return t.flipY=!0,t;if(r=parseFloat(r),isNaN(r))return t;switch(o){case"grow":t.size=t.size+r;break;case"shrink":t.size=t.size-r;break;case"left":t.x=t.x-r;break;case"right":t.x=t.x+r;break;case"up":t.y=t.y-r;break;case"down":t.y=t.y+r;break;case"rotate":t.rotate=t.rotate+r;break}return t},e)};var rQ={mixout(){return{parse:{transform:n=>W5(n)}}},hooks(){return{parseNodeAttributes(n,e){const t=e.getAttribute("data-fa-transform");return t&&(n.transform=W5(t)),n}}},provides(n){n.generateAbstractTransformGrouping=function(e){let{main:t,transform:i,containerWidth:s,iconWidth:o}=e;const r={transform:"translate(".concat(s/2," 256)")},a="translate(".concat(i.x*32,", ").concat(i.y*32,") "),l="scale(".concat(i.size/16*(i.flipX?-1:1),", ").concat(i.size/16*(i.flipY?-1:1),") "),c="rotate(".concat(i.rotate," 0 0)"),d={transform:"".concat(a," ").concat(l," ").concat(c)},u={transform:"translate(".concat(o/2*-1," -256)")},h={outer:r,inner:d,path:u};return{tag:"g",attributes:{...h.outer},children:[{tag:"g",attributes:{...h.inner},children:[{tag:t.icon.tag,children:t.icon.children,attributes:{...t.icon.attributes,...h.path}}]}]}}}};const pk={x:0,y:0,width:"100%",height:"100%"};function V5(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return n.attributes&&(n.attributes.fill||e)&&(n.attributes.fill="black"),n}function aQ(n){return n.tag==="g"?n.children:[n]}var lQ={hooks(){return{parseNodeAttributes(n,e){const t=e.getAttribute("data-fa-mask"),i=t?qx(t.split(" ").map(s=>s.trim())):cM();return i.prefix||(i.prefix=Hd()),n.mask=i,n.maskId=e.getAttribute("data-fa-mask-id"),n}}},provides(n){n.generateAbstractMask=function(e){let{children:t,attributes:i,main:s,mask:o,maskId:r,transform:a}=e;const{width:l,icon:c}=s,{width:d,icon:u}=o,h=oX({transform:a,containerWidth:d,iconWidth:l}),f={tag:"rect",attributes:{...pk,fill:"white"}},g=c.children?{children:c.children.map(V5)}:{},p={tag:"g",attributes:{...h.inner},children:[V5({tag:c.tag,attributes:{...c.attributes,...h.path},...g})]},_={tag:"g",attributes:{...h.outer},children:[p]},v="mask-".concat(r||db()),b="clip-".concat(r||db()),y={tag:"mask",attributes:{...pk,id:v,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"},children:[f,_]},w={tag:"defs",children:[{tag:"clipPath",attributes:{id:b},children:aQ(u)},y]};return t.push(w,{tag:"rect",attributes:{fill:"currentColor","clip-path":"url(#".concat(b,")"),mask:"url(#".concat(v,")"),...pk}}),{children:t,attributes:i}}}},cQ={provides(n){let e=!1;zd.matchMedia&&(e=zd.matchMedia("(prefers-reduced-motion: reduce)").matches),n.missingIconAbstract=function(){const t=[],i={fill:"currentColor"},s={attributeType:"XML",repeatCount:"indefinite",dur:"2s"};t.push({tag:"path",attributes:{...i,d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"}});const o={...s,attributeName:"opacity"},r={tag:"circle",attributes:{...i,cx:"256",cy:"364",r:"28"},children:[]};return e||r.children.push({tag:"animate",attributes:{...s,attributeName:"r",values:"28;14;28;28;14;28;"}},{tag:"animate",attributes:{...o,values:"1;0;1;1;0;1;"}}),t.push(r),t.push({tag:"path",attributes:{...i,opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"},children:e?[]:[{tag:"animate",attributes:{...o,values:"1;0;0;0;0;1;"}}]}),e||t.push({tag:"path",attributes:{...i,opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"},children:[{tag:"animate",attributes:{...o,values:"0;0;1;1;0;0;"}}]}),{tag:"g",attributes:{class:"missing"},children:t}}}},dQ={hooks(){return{parseNodeAttributes(n,e){const t=e.getAttribute("data-fa-symbol"),i=t===null?!1:t===""?!0:t;return n.symbol=i,n}}}},uQ=[lX,KX,YX,ZX,XX,sQ,oQ,rQ,lQ,cQ,dQ];CX(uQ,{mixoutsTo:Yo});Yo.noAuto;Yo.config;Yo.library;Yo.dom;Yo.parse;Yo.findIconDefinition;Yo.toHtml;const mk=Yo.icon;Yo.layer;Yo.text;Yo.counter;const hQ={prefix:"fas",iconName:"table-columns",icon:[512,512,["columns"],"f0db","M0 96C0 60.7 28.7 32 64 32l384 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zm64 64l0 256 160 0 0-256L64 160zm384 0l-160 0 0 256 160 0 0-256z"]},fQ=hQ,gQ={prefix:"fas",iconName:"circle-question",icon:[512,512,[62108,"question-circle"],"f059","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM169.8 165.3c7.9-22.3 29.1-37.3 52.8-37.3l58.3 0c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L280 264.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24l0-13.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1l-58.3 0c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]},pQ=gQ,mQ={prefix:"fas",iconName:"indent",icon:[448,512,[],"f03c","M0 64C0 46.3 14.3 32 32 32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 96C14.3 96 0 81.7 0 64zM192 192c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32zm32 96l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zM0 448c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 480c-17.7 0-32-14.3-32-32zM127.8 268.6L25.8 347.9C15.3 356.1 0 348.6 0 335.3L0 176.7c0-13.3 15.3-20.8 25.8-12.6l101.9 79.3c8.2 6.4 8.2 18.9 0 25.3z"]};function hu(n,e,t){return n.fields=e||[],n.fname=t,n}function _Q(n){return n==null?null:n.fname}function bQ(n){return n==null?null:n.fields}function vQ(n){return n.length===1?yQ(n[0]):wQ(n)}const yQ=n=>function(e){return e[n]},wQ=n=>{const e=n.length;return function(t){for(let i=0;ir?c():r=a+1:l==="["?(a>r&&c(),s=r=a+1):l==="]"&&(s||In("Access path missing open bracket: "+n),s>0&&c(),s=0,r=a+1)}return s&&In("Access path missing closing bracket: "+n),i&&In("Access path missing closing quote: "+n),a>r&&(a++,c()),e}function Kx(n,e,t){const i=CQ(n);return n=i.length===1?i[0]:n,hu((t&&t.get||vQ)(i),[n],e||n)}Kx("id");const Yx=hu(n=>n,[],"identity");hu(()=>0,[],"zero");hu(()=>1,[],"one");hu(()=>!0,[],"true");hu(()=>!1,[],"false");var cs=Array.isArray;function Ms(n){return n===Object(n)}function ia(n){return n[n.length-1]}function ub(n){return n==null||n===""?null:+n}const OW=n=>e=>n*Math.exp(e),FW=n=>e=>Math.log(n*e),SQ=n=>e=>Math.sign(e)*Math.log1p(Math.abs(e/n)),xQ=n=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*n,zC=n=>e=>e<0?-Math.pow(-e,n):Math.pow(e,n);function fM(n,e,t,i){const s=t(n[0]),o=t(ia(n)),r=(o-s)*e;return[i(s-r),i(o-r)]}function LQ(n,e){return fM(n,e,ub,Yx)}function DQ(n,e){var t=Math.sign(n[0]);return fM(n,e,FW(t),OW(t))}function kQ(n,e,t){return fM(n,e,zC(t),zC(1/t))}function Zx(n,e,t,i,s){const o=i(n[0]),r=i(ia(n)),a=e!=null?i(e):(o+r)/2;return[s(a+(o-a)*t),s(a+(r-a)*t)]}function BW(n,e,t){return Zx(n,e,t,ub,Yx)}function WW(n,e,t){const i=Math.sign(n[0]);return Zx(n,e,t,FW(i),OW(i))}function WE(n,e,t,i){return Zx(n,e,t,zC(i),zC(1/i))}function EQ(n,e,t,i){return Zx(n,e,t,SQ(i),xQ(i))}function VE(n){return n!=null?cs(n)?n:[n]:[]}function AQ(n,e,t){let i=n[0],s=n[1],o;return s=t-e?[e,t]:[i=Math.min(Math.max(i,e),t-o),i+o]}function fr(n){return typeof n=="function"}const IQ="descending";function VW(n,e,t){t=t||{},e=VE(e)||[];const i=[],s=[],o={},r=t.comparator||TQ;return VE(n).forEach((a,l)=>{a!=null&&(i.push(e[l]===IQ?-1:1),s.push(a=fr(a)?a:Kx(a,null,t)),(bQ(a)||[]).forEach(c=>o[c]=1))}),s.length===0?null:hu(r(s,i),Object.keys(o))}const zW=(n,e)=>(ne||e==null)&&n!=null?1:(e=e instanceof Date?+e:e,(n=n instanceof Date?+n:n)!==n&&e===e?-1:e!==e&&n===n?1:0),TQ=(n,e)=>n.length===1?NQ(n[0],e[0]):RQ(n,e,n.length),NQ=(n,e)=>function(t,i){return zW(n(t),n(i))*e},RQ=(n,e,t)=>(e.push(0),function(i,s){let o,r=0,a=-1;for(;r===0&&++aQs(n)||OQ(n)?n:Date.parse(n);function zQ(n,e){return e=e||VQ,n==null||n===""?null:e(n)}function HQ(n){return n==null||n===""?null:n+""}function $C(n){const e={},t=n.length;for(let i=0;i9999?"+"+co(n,6):co(n,4)}function jQ(n){var e=n.getUTCHours(),t=n.getUTCMinutes(),i=n.getUTCSeconds(),s=n.getUTCMilliseconds();return isNaN(n)?"Invalid Date":UQ(n.getUTCFullYear())+"-"+co(n.getUTCMonth()+1,2)+"-"+co(n.getUTCDate(),2)+(s?"T"+co(e,2)+":"+co(t,2)+":"+co(i,2)+"."+co(s,3)+"Z":i?"T"+co(e,2)+":"+co(t,2)+":"+co(i,2)+"Z":t||e?"T"+co(e,2)+":"+co(t,2)+"Z":"")}function UW(n){var e=new RegExp('["'+n+` +\r]`),t=n.charCodeAt(0);function i(u,h){var f,g,p=s(u,function(_,v){if(f)return f(_,v-1);g=_,f=h?$Q(_,h):$W(_)});return p.columns=g||[],p}function s(u,h){var f=[],g=u.length,p=0,_=0,v,b=g<=0,y=!1;u.charCodeAt(g-1)===v0&&--g,u.charCodeAt(g-1)===vk&&--g;function w(){if(b)return _k;if(y)return y=!1,z5;var L,x=p,D;if(u.charCodeAt(x)===bk){for(;p++=g?b=!0:(D=u.charCodeAt(p++))===v0?y=!0:D===vk&&(y=!0,u.charCodeAt(p)===v0&&++p),u.slice(x+1,L-1).replace(/""/g,'"')}for(;p1)i=UQ(n,e,t);else for(s=0,i=new Array(o=n.arcs.length);se?1:n>=e?0:NaN}function jQ(n,e){return n==null||e==null?NaN:en?1:e>=n?0:NaN}function em(n){let e,t,i;n.length!==2?(e=zh,t=(a,l)=>zh(n(a),l),i=(a,l)=>n(a)-l):(e=n===zh||n===jQ?n:qQ,t=n,i=n);function s(a,l,c=0,d=a.length){if(c>>1;t(a[u],l)<0?c=u+1:d=u}while(c>>1;t(a[u],l)<=0?c=u+1:d=u}while(cc&&i(a[u-1],l)>-i(a[u],l)?u-1:u}return{left:s,center:r,right:o}}function qQ(){return 0}function GW(n){return n===null?NaN:+n}function*GQ(n,e){if(e===void 0)for(let t of n)t!=null&&(t=+t)>=t&&(yield t);else{let t=-1;for(let i of n)(i=e(i,++t,n))!=null&&(i=+i)>=i&&(yield i)}}const KW=em(zh),$d=KW.right;KW.left;em(GW).center;function KQ(n,e){let t=0;if(e===void 0)for(let i of n)i!=null&&(i=+i)>=i&&++t;else{let i=-1;for(let s of n)(s=e(s,++i,n))!=null&&(s=+s)>=s&&++t}return t}function YQ(n,e){let t=0,i,s=0,o=0;if(e===void 0)for(let r of n)r!=null&&(r=+r)>=r&&(i=r-s,s+=i/++t,o+=i*(r-s));else{let r=-1;for(let a of n)(a=e(a,++r,n))!=null&&(a=+a)>=a&&(i=a-s,s+=i/++t,o+=i*(a-s))}if(t>1)return o/(t-1)}function ZQ(n,e){let t,i;for(const s of n)s!=null&&(t===void 0?s>=s&&(t=i=s):(t>s&&(t=s),i=i.length)return t(o);const a=new gc,l=i[r++];let c=-1;for(const d of o){const u=l(d,++c,o),h=a.get(u);h?h.push(d):a.set(u,[d])}for(const[d,u]of a)a.set(d,s(u,r));return e(a)}(n,0)}function tJ(n=zh){if(n===zh)return ZW;if(typeof n!="function")throw new TypeError("compare is not a function");return(e,t)=>{const i=n(e,t);return i||i===0?i:(n(t,t)===0)-(n(e,e)===0)}}function ZW(n,e){return(n==null||!(n>=n))-(e==null||!(e>=e))||(ne?1:0)}const iJ=Math.sqrt(50),nJ=Math.sqrt(10),sJ=Math.sqrt(2);function XC(n,e,t){const i=(e-n)/Math.max(0,t),s=Math.floor(Math.log10(i)),o=i/Math.pow(10,s),r=o>=iJ?10:o>=nJ?5:o>=sJ?2:1;let a,l,c;return s<0?(c=Math.pow(10,-s)/r,a=Math.round(n*c),l=Math.round(e*c),a/ce&&--l,c=-c):(c=Math.pow(10,s)*r,a=Math.round(n/c),l=Math.round(e/c),a*ce&&--l),l0))return[];if(n===e)return[n];const i=e=s))return[];const a=o-s+1,l=new Array(a);if(i)if(r<0)for(let c=0;c=i)&&(t=i);else{let i=-1;for(let s of n)(s=e(s,++i,n))!=null&&(t=s)&&(t=s)}return t}function qE(n,e){let t;if(e===void 0)for(const i of n)i!=null&&(t>i||t===void 0&&i>=i)&&(t=i);else{let i=-1;for(let s of n)(s=e(s,++i,n))!=null&&(t>s||t===void 0&&s>=s)&&(t=s)}return t}function XW(n,e,t=0,i=1/0,s){if(e=Math.floor(e),t=Math.floor(Math.max(0,t)),i=Math.floor(Math.min(n.length-1,i)),!(t<=e&&e<=i))return n;for(s=s===void 0?ZW:tJ(s);i>t;){if(i-t>600){const l=i-t+1,c=e-t+1,d=Math.log(l),u=.5*Math.exp(2*d/3),h=.5*Math.sqrt(d*u*(l-u)/l)*(c-l/2<0?-1:1),f=Math.max(t,Math.floor(e-c*u/l+h)),g=Math.min(i,Math.floor(e+(l-c)*u/l+h));XW(n,e,f,g,s)}const o=n[e];let r=t,a=i;for(m0(n,t,e),s(n[i],o)>0&&m0(n,t,i);r0;)--a}s(n[t],o)===0?m0(n,t,a):(++a,m0(n,a,i)),a<=e&&(t=a+1),e<=a&&(i=a-1)}return n}function m0(n,e,t){const i=n[e];n[e]=n[t],n[t]=i}function oJ(n,e,t){if(n=Float64Array.from(GQ(n,t)),!(!(i=n.length)||isNaN(e=+e))){if(e<=0||i<2)return qE(n);if(e>=1)return jE(n);var i,s=(i-1)*e,o=Math.floor(s),r=jE(XW(n,o).subarray(0,o+1)),a=qE(n.subarray(o+1));return r+(a-r)*(s-o)}}function QW(n,e,t=GW){if(!(!(i=n.length)||isNaN(e=+e))){if(e<=0||i<2)return+t(n[0],0,n);if(e>=1)return+t(n[i-1],i-1,n);var i,s=(i-1)*e,o=Math.floor(s),r=+t(n[o],o,n),a=+t(n[o+1],o+1,n);return r+(a-r)*(s-o)}}function rJ(n,e){let t=0,i=0;if(e===void 0)for(let s of n)s!=null&&(s=+s)>=s&&(++t,i+=s);else{let s=-1;for(let o of n)(o=e(o,++s,n))!=null&&(o=+o)>=o&&(++t,i+=o)}if(t)return i/t}function aJ(n,e){return oJ(n,.5,e)}function db(n,e,t){n=+n,e=+e,t=(s=arguments.length)<2?(e=n,n=0,1):s<3?1:+t;for(var i=-1,s=Math.max(0,Math.ceil((e-n)/t))|0,o=new Array(s);++i=1e21?n.toLocaleString("en").replace(/,/g,""):n.toString(10)}function JC(n,e){if((t=(n=e?n.toExponential(e-1):n.toExponential()).indexOf("e"))<0)return null;var t,i=n.slice(0,t);return[i.length>1?i[0]+i.slice(2):i,+n.slice(t+1)]}function tm(n){return n=JC(Math.abs(n)),n?n[1]:NaN}function cJ(n,e){return function(t,i){for(var s=t.length,o=[],r=0,a=n[0],l=0;s>0&&a>0&&(l+a+1>i&&(a=Math.max(1,i-l)),o.push(t.substring(s-=a,s+a)),!((l+=a+1)>i));)a=n[r=(r+1)%n.length];return o.reverse().join(e)}}function dJ(n){return function(e){return e.replace(/[0-9]/g,function(t){return n[+t]})}}var uJ=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function im(n){if(!(e=uJ.exec(n)))throw new Error("invalid format: "+n);var e;return new _M({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}im.prototype=_M.prototype;function _M(n){this.fill=n.fill===void 0?" ":n.fill+"",this.align=n.align===void 0?">":n.align+"",this.sign=n.sign===void 0?"-":n.sign+"",this.symbol=n.symbol===void 0?"":n.symbol+"",this.zero=!!n.zero,this.width=n.width===void 0?void 0:+n.width,this.comma=!!n.comma,this.precision=n.precision===void 0?void 0:+n.precision,this.trim=!!n.trim,this.type=n.type===void 0?"":n.type+""}_M.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function hJ(n){e:for(var e=n.length,t=1,i=-1,s;t0&&(i=0);break}return i>0?n.slice(0,i)+n.slice(s+1):n}var JW;function fJ(n,e){var t=JC(n,e);if(!t)return n+"";var i=t[0],s=t[1],o=s-(JW=Math.max(-8,Math.min(8,Math.floor(s/3)))*3)+1,r=i.length;return o===r?i:o>r?i+new Array(o-r+1).join("0"):o>0?i.slice(0,o)+"."+i.slice(o):"0."+new Array(1-o).join("0")+JC(n,Math.max(0,e+o-1))[0]}function K5(n,e){var t=JC(n,e);if(!t)return n+"";var i=t[0],s=t[1];return s<0?"0."+new Array(-s).join("0")+i:i.length>s+1?i.slice(0,s+1)+"."+i.slice(s+1):i+new Array(s-i.length+2).join("0")}const Y5={"%":(n,e)=>(n*100).toFixed(e),b:n=>Math.round(n).toString(2),c:n=>n+"",d:lJ,e:(n,e)=>n.toExponential(e),f:(n,e)=>n.toFixed(e),g:(n,e)=>n.toPrecision(e),o:n=>Math.round(n).toString(8),p:(n,e)=>K5(n*100,e),r:K5,s:fJ,X:n=>Math.round(n).toString(16).toUpperCase(),x:n=>Math.round(n).toString(16)};function Z5(n){return n}var X5=Array.prototype.map,Q5=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function gJ(n){var e=n.grouping===void 0||n.thousands===void 0?Z5:cJ(X5.call(n.grouping,Number),n.thousands+""),t=n.currency===void 0?"":n.currency[0]+"",i=n.currency===void 0?"":n.currency[1]+"",s=n.decimal===void 0?".":n.decimal+"",o=n.numerals===void 0?Z5:dJ(X5.call(n.numerals,String)),r=n.percent===void 0?"%":n.percent+"",a=n.minus===void 0?"−":n.minus+"",l=n.nan===void 0?"NaN":n.nan+"";function c(u){u=im(u);var h=u.fill,f=u.align,g=u.sign,p=u.symbol,_=u.zero,v=u.width,b=u.comma,y=u.precision,w=u.trim,C=u.type;C==="n"?(b=!0,C="g"):Y5[C]||(y===void 0&&(y=12),w=!0,C="g"),(_||h==="0"&&f==="=")&&(_=!0,h="0",f="=");var L=p==="$"?t:p==="#"&&/[boxX]/.test(C)?"0"+C.toLowerCase():"",x=p==="$"?i:/[%p]/.test(C)?r:"",D=Y5[C],k=/[defgprs%]/.test(C);y=y===void 0?6:/[gprs]/.test(C)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y));function P(O){var M=L,R=x,z,G,te;if(C==="c")R=D(O)+R,O="";else{O=+O;var ae=O<0||1/O<0;if(O=isNaN(O)?l:D(Math.abs(O),y),w&&(O=hJ(O)),ae&&+O==0&&g!=="+"&&(ae=!1),M=(ae?g==="("?g:a:g==="-"||g==="("?"":g)+M,R=(C==="s"?Q5[8+JW/3]:"")+R+(ae&&g==="("?")":""),k){for(z=-1,G=O.length;++zte||te>57){R=(te===46?s+O.slice(z+1):O.slice(z))+R,O=O.slice(0,z);break}}}b&&!_&&(O=e(O,1/0));var fe=M.length+O.length+R.length,oe=fe>1)+M+O+R+oe.slice(fe);break;default:O=oe+M+O+R;break}return o(O)}return P.toString=function(){return u+""},P}function d(u,h){var f=c((u=im(u),u.type="f",u)),g=Math.max(-8,Math.min(8,Math.floor(tm(h)/3)))*3,p=Math.pow(10,-g),_=Q5[8+g/3];return function(v){return f(p*v)+_}}return{format:c,formatPrefix:d}}var Iy,Ts,eV;pJ({thousands:",",grouping:[3],currency:["$",""]});function pJ(n){return Iy=gJ(n),Ts=Iy.format,eV=Iy.formatPrefix,Iy}function mJ(n){return Math.max(0,-tm(Math.abs(n)))}function _J(n,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(tm(e)/3)))*3-tm(Math.abs(n)))}function bJ(n,e){return n=Math.abs(n),e=Math.abs(e)-n,Math.max(0,tm(e)-tm(n))+1}const Lk=new Date,Dk=new Date;function Vn(n,e,t,i){function s(o){return n(o=arguments.length===0?new Date:new Date(+o)),o}return s.floor=o=>(n(o=new Date(+o)),o),s.ceil=o=>(n(o=new Date(o-1)),e(o,1),n(o),o),s.round=o=>{const r=s(o),a=s.ceil(o);return o-r(e(o=new Date(+o),r==null?1:Math.floor(r)),o),s.range=(o,r,a)=>{const l=[];if(o=s.ceil(o),a=a==null?1:Math.floor(a),!(o0))return l;let c;do l.push(c=new Date(+o)),e(o,a),n(o);while(cVn(r=>{if(r>=r)for(;n(r),!o(r);)r.setTime(r-1)},(r,a)=>{if(r>=r)if(a<0)for(;++a<=0;)for(;e(r,-1),!o(r););else for(;--a>=0;)for(;e(r,1),!o(r););}),t&&(s.count=(o,r)=>(Lk.setTime(+o),Dk.setTime(+r),n(Lk),n(Dk),Math.floor(t(Lk,Dk))),s.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?s.filter(i?r=>i(r)%o===0:r=>s.count(0,r)%o===0):s)),s}const nm=Vn(()=>{},(n,e)=>{n.setTime(+n+e)},(n,e)=>e-n);nm.every=n=>(n=Math.floor(n),!isFinite(n)||!(n>0)?null:n>1?Vn(e=>{e.setTime(Math.floor(e/n)*n)},(e,t)=>{e.setTime(+e+t*n)},(e,t)=>(t-e)/n):nm);nm.range;const Gl=1e3,lr=Gl*60,Kl=lr*60,pc=Kl*24,bM=pc*7,J5=pc*30,kk=pc*365,Yl=Vn(n=>{n.setTime(n-n.getMilliseconds())},(n,e)=>{n.setTime(+n+e*Gl)},(n,e)=>(e-n)/Gl,n=>n.getUTCSeconds());Yl.range;const oL=Vn(n=>{n.setTime(n-n.getMilliseconds()-n.getSeconds()*Gl)},(n,e)=>{n.setTime(+n+e*lr)},(n,e)=>(e-n)/lr,n=>n.getMinutes());oL.range;const rL=Vn(n=>{n.setUTCSeconds(0,0)},(n,e)=>{n.setTime(+n+e*lr)},(n,e)=>(e-n)/lr,n=>n.getUTCMinutes());rL.range;const aL=Vn(n=>{n.setTime(n-n.getMilliseconds()-n.getSeconds()*Gl-n.getMinutes()*lr)},(n,e)=>{n.setTime(+n+e*Kl)},(n,e)=>(e-n)/Kl,n=>n.getHours());aL.range;const lL=Vn(n=>{n.setUTCMinutes(0,0,0)},(n,e)=>{n.setTime(+n+e*Kl)},(n,e)=>(e-n)/Kl,n=>n.getUTCHours());lL.range;const xd=Vn(n=>n.setHours(0,0,0,0),(n,e)=>n.setDate(n.getDate()+e),(n,e)=>(e-n-(e.getTimezoneOffset()-n.getTimezoneOffset())*lr)/pc,n=>n.getDate()-1);xd.range;const Hh=Vn(n=>{n.setUTCHours(0,0,0,0)},(n,e)=>{n.setUTCDate(n.getUTCDate()+e)},(n,e)=>(e-n)/pc,n=>n.getUTCDate()-1);Hh.range;const tV=Vn(n=>{n.setUTCHours(0,0,0,0)},(n,e)=>{n.setUTCDate(n.getUTCDate()+e)},(n,e)=>(e-n)/pc,n=>Math.floor(n/pc));tV.range;function Rf(n){return Vn(e=>{e.setDate(e.getDate()-(e.getDay()+7-n)%7),e.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+t*7)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*lr)/bM)}const p1=Rf(0),eS=Rf(1),vJ=Rf(2),yJ=Rf(3),sm=Rf(4),wJ=Rf(5),CJ=Rf(6);p1.range;eS.range;vJ.range;yJ.range;sm.range;wJ.range;CJ.range;function Mf(n){return Vn(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-n)%7),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t*7)},(e,t)=>(t-e)/bM)}const m1=Mf(0),tS=Mf(1),SJ=Mf(2),xJ=Mf(3),om=Mf(4),LJ=Mf(5),DJ=Mf(6);m1.range;tS.range;SJ.range;xJ.range;om.range;LJ.range;DJ.range;const ub=Vn(n=>{n.setDate(1),n.setHours(0,0,0,0)},(n,e)=>{n.setMonth(n.getMonth()+e)},(n,e)=>e.getMonth()-n.getMonth()+(e.getFullYear()-n.getFullYear())*12,n=>n.getMonth());ub.range;const hb=Vn(n=>{n.setUTCDate(1),n.setUTCHours(0,0,0,0)},(n,e)=>{n.setUTCMonth(n.getUTCMonth()+e)},(n,e)=>e.getUTCMonth()-n.getUTCMonth()+(e.getUTCFullYear()-n.getUTCFullYear())*12,n=>n.getUTCMonth());hb.range;const Ja=Vn(n=>{n.setMonth(0,1),n.setHours(0,0,0,0)},(n,e)=>{n.setFullYear(n.getFullYear()+e)},(n,e)=>e.getFullYear()-n.getFullYear(),n=>n.getFullYear());Ja.every=n=>!isFinite(n=Math.floor(n))||!(n>0)?null:Vn(e=>{e.setFullYear(Math.floor(e.getFullYear()/n)*n),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t*n)});Ja.range;const el=Vn(n=>{n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)},(n,e)=>{n.setUTCFullYear(n.getUTCFullYear()+e)},(n,e)=>e.getUTCFullYear()-n.getUTCFullYear(),n=>n.getUTCFullYear());el.every=n=>!isFinite(n=Math.floor(n))||!(n>0)?null:Vn(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/n)*n),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t*n)});el.range;function iV(n,e,t,i,s,o){const r=[[Yl,1,Gl],[Yl,5,5*Gl],[Yl,15,15*Gl],[Yl,30,30*Gl],[o,1,lr],[o,5,5*lr],[o,15,15*lr],[o,30,30*lr],[s,1,Kl],[s,3,3*Kl],[s,6,6*Kl],[s,12,12*Kl],[i,1,pc],[i,2,2*pc],[t,1,bM],[e,1,J5],[e,3,3*J5],[n,1,kk]];function a(c,d,u){const h=d_).right(r,h);if(f===r.length)return n.every(df(c/kk,d/kk,u));if(f===0)return nm.every(Math.max(df(c,d,u),1));const[g,p]=r[h/r[f-1][2](n[e]=1+t,n),{});const NJ={[fb]:Ja,[gb]:ub.every(3),[pb]:ub,[mb]:p1,[_b]:xd,[cL]:xd,[vM]:xd,[bb]:aL,[vb]:oL,[yb]:Yl,[dL]:nm},RJ={[fb]:el,[gb]:hb.every(3),[pb]:hb,[mb]:m1,[_b]:Hh,[cL]:Hh,[vM]:Hh,[bb]:lL,[vb]:rL,[yb]:Yl,[dL]:nm};function MJ(n){return NJ[n]}function PJ(n){return RJ[n]}function Ek(n){if(0<=n.y&&n.y<100){var e=new Date(-1,n.m,n.d,n.H,n.M,n.S,n.L);return e.setFullYear(n.y),e}return new Date(n.y,n.m,n.d,n.H,n.M,n.S,n.L)}function Ak(n){if(0<=n.y&&n.y<100){var e=new Date(Date.UTC(-1,n.m,n.d,n.H,n.M,n.S,n.L));return e.setUTCFullYear(n.y),e}return new Date(Date.UTC(n.y,n.m,n.d,n.H,n.M,n.S,n.L))}function _0(n,e,t){return{y:n,m:e,d:t,H:0,M:0,S:0,L:0}}function nV(n){var e=n.dateTime,t=n.date,i=n.time,s=n.periods,o=n.days,r=n.shortDays,a=n.months,l=n.shortMonths,c=b0(s),d=v0(s),u=b0(o),h=v0(o),f=b0(r),g=v0(r),p=b0(a),_=v0(a),v=b0(l),b=v0(l),y={a:ae,A:fe,b:oe,B:Se,c:null,d:oO,e:oO,f:see,g:gee,G:mee,H:tee,I:iee,j:nee,L:sV,m:oee,M:ree,p:Ie,q:me,Q:lO,s:cO,S:aee,u:lee,U:cee,V:dee,w:uee,W:hee,x:null,X:null,y:fee,Y:pee,Z:_ee,"%":aO},w={a:ie,A:Xt,b:Dt,B:Nt,c:null,d:rO,e:rO,f:wee,g:Tee,G:Ree,H:bee,I:vee,j:yee,L:rV,m:Cee,M:See,p:Ge,q:si,Q:lO,s:cO,S:xee,u:Lee,U:Dee,V:kee,w:Eee,W:Aee,x:null,X:null,y:Iee,Y:Nee,Z:Mee,"%":aO},C={a:P,A:O,b:M,B:R,c:z,d:nO,e:nO,f:XJ,g:iO,G:tO,H:sO,I:sO,j:GJ,L:ZJ,m:qJ,M:KJ,p:k,q:jJ,Q:JJ,s:eee,S:YJ,u:VJ,U:zJ,V:HJ,w:WJ,W:$J,x:G,X:te,y:iO,Y:tO,Z:UJ,"%":QJ};y.x=L(t,y),y.X=L(i,y),y.c=L(e,y),w.x=L(t,w),w.X=L(i,w),w.c=L(e,w);function L(ke,Ve){return function(ge){var he=[],Ei=-1,kt=0,Tt=ke.length,yi,er,Mu;for(ge instanceof Date||(ge=new Date(+ge));++Ei53)return null;"w"in he||(he.w=1),"Z"in he?(kt=Ak(_0(he.y,0,1)),Tt=kt.getUTCDay(),kt=Tt>4||Tt===0?tS.ceil(kt):tS(kt),kt=Hh.offset(kt,(he.V-1)*7),he.y=kt.getUTCFullYear(),he.m=kt.getUTCMonth(),he.d=kt.getUTCDate()+(he.w+6)%7):(kt=Ek(_0(he.y,0,1)),Tt=kt.getDay(),kt=Tt>4||Tt===0?eS.ceil(kt):eS(kt),kt=xd.offset(kt,(he.V-1)*7),he.y=kt.getFullYear(),he.m=kt.getMonth(),he.d=kt.getDate()+(he.w+6)%7)}else("W"in he||"U"in he)&&("w"in he||(he.w="u"in he?he.u%7:"W"in he?1:0),Tt="Z"in he?Ak(_0(he.y,0,1)).getUTCDay():Ek(_0(he.y,0,1)).getDay(),he.m=0,he.d="W"in he?(he.w+6)%7+he.W*7-(Tt+5)%7:he.w+he.U*7-(Tt+6)%7);return"Z"in he?(he.H+=he.Z/100|0,he.M+=he.Z%100,Ak(he)):Ek(he)}}function D(ke,Ve,ge,he){for(var Ei=0,kt=Ve.length,Tt=ge.length,yi,er;Ei=Tt)return-1;if(yi=Ve.charCodeAt(Ei++),yi===37){if(yi=Ve.charAt(Ei++),er=C[yi in eO?Ve.charAt(Ei++):yi],!er||(he=er(ke,ge,he))<0)return-1}else if(yi!=ge.charCodeAt(he++))return-1}return he}function k(ke,Ve,ge){var he=c.exec(Ve.slice(ge));return he?(ke.p=d.get(he[0].toLowerCase()),ge+he[0].length):-1}function P(ke,Ve,ge){var he=f.exec(Ve.slice(ge));return he?(ke.w=g.get(he[0].toLowerCase()),ge+he[0].length):-1}function O(ke,Ve,ge){var he=u.exec(Ve.slice(ge));return he?(ke.w=h.get(he[0].toLowerCase()),ge+he[0].length):-1}function M(ke,Ve,ge){var he=v.exec(Ve.slice(ge));return he?(ke.m=b.get(he[0].toLowerCase()),ge+he[0].length):-1}function R(ke,Ve,ge){var he=p.exec(Ve.slice(ge));return he?(ke.m=_.get(he[0].toLowerCase()),ge+he[0].length):-1}function z(ke,Ve,ge){return D(ke,e,Ve,ge)}function G(ke,Ve,ge){return D(ke,t,Ve,ge)}function te(ke,Ve,ge){return D(ke,i,Ve,ge)}function ae(ke){return r[ke.getDay()]}function fe(ke){return o[ke.getDay()]}function oe(ke){return l[ke.getMonth()]}function Se(ke){return a[ke.getMonth()]}function Ie(ke){return s[+(ke.getHours()>=12)]}function me(ke){return 1+~~(ke.getMonth()/3)}function ie(ke){return r[ke.getUTCDay()]}function Xt(ke){return o[ke.getUTCDay()]}function Dt(ke){return l[ke.getUTCMonth()]}function Nt(ke){return a[ke.getUTCMonth()]}function Ge(ke){return s[+(ke.getUTCHours()>=12)]}function si(ke){return 1+~~(ke.getUTCMonth()/3)}return{format:function(ke){var Ve=L(ke+="",y);return Ve.toString=function(){return ke},Ve},parse:function(ke){var Ve=x(ke+="",!1);return Ve.toString=function(){return ke},Ve},utcFormat:function(ke){var Ve=L(ke+="",w);return Ve.toString=function(){return ke},Ve},utcParse:function(ke){var Ve=x(ke+="",!0);return Ve.toString=function(){return ke},Ve}}}var eO={"-":"",_:" ",0:"0"},es=/^\s*\d+/,OJ=/^%/,FJ=/[\\^$*+?|[\]().{}]/g;function Yt(n,e,t){var i=n<0?"-":"",s=(i?-n:n)+"",o=s.length;return i+(o[e.toLowerCase(),t]))}function WJ(n,e,t){var i=es.exec(e.slice(t,t+1));return i?(n.w=+i[0],t+i[0].length):-1}function VJ(n,e,t){var i=es.exec(e.slice(t,t+1));return i?(n.u=+i[0],t+i[0].length):-1}function zJ(n,e,t){var i=es.exec(e.slice(t,t+2));return i?(n.U=+i[0],t+i[0].length):-1}function HJ(n,e,t){var i=es.exec(e.slice(t,t+2));return i?(n.V=+i[0],t+i[0].length):-1}function $J(n,e,t){var i=es.exec(e.slice(t,t+2));return i?(n.W=+i[0],t+i[0].length):-1}function tO(n,e,t){var i=es.exec(e.slice(t,t+4));return i?(n.y=+i[0],t+i[0].length):-1}function iO(n,e,t){var i=es.exec(e.slice(t,t+2));return i?(n.y=+i[0]+(+i[0]>68?1900:2e3),t+i[0].length):-1}function UJ(n,e,t){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(t,t+6));return i?(n.Z=i[1]?0:-(i[2]+(i[3]||"00")),t+i[0].length):-1}function jJ(n,e,t){var i=es.exec(e.slice(t,t+1));return i?(n.q=i[0]*3-3,t+i[0].length):-1}function qJ(n,e,t){var i=es.exec(e.slice(t,t+2));return i?(n.m=i[0]-1,t+i[0].length):-1}function nO(n,e,t){var i=es.exec(e.slice(t,t+2));return i?(n.d=+i[0],t+i[0].length):-1}function GJ(n,e,t){var i=es.exec(e.slice(t,t+3));return i?(n.m=0,n.d=+i[0],t+i[0].length):-1}function sO(n,e,t){var i=es.exec(e.slice(t,t+2));return i?(n.H=+i[0],t+i[0].length):-1}function KJ(n,e,t){var i=es.exec(e.slice(t,t+2));return i?(n.M=+i[0],t+i[0].length):-1}function YJ(n,e,t){var i=es.exec(e.slice(t,t+2));return i?(n.S=+i[0],t+i[0].length):-1}function ZJ(n,e,t){var i=es.exec(e.slice(t,t+3));return i?(n.L=+i[0],t+i[0].length):-1}function XJ(n,e,t){var i=es.exec(e.slice(t,t+6));return i?(n.L=Math.floor(i[0]/1e3),t+i[0].length):-1}function QJ(n,e,t){var i=OJ.exec(e.slice(t,t+1));return i?t+i[0].length:-1}function JJ(n,e,t){var i=es.exec(e.slice(t));return i?(n.Q=+i[0],t+i[0].length):-1}function eee(n,e,t){var i=es.exec(e.slice(t));return i?(n.s=+i[0],t+i[0].length):-1}function oO(n,e){return Yt(n.getDate(),e,2)}function tee(n,e){return Yt(n.getHours(),e,2)}function iee(n,e){return Yt(n.getHours()%12||12,e,2)}function nee(n,e){return Yt(1+xd.count(Ja(n),n),e,3)}function sV(n,e){return Yt(n.getMilliseconds(),e,3)}function see(n,e){return sV(n,e)+"000"}function oee(n,e){return Yt(n.getMonth()+1,e,2)}function ree(n,e){return Yt(n.getMinutes(),e,2)}function aee(n,e){return Yt(n.getSeconds(),e,2)}function lee(n){var e=n.getDay();return e===0?7:e}function cee(n,e){return Yt(p1.count(Ja(n)-1,n),e,2)}function oV(n){var e=n.getDay();return e>=4||e===0?sm(n):sm.ceil(n)}function dee(n,e){return n=oV(n),Yt(sm.count(Ja(n),n)+(Ja(n).getDay()===4),e,2)}function uee(n){return n.getDay()}function hee(n,e){return Yt(eS.count(Ja(n)-1,n),e,2)}function fee(n,e){return Yt(n.getFullYear()%100,e,2)}function gee(n,e){return n=oV(n),Yt(n.getFullYear()%100,e,2)}function pee(n,e){return Yt(n.getFullYear()%1e4,e,4)}function mee(n,e){var t=n.getDay();return n=t>=4||t===0?sm(n):sm.ceil(n),Yt(n.getFullYear()%1e4,e,4)}function _ee(n){var e=n.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Yt(e/60|0,"0",2)+Yt(e%60,"0",2)}function rO(n,e){return Yt(n.getUTCDate(),e,2)}function bee(n,e){return Yt(n.getUTCHours(),e,2)}function vee(n,e){return Yt(n.getUTCHours()%12||12,e,2)}function yee(n,e){return Yt(1+Hh.count(el(n),n),e,3)}function rV(n,e){return Yt(n.getUTCMilliseconds(),e,3)}function wee(n,e){return rV(n,e)+"000"}function Cee(n,e){return Yt(n.getUTCMonth()+1,e,2)}function See(n,e){return Yt(n.getUTCMinutes(),e,2)}function xee(n,e){return Yt(n.getUTCSeconds(),e,2)}function Lee(n){var e=n.getUTCDay();return e===0?7:e}function Dee(n,e){return Yt(m1.count(el(n)-1,n),e,2)}function aV(n){var e=n.getUTCDay();return e>=4||e===0?om(n):om.ceil(n)}function kee(n,e){return n=aV(n),Yt(om.count(el(n),n)+(el(n).getUTCDay()===4),e,2)}function Eee(n){return n.getUTCDay()}function Aee(n,e){return Yt(tS.count(el(n)-1,n),e,2)}function Iee(n,e){return Yt(n.getUTCFullYear()%100,e,2)}function Tee(n,e){return n=aV(n),Yt(n.getUTCFullYear()%100,e,2)}function Nee(n,e){return Yt(n.getUTCFullYear()%1e4,e,4)}function Ree(n,e){var t=n.getUTCDay();return n=t>=4||t===0?om(n):om.ceil(n),Yt(n.getUTCFullYear()%1e4,e,4)}function Mee(){return"+0000"}function aO(){return"%"}function lO(n){return+n}function cO(n){return Math.floor(+n/1e3)}var ag,yM,lV,wM,cV;Pee({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Pee(n){return ag=nV(n),yM=ag.format,lV=ag.parse,wM=ag.utcFormat,cV=ag.utcParse,ag}function Ty(n){const e={};return t=>e[t]||(e[t]=n(t))}function dO(n,e,t){t=t||{},Os(t)||Nn(`Invalid time multi-format specifier: ${t}`);const i=e(yb),s=e(vb),o=e(bb),r=e(_b),a=e(mb),l=e(pb),c=e(gb),d=e(fb),u=n(t[dL]||".%L"),h=n(t[yb]||":%S"),f=n(t[vb]||"%I:%M"),g=n(t[bb]||"%I %p"),p=n(t[_b]||t[cL]||"%a %d"),_=n(t[mb]||"%b %d"),v=n(t[pb]||"%B"),b=n(t[gb]||"%B"),y=n(t[fb]||"%Y");return w=>(i(w)Ti(i)?e(i):dO(e,MJ,i),utcFormat:i=>Ti(i)?t(i):dO(t,PJ,i),timeParse:Ty(n.parse),utcParse:Ty(n.utcParse)}}let GE;Oee();function Oee(){return GE=dV({format:yM,parse:lV,utcFormat:wM,utcParse:cV})}function Fee(n){return dV(nV(n))}function Bee(n){return arguments.length?GE=Fee(n):GE}const Wee=n=>n!=null&&n===n,Vee=n=>n==="true"||n==="false"||n===!0||n===!1,zee=n=>!Number.isNaN(Date.parse(n)),uV=n=>!Number.isNaN(+n)&&!(n instanceof Date),Hee=n=>uV(n)&&Number.isInteger(+n),uO={boolean:EQ,integer:cb,number:cb,date:IQ,string:TQ,unknown:iL},Ny=[Vee,Hee,uV,zee],$ee=["boolean","integer","number","date"];function Uee(n,e){if(!n||!n.length)return"unknown";const t=n.length,i=Ny.length,s=Ny.map((o,r)=>r+1);for(let o=0,r=0,a,l;oo===0?r:o,0)-1]}function jee(n,e){return e.reduce((t,i)=>(t[i]=Uee(n,i),t),{})}function hO(n){const e=function(t,i){const s={delimiter:n};return CM(t,i?SQ(i,s):s)};return e.responseType="text",e}function CM(n,e){return e.header&&(n=e.header.map(mM).join(e.delimiter)+` -`+n),jW(e.delimiter).parse(n+"")}CM.responseType="text";function qee(n){return typeof Buffer=="function"&&gr(Buffer.isBuffer)?Buffer.isBuffer(n):!1}function SM(n,e){const t=e&&e.property?tL(e.property):iL;return Os(n)&&!qee(n)?Gee(t(n),e):t(JSON.parse(n))}SM.responseType="json";function Gee(n,e){return!Ps(n)&&DQ(n)&&(n=[...n]),e&&e.copy?JSON.parse(JSON.stringify(n)):n}const Kee={interior:(n,e)=>n!==e,exterior:(n,e)=>n===e};function hV(n,e){let t,i,s,o;return n=SM(n,e),e&&e.feature?(t=VQ,s=e.feature):e&&e.mesh?(t=HQ,s=e.mesh,o=Kee[e.filter]):Nn("Missing TopoJSON feature or mesh parameter."),i=(i=n.objects[s])?t(n,i,o):Nn("Invalid TopoJSON object: "+s),i&&i.features||[i]}hV.responseType="json";const Ik={dsv:CM,csv:hO(","),tsv:hO(" "),json:SM,topojson:hV};function xM(n,e){return arguments.length>1?(Ik[n]=e,this):Rg(Ik,n)?Ik[n]:null}function LM(n,e,t,i){e=e||{};const s=xM(e.type||"json");return s||Nn("Unknown data format type: "+e.type),n=s(n,e),e.parse&&Yee(n,e.parse,t,i),Rg(n,"columns")&&delete n.columns,n}function Yee(n,e,t,i){if(!n.length)return;const s=Bee();t=t||s.timeParse,i=i||s.utcParse;let o=n.columns||Object.keys(n[0]),r,a,l,c,d,u;e==="auto"&&(e=jee(n,o)),o=Object.keys(e);const h=o.map(f=>{const g=e[f];let p,_;if(g&&(g.startsWith("date:")||g.startsWith("utc:")))return p=g.split(/:(.+)?/,2),_=p[1],(_[0]==="'"&&_[_.length-1]==="'"||_[0]==='"'&&_[_.length-1]==='"')&&(_=_.slice(1,-1)),(p[0]==="utc"?i:t)(_);if(!uO[g])throw Error("Illegal format pattern: "+f+":"+g);return uO[g]});for(l=0,d=n.length,u=o.length;l1)i=tJ(n,e,t);else for(s=0,i=new Array(o=n.arcs.length);se?1:n>=e?0:NaN}function iJ(n,e){return n==null||e==null?NaN:en?1:e>=n?0:NaN}function nm(n){let e,t,i;n.length!==2?(e=Uh,t=(a,l)=>Uh(n(a),l),i=(a,l)=>n(a)-l):(e=n===Uh||n===iJ?n:nJ,t=n,i=n);function s(a,l,c=0,d=a.length){if(c>>1;t(a[u],l)<0?c=u+1:d=u}while(c>>1;t(a[u],l)<=0?c=u+1:d=u}while(cc&&i(a[u-1],l)>-i(a[u],l)?u-1:u}return{left:s,center:r,right:o}}function nJ(){return 0}function qW(n){return n===null?NaN:+n}function*sJ(n,e){if(e===void 0)for(let t of n)t!=null&&(t=+t)>=t&&(yield t);else{let t=-1;for(let i of n)(i=e(i,++t,n))!=null&&(i=+i)>=i&&(yield i)}}const GW=nm(Uh),Ud=GW.right;GW.left;nm(qW).center;function oJ(n,e){let t=0;if(e===void 0)for(let i of n)i!=null&&(i=+i)>=i&&++t;else{let i=-1;for(let s of n)(s=e(s,++i,n))!=null&&(s=+s)>=s&&++t}return t}function rJ(n,e){let t=0,i,s=0,o=0;if(e===void 0)for(let r of n)r!=null&&(r=+r)>=r&&(i=r-s,s+=i/++t,o+=i*(r-s));else{let r=-1;for(let a of n)(a=e(a,++r,n))!=null&&(a=+a)>=a&&(i=a-s,s+=i/++t,o+=i*(a-s))}if(t>1)return o/(t-1)}function aJ(n,e){let t,i;for(const s of n)s!=null&&(t===void 0?s>=s&&(t=i=s):(t>s&&(t=s),i=i.length)return t(o);const a=new gc,l=i[r++];let c=-1;for(const d of o){const u=l(d,++c,o),h=a.get(u);h?h.push(d):a.set(u,[d])}for(const[d,u]of a)a.set(d,s(u,r));return e(a)}(n,0)}function hJ(n=Uh){if(n===Uh)return YW;if(typeof n!="function")throw new TypeError("compare is not a function");return(e,t)=>{const i=n(e,t);return i||i===0?i:(n(t,t)===0)-(n(e,e)===0)}}function YW(n,e){return(n==null||!(n>=n))-(e==null||!(e>=e))||(ne?1:0)}const fJ=Math.sqrt(50),gJ=Math.sqrt(10),pJ=Math.sqrt(2);function UC(n,e,t){const i=(e-n)/Math.max(0,t),s=Math.floor(Math.log10(i)),o=i/Math.pow(10,s),r=o>=fJ?10:o>=gJ?5:o>=pJ?2:1;let a,l,c;return s<0?(c=Math.pow(10,-s)/r,a=Math.round(n*c),l=Math.round(e*c),a/ce&&--l,c=-c):(c=Math.pow(10,s)*r,a=Math.round(n/c),l=Math.round(e/c),a*ce&&--l),l0))return[];if(n===e)return[n];const i=e=s))return[];const a=o-s+1,l=new Array(a);if(i)if(r<0)for(let c=0;c=i)&&(t=i);else{let i=-1;for(let s of n)(s=e(s,++i,n))!=null&&(t=s)&&(t=s)}return t}function UE(n,e){let t;if(e===void 0)for(const i of n)i!=null&&(t>i||t===void 0&&i>=i)&&(t=i);else{let i=-1;for(let s of n)(s=e(s,++i,n))!=null&&(t>s||t===void 0&&s>=s)&&(t=s)}return t}function ZW(n,e,t=0,i=1/0,s){if(e=Math.floor(e),t=Math.floor(Math.max(0,t)),i=Math.floor(Math.min(n.length-1,i)),!(t<=e&&e<=i))return n;for(s=s===void 0?YW:hJ(s);i>t;){if(i-t>600){const l=i-t+1,c=e-t+1,d=Math.log(l),u=.5*Math.exp(2*d/3),h=.5*Math.sqrt(d*u*(l-u)/l)*(c-l/2<0?-1:1),f=Math.max(t,Math.floor(e-c*u/l+h)),g=Math.min(i,Math.floor(e+(l-c)*u/l+h));ZW(n,e,f,g,s)}const o=n[e];let r=t,a=i;for(y0(n,t,e),s(n[i],o)>0&&y0(n,t,i);r0;)--a}s(n[t],o)===0?y0(n,t,a):(++a,y0(n,a,i)),a<=e&&(t=a+1),e<=a&&(i=a-1)}return n}function y0(n,e,t){const i=n[e];n[e]=n[t],n[t]=i}function mJ(n,e,t){if(n=Float64Array.from(sJ(n,t)),!(!(i=n.length)||isNaN(e=+e))){if(e<=0||i<2)return UE(n);if(e>=1)return $E(n);var i,s=(i-1)*e,o=Math.floor(s),r=$E(ZW(n,o).subarray(0,o+1)),a=UE(n.subarray(o+1));return r+(a-r)*(s-o)}}function XW(n,e,t=qW){if(!(!(i=n.length)||isNaN(e=+e))){if(e<=0||i<2)return+t(n[0],0,n);if(e>=1)return+t(n[i-1],i-1,n);var i,s=(i-1)*e,o=Math.floor(s),r=+t(n[o],o,n),a=+t(n[o+1],o+1,n);return r+(a-r)*(s-o)}}function _J(n,e){let t=0,i=0;if(e===void 0)for(let s of n)s!=null&&(s=+s)>=s&&(++t,i+=s);else{let s=-1;for(let o of n)(o=e(o,++s,n))!=null&&(o=+o)>=o&&(++t,i+=o)}if(t)return i/t}function bJ(n,e){return mJ(n,.5,e)}function hb(n,e,t){n=+n,e=+e,t=(s=arguments.length)<2?(e=n,n=0,1):s<3?1:+t;for(var i=-1,s=Math.max(0,Math.ceil((e-n)/t))|0,o=new Array(s);++i=1e21?n.toLocaleString("en").replace(/,/g,""):n.toString(10)}function qC(n,e){if((t=(n=e?n.toExponential(e-1):n.toExponential()).indexOf("e"))<0)return null;var t,i=n.slice(0,t);return[i.length>1?i[0]+i.slice(2):i,+n.slice(t+1)]}function sm(n){return n=qC(Math.abs(n)),n?n[1]:NaN}function yJ(n,e){return function(t,i){for(var s=t.length,o=[],r=0,a=n[0],l=0;s>0&&a>0&&(l+a+1>i&&(a=Math.max(1,i-l)),o.push(t.substring(s-=a,s+a)),!((l+=a+1)>i));)a=n[r=(r+1)%n.length];return o.reverse().join(e)}}function wJ(n){return function(e){return e.replace(/[0-9]/g,function(t){return n[+t]})}}var CJ=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function om(n){if(!(e=CJ.exec(n)))throw new Error("invalid format: "+n);var e;return new pM({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}om.prototype=pM.prototype;function pM(n){this.fill=n.fill===void 0?" ":n.fill+"",this.align=n.align===void 0?">":n.align+"",this.sign=n.sign===void 0?"-":n.sign+"",this.symbol=n.symbol===void 0?"":n.symbol+"",this.zero=!!n.zero,this.width=n.width===void 0?void 0:+n.width,this.comma=!!n.comma,this.precision=n.precision===void 0?void 0:+n.precision,this.trim=!!n.trim,this.type=n.type===void 0?"":n.type+""}pM.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function SJ(n){e:for(var e=n.length,t=1,i=-1,s;t0&&(i=0);break}return i>0?n.slice(0,i)+n.slice(s+1):n}var QW;function xJ(n,e){var t=qC(n,e);if(!t)return n+"";var i=t[0],s=t[1],o=s-(QW=Math.max(-8,Math.min(8,Math.floor(s/3)))*3)+1,r=i.length;return o===r?i:o>r?i+new Array(o-r+1).join("0"):o>0?i.slice(0,o)+"."+i.slice(o):"0."+new Array(1-o).join("0")+qC(n,Math.max(0,e+o-1))[0]}function j5(n,e){var t=qC(n,e);if(!t)return n+"";var i=t[0],s=t[1];return s<0?"0."+new Array(-s).join("0")+i:i.length>s+1?i.slice(0,s+1)+"."+i.slice(s+1):i+new Array(s-i.length+2).join("0")}const q5={"%":(n,e)=>(n*100).toFixed(e),b:n=>Math.round(n).toString(2),c:n=>n+"",d:vJ,e:(n,e)=>n.toExponential(e),f:(n,e)=>n.toFixed(e),g:(n,e)=>n.toPrecision(e),o:n=>Math.round(n).toString(8),p:(n,e)=>j5(n*100,e),r:j5,s:xJ,X:n=>Math.round(n).toString(16).toUpperCase(),x:n=>Math.round(n).toString(16)};function G5(n){return n}var K5=Array.prototype.map,Y5=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function LJ(n){var e=n.grouping===void 0||n.thousands===void 0?G5:yJ(K5.call(n.grouping,Number),n.thousands+""),t=n.currency===void 0?"":n.currency[0]+"",i=n.currency===void 0?"":n.currency[1]+"",s=n.decimal===void 0?".":n.decimal+"",o=n.numerals===void 0?G5:wJ(K5.call(n.numerals,String)),r=n.percent===void 0?"%":n.percent+"",a=n.minus===void 0?"−":n.minus+"",l=n.nan===void 0?"NaN":n.nan+"";function c(u){u=om(u);var h=u.fill,f=u.align,g=u.sign,p=u.symbol,_=u.zero,v=u.width,b=u.comma,y=u.precision,w=u.trim,S=u.type;S==="n"?(b=!0,S="g"):q5[S]||(y===void 0&&(y=12),w=!0,S="g"),(_||h==="0"&&f==="=")&&(_=!0,h="0",f="=");var L=p==="$"?t:p==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",x=p==="$"?i:/[%p]/.test(S)?r:"",D=q5[S],k=/[defgprs%]/.test(S);y=y===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y));function P(O){var M=L,R=x,z,G,te;if(S==="c")R=D(O)+R,O="";else{O=+O;var ae=O<0||1/O<0;if(O=isNaN(O)?l:D(Math.abs(O),y),w&&(O=SJ(O)),ae&&+O==0&&g!=="+"&&(ae=!1),M=(ae?g==="("?g:a:g==="-"||g==="("?"":g)+M,R=(S==="s"?Y5[8+QW/3]:"")+R+(ae&&g==="("?")":""),k){for(z=-1,G=O.length;++zte||te>57){R=(te===46?s+O.slice(z+1):O.slice(z))+R,O=O.slice(0,z);break}}}b&&!_&&(O=e(O,1/0));var fe=M.length+O.length+R.length,oe=fe>1)+M+O+R+oe.slice(fe);break;default:O=oe+M+O+R;break}return o(O)}return P.toString=function(){return u+""},P}function d(u,h){var f=c((u=om(u),u.type="f",u)),g=Math.max(-8,Math.min(8,Math.floor(sm(h)/3)))*3,p=Math.pow(10,-g),_=Y5[8+g/3];return function(v){return f(p*v)+_}}return{format:c,formatPrefix:d}}var xy,Is,JW;DJ({thousands:",",grouping:[3],currency:["$",""]});function DJ(n){return xy=LJ(n),Is=xy.format,JW=xy.formatPrefix,xy}function kJ(n){return Math.max(0,-sm(Math.abs(n)))}function EJ(n,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(sm(e)/3)))*3-sm(Math.abs(n)))}function AJ(n,e){return n=Math.abs(n),e=Math.abs(e)-n,Math.max(0,sm(e)-sm(n))+1}const yk=new Date,wk=new Date;function Fn(n,e,t,i){function s(o){return n(o=arguments.length===0?new Date:new Date(+o)),o}return s.floor=o=>(n(o=new Date(+o)),o),s.ceil=o=>(n(o=new Date(o-1)),e(o,1),n(o),o),s.round=o=>{const r=s(o),a=s.ceil(o);return o-r(e(o=new Date(+o),r==null?1:Math.floor(r)),o),s.range=(o,r,a)=>{const l=[];if(o=s.ceil(o),a=a==null?1:Math.floor(a),!(o0))return l;let c;do l.push(c=new Date(+o)),e(o,a),n(o);while(cFn(r=>{if(r>=r)for(;n(r),!o(r);)r.setTime(r-1)},(r,a)=>{if(r>=r)if(a<0)for(;++a<=0;)for(;e(r,-1),!o(r););else for(;--a>=0;)for(;e(r,1),!o(r););}),t&&(s.count=(o,r)=>(yk.setTime(+o),wk.setTime(+r),n(yk),n(wk),Math.floor(t(yk,wk))),s.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?s.filter(i?r=>i(r)%o===0:r=>s.count(0,r)%o===0):s)),s}const rm=Fn(()=>{},(n,e)=>{n.setTime(+n+e)},(n,e)=>e-n);rm.every=n=>(n=Math.floor(n),!isFinite(n)||!(n>0)?null:n>1?Fn(e=>{e.setTime(Math.floor(e/n)*n)},(e,t)=>{e.setTime(+e+t*n)},(e,t)=>(t-e)/n):rm);rm.range;const Kl=1e3,ar=Kl*60,Yl=ar*60,pc=Yl*24,mM=pc*7,Z5=pc*30,Ck=pc*365,Zl=Fn(n=>{n.setTime(n-n.getMilliseconds())},(n,e)=>{n.setTime(+n+e*Kl)},(n,e)=>(e-n)/Kl,n=>n.getUTCSeconds());Zl.range;const Qx=Fn(n=>{n.setTime(n-n.getMilliseconds()-n.getSeconds()*Kl)},(n,e)=>{n.setTime(+n+e*ar)},(n,e)=>(e-n)/ar,n=>n.getMinutes());Qx.range;const Jx=Fn(n=>{n.setUTCSeconds(0,0)},(n,e)=>{n.setTime(+n+e*ar)},(n,e)=>(e-n)/ar,n=>n.getUTCMinutes());Jx.range;const eL=Fn(n=>{n.setTime(n-n.getMilliseconds()-n.getSeconds()*Kl-n.getMinutes()*ar)},(n,e)=>{n.setTime(+n+e*Yl)},(n,e)=>(e-n)/Yl,n=>n.getHours());eL.range;const tL=Fn(n=>{n.setUTCMinutes(0,0,0)},(n,e)=>{n.setTime(+n+e*Yl)},(n,e)=>(e-n)/Yl,n=>n.getUTCHours());tL.range;const Ld=Fn(n=>n.setHours(0,0,0,0),(n,e)=>n.setDate(n.getDate()+e),(n,e)=>(e-n-(e.getTimezoneOffset()-n.getTimezoneOffset())*ar)/pc,n=>n.getDate()-1);Ld.range;const jh=Fn(n=>{n.setUTCHours(0,0,0,0)},(n,e)=>{n.setUTCDate(n.getUTCDate()+e)},(n,e)=>(e-n)/pc,n=>n.getUTCDate()-1);jh.range;const eV=Fn(n=>{n.setUTCHours(0,0,0,0)},(n,e)=>{n.setUTCDate(n.getUTCDate()+e)},(n,e)=>(e-n)/pc,n=>Math.floor(n/pc));eV.range;function Of(n){return Fn(e=>{e.setDate(e.getDate()-(e.getDay()+7-n)%7),e.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+t*7)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*ar)/mM)}const _1=Of(0),GC=Of(1),IJ=Of(2),TJ=Of(3),am=Of(4),NJ=Of(5),RJ=Of(6);_1.range;GC.range;IJ.range;TJ.range;am.range;NJ.range;RJ.range;function Ff(n){return Fn(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-n)%7),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t*7)},(e,t)=>(t-e)/mM)}const b1=Ff(0),KC=Ff(1),MJ=Ff(2),PJ=Ff(3),lm=Ff(4),OJ=Ff(5),FJ=Ff(6);b1.range;KC.range;MJ.range;PJ.range;lm.range;OJ.range;FJ.range;const fb=Fn(n=>{n.setDate(1),n.setHours(0,0,0,0)},(n,e)=>{n.setMonth(n.getMonth()+e)},(n,e)=>e.getMonth()-n.getMonth()+(e.getFullYear()-n.getFullYear())*12,n=>n.getMonth());fb.range;const gb=Fn(n=>{n.setUTCDate(1),n.setUTCHours(0,0,0,0)},(n,e)=>{n.setUTCMonth(n.getUTCMonth()+e)},(n,e)=>e.getUTCMonth()-n.getUTCMonth()+(e.getUTCFullYear()-n.getUTCFullYear())*12,n=>n.getUTCMonth());gb.range;const Ja=Fn(n=>{n.setMonth(0,1),n.setHours(0,0,0,0)},(n,e)=>{n.setFullYear(n.getFullYear()+e)},(n,e)=>e.getFullYear()-n.getFullYear(),n=>n.getFullYear());Ja.every=n=>!isFinite(n=Math.floor(n))||!(n>0)?null:Fn(e=>{e.setFullYear(Math.floor(e.getFullYear()/n)*n),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t*n)});Ja.range;const el=Fn(n=>{n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)},(n,e)=>{n.setUTCFullYear(n.getUTCFullYear()+e)},(n,e)=>e.getUTCFullYear()-n.getUTCFullYear(),n=>n.getUTCFullYear());el.every=n=>!isFinite(n=Math.floor(n))||!(n>0)?null:Fn(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/n)*n),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t*n)});el.range;function tV(n,e,t,i,s,o){const r=[[Zl,1,Kl],[Zl,5,5*Kl],[Zl,15,15*Kl],[Zl,30,30*Kl],[o,1,ar],[o,5,5*ar],[o,15,15*ar],[o,30,30*ar],[s,1,Yl],[s,3,3*Yl],[s,6,6*Yl],[s,12,12*Yl],[i,1,pc],[i,2,2*pc],[t,1,mM],[e,1,Z5],[e,3,3*Z5],[n,1,Ck]];function a(c,d,u){const h=d_).right(r,h);if(f===r.length)return n.every(ff(c/Ck,d/Ck,u));if(f===0)return rm.every(Math.max(ff(c,d,u),1));const[g,p]=r[h/r[f-1][2](n[e]=1+t,n),{});const $J={[pb]:Ja,[mb]:fb.every(3),[_b]:fb,[bb]:_1,[vb]:Ld,[iL]:Ld,[_M]:Ld,[yb]:eL,[wb]:Qx,[Cb]:Zl,[nL]:rm},UJ={[pb]:el,[mb]:gb.every(3),[_b]:gb,[bb]:b1,[vb]:jh,[iL]:jh,[_M]:jh,[yb]:tL,[wb]:Jx,[Cb]:Zl,[nL]:rm};function jJ(n){return $J[n]}function qJ(n){return UJ[n]}function Sk(n){if(0<=n.y&&n.y<100){var e=new Date(-1,n.m,n.d,n.H,n.M,n.S,n.L);return e.setFullYear(n.y),e}return new Date(n.y,n.m,n.d,n.H,n.M,n.S,n.L)}function xk(n){if(0<=n.y&&n.y<100){var e=new Date(Date.UTC(-1,n.m,n.d,n.H,n.M,n.S,n.L));return e.setUTCFullYear(n.y),e}return new Date(Date.UTC(n.y,n.m,n.d,n.H,n.M,n.S,n.L))}function w0(n,e,t){return{y:n,m:e,d:t,H:0,M:0,S:0,L:0}}function iV(n){var e=n.dateTime,t=n.date,i=n.time,s=n.periods,o=n.days,r=n.shortDays,a=n.months,l=n.shortMonths,c=C0(s),d=S0(s),u=C0(o),h=S0(o),f=C0(r),g=S0(r),p=C0(a),_=S0(a),v=C0(l),b=S0(l),y={a:ae,A:fe,b:oe,B:Se,c:null,d:iO,e:iO,f:pee,g:Lee,G:kee,H:hee,I:fee,j:gee,L:nV,m:mee,M:_ee,p:Ie,q:me,Q:oO,s:rO,S:bee,u:vee,U:yee,V:wee,w:Cee,W:See,x:null,X:null,y:xee,Y:Dee,Z:Eee,"%":sO},w={a:ie,A:Zt,b:Dt,B:Tt,c:null,d:nO,e:nO,f:Nee,g:Hee,G:Uee,H:Aee,I:Iee,j:Tee,L:oV,m:Ree,M:Mee,p:qe,q:ni,Q:oO,s:rO,S:Pee,u:Oee,U:Fee,V:Bee,w:Wee,W:Vee,x:null,X:null,y:zee,Y:$ee,Z:jee,"%":sO},S={a:P,A:O,b:M,B:R,c:z,d:eO,e:eO,f:lee,g:J5,G:Q5,H:tO,I:tO,j:see,L:aee,m:nee,M:oee,p:k,q:iee,Q:dee,s:uee,S:ree,u:XJ,U:QJ,V:JJ,w:ZJ,W:eee,x:G,X:te,y:J5,Y:Q5,Z:tee,"%":cee};y.x=L(t,y),y.X=L(i,y),y.c=L(e,y),w.x=L(t,w),w.X=L(i,w),w.c=L(e,w);function L(ke,Ve){return function(ge){var he=[],ki=-1,kt=0,It=ke.length,vi,Jo,Pu;for(ge instanceof Date||(ge=new Date(+ge));++ki53)return null;"w"in he||(he.w=1),"Z"in he?(kt=xk(w0(he.y,0,1)),It=kt.getUTCDay(),kt=It>4||It===0?KC.ceil(kt):KC(kt),kt=jh.offset(kt,(he.V-1)*7),he.y=kt.getUTCFullYear(),he.m=kt.getUTCMonth(),he.d=kt.getUTCDate()+(he.w+6)%7):(kt=Sk(w0(he.y,0,1)),It=kt.getDay(),kt=It>4||It===0?GC.ceil(kt):GC(kt),kt=Ld.offset(kt,(he.V-1)*7),he.y=kt.getFullYear(),he.m=kt.getMonth(),he.d=kt.getDate()+(he.w+6)%7)}else("W"in he||"U"in he)&&("w"in he||(he.w="u"in he?he.u%7:"W"in he?1:0),It="Z"in he?xk(w0(he.y,0,1)).getUTCDay():Sk(w0(he.y,0,1)).getDay(),he.m=0,he.d="W"in he?(he.w+6)%7+he.W*7-(It+5)%7:he.w+he.U*7-(It+6)%7);return"Z"in he?(he.H+=he.Z/100|0,he.M+=he.Z%100,xk(he)):Sk(he)}}function D(ke,Ve,ge,he){for(var ki=0,kt=Ve.length,It=ge.length,vi,Jo;ki=It)return-1;if(vi=Ve.charCodeAt(ki++),vi===37){if(vi=Ve.charAt(ki++),Jo=S[vi in X5?Ve.charAt(ki++):vi],!Jo||(he=Jo(ke,ge,he))<0)return-1}else if(vi!=ge.charCodeAt(he++))return-1}return he}function k(ke,Ve,ge){var he=c.exec(Ve.slice(ge));return he?(ke.p=d.get(he[0].toLowerCase()),ge+he[0].length):-1}function P(ke,Ve,ge){var he=f.exec(Ve.slice(ge));return he?(ke.w=g.get(he[0].toLowerCase()),ge+he[0].length):-1}function O(ke,Ve,ge){var he=u.exec(Ve.slice(ge));return he?(ke.w=h.get(he[0].toLowerCase()),ge+he[0].length):-1}function M(ke,Ve,ge){var he=v.exec(Ve.slice(ge));return he?(ke.m=b.get(he[0].toLowerCase()),ge+he[0].length):-1}function R(ke,Ve,ge){var he=p.exec(Ve.slice(ge));return he?(ke.m=_.get(he[0].toLowerCase()),ge+he[0].length):-1}function z(ke,Ve,ge){return D(ke,e,Ve,ge)}function G(ke,Ve,ge){return D(ke,t,Ve,ge)}function te(ke,Ve,ge){return D(ke,i,Ve,ge)}function ae(ke){return r[ke.getDay()]}function fe(ke){return o[ke.getDay()]}function oe(ke){return l[ke.getMonth()]}function Se(ke){return a[ke.getMonth()]}function Ie(ke){return s[+(ke.getHours()>=12)]}function me(ke){return 1+~~(ke.getMonth()/3)}function ie(ke){return r[ke.getUTCDay()]}function Zt(ke){return o[ke.getUTCDay()]}function Dt(ke){return l[ke.getUTCMonth()]}function Tt(ke){return a[ke.getUTCMonth()]}function qe(ke){return s[+(ke.getUTCHours()>=12)]}function ni(ke){return 1+~~(ke.getUTCMonth()/3)}return{format:function(ke){var Ve=L(ke+="",y);return Ve.toString=function(){return ke},Ve},parse:function(ke){var Ve=x(ke+="",!1);return Ve.toString=function(){return ke},Ve},utcFormat:function(ke){var Ve=L(ke+="",w);return Ve.toString=function(){return ke},Ve},utcParse:function(ke){var Ve=x(ke+="",!0);return Ve.toString=function(){return ke},Ve}}}var X5={"-":"",_:" ",0:"0"},Qn=/^\s*\d+/,GJ=/^%/,KJ=/[\\^$*+?|[\]().{}]/g;function Kt(n,e,t){var i=n<0?"-":"",s=(i?-n:n)+"",o=s.length;return i+(o[e.toLowerCase(),t]))}function ZJ(n,e,t){var i=Qn.exec(e.slice(t,t+1));return i?(n.w=+i[0],t+i[0].length):-1}function XJ(n,e,t){var i=Qn.exec(e.slice(t,t+1));return i?(n.u=+i[0],t+i[0].length):-1}function QJ(n,e,t){var i=Qn.exec(e.slice(t,t+2));return i?(n.U=+i[0],t+i[0].length):-1}function JJ(n,e,t){var i=Qn.exec(e.slice(t,t+2));return i?(n.V=+i[0],t+i[0].length):-1}function eee(n,e,t){var i=Qn.exec(e.slice(t,t+2));return i?(n.W=+i[0],t+i[0].length):-1}function Q5(n,e,t){var i=Qn.exec(e.slice(t,t+4));return i?(n.y=+i[0],t+i[0].length):-1}function J5(n,e,t){var i=Qn.exec(e.slice(t,t+2));return i?(n.y=+i[0]+(+i[0]>68?1900:2e3),t+i[0].length):-1}function tee(n,e,t){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(t,t+6));return i?(n.Z=i[1]?0:-(i[2]+(i[3]||"00")),t+i[0].length):-1}function iee(n,e,t){var i=Qn.exec(e.slice(t,t+1));return i?(n.q=i[0]*3-3,t+i[0].length):-1}function nee(n,e,t){var i=Qn.exec(e.slice(t,t+2));return i?(n.m=i[0]-1,t+i[0].length):-1}function eO(n,e,t){var i=Qn.exec(e.slice(t,t+2));return i?(n.d=+i[0],t+i[0].length):-1}function see(n,e,t){var i=Qn.exec(e.slice(t,t+3));return i?(n.m=0,n.d=+i[0],t+i[0].length):-1}function tO(n,e,t){var i=Qn.exec(e.slice(t,t+2));return i?(n.H=+i[0],t+i[0].length):-1}function oee(n,e,t){var i=Qn.exec(e.slice(t,t+2));return i?(n.M=+i[0],t+i[0].length):-1}function ree(n,e,t){var i=Qn.exec(e.slice(t,t+2));return i?(n.S=+i[0],t+i[0].length):-1}function aee(n,e,t){var i=Qn.exec(e.slice(t,t+3));return i?(n.L=+i[0],t+i[0].length):-1}function lee(n,e,t){var i=Qn.exec(e.slice(t,t+6));return i?(n.L=Math.floor(i[0]/1e3),t+i[0].length):-1}function cee(n,e,t){var i=GJ.exec(e.slice(t,t+1));return i?t+i[0].length:-1}function dee(n,e,t){var i=Qn.exec(e.slice(t));return i?(n.Q=+i[0],t+i[0].length):-1}function uee(n,e,t){var i=Qn.exec(e.slice(t));return i?(n.s=+i[0],t+i[0].length):-1}function iO(n,e){return Kt(n.getDate(),e,2)}function hee(n,e){return Kt(n.getHours(),e,2)}function fee(n,e){return Kt(n.getHours()%12||12,e,2)}function gee(n,e){return Kt(1+Ld.count(Ja(n),n),e,3)}function nV(n,e){return Kt(n.getMilliseconds(),e,3)}function pee(n,e){return nV(n,e)+"000"}function mee(n,e){return Kt(n.getMonth()+1,e,2)}function _ee(n,e){return Kt(n.getMinutes(),e,2)}function bee(n,e){return Kt(n.getSeconds(),e,2)}function vee(n){var e=n.getDay();return e===0?7:e}function yee(n,e){return Kt(_1.count(Ja(n)-1,n),e,2)}function sV(n){var e=n.getDay();return e>=4||e===0?am(n):am.ceil(n)}function wee(n,e){return n=sV(n),Kt(am.count(Ja(n),n)+(Ja(n).getDay()===4),e,2)}function Cee(n){return n.getDay()}function See(n,e){return Kt(GC.count(Ja(n)-1,n),e,2)}function xee(n,e){return Kt(n.getFullYear()%100,e,2)}function Lee(n,e){return n=sV(n),Kt(n.getFullYear()%100,e,2)}function Dee(n,e){return Kt(n.getFullYear()%1e4,e,4)}function kee(n,e){var t=n.getDay();return n=t>=4||t===0?am(n):am.ceil(n),Kt(n.getFullYear()%1e4,e,4)}function Eee(n){var e=n.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Kt(e/60|0,"0",2)+Kt(e%60,"0",2)}function nO(n,e){return Kt(n.getUTCDate(),e,2)}function Aee(n,e){return Kt(n.getUTCHours(),e,2)}function Iee(n,e){return Kt(n.getUTCHours()%12||12,e,2)}function Tee(n,e){return Kt(1+jh.count(el(n),n),e,3)}function oV(n,e){return Kt(n.getUTCMilliseconds(),e,3)}function Nee(n,e){return oV(n,e)+"000"}function Ree(n,e){return Kt(n.getUTCMonth()+1,e,2)}function Mee(n,e){return Kt(n.getUTCMinutes(),e,2)}function Pee(n,e){return Kt(n.getUTCSeconds(),e,2)}function Oee(n){var e=n.getUTCDay();return e===0?7:e}function Fee(n,e){return Kt(b1.count(el(n)-1,n),e,2)}function rV(n){var e=n.getUTCDay();return e>=4||e===0?lm(n):lm.ceil(n)}function Bee(n,e){return n=rV(n),Kt(lm.count(el(n),n)+(el(n).getUTCDay()===4),e,2)}function Wee(n){return n.getUTCDay()}function Vee(n,e){return Kt(KC.count(el(n)-1,n),e,2)}function zee(n,e){return Kt(n.getUTCFullYear()%100,e,2)}function Hee(n,e){return n=rV(n),Kt(n.getUTCFullYear()%100,e,2)}function $ee(n,e){return Kt(n.getUTCFullYear()%1e4,e,4)}function Uee(n,e){var t=n.getUTCDay();return n=t>=4||t===0?lm(n):lm.ceil(n),Kt(n.getUTCFullYear()%1e4,e,4)}function jee(){return"+0000"}function sO(){return"%"}function oO(n){return+n}function rO(n){return Math.floor(+n/1e3)}var dg,bM,aV,vM,lV;qee({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function qee(n){return dg=iV(n),bM=dg.format,aV=dg.parse,vM=dg.utcFormat,lV=dg.utcParse,dg}function Ly(n){const e={};return t=>e[t]||(e[t]=n(t))}function aO(n,e,t){t=t||{},Ms(t)||In(`Invalid time multi-format specifier: ${t}`);const i=e(Cb),s=e(wb),o=e(yb),r=e(vb),a=e(bb),l=e(_b),c=e(mb),d=e(pb),u=n(t[nL]||".%L"),h=n(t[Cb]||":%S"),f=n(t[wb]||"%I:%M"),g=n(t[yb]||"%I %p"),p=n(t[vb]||t[iL]||"%a %d"),_=n(t[bb]||"%b %d"),v=n(t[_b]||"%B"),b=n(t[mb]||"%B"),y=n(t[pb]||"%Y");return w=>(i(w)Ti(i)?e(i):aO(e,jJ,i),utcFormat:i=>Ti(i)?t(i):aO(t,qJ,i),timeParse:Ly(n.parse),utcParse:Ly(n.utcParse)}}let jE;Gee();function Gee(){return jE=cV({format:bM,parse:aV,utcFormat:vM,utcParse:lV})}function Kee(n){return cV(iV(n))}function Yee(n){return arguments.length?jE=Kee(n):jE}const Zee=n=>n!=null&&n===n,Xee=n=>n==="true"||n==="false"||n===!0||n===!1,Qee=n=>!Number.isNaN(Date.parse(n)),dV=n=>!Number.isNaN(+n)&&!(n instanceof Date),Jee=n=>dV(n)&&Number.isInteger(+n),lO={boolean:WQ,integer:ub,number:ub,date:zQ,string:HQ,unknown:Yx},Dy=[Xee,Jee,dV,Qee],ete=["boolean","integer","number","date"];function tte(n,e){if(!n||!n.length)return"unknown";const t=n.length,i=Dy.length,s=Dy.map((o,r)=>r+1);for(let o=0,r=0,a,l;oo===0?r:o,0)-1]}function ite(n,e){return e.reduce((t,i)=>(t[i]=tte(n,i),t),{})}function cO(n){const e=function(t,i){const s={delimiter:n};return yM(t,i?MQ(i,s):s)};return e.responseType="text",e}function yM(n,e){return e.header&&(n=e.header.map(gM).join(e.delimiter)+` +`+n),UW(e.delimiter).parse(n+"")}yM.responseType="text";function nte(n){return typeof Buffer=="function"&&fr(Buffer.isBuffer)?Buffer.isBuffer(n):!1}function wM(n,e){const t=e&&e.property?Kx(e.property):Yx;return Ms(n)&&!nte(n)?ste(t(n),e):t(JSON.parse(n))}wM.responseType="json";function ste(n,e){return!cs(n)&&FQ(n)&&(n=[...n]),e&&e.copy?JSON.parse(JSON.stringify(n)):n}const ote={interior:(n,e)=>n!==e,exterior:(n,e)=>n===e};function uV(n,e){let t,i,s,o;return n=wM(n,e),e&&e.feature?(t=XQ,s=e.feature):e&&e.mesh?(t=JQ,s=e.mesh,o=ote[e.filter]):In("Missing TopoJSON feature or mesh parameter."),i=(i=n.objects[s])?t(n,i,o):In("Invalid TopoJSON object: "+s),i&&i.features||[i]}uV.responseType="json";const Lk={dsv:yM,csv:cO(","),tsv:cO(" "),json:wM,topojson:uV};function CM(n,e){return arguments.length>1?(Lk[n]=e,this):Pg(Lk,n)?Lk[n]:null}function SM(n,e,t,i){e=e||{};const s=CM(e.type||"json");return s||In("Unknown data format type: "+e.type),n=s(n,e),e.parse&&rte(n,e.parse,t,i),Pg(n,"columns")&&delete n.columns,n}function rte(n,e,t,i){if(!n.length)return;const s=Yee();t=t||s.timeParse,i=i||s.utcParse;let o=n.columns||Object.keys(n[0]),r,a,l,c,d,u;e==="auto"&&(e=ite(n,o)),o=Object.keys(e);const h=o.map(f=>{const g=e[f];let p,_;if(g&&(g.startsWith("date:")||g.startsWith("utc:")))return p=g.split(/:(.+)?/,2),_=p[1],(_[0]==="'"&&_[_.length-1]==="'"||_[0]==='"'&&_[_.length-1]==='"')&&(_=_.slice(1,-1)),(p[0]==="utc"?i:t)(_);if(!lO[g])throw Error("Illegal format pattern: "+f+":"+g);return lO[g]});for(l=0,d=n.length,u=o.length;l2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(n){return Object.keys(n).reduce((e,t)=>{const i=n[t];return i==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(n,[e]){const{style:t}=n.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const i of this.ft)e[i]==null&&(this.ft.delete(i),i.includes("-")?t.removeProperty(i):t[i]=null);for(const i in e){const s=e[i];if(s!=null){this.ft.add(i);const o=typeof s=="string"&&s.endsWith(Zee);i.includes("-")||o?t.setProperty(i,o?s.slice(0,-11):s,o?fV:""):t[i]=s}}return af}}),Qee="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cstyle%3e.spinner_ajPY{transform-origin:center;animation:spinner_AtaB%20.75s%20infinite%20linear}@keyframes%20spinner_AtaB{100%25{transform:rotate(360deg)}}%3c/style%3e%3cpath%20d='M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z'%20opacity='.25'/%3e%3cpath%20d='M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z'%20class='spinner_ajPY'/%3e%3c/svg%3e",Jee=` + */const hV="important",ate=" !"+hV,lte=tW(class extends iW{constructor(n){var e;if(super(n),n.type!==eW.ATTRIBUTE||n.name!=="style"||((e=n.strings)==null?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(n){return Object.keys(n).reduce((e,t)=>{const i=n[t];return i==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(n,[e]){const{style:t}=n.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const i of this.ft)e[i]==null&&(this.ft.delete(i),i.includes("-")?t.removeProperty(i):t[i]=null);for(const i in e){const s=e[i];if(s!=null){this.ft.add(i);const o=typeof s=="string"&&s.endsWith(ate);i.includes("-")||o?t.setProperty(i,o?s.slice(0,-11):s,o?hV:""):t[i]=s}}return df}}),cte="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cstyle%3e.spinner_ajPY{transform-origin:center;animation:spinner_AtaB%20.75s%20infinite%20linear}@keyframes%20spinner_AtaB{100%25{transform:rotate(360deg)}}%3c/style%3e%3cpath%20d='M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z'%20opacity='.25'/%3e%3cpath%20d='M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z'%20class='spinner_ajPY'/%3e%3c/svg%3e",dte=` .genome-spy { font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; position: relative; @@ -996,9 +789,9 @@ svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa { font-size: 14px; padding: 10px; } -`;function ete(n,e){var t=n.getBoundingClientRect();return[e.clientX-t.left-n.clientLeft,e.clientY-t.top-n.clientTop]}function iS(n,e){return n.length==e.length&&n.every((t,i)=>n[i]===e[i])}function Zs(n){return Array.isArray(n)?n:typeof n<"u"?[n]:[]}function _1(n){return n[n.length-1]}class tte{constructor(e){this.container=e,this.element=document.createElement("div"),this.element.className="tooltip",this._visible=!0,this.container.appendChild(this.element),this._previousTooltipDatum=void 0,this.enabledStack=[!0],this._penaltyUntil=0,this._lastCoords=void 0,this._previousMove=0,this.clear()}set visible(e){e!=this._visible&&(this.element.style.display=e?null:"none",this._visible=e)}get visible(){return this._visible}get enabled(){return _1(this.enabledStack)??!0}pushEnabledState(e){this.enabledStack.push(e),e||(this.visible=!1)}popEnabledState(){this.enabledStack.pop()}handleMouseMove(e){this.mouseCoords=ete(this.container,e);const t=performance.now();!this.visible&&!this._isPenalty()&&t-this._previousMove>500&&(this._penaltyUntil=t+70),this._lastCoords&&ite(this.mouseCoords,this._lastCoords)>20&&(this._penaltyUntil=t+400),this._lastCoords=this.mouseCoords,this.visible&&this.updatePlacement(),this._previousMove=t}updatePlacement(){const[t,i]=this.mouseCoords;let s=t+20;s>this.container.clientWidth-this.element.offsetWidth&&(s=t-20-this.element.offsetWidth),this.element.style.left=s+"px",this.element.style.top=Math.min(i+20,this.container.clientHeight-this.element.offsetHeight)+"px"}setContent(e){if(!e||!this.enabled||this._isPenalty()){this.visible&&(Qp("",this.element),this.visible=!1),this._previousTooltipDatum=void 0;return}Qp(e,this.element),this.visible=!0,this.updatePlacement()}clear(){this._previousTooltipDatum=void 0,this.setContent(void 0)}updateWithDatum(e,t){e!==this._previousTooltipDatum&&(this._previousTooltipDatum=e,t||(t=i=>Promise.resolve(It` ${JSON.stringify(i)} `)),t(e).then(i=>this.setContent(i)).catch(i=>{if(i!=="debounced")throw i}))}_isPenalty(){return this._penaltyUntil&&this._penaltyUntil>performance.now()}}function ite(n,e){let t=0;for(let i=0;in[i]===e[i])}function Ks(n){return Array.isArray(n)?n:typeof n<"u"?[n]:[]}function v1(n){return n[n.length-1]}class hte{constructor(e){this.container=e,this.element=document.createElement("div"),this.element.className="tooltip",this._visible=!0,this.container.appendChild(this.element),this._previousTooltipDatum=void 0,this.enabledStack=[!0],this._penaltyUntil=0,this._lastCoords=void 0,this._previousMove=0,this.clear()}set visible(e){e!=this._visible&&(this.element.style.display=e?null:"none",this._visible=e)}get visible(){return this._visible}get enabled(){return v1(this.enabledStack)??!0}pushEnabledState(e){this.enabledStack.push(e),e||(this.visible=!1)}popEnabledState(){this.enabledStack.pop()}handleMouseMove(e){this.mouseCoords=ute(this.container,e);const t=performance.now();!this.visible&&!this._isPenalty()&&t-this._previousMove>500&&(this._penaltyUntil=t+70),this._lastCoords&&fte(this.mouseCoords,this._lastCoords)>20&&(this._penaltyUntil=t+400),this._lastCoords=this.mouseCoords,this.visible&&this.updatePlacement(),this._previousMove=t}updatePlacement(){const[t,i]=this.mouseCoords;let s=t+20;s>this.container.clientWidth-this.element.offsetWidth&&(s=t-20-this.element.offsetWidth),this.element.style.left=s+"px",this.element.style.top=Math.min(i+20,this.container.clientHeight-this.element.offsetHeight)+"px"}setContent(e){if(!e||!this.enabled||this._isPenalty()){this.visible&&(em("",this.element),this.visible=!1),this._previousTooltipDatum=void 0;return}em(e,this.element),this.visible=!0,this.updatePlacement()}clear(){this._previousTooltipDatum=void 0,this.setContent(void 0)}updateWithDatum(e,t){e!==this._previousTooltipDatum&&(this._previousTooltipDatum=e,t||(t=i=>Promise.resolve(Lt` ${JSON.stringify(i)} `)),t(e).then(i=>this.setContent(i)).catch(i=>{if(i!=="debounced")throw i}))}_isPenalty(){return this._penaltyUntil&&this._penaltyUntil>performance.now()}}function fte(n,e){let t=0;for(let i=0;i0)throw new Error(`Can not guess numComponents for attribute '${n}'. Tried ${t} but ${e} values is not evenly divisible by ${t}. You should specify it.`);return t}function Tte(n,e){return n.numComponents||n.size||CV(e,Ete(n).length)}function RM(n,e){if(nS(n))return n;if(nS(n.data))return n.data;Array.isArray(n)&&(n={data:n});let t=n.type;return t||(wV(e)?t=Uint16Array:t=Float32Array),new t(n.data)}function Nte(n,e){const t={};return Object.keys(e).forEach(function(i){if(!wV(i)){const s=e[i],o=s.attrib||s.name||s.attribName||bV.attribPrefix+i;if(s.value){if(!Array.isArray(s.value)&&!nS(s.value))throw new Error("array.value is not array or typedarray");t[o]={value:s.value}}else{let r,a,l,c;if(s.buffer&&s.buffer instanceof WebGLBuffer)r=s.buffer,c=s.numComponents||s.size,a=s.type,l=s.normalize;else if(typeof s=="number"||typeof s.data=="number"){const d=s.data||s,u=s.type||Float32Array,h=d*u.BYTES_PER_ELEMENT;a=hte(u),l=s.normalize!==void 0?s.normalize:kte(u),c=s.numComponents||s.size||CV(i,d),r=n.createBuffer(),n.bindBuffer(Ga,r),n.bufferData(Ga,h,s.drawType||_V)}else{const d=RM(s,i);r=yV(n,d,void 0,s.drawType),a=NM(d),l=s.normalize!==void 0?s.normalize:Dte(d),c=Tte(s,i)}t[o]={buffer:r,numComponents:c,type:a,normalize:l,stride:s.stride||0,offset:s.offset||0,divisor:s.divisor===void 0?void 0:s.divisor,drawType:s.drawType}}}}),n.bindBuffer(Ga,null),t}function Rte(n,e,t,i){t=RM(t),i!==void 0?(n.bindBuffer(Ga,e.buffer),n.bufferSubData(Ga,i,t)):vV(n,Ga,e.buffer,t,e.drawType)}function Mte(n,e){return e===vte||e===yte?1:e===wte||e===Cte?2:e===Ste||e===xte||e===Lte?4:0}const Tk=["position","positions","a_position"];function Pte(n,e){let t,i;for(i=0;i{const y=v*b.ndx,w=t.subarray(y,y+v);n.texImage2D(b.face,l,c,o,r,0,u,h,w)})}else s===Ud||s===jd?n.texImage3D(s,l,c,o,r,a,0,u,h,t):n.texImage2D(s,l,c,o,r,0,u,h,t);return{width:o,height:r,depth:a,type:h}}function fne(n,e,t){const i=t.target||yc;n.bindTexture(i,e);const s=t.level||0,o=t.internalFormat||t.format||Ii,r=Gm(o),a=t.format||r.format,l=t.type||r.type;if(am(n,t),i===mc)for(let c=0;c<6;++c)n.texImage2D(hL+c,s,o,t.width,t.height,0,a,l,null);else i===Ud||i===jd?n.texImage3D(i,s,o,t.width,t.height,t.depth,0,a,l,null):n.texImage2D(i,s,o,t.width,t.height,0,a,l,null)}function Sb(n,e,t){t=t||b1,e=e||hu.textureOptions;const i=n.createTexture(),s=e.target||yc;let o=e.width||1,r=e.height||1;const a=e.internalFormat||Ii;n.bindTexture(s,i),s===mc&&(n.texParameteri(s,oS,sS),n.texParameteri(s,rS,sS));let l=e.src;if(l)if(typeof l=="function"&&(l=l(n,e)),typeof l=="string")dne(n,i,e,t);else if(rm(l)||Array.isArray(l)&&(typeof l[0]=="number"||Array.isArray(l[0])||rm(l[0]))){const c=MV(n,i,l,e);o=c.width,r=c.height}else Array.isArray(l)&&(typeof l[0]=="string"||RV(l[0]))?s===mc?une(n,i,e,t):hne(n,i,e,t):(NV(n,i,l,e),o=l.width,r=l.height);else fne(n,i,e);return Cb(e)&&tA(n,i,e,o,r,a),TV(n,i,e),i}function gne(n,e,t,i,s,o){i=i||t.width,s=s||t.height,o=o||t.depth;const r=t.target||yc;n.bindTexture(r,e);const a=t.level||0,l=t.internalFormat||t.format||Ii,c=Gm(l),d=t.format||c.format;let u;const h=t.src;if(h&&(rm(h)||Array.isArray(h)&&typeof h[0]=="number")?u=t.type||AV(n,h,c.type):u=t.type||c.type,r===mc)for(let f=0;f<6;++f)n.texImage2D(hL+f,a,l,i,s,0,d,u,null);else r===Ud||r===jd?n.texImage3D(r,a,l,i,s,o,0,d,u,null):n.texImage2D(r,a,l,i,s,0,d,u,null)}const pne=pV,aS=33984,mne=35048,gL=34962,_ne=34963,FM=35345,PV=35718,bne=35721,vne=35971,yne=35382,wne=35396,Cne=35398,Sne=35392,xne=35395,pL=5126,OV=35664,FV=35665,BV=35666,BM=5124,WV=35667,VV=35668,zV=35669,HV=35670,$V=35671,UV=35672,jV=35673,qV=35674,GV=35675,KV=35676,Lne=35678,Dne=35680,kne=35679,Ene=35682,Ane=35685,Ine=35686,Tne=35687,Nne=35688,Rne=35689,Mne=35690,Pne=36289,One=36292,Fne=36293,WM=5125,YV=36294,ZV=36295,XV=36296,Bne=36298,Wne=36299,Vne=36300,zne=36303,Hne=36306,$ne=36307,Une=36308,jne=36311,mL=3553,_L=34067,VM=32879,bL=35866,wt={};function QV(n,e){return wt[e].bindPoint}function qne(n,e){return function(t){n.uniform1f(e,t)}}function Gne(n,e){return function(t){n.uniform1fv(e,t)}}function Kne(n,e){return function(t){n.uniform2fv(e,t)}}function Yne(n,e){return function(t){n.uniform3fv(e,t)}}function Zne(n,e){return function(t){n.uniform4fv(e,t)}}function JV(n,e){return function(t){n.uniform1i(e,t)}}function ez(n,e){return function(t){n.uniform1iv(e,t)}}function tz(n,e){return function(t){n.uniform2iv(e,t)}}function iz(n,e){return function(t){n.uniform3iv(e,t)}}function nz(n,e){return function(t){n.uniform4iv(e,t)}}function Xne(n,e){return function(t){n.uniform1ui(e,t)}}function Qne(n,e){return function(t){n.uniform1uiv(e,t)}}function Jne(n,e){return function(t){n.uniform2uiv(e,t)}}function ese(n,e){return function(t){n.uniform3uiv(e,t)}}function tse(n,e){return function(t){n.uniform4uiv(e,t)}}function ise(n,e){return function(t){n.uniformMatrix2fv(e,!1,t)}}function nse(n,e){return function(t){n.uniformMatrix3fv(e,!1,t)}}function sse(n,e){return function(t){n.uniformMatrix4fv(e,!1,t)}}function ose(n,e){return function(t){n.uniformMatrix2x3fv(e,!1,t)}}function rse(n,e){return function(t){n.uniformMatrix3x2fv(e,!1,t)}}function ase(n,e){return function(t){n.uniformMatrix2x4fv(e,!1,t)}}function lse(n,e){return function(t){n.uniformMatrix4x2fv(e,!1,t)}}function cse(n,e){return function(t){n.uniformMatrix3x4fv(e,!1,t)}}function dse(n,e){return function(t){n.uniformMatrix4x3fv(e,!1,t)}}function oo(n,e,t,i){const s=QV(n,e);return qm(n)?function(o){let r,a;uL(n,o)?(r=o,a=null):(r=o.texture,a=o.sampler),n.uniform1i(i,t),n.activeTexture(aS+t),n.bindTexture(s,r),n.bindSampler(t,a)}:function(o){n.uniform1i(i,t),n.activeTexture(aS+t),n.bindTexture(s,o)}}function ro(n,e,t,i,s){const o=QV(n,e),r=new Int32Array(s);for(let a=0;an>="0"&&n<="9";function oz(n,e,t,i){const s=n.split(use).filter(a=>a!=="");let o=0,r="";for(;;){const a=s[o++];r+=a;const l=hse(a[0]),c=l?parseInt(a):a;if(l&&(r+=s[o++]),o===s.length){t[c]=e;break}else{const u=s[o++],h=u==="[",f=t[c]||(h?[]:{});t[c]=f,t=f,i[r]=i[r]||function(g){return function(p){az(g,p)}}(f),r+=u}}}function fse(n,e){let t=0;function i(a,l,c){const d=l.name.endsWith("[0]"),u=l.type,h=wt[u];if(!h)throw new Error(`unknown type: 0x${u.toString(16)}`);let f;if(h.bindPoint){const g=t;t+=l.size,d?f=h.arraySetter(n,u,g,c,l.size):f=h.setter(n,u,g,c,l.size)}else h.arraySetter&&d?f=h.arraySetter(n,c):f=h.setter(n,c);return f.location=c,f}const s={},o={},r=n.getProgramParameter(e,PV);for(let a=0;a((n+(e-1))/e|0)*e;function _se(n,e,t,i){if(e||t){i=i||1;const o=n.length/4;return function(r){let a=0,l=0;for(let c=0;c=sA&&n1?n.renderbufferStorageMultisample(Ch,u,h,t,i):n.renderbufferStorage(Ch,h,t,i);else{const g=Object.assign({},l);g.width=t,g.height=i,g.auto===void 0&&(g.auto=!1,g.min=g.min||g.minMag||rA,g.mag=g.mag||g.minMag||rA,g.wrapS=g.wrapS||g.wrap||oA,g.wrapT=g.wrapT||g.wrap||oA),d=Sb(n,g)}if(mV(n,d))n.framebufferRenderbuffer(s,f,Ch,d);else if(uL(n,d))l.layer!==void 0?n.framebufferTextureLayer(s,f,d,l.level||0,l.layer):n.framebufferTexture2D(s,f,l.target||xse,d,l.level||0);else throw new Error("unknown attachment type");a.attachments.push(d)}),n.drawBuffers&&n.drawBuffers(r),a}function Vse(n,e,t,i,s){i=i||n.drawingBufferWidth,s=s||n.drawingBufferHeight,e.width=i,e.height=s,t=t||hz,t.forEach(function(o,r){const a=e.attachments[r],l=o.format,c=o.samples;if(c!==void 0||mV(n,a))n.bindRenderbuffer(Ch,a),c>1?n.renderbufferStorageMultisample(Ch,c,l,i,s):n.renderbufferStorage(Ch,l,i,s);else if(uL(n,a))gne(n,a,o,i,s);else throw new Error("unknown attachment type")})}function zse(n,e,t){const i=n.createVertexArray();return n.bindVertexArray(i),e.length||(e=[e]),e.forEach(function(s){uf(n,s,t)}),n.bindVertexArray(null),{numElements:t.numElements,elementType:t.elementType,vertexArrayObject:i}}const Hse=/^(.*?)_/;function $se(n,e){KE(n,0);const t=n.getExtension(e);if(t){const i={},s=Hse.exec(e)[1],o="_"+s;for(const r in t){const a=t[r],l=typeof a=="function",c=l?s:o;let d=r;r.endsWith(c)&&(d=r.substring(0,r.length-c.length)),n[d]!==void 0?!l&&n[d]!==a&&pV(d,n[d],a,r):l?n[d]=function(u){return function(){return u.apply(t,arguments)}}(a):(n[d]=a,i[d]=a)}i.constructor={name:t.constructor.name},KE(i,0)}return t}const CO=["ANGLE_instanced_arrays","EXT_blend_minmax","EXT_color_buffer_float","EXT_color_buffer_half_float","EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2","EXT_frag_depth","EXT_sRGB","EXT_shader_texture_lod","EXT_texture_filter_anisotropic","OES_element_index_uint","OES_standard_derivatives","OES_texture_float","OES_texture_float_linear","OES_texture_half_float","OES_texture_half_float_linear","OES_vertex_array_object","WEBGL_color_buffer_float","WEBGL_compressed_texture_atc","WEBGL_compressed_texture_etc1","WEBGL_compressed_texture_pvrtc","WEBGL_compressed_texture_s3tc","WEBGL_compressed_texture_s3tc_srgb","WEBGL_depth_texture","WEBGL_draw_buffers"];function fz(n){for(let e=0;e0)throw new Error(`Can not guess numComponents for attribute '${n}'. Tried ${t} but ${e} values is not evenly divisible by ${t}. You should specify it.`);return t}function Hte(n,e){return n.numComponents||n.size||wV(e,Wte(n).length)}function TM(n,e){if(ZC(n))return n;if(ZC(n.data))return n.data;Array.isArray(n)&&(n={data:n});let t=n.type;return t||(yV(e)?t=Uint16Array:t=Float32Array),new t(n.data)}function $te(n,e){const t={};return Object.keys(e).forEach(function(i){if(!yV(i)){const s=e[i],o=s.attrib||s.name||s.attribName||_V.attribPrefix+i;if(s.value){if(!Array.isArray(s.value)&&!ZC(s.value))throw new Error("array.value is not array or typedarray");t[o]={value:s.value}}else{let r,a,l,c;if(s.buffer&&s.buffer instanceof WebGLBuffer)r=s.buffer,c=s.numComponents||s.size,a=s.type,l=s.normalize;else if(typeof s=="number"||typeof s.data=="number"){const d=s.data||s,u=s.type||Float32Array,h=d*u.BYTES_PER_ELEMENT;a=Ste(u),l=s.normalize!==void 0?s.normalize:Bte(u),c=s.numComponents||s.size||wV(i,d),r=n.createBuffer(),n.bindBuffer(qa,r),n.bufferData(qa,h,s.drawType||mV)}else{const d=TM(s,i);r=vV(n,d,void 0,s.drawType),a=IM(d),l=s.normalize!==void 0?s.normalize:Fte(d),c=Hte(s,i)}t[o]={buffer:r,numComponents:c,type:a,normalize:l,stride:s.stride||0,offset:s.offset||0,divisor:s.divisor===void 0?void 0:s.divisor,drawType:s.drawType}}}}),n.bindBuffer(qa,null),t}function Ute(n,e,t,i){t=TM(t),i!==void 0?(n.bindBuffer(qa,e.buffer),n.bufferSubData(qa,i,t)):bV(n,qa,e.buffer,t,e.drawType)}function jte(n,e){return e===Ite||e===Tte?1:e===Nte||e===Rte?2:e===Mte||e===Pte||e===Ote?4:0}const Dk=["position","positions","a_position"];function qte(n,e){let t,i;for(i=0;i{const y=v*b.ndx,w=t.subarray(y,y+v);n.texImage2D(b.face,l,c,o,r,0,u,h,w)})}else s===jd||s===qd?n.texImage3D(s,l,c,o,r,a,0,u,h,t):n.texImage2D(s,l,c,o,r,0,u,h,t);return{width:o,height:r,depth:a,type:h}}function xne(n,e,t){const i=t.target||yc;n.bindTexture(i,e);const s=t.level||0,o=t.internalFormat||t.format||Ii,r=Xm(o),a=t.format||r.format,l=t.type||r.type;if(dm(n,t),i===mc)for(let c=0;c<6;++c)n.texImage2D(oL+c,s,o,t.width,t.height,0,a,l,null);else i===jd||i===qd?n.texImage3D(i,s,o,t.width,t.height,t.depth,0,a,l,null):n.texImage2D(i,s,o,t.width,t.height,0,a,l,null)}function Lb(n,e,t){t=t||y1,e=e||fu.textureOptions;const i=n.createTexture(),s=e.target||yc;let o=e.width||1,r=e.height||1;const a=e.internalFormat||Ii;n.bindTexture(s,i),s===mc&&(n.texParameteri(s,QC,XC),n.texParameteri(s,JC,XC));let l=e.src;if(l)if(typeof l=="function"&&(l=l(n,e)),typeof l=="string")wne(n,i,e,t);else if(cm(l)||Array.isArray(l)&&(typeof l[0]=="number"||Array.isArray(l[0])||cm(l[0]))){const c=RV(n,i,l,e);o=c.width,r=c.height}else Array.isArray(l)&&(typeof l[0]=="string"||NV(l[0]))?s===mc?Cne(n,i,e,t):Sne(n,i,e,t):(TV(n,i,l,e),o=l.width,r=l.height);else xne(n,i,e);return xb(e)&&JE(n,i,e,o,r,a),IV(n,i,e),i}function Lne(n,e,t,i,s,o){i=i||t.width,s=s||t.height,o=o||t.depth;const r=t.target||yc;n.bindTexture(r,e);const a=t.level||0,l=t.internalFormat||t.format||Ii,c=Xm(l),d=t.format||c.format;let u;const h=t.src;if(h&&(cm(h)||Array.isArray(h)&&typeof h[0]=="number")?u=t.type||EV(n,h,c.type):u=t.type||c.type,r===mc)for(let f=0;f<6;++f)n.texImage2D(oL+f,a,l,i,s,0,d,u,null);else r===jd||r===qd?n.texImage3D(r,a,l,i,s,o,0,d,u,null):n.texImage2D(r,a,l,i,s,0,d,u,null)}const Dne=gV,eS=33984,kne=35048,aL=34962,Ene=34963,PM=35345,MV=35718,Ane=35721,Ine=35971,Tne=35382,Nne=35396,Rne=35398,Mne=35392,Pne=35395,lL=5126,PV=35664,OV=35665,FV=35666,OM=5124,BV=35667,WV=35668,VV=35669,zV=35670,HV=35671,$V=35672,UV=35673,jV=35674,qV=35675,GV=35676,One=35678,Fne=35680,Bne=35679,Wne=35682,Vne=35685,zne=35686,Hne=35687,$ne=35688,Une=35689,jne=35690,qne=36289,Gne=36292,Kne=36293,FM=5125,KV=36294,YV=36295,ZV=36296,Yne=36298,Zne=36299,Xne=36300,Qne=36303,Jne=36306,ese=36307,tse=36308,ise=36311,cL=3553,dL=34067,BM=32879,uL=35866,yt={};function XV(n,e){return yt[e].bindPoint}function nse(n,e){return function(t){n.uniform1f(e,t)}}function sse(n,e){return function(t){n.uniform1fv(e,t)}}function ose(n,e){return function(t){n.uniform2fv(e,t)}}function rse(n,e){return function(t){n.uniform3fv(e,t)}}function ase(n,e){return function(t){n.uniform4fv(e,t)}}function QV(n,e){return function(t){n.uniform1i(e,t)}}function JV(n,e){return function(t){n.uniform1iv(e,t)}}function ez(n,e){return function(t){n.uniform2iv(e,t)}}function tz(n,e){return function(t){n.uniform3iv(e,t)}}function iz(n,e){return function(t){n.uniform4iv(e,t)}}function lse(n,e){return function(t){n.uniform1ui(e,t)}}function cse(n,e){return function(t){n.uniform1uiv(e,t)}}function dse(n,e){return function(t){n.uniform2uiv(e,t)}}function use(n,e){return function(t){n.uniform3uiv(e,t)}}function hse(n,e){return function(t){n.uniform4uiv(e,t)}}function fse(n,e){return function(t){n.uniformMatrix2fv(e,!1,t)}}function gse(n,e){return function(t){n.uniformMatrix3fv(e,!1,t)}}function pse(n,e){return function(t){n.uniformMatrix4fv(e,!1,t)}}function mse(n,e){return function(t){n.uniformMatrix2x3fv(e,!1,t)}}function _se(n,e){return function(t){n.uniformMatrix3x2fv(e,!1,t)}}function bse(n,e){return function(t){n.uniformMatrix2x4fv(e,!1,t)}}function vse(n,e){return function(t){n.uniformMatrix4x2fv(e,!1,t)}}function yse(n,e){return function(t){n.uniformMatrix3x4fv(e,!1,t)}}function wse(n,e){return function(t){n.uniformMatrix4x3fv(e,!1,t)}}function io(n,e,t,i){const s=XV(n,e);return Zm(n)?function(o){let r,a;sL(n,o)?(r=o,a=null):(r=o.texture,a=o.sampler),n.uniform1i(i,t),n.activeTexture(eS+t),n.bindTexture(s,r),n.bindSampler(t,a)}:function(o){n.uniform1i(i,t),n.activeTexture(eS+t),n.bindTexture(s,o)}}function no(n,e,t,i,s){const o=XV(n,e),r=new Int32Array(s);for(let a=0;an>="0"&&n<="9";function sz(n,e,t,i){const s=n.split(Cse).filter(a=>a!=="");let o=0,r="";for(;;){const a=s[o++];r+=a;const l=Sse(a[0]),c=l?parseInt(a):a;if(l&&(r+=s[o++]),o===s.length){t[c]=e;break}else{const u=s[o++],h=u==="[",f=t[c]||(h?[]:{});t[c]=f,t=f,i[r]=i[r]||function(g){return function(p){rz(g,p)}}(f),r+=u}}}function xse(n,e){let t=0;function i(a,l,c){const d=l.name.endsWith("[0]"),u=l.type,h=yt[u];if(!h)throw new Error(`unknown type: 0x${u.toString(16)}`);let f;if(h.bindPoint){const g=t;t+=l.size,d?f=h.arraySetter(n,u,g,c,l.size):f=h.setter(n,u,g,c,l.size)}else h.arraySetter&&d?f=h.arraySetter(n,c):f=h.setter(n,c);return f.location=c,f}const s={},o={},r=n.getProgramParameter(e,MV);for(let a=0;a((n+(e-1))/e|0)*e;function Ese(n,e,t,i){if(e||t){i=i||1;const o=n.length/4;return function(r){let a=0,l=0;for(let c=0;c=iA&&n1?n.renderbufferStorageMultisample(Ch,u,h,t,i):n.renderbufferStorage(Ch,h,t,i);else{const g=Object.assign({},l);g.width=t,g.height=i,g.auto===void 0&&(g.auto=!1,g.min=g.min||g.minMag||sA,g.mag=g.mag||g.minMag||sA,g.wrapS=g.wrapS||g.wrap||nA,g.wrapT=g.wrapT||g.wrap||nA),d=Lb(n,g)}if(pV(n,d))n.framebufferRenderbuffer(s,f,Ch,d);else if(sL(n,d))l.layer!==void 0?n.framebufferTextureLayer(s,f,d,l.level||0,l.layer):n.framebufferTexture2D(s,f,l.target||Pse,d,l.level||0);else throw new Error("unknown attachment type");a.attachments.push(d)}),n.drawBuffers&&n.drawBuffers(r),a}function Xse(n,e,t,i,s){i=i||n.drawingBufferWidth,s=s||n.drawingBufferHeight,e.width=i,e.height=s,t=t||uz,t.forEach(function(o,r){const a=e.attachments[r],l=o.format,c=o.samples;if(c!==void 0||pV(n,a))n.bindRenderbuffer(Ch,a),c>1?n.renderbufferStorageMultisample(Ch,c,l,i,s):n.renderbufferStorage(Ch,l,i,s);else if(sL(n,a))Lne(n,a,o,i,s);else throw new Error("unknown attachment type")})}function Qse(n,e,t){const i=n.createVertexArray();return n.bindVertexArray(i),e.length||(e=[e]),e.forEach(function(s){gf(n,s,t)}),n.bindVertexArray(null),{numElements:t.numElements,elementType:t.elementType,vertexArrayObject:i}}const Jse=/^(.*?)_/;function eoe(n,e){qE(n,0);const t=n.getExtension(e);if(t){const i={},s=Jse.exec(e)[1],o="_"+s;for(const r in t){const a=t[r],l=typeof a=="function",c=l?s:o;let d=r;r.endsWith(c)&&(d=r.substring(0,r.length-c.length)),n[d]!==void 0?!l&&n[d]!==a&&gV(d,n[d],a,r):l?n[d]=function(u){return function(){return u.apply(t,arguments)}}(a):(n[d]=a,i[d]=a)}i.constructor={name:t.constructor.name},qE(i,0)}return t}const vO=["ANGLE_instanced_arrays","EXT_blend_minmax","EXT_color_buffer_float","EXT_color_buffer_half_float","EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2","EXT_frag_depth","EXT_sRGB","EXT_shader_texture_lod","EXT_texture_filter_anisotropic","OES_element_index_uint","OES_standard_derivatives","OES_texture_float","OES_texture_float_linear","OES_texture_half_float","OES_texture_half_float_linear","OES_vertex_array_object","WEBGL_color_buffer_float","WEBGL_compressed_texture_atc","WEBGL_compressed_texture_etc1","WEBGL_compressed_texture_pvrtc","WEBGL_compressed_texture_s3tc","WEBGL_compressed_texture_s3tc_srgb","WEBGL_depth_texture","WEBGL_draw_buffers"];function hz(n){for(let e=0;e>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?Oy(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?Oy(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Zse.exec(n))?new Zn(e[1],e[2],e[3],1):(e=Xse.exec(n))?new Zn(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Qse.exec(n))?Oy(e[1],e[2],e[3],e[4]):(e=Jse.exec(n))?Oy(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=eoe.exec(n))?AO(e[1],e[2]/100,e[3]/100,1):(e=toe.exec(n))?AO(e[1],e[2]/100,e[3]/100,e[4]):SO.hasOwnProperty(n)?DO(SO[n]):n==="transparent"?new Zn(NaN,NaN,NaN,0):null}function DO(n){return new Zn(n>>16&255,n>>8&255,n&255,1)}function Oy(n,e,t,i){return i<=0&&(n=e=t=NaN),new Zn(n,e,t,i)}function jM(n){return n instanceof mu||(n=qd(n)),n?(n=n.rgb(),new Zn(n.r,n.g,n.b,n.opacity)):new Zn}function lS(n,e,t,i){return arguments.length===1?jM(n):new Zn(n,e,t,i??1)}function Zn(n,e,t,i){this.r=+n,this.g=+e,this.b=+t,this.opacity=+i}Km(Zn,lS,v1(mu,{brighter(n){return n=n==null?lm:Math.pow(lm,n),new Zn(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=n==null?hf:Math.pow(hf,n),new Zn(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new Zn($h(this.r),$h(this.g),$h(this.b),cS(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:kO,formatHex:kO,formatHex8:soe,formatRgb:EO,toString:EO}));function kO(){return`#${Sh(this.r)}${Sh(this.g)}${Sh(this.b)}`}function soe(){return`#${Sh(this.r)}${Sh(this.g)}${Sh(this.b)}${Sh((isNaN(this.opacity)?1:this.opacity)*255)}`}function EO(){const n=cS(this.opacity);return`${n===1?"rgb(":"rgba("}${$h(this.r)}, ${$h(this.g)}, ${$h(this.b)}${n===1?")":`, ${n})`}`}function cS(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function $h(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function Sh(n){return n=$h(n),(n<16?"0":"")+n.toString(16)}function AO(n,e,t,i){return i<=0?n=e=t=NaN:t<=0||t>=1?n=e=NaN:e<=0&&(n=NaN),new Xr(n,e,t,i)}function gz(n){if(n instanceof Xr)return new Xr(n.h,n.s,n.l,n.opacity);if(n instanceof mu||(n=qd(n)),!n)return new Xr;if(n instanceof Xr)return n;n=n.rgb();var e=n.r/255,t=n.g/255,i=n.b/255,s=Math.min(e,t,i),o=Math.max(e,t,i),r=NaN,a=o-s,l=(o+s)/2;return a?(e===o?r=(t-i)/a+(t0&&l<1?0:r,new Xr(r,a,l,n.opacity)}function lA(n,e,t,i){return arguments.length===1?gz(n):new Xr(n,e,t,i??1)}function Xr(n,e,t,i){this.h=+n,this.s=+e,this.l=+t,this.opacity=+i}Km(Xr,lA,v1(mu,{brighter(n){return n=n==null?lm:Math.pow(lm,n),new Xr(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=n==null?hf:Math.pow(hf,n),new Xr(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+(this.h<0)*360,e=isNaN(n)||isNaN(this.s)?0:this.s,t=this.l,i=t+(t<.5?t:1-t)*e,s=2*t-i;return new Zn(Mk(n>=240?n-240:n+120,s,i),Mk(n,s,i),Mk(n<120?n+240:n-120,s,i),this.opacity)},clamp(){return new Xr(IO(this.h),Fy(this.s),Fy(this.l),cS(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const n=cS(this.opacity);return`${n===1?"hsl(":"hsla("}${IO(this.h)}, ${Fy(this.s)*100}%, ${Fy(this.l)*100}%${n===1?")":`, ${n})`}`}}));function IO(n){return n=(n||0)%360,n<0?n+360:n}function Fy(n){return Math.max(0,Math.min(1,n||0))}function Mk(n,e,t){return(n<60?e+(t-e)*n/60:n<180?t:n<240?e+(t-e)*(240-n)/60:e)*255}const pz=Math.PI/180,mz=180/Math.PI,dS=18,_z=.96422,bz=1,vz=.82521,yz=4/29,cp=6/29,wz=3*cp*cp,ooe=cp*cp*cp;function Cz(n){if(n instanceof Ya)return new Ya(n.l,n.a,n.b,n.opacity);if(n instanceof Zl)return Sz(n);n instanceof Zn||(n=jM(n));var e=Bk(n.r),t=Bk(n.g),i=Bk(n.b),s=Pk((.2225045*e+.7168786*t+.0606169*i)/bz),o,r;return e===t&&t===i?o=r=s:(o=Pk((.4360747*e+.3850649*t+.1430804*i)/_z),r=Pk((.0139322*e+.0971045*t+.7141733*i)/vz)),new Ya(116*s-16,500*(o-s),200*(s-r),n.opacity)}function cA(n,e,t,i){return arguments.length===1?Cz(n):new Ya(n,e,t,i??1)}function Ya(n,e,t,i){this.l=+n,this.a=+e,this.b=+t,this.opacity=+i}Km(Ya,cA,v1(mu,{brighter(n){return new Ya(this.l+dS*(n??1),this.a,this.b,this.opacity)},darker(n){return new Ya(this.l-dS*(n??1),this.a,this.b,this.opacity)},rgb(){var n=(this.l+16)/116,e=isNaN(this.a)?n:n+this.a/500,t=isNaN(this.b)?n:n-this.b/200;return e=_z*Ok(e),n=bz*Ok(n),t=vz*Ok(t),new Zn(Fk(3.1338561*e-1.6168667*n-.4906146*t),Fk(-.9787684*e+1.9161415*n+.033454*t),Fk(.0719453*e-.2289914*n+1.4052427*t),this.opacity)}}));function Pk(n){return n>ooe?Math.pow(n,1/3):n/wz+yz}function Ok(n){return n>cp?n*n*n:wz*(n-yz)}function Fk(n){return 255*(n<=.0031308?12.92*n:1.055*Math.pow(n,1/2.4)-.055)}function Bk(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function roe(n){if(n instanceof Zl)return new Zl(n.h,n.c,n.l,n.opacity);if(n instanceof Ya||(n=Cz(n)),n.a===0&&n.b===0)return new Zl(NaN,0=1?(t=1,e-1):Math.floor(t*e),s=n[i],o=n[i+1],r=i>0?n[i-1]:2*s-o,a=i()=>n;function Ez(n,e){return function(t){return n+t*e}}function loe(n,e,t){return n=Math.pow(n,t),e=Math.pow(e,t)-n,t=1/t,function(i){return Math.pow(n+i*e,t)}}function LL(n,e){var t=e-n;return t?Ez(n,t>180||t<-180?t-360*Math.round(t/360):t):xL(isNaN(n)?e:n)}function coe(n){return(n=+n)==1?Xn:function(e,t){return t-e?loe(e,t,n):xL(isNaN(e)?t:e)}}function Xn(n,e){var t=e-n;return t?Ez(n,t):xL(isNaN(n)?e:n)}const hA=function n(e){var t=coe(e);function i(s,o){var r=t((s=lS(s)).r,(o=lS(o)).r),a=t(s.g,o.g),l=t(s.b,o.b),c=Xn(s.opacity,o.opacity);return function(d){return s.r=r(d),s.g=a(d),s.b=l(d),s.opacity=c(d),s+""}}return i.gamma=n,i}(1);function Az(n){return function(e){var t=e.length,i=new Array(t),s=new Array(t),o=new Array(t),r,a;for(r=0;rt&&(o=e.slice(t,o),a[r]?a[r]+=o:a[++r]=o),(i=i[0])===(s=s[0])?a[r]?a[r]+=s:a[++r]=s:(a[++r]=null,l.push({i:r,x:Kr(i,s)})),t=Wk.lastIndex;return t180?d+=360:d-c>180&&(c+=360),h.push({i:u.push(s(u)+"rotate(",null,i)-2,x:Kr(c,d)})):d&&u.push(s(u)+"rotate("+d+i)}function a(c,d,u,h){c!==d?h.push({i:u.push(s(u)+"skewX(",null,i)-2,x:Kr(c,d)}):d&&u.push(s(u)+"skewX("+d+i)}function l(c,d,u,h,f,g){if(c!==u||d!==h){var p=f.push(s(f)+"scale(",null,",",null,")");g.push({i:p-4,x:Kr(c,u)},{i:p-2,x:Kr(d,h)})}else(u!==1||h!==1)&&f.push(s(f)+"scale("+u+","+h+")")}return function(c,d){var u=[],h=[];return c=n(c),d=n(d),o(c.translateX,c.translateY,d.translateX,d.translateY,u,h),r(c.rotate,d.rotate,u,h),a(c.skewX,d.skewX,u,h),l(c.scaleX,c.scaleY,d.scaleX,d.scaleY,u,h),c=d=null,function(f){for(var g=-1,p=h.length,_;++ge&&(t=n,n=e,e=t),function(i){return Math.max(n,Math.min(e,i))}}function Ooe(n,e,t){var i=n[0],s=n[1],o=e[0],r=e[1];return s2?Foe:Ooe,l=c=null,u}function u(h){return h==null||isNaN(h=+h)?o:(l||(l=a(n.map(i),e,t)))(i(r(h)))}return u.invert=function(h){return r(s((c||(c=a(e,n.map(i),Kr)))(h)))},u.domain=function(h){return arguments.length?(n=Array.from(h,pA),d()):n.slice()},u.range=function(h){return arguments.length?(e=Array.from(h),d()):e.slice()},u.rangeRound=function(h){return e=Array.from(h),t=y1,d()},u.clamp=function(h){return arguments.length?(r=h?!0:yo,d()):r!==yo},u.interpolate=function(h){return arguments.length?(t=h,d()):t},u.unknown=function(h){return arguments.length?(o=h,u):o},function(h,f){return i=h,s=f,d()}}function Vz(){return DL()(yo,yo)}function zz(n,e,t,i){var s=df(n,e,t),o;switch(i=im(i??",f"),i.type){case"s":{var r=Math.max(Math.abs(n),Math.abs(e));return i.precision==null&&!isNaN(o=_J(s,r))&&(i.precision=o),eV(i,r)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(o=bJ(s,Math.max(Math.abs(n),Math.abs(e))))&&(i.precision=o-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(o=mJ(s))&&(i.precision=o-(i.type==="%")*2);break}}return Ts(i)}function Pf(n){var e=n.domain;return n.ticks=function(t){var i=e();return QC(i[0],i[i.length-1],t??10)},n.tickFormat=function(t,i){var s=e();return zz(s[0],s[s.length-1],t??10,i)},n.nice=function(t){t==null&&(t=10);var i=e(),s=0,o=i.length-1,r=i[s],a=i[o],l,c,d=10;for(a0;){if(c=UE(r,a,t),c===l)return i[s]=r,i[o]=a,e(i);if(c>0)r=Math.floor(r/c)*c,a=Math.ceil(a/c)*c;else if(c<0)r=Math.ceil(r*c)/c,a=Math.floor(a*c)/c;else break;l=c}return n},n}function Hz(){var n=Vz();return n.copy=function(){return w1(n,Hz())},ul.apply(n,arguments),Pf(n)}function $z(n){var e;function t(i){return i==null||isNaN(i=+i)?e:i}return t.invert=t,t.domain=t.range=function(i){return arguments.length?(n=Array.from(i,pA),t):n.slice()},t.unknown=function(i){return arguments.length?(e=i,t):e},t.copy=function(){return $z(n).unknown(e)},n=arguments.length?Array.from(n,pA):[0,1],Pf(t)}function Uz(n,e){n=n.slice();var t=0,i=n.length-1,s=n[t],o=n[i],r;return oMath.pow(n,e)}function Hoe(n){return n===Math.E?Math.log:n===10&&Math.log10||n===2&&Math.log2||(n=Math.log(n),e=>Math.log(e)/n)}function WO(n){return(e,t)=>-n(-e,t)}function ZM(n){const e=n(FO,BO),t=e.domain;let i=10,s,o;function r(){return s=Hoe(i),o=zoe(i),t()[0]<0?(s=WO(s),o=WO(o),n(Boe,Woe)):n(FO,BO),e}return e.base=function(a){return arguments.length?(i=+a,r()):i},e.domain=function(a){return arguments.length?(t(a),r()):t()},e.ticks=a=>{const l=t();let c=l[0],d=l[l.length-1];const u=d0){for(;h<=f;++h)for(g=1;gd)break;v.push(p)}}else for(;h<=f;++h)for(g=i-1;g>=1;--g)if(p=h>0?g/o(-h):g*o(h),!(pd)break;v.push(p)}v.length*2<_&&(v=QC(c,d,_))}else v=QC(h,f,Math.min(f-h,_)).map(o);return u?v.reverse():v},e.tickFormat=(a,l)=>{if(a==null&&(a=10),l==null&&(l=i===10?"s":","),typeof l!="function"&&(!(i%1)&&(l=im(l)).precision==null&&(l.trim=!0),l=Ts(l)),a===1/0)return l;const c=Math.max(1,i*a/e.ticks().length);return d=>{let u=d/o(Math.round(s(d)));return u*it(Uz(t(),{floor:a=>o(Math.floor(s(a))),ceil:a=>o(Math.ceil(s(a)))})),e}function XM(){const n=ZM(DL()).domain([1,10]);return n.copy=()=>w1(n,XM()).base(n.base()),ul.apply(n,arguments),n}function VO(n){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/n))}}function zO(n){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*n}}function QM(n){var e=1,t=n(VO(e),zO(e));return t.constant=function(i){return arguments.length?n(VO(e=+i),zO(e)):e},Pf(t)}function jz(){var n=QM(DL());return n.copy=function(){return w1(n,jz()).constant(n.constant())},ul.apply(n,arguments)}function HO(n){return function(e){return e<0?-Math.pow(-e,n):Math.pow(e,n)}}function $oe(n){return n<0?-Math.sqrt(-n):Math.sqrt(n)}function Uoe(n){return n<0?-n*n:n*n}function JM(n){var e=n(yo,yo),t=1;function i(){return t===1?n(yo,yo):t===.5?n($oe,Uoe):n(HO(t),HO(1/t))}return e.exponent=function(s){return arguments.length?(t=+s,i()):t},Pf(e)}function e4(){var n=JM(DL());return n.copy=function(){return w1(n,e4()).exponent(n.exponent())},ul.apply(n,arguments),n}function joe(){return e4.apply(null,arguments).exponent(.5)}function qz(){var n=[],e=[],t=[],i;function s(){var r=0,a=Math.max(1,e.length);for(t=new Array(a-1);++r0?t[a-1]:n[0],a=t?[i[t-1],e]:[i[c-1],i[c]]},r.unknown=function(l){return arguments.length&&(o=l),r},r.thresholds=function(){return i.slice()},r.copy=function(){return Gz().domain([n,e]).range(s).unknown(o)},ul.apply(Pf(r),arguments)}function Kz(){var n=[.5],e=[0,1],t,i=1;function s(o){return o!=null&&o<=o?e[$d(n,o,0,i)]:t}return s.domain=function(o){return arguments.length?(n=Array.from(o),i=Math.min(n.length,e.length-1),s):n.slice()},s.range=function(o){return arguments.length?(e=Array.from(o),i=Math.min(n.length,e.length-1),s):e.slice()},s.invertExtent=function(o){var r=e.indexOf(o);return[n[r-1],n[r]]},s.unknown=function(o){return arguments.length?(t=o,s):t},s.copy=function(){return Kz().domain(n).range(e).unknown(t)},ul.apply(s,arguments)}function qoe(n){return new Date(n)}function Goe(n){return n instanceof Date?+n:+new Date(+n)}function t4(n,e,t,i,s,o,r,a,l,c){var d=Vz(),u=d.invert,h=d.domain,f=c(".%L"),g=c(":%S"),p=c("%I:%M"),_=c("%I %p"),v=c("%a %d"),b=c("%b %d"),y=c("%B"),w=c("%Y");function C(L){return(l(L)0?i:1:0}const Qoe="identity",cm="linear",Gd="log",C1="pow",S1="sqrt",AL="symlog",eH="time",tH="utc",Za="sequential",Ym="diverging",_A="quantile",iH="quantize",nH="threshold",r4="ordinal",bA="point",sH="band",a4="bin-ordinal",zn="continuous",x1="discrete",L1="discretizing",Ar="interpolating",oH="temporal";function Joe(n){return function(e){let t=e[0],i=e[1],s;return i=i&&t[l]<=s&&(o<0&&(o=l),r=l);if(!(o<0))return i=n.invertExtent(t[o]),s=n.invertExtent(t[r]),[i[0]===void 0?i[1]:i[0],s[1]===void 0?s[0]:s[1]]}}function l4(){const n=UM().unknown(void 0),e=n.domain,t=n.range;let i=[0,1],s,o,r=!1,a=0,l=0,c=.5;delete n.unknown;function d(){const u=e().length,h=i[1]p+s*v);return t(h?_.reverse():_)}return n.domain=function(u){return arguments.length?(e(u),d()):e()},n.range=function(u){return arguments.length?(i=[+u[0],+u[1]],d()):i.slice()},n.rangeRound=function(u){return i=[+u[0],+u[1]],r=!0,d()},n.bandwidth=function(){return o},n.step=function(){return s},n.round=function(u){return arguments.length?(r=!!u,d()):r},n.padding=function(u){return arguments.length?(l=Math.max(0,Math.min(1,u)),a=l,d()):a},n.paddingInner=function(u){return arguments.length?(a=Math.max(0,Math.min(1,u)),d()):a},n.paddingOuter=function(u){return arguments.length?(l=Math.max(0,Math.min(1,u)),d()):l},n.align=function(u){return arguments.length?(c=Math.max(0,Math.min(1,u)),d()):c},n.invertRange=function(u){if(u[0]==null||u[1]==null)return;const h=i[1]i[1-h])))return v=Math.max(0,$d(f,p)-1),b=p===_?v:$d(f,_)-1,p-f[v]>o+1e-10&&++v,h&&(y=v,v=g-b,b=g-y),v>b?void 0:e().slice(v,b+1)},n.invert=function(u){const h=n.invertRange([u,u]);return h&&h[0]},n.copy=function(){return l4().domain(e()).range(i).round(r).paddingInner(a).paddingOuter(l).align(c)},d()}function rH(n){const e=n.copy;return n.padding=n.paddingOuter,delete n.paddingInner,n.copy=function(){return rH(e())},n}function tre(){return rH(l4().paddingInner(1))}var ire=Array.prototype.map;function nre(n){return ire.call(n,cb)}const sre=Array.prototype.slice;function aH(){let n=[],e=[];function t(i){return i==null||i!==i?void 0:e[($d(n,i)-1)%e.length]}return t.domain=function(i){return arguments.length?(n=nre(i),t):n.slice()},t.range=function(i){return arguments.length?(e=sre.call(i),t):e.slice()},t.tickFormat=function(i,s){return zz(n[0],sa(n),i??10,s)},t.copy=function(){return aH().domain(t.domain()).range(t.range())},t}const uS=new Map,ore=Symbol("vega_scale");function rre(n){return n[ore]=!0,n}function are(n,e,t){const i=function(){const o=e();return o.invertRange||(o.invertRange=o.invert?Joe(o):o.invertExtent?ere(o):void 0),o.type=n,rre(o)};return i.metadata=ZC(HE(t)),i}function ii(n,e,t){return arguments.length>1?(uS.set(n,are(n,e,t)),this):lre(n)?uS.get(n):void 0}ii(Qoe,$z);ii(cm,Hz,zn);ii(Gd,XM,[zn,Gd]);ii(C1,e4,zn);ii(S1,joe,zn);ii(AL,jz,zn);ii(eH,Koe,[zn,oH]);ii(tH,Yoe,[zn,oH]);ii(Za,i4,[zn,Ar]);ii(`${Za}-${cm}`,i4,[zn,Ar]);ii(`${Za}-${Gd}`,Yz,[zn,Ar,Gd]);ii(`${Za}-${C1}`,n4,[zn,Ar]);ii(`${Za}-${S1}`,Zoe,[zn,Ar]);ii(`${Za}-${AL}`,Zz,[zn,Ar]);ii(`${Ym}-${cm}`,Xz,[zn,Ar]);ii(`${Ym}-${Gd}`,Qz,[zn,Ar,Gd]);ii(`${Ym}-${C1}`,s4,[zn,Ar]);ii(`${Ym}-${S1}`,Xoe,[zn,Ar]);ii(`${Ym}-${AL}`,Jz,[zn,Ar]);ii(_A,qz,[L1,_A]);ii(iH,Gz,L1);ii(nH,Kz,L1);ii(a4,aH,[x1,L1]);ii(r4,UM,x1);ii(sH,l4,x1);ii(bA,tre,x1);function lre(n){return uS.has(n)}function D1(n,e){const t=uS.get(n);return t&&t.metadata[e]}function as(n){return D1(n,zn)}function Kd(n){return D1(n,x1)}function rh(n){return D1(n,L1)}function lH(n){return D1(n,Gd)}function IL(n){return D1(n,Ar)}function cre(n,e){const t=e[0],i=sa(e)-t;return function(s){return n(t+s*i)}}function TL(n,e,t){return YM(cH(e||"rgb",t),n)}function dre(n,e){const t=new Array(e),i=e+1;for(let s=0;se[0].toUpperCase()+e.slice(1)).join("")}const hre={blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},fre={category10:"1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf",category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5",accent:"7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666",dark2:"1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666",paired:"a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928",pastel1:"fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2",pastel2:"b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc",set1:"e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999",set2:"66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3",set3:"8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f"};function dH(n){const e=n.length/6|0,t=new Array(e);for(let i=0;iTL(dH(n)));function c4(n,e){return n=n&&n.toLowerCase(),arguments.length>1?($O[n]=e,this):$O[n]}function di(n,e=n){if(/^[A-Za-z0-9_]+$/.test(n)){const t=new Function("datum",`return datum[${JSON.stringify(n)}]`);return uu(t,[n],e)}else return tL(n)}const gre="RawCode",pre="Literal",mre="Property",_re="Identifier",bre="ArrayExpression",vre="BinaryExpression",yre="CallExpression",wre="ConditionalExpression",Cre="LogicalExpression",Sre="MemberExpression",xre="ObjectExpression",Lre="UnaryExpression";function ha(n){this.type=n}ha.prototype.visit=function(n){let e,t,i;if(n(this))return 1;for(e=Dre(this),t=0,i=e.length;t";hl[ff]="Identifier";hl[vu]="Keyword";hl[RL]="Null";hl[Of]="Numeric";hl[po]="Punctuator";hl[E1]="String";hl[kre]="RegularExpression";var Ere="ArrayExpression",Are="BinaryExpression",Ire="CallExpression",Tre="ConditionalExpression",hH="Identifier",Nre="Literal",Rre="LogicalExpression",Mre="MemberExpression",Pre="ObjectExpression",Ore="Property",Fre="UnaryExpression",Qn="Unexpected token %0",Bre="Unexpected number",Wre="Unexpected string",Vre="Unexpected identifier",zre="Unexpected reserved word",Hre="Unexpected end of input",vA="Invalid regular expression",Vk="Invalid regular expression: missing /",fH="Octal literals are not allowed in strict mode.",$re="Duplicate data property in object literal not allowed in strict mode",ls="ILLEGAL",kb="Disabled.",Ure=new RegExp("[\\xAA\\xB5\\xBA\\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\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\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\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\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\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\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-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\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-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\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\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),jre=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\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\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\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\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function ML(n,e){if(!n)throw new Error("ASSERT: "+e)}function Tl(n){return n>=48&&n<=57}function d4(n){return"0123456789abcdefABCDEF".indexOf(n)>=0}function k_(n){return"01234567".indexOf(n)>=0}function qre(n){return n===32||n===9||n===11||n===12||n===160||n>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(n)>=0}function Eb(n){return n===10||n===13||n===8232||n===8233}function A1(n){return n===36||n===95||n>=65&&n<=90||n>=97&&n<=122||n===92||n>=128&&Ure.test(String.fromCharCode(n))}function hS(n){return n===36||n===95||n>=65&&n<=90||n>=97&&n<=122||n>=48&&n<=57||n===92||n>=128&&jre.test(String.fromCharCode(n))}const Gre={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function gH(){for(;ne1114111||n!=="}")&&Kt({},Qn,ls),e<=65535?String.fromCharCode(e):(t=(e-65536>>10)+55296,i=(e-65536&1023)+56320,String.fromCharCode(t,i))}function pH(){var n,e;for(n=Be.charCodeAt(ne++),e=String.fromCharCode(n),n===92&&(Be.charCodeAt(ne)!==117&&Kt({},Qn,ls),++ne,n=yA("u"),(!n||n==="\\"||!A1(n.charCodeAt(0)))&&Kt({},Qn,ls),e=n);ne>>=")return ne+=4,{type:po,value:r,start:n,end:ne};if(o=r.substr(0,3),o===">>>"||o==="<<="||o===">>=")return ne+=3,{type:po,value:o,start:n,end:ne};if(s=o.substr(0,2),i===s[1]&&"+-<>&|".indexOf(i)>=0||s==="=>")return ne+=2,{type:po,value:s,start:n,end:ne};if(s==="//"&&Kt({},Qn,ls),"<>=!+-*%&|^/".indexOf(i)>=0)return++ne,{type:po,value:i,start:n,end:ne};Kt({},Qn,ls)}function Xre(n){let e="";for(;ne=0&&ne=0&&(t=t.replace(/\\u\{([0-9a-fA-F]+)\}/g,(i,s)=>{if(parseInt(s,16)<=1114111)return"x";Kt({},vA)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(t)}catch{Kt({},vA)}try{return new RegExp(n,e)}catch{return null}}function tae(){var n,e,t,i,s;for(n=Be[ne],ML(n==="/","Regular expression literal must start with a slash"),e=Be[ne++],t=!1,i=!1;ne=0&&Kt({},vA,t),{value:t,literal:e}}function nae(){var n,e,t,i;return ci=null,gH(),n=ne,e=tae(),t=iae(),i=eae(e.value,t.value),{literal:e.literal+t.literal,value:i,regex:{pattern:e.value,flags:t.value},start:n,end:ne}}function sae(n){return n.type===ff||n.type===vu||n.type===NL||n.type===RL}function mH(){if(gH(),ne>=Ns)return{type:k1,start:ne,end:ne};const n=Be.charCodeAt(ne);return A1(n)?Zre():n===40||n===41||n===59?zk():n===39||n===34?Jre():n===46?Tl(Be.charCodeAt(ne+1))?UO():zk():Tl(n)?UO():zk()}function _o(){const n=ci;return ne=n.end,ci=mH(),ne=n.end,n}function _H(){const n=ne;ci=mH(),ne=n}function oae(n){const e=new ha(Ere);return e.elements=n,e}function jO(n,e,t){const i=new ha(n==="||"||n==="&&"?Rre:Are);return i.operator=n,i.left=e,i.right=t,i}function rae(n,e){const t=new ha(Ire);return t.callee=n,t.arguments=e,t}function aae(n,e,t){const i=new ha(Tre);return i.test=n,i.consequent=e,i.alternate=t,i}function u4(n){const e=new ha(hH);return e.name=n,e}function Q0(n){const e=new ha(Nre);return e.value=n.value,e.raw=Be.slice(n.start,n.end),n.regex&&(e.raw==="//"&&(e.raw="/(?:)/"),e.regex=n.regex),e}function qO(n,e,t){const i=new ha(Mre);return i.computed=n==="[",i.object=e,i.property=t,i.computed||(t.member=!0),i}function lae(n){const e=new ha(Pre);return e.properties=n,e}function GO(n,e,t){const i=new ha(Ore);return i.key=e,i.value=t,i.kind=n,i}function cae(n,e){const t=new ha(Fre);return t.operator=n,t.argument=e,t.prefix=!0,t}function Kt(n,e){var t,i=Array.prototype.slice.call(arguments,2),s=e.replace(/%(\d)/g,(o,r)=>(ML(r":case"<=":case">=":case"instanceof":case"in":e=7;break;case"<<":case">>":case">>>":e=8;break;case"+":case"-":e=9;break;case"*":case"/":case"%":e=11;break}return e}function wae(){var n,e,t,i,s,o,r,a,l,c;if(n=ci,l=tC(),i=ci,s=ZO(i),s===0)return l;for(i.prec=s,_o(),e=[n,ci],r=tC(),o=[l,i,r];(s=ZO(ci))>0;){for(;o.length>2&&s<=o[o.length-2].prec;)r=o.pop(),a=o.pop().value,l=o.pop(),e.pop(),t=jO(a,l,r),o.push(t);i=_o(),i.prec=s,o.push(i),e.push(ci),t=tC(),o.push(t)}for(c=o.length-1,t=o[c],e.pop();c>1;)e.pop(),t=jO(o[c-1].value,o[c-2],t),c-=2;return t}function gf(){var n,e,t;return n=wae(),Oi("?")&&(_o(),e=gf(),Rs(":"),t=gf(),n=aae(n,e,t)),n}function h4(){const n=gf();if(Oi(","))throw new Error(kb);return n}function Cae(n){Be=n,ne=0,Ns=Be.length,ci=null,_H();const e=h4();if(ci.type!==k1)throw new Error("Unexpect token after expression.");return e}var Sae={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function bH(n){function e(r,a,l,c){let d=n(a[0]);return l&&(d=l+"("+d+")",l.lastIndexOf("new ",0)===0&&(d="("+d+")")),d+"."+r+(c<0?"":c===0?"()":"("+a.slice(1).map(n).join(",")+")")}function t(r,a,l){return c=>e(r,c,a,l)}const i="new Date",s="String",o="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",hypot:"Math.hypot",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(r){r.length<3&&Nn("Missing arguments to clamp function."),r.length>3&&Nn("Too many arguments to clamp function.");const a=r.map(n);return"Math.max("+a[1]+", Math.min("+a[2]+","+a[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:i,date:t("getDate",i,0),day:t("getDay",i,0),year:t("getFullYear",i,0),month:t("getMonth",i,0),hours:t("getHours",i,0),minutes:t("getMinutes",i,0),seconds:t("getSeconds",i,0),milliseconds:t("getMilliseconds",i,0),time:t("getTime",i,0),timezoneoffset:t("getTimezoneOffset",i,0),utcdate:t("getUTCDate",i,0),utcday:t("getUTCDay",i,0),utcyear:t("getUTCFullYear",i,0),utcmonth:t("getUTCMonth",i,0),utchours:t("getUTCHours",i,0),utcminutes:t("getUTCMinutes",i,0),utcseconds:t("getUTCSeconds",i,0),utcmilliseconds:t("getUTCMilliseconds",i,0),length:t("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:t("toUpperCase",s,0),lower:t("toLowerCase",s,0),substring:t("substring",s),split:t("split",s),trim:t("trim",s,0),regexp:o,test:t("test",o),if:function(r){r.length<3&&Nn("Missing arguments to if function."),r.length>3&&Nn("Too many arguments to if function.");const a=r.map(n);return"("+a[0]+"?"+a[1]+":"+a[2]+")"}}}function xae(n){const e=n&&n.length-1;return e&&(n[0]==='"'&&n[e]==='"'||n[0]==="'"&&n[e]==="'")?n.slice(1,-1):n}function Lae(n){n=n||{};const e=n.allowed?ZC(n.allowed):{},t=n.forbidden?ZC(n.forbidden):{},i=n.constants||Sae,s=(n.functions||bH)(u),o=n.globalvar,r=n.fieldvar,a=gr(o)?o:g=>`${o}["${g}"]`;let l={},c={},d=0;function u(g){if(Ti(g))return g;const p=h[g.type];return p==null&&Nn("Unsupported type: "+g.type),p(g)}const h={Literal:g=>g.raw,Identifier:g=>{const p=g.name;return d>0?p:Rg(t,p)?Nn("Illegal identifier: "+p):Rg(i,p)?i[p]:Rg(e,p)?p:(l[p]=1,a(p))},MemberExpression:g=>{const p=!g.computed,_=u(g.object);p&&(d+=1);const v=u(g.property);return _===r&&(c[xae(v)]=1),p&&(d-=1),_+(p?"."+v:"["+v+"]")},CallExpression:g=>{g.callee.type!=="Identifier"&&Nn("Illegal callee type: "+g.callee.type);const p=g.callee.name,_=g.arguments,v=Rg(s,p)&&s[p];return v||Nn("Unrecognized function: "+p),gr(v)?v(_):v+"("+_.map(u).join(",")+")"},ArrayExpression:g=>"["+g.elements.map(u).join(",")+"]",BinaryExpression:g=>"("+u(g.left)+" "+g.operator+" "+u(g.right)+")",UnaryExpression:g=>"("+g.operator+u(g.argument)+")",ConditionalExpression:g=>"("+u(g.test)+"?"+u(g.consequent)+":"+u(g.alternate)+")",LogicalExpression:g=>"("+u(g.left)+g.operator+u(g.right)+")",ObjectExpression:g=>"{"+g.properties.map(u).join(",")+"}",Property:g=>{d+=1;const p=u(g.key);return d-=1,p+":"+u(g.value)}};function f(g){const p={code:u(g),globals:Object.keys(l),fields:Object.keys(c)};return l={},c={},p}return f.functions=s,f.constants=i,f}function vH(n,e,t){return t=(t-n)/(e-n),t=Math.max(0,Math.min(1,t)),t*t*(3-2*t)}function dm(n,e=0,t=1){return Math.max(e,Math.min(t,n))}function Dae(n,e,t){return dm((t-n)/(e-n),0,1)}const fl=1,yu=2,f4=4;var Rh,J0;class g4{constructor(e){Oe(this,Rh);zi(this,"stats",{count:0,first:null});zi(this,"paramMediatorProvider",null);this.paramMediatorProvider=e,this.children=[],this.parent=void 0,this.completed=!1}get behavior(){return 0}get label(){return`(${this.constructor.name})`}reset(){this.completed=!1;for(const e of this.children)e.reset();this.stats.count=0,this.stats.first=null}initialize(){}setParent(e){this.parent=e}addChild(e){if(e.parent)throw new Error("Cannot add the child! It already has a parent.");return this.children.push(e),e.setParent(this),Le(this,Rh,J0).call(this),this}adopt(e){e.parent&&e.parent.removeChild(e),this.addChild(e)}adoptChildrenOf(e){for(const t of e.children)this.adopt(t)}insertAsParent(e){var t;if(this.isRoot())throw new Error("Cannot insert a new parent for a root node!");e.parent=this.parent,this.parent.children[this.parent.children.indexOf(this)]=e,Le(t=this.parent,Rh,J0).call(t),this.parent=void 0,e.addChild(this)}removeChild(e){const t=this.children.indexOf(e);if(t>-1)this.children.splice(t,1),e.parent=void 0,Le(this,Rh,J0).call(this);else throw new Error("Trying to remove an unknown child node!")}excise(){var e;if(this.isRoot())throw new Error("Cannot excise root node!");if(this.isTerminal())this.parent.removeChild(this);else if(this.children.length==1){const t=this.children[0];t.setParent(this.parent),this.parent.children[this.parent.children.indexOf(this)]=t,Le(e=this.parent,Rh,J0).call(e),this.setParent(void 0),this.children.length=0}else throw new Error("Cannot excise a node that has multiple children!")}isRoot(){return!this.parent}isBranching(){return this.children.length>1}isTerminal(){return this.children.length==0}visit(e){e(this);for(const t of this.children)t.visit(e);e.afterChildren&&e.afterChildren(this)}subtreeToString(e=0){const t=this.children.map(i=>i.subtreeToString(e+1)).join("");return`${" ".repeat(e*2)}* ${this.label}${("identifier"in this&&this.identifier?": "+this.identifier:"")??""} -${t}`}handle(e){this._propagate(e)}complete(){this.completed=!0;for(const e of this.children)e.complete()}beginBatch(e){for(const t of this.children)t.beginBatch(e)}get paramMediator(){if(this.paramMediatorProvider)return this.paramMediatorProvider.paramMediator;if(!this.parent)throw new Error("Cannot find paramMediator!");return this.parent.paramMediator}repropagate(){if(this.parent)this.parent.repropagate();else throw new Error("Cannot repropagate data, no FlowNode with stored data found!")}_propagate(e){}}Rh=new WeakSet,J0=function(){this._propagate=Function("children","stats",db(this.children.length).map(e=>`const child${e} = children[${e}];`).join(` +`;function ul(n,e){switch(arguments.length){case 0:break;case 1:this.range(n);break;default:this.range(e).domain(n);break}return this}function mu(n,e){switch(arguments.length){case 0:break;case 1:{typeof n=="function"?this.interpolator(n):this.range(n);break}default:{this.domain(n),typeof e=="function"?this.interpolator(e):this.range(e);break}}return this}const oA=Symbol("implicit");function HM(){var n=new gc,e=[],t=[],i=oA;function s(o){let r=n.get(o);if(r===void 0){if(i!==oA)return i;n.set(o,r=e.push(o)-1)}return t[r%t.length]}return s.domain=function(o){if(!arguments.length)return e.slice();e=[],n=new gc;for(const r of o)n.has(r)||n.set(r,e.push(r)-1);return s},s.range=function(o){return arguments.length?(t=Array.from(o),s):t.slice()},s.unknown=function(o){return arguments.length?(i=o,s):i},s.copy=function(){return HM(e,t).unknown(i)},ul.apply(s,arguments),s}function Qm(n,e,t){n.prototype=e.prototype=t,t.constructor=n}function w1(n,e){var t=Object.create(n.prototype);for(var i in e)t[i]=e[i];return t}function _u(){}var pf=.7,um=1/pf,dp="\\s*([+-]?\\d+)\\s*",kb="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ga="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",roe=/^#([0-9a-f]{3,8})$/,aoe=new RegExp(`^rgb\\(${dp},${dp},${dp}\\)$`),loe=new RegExp(`^rgb\\(${Ga},${Ga},${Ga}\\)$`),coe=new RegExp(`^rgba\\(${dp},${dp},${dp},${kb}\\)$`),doe=new RegExp(`^rgba\\(${Ga},${Ga},${Ga},${kb}\\)$`),uoe=new RegExp(`^hsl\\(${kb},${Ga},${Ga}\\)$`),hoe=new RegExp(`^hsla\\(${kb},${Ga},${Ga},${kb}\\)$`),yO={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Qm(_u,Gd,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:wO,formatHex:wO,formatHex8:foe,formatHsl:goe,formatRgb:CO,toString:CO});function wO(){return this.rgb().formatHex()}function foe(){return this.rgb().formatHex8()}function goe(){return fz(this).formatHsl()}function CO(){return this.rgb().formatRgb()}function Gd(n){var e,t;return n=(n+"").trim().toLowerCase(),(e=roe.exec(n))?(t=e[1].length,e=parseInt(e[1],16),t===6?SO(e):t===3?new Gn(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?Iy(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?Iy(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=aoe.exec(n))?new Gn(e[1],e[2],e[3],1):(e=loe.exec(n))?new Gn(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=coe.exec(n))?Iy(e[1],e[2],e[3],e[4]):(e=doe.exec(n))?Iy(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=uoe.exec(n))?DO(e[1],e[2]/100,e[3]/100,1):(e=hoe.exec(n))?DO(e[1],e[2]/100,e[3]/100,e[4]):yO.hasOwnProperty(n)?SO(yO[n]):n==="transparent"?new Gn(NaN,NaN,NaN,0):null}function SO(n){return new Gn(n>>16&255,n>>8&255,n&255,1)}function Iy(n,e,t,i){return i<=0&&(n=e=t=NaN),new Gn(n,e,t,i)}function $M(n){return n instanceof _u||(n=Gd(n)),n?(n=n.rgb(),new Gn(n.r,n.g,n.b,n.opacity)):new Gn}function tS(n,e,t,i){return arguments.length===1?$M(n):new Gn(n,e,t,i??1)}function Gn(n,e,t,i){this.r=+n,this.g=+e,this.b=+t,this.opacity=+i}Qm(Gn,tS,w1(_u,{brighter(n){return n=n==null?um:Math.pow(um,n),new Gn(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=n==null?pf:Math.pow(pf,n),new Gn(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new Gn(qh(this.r),qh(this.g),qh(this.b),iS(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:xO,formatHex:xO,formatHex8:poe,formatRgb:LO,toString:LO}));function xO(){return`#${Sh(this.r)}${Sh(this.g)}${Sh(this.b)}`}function poe(){return`#${Sh(this.r)}${Sh(this.g)}${Sh(this.b)}${Sh((isNaN(this.opacity)?1:this.opacity)*255)}`}function LO(){const n=iS(this.opacity);return`${n===1?"rgb(":"rgba("}${qh(this.r)}, ${qh(this.g)}, ${qh(this.b)}${n===1?")":`, ${n})`}`}function iS(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function qh(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function Sh(n){return n=qh(n),(n<16?"0":"")+n.toString(16)}function DO(n,e,t,i){return i<=0?n=e=t=NaN:t<=0||t>=1?n=e=NaN:e<=0&&(n=NaN),new Zr(n,e,t,i)}function fz(n){if(n instanceof Zr)return new Zr(n.h,n.s,n.l,n.opacity);if(n instanceof _u||(n=Gd(n)),!n)return new Zr;if(n instanceof Zr)return n;n=n.rgb();var e=n.r/255,t=n.g/255,i=n.b/255,s=Math.min(e,t,i),o=Math.max(e,t,i),r=NaN,a=o-s,l=(o+s)/2;return a?(e===o?r=(t-i)/a+(t0&&l<1?0:r,new Zr(r,a,l,n.opacity)}function rA(n,e,t,i){return arguments.length===1?fz(n):new Zr(n,e,t,i??1)}function Zr(n,e,t,i){this.h=+n,this.s=+e,this.l=+t,this.opacity=+i}Qm(Zr,rA,w1(_u,{brighter(n){return n=n==null?um:Math.pow(um,n),new Zr(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=n==null?pf:Math.pow(pf,n),new Zr(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+(this.h<0)*360,e=isNaN(n)||isNaN(this.s)?0:this.s,t=this.l,i=t+(t<.5?t:1-t)*e,s=2*t-i;return new Gn(Ak(n>=240?n-240:n+120,s,i),Ak(n,s,i),Ak(n<120?n+240:n-120,s,i),this.opacity)},clamp(){return new Zr(kO(this.h),Ty(this.s),Ty(this.l),iS(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const n=iS(this.opacity);return`${n===1?"hsl(":"hsla("}${kO(this.h)}, ${Ty(this.s)*100}%, ${Ty(this.l)*100}%${n===1?")":`, ${n})`}`}}));function kO(n){return n=(n||0)%360,n<0?n+360:n}function Ty(n){return Math.max(0,Math.min(1,n||0))}function Ak(n,e,t){return(n<60?e+(t-e)*n/60:n<180?t:n<240?e+(t-e)*(240-n)/60:e)*255}const gz=Math.PI/180,pz=180/Math.PI,nS=18,mz=.96422,_z=1,bz=.82521,vz=4/29,up=6/29,yz=3*up*up,moe=up*up*up;function wz(n){if(n instanceof Ka)return new Ka(n.l,n.a,n.b,n.opacity);if(n instanceof Xl)return Cz(n);n instanceof Gn||(n=$M(n));var e=Rk(n.r),t=Rk(n.g),i=Rk(n.b),s=Ik((.2225045*e+.7168786*t+.0606169*i)/_z),o,r;return e===t&&t===i?o=r=s:(o=Ik((.4360747*e+.3850649*t+.1430804*i)/mz),r=Ik((.0139322*e+.0971045*t+.7141733*i)/bz)),new Ka(116*s-16,500*(o-s),200*(s-r),n.opacity)}function aA(n,e,t,i){return arguments.length===1?wz(n):new Ka(n,e,t,i??1)}function Ka(n,e,t,i){this.l=+n,this.a=+e,this.b=+t,this.opacity=+i}Qm(Ka,aA,w1(_u,{brighter(n){return new Ka(this.l+nS*(n??1),this.a,this.b,this.opacity)},darker(n){return new Ka(this.l-nS*(n??1),this.a,this.b,this.opacity)},rgb(){var n=(this.l+16)/116,e=isNaN(this.a)?n:n+this.a/500,t=isNaN(this.b)?n:n-this.b/200;return e=mz*Tk(e),n=_z*Tk(n),t=bz*Tk(t),new Gn(Nk(3.1338561*e-1.6168667*n-.4906146*t),Nk(-.9787684*e+1.9161415*n+.033454*t),Nk(.0719453*e-.2289914*n+1.4052427*t),this.opacity)}}));function Ik(n){return n>moe?Math.pow(n,1/3):n/yz+vz}function Tk(n){return n>up?n*n*n:yz*(n-vz)}function Nk(n){return 255*(n<=.0031308?12.92*n:1.055*Math.pow(n,1/2.4)-.055)}function Rk(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function _oe(n){if(n instanceof Xl)return new Xl(n.h,n.c,n.l,n.opacity);if(n instanceof Ka||(n=wz(n)),n.a===0&&n.b===0)return new Xl(NaN,0=1?(t=1,e-1):Math.floor(t*e),s=n[i],o=n[i+1],r=i>0?n[i-1]:2*s-o,a=i()=>n;function kz(n,e){return function(t){return n+t*e}}function voe(n,e,t){return n=Math.pow(n,t),e=Math.pow(e,t)-n,t=1/t,function(i){return Math.pow(n+i*e,t)}}function bL(n,e){var t=e-n;return t?kz(n,t>180||t<-180?t-360*Math.round(t/360):t):_L(isNaN(n)?e:n)}function yoe(n){return(n=+n)==1?Kn:function(e,t){return t-e?voe(e,t,n):_L(isNaN(e)?t:e)}}function Kn(n,e){var t=e-n;return t?kz(n,t):_L(isNaN(n)?e:n)}const dA=function n(e){var t=yoe(e);function i(s,o){var r=t((s=tS(s)).r,(o=tS(o)).r),a=t(s.g,o.g),l=t(s.b,o.b),c=Kn(s.opacity,o.opacity);return function(d){return s.r=r(d),s.g=a(d),s.b=l(d),s.opacity=c(d),s+""}}return i.gamma=n,i}(1);function Ez(n){return function(e){var t=e.length,i=new Array(t),s=new Array(t),o=new Array(t),r,a;for(r=0;rt&&(o=e.slice(t,o),a[r]?a[r]+=o:a[++r]=o),(i=i[0])===(s=s[0])?a[r]?a[r]+=s:a[++r]=s:(a[++r]=null,l.push({i:r,x:Gr(i,s)})),t=Mk.lastIndex;return t180?d+=360:d-c>180&&(c+=360),h.push({i:u.push(s(u)+"rotate(",null,i)-2,x:Gr(c,d)})):d&&u.push(s(u)+"rotate("+d+i)}function a(c,d,u,h){c!==d?h.push({i:u.push(s(u)+"skewX(",null,i)-2,x:Gr(c,d)}):d&&u.push(s(u)+"skewX("+d+i)}function l(c,d,u,h,f,g){if(c!==u||d!==h){var p=f.push(s(f)+"scale(",null,",",null,")");g.push({i:p-4,x:Gr(c,u)},{i:p-2,x:Gr(d,h)})}else(u!==1||h!==1)&&f.push(s(f)+"scale("+u+","+h+")")}return function(c,d){var u=[],h=[];return c=n(c),d=n(d),o(c.translateX,c.translateY,d.translateX,d.translateY,u,h),r(c.rotate,d.rotate,u,h),a(c.skewX,d.skewX,u,h),l(c.scaleX,c.scaleY,d.scaleX,d.scaleY,u,h),c=d=null,function(f){for(var g=-1,p=h.length,_;++ge&&(t=n,n=e,e=t),function(i){return Math.max(n,Math.min(e,i))}}function Goe(n,e,t){var i=n[0],s=n[1],o=e[0],r=e[1];return s2?Koe:Goe,l=c=null,u}function u(h){return h==null||isNaN(h=+h)?o:(l||(l=a(n.map(i),e,t)))(i(r(h)))}return u.invert=function(h){return r(s((c||(c=a(e,n.map(i),Gr)))(h)))},u.domain=function(h){return arguments.length?(n=Array.from(h,fA),d()):n.slice()},u.range=function(h){return arguments.length?(e=Array.from(h),d()):e.slice()},u.rangeRound=function(h){return e=Array.from(h),t=C1,d()},u.clamp=function(h){return arguments.length?(r=h?!0:_o,d()):r!==_o},u.interpolate=function(h){return arguments.length?(t=h,d()):t},u.unknown=function(h){return arguments.length?(o=h,u):o},function(h,f){return i=h,s=f,d()}}function Wz(){return vL()(_o,_o)}function Vz(n,e,t,i){var s=ff(n,e,t),o;switch(i=om(i??",f"),i.type){case"s":{var r=Math.max(Math.abs(n),Math.abs(e));return i.precision==null&&!isNaN(o=EJ(s,r))&&(i.precision=o),JW(i,r)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(o=AJ(s,Math.max(Math.abs(n),Math.abs(e))))&&(i.precision=o-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(o=kJ(s))&&(i.precision=o-(i.type==="%")*2);break}}return Is(i)}function Bf(n){var e=n.domain;return n.ticks=function(t){var i=e();return jC(i[0],i[i.length-1],t??10)},n.tickFormat=function(t,i){var s=e();return Vz(s[0],s[s.length-1],t??10,i)},n.nice=function(t){t==null&&(t=10);var i=e(),s=0,o=i.length-1,r=i[s],a=i[o],l,c,d=10;for(a0;){if(c=HE(r,a,t),c===l)return i[s]=r,i[o]=a,e(i);if(c>0)r=Math.floor(r/c)*c,a=Math.ceil(a/c)*c;else if(c<0)r=Math.ceil(r*c)/c,a=Math.floor(a*c)/c;else break;l=c}return n},n}function zz(){var n=Wz();return n.copy=function(){return S1(n,zz())},ul.apply(n,arguments),Bf(n)}function Hz(n){var e;function t(i){return i==null||isNaN(i=+i)?e:i}return t.invert=t,t.domain=t.range=function(i){return arguments.length?(n=Array.from(i,fA),t):n.slice()},t.unknown=function(i){return arguments.length?(e=i,t):e},t.copy=function(){return Hz(n).unknown(e)},n=arguments.length?Array.from(n,fA):[0,1],Bf(t)}function $z(n,e){n=n.slice();var t=0,i=n.length-1,s=n[t],o=n[i],r;return oMath.pow(n,e)}function Joe(n){return n===Math.E?Math.log:n===10&&Math.log10||n===2&&Math.log2||(n=Math.log(n),e=>Math.log(e)/n)}function OO(n){return(e,t)=>-n(-e,t)}function KM(n){const e=n(MO,PO),t=e.domain;let i=10,s,o;function r(){return s=Joe(i),o=Qoe(i),t()[0]<0?(s=OO(s),o=OO(o),n(Yoe,Zoe)):n(MO,PO),e}return e.base=function(a){return arguments.length?(i=+a,r()):i},e.domain=function(a){return arguments.length?(t(a),r()):t()},e.ticks=a=>{const l=t();let c=l[0],d=l[l.length-1];const u=d0){for(;h<=f;++h)for(g=1;gd)break;v.push(p)}}else for(;h<=f;++h)for(g=i-1;g>=1;--g)if(p=h>0?g/o(-h):g*o(h),!(pd)break;v.push(p)}v.length*2<_&&(v=jC(c,d,_))}else v=jC(h,f,Math.min(f-h,_)).map(o);return u?v.reverse():v},e.tickFormat=(a,l)=>{if(a==null&&(a=10),l==null&&(l=i===10?"s":","),typeof l!="function"&&(!(i%1)&&(l=om(l)).precision==null&&(l.trim=!0),l=Is(l)),a===1/0)return l;const c=Math.max(1,i*a/e.ticks().length);return d=>{let u=d/o(Math.round(s(d)));return u*it($z(t(),{floor:a=>o(Math.floor(s(a))),ceil:a=>o(Math.ceil(s(a)))})),e}function YM(){const n=KM(vL()).domain([1,10]);return n.copy=()=>S1(n,YM()).base(n.base()),ul.apply(n,arguments),n}function FO(n){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/n))}}function BO(n){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*n}}function ZM(n){var e=1,t=n(FO(e),BO(e));return t.constant=function(i){return arguments.length?n(FO(e=+i),BO(e)):e},Bf(t)}function Uz(){var n=ZM(vL());return n.copy=function(){return S1(n,Uz()).constant(n.constant())},ul.apply(n,arguments)}function WO(n){return function(e){return e<0?-Math.pow(-e,n):Math.pow(e,n)}}function ere(n){return n<0?-Math.sqrt(-n):Math.sqrt(n)}function tre(n){return n<0?-n*n:n*n}function XM(n){var e=n(_o,_o),t=1;function i(){return t===1?n(_o,_o):t===.5?n(ere,tre):n(WO(t),WO(1/t))}return e.exponent=function(s){return arguments.length?(t=+s,i()):t},Bf(e)}function QM(){var n=XM(vL());return n.copy=function(){return S1(n,QM()).exponent(n.exponent())},ul.apply(n,arguments),n}function ire(){return QM.apply(null,arguments).exponent(.5)}function jz(){var n=[],e=[],t=[],i;function s(){var r=0,a=Math.max(1,e.length);for(t=new Array(a-1);++r0?t[a-1]:n[0],a=t?[i[t-1],e]:[i[c-1],i[c]]},r.unknown=function(l){return arguments.length&&(o=l),r},r.thresholds=function(){return i.slice()},r.copy=function(){return qz().domain([n,e]).range(s).unknown(o)},ul.apply(Bf(r),arguments)}function Gz(){var n=[.5],e=[0,1],t,i=1;function s(o){return o!=null&&o<=o?e[Ud(n,o,0,i)]:t}return s.domain=function(o){return arguments.length?(n=Array.from(o),i=Math.min(n.length,e.length-1),s):n.slice()},s.range=function(o){return arguments.length?(e=Array.from(o),i=Math.min(n.length,e.length-1),s):e.slice()},s.invertExtent=function(o){var r=e.indexOf(o);return[n[r-1],n[r]]},s.unknown=function(o){return arguments.length?(t=o,s):t},s.copy=function(){return Gz().domain(n).range(e).unknown(t)},ul.apply(s,arguments)}function nre(n){return new Date(n)}function sre(n){return n instanceof Date?+n:+new Date(+n)}function JM(n,e,t,i,s,o,r,a,l,c){var d=Wz(),u=d.invert,h=d.domain,f=c(".%L"),g=c(":%S"),p=c("%I:%M"),_=c("%I %p"),v=c("%a %d"),b=c("%b %d"),y=c("%B"),w=c("%Y");function S(L){return(l(L)0?i:1:0}const vre="identity",hm="linear",Kd="log",x1="pow",L1="sqrt",CL="symlog",Jz="time",eH="utc",Ya="sequential",Jm="diverging",pA="quantile",tH="quantize",iH="threshold",s4="ordinal",mA="point",nH="band",o4="bin-ordinal",Bn="continuous",D1="discrete",k1="discretizing",Er="interpolating",sH="temporal";function yre(n){return function(e){let t=e[0],i=e[1],s;return i=i&&t[l]<=s&&(o<0&&(o=l),r=l);if(!(o<0))return i=n.invertExtent(t[o]),s=n.invertExtent(t[r]),[i[0]===void 0?i[1]:i[0],s[1]===void 0?s[0]:s[1]]}}function r4(){const n=HM().unknown(void 0),e=n.domain,t=n.range;let i=[0,1],s,o,r=!1,a=0,l=0,c=.5;delete n.unknown;function d(){const u=e().length,h=i[1]p+s*v);return t(h?_.reverse():_)}return n.domain=function(u){return arguments.length?(e(u),d()):e()},n.range=function(u){return arguments.length?(i=[+u[0],+u[1]],d()):i.slice()},n.rangeRound=function(u){return i=[+u[0],+u[1]],r=!0,d()},n.bandwidth=function(){return o},n.step=function(){return s},n.round=function(u){return arguments.length?(r=!!u,d()):r},n.padding=function(u){return arguments.length?(l=Math.max(0,Math.min(1,u)),a=l,d()):a},n.paddingInner=function(u){return arguments.length?(a=Math.max(0,Math.min(1,u)),d()):a},n.paddingOuter=function(u){return arguments.length?(l=Math.max(0,Math.min(1,u)),d()):l},n.align=function(u){return arguments.length?(c=Math.max(0,Math.min(1,u)),d()):c},n.invertRange=function(u){if(u[0]==null||u[1]==null)return;const h=i[1]i[1-h])))return v=Math.max(0,Ud(f,p)-1),b=p===_?v:Ud(f,_)-1,p-f[v]>o+1e-10&&++v,h&&(y=v,v=g-b,b=g-y),v>b?void 0:e().slice(v,b+1)},n.invert=function(u){const h=n.invertRange([u,u]);return h&&h[0]},n.copy=function(){return r4().domain(e()).range(i).round(r).paddingInner(a).paddingOuter(l).align(c)},d()}function oH(n){const e=n.copy;return n.padding=n.paddingOuter,delete n.paddingInner,n.copy=function(){return oH(e())},n}function Cre(){return oH(r4().paddingInner(1))}var Sre=Array.prototype.map;function xre(n){return Sre.call(n,ub)}const Lre=Array.prototype.slice;function rH(){let n=[],e=[];function t(i){return i==null||i!==i?void 0:e[(Ud(n,i)-1)%e.length]}return t.domain=function(i){return arguments.length?(n=xre(i),t):n.slice()},t.range=function(i){return arguments.length?(e=Lre.call(i),t):e.slice()},t.tickFormat=function(i,s){return Vz(n[0],ia(n),i??10,s)},t.copy=function(){return rH().domain(t.domain()).range(t.range())},t}const sS=new Map,Dre=Symbol("vega_scale");function kre(n){return n[Dre]=!0,n}function Ere(n,e,t){const i=function(){const o=e();return o.invertRange||(o.invertRange=o.invert?yre(o):o.invertExtent?wre(o):void 0),o.type=n,kre(o)};return i.metadata=$C(VE(t)),i}function ti(n,e,t){return arguments.length>1?(sS.set(n,Ere(n,e,t)),this):Are(n)?sS.get(n):void 0}ti(vre,Hz);ti(hm,zz,Bn);ti(Kd,YM,[Bn,Kd]);ti(x1,QM,Bn);ti(L1,ire,Bn);ti(CL,Uz,Bn);ti(Jz,ore,[Bn,sH]);ti(eH,rre,[Bn,sH]);ti(Ya,e4,[Bn,Er]);ti(`${Ya}-${hm}`,e4,[Bn,Er]);ti(`${Ya}-${Kd}`,Kz,[Bn,Er,Kd]);ti(`${Ya}-${x1}`,t4,[Bn,Er]);ti(`${Ya}-${L1}`,are,[Bn,Er]);ti(`${Ya}-${CL}`,Yz,[Bn,Er]);ti(`${Jm}-${hm}`,Zz,[Bn,Er]);ti(`${Jm}-${Kd}`,Xz,[Bn,Er,Kd]);ti(`${Jm}-${x1}`,i4,[Bn,Er]);ti(`${Jm}-${L1}`,lre,[Bn,Er]);ti(`${Jm}-${CL}`,Qz,[Bn,Er]);ti(pA,jz,[k1,pA]);ti(tH,qz,k1);ti(iH,Gz,k1);ti(o4,rH,[D1,k1]);ti(s4,HM,D1);ti(nH,r4,D1);ti(mA,Cre,D1);function Are(n){return sS.has(n)}function E1(n,e){const t=sS.get(n);return t&&t.metadata[e]}function os(n){return E1(n,Bn)}function Yd(n){return E1(n,D1)}function lh(n){return E1(n,k1)}function aH(n){return E1(n,Kd)}function SL(n){return E1(n,Er)}function Ire(n,e){const t=e[0],i=ia(e)-t;return function(s){return n(t+s*i)}}function xL(n,e,t){return GM(lH(e||"rgb",t),n)}function Tre(n,e){const t=new Array(e),i=e+1;for(let s=0;se[0].toUpperCase()+e.slice(1)).join("")}const Rre={blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"},Mre={accent:dre,category10:cre,category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",dark2:ure,observable10:hre,paired:fre,pastel1:gre,pastel2:pre,set1:mre,set2:_re,set3:bre,tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"};function cH(n){if(cs(n))return n;const e=n.length/6|0,t=new Array(e);for(let i=0;ixL(cH(n)));function a4(n,e){return n=n&&n.toLowerCase(),arguments.length>1?(VO[n]=e,this):VO[n]}function ci(n,e=n){if(/^[A-Za-z0-9_]+$/.test(n)){const t=function(s){n in s||Pre(s,n)},i=new Function("validator",` + let validated = !validator; + return function accessField(datum) { + if (!validated) { + validator(datum); + validated = true; + } + return datum[${JSON.stringify(n)}]; + }`)(t);return hu(i,[n],e)}else return Kx(n)}function Pre(n,e){throw new Error(`Invalid field "${e}". Available fields or properties: ${Object.keys(n).join(", ")}`)}const Ore="RawCode",Fre="Literal",Bre="Property",Wre="Identifier",Vre="ArrayExpression",zre="BinaryExpression",Hre="CallExpression",$re="ConditionalExpression",Ure="LogicalExpression",jre="MemberExpression",qre="ObjectExpression",Gre="UnaryExpression";function da(n){this.type=n}da.prototype.visit=function(n){let e,t,i;if(n(this))return 1;for(e=Kre(this),t=0,i=e.length;t";fl[mf]="Identifier";fl[yu]="Keyword";fl[DL]="Null";fl[Wf]="Numeric";fl[ho]="Punctuator";fl[I1]="String";fl[Yre]="RegularExpression";var Zre="ArrayExpression",Xre="BinaryExpression",Qre="CallExpression",Jre="ConditionalExpression",uH="Identifier",eae="Literal",tae="LogicalExpression",iae="MemberExpression",nae="ObjectExpression",sae="Property",oae="UnaryExpression",Yn="Unexpected token %0",rae="Unexpected number",aae="Unexpected string",lae="Unexpected identifier",cae="Unexpected reserved word",dae="Unexpected end of input",_A="Invalid regular expression",Pk="Invalid regular expression: missing /",hH="Octal literals are not allowed in strict mode.",uae="Duplicate data property in object literal not allowed in strict mode",rs="ILLEGAL",Ab="Disabled.",hae=new RegExp("[\\xAA\\xB5\\xBA\\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\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\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\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\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\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\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-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\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-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\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\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),fae=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\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\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\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\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function kL(n,e){if(!n)throw new Error("ASSERT: "+e)}function Nl(n){return n>=48&&n<=57}function l4(n){return"0123456789abcdefABCDEF".includes(n)}function N_(n){return"01234567".includes(n)}function gae(n){return n===32||n===9||n===11||n===12||n===160||n>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(n)}function Ib(n){return n===10||n===13||n===8232||n===8233}function T1(n){return n===36||n===95||n>=65&&n<=90||n>=97&&n<=122||n===92||n>=128&&hae.test(String.fromCharCode(n))}function oS(n){return n===36||n===95||n>=65&&n<=90||n>=97&&n<=122||n>=48&&n<=57||n===92||n>=128&&fae.test(String.fromCharCode(n))}const pae={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function fH(){for(;ne1114111||n!=="}")&&Gt({},Yn,rs),e<=65535?String.fromCharCode(e):(t=(e-65536>>10)+55296,i=(e-65536&1023)+56320,String.fromCharCode(t,i))}function gH(){var n,e;for(n=Fe.charCodeAt(ne++),e=String.fromCharCode(n),n===92&&(Fe.charCodeAt(ne)!==117&&Gt({},Yn,rs),++ne,n=bA("u"),(!n||n==="\\"||!T1(n.charCodeAt(0)))&&Gt({},Yn,rs),e=n);ne>>=")return ne+=4,{type:ho,value:r,start:n,end:ne};if(o=r.substr(0,3),o===">>>"||o==="<<="||o===">>=")return ne+=3,{type:ho,value:o,start:n,end:ne};if(s=o.substr(0,2),i===s[1]&&"+-<>&|".includes(i)||s==="=>")return ne+=2,{type:ho,value:s,start:n,end:ne};if(s==="//"&&Gt({},Yn,rs),"<>=!+-*%&|^/".includes(i))return++ne,{type:ho,value:i,start:n,end:ne};Gt({},Yn,rs)}function vae(n){let e="";for(;ne{if(parseInt(s,16)<=1114111)return"x";Gt({},_A)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(t)}catch{Gt({},_A)}try{return new RegExp(n,e)}catch{return null}}function Sae(){var n,e,t,i,s;for(n=Fe[ne],kL(n==="/","Regular expression literal must start with a slash"),e=Fe[ne++],t=!1,i=!1;ne=0&&Gt({},_A,t),{value:t,literal:e}}function Lae(){var n,e,t,i;return li=null,fH(),n=ne,e=Sae(),t=xae(),i=Cae(e.value,t.value),{literal:e.literal+t.literal,value:i,regex:{pattern:e.value,flags:t.value},start:n,end:ne}}function Dae(n){return n.type===mf||n.type===yu||n.type===LL||n.type===DL}function pH(){if(fH(),ne>=Ts)return{type:A1,start:ne,end:ne};const n=Fe.charCodeAt(ne);return T1(n)?bae():n===40||n===41||n===59?Ok():n===39||n===34?wae():n===46?Nl(Fe.charCodeAt(ne+1))?zO():Ok():Nl(n)?zO():Ok()}function go(){const n=li;return ne=n.end,li=pH(),ne=n.end,n}function mH(){const n=ne;li=pH(),ne=n}function kae(n){const e=new da(Zre);return e.elements=n,e}function HO(n,e,t){const i=new da(n==="||"||n==="&&"?tae:Xre);return i.operator=n,i.left=e,i.right=t,i}function Eae(n,e){const t=new da(Qre);return t.callee=n,t.arguments=e,t}function Aae(n,e,t){const i=new da(Jre);return i.test=n,i.consequent=e,i.alternate=t,i}function c4(n){const e=new da(uH);return e.name=n,e}function n_(n){const e=new da(eae);return e.value=n.value,e.raw=Fe.slice(n.start,n.end),n.regex&&(e.raw==="//"&&(e.raw="/(?:)/"),e.regex=n.regex),e}function $O(n,e,t){const i=new da(iae);return i.computed=n==="[",i.object=e,i.property=t,i.computed||(t.member=!0),i}function Iae(n){const e=new da(nae);return e.properties=n,e}function UO(n,e,t){const i=new da(sae);return i.key=e,i.value=t,i.kind=n,i}function Tae(n,e){const t=new da(oae);return t.operator=n,t.argument=e,t.prefix=!0,t}function Gt(n,e){var t,i=Array.prototype.slice.call(arguments,2),s=e.replace(/%(\d)/g,(o,r)=>(kL(r":case"<=":case">=":case"instanceof":case"in":e=7;break;case"<<":case">>":case">>>":e=8;break;case"+":case"-":e=9;break;case"*":case"/":case"%":e=11;break}return e}function $ae(){var n,e,t,i,s,o,r,a,l,c;if(n=li,l=Yw(),i=li,s=GO(i),s===0)return l;for(i.prec=s,go(),e=[n,li],r=Yw(),o=[l,i,r];(s=GO(li))>0;){for(;o.length>2&&s<=o[o.length-2].prec;)r=o.pop(),a=o.pop().value,l=o.pop(),e.pop(),t=HO(a,l,r),o.push(t);i=go(),i.prec=s,o.push(i),e.push(li),t=Yw(),o.push(t)}for(c=o.length-1,t=o[c],e.pop();c>1;)e.pop(),t=HO(o[c-1].value,o[c-2],t),c-=2;return t}function _f(){var n,e,t;return n=$ae(),Pi("?")&&(go(),e=_f(),Ns(":"),t=_f(),n=Aae(n,e,t)),n}function d4(){const n=_f();if(Pi(","))throw new Error(Ab);return n}function Uae(n){Fe=n,ne=0,Ts=Fe.length,li=null,mH();const e=d4();if(li.type!==A1)throw new Error("Unexpect token after expression.");return e}var jae={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function _H(n){function e(r,a,l,c){let d=n(a[0]);return l&&(d=l+"("+d+")",l.lastIndexOf("new ",0)===0&&(d="("+d+")")),d+"."+r+(c<0?"":c===0?"()":"("+a.slice(1).map(n).join(",")+")")}function t(r,a,l){return c=>e(r,c,a,l)}const i="new Date",s="String",o="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",hypot:"Math.hypot",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(r){r.length<3&&In("Missing arguments to clamp function."),r.length>3&&In("Too many arguments to clamp function.");const a=r.map(n);return"Math.max("+a[1]+", Math.min("+a[2]+","+a[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:i,date:t("getDate",i,0),day:t("getDay",i,0),year:t("getFullYear",i,0),month:t("getMonth",i,0),hours:t("getHours",i,0),minutes:t("getMinutes",i,0),seconds:t("getSeconds",i,0),milliseconds:t("getMilliseconds",i,0),time:t("getTime",i,0),timezoneoffset:t("getTimezoneOffset",i,0),utcdate:t("getUTCDate",i,0),utcday:t("getUTCDay",i,0),utcyear:t("getUTCFullYear",i,0),utcmonth:t("getUTCMonth",i,0),utchours:t("getUTCHours",i,0),utcminutes:t("getUTCMinutes",i,0),utcseconds:t("getUTCSeconds",i,0),utcmilliseconds:t("getUTCMilliseconds",i,0),length:t("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:t("toUpperCase",s,0),lower:t("toLowerCase",s,0),substring:t("substring",s),split:t("split",s),trim:t("trim",s,0),regexp:o,test:t("test",o),if:function(r){r.length<3&&In("Missing arguments to if function."),r.length>3&&In("Too many arguments to if function.");const a=r.map(n);return"("+a[0]+"?"+a[1]+":"+a[2]+")"}}}function qae(n){const e=n&&n.length-1;return e&&(n[0]==='"'&&n[e]==='"'||n[0]==="'"&&n[e]==="'")?n.slice(1,-1):n}function Gae(n){n=n||{};const e=n.allowed?$C(n.allowed):{},t=n.forbidden?$C(n.forbidden):{},i=n.constants||jae,s=(n.functions||_H)(u),o=n.globalvar,r=n.fieldvar,a=fr(o)?o:g=>`${o}["${g}"]`;let l={},c={},d=0;function u(g){if(Ti(g))return g;const p=h[g.type];return p==null&&In("Unsupported type: "+g.type),p(g)}const h={Literal:g=>g.raw,Identifier:g=>{const p=g.name;return d>0?p:Pg(t,p)?In("Illegal identifier: "+p):Pg(i,p)?i[p]:Pg(e,p)?p:(l[p]=1,a(p))},MemberExpression:g=>{const p=!g.computed,_=u(g.object);p&&(d+=1);const v=u(g.property);return _===r&&(c[qae(v)]=1),p&&(d-=1),_+(p?"."+v:"["+v+"]")},CallExpression:g=>{g.callee.type!=="Identifier"&&In("Illegal callee type: "+g.callee.type);const p=g.callee.name,_=g.arguments,v=Pg(s,p)&&s[p];return v||In("Unrecognized function: "+p),fr(v)?v(_):v+"("+_.map(u).join(",")+")"},ArrayExpression:g=>"["+g.elements.map(u).join(",")+"]",BinaryExpression:g=>"("+u(g.left)+" "+g.operator+" "+u(g.right)+")",UnaryExpression:g=>"("+g.operator+u(g.argument)+")",ConditionalExpression:g=>"("+u(g.test)+"?"+u(g.consequent)+":"+u(g.alternate)+")",LogicalExpression:g=>"("+u(g.left)+g.operator+u(g.right)+")",ObjectExpression:g=>"{"+g.properties.map(u).join(",")+"}",Property:g=>{d+=1;const p=u(g.key);return d-=1,p+":"+u(g.value)}};function f(g){const p={code:u(g),globals:Object.keys(l),fields:Object.keys(c)};return l={},c={},p}return f.functions=s,f.constants=i,f}function bH(n,e,t){return t=(t-n)/(e-n),t=Math.max(0,Math.min(1,t)),t*t*(3-2*t)}function fm(n,e=0,t=1){return Math.max(e,Math.min(t,n))}function Kae(n,e,t){return fm((t-n)/(e-n),0,1)}const gl=1,wu=2,u4=4;var Rh,s_;class h4{constructor(e){Pe(this,Rh);Ei(this,"stats",{count:0,first:null});Ei(this,"paramMediatorProvider",null);this.paramMediatorProvider=e,this.children=[],this.parent=void 0,this.completed=!1}get behavior(){return 0}get label(){return`(${this.constructor.name})`}reset(){this.completed=!1;for(const e of this.children)e.reset();this.stats.count=0,this.stats.first=null}initialize(){}setParent(e){this.parent=e}addChild(e){if(e.parent)throw new Error("Cannot add the child! It already has a parent.");return this.children.push(e),e.setParent(this),xe(this,Rh,s_).call(this),this}adopt(e){e.parent&&e.parent.removeChild(e),this.addChild(e)}adoptChildrenOf(e){for(const t of e.children)this.adopt(t)}insertAsParent(e){var t;if(this.isRoot())throw new Error("Cannot insert a new parent for a root node!");e.parent=this.parent,this.parent.children[this.parent.children.indexOf(this)]=e,xe(t=this.parent,Rh,s_).call(t),this.parent=void 0,e.addChild(this)}removeChild(e){const t=this.children.indexOf(e);if(t>-1)this.children.splice(t,1),e.parent=void 0,xe(this,Rh,s_).call(this);else throw new Error("Trying to remove an unknown child node!")}excise(){var e;if(this.isRoot())throw new Error("Cannot excise root node!");if(this.isTerminal())this.parent.removeChild(this);else if(this.children.length==1){const t=this.children[0];t.setParent(this.parent),this.parent.children[this.parent.children.indexOf(this)]=t,xe(e=this.parent,Rh,s_).call(e),this.setParent(void 0),this.children.length=0}else throw new Error("Cannot excise a node that has multiple children!")}isRoot(){return!this.parent}isBranching(){return this.children.length>1}isTerminal(){return this.children.length==0}visit(e){e(this);for(const t of this.children)t.visit(e);e.afterChildren&&e.afterChildren(this)}subtreeToString(e=0){const t=this.children.map(i=>i.subtreeToString(e+1)).join("");return`${" ".repeat(e*2)}* ${this.label}${"identifier"in this&&this.identifier?": "+this.identifier:""} +${t}`}handle(e){this._propagate(e)}complete(){this.completed=!0;for(const e of this.children)e.complete()}beginBatch(e){for(const t of this.children)t.beginBatch(e)}get paramMediator(){if(this.paramMediatorProvider)return this.paramMediatorProvider.paramMediator;if(!this.parent)throw new Error("Cannot find paramMediator!");return this.parent.paramMediator}repropagate(){if(this.parent)this.parent.repropagate();else throw new Error("Cannot repropagate data, no FlowNode with stored data found!")}_propagate(e){}}Rh=new WeakSet,s_=function(){this._propagate=Function("children","stats",hb(this.children.length).map(e=>`const child${e} = children[${e}];`).join(` `)+`return function propagate(datum) { if (stats.count === 0) { stats.first = structuredClone(datum); } stats.count++; - ${db(this.children.length).map(e=>`child${e}.handle(datum);`).join(` + ${hb(this.children.length).map(e=>`child${e}.handle(datum);`).join(` `)} - };`)(this.children,this.stats)};function yH(n){return n.type=="file"}function kae(n){return n.type=="facet"}var jv;class Hn extends g4{constructor(t,i){super(i);Oe(this,jv);ut(this,jv,t.type)}get label(){return X(this,jv)}}jv=new WeakMap;const pr="_uniqueId",XO=1e4,QO=[null];class wA extends Hn{get behavior(){return yu}constructor(e){super(e),this.params=e,this.as=e.as??pr,this._blocks=[],this._usedBlocks=0,this._id=-1}initialize(){}reset(){super.reset(),this._usedBlocks=0,this._id=-1}handle(e){e[this.as]=this._nextId(),this._propagate(e)}_nextId(){return++this._id%XO==0&&(this._id=this._getBlock()*XO),this._id}_getBlock(){return this._usedBlocks[e[pr],e]))}}function Eae(n,{add:e,remove:t,toggle:i}){const s=n.data;for(const o of e??[])s.set(o[pr],o);for(const o of t??[])s.delete(o[pr]);for(const o of i??[]){const r=o[pr];s.has(r)?s.delete(r):s.set(r,o)}return{type:"multi",data:s}}function Aae(n,e,t=!0){if(!n||!e)return!1;if(xH(n))return n.uniqueId==null?t:n.uniqueId===e[pr];if(p4(n))return n.data.size==0?t:n.data.has(e[pr]);throw new Error("Not a selection: "+JSON.stringify(n))}function SH(n){return`selectionTest(${fS(n.param)}, datum, ${!!(n.empty??!0)})`}function xH(n){return n.type==="single"}function p4(n){return n.type==="multi"}function LH(n){const e=typeof n=="string"?{type:n}:n;return m4(e)&&(e.on??(e.on="click"),e.on==="click"&&(e.toggle=!0)),e}function m4(n){return n&&n.type=="point"}const DH={clamp:dm,isArray:Ps,isBoolean:g1,isDefined(n){return n!==void 0},isNumber:to,isObject:Os,isRegExp:kQ,isString:Ti,isValid(n){return n!=null&&n===n},lerp:$W,linearstep:Dae,smoothstep:vH,selectionTest:Aae};function Iae(n){const e=bH(n);for(const t in DH)e[t]=`this.${t}`;return e}const Tae=Lae({forbidden:[],allowed:["datum","undefined"],globalvar:"globalObject",fieldvar:"datum",functions:Iae});function Nae(n,e={}){try{const t=Cae(n),i=Tae(t),s=Function("datum","globalObject",`"use strict"; + };`)(this.children,this.stats)};function vH(n){return n.type=="file"}function Yae(n){return n.type=="facet"}var Kv;class Wn extends h4{constructor(t,i){super(i);Pe(this,Kv);dt(this,Kv,t.type)}get label(){return X(this,Kv)}}Kv=new WeakMap;const gr="_uniqueId",KO=1e4,YO=[null];class vA extends Wn{get behavior(){return wu}constructor(e){super(e),this.params=e,this.as=e.as??gr,this._blocks=[],this._usedBlocks=0,this._id=-1}initialize(){}reset(){super.reset(),this._usedBlocks=0,this._id=-1}handle(e){e[this.as]=this._nextId(),this._propagate(e)}_nextId(){return++this._id%KO==0&&(this._id=this._getBlock()*KO),this._id}_getBlock(){return this._usedBlocks[e[gr],e]))}}function Zae(n,{add:e,remove:t,toggle:i}){const s=n.data;for(const o of e??[])s.set(o[gr],o);for(const o of t??[])s.delete(o[gr]);for(const o of i??[]){const r=o[gr];s.has(r)?s.delete(r):s.set(r,o)}return{type:"multi",data:s}}function Xae(n,e,t=!0){if(!n||!e)return!1;if(SH(n))return n.uniqueId==null?t:n.uniqueId===e[gr];if(f4(n))return n.data.size==0?t:n.data.has(e[gr]);throw new Error("Not a selection: "+JSON.stringify(n))}function CH(n){return`selectionTest(${rS(n.param)}, datum, ${!!(n.empty??!0)})`}function SH(n){return n.type==="single"}function f4(n){return n.type==="multi"}function xH(n){const e=typeof n=="string"?{type:n}:n;return g4(e)&&(e.on??(e.on="click"),e.on==="click"&&(e.toggle=!0)),e}function g4(n){return n&&n.type=="point"}const LH={clamp:fm,isArray:cs,isBoolean:m1,isDefined(n){return n!==void 0},isNumber:Qs,isObject:Ms,isRegExp:BQ,isString:Ti,isValid(n){return n!=null&&n===n},lerp:HW,linearstep:Kae,smoothstep:bH,selectionTest:Xae};function Qae(n){const e=_H(n);for(const t in LH)e[t]=`this.${t}`;return e}const Jae=Gae({forbidden:[],allowed:["datum","undefined"],globalvar:"globalObject",fieldvar:"datum",functions:Qae});function ele(n,e={}){try{const t=Uae(n),i=Jae(t),s=Function("datum","globalObject",`"use strict"; try { return (${i.code}); } catch (e) { throw new Error("Error evaluating expression: " + ${JSON.stringify(n)} + ", " + e.message, e); - }`).bind(DH),o=r=>s(r,e);return o.fields=i.fields,o.globals=i.globals,o.code=i.code,o}catch(t){throw new Error(`Invalid expression: ${n}, ${t.message}`)}}var nd,Mh,Pp,Op,qv;class Rae{constructor(e){Oe(this,nd);zi(this,"paramListeners");Oe(this,Mh,new Map);Oe(this,Pp,new Map);Oe(this,Op,new Map);Oe(this,qv);ut(this,qv,e??(()=>{})),ut(this,nd,new Map),this.paramListeners=new Map}registerParam(e){const t=e.name;if("value"in e&&"expr"in e)throw new Error(`The parameter "${t}" must not have both value and expr properties!`);let i;if(e.push=="outer"){const s=this.findMediatorForParam(t);if(!s)throw new Error(`Parameter "${t}" not found in outer scope!`);const o=s.paramConfigs.get(t);if("expr"in o||"select"in o)throw new Error(`The outer parameter "${t}" must not have expr or select properties!`);i=s.getSetter(t),X(this,Mh).set(t,i)}else if("value"in e)i=this.allocateSetter(t,e.value);else if("expr"in e){const s=this.createExpression(e.expr),o=this.allocateSetter(t,s(null));s.addListener(()=>o(s(null))),i=r=>{}}else i=this.allocateSetter(t,null);if("select"in e){const s=LH(e.select);m4(s)&&i(s.toggle?CH():wH(null))}return X(this,Op).set(t,e),i}allocateSetter(e,t,i=!1){if(fS(e),X(this,Mh).has(e))throw new Error("Setter already allocated for parameter: "+e);const s=o=>{const r=X(this,nd).get(e);if(o!==r){X(this,nd).set(e,o);const a=this.paramListeners.get(e);if(a&&!i)for(const l of a)l()}};return s(t),X(this,Mh).set(e,s),s}getSetter(e){const t=X(this,Mh).get(e);if(!t)throw new Error("Setter not found for parameter: "+e);return t}getValue(e){return X(this,nd).get(e)}findValue(e){const t=this.findMediatorForParam(e);return t==null?void 0:t.getValue(e)}get paramConfigs(){return X(this,Op)}findMediatorForParam(e){var t;return X(this,nd).has(e)?this:(t=X(this,qv).call(this))==null?void 0:t.findMediatorForParam(e)}createExpression(e){if(X(this,Pp).has(e))return X(this,Pp).get(e);const t={},i=Nae(e,t),s=new Map;for(const r of i.globals){const a=this.findMediatorForParam(r);if(!a)throw new Error(`Unknown variable "${r}" in expression: ${e}`);s.set(r,a),Object.defineProperty(t,r,{enumerable:!0,get(){return a.getValue(r)}})}const o=new Set;return i.addListener=r=>{for(const[a,l]of s){const c=l.paramListeners.get(a)??new Set;l.paramListeners.set(a,c),c.add(r),o.add(r)}},i.invalidate=()=>{var r;for(const[a,l]of s)for(const c of o)(r=l.paramListeners.get(a))==null||r.delete(c)},i.identifier=()=>i.code,X(this,Pp).set(e,i),i}evaluateAndGet(e){return this.createExpression(e)()}hasPointSelections(){for(const e of X(this,Op).values())if(Pae(e)){const t=e.select;if(Ti(t)){if(t=="point")return!0}else if(t.type=="point")return!0}return!1}}nd=new WeakMap,Mh=new WeakMap,Pp=new WeakMap,Op=new WeakMap,qv=new WeakMap;function Gs(n){return typeof n=="object"&&n!=null&&"expr"in n&&Ti(n.expr)}function Fo(n){if(Gs(n))throw new Error(`ExprRef ${JSON.stringify(n)} not allowed here. Expected a scalar value.`);return n}function Mae(n){return("expr"in n||"bind"in n)&&!("select"in n)}function Pae(n){return!("expr"in n||"bind"in n)&&"select"in n}function OL(n,e,t){const i={...e},s=[],o=r=>{s.push(r),s.length===1&&queueMicrotask(()=>{t(s.slice()),s.length=0})};for(const[r,a]of Object.entries(e))if(Gs(a)){const l=n.createExpression(a.expr);t&&l.addListener(()=>o(r)),Object.defineProperty(i,r,{enumerable:!0,get(){return l()}})}else i[r]=a;return i}function fS(n){if(!/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(n))throw new Error(`Invalid parameter name: ${n}. Must be a valid JavaScript identifier.`);return n}function Oae(n){return Object.assign(()=>n,{addListener:()=>{},invalidate:()=>{},identifier:()=>"constant",fields:[],globals:[],code:JSON.stringify(n)})}function JO(n,e,t){if(!n)return;function i(o){const r=o;return r.fields??(r.fields=[]),r.constant=r.fields.length===0,r.channelDef=e,r.channel=n,r.scaleChannel=((zo(e)&&e.resolutionChannel)??(Ib(n)&&n))||void 0,"param"in e?(r.predicate=t.createExpression(SH(e)),r.predicate.param=e.param,r.predicate.empty=e.empty??!0):(r.predicate=Oae(!0),r.predicate.empty=!1),r.asNumberAccessor=()=>r,r}function s(o){if(Gs(o)){const r=i(t.createExpression(o.expr));if(r.fields.length>0)throw new Error("Expression in DatumDef/ValueDef cannot access data fields: "+o.expr);return r}else{const r=o;return i(()=>r)}}if(wu(e))try{return i(di(e.field))}catch(o){throw new Error(`Invalid field definition: ${o.message}`)}else{if(T1(e))return i(t.createExpression(e.expr));if(I1(e))return s(e.datum);if(Sr(e))return s(e.value);throw new Error(`Invalid channel definition: ${JSON.stringify(e)}. Cannot create an accessor for channel ${n}!`)}}function Fae(n,e,t){const i=[];if(zae(e)||Hae(e)){const s=Array.isArray(e.condition)?e.condition:[e.condition];for(const o of s)i.push(JO(n,o,t))}if(i.push(JO(n,e,t)),i.filter(s=>!s.constant).length>1)throw new Error("Only one accessor can be non-constant. Channel: "+n);return i}function Bae(n,e){const t={},i=s=>{var o;return(o=n.getScaleResolution(s))==null?void 0:o.scale};for(const[s,o]of Object.entries(e))o&&(t[s]=Wae(Fae(s,o,n.paramMediator),i));return t}function Wae(n,e){if(n.length===1)return eF(n[0],e);const t=n.map(o=>o.predicate),i=n.map(o=>eF(o,e));return Object.assign(o=>{for(let r=0;ro.accessors[0]),dataAccessor:i.map(o=>o.dataAccessor).find(o=>o),scale:i.map(o=>o.scale).find(o=>o),channelDef:n.at(-1).channelDef})}function eF(n,e){const{channel:t,scaleChannel:i,channelDef:s}=n,o=n.scaleChannel?e(i):void 0;if(i&&!o)throw new Error(`Missing scale! "${t}": ${JSON.stringify(s)}`);return Object.assign(o?r=>o(n(r)):r=>n(r),{scale:o,constant:n.constant,accessors:[n],dataAccessor:n.constant?void 0:n,channelDef:s})}function Sr(n){return n&&"value"in n}function wu(n){return n&&"field"in n}function I1(n){return n&&"datum"in n}function zo(n){return wu(n)||I1(n)||T1(n)||kH(n)}function Vae(n,e){const t=n.mark.encoding[e];if(zo(t))return t;throw new Error("Not a channel def with scale!")}function kH(n){return n&&"chrom"in n}function T1(n){return n&&"expr"in n}function zae(n){return(wu(n)||I1(n))&&"condition"in n}function Hae(n){return Sr(n)&&"condition"in n}const Zm=["x","y"],$ae=["x2","y2"],Uae=[...Zm,...$ae];function EH(n){return Zm.includes(n)}function Ab(n){return Uae.includes(n)}const AH={x:"x2",y:"y2"},IH=Object.fromEntries(Object.entries(AH).map(n=>[n[1],n[0]]));function TH(n){return n in IH}function jae(n){const e=AH[n];if(e)return e;throw new Error(`${n} has no secondary channel!`)}function pf(n){return IH[n]??n}function Yd(n){return["color","fill","stroke"].includes(pf(n))}function FL(n){return["shape"].includes(n)}function Ib(n){return["x","y","x2","y2","color","fill","stroke","opacity","fillOpacity","strokeOpacity","strokeWidth","size","shape","angle","dx","dy"].includes(n)}function qae(n){switch(n){case"shape":return["circle","square","cross","diamond","triangle-up","triangle-right","triangle-down","triangle-left","tick-up","tick-right","tick-down","tick-left"]}}function NH(n){if(!FL(n))throw new Error("Not a discrete channel: "+n);const e=new Map(qae(n).map((t,i)=>[t,i]));return t=>{const i=e.get(t);if(i!==void 0)return i;throw new Error(`Invalid value for "${n}" channel: ${t}`)}}function _4(){const n=e=>e;return n.invert=e=>e,n.copy=_4,n.invertRange=()=>{},n.type="null",n}const BL="attr_",Gae="uDomain_",Kae="range_",Yae="accessor_",RH="scale_",Zae="getScaled_",CA="uRangeTexture_",$k="uParam_",iC="checkSelection_",tF=3402823466e29;function Xae(n){const e=n.match(/^(?:(\w+)-)?(\w+)$/);if(!e)throw new Error("Not a scale type: "+n);return{family:e[1]||"continuous",transform:e[2]}}function N1(n,e){return`${Yae}${n}_${e}`}function Qae(n,e,t){let i;if(FL(n))i=xh(NH(n)(t));else if(Ti(t))if(Yd(n))i=nle(t);else throw new Error(`String values are not supported on the "${n}" channel: ${t}`);else if(g1(t))i=xh(t?1:0);else if(t===null)if(Yd(n))i=xh([0,0,0]);else throw new Error(`null value is not supported on the "${n}" chanel.`);else i=xh(t);const s=N1(n,e),o=` + }`).bind(LH),o=r=>s(r,e);return o.fields=i.fields,o.globals=i.globals,o.code=i.code,o}catch(t){throw new Error(`Invalid expression: ${n}, ${t.message}`)}}var nd,Mh,Fp,Bp,Yv;class tle{constructor(e){Pe(this,nd);Ei(this,"paramListeners");Pe(this,Mh,new Map);Pe(this,Fp,new Map);Pe(this,Bp,new Map);Pe(this,Yv);dt(this,Yv,e??(()=>{})),dt(this,nd,new Map),this.paramListeners=new Map}registerParam(e){const t=e.name;if("value"in e&&"expr"in e)throw new Error(`The parameter "${t}" must not have both value and expr properties!`);let i;if(e.push=="outer"){const s=this.findMediatorForParam(t);if(!s)throw new Error(`Parameter "${t}" not found in outer scope!`);const o=s.paramConfigs.get(t);if("expr"in o||"select"in o)throw new Error(`The outer parameter "${t}" must not have expr or select properties!`);i=s.getSetter(t),X(this,Mh).set(t,i)}else if("value"in e)i=this.allocateSetter(t,e.value);else if("expr"in e){const s=this.createExpression(e.expr),o=this.allocateSetter(t,s(null));s.addListener(()=>o(s(null))),i=r=>{}}else i=this.allocateSetter(t,null);if("select"in e){const s=xH(e.select);g4(s)&&i(s.toggle?wH():yH(null))}return X(this,Bp).set(t,e),i}allocateSetter(e,t,i=!1){if(rS(e),X(this,Mh).has(e))throw new Error("Setter already allocated for parameter: "+e);const s=o=>{const r=X(this,nd).get(e);if(o!==r){X(this,nd).set(e,o);const a=this.paramListeners.get(e);if(a&&!i)for(const l of a)l()}};return s(t),X(this,Mh).set(e,s),s}getSetter(e){const t=X(this,Mh).get(e);if(!t)throw new Error("Setter not found for parameter: "+e);return t}getValue(e){return X(this,nd).get(e)}findValue(e){const t=this.findMediatorForParam(e);return t==null?void 0:t.getValue(e)}get paramConfigs(){return X(this,Bp)}findMediatorForParam(e){var t;return X(this,nd).has(e)?this:(t=X(this,Yv).call(this))==null?void 0:t.findMediatorForParam(e)}createExpression(e){if(X(this,Fp).has(e))return X(this,Fp).get(e);const t={},i=ele(e,t),s=new Map;for(const r of i.globals){const a=this.findMediatorForParam(r);if(!a)throw new Error(`Unknown variable "${r}" in expression: ${e}`);s.set(r,a),Object.defineProperty(t,r,{enumerable:!0,get(){return a.getValue(r)}})}const o=new Set;return i.addListener=r=>{for(const[a,l]of s){const c=l.paramListeners.get(a)??new Set;l.paramListeners.set(a,c),c.add(r),o.add(r)}},i.invalidate=()=>{var r;for(const[a,l]of s)for(const c of o)(r=l.paramListeners.get(a))==null||r.delete(c)},i.identifier=()=>i.code,X(this,Fp).set(e,i),i}evaluateAndGet(e){return this.createExpression(e)()}hasPointSelections(){for(const e of X(this,Bp).values())if(nle(e)){const t=e.select;if(Ti(t)){if(t=="point")return!0}else if(t.type=="point")return!0}return!1}}nd=new WeakMap,Mh=new WeakMap,Fp=new WeakMap,Bp=new WeakMap,Yv=new WeakMap;function js(n){return typeof n=="object"&&n!=null&&"expr"in n&&Ti(n.expr)}function Mo(n){if(js(n))throw new Error(`ExprRef ${JSON.stringify(n)} not allowed here. Expected a scalar value.`);return n}function ile(n){return("expr"in n||"bind"in n)&&!("select"in n)}function nle(n){return!("expr"in n||"bind"in n)&&"select"in n}function AL(n,e,t){const i={...e},s=[],o=r=>{s.push(r),s.length===1&&queueMicrotask(()=>{t(s.slice()),s.length=0})};for(const[r,a]of Object.entries(e))if(js(a)){const l=n.createExpression(a.expr);t&&l.addListener(()=>o(r)),Object.defineProperty(i,r,{enumerable:!0,get(){return l()}})}else i[r]=a;return i}function rS(n){if(!/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(n))throw new Error(`Invalid parameter name: ${n}. Must be a valid JavaScript identifier.`);return n}function sle(n){return Object.assign(()=>n,{addListener:()=>{},invalidate:()=>{},identifier:()=>"constant",fields:[],globals:[],code:JSON.stringify(n)})}function ZO(n,e,t){if(!n)return;function i(o){const r=o;return r.fields??(r.fields=[]),r.constant=r.fields.length===0,r.channelDef=e,r.channel=n,r.scaleChannel=((Vo(e)&&e.resolutionChannel)??(Nb(n)&&n))||void 0,"param"in e?(r.predicate=t.createExpression(CH(e)),r.predicate.param=e.param,r.predicate.empty=e.empty??!0):(r.predicate=sle(!0),r.predicate.empty=!1),r.asNumberAccessor=()=>r,r}function s(o){if(js(o)){const r=i(t.createExpression(o.expr));if(r.fields.length>0)throw new Error("Expression in DatumDef/ValueDef cannot access data fields: "+o.expr);return r}else{const r=o;return i(()=>r)}}if(Cu(e))try{return i(ci(e.field))}catch(o){throw new Error(`Invalid field definition: ${o.message}`)}else{if(R1(e))return i(t.createExpression(e.expr));if(N1(e))return s(e.datum);if(Cr(e))return s(e.value);throw new Error(`Invalid channel definition: ${JSON.stringify(e)}. Cannot create an accessor for channel ${n}!`)}}function ole(n,e,t){const i=[];if(cle(e)||dle(e)){const s=Array.isArray(e.condition)?e.condition:[e.condition];for(const o of s)i.push(ZO(n,o,t))}if(i.push(ZO(n,e,t)),i.filter(s=>!s.constant).length>1)throw new Error("Only one accessor can be non-constant. Channel: "+n);return i}function rle(n,e){const t={},i=s=>{var o;return(o=n.getScaleResolution(s))==null?void 0:o.scale};for(const[s,o]of Object.entries(e))o&&(t[s]=ale(ole(s,o,n.paramMediator),i));return t}function ale(n,e){if(n.length===1)return XO(n[0],e);const t=n.map(o=>o.predicate),i=n.map(o=>XO(o,e));return Object.assign(o=>{for(let r=0;ro.accessors[0]),dataAccessor:i.map(o=>o.dataAccessor).find(o=>o),scale:i.map(o=>o.scale).find(o=>o),channelDef:n.at(-1).channelDef})}function XO(n,e){const{channel:t,scaleChannel:i,channelDef:s}=n,o=n.scaleChannel?e(i):void 0;if(i&&!o)throw new Error(`Missing scale! "${t}": ${JSON.stringify(s)}`);return Object.assign(o?r=>o(n(r)):r=>n(r),{scale:o,constant:n.constant,accessors:[n],dataAccessor:n.constant?void 0:n,channelDef:s})}function Cr(n){return n&&"value"in n}function Cu(n){return n&&"field"in n}function N1(n){return n&&"datum"in n}function Vo(n){return Cu(n)||N1(n)||R1(n)||DH(n)}function lle(n,e){const t=n.mark.encoding[e];if(Vo(t))return t;throw new Error("Not a channel def with scale!")}function DH(n){return n&&"chrom"in n}function R1(n){return n&&"expr"in n}function cle(n){return(Cu(n)||N1(n))&&"condition"in n}function dle(n){return Cr(n)&&"condition"in n}const e0=["x","y"],ule=["x2","y2"],hle=[...e0,...ule];function kH(n){return e0.includes(n)}function Tb(n){return hle.includes(n)}const EH={x:"x2",y:"y2"},AH=Object.fromEntries(Object.entries(EH).map(n=>[n[1],n[0]]));function IH(n){return n in AH}function fle(n){const e=EH[n];if(e)return e;throw new Error(`${n} has no secondary channel!`)}function bf(n){return AH[n]??n}function Zd(n){return["color","fill","stroke"].includes(bf(n))}function IL(n){return["shape"].includes(n)}function Nb(n){return["x","y","x2","y2","color","fill","stroke","opacity","fillOpacity","strokeOpacity","strokeWidth","size","shape","angle","dx","dy","sample"].includes(n)}function gle(n){switch(n){case"shape":return["circle","square","cross","diamond","triangle-up","triangle-right","triangle-down","triangle-left","tick-up","tick-right","tick-down","tick-left"]}}function TH(n){if(!IL(n))throw new Error("Not a discrete channel: "+n);const e=new Map(gle(n).map((t,i)=>[t,i]));return t=>{const i=e.get(t);if(i!==void 0)return i;throw new Error(`Invalid value for "${n}" channel: ${t}`)}}function p4(){const n=e=>e;return n.invert=e=>e,n.copy=p4,n.invertRange=()=>{},n.type="null",n}const TL="attr_",ple="uDomain_",mle="range_",_le="accessor_",NH="scale_",ble="getScaled_",yA="uRangeTexture_",Bk="uParam_",Zw="checkSelection_",QO=3402823466e29;function vle(n){const e=n.match(/^(?:(\w+)-)?(\w+)$/);if(!e)throw new Error("Not a scale type: "+n);return{family:e[1]||"continuous",transform:e[2]}}function M1(n,e){return`${_le}${n}_${e}`}function yle(n,e,t){let i;if(IL(n))i=xh(TH(n)(t));else if(Ti(t))if(Zd(n))i=Lle(t);else throw new Error(`String values are not supported on the "${n}" channel: ${t}`);else if(m1(t))i=xh(t?1:0);else if(t===null)if(Zd(n))i=xh([0,0,0]);else throw new Error(`null value is not supported on the "${n}" chanel.`);else i=xh(t);const s=M1(n,e),o=` ${i.type} ${s}() { // Constant value return ${i}; -}`;return{channel:n,accessorGlsl:o,accessorFunctionName:s}}function Jae(n,e){let t="float",i=l=>l;Yd(n)&&(t="vec3",i=l=>FH(l));const s=`u${cle(n)}_${e}`,o=` // Dynamic value - uniform ${t} ${s};`,r=N1(n,e);let a=` +}`;return{channel:n,accessorGlsl:o,accessorFunctionName:s}}function wle(n,e){let t="float",i=l=>l;Zd(n)&&(t="vec3",i=l=>OH(l));const s=`u${Tle(n)}_${e}`,o=` // Dynamic value + uniform ${t} ${s};`,r=M1(n,e);let a=` ${t} ${r}() { // Dynamic value return ${s}; -}`;return{channel:n,uniformName:s,uniformGlsl:o,accessorGlsl:a,accessorFunctionName:r,adjuster:i}}function iF(n,e,t,i=[n]){const{attributeType:s}=R1(e,n),o=BL+b4(i),r=`in highp ${s} ${o};`,a=N1(n,t),l=` +}`;return{channel:n,uniformName:s,uniformGlsl:o,accessorGlsl:a,accessorFunctionName:r,adjuster:i}}function JO(n,e,t,i=[n]){const{attributeType:s}=P1(e,n),o=TL+m4(i),r=`in highp ${s} ${o};`,a=M1(n,t),l=` ${s} ${a}() { return ${o}; -}`;return{channel:n,attributeName:o,attributeGlsl:r,accessorGlsl:l,accessorFunctionName:a}}function ele(n,e,t){const{attributeType:i}=R1(e,n),s=BL+b4(n),o=` uniform highp ${i} ${s};`,r=N1(n,t),a=` +}`;return{channel:n,attributeName:o,attributeGlsl:r,accessorGlsl:l,accessorFunctionName:a}}function Cle(n,e,t){const{attributeType:i}=P1(e,n),s=TL+m4(n),o=` uniform highp ${i} ${s};`,r=M1(n,t),a=` ${i} ${r}() { return ${s}; -}`;return{channel:n,uniformName:s,uniformGlsl:o,accessorGlsl:a,accessorFunctionName:r}}function tle(n,e,t){e??(e=_4());const i=pf(n),s=Gae+i,o=Kae+i,{hp:r,attributeType:a}=R1(e,n),l=e.domain?e.domain().length:void 0;let c;const d=[];d.push(""),d.push("/".repeat(70)),d.push(`// Channel: ${n}`),d.push("");const{transform:u}=Xae(e.type),h=(x,...D)=>sle.apply(null,[x,"value",...D]);let f;switch(u){case"linear":f=h("scaleLinear","domain",o);break;case"log":f=h("scaleLog","domain",o,e.base());break;case"symlog":f=h("scaleSymlog","domain",o,e.constant());break;case"pow":case"sqrt":f=h("scalePow","domain",o,e.exponent());break;case"index":case"locus":f=h("scaleBandHp","domain",o,e.paddingInner(),e.paddingOuter(),e.align(),t.band??.5);break;case"point":case"band":f=h("scaleBand","domain",o,e.paddingInner(),e.paddingOuter(),e.align(),t.band??.5);break;case"ordinal":case"null":case"identity":f=h("scaleIdentity");break;case"threshold":break;default:throw new Error(`Unsupported scale type: ${e.type}! ${n}: ${JSON.stringify(t)}`)}const g=zH(e,n);let p;if(g&&n==i){const x=e.props.range??[];if(Gs(x)||x.some(Gs)){if(g.length<1||g.length>4)throw new Error(`A range with ExprRefs must have 1-4 elements, not ${g.length}! Range: ${JSON.stringify(g)}`);p=` uniform ${PH(g.length)} ${o};`}else if(g.length&&g.every(to)){const D=nF(g);d.push(`const ${D.type} ${o} = ${D};`)}}const _=OH(n);let v;if(Yd(n)){const x=CA+i;if(n==i&&d.push(`uniform sampler2D ${x};`),as(e.type))v=`getInterpolatedColor(${x}, transformed)`;else if(Kd(e.type)||rh(e.type))v=`getDiscreteColor(${x}, int(transformed))`;else throw new Error("Problem with color scale!")}else if(e.type==="ordinal"||rh(e.type)){const x=CA+i;n==i&&d.push(`uniform sampler2D ${x};`),v=`getDiscreteColor(${x}, int(transformed)).r`}const b=[],y=as(e.type)&&l>2,w=rh(e.type)||y;if(b.push("int slot = 0;"),w){const x=s;b.push(y?`while (slot < ${x}.length() - 2 && value >= ${x}[slot + 1]) { slot++; }`:`while (slot < ${x}.length() && value >= ${x}[slot]) { slot++; }`)}const C=as(e.type)||rh(e.type)||["band","point"].includes(e.type);if(f){const x=s;C&&(r?b.push(`vec3 domain = ${x};`):b.push(`vec2 domain = vec2(${x}[slot], ${x}[slot + 1]);`)),b.push(`float transformed = ${f};`),y&&b.push(`transformed = (float(slot) + transformed) / (float(${x}.length() - 1));`)}else b.push("float transformed = float(slot);");"clamp"in e&&e.clamp()&&b.push(`transformed = clampToRange(transformed, ${nF(g)});`),b.push(`return ${v??"transformed"};`),d.push(` -${_} ${RH}${n}(${a} value) { +}`;return{channel:n,uniformName:s,uniformGlsl:o,accessorGlsl:a,accessorFunctionName:r}}function Sle(n,e,t){e??(e=p4());const i=bf(n),s=ple+i,o=mle+i,{hp:r,attributeType:a}=P1(e,n),l=e.domain?e.domain().length:void 0;let c;const d=[];d.push(""),d.push("/".repeat(70)),d.push(`// Channel: ${n}`),d.push("");const{transform:u}=vle(e.type),h=(x,...D)=>Dle.apply(null,[x,"value",...D]);let f;switch(u){case"linear":f=h("scaleLinear","domain",o);break;case"log":f=h("scaleLog","domain",o,e.base());break;case"symlog":f=h("scaleSymlog","domain",o,e.constant());break;case"pow":case"sqrt":f=h("scalePow","domain",o,e.exponent());break;case"index":case"locus":f=h("scaleBandHp","domain",o,e.paddingInner(),e.paddingOuter(),e.align(),t.band??.5);break;case"point":case"band":f=h("scaleBand","domain",o,e.paddingInner(),e.paddingOuter(),e.align(),t.band??.5);break;case"ordinal":case"null":case"identity":f=h("scaleIdentity");break;case"threshold":break;default:throw new Error(`Unsupported scale type: ${e.type}! ${n}: ${JSON.stringify(t)}`)}const g=VH(e,n);let p;if(g&&n==i){const x=e.props.range??[];if(js(x)||x.some(js)){if(g.length<1||g.length>4)throw new Error(`A range with ExprRefs must have 1-4 elements, not ${g.length}! Range: ${JSON.stringify(g)}`);p=` uniform ${MH(g.length)} ${o};`}else if(g.length&&g.every(Qs)){const D=eF(g);d.push(`const ${D.type} ${o} = ${D};`)}}const _=PH(n);let v;if(Zd(n)){const x=yA+i;if(n==i&&d.push(`uniform sampler2D ${x};`),os(e.type))v=`getInterpolatedColor(${x}, transformed)`;else if(Yd(e.type)||lh(e.type))v=`getDiscreteColor(${x}, int(transformed))`;else throw new Error("Problem with color scale!")}else if(e.type==="ordinal"||lh(e.type)){const x=yA+i;n==i&&d.push(`uniform sampler2D ${x};`),v=`getDiscreteColor(${x}, int(transformed)).r`}const b=[],y=os(e.type)&&l>2,w=lh(e.type)||y;if(b.push("int slot = 0;"),w){const x=s;b.push(y?`while (slot < ${x}.length() - 2 && value >= ${x}[slot + 1]) { slot++; }`:`while (slot < ${x}.length() && value >= ${x}[slot]) { slot++; }`)}const S=os(e.type)||lh(e.type)||["band","point"].includes(e.type);if(f){const x=s;S&&(r?b.push(`vec3 domain = ${x};`):b.push(`vec2 domain = vec2(${x}[slot], ${x}[slot + 1]);`)),b.push(`float transformed = ${f};`),y&&b.push(`transformed = (float(slot) + transformed) / (float(${x}.length() - 1));`)}else b.push("float transformed = float(slot);");"clamp"in e&&e.clamp()&&b.push(`transformed = clampToRange(transformed, ${eF(g)});`),b.push(`return ${v??"transformed"};`),d.push(` +${_} ${NH}${n}(${a} value) { ${b.map(x=>` ${x} `).join("")} }`);const L=d.join(` -`);if(C&&n==i){const x=as(e.type)||rh(e.type)?l:2;c=r?` highp vec3 ${s};`:` mediump float ${s}[${x}];`}return{glsl:L,domainUniformName:s,domainUniform:c,rangeUniformName:o,rangeUniform:p}}function ile(n,e){const t=OH(n),i=[],s=[];for(let o=0;o4)throw new Error("Invalid number of components: "+e);const t=PH(e),i=`${t}(${n.map(MH).join(", ")})`;return Object.assign(i,{type:t,numComponents:e})}function PH(n){switch(n){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4";default:throw new Error("Invalid number of components: "+n)}}function OH(n){return Yd(n)?"vec3":n=="uniqueId"?"uint":"float"}function FH(n){const e=qd(n).rgb();return[e.r,e.g,e.b].map(t=>t/255)}function nle(n){return xh(FH(n))}function nF(n){return xh([n[0],_1(n)])}function sle(n,...e){const t=[];for(const i of e)to(i)?t.push(MH(i)):Ps(i)?t.push(xh(i)):t.push(i);return`${n}(${t.join(", ")})`}function R1(n,e){var r;const t=n&&Kd(n.type),i=n&&BH(n.type),s=i&&ole(n.domain()),o=s?{attributeType:"uvec2",arrayConstructor:Uint32Array}:i?{attributeType:"uint",arrayConstructor:Uint32Array}:t?{attributeType:"uint",arrayConstructor:Uint16Array}:e=="uniqueId"?{attributeType:"uint",arrayConstructor:Uint32Array}:{attributeType:"float",arrayConstructor:Float32Array};return Object.assign(o,{numComponents:+(((r=o.attributeType.match(/^vec([234])$/))==null?void 0:r[1])??1),discrete:t,hp:i,largeHp:s})}function BH(n){return n=="index"||n=="locus"}function ole(n){return n[1]>2**32}const rle=12,SA=2**rle;function WH(n,e=[]){const t=n%SA,i=(n-t)/SA;return e[0]=i,e[1]=t,e}function ale(n){const e=n%SA;return[n-e,e]}function lle(n){return[...ale(n[0]),n[1]-n[0]]}function VH(n){const e=new gc([],JSON.stringify);for(const[t,i]of Object.entries(n)){const s=i.channelDef;if(wu(s)){const r=[s.field,i.scale?(as(i.scale.type)||rh(i.scale.type))??!1:!1];e.set(r,[...e.get(r)??[],t])}}return e}function b4(n){return Zs(n).join("_")}function cle(n){return n[0].toUpperCase()+n.slice(1)}const zH=(n,e)=>IL(n.type)||as(n.type)&&Yd(e)?[0,1]:n.range?n.range():void 0;function dle(n,e){if(n.length!=e.length)throw new Error("Unequal array lengths");const t=n.length;if(t==0)return"";if(t==1&&n[0]==null)return e[0];const i=[];for(let s=0;s4)throw new Error("Invalid number of components: "+e);const t=MH(e),i=`${t}(${n.map(RH).join(", ")})`;return Object.assign(i,{type:t,numComponents:e})}function MH(n){switch(n){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4";default:throw new Error("Invalid number of components: "+n)}}function PH(n){return Zd(n)?"vec3":n=="uniqueId"?"uint":"float"}function OH(n){const e=Gd(n).rgb();return[e.r,e.g,e.b].map(t=>t/255)}function Lle(n){return xh(OH(n))}function eF(n){return xh([n[0],v1(n)])}function Dle(n,...e){const t=[];for(const i of e)Qs(i)?t.push(RH(i)):cs(i)?t.push(xh(i)):t.push(i);return`${n}(${t.join(", ")})`}function P1(n,e){var r;const t=n&&Yd(n.type),i=n&&FH(n.type),s=i&&kle(n.domain()),o=s?{attributeType:"uvec2",arrayConstructor:Uint32Array}:i?{attributeType:"uint",arrayConstructor:Uint32Array}:t?{attributeType:"uint",arrayConstructor:Uint16Array}:e=="uniqueId"?{attributeType:"uint",arrayConstructor:Uint32Array}:{attributeType:"float",arrayConstructor:Float32Array};return Object.assign(o,{numComponents:+(((r=o.attributeType.match(/^vec([234])$/))==null?void 0:r[1])??1),discrete:t,hp:i,largeHp:s})}function FH(n){return n=="index"||n=="locus"}function kle(n){return n[1]>2**32}const Ele=12,wA=2**Ele;function BH(n,e=[]){const t=n%wA,i=(n-t)/wA;return e[0]=i,e[1]=t,e}function Ale(n){const e=n%wA;return[n-e,e]}function Ile(n){return[...Ale(n[0]),n[1]-n[0]]}function WH(n){const e=new gc([],JSON.stringify);for(const[t,i]of Object.entries(n)){const s=i.channelDef;if(Cu(s)){const r=[s.field,i.scale?(os(i.scale.type)||lh(i.scale.type))??!1:!1];e.set(r,[...e.get(r)??[],t])}}return e}function m4(n){return Ks(n).join("_")}function Tle(n){return n[0].toUpperCase()+n.slice(1)}const VH=(n,e)=>SL(n.type)||os(n.type)&&Zd(e)?[0,1]:n.range?n.range():void 0;function Nle(n,e){if(n.length!=e.length)throw new Error("Unequal array lengths");const t=n.length;if(t==0)return"";if(t==1&&n[0]==null)return e[0];const i=[];for(let s=0;si(s(o)):o=>i(s(o)))}createUpdater(e,t,i=Float32Array,s=void 0){if(!to(this.size))throw new Error("The number of vertices must be defined!");let o,r,a=0;const l=new i(this.size*t);if(this.arrays[e]={data:l,numComponents:t},t==1){let c=0;const d=u=>{c=+u};o=()=>{l[a++]=c},r=d}else{let c=s??[0];const d=s?u=>{}:u=>{c=u};switch(t){case 1:break;case 2:o=()=>{l[a++]=c[0],l[a++]=c[1]},r=d;break;case 3:o=()=>{l[a++]=c[0],l[a++]=c[1],l[a++]=c[2]},r=d;break;case 4:o=()=>{l[a++]=c[0],l[a++]=c[1],l[a++]=c[2],l[a++]=c[3]},r=d;break;default:throw new Error("Invalid numComponents: "+t)}}return this.pushers.push(o),r}pushAll(){throw new Error("Call configure() first!")}updateFromDatum(e){throw new Error("Call configure() first!")}pushFromDatum(e){this.updateFromDatum(e),this.pushAll()}}Gv=new WeakMap,Um=new WeakSet,HH=function(){if(this.size>sF){const e=this.pushers.map((i,s)=>`const p${s} = that.pushers[${s}];`).join(` +`)}const tF=1e4;var Zv,Gm,zH,HH;class Rle{constructor(e){Pe(this,Gm);Pe(this,Zv,!1);this.size=e,this.arrays={},this.pushers=[],this.dataUpdaters=[],this.vertexCount=0}configure(){if(X(this,Zv))throw new Error("Already configured!");xe(this,Gm,zH).call(this),xe(this,Gm,HH).call(this),dt(this,Zv,!0)}addConverter(e,t){const i=this.createUpdater(TL+e,t.numComponents||1,t.targetArrayType??Float32Array,t.arrayReference),s=t.f;this.dataUpdaters.push(t.arrayReference?o=>i(s(o)):o=>i(s(o)))}createUpdater(e,t,i=Float32Array,s=void 0){if(!Qs(this.size))throw new Error("The number of vertices must be defined!");let o,r,a=0;const l=new i(this.size*t);if(this.arrays[e]={data:l,numComponents:t},t==1){let c=0;const d=u=>{c=+u};o=()=>{l[a++]=c},r=d}else{let c=s??[0];const d=s?u=>{}:u=>{c=u};switch(t){case 1:break;case 2:o=()=>{l[a++]=c[0],l[a++]=c[1]},r=d;break;case 3:o=()=>{l[a++]=c[0],l[a++]=c[1],l[a++]=c[2]},r=d;break;case 4:o=()=>{l[a++]=c[0],l[a++]=c[1],l[a++]=c[2],l[a++]=c[3]},r=d;break;default:throw new Error("Invalid numComponents: "+t)}}return this.pushers.push(o),r}pushAll(){throw new Error("Call configure() first!")}updateFromDatum(e){throw new Error("Call configure() first!")}pushFromDatum(e){this.updateFromDatum(e),this.pushAll()}}Zv=new WeakMap,Gm=new WeakSet,zH=function(){if(this.size>tF){const e=this.pushers.map((i,s)=>`const p${s} = that.pushers[${s}];`).join(` `),t=this.pushers.map((i,s)=>` p${s}();`).join(` `);this.pushAll=new Function("that",`${e} return function unrolledPushAll() { ${t} that.vertexCount++; -};`)(this)}else this.pushAll=()=>{for(let e=0;esF){const e=this.dataUpdaters.map((i,s)=>`const u${s} = that.dataUpdaters[${s}];`).join(` +};`)(this)}else this.pushAll=()=>{for(let e=0;etF){const e=this.dataUpdaters.map((i,s)=>`const u${s} = that.dataUpdaters[${s}];`).join(` `),t=this.dataUpdaters.map((i,s)=>` u${s}(datum);`).join(` `);this.updateFromDatum=new Function("that","datum",`${e} return function unrolledUpdateFromDatum(datum) { ${t} -};`)(this)}else this.updateFromDatum=e=>{for(let t=0;t{const y=(v-c)/u,w=Math.floor(y);return dm(b&&w==y?w-1:w,0,n-1)};function f(v,b,y){if(a)return;if(b>o)o=b;else{a=!0,console.debug("Items are not ordered properly. Disabling binned index.");return}const w=t(v);if(wb&&(s[C]=b),l[C]o)o=b;else{a=!0,console.debug("Items (vertices) are not ordered properly. Disabling binned index.");return}const w=t(v),C=i(v);if(wb&&(s[D]=b),l[D]{const w=h(v,!1),C=h(b,!0),L=s[w],x=Math.max(l[C],L);return y[0]=L,y[1]=x,y},_=()=>{if(a)return;for(let b=1;b0;b--)v&&s[b]==oF?(s[b]=l[b],v=!1):s[b-1]>s[b]&&(s[b-1]=s[b]);return p};return f.getIndex=_,g.getIndex=_,t==i?f:g}function gle(){let n=0,e,t=0;const i=new Map,s=o=>(o===e||(t=i.get(o),t===void 0&&(t=n++,i.set(o,t)),e=o),t);return s.addAll=o=>{for(const r of o)s(r)},s.invert=o=>{for(const r of i.entries())if(r[1]==o)return r[0]},s.domain=()=>[...i.keys()],s}class M1{constructor({encoders:e,numVertices:t=void 0,attributes:i=[]}){this.encoders=e,this.variableEncoders=Object.fromEntries(Object.entries(e).filter(([o,r])=>i.includes(o)&&r&&!r.constant));const s=[...VH(e).entries()].filter(([o,r])=>o[1]&&r.length>1).map(([o,r])=>r);this.allocatedVertices=t,this.variableBuilder=new ule(t);for(const[o,r]of Object.entries(this.variableEncoders)){const a=r.dataAccessor;if(!a)continue;const l=s.find(y=>y.find(w=>w==o));if(l&&o!=l[0])continue;const c=a.asNumberAccessor(),d=r.scale,{largeHp:u,arrayConstructor:h,discrete:f,numComponents:g}=R1(d,o),p=[0,0];let _;d&&f&&"domain"in d&&(_=gle(),_.addAll(d.domain()));const v=_?y=>_(a(y)):u?y=>WH(c(y),p):c,b=l?b4(l):o;this.variableBuilder.addConverter(b,{f:v,numComponents:g,arrayReference:u?p:void 0,targetArrayType:h})}this.lastOffset=0,this.rangeMap=new gc([],JSON.stringify)}registerBatch(e){var o;const t=this.lastOffset,i=this.variableBuilder.vertexCount,s=i-t;s&&this.rangeMap.set(e,{offset:t,count:s,xIndex:(o=this.xIndexer)==null?void 0:o.getIndex()}),this.lastOffset=i}addBatches(e){for(const[t,i]of e)this.addBatch(t,i)}addBatch(e,t,i=0,s=t.length){this.prepareXIndexer(t,i,s);for(let o=i;o{this.addToXIndex=d=>{},this.xIndexer=void 0},o=(c=this.encoders.x)==null?void 0:c.channelDef;if(!("buildIndex"in o)||!o.buildIndex||!e.length||i-t<0){s();return}const r=d=>{var u;return d&&as((u=d.scale)==null?void 0:u.type)&&d},a=r(this.variableEncoders.x),l=r(this.variableEncoders.x2);if(a&&!a.constant&&(!l||!l.constant)){const d=a.dataAccessor.asNumberAccessor(),u=l?l.dataAccessor.asNumberAccessor():d,h=[d(e[t]),u(e[i-1])];if(h[1]>h[0]){this.xIndexer=fle(50,h,d,u);let f=this.variableBuilder.vertexCount;this.addToXIndex=g=>{let p=this.variableBuilder.vertexCount;this.xIndexer(g,f,p),f=p}}else s()}else s()}addToXIndex(e){}toArrays(){return{arrays:this.variableBuilder.arrays,vertexCount:this.variableBuilder.vertexCount,allocatedVertices:this.allocatedVertices,rangeMap:this.rangeMap}}}class ple extends M1{constructor({encoders:e,attributes:t,numItems:i}){super({encoders:e,attributes:t,numVertices:i*6}),this.variableBuilder.configure();const s=this.variableBuilder.pushAll;this.pushAllSixTimes=i>500?new Function("pushAll",`return function unrolledPushAllSixTimes() { +};`)(this)}else this.updateFromDatum=e=>{for(let t=0;t{const y=(v-c)/u,w=Math.floor(y);return fm(b&&w==y?w-1:w,0,n-1)};function f(v,b,y){if(a)return;if(b>o)o=b;else{a=!0,console.debug("Items are not ordered properly. Disabling binned index.");return}const w=t(v);if(wb&&(s[S]=b),l[S]o)o=b;else{a=!0,console.debug("Items (vertices) are not ordered properly. Disabling binned index.");return}const w=t(v),S=i(v);if(wb&&(s[D]=b),l[D]{const w=h(v,!1),S=h(b,!0),L=s[w],x=Math.max(l[S],L);return y[0]=L,y[1]=x,y},_=()=>{if(a)return;for(let b=1;b0;b--)v&&s[b]==iF?(s[b]=l[b],v=!1):s[b-1]>s[b]&&(s[b-1]=s[b]);return p};return f.getIndex=_,g.getIndex=_,t==i?f:g}function Ole(){let n=0,e,t=0;const i=new Map,s=o=>(o===e||(t=i.get(o),t===void 0&&(t=n++,i.set(o,t)),e=o),t);return s.addAll=o=>{for(const r of o)s(r)},s.invert=o=>{for(const r of i.entries())if(r[1]==o)return r[0]},s.domain=()=>[...i.keys()],s}class O1{constructor({encoders:e,numVertices:t=void 0,attributes:i=[]}){this.encoders=e,this.variableEncoders=Object.fromEntries(Object.entries(e).filter(([o,r])=>i.includes(o)&&r&&!r.constant));const s=[...WH(e).entries()].filter(([o,r])=>o[1]&&r.length>1).map(([o,r])=>r);this.allocatedVertices=t,this.variableBuilder=new Rle(t);for(const[o,r]of Object.entries(this.variableEncoders)){const a=r.dataAccessor;if(!a)continue;const l=s.find(y=>y.find(w=>w==o));if(l&&o!=l[0])continue;const c=a.asNumberAccessor(),d=r.scale,{largeHp:u,arrayConstructor:h,discrete:f,numComponents:g}=P1(d,o),p=[0,0];let _;d&&f&&"domain"in d&&(_=Ole(),_.addAll(d.domain()));const v=_?y=>_(a(y)):u?y=>BH(c(y),p):c,b=l?m4(l):o;this.variableBuilder.addConverter(b,{f:v,numComponents:g,arrayReference:u?p:void 0,targetArrayType:h})}this.lastOffset=0,this.rangeMap=new gc([],JSON.stringify)}registerBatch(e){var o;const t=this.lastOffset,i=this.variableBuilder.vertexCount,s=i-t;s&&this.rangeMap.set(e,{offset:t,count:s,xIndex:(o=this.xIndexer)==null?void 0:o.getIndex()}),this.lastOffset=i}addBatches(e){for(const[t,i]of e)this.addBatch(t,i)}addBatch(e,t,i=0,s=t.length){this.prepareXIndexer(t,i,s);for(let o=i;o{this.addToXIndex=d=>{},this.xIndexer=void 0},o=(c=this.encoders.x)==null?void 0:c.channelDef;if(!("buildIndex"in o)||!o.buildIndex||!e.length||i-t<0){s();return}const r=d=>{var u;return d&&os((u=d.scale)==null?void 0:u.type)&&d},a=r(this.variableEncoders.x),l=r(this.variableEncoders.x2);if(a&&!a.constant&&(!l||!l.constant)){const d=a.dataAccessor.asNumberAccessor(),u=l?l.dataAccessor.asNumberAccessor():d,h=[d(e[t]),u(e[i-1])];if(h[1]>h[0]){this.xIndexer=Ple(50,h,d,u);let f=this.variableBuilder.vertexCount;this.addToXIndex=g=>{let p=this.variableBuilder.vertexCount;this.xIndexer(g,f,p),f=p}}else s()}else s()}addToXIndex(e){}toArrays(){return{arrays:this.variableBuilder.arrays,vertexCount:this.variableBuilder.vertexCount,allocatedVertices:this.allocatedVertices,rangeMap:this.rangeMap}}}class Fle extends O1{constructor({encoders:e,attributes:t,numItems:i}){super({encoders:e,attributes:t,numVertices:i*6}),this.variableBuilder.configure();const s=this.variableBuilder.pushAll;this.pushAllSixTimes=i>500?new Function("pushAll",`return function unrolledPushAllSixTimes() { pushAll(); pushAll(); pushAll(); pushAll(); pushAll(); pushAll(); -};`)(s):function(){s(),s(),s(),s(),s(),s()}}addBatch(e,t,i=0,s=t.length){if(!(s<=i)){this.prepareXIndexer(t,i,s);for(let o=i;ol,this.updateVertexCoord=this.variableBuilder.createUpdater("vertexCoord",2),this.updateTextureCoord=this.variableBuilder.createUpdater("textureCoord",2),this.updateWidth=this.variableBuilder.createUpdater("width",1),this.variableBuilder.configure()}addBatch(e,t,i=0,s=t.length){const o=this.properties.align||"left",r=this.properties.logoLetters??!1,a=this.metadata.common.base,l=this.metadata.common.scaleH;let c=-Mg;switch(this.properties.baseline){case"top":c+=this.metrics.capHeight;break;case"middle":c+=this.metrics.capHeight/2;break;case"bottom":c-=this.metrics.descent;break}const d=this.encoders.text,u=[0,0];this.updateVertexCoord(u);const h=[0,0];this.updateTextureCoord(h),this.prepareXIndexer(t,i,s);for(let f=i;fl,this.updateVertexCoord=this.variableBuilder.createUpdater("vertexCoord",2),this.updateTextureCoord=this.variableBuilder.createUpdater("textureCoord",2),this.updateWidth=this.variableBuilder.createUpdater("width",1),this.variableBuilder.configure()}addBatch(e,t,i=0,s=t.length){const o=this.properties.align||"left",r=this.properties.logoLetters??!1,a=this.metadata.common.base,l=this.metadata.common.scaleH;let c=-Og;switch(this.properties.baseline){case"top":c+=this.metrics.capHeight;break;case"middle":c+=this.metrics.capHeight/2;break;case"bottom":c-=this.metrics.descent;break}const d=this.encoders.text,u=[0,0];this.updateVertexCoord(u);const h=[0,0];this.updateTextureCoord(h),this.prepareXIndexer(t,i,s);for(let f=i;fa/(i-1)).map(a=>s+a/o).map(n);return t&&r.reverse(),qH(r)}function qH(n,e){const t=Math.max(n.length,e||0),i=new Uint8Array(t*3);for(let s=0;s({width:void 0,height:void 0})),this._shaderCache=new Map,this.rangeTextures=new WeakMap,this.selectionTextures=new WeakMap;const o=document.createElement("canvas");e.appendChild(o);const r=jse(o,{antialias:!0,depth:!1,premultipliedAlpha:!0,...s});if(!r)throw new Error("Unable to initialize WebGL. Your browser or machine may not support it.");if(!qm(r))throw new Error("Your web browser does not support WebGL 2.0. Chrome, Firefox, and Safari Tech Preview should work.");if(fz(r),r.blendFunc(r.ONE,r.ONE_MINUS_SRC_ALPHA),this.canvas=o,this.gl=r,this._pickingAttachmentOptions=[{format:r.RGBA,type:r.UNSIGNED_BYTE,minMag:r.LINEAR,wrap:r.CLAMP_TO_EDGE}],this._pickingBufferInfo=Wse(r,this._pickingAttachmentOptions),r.bindFramebuffer(r.FRAMEBUFFER,null),this.adjustGl(),this._updateDpr(),this._clearColor=[0,0,0,0],i){const a=qd(i).rgb();this._clearColor=[a.r/255,a.g/255,a.b/255,a.opacity]}}invalidateSize(){this._logicalCanvasSize=void 0,this._updateDpr(),this.adjustGl()}_updateDpr(){this.dpr=window.devicePixelRatio}compileShader(e,t){const i="#version 300 es",s="precision mediump float;";Ps(t)&&(t=t.join(` +`,jle=`in highp vec4 vPickingColor; +`,Xw=Symbol("cacheMap");function NL(n,e,t){let i=Rb(n).get(e);return i===void 0&&(i=t(e),Rb(n).set(e,i)),i}function qle(n,e){Rb(n).delete(e)}function Qw(n,e){const t=Rb(n);for(const i of t.keys())i.startsWith(e)&&t.delete(i);Rb(n).delete(e)}function $H(n){n[Xw]=new Map}function Rb(n){return n[Xw]||$H(n),n[Xw]}function Gle(n,e,t,i){const s=Ti(n)?n:n.name,o=!Ti(n)&&n.extent||[0,1];if(t===void 0&&!Ti(n)&&(t=n.count),s){const r=a4(s);if(fr(r)){const a=UH(r,{extent:o,count:t});return F1(e,{minMag:e.LINEAR,format:e.RGB,height:1,wrap:e.CLAMP_TO_EDGE},a,i)}else{if(cs(r))return SA(r,e);throw new Error("Unknown scheme: "+s)}}}function Kle(n,e="rgb",t,i){const s=xL(n,Ti(e)?e:e.type,Ti(e)?void 0:e.gamma),o=UH(s);return F1(t,{minMag:t.LINEAR,format:t.RGB,height:1,wrap:t.CLAMP_TO_EDGE},o,i)}function Yle(n,e,t,i){const s=Math.max(n.length,t||0),o=new Float32Array(s);for(let r=0;ra/(i-1)).map(a=>s+a/o).map(n);return t&&r.reverse(),jH(r)}function jH(n,e){const t=Math.max(n.length,e||0),i=new Uint8Array(t*3);for(let s=0;s({width:void 0,height:void 0})),this._shaderCache=new Map,this.rangeTextures=new WeakMap,this.selectionTextures=new WeakMap;const o=document.createElement("canvas");e.appendChild(o);const r=ioe(o,{antialias:!0,depth:!1,premultipliedAlpha:!0,...s});if(!r)throw new Error("Unable to initialize WebGL. Your browser or machine may not support it.");if(!Zm(r))throw new Error("Your web browser does not support WebGL 2.0. Chrome, Firefox, and Safari Tech Preview should work.");if(hz(r),r.blendFunc(r.ONE,r.ONE_MINUS_SRC_ALPHA),this.canvas=o,this.gl=r,this._pickingAttachmentOptions=[{format:r.RGBA,type:r.UNSIGNED_BYTE,minMag:r.LINEAR,wrap:r.CLAMP_TO_EDGE}],this._pickingBufferInfo=Zse(r,this._pickingAttachmentOptions),r.bindFramebuffer(r.FRAMEBUFFER,null),this.adjustGl(),this._updateDpr(),this._clearColor=[0,0,0,0],i){const a=Gd(i).rgb();this._clearColor=[a.r/255,a.g/255,a.b/255,a.opacity]}}invalidateSize(){this._logicalCanvasSize=void 0,this._updateDpr(),this.adjustGl()}_updateDpr(){this.dpr=window.devicePixelRatio}compileShader(e,t){const i="#version 300 es",s="precision mediump float;";cs(t)&&(t=t.join(` `));const o=this.gl,r=t.replaceAll(/ {2,}|^\s*\/\/.*$/gm,"");let a=this._shaderCache.get(r);if(!a){const l=[i,s,t].join(` -`);a=o.createShader(e),o.shaderSource(a,l),o.compileShader(a),this._shaderCache.set(r,a)}return a}adjustGl(){const e=this.getLogicalCanvasSize();this.canvas.style.width=`${e.width}px`,this.canvas.style.height=`${e.height}px`;const t=this.getPhysicalCanvasSize(e);this.canvas.width=t.width,this.canvas.height=t.height,Vse(this.gl,this._pickingBufferInfo,this._pickingAttachmentOptions)}finalize(){this.canvas.remove()}getPhysicalCanvasSize(e){return e=e||this.getLogicalCanvasSize(),{width:e.width*this.dpr,height:e.height*this.dpr}}getLogicalCanvasSize(){if(this._logicalCanvasSize)return this._logicalCanvasSize;const e=this._sizeSource(),t=window.getComputedStyle(this._container,null),i=e.width??this._container.clientWidth-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight),s=e.height??this._container.clientHeight-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom);return this._logicalCanvasSize={width:i,height:s},this._logicalCanvasSize}readPickingPixel(e,t){const i=this.gl;e*=this.dpr,t*=this.dpr;const s=this.getPhysicalCanvasSize().height,o=new Uint8Array(4);return i.bindFramebuffer(i.FRAMEBUFFER,this._pickingBufferInfo.framebuffer),i.readPixels(e,s-t-1,1,1,i.RGBA,i.UNSIGNED_BYTE,o),i.bindFramebuffer(i.FRAMEBUFFER,null),o}clearAll(){const e=this.gl,{width:t,height:i}=this.getPhysicalCanvasSize();e.viewport(0,0,t,i),e.disable(e.SCISSOR_TEST),e.clearColor(...this._clearColor),e.clear(e.COLOR_BUFFER_BIT)}createRangeTexture(e,t=!1){const i=this.rangeTextures.get(e);if(!t&&i)return;function s(r,a){return Kd(a.type)?a.domain().length:a.type=="threshold"?a.domain().length+1:a.type=="quantize"||a.type=="quantile"?r??4:r}const o=e.channel;if(Yd(o)){const r=e.scale,a=r.props,l=r.range();let c;if(a.scheme)if(r.type=="threshold"&&l)c=LA(l,this.gl,r.domain().length,i);else{let d=Ti(a.scheme)?void 0:a.scheme.count;d=s(d,r),c=Lle(a.scheme,this.gl,d,i)}else IL(r.type)||as(r.type)&&l.length>1?c=Dle(l,a.interpolate,this.gl,i):c=LA(l,this.gl,r.domain().length,i);this.rangeTextures.set(e,c)}else{const r=e.scale;if(r.type==="ordinal"||rh(r.type)){const a=FL(o)?NH(o):c=>c,l=r.range();this.rangeTextures.set(e,kle(l.map(a),this.gl,r.domain().length,i))}}}createSelectionTexture(e,t=!0){if(!p4(e))throw new Error("Not a multi-point selection, cannot create texture");const i=Array.from(e.data.keys()),s=i.length>0?i.sort((l,c)=>l-c):[0],o=this.selectionTextures.get(e),r=this.gl,a=P1(this.gl,{level:0,minMag:r.NEAREST,format:r.RED_INTEGER,internalFormat:r.R32UI,height:1,width:s.length},new Uint32Array(s),t?o:!1);this.selectionTextures.set(e,a)}}function Ale(n,e="",t=0){const i=/ERROR:\s*\d+:(\d+)/gi,s=[...e.matchAll(i)],o=new Map(s.map((r,a)=>{const l=parseInt(r[1]),c=s[a+1],d=c?c.index:e.length,u=e.substring(r.index,d);return[l-1,u]}));return n.split(` +`);a=o.createShader(e),o.shaderSource(a,l),o.compileShader(a),this._shaderCache.set(r,a)}return a}adjustGl(){const e=this.getLogicalCanvasSize();this.canvas.style.width=`${e.width}px`,this.canvas.style.height=`${e.height}px`;const t=this.getPhysicalCanvasSize(e);this.canvas.width=t.width,this.canvas.height=t.height,Xse(this.gl,this._pickingBufferInfo,this._pickingAttachmentOptions)}finalize(){this.canvas.remove()}getPhysicalCanvasSize(e){return e=e||this.getLogicalCanvasSize(),{width:e.width*this.dpr,height:e.height*this.dpr}}getLogicalCanvasSize(){if(this._logicalCanvasSize)return this._logicalCanvasSize;const e=this._sizeSource(),t=window.getComputedStyle(this._container,null),i=e.width??this._container.clientWidth-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight),s=e.height??this._container.clientHeight-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom);return this._logicalCanvasSize={width:i,height:s},this._logicalCanvasSize}readPickingPixel(e,t){const i=this.gl;e*=this.dpr,t*=this.dpr;const s=this.getPhysicalCanvasSize().height,o=new Uint8Array(4);return i.bindFramebuffer(i.FRAMEBUFFER,this._pickingBufferInfo.framebuffer),i.readPixels(e,s-t-1,1,1,i.RGBA,i.UNSIGNED_BYTE,o),i.bindFramebuffer(i.FRAMEBUFFER,null),o}clearAll(){const e=this.gl,{width:t,height:i}=this.getPhysicalCanvasSize();e.viewport(0,0,t,i),e.disable(e.SCISSOR_TEST),e.clearColor(...this._clearColor),e.clear(e.COLOR_BUFFER_BIT)}createRangeTexture(e,t=!1){const i=this.rangeTextures.get(e);if(!t&&i)return;function s(r,a){return Yd(a.type)?a.domain().length:a.type=="threshold"?a.domain().length+1:a.type=="quantize"||a.type=="quantile"?r??4:r}const o=e.channel;if(Zd(o)){const r=e.scale,a=r.props,l=r.range();let c;if(a.scheme)if(r.type=="threshold"&&l)c=SA(l,this.gl,r.domain().length,i);else{let d=Ti(a.scheme)?void 0:a.scheme.count;d=s(d,r),c=Gle(a.scheme,this.gl,d,i)}else SL(r.type)||os(r.type)&&l.length>1?c=Kle(l,a.interpolate,this.gl,i):c=SA(l,this.gl,r.domain().length,i);this.rangeTextures.set(e,c)}else{const r=e.scale;if(r.type==="ordinal"||lh(r.type)){const a=IL(o)?TH(o):c=>c,l=r.range();this.rangeTextures.set(e,Yle(l.map(a),this.gl,r.domain().length,i))}}}createSelectionTexture(e,t=!0){if(!f4(e))throw new Error("Not a multi-point selection, cannot create texture");const i=Array.from(e.data.keys()),s=i.length>0?i.sort((l,c)=>l-c):[0],o=this.selectionTextures.get(e),r=this.gl,a=F1(this.gl,{level:0,minMag:r.NEAREST,format:r.RED_INTEGER,internalFormat:r.R32UI,height:1,width:s.length},new Uint32Array(s),t?o:!1);this.selectionTextures.set(e,a)}}function Xle(n,e="",t=0){const i=/ERROR:\s*\d+:(\d+)/gi,s=[...e.matchAll(i)],o=new Map(s.map((r,a)=>{const l=parseInt(r[1]),c=s[a+1],d=c?c.index:e.length,u=e.substring(r.index,d);return[l-1,u]}));return n.split(` `).map((r,a)=>{const l=o.get(a);return`${a+1+t}: ${r}${l?` ^^^ ${l}`:""}`}).join(` -`)}function Ile(n,e,t){const i=n.createProgram();n.attachShader(i,e),n.attachShader(i,t),n.linkProgram(i);function s(){let o,r;if(!n.getProgramParameter(i,n.LINK_STATUS)){o=n.getProgramInfoLog(i);for(const l of[e,t])n.getShaderParameter(l,n.COMPILE_STATUS)||(o=n.getShaderInfoLog(l),r=Ale(n.getShaderSource(l),o,0)+` -Error compiling: ${o}`,n.deleteShader(l));n.deleteProgram(i)}if(o)return{message:o,detail:r}}return{program:i,getProgramErrors:s}}function P1(n,e,t,i){return i?MV(n,i,t,e):i=Sb(n,{...e,src:t}),i}function aF(...n){const e={get(t,i,s){for(const o of n){const a=o()[i];if(a!==void 0)return a}},has(t,i,s){for(const o of n){const r=o();if(i in r)return!0}return!1}};return new Proxy({},e)}function Tle(n){return Ti(n)||to(n)||g1(n)}class jh extends Error{constructor(e,t){super(e),this.name="ViewError",this.view=t}}const Nle="SAMPLE_FACET_UNIFORM",lF="SAMPLE_FACET_TEXTURE",cF="uSelectionTexture_";var Da;class O1{constructor(e){Oe(this,Da,[]);this.unitView=e,this.encoders=void 0,this.bufferInfo=void 0,this.bytesPerElement=new Map,this.programInfo=void 0,this.vertexArrayInfo=void 0,this.viewUniformInfo=void 0,this.markUniformInfo=void 0,this.markUniformsAltered=!0,this.selectionTextureOps=[],this.rangeMap=new Rle,this.defaultProperties={get clip(){return["x","y"].map(t=>e.getScaleResolution(t)).some(t=>(t==null?void 0:t.isZoomable())??!1)},xOffset:0,yOffset:0,minBufferSize:0},this.properties=aF(typeof this.unitView.spec.mark=="object"?()=>this.unitView.spec.mark:()=>({}),()=>this.defaultProperties)}augmentDefaultProperties(e){Object.defineProperties(this.defaultProperties,Object.getOwnPropertyDescriptors(e))}get opaque(){return!1}getAttributes(){throw new Error("Not implemented!")}getSupportedChannels(){return["sample","facetIndex","x","y","color","opacity","search","uniqueId"]}getDefaultEncoding(){const e={sample:void 0,uniqueId:void 0};return this.isPickingParticipant()&&(e.uniqueId={field:pr}),e}fixEncoding(e){return e}setupExprRefsNeedingGraphicsUpdate(e){const t=this.getSupportedChannels(),i={};for(const o of e){const r=this.properties[o];if(r&&Gs(r)){const a=this.unitView.paramMediator.createExpression(r.expr);a.addListener(()=>{this.updateGraphicsData(),this.unitView.context.animator.requestRender()}),t.includes(o)||Object.defineProperty(i,o,{get(){return a()}})}}const s=this.properties;this.properties=aF(()=>i,()=>s)}get encoding(){return WL(this,"encoding",()=>{var r;const e=this.getDefaultEncoding(),t=this.unitView.getEncoding(),i=a=>{const l=this.properties[a];return Tle(l)||Gs(l)?{value:l}:void 0},s=Object.fromEntries(this.getSupportedChannels().map(a=>[a,i(a)]).filter(a=>Sr(a[1]))),o=this.fixEncoding({...e,...s,...t});for(const a of Object.keys(o))this.getSupportedChannels().includes(a)||delete o[a];return o.x&&((r=o.x).buildIndex??(r.buildIndex=!0)),o})}getContext(){return this.unitView.context}getType(){return this.unitView.getMarkType()}initializeData(){}initializeEncoders(){this.encoders=Bae(this.unitView,this.encoding)}async initializeGraphics(){}updateGraphicsData(){}getSampleFacetMode(){if(this.encoders.facetIndex)return lF;if(this.unitView.getLayoutAncestors().find(e=>"samples"in e.spec))return Nle}createAndLinkShaders(e,t,i=[]){const s=this.getAttributes(),o=this.encoders,r=this.getSampleFacetMode();r&&i.push(`#define ${r}`);const a="// view: "+this.unitView.getPathString();let l=[];const c=new Set,d=VH(o),u=[],h=Object.values(o).flatMap(C=>C.accessors).map(C=>C.predicate).filter(C=>C.param),f=new Map;for(const C of h){const L=C.param,x=this.unitView.paramMediator,D=x.getValue(L);if(!D)throw new Error(`Cannot infer selection type as the parameter "${L}" has no value. Please ensure that the parameter is properly defined!`);const k=BL+"uniqueId";if(xH(D)){if(!f.has(L)){const P=$k+fS(L);f.set(L,"single"),u.push(" // Selection parameter"),u.push(` uniform highp uint ${P};`),X(this,Da).push(()=>{this.registerMarkUniformValue(P,{expr:L},O=>O.uniqueId??0)}),l.push(`bool ${iC}${L}(bool empty) { - return ${$k}${L} == ${k} || (empty && ${$k}${L} == 0u); -}`)}}else if(p4(D)&&!f.has(L)){f.set(L,"multi");const P=cF+fS(L);l.push(`// Selection texture -uniform highp usampler2D ${P};`);const O=this.getContext().glHelper,M=O.selectionTextures;this.selectionTextureOps.push(()=>{const G=x.getValue(L),te=M.get(G);if(!te)throw new Error(`Bug: no selection texture found for "${L}"!`);wh(this.programInfo,{[P]:te})});const R=cF+L;l.push(`bool ${iC}${L}(bool empty) { +`)}function Qle(n,e,t){const i=n.createProgram();n.attachShader(i,e),n.attachShader(i,t),n.linkProgram(i);function s(){let o,r;if(!n.getProgramParameter(i,n.LINK_STATUS)){o=n.getProgramInfoLog(i);for(const l of[e,t])n.getShaderParameter(l,n.COMPILE_STATUS)||(o=n.getShaderInfoLog(l),r=Xle(n.getShaderSource(l),o,0)+` +Error compiling: ${o}`,n.deleteShader(l));n.deleteProgram(i)}if(o)return{message:o,detail:r}}return{program:i,getProgramErrors:s}}function F1(n,e,t,i){return i?RV(n,i,t,e):i=Lb(n,{...e,src:t}),i}function sF(...n){const e={get(t,i,s){for(const o of n){const a=o()[i];if(a!==void 0)return a}},has(t,i,s){for(const o of n){const r=o();if(i in r)return!0}return!1}};return new Proxy({},e)}function Jle(n){return Ti(n)||Qs(n)||m1(n)}class Kh extends Error{constructor(e,t){super(e),this.name="ViewError",this.view=t}}const ece="SAMPLE_FACET_UNIFORM",oF="SAMPLE_FACET_TEXTURE",rF="uSelectionTexture_";var xa;class B1{constructor(e){Pe(this,xa,[]);this.unitView=e,this.encoders=void 0,this.bufferInfo=void 0,this.bytesPerElement=new Map,this.programInfo=void 0,this.vertexArrayInfo=void 0,this.viewUniformInfo=void 0,this.markUniformInfo=void 0,this.markUniformsAltered=!0,this.selectionTextureOps=[],this.rangeMap=new tce,this.defaultProperties={get clip(){return["x","y"].map(t=>e.getScaleResolution(t)).some(t=>(t==null?void 0:t.isZoomable())??!1)},xOffset:0,yOffset:0,minBufferSize:0},this.properties=sF(typeof this.unitView.spec.mark=="object"?()=>this.unitView.spec.mark:()=>({}),()=>this.defaultProperties)}augmentDefaultProperties(e){Object.defineProperties(this.defaultProperties,Object.getOwnPropertyDescriptors(e))}get opaque(){return!1}getAttributes(){throw new Error("Not implemented!")}getSupportedChannels(){return["sample","facetIndex","x","y","color","opacity","search","uniqueId"]}getDefaultEncoding(){const e={sample:void 0,uniqueId:void 0};return this.isPickingParticipant()&&(e.uniqueId={field:gr}),e}fixEncoding(e){return e}setupExprRefsNeedingGraphicsUpdate(e){const t=this.getSupportedChannels(),i={};for(const o of e){const r=this.properties[o];if(r&&js(r)){const a=this.unitView.paramMediator.createExpression(r.expr);a.addListener(()=>{this.updateGraphicsData(),this.unitView.context.animator.requestRender()}),t.includes(o)||Object.defineProperty(i,o,{get(){return a()}})}}const s=this.properties;this.properties=sF(()=>i,()=>s)}get encoding(){return NL(this,"encoding",()=>{var r;const e=this.getDefaultEncoding(),t=this.unitView.getEncoding(),i=a=>{const l=this.properties[a];return Jle(l)||js(l)?{value:l}:void 0},s=Object.fromEntries(this.getSupportedChannels().map(a=>[a,i(a)]).filter(a=>Cr(a[1]))),o=this.fixEncoding({...e,...s,...t});for(const a of Object.keys(o))this.getSupportedChannels().includes(a)||delete o[a];return o.x&&((r=o.x).buildIndex??(r.buildIndex=!0)),o})}getContext(){return this.unitView.context}getType(){return this.unitView.getMarkType()}initializeData(){}initializeEncoders(){this.encoders=rle(this.unitView,this.encoding)}async initializeGraphics(){}updateGraphicsData(){}getSampleFacetMode(){if(this.encoders.facetIndex)return oF;if(this.unitView.getLayoutAncestors().find(e=>"samples"in e.spec))return ece}createAndLinkShaders(e,t,i=[]){const s=this.getAttributes(),o=this.encoders,r=this.getSampleFacetMode();r&&i.push(`#define ${r}`);const a="// view: "+this.unitView.getPathString();let l=[];const c=new Set,d=WH(o),u=[],h=Object.values(o).flatMap(S=>S.accessors).map(S=>S.predicate).filter(S=>S.param),f=new Map;for(const S of h){const L=S.param,x=this.unitView.paramMediator,D=x.getValue(L);if(!D)throw new Error(`Cannot infer selection type as the parameter "${L}" has no value. Please ensure that the parameter is properly defined!`);const k=TL+"uniqueId";if(SH(D)){if(!f.has(L)){const P=Bk+rS(L);f.set(L,"single"),u.push(" // Selection parameter"),u.push(` uniform highp uint ${P};`),X(this,xa).push(()=>{this.registerMarkUniformValue(P,{expr:L},O=>O.uniqueId??0)}),l.push(`bool ${Zw}${L}(bool empty) { + return ${Bk}${L} == ${k} || (empty && ${Bk}${L} == 0u); +}`)}}else if(f4(D)&&!f.has(L)){f.set(L,"multi");const P=rF+rS(L);l.push(`// Selection texture +uniform highp usampler2D ${P};`);const O=this.getContext().glHelper,M=O.selectionTextures;this.selectionTextureOps.push(()=>{const G=x.getValue(L),te=M.get(G);if(!te)throw new Error(`Bug: no selection texture found for "${L}"!`);wh(this.programInfo,{[P]:te})});const R=rF+L;l.push(`bool ${Zw}${L}(bool empty) { return binarySearchTexture(${R}, ${k}) || (empty && isEmptyBinarySearchTexture(${R})); -}`),O.createSelectionTexture(D);const z=x.createExpression(L);z.addListener(()=>{const G=z(null);O.createSelectionTexture(G),this.getContext().animator.requestRender()})}}const g=(C,L,x,D)=>{const k=L.channelDef;if(Sr(k))if(Gs(k.value)){const{uniformName:P,uniformGlsl:O,accessorGlsl:M,adjuster:R}=Jae(C,x);l.push(M),u.push(O),X(this,Da).push(()=>{this.registerMarkUniformValue(P,k.value,R)})}else l.push(Qae(C,x,k.value).accessorGlsl);else if(I1(k)){const{uniformName:P,uniformGlsl:O,accessorGlsl:M}=ele(C,D,x);u.push(O),l.push(M);const{largeHp:R,discrete:z}=R1(D,C),G=z&&"domain"in D?te=>D.domain().indexOf(te):R?WH:te=>+te;X(this,Da).push(()=>{this.registerMarkUniformValue(P,k.datum,G)})}else if(wu(k)){const P=d.get([k.field,!0]),{attributeGlsl:O,accessorGlsl:M}=iF(C,D,x,P!=null&&P.includes(C)?P:void 0);c.add(O),l.push(M)}else if(T1(k)){const{attributeGlsl:P,accessorGlsl:O}=iF(C,D,x);c.add(P),l.push(O)}else throw new jh(`Unsupported channel definition: ${JSON.stringify(k)}`,this.unitView)};for(const[C,L]of Object.entries(o)){if(!s.includes(C))continue;const{channelDef:x,accessors:D,scale:k}=L;for(let P=0;P{const ae=this.createMarkUniformSetter(te),fe=()=>ae(zH(k,C));O.addEventListener("range",fe),fe()}),R&&X(this,Da).push(()=>{const ae=this.createMarkUniformSetter(z),fe=()=>{const oe=Kd(k.type)?[0,k.domain().length]:k.domain();ae(BH(k.type)?lle(oe):oe)};O.addEventListener("domain",fe),fe()})}l.push(ile(C,D))}const p=[...f.keys()].map(C=>`${iC}${C}(false)`);l.push(`bool isPointSelected() { +}`),O.createSelectionTexture(D);const z=x.createExpression(L);z.addListener(()=>{const G=z(null);O.createSelectionTexture(G),this.getContext().animator.requestRender()})}}const g=(S,L,x,D)=>{const k=L.channelDef;if(Cr(k))if(js(k.value)){const{uniformName:P,uniformGlsl:O,accessorGlsl:M,adjuster:R}=wle(S,x);l.push(M),u.push(O),X(this,xa).push(()=>{this.registerMarkUniformValue(P,k.value,R)})}else l.push(yle(S,x,k.value).accessorGlsl);else if(N1(k)){const{uniformName:P,uniformGlsl:O,accessorGlsl:M}=Cle(S,D,x);u.push(O),l.push(M);const{largeHp:R,discrete:z}=P1(D,S),G=z&&"domain"in D?te=>D.domain().indexOf(te):R?BH:te=>+te;X(this,xa).push(()=>{this.registerMarkUniformValue(P,k.datum,G)})}else if(Cu(k)){const P=d.get([k.field,!0]),{attributeGlsl:O,accessorGlsl:M}=JO(S,D,x,P!=null&&P.includes(S)?P:void 0);c.add(O),l.push(M)}else if(R1(k)){const{attributeGlsl:P,accessorGlsl:O}=JO(S,D,x);c.add(P),l.push(O)}else throw new Kh(`Unsupported channel definition: ${JSON.stringify(k)}`,this.unitView)};for(const[S,L]of Object.entries(o)){if(!s.includes(S))continue;const{channelDef:x,accessors:D,scale:k}=L;for(let P=0;P{const ae=this.createMarkUniformSetter(te),fe=()=>ae(VH(k,S));O.addEventListener("range",fe),fe()}),R&&X(this,xa).push(()=>{const ae=this.createMarkUniformSetter(z),fe=()=>{const oe=Yd(k.type)?[0,k.domain().length]:k.domain();ae(FH(k.type)?Ile(oe):oe)};O.addEventListener("domain",fe),fe()})}l.push(xle(S,D))}const p=[...f.keys()].map(S=>`${Zw}${S}(false)`);l.push(`bool isPointSelected() { `+(this.encoders.uniqueId&&p.length>0?` return ${p.join(" || ")};`:" return false;")+` }`);const _=`precision highp float; -precision highp int;`,v=C=>C.replace("#pragma markUniforms",u.join(` -`));i=i.map(v),e=v(e),t=v(t);const b=[_,a,...i,rF,yle,[...c].join(` -`),...l,wle,Cle,e],y=[_,a,...i,rF,Sle,t],w=this.gl;this.programStatus=Ile(w,this.glHelper.compileShader(w.VERTEX_SHADER,b),this.glHelper.compileShader(w.FRAGMENT_SHADER,y))}finalizeGraphicsInitialization(){const e=this.programStatus.getProgramErrors();if(e){e.detail&&console.warn(e.detail);const t=new Error("Cannot create shader program: "+e.message);throw t.view=this.unitView,t}this.programInfo=wse(this.gl,this.programStatus.program),delete this.programStatus,this.viewUniformInfo=vO(this.gl,this.programInfo,"View"),this.markUniformInfo=vO(this.gl,this.programInfo,"Mark"),this.gl.useProgram(this.programInfo.program),wh(this.programInfo,{uSampleFacet:[0,1,0,1],uTransitionOffset:0,uZero:0});for(const t of X(this,Da))t();ut(this,Da,void 0)}createMarkUniformSetter(e){const t=this.markUniformInfo.setters[e];if(!t)throw new Error(`Uniform "${e}" not found int the Mark block!`);return i=>{t(i),this.markUniformsAltered=!0,this.unitView.context.animator.requestRender()}}registerMarkUniformValue(e,t,i=s=>s){const s=this.createMarkUniformSetter(e),o=r=>{if(r==null)throw new Error(`Trying to set null/undefined value for uniform: ${e}${Gs(t)?`Expr: ${t.expr}`:""}`);s(r)};if(Gs(t)){const r=this.unitView.paramMediator.createExpression(t.expr),a=()=>o(i(r(null)));r.addListener(a),a()}else o(i(t))}deleteGraphicsData(){const e=this.gl;if(this.vertexArrayInfo&&(this.gl.bindVertexArray(null),e.deleteVertexArray(this.vertexArrayInfo.vertexArrayObject),this.vertexArrayInfo=void 0),this.bufferInfo){for(let t=0;t<8;t++)e.disableVertexAttribArray(t);Object.values(this.bufferInfo.attribs).forEach(t=>this.gl.deleteBuffer(t.buffer)),this.bufferInfo.indices&&this.gl.deleteBuffer(this.bufferInfo.indices),this.bufferInfo=void 0}}updateBufferInfo(e){if(this.gl.bindVertexArray(null),this.bufferInfo&&e.vertexCount<=this.bufferInfo.allocatedVertices)for(const[t,i]of Object.entries(e.arrays))i.data&&Rte(this.gl,this.bufferInfo.attribs[t],i.data,0);else{this.deleteGraphicsData(),this.bufferInfo=Ote(this.gl,e.arrays,{numElements:e.vertexCount}),this.bufferInfo.allocatedVertices=e.allocatedVertices;for(const[t,i]of Object.entries(e.arrays))this.bytesPerElement.set(t,i.data.BYTES_PER_ELEMENT)}}get glHelper(){return this.getContext().glHelper}get gl(){return this.glHelper.gl}onBeforeSampleAnimation(){}onAfterSampleAnimation(){}isReady(){return this.bufferInfo&&this.programInfo}isPickingParticipant(){if(this.properties.tooltip===null&&!this.unitView.paramMediator.hasPointSelections())return!1;for(const e of this.unitView.getLayoutAncestors())if(!e.isPickingSupported())return!1;return!0}bindOrSetMarkUniformBlock(){this.markUniformsAltered?(yO(this.gl,this.programInfo,this.markUniformInfo),this.markUniformsAltered=!1):rz(this.gl,this.programInfo,this.markUniformInfo)}prepareRender(e){const t=this.glHelper,i=this.gl,s=[];s.push(()=>{this.vertexArrayInfo||(this.vertexArrayInfo=zse(this.gl,this.programInfo,this.bufferInfo)),i.useProgram(this.programInfo.program)});for(const[r,a]of Object.entries(this.encoding))if(zo(a)){const l=zo(a)&&a.resolutionChannel||r;if(Ib(l)){const c=this.unitView.getScaleResolution(l),d=t.rangeTextures.get(c);d&&s.push(()=>wh(this.programInfo,{[CA+r]:d}))}}s.push(...this.selectionTextureOps),this.getSampleFacetMode()==lF&&s.push(()=>{let r;for(const a of this.unitView.getLayoutAncestors())if(r=a.getSampleFacetTexture(),r)break;if(!r)throw new Error("No facet texture available. This is bug.");wh(this.programInfo,{uSampleFacetTexture:r})});const o=(e.picking??!1)&&this.isPickingParticipant();return s.push(()=>xb(this.viewUniformInfo,{uViewOpacity:this.unitView.getEffectiveOpacity(),uPickingEnabled:o})),this.opaque||e.picking?s.push(()=>i.disable(i.BLEND)):s.push(()=>i.enable(i.BLEND)),s}prepareSampleFacetRendering(e){const t=e.sampleFacetRenderingOptions,i=this.programInfo.uniformSetters.uSampleFacet;if(t&&i){const s=t.locSize?t.locSize.location:0,o=t.locSize?t.locSize.size:1;if(s>1||s+o<0)return!1;const r=t.targetLocSize?t.targetLocSize.location:s,a=t.targetLocSize?t.targetLocSize.size:o;this.gl.uniform4f(i.location,s,o,r,a)}return!0}render(e){}createRenderCallback(e,t){var u;if(!this.bufferInfo)return()=>{};const i=this;let s;const o=(u=this.unitView.getScaleResolution("x"))==null?void 0:u.scale,r=o&&as(o.type),a=["index","locus"].includes(o==null?void 0:o.type)?-1:0,l=[0,0];s=h=>{if(r&&h.xIndex){const f=o.domain(),g=h.xIndex(f[0]+a,f[1],l),p=g[0],_=g[1]-p;_>0&&e(p,_)}else e(h.offset,h.count)};const c=this.rangeMap.get(void 0).count==0?t.facetId:void 0,d=this.rangeMap.get(c);return t.sampleFacetRenderingOptions?function(){d.count&&i.prepareSampleFacetRendering(t)&&s(d)}:function(){d.count&&s(d)}}setViewport(e,t){e=e.flatten();const i=this.unitView.context.devicePixelRatio,s=this.gl,o=this.properties,r=this.glHelper.getLogicalCanvasSize(),a=.5,l=(o.xOffset??0)+a,c=(o.yOffset??0)+a;let d,u=e;if(o.clip!=="never"&&(o.clip||t)){let h=0,f=0,g;if(t){if(u=e.intersect(t).flatten(),!u.isDefined())return!1;g=[e.width/u.width,e.height/u.height],f=Math.max(0,e.y2-t.y2),h=Math.min(0,e.x-t.x)}else g=[1,1];const p=[u.x,r.height-u.y2,u.width,u.height].map(y=>y*i),_=p.map(y=>Math.floor(y)),v=p[0]-_[0],b=p[1]-_[1];s.viewport(..._),s.scissor(..._),s.enable(s.SCISSOR_TEST),d={uViewOffset:[(l+h+v/i)/u.width,-(c+f-b/i)/u.height],uViewScale:g}}else{if(!e.isDefined())return!1;s.viewport(0,0,r.width*i,r.height*i),s.disable(s.SCISSOR_TEST),d={uViewOffset:[(e.x+l)/r.width,(r.height-e.y-c-e.height)/r.height],uViewScale:[e.width/r.width,e.height/r.height]}}return xb(this.viewUniformInfo,{...d,uViewportSize:[e.width,e.height],uDevicePixelRatio:i}),yO(this.gl,this.programInfo,this.viewUniformInfo),!0}findDatumAt(e,t){}}Da=new WeakMap;let Rle=class extends gc{constructor(){super([],JSON.stringify)}get(e){let t=super.get(e);return t===void 0&&(t={offset:0,count:0,xIndex:void 0},super.set(e,t)),t}migrateEntries(e){for(const[t,i]of this.entries())e.has(t)||(i.offset=0,i.count=0,i.xIndex=void 0);for(const[t,i]of e.entries())Object.assign(this.get(t),i)}};function DA(n,e){const t=jae(e);let i=n[e]&&{...n[e]},s=n[t]&&{...n[t]};if(!(Sr(i)||Sr(s))){if(i){if(!zo(n[e]))return;if(s){if(i.type!="quantitative"){const o=(1-(i.band||1))/2;i.band=o,s.band=-o}}else if(i.type=="quantitative")s={datum:0,contributesToScaleDomain:!1};else{s={...i};const o=(1-(i.band??1))/2;i.band=0+o,s.band=1-o}}else i={value:0},s={value:1};n[e]=i,n[t]=s}}function GH(n,e){n.stroke||(e?n.stroke={value:null}:n.stroke={resolutionChannel:"color",...n.color}),Sr(n.stroke)&&n.stroke.value===null&&(n.strokeWidth={value:0}),n.strokeOpacity||(n.strokeOpacity={resolutionChannel:"opacity",...n.opacity})}function KH(n,e){Sr(n.fill)&&n.fill.value===null?n.fillOpacity={value:0}:n.fill||(n.fill={resolutionChannel:"color",...n.color},!e&&!n.fillOpacity&&(n.fillOpacity={value:0})),n.fillOpacity||(e?n.fillOpacity={resolutionChannel:"opacity",...n.opacity}:n.fillOpacity={value:0})}var du,kA,EA;class Mle extends O1{constructor(t){super(t);Oe(this,du);this.augmentDefaultProperties({x2:void 0,y2:void 0,filled:!0,color:"#4c78a8",opacity:1,strokeWidth:3,cornerRadius:0,minWidth:.5,minHeight:.5,minOpacity:1})}getAttributes(){return["uniqueId","facetIndex","x","x2","y","y2","fill","stroke","fillOpacity","strokeOpacity","strokeWidth"]}getSupportedChannels(){return[...super.getSupportedChannels(),"x2","y2","fill","stroke","fillOpacity","strokeOpacity","strokeWidth"]}get opaque(){return WL(this,"opaque",()=>!Le(this,du,kA).call(this)&&!Le(this,du,EA).call(this)&&Sr(this.encoding.fillOpacity)&&this.encoding.fillOpacity.value==1&&this.properties.minOpacity==1)&&this.unitView.getEffectiveOpacity()==1}fixEncoding(t){return DA(t,"x"),DA(t,"y"),GH(t,this.properties.filled),KH(t,this.properties.filled),delete t.color,delete t.opacity,t}onBeforeSampleAnimation(){}onAfterSampleAnimation(){}async initializeGraphics(){await super.initializeGraphics();const t=[];Le(this,du,kA).call(this)&&t.push("ROUNDED_CORNERS"),Le(this,du,EA).call(this)&&t.push("STROKED"),this.createAndLinkShaders(qse,Gse,[Kse,...t.map(i=>"#define "+i)])}finalizeGraphicsInitialization(){super.finalizeGraphicsInitialization(),this.gl.useProgram(this.programInfo.program);const t=this.properties;this.registerMarkUniformValue("uMinWidth",t.minWidth),this.registerMarkUniformValue("uMinHeight",t.minHeight),this.registerMarkUniformValue("uMinOpacity",t.minOpacity),this.registerMarkUniformValue("uCornerRadiusTopRight",t.cornerRadiusTopRight??t.cornerRadius??0),this.registerMarkUniformValue("uCornerRadiusBottomRight",t.cornerRadiusBottomRight??t.cornerRadius??0),this.registerMarkUniformValue("uCornerRadiusTopLeft",t.cornerRadiusTopLeft??t.cornerRadius??0),this.registerMarkUniformValue("uCornerRadiusBottomLeft",t.cornerRadiusBottomLeft??t.cornerRadius??0)}updateGraphicsData(){const t=this.unitView.getCollector();if(!t){console.debug("No collector");return}const i=t.getItemCount(),s=new ple({encoders:this.encoders,attributes:this.getAttributes(),numItems:i});s.addBatches(t.facetBatches);const o=s.toArrays();this.rangeMap.migrateEntries(o.rangeMap),this.updateBufferInfo(o)}prepareRender(t){const i=super.prepareRender(t);return i.push(()=>this.bindOrSetMarkUniformBlock()),i.push(()=>uf(this.gl,this.programInfo,this.vertexArrayInfo)),i}render(t){const i=this.gl;return this.createRenderCallback((s,o)=>{wL(i,this.vertexArrayInfo,i.TRIANGLE_STRIP,o,s)},t)}findDatumAt(t,i){t=Zs(t);const s=this.unitView.getCollector().facetBatches.get(t);if(!s)return;const o=this.encoders,r=o.x.scale.type;if(Kd(r)){const a=o.x.dataAccessor;return s.find(l=>i==a(l))}else{const a=o.x.dataAccessor,l=o.x2.dataAccessor;return s.find(c=>i>=a(c)&&iS.replace("#pragma markUniforms",u.join(` +`));i=i.map(v),e=v(e),t=v(t);const b=[_,a,...i,nF,Hle,[...c].join(` +`),...l,$le,Ule,e],y=[_,a,...i,nF,jle,t],w=this.gl;this.programStatus=Qle(w,this.glHelper.compileShader(w.VERTEX_SHADER,b),this.glHelper.compileShader(w.FRAGMENT_SHADER,y))}finalizeGraphicsInitialization(){const e=this.programStatus.getProgramErrors();if(e){e.detail&&console.warn(e.detail);const t=new Error("Cannot create shader program: "+e.message);throw t.view=this.unitView,t}this.programInfo=Nse(this.gl,this.programStatus.program),delete this.programStatus,this.viewUniformInfo=mO(this.gl,this.programInfo,"View"),this.markUniformInfo=mO(this.gl,this.programInfo,"Mark"),this.gl.useProgram(this.programInfo.program),wh(this.programInfo,{uSampleFacet:[0,1,0,1],uTransitionOffset:0,uZero:0});for(const t of X(this,xa))t();dt(this,xa,void 0)}createMarkUniformSetter(e){const t=this.markUniformInfo.setters[e];if(!t)throw new Error(`Uniform "${e}" not found int the Mark block!`);return i=>{t(i),this.markUniformsAltered=!0,this.unitView.context.animator.requestRender()}}registerMarkUniformValue(e,t,i=s=>s){const s=this.createMarkUniformSetter(e),o=r=>{if(r==null)throw new Error(`Trying to set null/undefined value for uniform: ${e}${js(t)?`Expr: ${t.expr}`:""}`);s(r)};if(js(t)){const r=this.unitView.paramMediator.createExpression(t.expr),a=()=>o(i(r(null)));r.addListener(a),a()}else o(i(t))}deleteGraphicsData(){const e=this.gl;if(this.vertexArrayInfo&&(this.gl.bindVertexArray(null),e.deleteVertexArray(this.vertexArrayInfo.vertexArrayObject),this.vertexArrayInfo=void 0),this.bufferInfo){for(let t=0;t<8;t++)e.disableVertexAttribArray(t);Object.values(this.bufferInfo.attribs).forEach(t=>this.gl.deleteBuffer(t.buffer)),this.bufferInfo.indices&&this.gl.deleteBuffer(this.bufferInfo.indices),this.bufferInfo=void 0}}updateBufferInfo(e){if(this.gl.bindVertexArray(null),this.bufferInfo&&e.vertexCount<=this.bufferInfo.allocatedVertices)for(const[t,i]of Object.entries(e.arrays))i.data&&Ute(this.gl,this.bufferInfo.attribs[t],i.data,0);else{this.deleteGraphicsData(),this.bufferInfo=Gte(this.gl,e.arrays,{numElements:e.vertexCount}),this.bufferInfo.allocatedVertices=e.allocatedVertices;for(const[t,i]of Object.entries(e.arrays))this.bytesPerElement.set(t,i.data.BYTES_PER_ELEMENT)}}get glHelper(){return this.getContext().glHelper}get gl(){return this.glHelper.gl}onBeforeSampleAnimation(){}onAfterSampleAnimation(){}isReady(){return this.bufferInfo&&this.programInfo}isPickingParticipant(){if(this.properties.tooltip===null&&!this.unitView.paramMediator.hasPointSelections())return!1;for(const e of this.unitView.getLayoutAncestors())if(!e.isPickingSupported())return!1;return!0}bindOrSetMarkUniformBlock(){this.markUniformsAltered?(_O(this.gl,this.programInfo,this.markUniformInfo),this.markUniformsAltered=!1):oz(this.gl,this.programInfo,this.markUniformInfo)}prepareRender(e){const t=this.glHelper,i=this.gl,s=[];s.push(()=>{this.vertexArrayInfo||(this.vertexArrayInfo=Qse(this.gl,this.programInfo,this.bufferInfo)),i.useProgram(this.programInfo.program)});for(const[r,a]of Object.entries(this.encoding))if(Vo(a)){const l=Vo(a)&&a.resolutionChannel||r;if(Nb(l)){const c=this.unitView.getScaleResolution(l),d=t.rangeTextures.get(c);d&&s.push(()=>wh(this.programInfo,{[yA+r]:d}))}}s.push(...this.selectionTextureOps),this.getSampleFacetMode()==oF&&s.push(()=>{let r;for(const a of this.unitView.getLayoutAncestors())if(r=a.getSampleFacetTexture(),r)break;if(!r)throw new Error("No facet texture available. This is bug.");wh(this.programInfo,{uSampleFacetTexture:r})});const o=(e.picking??!1)&&this.isPickingParticipant();return s.push(()=>Db(this.viewUniformInfo,{uViewOpacity:this.unitView.getEffectiveOpacity(),uPickingEnabled:o})),this.opaque||e.picking?s.push(()=>i.disable(i.BLEND)):s.push(()=>i.enable(i.BLEND)),s}prepareSampleFacetRendering(e){const t=e.sampleFacetRenderingOptions,i=this.programInfo.uniformSetters.uSampleFacet;if(t&&i){const s=t.locSize?t.locSize.location:0,o=t.locSize?t.locSize.size:1;if(s>1||s+o<0)return!1;const r=t.targetLocSize?t.targetLocSize.location:s,a=t.targetLocSize?t.targetLocSize.size:o;this.gl.uniform4f(i.location,s,o,r,a)}return!0}render(e){}createRenderCallback(e,t){var u;if(!this.bufferInfo)return()=>{};const i=this;let s;const o=(u=this.unitView.getScaleResolution("x"))==null?void 0:u.scale,r=o&&os(o.type),a=["index","locus"].includes(o==null?void 0:o.type)?-1:0,l=[0,0];s=h=>{if(r&&h.xIndex){const f=o.domain(),g=h.xIndex(f[0]+a,f[1],l),p=g[0],_=g[1]-p;_>0&&e(p,_)}else e(h.offset,h.count)};const c=this.rangeMap.get(void 0).count==0?t.facetId:void 0,d=this.rangeMap.get(c);return t.sampleFacetRenderingOptions?function(){d.count&&i.prepareSampleFacetRendering(t)&&s(d)}:function(){d.count&&s(d)}}setViewport(e,t){e=e.flatten();const i=this.unitView.context.devicePixelRatio,s=this.gl,o=this.properties,r=this.glHelper.getLogicalCanvasSize(),a=.5,l=(o.xOffset??0)+a,c=(o.yOffset??0)+a;let d,u=e;if(o.clip!=="never"&&(o.clip||t)){let h=0,f=0,g;if(t){if(u=e.intersect(t).flatten(),!u.isDefined())return!1;g=[e.width/u.width,e.height/u.height],f=Math.max(0,e.y2-t.y2),h=Math.min(0,e.x-t.x)}else g=[1,1];const p=[u.x,r.height-u.y2,u.width,u.height].map(y=>y*i),_=p.map(y=>Math.floor(y)),v=p[0]-_[0],b=p[1]-_[1];s.viewport(..._),s.scissor(..._),s.enable(s.SCISSOR_TEST),d={uViewOffset:[(l+h+v/i)/u.width,-(c+f-b/i)/u.height],uViewScale:g}}else{if(!e.isDefined())return!1;s.viewport(0,0,r.width*i,r.height*i),s.disable(s.SCISSOR_TEST),d={uViewOffset:[(e.x+l)/r.width,(r.height-e.y-c-e.height)/r.height],uViewScale:[e.width/r.width,e.height/r.height]}}return Db(this.viewUniformInfo,{...d,uViewportSize:[e.width,e.height],uDevicePixelRatio:i}),_O(this.gl,this.programInfo,this.viewUniformInfo),!0}findDatumAt(e,t){}}xa=new WeakMap;let tce=class extends gc{constructor(){super([],JSON.stringify)}get(e){let t=super.get(e);return t===void 0&&(t={offset:0,count:0,xIndex:void 0},super.set(e,t)),t}migrateEntries(e){for(const[t,i]of this.entries())e.has(t)||(i.offset=0,i.count=0,i.xIndex=void 0);for(const[t,i]of e.entries())Object.assign(this.get(t),i)}};function xA(n,e){const t=fle(e);let i=n[e]&&{...n[e]},s=n[t]&&{...n[t]};if(!(Cr(i)||Cr(s))){if(i){if(!Vo(n[e]))return;if(s){if(i.type!="quantitative"){const o=(1-(i.band||1))/2;i.band=o,s.band=-o}}else if(i.type=="quantitative")s={datum:0,contributesToScaleDomain:!1};else{s={...i};const o=(1-(i.band??1))/2;i.band=0+o,s.band=1-o}}else i={value:0},s={value:1};n[e]=i,n[t]=s}}function qH(n,e){n.stroke||(e?n.stroke={value:null}:n.stroke={resolutionChannel:"color",...n.color}),Cr(n.stroke)&&n.stroke.value===null&&(n.strokeWidth={value:0}),n.strokeOpacity||(n.strokeOpacity={resolutionChannel:"opacity",...n.opacity})}function GH(n,e){Cr(n.fill)&&n.fill.value===null?n.fillOpacity={value:0}:n.fill||(n.fill={resolutionChannel:"color",...n.color},!e&&!n.fillOpacity&&(n.fillOpacity={value:0})),n.fillOpacity||(e?n.fillOpacity={resolutionChannel:"opacity",...n.opacity}:n.fillOpacity={value:0})}var uu,LA,DA;class ice extends B1{constructor(t){super(t);Pe(this,uu);this.augmentDefaultProperties({x2:void 0,y2:void 0,filled:!0,color:"#4c78a8",opacity:1,strokeWidth:3,cornerRadius:0,minWidth:.5,minHeight:.5,minOpacity:1})}getAttributes(){return["uniqueId","facetIndex","x","x2","y","y2","fill","stroke","fillOpacity","strokeOpacity","strokeWidth"]}getSupportedChannels(){return[...super.getSupportedChannels(),"x2","y2","fill","stroke","fillOpacity","strokeOpacity","strokeWidth"]}get opaque(){return NL(this,"opaque",()=>!xe(this,uu,LA).call(this)&&!xe(this,uu,DA).call(this)&&Cr(this.encoding.fillOpacity)&&this.encoding.fillOpacity.value==1&&this.properties.minOpacity==1)&&this.unitView.getEffectiveOpacity()==1}fixEncoding(t){return xA(t,"x"),xA(t,"y"),qH(t,this.properties.filled),GH(t,this.properties.filled),delete t.color,delete t.opacity,t}onBeforeSampleAnimation(){}onAfterSampleAnimation(){}async initializeGraphics(){await super.initializeGraphics();const t=[];xe(this,uu,LA).call(this)&&t.push("ROUNDED_CORNERS"),xe(this,uu,DA).call(this)&&t.push("STROKED"),this.createAndLinkShaders(noe,soe,[ooe,...t.map(i=>"#define "+i)])}finalizeGraphicsInitialization(){super.finalizeGraphicsInitialization(),this.gl.useProgram(this.programInfo.program);const t=this.properties;this.registerMarkUniformValue("uMinWidth",t.minWidth),this.registerMarkUniformValue("uMinHeight",t.minHeight),this.registerMarkUniformValue("uMinOpacity",t.minOpacity),this.registerMarkUniformValue("uCornerRadiusTopRight",t.cornerRadiusTopRight??t.cornerRadius??0),this.registerMarkUniformValue("uCornerRadiusBottomRight",t.cornerRadiusBottomRight??t.cornerRadius??0),this.registerMarkUniformValue("uCornerRadiusTopLeft",t.cornerRadiusTopLeft??t.cornerRadius??0),this.registerMarkUniformValue("uCornerRadiusBottomLeft",t.cornerRadiusBottomLeft??t.cornerRadius??0)}updateGraphicsData(){const t=this.unitView.getCollector();if(!t){console.debug("No collector");return}const i=t.getItemCount(),s=new Fle({encoders:this.encoders,attributes:this.getAttributes(),numItems:i});s.addBatches(t.facetBatches);const o=s.toArrays();this.rangeMap.migrateEntries(o.rangeMap),this.updateBufferInfo(o)}prepareRender(t){const i=super.prepareRender(t);return i.push(()=>this.bindOrSetMarkUniformBlock()),i.push(()=>gf(this.gl,this.programInfo,this.vertexArrayInfo)),i}render(t){const i=this.gl;return this.createRenderCallback((s,o)=>{gL(i,this.vertexArrayInfo,i.TRIANGLE_STRIP,o,s)},t)}findDatumAt(t,i){t=Ks(t);const s=this.unitView.getCollector().facetBatches.get(t);if(!s)return;const o=this.encoders,r=o.x.scale.type;if(Yd(r)){const a=o.x.dataAccessor;return s.find(l=>i==a(l))}else{const a=o.x.dataAccessor,l=o.x2.dataAccessor;return s.find(c=>i>=a(c)&&i0);this.augmentDefaultProperties({x:.5,y:.5,color:"#4c78a8",filled:!0,opacity:1,size:100,semanticScore:0,shape:"circle",strokeWidth:2,fillGradientStrength:0,dx:0,dy:0,angle:0,sampleFacetPadding:.1,semanticZoomFraction:.02,minPickingSize:2});const i=this.properties.semanticZoomFraction;if(i!=null)if(Gs(i)){const s=this.unitView.paramMediator.createExpression(i.expr);s.addListener(()=>this.getContext().animator.requestRender()),ut(this,Fp,s)}else ut(this,Fp,()=>i)}getAttributes(){return["uniqueId","facetIndex","x","y","size","semanticScore","shape","strokeWidth","dx","dy","fill","stroke","fillOpacity","strokeOpacity","angle"]}getSupportedChannels(){return[...super.getSupportedChannels(),"size","semanticScore","shape","strokeWidth","dx","dy","fill","stroke","fillOpacity","strokeOpacity","angle"]}getDefaultEncoding(){return{...super.getDefaultEncoding(),...Wle}}fixEncoding(t){return GH(t,this.properties.filled),KH(t,this.properties.filled),delete t.color,delete t.opacity,t}initializeData(){var i,s;super.initializeData();const t=(s=(i=this.encoders.semanticScore)==null?void 0:i.dataAccessor)==null?void 0:s.asNumberAccessor();t&&(this.sampledSemanticScores=Float32Array.from(Ble(1e4,this.unitView.getCollector().getData(),t)),this.sampledSemanticScores.sort((o,r)=>o-r))}async initializeGraphics(){await super.initializeGraphics(),this.createAndLinkShaders(Ple,Ole,[Fle])}finalizeGraphicsInitialization(){super.finalizeGraphicsInitialization(),this.gl.useProgram(this.programInfo.program);const t=this.properties;this.registerMarkUniformValue("uInwardStroke",t.inwardStroke,i=>!!i),this.registerMarkUniformValue("uGradientStrength",t.fillGradientStrength),this.registerMarkUniformValue("uMinPickingSize",t.minPickingSize)}updateGraphicsData(){const t=this.unitView.getCollector();if(!t){console.debug("No collector");return}const i=t.getItemCount(),s=new _le({encoders:this.encoders,attributes:this.getAttributes(),numItems:Math.max(i,this.properties.minBufferSize||0)});s.addBatches(t.facetBatches);const o=s.toArrays();this.rangeMap.migrateEntries(o.rangeMap),this.updateBufferInfo(o)}getSemanticThreshold(){if(this.sampledSemanticScores){const t=Math.max(0,1-X(this,Fp).call(this)*this.unitView.getZoomLevel());if(t<=0)return-1/0;if(t>=1)return 1/0;{const i=this.sampledSemanticScores;return QW(i,t)}}else return-1}prepareRender(t){const i=super.prepareRender(t);return i.push(()=>{xb(this.markUniformInfo,{uScaleFactor:Le(this,Kx,ZH).call(this),uSemanticThreshold:this.getSemanticThreshold()}),this.markUniformsAltered=!0}),i.push(()=>this.bindOrSetMarkUniformBlock()),i.push(()=>uf(this.gl,this.programInfo,this.vertexArrayInfo)),i}render(t){const i=this.gl;return this.createRenderCallback((s,o)=>{o&&wL(i,this.vertexArrayInfo,i.POINTS,o,s)},t)}}Fp=new WeakMap,Kx=new WeakSet,ZH=function(){const t=Math.pow(2,this.properties.geometricZoomBound||0);return Math.pow(Math.min(1,this.unitView.getZoomLevel()/t),1/3)};const zle=`// Line caps +`;class KH extends Wn{constructor(e){super(e),this.params=e,this.k=e.size||500,this.reset()}reset(){super.reset(),this.reservoir=[],this.W=void 0,this.ingester=this._initialIngester}_initialIngester(e){this.reservoir.push(e),this.reservoir.length==this.k&&(this.W=Math.exp(Math.log(Math.random())/this.k),this.i=this.k,this.next=this.i,this.ingester=this._finalIngester,this._setNextStop())}_finalIngester(e){++this.i==this.next&&(this.reservoir[Math.floor(Math.random()*this.k)]=e,this.W*=Math.exp(Math.log(Math.random())/this.k),this._setNextStop())}_setNextStop(){this.next+=Math.floor(Math.log(Math.random())/Math.log(1-this.W))+1}handle(e){this.ingester(e)}complete(){for(const e of this.reservoir)this._propagate(e);super.complete()}}function rce(n,e,t){const i=new KH({type:"sample",size:n});for(const s of e)i.handle(t(s));return i.complete(),i.reservoir}const ace={};var Wp,zx,YH;class lce extends B1{constructor(t){super(t);Pe(this,zx);Pe(this,Wp,()=>0);this.augmentDefaultProperties({x:.5,y:.5,color:"#4c78a8",filled:!0,opacity:1,size:100,semanticScore:0,shape:"circle",strokeWidth:2,fillGradientStrength:0,dx:0,dy:0,angle:0,sampleFacetPadding:.1,semanticZoomFraction:.02,minPickingSize:2});const i=this.properties.semanticZoomFraction;if(i!=null)if(js(i)){const s=this.unitView.paramMediator.createExpression(i.expr);s.addListener(()=>this.getContext().animator.requestRender()),dt(this,Wp,s)}else dt(this,Wp,()=>i)}getAttributes(){return["uniqueId","facetIndex","x","y","size","semanticScore","shape","strokeWidth","dx","dy","fill","stroke","fillOpacity","strokeOpacity","angle"]}getSupportedChannels(){return[...super.getSupportedChannels(),"size","semanticScore","shape","strokeWidth","dx","dy","fill","stroke","fillOpacity","strokeOpacity","angle"]}getDefaultEncoding(){return{...super.getDefaultEncoding(),...ace}}fixEncoding(t){return qH(t,this.properties.filled),GH(t,this.properties.filled),delete t.color,delete t.opacity,t}initializeData(){var i,s;super.initializeData();const t=(s=(i=this.encoders.semanticScore)==null?void 0:i.dataAccessor)==null?void 0:s.asNumberAccessor();t&&(this.sampledSemanticScores=Float32Array.from(rce(1e4,this.unitView.getCollector().getData(),t)),this.sampledSemanticScores.sort((o,r)=>o-r))}async initializeGraphics(){await super.initializeGraphics(),this.createAndLinkShaders(nce,sce,[oce])}finalizeGraphicsInitialization(){super.finalizeGraphicsInitialization(),this.gl.useProgram(this.programInfo.program);const t=this.properties;this.registerMarkUniformValue("uInwardStroke",t.inwardStroke,i=>!!i),this.registerMarkUniformValue("uGradientStrength",t.fillGradientStrength),this.registerMarkUniformValue("uMinPickingSize",t.minPickingSize)}updateGraphicsData(){const t=this.unitView.getCollector();if(!t){console.debug("No collector");return}const i=t.getItemCount(),s=new Wle({encoders:this.encoders,attributes:this.getAttributes(),numItems:Math.max(i,this.properties.minBufferSize||0)});s.addBatches(t.facetBatches);const o=s.toArrays();this.rangeMap.migrateEntries(o.rangeMap),this.updateBufferInfo(o)}getSemanticThreshold(){if(this.sampledSemanticScores){const t=Math.max(0,1-X(this,Wp).call(this)*this.unitView.getZoomLevel());if(t<=0)return-1/0;if(t>=1)return 1/0;{const i=this.sampledSemanticScores;return XW(i,t)}}else return-1}prepareRender(t){const i=super.prepareRender(t);return i.push(()=>{Db(this.markUniformInfo,{uScaleFactor:xe(this,zx,YH).call(this),uSemanticThreshold:this.getSemanticThreshold()}),this.markUniformsAltered=!0}),i.push(()=>this.bindOrSetMarkUniformBlock()),i.push(()=>gf(this.gl,this.programInfo,this.vertexArrayInfo)),i}render(t){const i=this.gl;return this.createRenderCallback((s,o)=>{o&&gL(i,this.vertexArrayInfo,i.POINTS,o,s)},t)}}Wp=new WeakMap,zx=new WeakSet,YH=function(){const t=Math.pow(2,this.properties.geometricZoomBound||0);return Math.pow(Math.min(1,this.unitView.getZoomLevel()/t),1/3)};const cce=`// Line caps const int BUTT = 0; const int SQUARE = 1; const int ROUND = 2; @@ -2001,7 +1802,7 @@ void main(void) { setupPicking(); } -`,Hle=`// Line ending +`,dce=`// Line ending const int BUTT = 0; const int SQUARE = 1; const int ROUND = 2; @@ -2050,7 +1851,7 @@ void main(void) { fragColor = vPickingColor; } } -`,$le=`layout(std140) uniform Mark { +`,uce=`layout(std140) uniform Mark { /** Minimum rule length in pixels */ uniform mediump float uMinLength; @@ -2060,7 +1861,7 @@ void main(void) { #pragma markUniforms }; -`;class Ule extends O1{constructor(e){super(e),this.dashTextureSize=0,this.augmentDefaultProperties({x2:void 0,y2:void 0,size:1,color:"black",opacity:1,minLength:0,strokeDash:null,strokeDashOffset:0,strokeCap:"butt"})}getAttributes(){return["uniqueId","facetIndex","x","x2","y","y2","size","color","opacity"]}getSupportedChannels(){return[...super.getSupportedChannels(),"x2","y2","size"]}fixEncoding(e){if(!(e.x&&e.y&&e.x2&&e.y2))if(e.x&&e.x2&&!e.y)e.y={value:.5},e.y2=e.y;else if(e.y&&e.y2&&!e.x)e.x={value:.5},e.x2=e.x;else if(e.x&&!e.y)e.y={value:0},e.y2={value:1},e.x2=e.x;else if(e.y&&!e.x)e.x={value:0},e.x2={value:1},e.y2=e.y;else if(e.x&&e.y&&e.y2)e.x2=e.x;else if(e.y&&e.x&&e.x2)e.y2=e.y;else if(e.y&&e.x)if(!e.x2&&zo(e.y)&&e.y.type=="quantitative")e.x2=e.x,e.y2={datum:0};else if(!e.y2&&zo(e.x)&&e.x.type=="quantitative")e.y2=e.y,e.x2={datum:0};else throw new Error("A bug!");else throw new Error("Invalid x and y encodings for rule mark: "+JSON.stringify(e));return e}async initializeGraphics(){await super.initializeGraphics();const e=this.gl,t=jle(this.properties.strokeDash);this.dashTexture=Sb(e,{level:0,mag:e.NEAREST,min:e.NEAREST,internalFormat:e.R8,format:e.RED,src:t,height:1}),this.dashTextureSize=t.length,this.createAndLinkShaders(zle,Hle,[$le])}finalizeGraphicsInitialization(){super.finalizeGraphicsInitialization(),this.gl.useProgram(this.programInfo.program);const e=this.properties;this.registerMarkUniformValue("uMinLength",e.minLength),this.registerMarkUniformValue("uStrokeCap",e.strokeCap??"butt",t=>["butt","square","round"].indexOf(t)),xb(this.markUniformInfo,{uDashTextureSize:+this.dashTextureSize}),this.markUniformsAltered=!0}updateGraphicsData(){const e=this.unitView.getCollector();if(!e){console.debug("No collector");return}const t=e.getItemCount(),i=new mle({encoders:this.encoders,attributes:this.getAttributes(),numItems:Math.max(t,this.properties.minBufferSize||0)});i.addBatches(e.facetBatches);const s=i.toArrays();this.rangeMap.migrateEntries(s.rangeMap),this.updateBufferInfo(s)}prepareRender(e){const t=super.prepareRender(e);return t.push(()=>this.bindOrSetMarkUniformBlock()),t.push(()=>wh(this.programInfo,{uDashTexture:this.dashTexture})),t.push(()=>uf(this.gl,this.programInfo,this.vertexArrayInfo)),t}render(e){const t=this.gl;return this.createRenderCallback((i,s)=>wL(t,this.vertexArrayInfo,t.TRIANGLE_STRIP,s,i),e)}}function jle(n){if(!n)return new Uint8Array(0);if(n.length==0||n.length%2||n.findIndex(o=>Math.round(o)!=o||o<1||o>1e3)>=0)throw new Error("Invalid stroke dash pattern: "+JSON.stringify(n));const e=n.reduce((o,r)=>o+r),t=new Uint8Array(e);let i=!0,s=0;for(let o of n){for(;o;)t[s++]=i&&255||0,o--;i=!i}return t}const qle=`out vec4 vColor; +`;class hce extends B1{constructor(e){super(e),this.dashTextureSize=0,this.augmentDefaultProperties({x2:void 0,y2:void 0,size:1,color:"black",opacity:1,minLength:0,strokeDash:null,strokeDashOffset:0,strokeCap:"butt"})}getAttributes(){return["uniqueId","facetIndex","x","x2","y","y2","size","color","opacity"]}getSupportedChannels(){return[...super.getSupportedChannels(),"x2","y2","size"]}fixEncoding(e){if(!(e.x&&e.y&&e.x2&&e.y2))if(e.x&&e.x2&&!e.y)e.y={value:.5},e.y2=e.y;else if(e.y&&e.y2&&!e.x)e.x={value:.5},e.x2=e.x;else if(e.x&&!e.y)e.y={value:0},e.y2={value:1},e.x2=e.x;else if(e.y&&!e.x)e.x={value:0},e.x2={value:1},e.y2=e.y;else if(e.x&&e.y&&e.y2)e.x2=e.x;else if(e.y&&e.x&&e.x2)e.y2=e.y;else if(e.y&&e.x)if(!e.x2&&Vo(e.y)&&e.y.type=="quantitative")e.x2=e.x,e.y2={datum:0};else if(!e.y2&&Vo(e.x)&&e.x.type=="quantitative")e.y2=e.y,e.x2={datum:0};else throw new Error("A bug!");else throw new Error("Invalid x and y encodings for rule mark: "+JSON.stringify(e));return e}async initializeGraphics(){await super.initializeGraphics();const e=this.gl,t=fce(this.properties.strokeDash);this.dashTexture=Lb(e,{level:0,mag:e.NEAREST,min:e.NEAREST,internalFormat:e.R8,format:e.RED,src:t,height:1}),this.dashTextureSize=t.length,this.createAndLinkShaders(cce,dce,[uce])}finalizeGraphicsInitialization(){super.finalizeGraphicsInitialization(),this.gl.useProgram(this.programInfo.program);const e=this.properties;this.registerMarkUniformValue("uMinLength",e.minLength),this.registerMarkUniformValue("uStrokeCap",e.strokeCap??"butt",t=>["butt","square","round"].indexOf(t)),Db(this.markUniformInfo,{uDashTextureSize:+this.dashTextureSize}),this.markUniformsAltered=!0}updateGraphicsData(){const e=this.unitView.getCollector();if(!e){console.debug("No collector");return}const t=e.getItemCount(),i=new Ble({encoders:this.encoders,attributes:this.getAttributes(),numItems:Math.max(t,this.properties.minBufferSize||0)});i.addBatches(e.facetBatches);const s=i.toArrays();this.rangeMap.migrateEntries(s.rangeMap),this.updateBufferInfo(s)}prepareRender(e){const t=super.prepareRender(e);return t.push(()=>this.bindOrSetMarkUniformBlock()),t.push(()=>wh(this.programInfo,{uDashTexture:this.dashTexture})),t.push(()=>gf(this.gl,this.programInfo,this.vertexArrayInfo)),t}render(e){const t=this.gl;return this.createRenderCallback((i,s)=>gL(t,this.vertexArrayInfo,t.TRIANGLE_STRIP,s,i),e)}}function fce(n){if(!n)return new Uint8Array(0);if(n.length==0||n.length%2||n.findIndex(o=>Math.round(o)!=o||o<1||o>1e3)>=0)throw new Error("Invalid stroke dash pattern: "+JSON.stringify(n));const e=n.reduce((o,r)=>o+r),t=new Uint8Array(e);let i=!0,s=0;for(let o of n){for(;o;)t[s++]=i&&255||0,o--;i=!i}return t}const gce=`out vec4 vColor; /** Stroke width */ out float vSize; @@ -2264,7 +2065,7 @@ void main(void) { setupPicking(); } -`,Gle=`in vec4 vColor; +`,pce=`in vec4 vColor; in float vSize; in float vNormalLengthInPixels; in float vGamma; @@ -2285,7 +2086,7 @@ void main(void) { fragColor = vPickingColor; } } -`,Kle=`layout(std140) uniform Mark { +`,mce=`layout(std140) uniform Mark { uniform float uArcHeightFactor; /** Make very small arcs visible */ @@ -2308,7 +2109,7 @@ void main(void) { #pragma markUniforms }; -`,Yle=["arc","dome","diagonal","line"],Zle=["vertical","horizontal"];class Xle extends O1{constructor(e){super(e),this.augmentDefaultProperties({x:0,x2:void 0,y:0,y2:void 0,size:1,color:"black",opacity:1,segments:101,arcHeightFactor:1,minArcHeight:1.5,minPickingSize:3,clampApex:!1,maxChordLength:5e4,arcFadingDistance:!1,noFadingOnPointSelection:!0,linkShape:"arc",orient:"vertical"}),this._baseInstanceExt=this.gl.getExtension("WEBGL_draw_instanced_base_vertex_base_instance")}getAttributes(){return["uniqueId","facetIndex","x","x2","y","y2","size","color","opacity"]}getSupportedChannels(){return[...super.getSupportedChannels(),"x2","y2","size"]}fixEncoding(e){return e.x2||(zo(e.x)?e.x2={datum:0}:e.x2=e.x),e.y2||(zo(e.y)?e.y2={datum:0}:e.y2=e.y),e}async initializeGraphics(){await super.initializeGraphics(),this.createAndLinkShaders(qle,Gle,[Kle])}finalizeGraphicsInitialization(){super.finalizeGraphicsInitialization(),this.gl.useProgram(this.programInfo.program);const e=this.properties;this.registerMarkUniformValue("uArcFadingDistance",e.arcFadingDistance,t=>t||[0,0]),this.registerMarkUniformValue("uArcHeightFactor",e.arcHeightFactor),this.registerMarkUniformValue("uMinArcHeight",e.minArcHeight),this.registerMarkUniformValue("uMinPickingSize",e.minPickingSize),this.registerMarkUniformValue("uShape",e.linkShape,t=>Yle.indexOf(t)),this.registerMarkUniformValue("uOrient",e.orient,t=>Zle.indexOf(t)),this.registerMarkUniformValue("uClampApex",e.clampApex,t=>!!t),this.registerMarkUniformValue("uMaxChordLength",e.maxChordLength),this.registerMarkUniformValue("uSegmentBreaks",e.segments,t=>t),this.registerMarkUniformValue("uNoFadingOnPointSelection",e.noFadingOnPointSelection,t=>!!t)}updateGraphicsData(){const e=this.unitView.getCollector();if(!e){console.debug("No collector");return}const t=e.getItemCount(),i=new ble({encoders:this.encoders,attributes:this.getAttributes(),numItems:t});i.addBatches(e.facetBatches);const s=i.toArrays();this.rangeMap.migrateEntries(s.rangeMap),this.arrays=Object.fromEntries(Object.entries(s.arrays).map(([o,r])=>[o,{...r,data:void 0}])),this.updateBufferInfo(s)}prepareRender(e){const t=super.prepareRender(e);return t.push(()=>this.bindOrSetMarkUniformBlock()),this._baseInstanceExt?t.push(()=>uf(this.gl,this.programInfo,this.vertexArrayInfo)):t.push(()=>this.gl.bindVertexArray(null)),t}render(e){const t=this.gl,i=()=>(this.markUniformInfo.uniforms.uSegmentBreaks[0]+1)*2;return this._baseInstanceExt?this.createRenderCallback((s,o)=>{this._baseInstanceExt.drawArraysInstancedBaseInstanceWEBGL(t.TRIANGLE_STRIP,0,i(),o,s)},e):this.createRenderCallback((s,o)=>{for(const r of Object.entries(this.bufferInfo.attribs)){const[a,l]=r;l.buffer&&l.numComponents&&l.divisor&&(l.offset=s*this.arrays[a].numComponents*this.bytesPerElement.get(a))}uf(t,this.programInfo,this.bufferInfo),t.drawArraysInstanced(t.TRIANGLE_STRIP,0,i(),o)},e)}}const Qle=`in mediump vec2 vertexCoord; +`,_ce=["arc","dome","diagonal","line"],bce=["vertical","horizontal"];class vce extends B1{constructor(e){super(e),this.augmentDefaultProperties({x:0,x2:void 0,y:0,y2:void 0,size:1,color:"black",opacity:1,segments:101,arcHeightFactor:1,minArcHeight:1.5,minPickingSize:3,clampApex:!1,maxChordLength:5e4,arcFadingDistance:!1,noFadingOnPointSelection:!0,linkShape:"arc",orient:"vertical"}),this._baseInstanceExt=this.gl.getExtension("WEBGL_draw_instanced_base_vertex_base_instance")}getAttributes(){return["uniqueId","facetIndex","x","x2","y","y2","size","color","opacity"]}getSupportedChannels(){return[...super.getSupportedChannels(),"x2","y2","size"]}fixEncoding(e){return e.x2||(Vo(e.x)?e.x2={datum:0}:e.x2=e.x),e.y2||(Vo(e.y)?e.y2={datum:0}:e.y2=e.y),e}async initializeGraphics(){await super.initializeGraphics(),this.createAndLinkShaders(gce,pce,[mce])}finalizeGraphicsInitialization(){super.finalizeGraphicsInitialization(),this.gl.useProgram(this.programInfo.program);const e=this.properties;this.registerMarkUniformValue("uArcFadingDistance",e.arcFadingDistance,t=>t||[0,0]),this.registerMarkUniformValue("uArcHeightFactor",e.arcHeightFactor),this.registerMarkUniformValue("uMinArcHeight",e.minArcHeight),this.registerMarkUniformValue("uMinPickingSize",e.minPickingSize),this.registerMarkUniformValue("uShape",e.linkShape,t=>_ce.indexOf(t)),this.registerMarkUniformValue("uOrient",e.orient,t=>bce.indexOf(t)),this.registerMarkUniformValue("uClampApex",e.clampApex,t=>!!t),this.registerMarkUniformValue("uMaxChordLength",e.maxChordLength),this.registerMarkUniformValue("uSegmentBreaks",e.segments,t=>t),this.registerMarkUniformValue("uNoFadingOnPointSelection",e.noFadingOnPointSelection,t=>!!t)}updateGraphicsData(){const e=this.unitView.getCollector();if(!e){console.debug("No collector");return}const t=e.getItemCount(),i=new Vle({encoders:this.encoders,attributes:this.getAttributes(),numItems:t});i.addBatches(e.facetBatches);const s=i.toArrays();this.rangeMap.migrateEntries(s.rangeMap),this.arrays=Object.fromEntries(Object.entries(s.arrays).map(([o,r])=>[o,{...r,data:void 0}])),this.updateBufferInfo(s)}prepareRender(e){const t=super.prepareRender(e);return t.push(()=>this.bindOrSetMarkUniformBlock()),this._baseInstanceExt?t.push(()=>gf(this.gl,this.programInfo,this.vertexArrayInfo)):t.push(()=>this.gl.bindVertexArray(null)),t}render(e){const t=this.gl,i=()=>(this.markUniformInfo.uniforms.uSegmentBreaks[0]+1)*2;return this._baseInstanceExt?this.createRenderCallback((s,o)=>{this._baseInstanceExt.drawArraysInstancedBaseInstanceWEBGL(t.TRIANGLE_STRIP,0,i(),o,s)},e):this.createRenderCallback((s,o)=>{for(const r of Object.entries(this.bufferInfo.attribs)){const[a,l]=r;l.buffer&&l.numComponents&&l.divisor&&(l.offset=s*this.arrays[a].numComponents*this.bytesPerElement.get(a))}gf(t,this.programInfo,this.bufferInfo),t.drawArraysInstanced(t.TRIANGLE_STRIP,0,i(),o)},e)}}const yce=`in mediump vec2 vertexCoord; in lowp vec2 textureCoord; // Width of the text (all letters) @@ -2537,7 +2338,7 @@ void main(void) { setupPicking(); } -`,Jle=`uniform sampler2D uTexture; +`,wce=`uniform sampler2D uTexture; in vec2 vTexCoord; in float vEdgeFadeOpacity; @@ -2578,7 +2379,7 @@ void main() { fragColor = vPickingColor; } } -`,ece=`layout(std140) uniform Mark { +`,Cce=`layout(std140) uniform Mark { uniform mediump float uSdfNumerator; uniform mediump vec2 uD; // dx & dy @@ -2600,7 +2401,7 @@ void main() { #pragma markUniforms }; -`,tce={left:-1,center:0,right:1},ice={top:-1,middle:0,bottom:1,alphabetic:1};class nce extends O1{constructor(e){super(e),this.augmentDefaultProperties({x:.5,y:.5,x2:void 0,y2:void 0,text:"",size:11,color:"black",opacity:1,font:void 0,fontStyle:void 0,fontWeight:void 0,align:"center",baseline:"middle",dx:0,dy:0,angle:0,fitToBand:!1,squeeze:!0,paddingX:0,paddingY:0,flushX:!0,flushY:!0,logoLetters:!1,viewportEdgeFadeWidthTop:0,viewportEdgeFadeWidthRight:0,viewportEdgeFadeWidthBottom:0,viewportEdgeFadeWidthLeft:0,viewportEdgeFadeDistanceTop:-1/0,viewportEdgeFadeDistanceRight:-1/0,viewportEdgeFadeDistanceBottom:-1/0,viewportEdgeFadeDistanceLeft:-1/0}),this.font=this.properties.font?e.context.fontManager.getFont(this.properties.font,this.properties.fontStyle,this.properties.fontWeight):e.context.fontManager.getDefaultFont(),this.setupExprRefsNeedingGraphicsUpdate(["text","fitToBand","logoLetters"])}getAttributes(){return["uniqueId","facetIndex","x","x2","y","y2","color","size","opacity","angle"]}getSupportedChannels(){return[...super.getSupportedChannels(),"x2","y2","size","text","angle"]}fixEncoding(e){for(const t of Zm)this.properties.fitToBand&&DA(e,t);return e}async initializeGraphics(){await super.initializeGraphics(),this.createAndLinkShaders(Qle,Jle,[ece])}finalizeGraphicsInitialization(){super.finalizeGraphicsInitialization(),this.gl.useProgram(this.programInfo.program);const e=this.properties;this.registerMarkUniformValue("uSdfNumerator",{expr:"devicePixelRatio"},t=>{let i=.35;return this.properties.logoLetters&&(i/=2),this.font.metrics.common.base/(t/i)}),this.registerMarkUniformValue("uPaddingX",e.paddingX),this.registerMarkUniformValue("uPaddingY",e.paddingY),this.registerMarkUniformValue("uFlushX",e.flushX,t=>!!t),this.registerMarkUniformValue("uFlushY",e.flushY,t=>!!t),this.registerMarkUniformValue("uSqueeze",e.squeeze,t=>!!t),xb(this.markUniformInfo,{uAlign:[tce[e.align],ice[e.baseline]],uD:[e.dx,-e.dy],uLogoLetter:!!e.logoLetters,uViewportEdgeFadeWidth:[e.viewportEdgeFadeWidthTop,e.viewportEdgeFadeWidthRight,e.viewportEdgeFadeWidthBottom,e.viewportEdgeFadeWidthLeft],uViewportEdgeFadeDistance:[e.viewportEdgeFadeDistanceTop,e.viewportEdgeFadeDistanceRight,e.viewportEdgeFadeDistanceBottom,e.viewportEdgeFadeDistanceLeft]})}updateGraphicsData(){const e=this.unitView.getCollector();if(!e){console.debug("No collector");return}const t=e.getData(),i=this.encoding,s=this.encoders.text;let o=0;const r="format"in i.text?Ts(i.text.format):c=>c;for(const c of t){const d=r(s(c)),u=Ti(d)?d:d===null?"":""+d;o+=u&&u.length||0}const a=new vle({encoders:this.encoders,attributes:this.getAttributes(),properties:this.properties,fontMetrics:this.font.metrics,numCharacters:Math.max(o,this.properties.minBufferSize||1024)});a.addBatches(e.facetBatches);const l=a.toArrays();this.rangeMap.migrateEntries(l.rangeMap),this.updateBufferInfo(l)}prepareRender(e){const t=super.prepareRender(e);return t.push(()=>{wh(this.programInfo,{uTexture:this.font.texture})}),t.push(()=>this.bindOrSetMarkUniformBlock()),t.push(()=>uf(this.gl,this.programInfo,this.vertexArrayInfo)),t}render(e){const t=this.gl;return this.createRenderCallback((i,s)=>wL(t,this.vertexArrayInfo,t.TRIANGLES,s,i),e)}}const dF=1;function v4(){let n=[0,1],e=[0,1],t=1,i=1,s=0,o=0,r=.5,a=0;const c=d=>(d+r-n[0])/t*i+e[0];return c.invert=d=>(d-e[0])/i*t+n[0]-r,c.domain=function(d){if(arguments.length){n=ZQ(d),t=n[1]-n[0];const u=n[0]===0&&n[0]===0;if(ti/t,c.bandwidth=()=>c.step(),c.ticks=d=>{const u=c.align(),h=c.numberingOffset();return QC(n[0]-u+h,n[1]-u+h,Math.min(d,Math.ceil(t))).filter(Number.isInteger).map(f=>f-a)},c.tickFormat=(d,u)=>{if(u)throw new Error("Index scale's tickFormat does not support a specifier!");const f=df(n[0],n[1],Math.min(d,Math.ceil(t)))<1e5?Ts(","):Ts(".3s");return g=>f(g+a)},c.copy=()=>v4().domain(n).range(e).paddingInner(s).paddingOuter(o).numberingOffset(a),c}function sce(){const n=v4().numberingOffset(1);let e;n.genome=function(i){return arguments.length?(e=i,n):e},n.ticks=i=>{if(!e)return[];const s=n.domain(),o=n.numberingOffset(),[r,a]=[Math.max(s[0],0),Math.min(s[1],e.totalSize-1)].map(d=>e.toChromosome(d)),l=Math.max(1,df(s[0],s[1],i)),c=[];for(let d=r.index;d<=a.index;d++){const u=e.chromosomes[d],h=Math.max(u.continuousStart+l,s[0]-(s[0]-u.continuousStart)%l),f=Math.min(u.continuousEnd-l/4,s[1]+1);for(let g=h;g<=f;g+=l){const p=g-o;p>=s[0]&&p{if(!e)return;if(s)throw new Error("Locus scale's tickFormat does not support a specifier!");const o=n.domain(),r=o[1]-o[0],a=n.numberingOffset(),c=df(o[0],o[1],Math.min(i,Math.ceil(r)))<1e6?Ts(","):Ts(".3s"),d=u=>u-e.toChromosome(u).continuousStart;return u=>c(d(u)+a)};const t=n.copy;return n.copy=()=>t().genome(e),n}function oce(n){return n.type=="locus"}function gS(n,e,t){if(t=t||[],n.some(r=>r===null)){if(n.every(r=>r===null))return null;throw console.warn(n),new Error("Cannot merge objects with nulls!")}const i={},s=(r,a)=>r===a||cg(r)&&cg(a)||cg(r)&&a===!0||r===!0&&Os(a),o=r=>{for(let a in r){const l=r[a];if(!t.includes(a)&&l!==void 0)if(i[a]!==void 0&&!s(i[a],l))console.warn(`Conflicting property ${a} of ${e}: (${JSON.stringify(i[a])} and ${JSON.stringify(r[a])}). Using ${JSON.stringify(i[a])}.`);else{const c=i[a];if(cg(c))cg(l)&&(i[a]=gS([c,l],a));else if(cg(l)){if(!(c===!0||c===void 0))throw new Error("Bug in merge! Target is: "+c);i[a]=gS([{},l],a)}else i[a]=l}}};for(const r of n)o(r);return i}function cg(n){return Os(n)&&!Array.isArray(n)}/*! +`,Sce={left:-1,center:0,right:1},xce={top:-1,middle:0,bottom:1,alphabetic:1};class Lce extends B1{constructor(e){super(e),this.augmentDefaultProperties({x:.5,y:.5,x2:void 0,y2:void 0,text:"",size:11,color:"black",opacity:1,font:void 0,fontStyle:void 0,fontWeight:void 0,align:"center",baseline:"middle",dx:0,dy:0,angle:0,fitToBand:!1,squeeze:!0,paddingX:0,paddingY:0,flushX:!0,flushY:!0,logoLetters:!1,viewportEdgeFadeWidthTop:0,viewportEdgeFadeWidthRight:0,viewportEdgeFadeWidthBottom:0,viewportEdgeFadeWidthLeft:0,viewportEdgeFadeDistanceTop:-1/0,viewportEdgeFadeDistanceRight:-1/0,viewportEdgeFadeDistanceBottom:-1/0,viewportEdgeFadeDistanceLeft:-1/0}),this.font=this.properties.font?e.context.fontManager.getFont(this.properties.font,this.properties.fontStyle,this.properties.fontWeight):e.context.fontManager.getDefaultFont(),this.setupExprRefsNeedingGraphicsUpdate(["text","fitToBand","logoLetters"])}getAttributes(){return["uniqueId","facetIndex","x","x2","y","y2","color","size","opacity","angle"]}getSupportedChannels(){return[...super.getSupportedChannels(),"x2","y2","size","text","angle"]}fixEncoding(e){for(const t of e0)this.properties.fitToBand&&xA(e,t);return e}async initializeGraphics(){await super.initializeGraphics(),this.createAndLinkShaders(yce,wce,[Cce])}finalizeGraphicsInitialization(){super.finalizeGraphicsInitialization(),this.gl.useProgram(this.programInfo.program);const e=this.properties;this.registerMarkUniformValue("uSdfNumerator",{expr:"devicePixelRatio"},t=>{let i=.35;return this.properties.logoLetters&&(i/=2),this.font.metrics.common.base/(t/i)}),this.registerMarkUniformValue("uPaddingX",e.paddingX),this.registerMarkUniformValue("uPaddingY",e.paddingY),this.registerMarkUniformValue("uFlushX",e.flushX,t=>!!t),this.registerMarkUniformValue("uFlushY",e.flushY,t=>!!t),this.registerMarkUniformValue("uSqueeze",e.squeeze,t=>!!t),Db(this.markUniformInfo,{uAlign:[Sce[e.align],xce[e.baseline]],uD:[e.dx,-e.dy],uLogoLetter:!!e.logoLetters,uViewportEdgeFadeWidth:[e.viewportEdgeFadeWidthTop,e.viewportEdgeFadeWidthRight,e.viewportEdgeFadeWidthBottom,e.viewportEdgeFadeWidthLeft],uViewportEdgeFadeDistance:[e.viewportEdgeFadeDistanceTop,e.viewportEdgeFadeDistanceRight,e.viewportEdgeFadeDistanceBottom,e.viewportEdgeFadeDistanceLeft]})}updateGraphicsData(){const e=this.unitView.getCollector();if(!e){console.debug("No collector");return}const t=e.getData(),i=this.encoding,s=this.encoders.text;let o=0;const r="format"in i.text?Is(i.text.format):c=>c;for(const c of t){const d=r(s(c)),u=Ti(d)?d:d===null?"":""+d;o+=u&&u.length||0}const a=new zle({encoders:this.encoders,attributes:this.getAttributes(),properties:this.properties,fontMetrics:this.font.metrics,numCharacters:Math.max(o,this.properties.minBufferSize||1024)});a.addBatches(e.facetBatches);const l=a.toArrays();this.rangeMap.migrateEntries(l.rangeMap),this.updateBufferInfo(l)}prepareRender(e){const t=super.prepareRender(e);return t.push(()=>{wh(this.programInfo,{uTexture:this.font.texture})}),t.push(()=>this.bindOrSetMarkUniformBlock()),t.push(()=>gf(this.gl,this.programInfo,this.vertexArrayInfo)),t}render(e){const t=this.gl;return this.createRenderCallback((i,s)=>gL(t,this.vertexArrayInfo,t.TRIANGLES,s,i),e)}}const aF=1;function _4(){let n=[0,1],e=[0,1],t=1,i=1,s=0,o=0,r=.5,a=0;const c=d=>(d+r-n[0])/t*i+e[0];return c.invert=d=>(d-e[0])/i*t+n[0]-r,c.domain=function(d){if(arguments.length){n=aJ(d),t=n[1]-n[0];const u=n[0]===0&&n[0]===0;if(ti/t,c.bandwidth=()=>c.step(),c.ticks=d=>{const u=c.align(),h=c.numberingOffset();return jC(n[0]-u+h,n[1]-u+h,Math.min(d,Math.ceil(t))).filter(Number.isInteger).map(f=>f-a)},c.tickFormat=(d,u)=>{if(u)throw new Error("Index scale's tickFormat does not support a specifier!");const f=ff(n[0],n[1],Math.min(d,Math.ceil(t)))<1e5?Is(","):Is(".3s");return g=>f(g+a)},c.copy=()=>_4().domain(n).range(e).paddingInner(s).paddingOuter(o).numberingOffset(a),c}function Dce(){const n=_4().numberingOffset(1);let e;n.genome=function(i){return arguments.length?(e=i,n):e},n.ticks=i=>{if(!e)return[];const s=n.domain(),o=n.numberingOffset(),[r,a]=[Math.max(s[0],0),Math.min(s[1],e.totalSize-1)].map(d=>e.toChromosome(d)),l=Math.max(1,ff(s[0],s[1],i)),c=[];for(let d=r.index;d<=a.index;d++){const u=e.chromosomes[d],h=Math.max(u.continuousStart+l,s[0]-(s[0]-u.continuousStart)%l),f=Math.min(u.continuousEnd-l/4,s[1]+1);for(let g=h;g<=f;g+=l){const p=g-o;p>=s[0]&&p{if(!e)return;if(s)throw new Error("Locus scale's tickFormat does not support a specifier!");const o=n.domain(),r=o[1]-o[0],a=n.numberingOffset(),c=ff(o[0],o[1],Math.min(i,Math.ceil(r)))<1e6?Is(","):Is(".3s"),d=u=>u-e.toChromosome(u).continuousStart;return u=>c(d(u)+a)};const t=n.copy;return n.copy=()=>t().genome(e),n}function kce(n){return n.type=="locus"}function aS(n,e,t){if(t=t||[],n.some(r=>r===null)){if(n.every(r=>r===null))return null;throw console.warn(n),new Error("Cannot merge objects with nulls!")}const i={},s=(r,a)=>r===a||hg(r)&&hg(a)||hg(r)&&a===!0||r===!0&&Ms(a),o=r=>{for(let a in r){const l=r[a];if(!t.includes(a)&&l!==void 0)if(i[a]!==void 0&&!s(i[a],l))console.warn(`Conflicting property ${a} of ${e}: (${JSON.stringify(i[a])} and ${JSON.stringify(r[a])}). Using ${JSON.stringify(i[a])}.`);else{const c=i[a];if(hg(c))hg(l)&&(i[a]=aS([c,l],a));else if(hg(l)){if(!(c===!0||c===void 0))throw new Error("Bug in merge! Target is: "+c);i[a]=aS([{},l],a)}else i[a]=l}}};for(const r of n)o(r);return i}function hg(n){return Ms(n)&&!Array.isArray(n)}/*! * Adapted from vega-encode: * https://github.com/vega/vega/blob/master/packages/vega-encode/src/ticks.js * @@ -2608,7 +2409,7 @@ void main() { * All rights reserved. * * BSD-3-Clause License: https://github.com/vega/vega-lite/blob/master/LICENSE - */function XH(n,e,t){return to(e)&&t!=null&&(e=Math.min(e,~~(YC(n.domain())/t)||1)),Os(e)&&(e.step,e=e.interval),e}function QH(n,e,t){var i=n.range(),s=Math.floor(i[0]),o=Math.ceil(sa(i));if(s>o&&(i=o,o=s,s=i),e=e.filter(function(a){return a=n(a),s<=a&&a<=o}),t>0&&e.length>1){for(var r=[e[0],sa(e)];e.length>t&&e.length>=3;)e=e.filter(function(a,l){return!(l%2)});e.length<3&&(e=r)}return e}function rce(n,e){return n.bins?QH(n,ace(n.bins,e)):n.ticks?n.ticks(e):n.domain()}function ace(n,e){var t=n.length,i=~~(t/(e||t));return i<2?n.slice():n.filter(function(s,o){return!(o%i)})}function lce(n,e,t){var i=n.tickFormat?n.tickFormat(e,t):t?Ts(t):String;if(lH(n.type)){var s=dce(t);i=n.bins?s:cce(i,s)}return i}function cce(n,e){return function(t){return n(t)?e(t):""}}function dce(n){var e=im(n||",");if(e.precision==null){switch(e.precision=12,e.type){case"%":e.precision-=2;break;case"e":e.precision-=1;break}return uce(Ts(e),Ts(".1f")(1)[1])}else return Ts(e)}function uce(n,e){return function(t){var i=n(t),s=i.indexOf(e),o,r;if(s<0)return i;for(o=hce(i,s),r=os;)if(i[o]!=="0"){++o;break}return i.slice(0,o)+r}}function hce(n,e){var t=n.lastIndexOf("e"),i;if(t>0)return t;for(t=n.length;--t>e;)if(i=n.charCodeAt(t),i>=48&&i<=57)return t+1}/*! + */function ZH(n,e,t){return Qs(e)&&t!=null&&(e=Math.min(e,~~(HC(n.domain())/t)||1)),Ms(e)&&(e.step,e=e.interval),e}function XH(n,e,t){var i=n.range(),s=Math.floor(i[0]),o=Math.ceil(ia(i));if(s>o&&(i=o,o=s,s=i),e=e.filter(function(a){return a=n(a),s<=a&&a<=o}),t>0&&e.length>1){for(var r=[e[0],ia(e)];e.length>t&&e.length>=3;)e=e.filter(function(a,l){return!(l%2)});e.length<3&&(e=r)}return e}function Ece(n,e){return n.bins?XH(n,Ace(n.bins,e)):n.ticks?n.ticks(e):n.domain()}function Ace(n,e){var t=n.length,i=~~(t/(e||t));return i<2?n.slice():n.filter(function(s,o){return!(o%i)})}function Ice(n,e,t){var i=n.tickFormat?n.tickFormat(e,t):t?Is(t):String;if(aH(n.type)){var s=Nce(t);i=n.bins?s:Tce(i,s)}return i}function Tce(n,e){return function(t){return n(t)?e(t):""}}function Nce(n){var e=om(n||",");if(e.precision==null){switch(e.precision=12,e.type){case"%":e.precision-=2;break;case"e":e.precision-=1;break}return Rce(Is(e),Is(".1f")(1)[1])}else return Is(e)}function Rce(n,e){return function(t){var i=n(t),s=i.indexOf(e),o,r;if(s<0)return i;for(o=Mce(i,s),r=os;)if(i[o]!=="0"){++o;break}return i.slice(0,o)+r}}function Mce(n,e){var t=n.lastIndexOf("e"),i;if(t>0)return t;for(t=n.length;--t>e;)if(i=n.charCodeAt(t),i>=48&&i<=57)return t+1}/*! * Adapted from vega-encode: * https://github.com/vega/vega/blob/master/packages/vega-encode/src/Scale.js * @@ -2616,14 +2417,14 @@ void main() { * All rights reserved. * * BSD-3-Clause License: https://github.com/vega/vega-lite/blob/master/LICENSE - */const fce="locus",gce="index";var pce=5;function mce(n){const e=n.type;return!n.bins&&(e===cm||e===C1||e===S1)}function JH(n){return as(n)&&![Za,gce,fce].includes(n)}function e$(n){return n||{warn:(e,...t)=>console.warn(e,...t)}}var _ce=ZC(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma","zoom","fp64","name"]);function t$(n,e,t){t=e$(t);for(const i in n)if(!_ce[i]){if(i==="padding"&&JH(e.type))continue;gr(e[i])?e[i](n[i]):t.warn("Unsupported scale property: "+i)}Lce(e,n,xce(e,n,wce(e,n,t)))}function bce(n,e){const t=vce(n),i=ii(t);if(!i)throw new Error("Unknown scale type: "+t);const s=i();return!n.domain&&as(s.type)&&(n.domain=[0,0]),t$(n,s,e),s}function vce(n){var e=n.type,t="",i;return e===Za?Za+"-"+cm:(yce(n)&&(i=n.rawDomain?n.rawDomain.length:n.domain?n.domain.length+ +(n.domainMid!=null):0,t=i===2?Za+"-":i===3?Ym+"-":""),(t+e||cm).toLowerCase())}function yce(n){const e=n.type;return as(e)&&e!==eH&&e!==tH&&(n.scheme||n.range&&n.range.length&&n.range.every(Ti))}function wce(n,e,t){if(!n.domain)return 0;t=e$(t);var i=Cce(n,e.domainRaw,t);if(i>-1)return i;var s=e.domain,o=n.type,r=e.zero||e.zero===void 0&&mce(n),a,l;return s?(JH(o)&&e.padding&&s[0]!==sa(s)&&(s=Sce(o,s,e.range,e.padding,e.exponent,e.constant)),(r||e.domainMin!=null||e.domainMax!=null||e.domainMid!=null)&&(a=(s=s.slice()).length-1||1,r&&(s[0]>0&&(s[0]=0),s[a]<0&&(s[a]=0)),e.domainMin!=null&&(s[0]=e.domainMin),e.domainMax!=null&&(s[a]=e.domainMax),e.domainMid!=null&&(l=e.domainMid,(ls[a])&&t.warn("Scale domainMid exceeds domain min or max.",l),s.splice(a,0,l))),n.domain(i$(o,s,t)),o===r4&&n.unknown(e.domainImplicit?aA:void 0),e.nice&&n.nice&&n.nice(e.nice!==!0&&XH(n,e.nice)||null),s.length):0}function Cce(n,e,t){return e?(n.domain(i$(n.type,e,t)),e.length):-1}function Sce(n,e,t,i,s,o){t??(t=[0,1]);var r=Math.abs(sa(t)-t[0]),a=r/(r-2*i),l=n===Gd?VW(e,null,a):n===S1?zE(e,null,a,.5):n===C1?zE(e,null,a,s||1):n===AL?_Q(e,null,a,o||1):WW(e,null,a);return e=e.slice(),e[0]=l[0],e[e.length-1]=l[1],e}function i$(n,e,t){if(lH(n)){var i=Math.abs(e.reduce(function(s,o){return s+(o<0?-1:o>0?1:0)},0));i!==e.length&&t.warn("Log scale domain includes zero: "+mM(e))}return e}function xce(n,e,t){let i=e.bins;if(i&&!Ps(i)){const s=(i.start==null||i.stop==null)&&n.domain(),o=i.start==null?s[0]:i.start,r=i.stop==null?sa(s):i.stop,a=i.step;a||Nn("Scale bins parameter missing step property."),i=db(o,r+a,a)}return i?n.bins=i:n.bins&&delete n.bins,n.type===a4&&(i?!e.domain&&!e.domainRaw&&(n.domain(i),t=i.length):n.bins=n.domain()),t}function Lce(n,e,t){var i=n.type,s=e.round||!1,o=e.range;if(e.rangeStep!=null)o=Dce(i,e,t);else if(e.scheme&&(o=kce(i,e,t),gr(o))){if(n.interpolator)return n.interpolator(o);Nn(`Scale type ${i} does not support interpolating color schemes.`)}if(o&&IL(i))return n.interpolator(TL(AA(o,e.reverse),e.interpolate,e.interpolateGamma));o&&e.interpolate&&n.interpolate?n.interpolate(cH(e.interpolate,e.interpolateGamma)):gr(n.round)?n.round(s):gr(n.rangeRound)&&n.interpolate(s?y1:_u),o&&n.range(AA(o,e.reverse))}function Dce(n,e,t){n!==sH&&n!==bA&&Nn("Only band and point scales support rangeStep.");var i=(e.paddingOuter!=null?e.paddingOuter:e.padding)||0,s=n===bA?1:(e.paddingInner!=null?e.paddingInner:e.padding)||0;return[0,e.rangeStep*o4(t,s,i)]}function kce(n,e,t){var i=e.schemeExtent,s,o;return Ps(e.scheme)?o=TL(e.scheme,e.interpolate,e.interpolateGamma):(s=e.scheme.toLowerCase(),o=c4(s),o||Nn(`Unrecognized scheme name: ${e.scheme}`)),t=n===nH?t+1:n===a4?t-1:n===_A||n===iH?+e.schemeCount||pce:t,IL(n)?uF(o,i,e.reverse):gr(o)?dre(uF(o,i),t):n===r4?o:o.slice(0,t)}function uF(n,e,t){return gr(n)&&(e||t)?cre(n,AA(e||[0,1],t)):n}function AA(n,e){return e?n.slice().reverse():n}const hF=Ts(",d");function Ece(n,e){return n.chrom+":"+hF(Math.floor(n.pos+1))+"-"+(n.chrom!=e.chrom?e.chrom+":":"")+hF(Math.ceil(e.pos))}const Ace=`chr3R 32079331 + */const Pce="locus",Oce="index";var Fce=5;function Bce(n){const e=n.type;return!n.bins&&(e===hm||e===x1||e===L1)}function QH(n){return os(n)&&![Ya,Oce,Pce].includes(n)}function JH(n){return n||{warn:(e,...t)=>console.warn(e,...t)}}var Wce=$C(["set","modified","clear","type","scheme","schemeExtent","schemeCount","domain","domainMin","domainMid","domainMax","domainRaw","domainImplicit","nice","zero","bins","range","rangeStep","round","reverse","interpolate","interpolateGamma","zoom","fp64","name"]);function e$(n,e,t){t=JH(t);for(const i in n)if(!Wce[i]){if(i==="padding"&&QH(e.type))continue;fr(e[i])?e[i](n[i]):t.warn("Unsupported scale property: "+i)}Gce(e,n,qce(e,n,$ce(e,n,t)))}function Vce(n,e){const t=zce(n),i=ti(t);if(!i)throw new Error("Unknown scale type: "+t);const s=i();return!n.domain&&os(s.type)&&(n.domain=[0,0]),e$(n,s,e),s}function zce(n){var e=n.type,t="",i;return e===Ya?Ya+"-"+hm:(Hce(n)&&(i=n.rawDomain?n.rawDomain.length:n.domain?n.domain.length+ +(n.domainMid!=null):0,t=i===2?Ya+"-":i===3?Jm+"-":""),(t+e||hm).toLowerCase())}function Hce(n){const e=n.type;return os(e)&&e!==Jz&&e!==eH&&(n.scheme||n.range&&n.range.length&&n.range.every(Ti))}function $ce(n,e,t){if(!n.domain)return 0;t=JH(t);var i=Uce(n,e.domainRaw,t);if(i>-1)return i;var s=e.domain,o=n.type,r=e.zero||e.zero===void 0&&Bce(n),a,l;return s?(QH(o)&&e.padding&&s[0]!==ia(s)&&(s=jce(o,s,e.range,e.padding,e.exponent,e.constant)),(r||e.domainMin!=null||e.domainMax!=null||e.domainMid!=null)&&(a=(s=s.slice()).length-1||1,r&&(s[0]>0&&(s[0]=0),s[a]<0&&(s[a]=0)),e.domainMin!=null&&(s[0]=e.domainMin),e.domainMax!=null&&(s[a]=e.domainMax),e.domainMid!=null&&(l=e.domainMid,(ls[a])&&t.warn("Scale domainMid exceeds domain min or max.",l),s.splice(a,0,l))),n.domain(t$(o,s,t)),o===s4&&n.unknown(e.domainImplicit?oA:void 0),e.nice&&n.nice&&n.nice(e.nice!==!0&&ZH(n,e.nice)||null),s.length):0}function Uce(n,e,t){return e?(n.domain(t$(n.type,e,t)),e.length):-1}function jce(n,e,t,i,s,o){t??(t=[0,1]);var r=Math.abs(ia(t)-t[0]),a=r/(r-2*i),l=n===Kd?WW(e,null,a):n===L1?WE(e,null,a,.5):n===x1?WE(e,null,a,s||1):n===CL?EQ(e,null,a,o||1):BW(e,null,a);return e=e.slice(),e[0]=l[0],e[e.length-1]=l[1],e}function t$(n,e,t){if(aH(n)){var i=Math.abs(e.reduce(function(s,o){return s+(o<0?-1:o>0?1:0)},0));i!==e.length&&t.warn("Log scale domain includes zero: "+gM(e))}return e}function qce(n,e,t){let i=e.bins;if(i&&!cs(i)){const s=(i.start==null||i.stop==null)&&n.domain(),o=i.start==null?s[0]:i.start,r=i.stop==null?ia(s):i.stop,a=i.step;a||In("Scale bins parameter missing step property."),i=hb(o,r+a,a)}return i?n.bins=i:n.bins&&delete n.bins,n.type===o4&&(i?!e.domain&&!e.domainRaw&&(n.domain(i),t=i.length):n.bins=n.domain()),t}function Gce(n,e,t){var i=n.type,s=e.round||!1,o=e.range;if(e.rangeStep!=null)o=Kce(i,e,t);else if(e.scheme&&(o=Yce(i,e,t),fr(o))){if(n.interpolator)return n.interpolator(o);In(`Scale type ${i} does not support interpolating color schemes.`)}if(o&&SL(i))return n.interpolator(xL(kA(o,e.reverse),e.interpolate,e.interpolateGamma));o&&e.interpolate&&n.interpolate?n.interpolate(lH(e.interpolate,e.interpolateGamma)):fr(n.round)?n.round(s):fr(n.rangeRound)&&n.interpolate(s?C1:bu),o&&n.range(kA(o,e.reverse))}function Kce(n,e,t){n!==nH&&n!==mA&&In("Only band and point scales support rangeStep.");var i=(e.paddingOuter!=null?e.paddingOuter:e.padding)||0,s=n===mA?1:(e.paddingInner!=null?e.paddingInner:e.padding)||0;return[0,e.rangeStep*n4(t,s,i)]}function Yce(n,e,t){var i=e.schemeExtent,s,o;return cs(e.scheme)?o=xL(e.scheme,e.interpolate,e.interpolateGamma):(s=e.scheme.toLowerCase(),o=a4(s),o||In(`Unrecognized scheme name: ${e.scheme}`)),t=n===iH?t+1:n===o4?t-1:n===pA||n===tH?+e.schemeCount||Fce:t,SL(n)?lF(o,i,e.reverse):fr(o)?Tre(lF(o,i),t):n===s4?o:o.slice(0,t)}function lF(n,e,t){return fr(n)&&(e||t)?Ire(n,kA(e||[0,1],t)):n}function kA(n,e){return e?n.slice().reverse():n}const cF=Is(",d");function Zce(n,e){return n.chrom+":"+cF(Math.floor(n.pos+1))+"-"+(n.chrom!=e.chrom?e.chrom+":":"")+cF(Math.ceil(e.pos))}const Xce=`chr3R 32079331 chr3L 28110227 chr2R 25286936 chrX 23542271 chr2L 23513712 chrY 3667352 chr4 1348131 -chrM 19524`,Ice=`chr1 247249719 +chrM 19524`,Qce=`chr1 247249719 chr2 242951149 chr3 199501827 chr4 191273063 @@ -2647,7 +2448,7 @@ chr21 46944323 chr22 49691432 chrX 154913754 chrY 57772954 -chrM 16571`,Tce=`chr1 249250621 +chrM 16571`,Jce=`chr1 249250621 chr2 243199373 chr3 198022430 chr4 191154276 @@ -2671,7 +2472,7 @@ chr21 48129895 chr22 51304566 chrX 155270560 chrY 59373566 -chrM 16571`,Nce=`chr1 248956422 +chrM 16571`,ede=`chr1 248956422 chr2 242193529 chr3 198295559 chr4 190214555 @@ -2695,7 +2496,7 @@ chr21 46709983 chr22 50818468 chrX 156040895 chrY 57227415 -chrM 16569`,Rce=`chr1 197195432 +chrM 16569`,tde=`chr1 197195432 chr2 181748087 chr3 159599783 chr4 155630120 @@ -2716,7 +2517,7 @@ chr18 90772031 chr19 61342430 chrX 166650296 chrY 15902555 -chrM 16299`,Mce=`chr1 195471971 +chrM 16299`,ide=`chr1 195471971 chr2 182113224 chr3 160039680 chr4 156508116 @@ -2737,12 +2538,12 @@ chr18 90702639 chr19 61431566 chrX 171031299 chrY 91744698 -chrM 16299`,fF={dm6:Ace,hg18:Ice,hg19:Tce,hg38:Nce,mm9:Rce,mm10:Mce};function Pce(n){if(!(n in fF))throw new Error(`Unknown assembly: ${n}`);return fF[n].split(` -`).map(e=>{const t=e.split(" ");return{name:t[0],size:parseInt(t[1])}})}const Oce=/^([A-Za-z]+:)?\/\//;function Nb(n,e){if(e&&Oce.test(e))return e;const t=typeof n=="function"?n():n;if(!t)return e;if(!e)return t;if(/[#?]/.test(t))throw new Error(`Cannot append to a url with query or hash. Append: ${e}, base: ${t}`);return n$(t)+e}function n$(n){const e=n.replace(/[^/]*$/,"");return e===""?void 0:e.endsWith("://")?n+"/":e}class Fce{constructor(e){if(this.config={name:"custom",...e},"baseUrl"in e)throw new Error("The `baseUrl` property in genome config has been removed in GenomeSpy v0.52.0. Use `url` instead. See https://genomespy.app/docs/genomic-data/genomic-coordinates/.");if(!y4(e))throw new Error("Not a genome configuration: "+JSON.stringify(e));if(this.chromosomes=[],this.cumulativeChromPositions=new Map,this.chromosomesByName=new Map,this.startByIndex=[],this.totalSize=0,o$(this.config))this.setChromSizes(this.config.contigs);else if(!IA(this.config)){const t=Pce(this.config.name);if(t)this.setChromSizes(t);else throw new Error(`Unknown genome: ${this.config.name}. Please provide contigs or a URL. See https://genomespy.app/docs/genomic-data/genomic-coordinates/.`)}}get name(){return this.config.name}async load(e){if(IA(this.config))try{const t=Nb(e,this.config.url),i=await fetch(t);if(!i.ok)throw new Error(`${i.status} ${i.statusText}`);this.setChromSizes(Bce(await i.text()))}catch(t){throw new Error(`Could not load chrom sizes: ${this.config.url}. Reason: ${t.message}`)}}hasChrPrefix(){return this.chromosomes.some(e=>e.name.startsWith("chr"))}setChromSizes(e){let t=0;this.startByIndex=[0];for(let i=0;ithis.totalSize)return;e=Math.floor(e);const t=$d(this.startByIndex,e)-1;if(t>0&&t<=this.chromosomes.length)return this.chromosomes[t-1]}toChromosomal(e){const t=this.toChromosome(e);if(t)return{chrom:t.name,pos:Math.floor(e)-t.continuousStart}}getChromosome(e){return this.chromosomesByName.get(e)}formatInterval(e){return Ece(...this.toChromosomalInterval(e))}toChromosomalInterval(e){const t=this.toChromosomal(e[0]+.5),i=this.toChromosomal(e[1]-.5);return i.pos+=1,[t,i]}toContinuousInterval(e){var s;let[t,i]=e;return i||(i=t),[this.toContinuous(t.chrom,t.pos??0),this.toContinuous(i.chrom,i.pos??((s=this.chromosomesByName.get(i.chrom))==null?void 0:s.size))]}toDiscreteChromosomeIntervals(e){const t=e[0],i=e[1],s=[];if(t.chrom===i.chrom)s.push({chrom:t.chrom,startPos:t.pos,endPos:i.pos});else{const o=this.chromosomes.findIndex(a=>a.name===t.chrom),r=this.chromosomes.findIndex(a=>a.name===i.chrom);s.push({chrom:t.chrom,startPos:t.pos,endPos:this.chromosomes[o].size});for(let a=o+1;aa===void 0)){const a=this.getChromosome(i);return a?[a.continuousStart,a.continuousEnd]:void 0}const s=t[3]||i,o=parseInt(t[2].replace(/,/g,"")),r=t[4]!==void 0?parseInt(t[4].replace(/,/g,"")):o;return[this.toContinuous(i,o-1),this.toContinuous(s,r)]}}}function Bce(n){return OQ(n).map(([e,t])=>({name:e,size:parseInt(t)}))}function s$(n){return Os(n)&&"chrom"in n}function Wce(n){return n.every(s$)}function y4(n){return Os(n)&&("name"in n||IA(n)||o$(n))}function IA(n){return y4(n)&&"url"in n}function o$(n){return y4(n)&&"contigs"in n}class F1 extends Array{constructor(){super(),this.type=void 0}extend(e){return this}extendAll(e){if(e instanceof F1&&e.type!=this.type)throw new Error(`Cannot combine different types of domains: ${this.type} and ${e.type}`);for(const t of e)this.extend(t);return this}extendAllWithAccessor(e,t){for(const i of e)this.extend(t(i));return this}}class jk extends F1{constructor(){super(),this.type="quantitative"}extend(e){return e==null||Number.isNaN(e)?this:(e=+e,this.length?ethis[1]&&(this[1]=e):(this.push(e),this.push(e)),this)}}class r$ extends F1{constructor(){super(),this.type="ordinal",this.uniqueValues=new Set}extend(e){return e==null||Number.isNaN(e)?this:(this.uniqueValues.has(e)||(this.uniqueValues.add(e),this.push(e)),this)}}class a$ extends r${constructor(){super(),this.type="nominal"}}class Vce extends F1{constructor(e){super();let t=0;for(let i=1;ithis.push(i))}extend(e){if(this.includes(e))return this;throw new Error("Piecewise domains are immutable and cannot be unioned!")}}const gF={quantitative:jk,index:jk,locus:jk,nominal:a$,ordinal:r$};function l$(n,e){if(n=="quantitative"&&zce(e)){const t=new Vce(e);return t.type=n,t}else if(gF[n]){const t=new gF[n];return t.type=n,e&&t.extendAll(e),t}throw new Error("Unknown type: "+n)}function zce(n){return n&&n.length>0&&n.length!=2&&n.every(e=>typeof e=="number")}function Hce(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}function $ce(n,e,t){return n*Math.pow(e/n,t)}ii("index",v4,["continuous"]);ii("locus",sce,["continuous"]);ii("null",_4,[]);const pF="quantitative",c$="ordinal",d$="nominal",u$="locus",Uce="index";var Ol,Bp,No,Kv,lt,TA,NA,Dl,RA,h$,f$,MA,PA,oC,OA,Qu,FA,g$;class jce{constructor(e){Oe(this,lt);Oe(this,Ol);Oe(this,Bp,{domain:new Set,range:new Set});Oe(this,No);Oe(this,Kv,new Set);this.channel=e,this.members=[],this.type=null,this.name=void 0}addEventListener(e,t){X(this,Bp)[e].add(t)}removeEventListener(e,t){X(this,Bp)[e].delete(t)}addMember(e){var r;const{channel:t,channelDef:i}=e,s=i.type,o=(r=i==null?void 0:i.scale)==null?void 0:r.name;if(o){if(this.name!==void 0&&o!=this.name)throw new Error(`Shared scales have conflicting names: "${o}" vs. "${this.name}"!`);this.name=o}if(!this.type)this.type=s;else if(s!==this.type&&!TH(t))throw new Error(`Can not use shared scale for different data types: ${this.type} vs. ${s}. Use "resolve: independent" for channel ${this.channel}`);this.members.push(e)}getDataDomain(){return this.members.map(e=>{var t;return(t=e.dataDomainSource)==null?void 0:t.call(e,e.channel,this.type)}).filter(e=>!!e).reduce((e,t)=>e.extendAll(t))}reconfigure(){const e=X(this,No);if(!e||e.type=="null")return;const t=Le(this,lt,h$).call(this),i=e.domain(),s=Le(this,lt,MA).call(this,!0);if(t$({...s,range:void 0},e),e.props=s,Le(this,lt,PA).call(this),as(e.type)&&ut(this,Ol,Le(this,lt,FA).call(this)),!t){Le(this,lt,Dl).call(this,"domain");return}const o=e.domain();iS(o,i)||(this.isZoomable()?e.domain(i):Le(this,lt,Qu).call(this)?(e.domain(i),this.zoomTo(o,500)):Le(this,lt,Dl).call(this,"domain"))}get scale(){if(X(this,No))return X(this,No);const e=Le(this,lt,MA).call(this),t=bce({...e,range:void 0});t.props=e,"unknown"in t&&t.unknown(null),ut(this,No,t),Le(this,lt,PA).call(this),oce(t)&&t.genome(this.getGenome()),as(t.type)&&ut(this,Ol,Le(this,lt,FA).call(this));const i=t.range;if(i){const s=()=>Le(this,lt,Dl).call(this,"range");t.range=function(o){if(arguments.length)i(o),s();else return i()},s()}return t}getDomain(){return this.scale.domain()}getComplexDomain(){var e;return((e=this.getGenome())==null?void 0:e.toChromosomalInterval(this.getDomain()))??this.getDomain()}isZoomed(){return Le(this,lt,Qu).call(this)&&iS(Le(this,lt,oC).call(this),this.getDomain())}isZoomable(){return Le(this,lt,Qu).call(this)&&!!this.scale.props.zoom}zoom(e,t,i){if(!Le(this,lt,Qu).call(this))return!1;const s=this.scale,o=s.domain();let r=[...o],a=s.invert(t);switch(s.props.reverse&&(i=-i),"align"in s&&(a+=s.align()),s.type){case"linear":case"index":case"locus":r=gQ(r,i||0),r=WW(r,a,e);break;case"log":r=pQ(r,i||0),r=VW(r,a,e);break;case"pow":case"sqrt":{const l=s;r=mQ(r,i||0,l.exponent()),r=zE(r,a,e,l.exponent());break}default:throw new Error("Zooming is not implemented for: "+s.type)}return X(this,Ol)&&(r=bQ(r,X(this,Ol)[0],X(this,Ol)[1])),[0,1].some(l=>r[l]!=o[l])?(s.domain(r),Le(this,lt,Dl).call(this,"domain"),!0):!1}async zoomTo(e,t=!1){if(g1(t)&&(t=t?700:0),!Le(this,lt,Qu).call(this))throw new Error("Not a zoomable scale!");const i=this.fromComplexInterval(e),s=X(this,lt,NA).animator,o=this.scale,r=o.domain();if(t>0&&r.length==2){const a=r[1]-r[0],l=i[1]-i[0],c=r[0]+a/2,d=i[0]+l/2,u=r[0]==i[0],h=r[1]==i[1];await s.transition({duration:t,easingFunction:Hce,onUpdate:f=>{const g=$ce(a,l,f),p=a==l?f:(a-g)/(a-l),_=p*d+(1-p)*c,v=[u?r[0]:_-g/2,h?r[1]:_+g/2];o.domain(v),Le(this,lt,Dl).call(this,"domain")}}),o.domain(i),Le(this,lt,Dl).call(this,"domain")}else o.domain(i),s==null||s.requestRender(),Le(this,lt,Dl).call(this,"domain")}resetZoom(){if(!Le(this,lt,Qu).call(this))throw new Error("Not a zoomable scale!");const e=this.getDomain(),t=Le(this,lt,oC).call(this);return[0,1].some(i=>t[i]!=e[i])?(X(this,No).domain(t),Le(this,lt,Dl).call(this,"domain"),!0):!1}getZoomLevel(){return this.isZoomable()?YC(X(this,Ol))/YC(this.scale.domain()):1}getAxisLength(){if(this.channel!=="x"&&this.channel!=="y")throw new Error("Axis length is only defined for x and y channels!");const e=this.members.map(t=>{var i;return(i=t.view.coords)==null?void 0:i[this.channel==="x"?"width":"height"]}).filter(t=>t>0);return e.length?e.reduce((t,i)=>Math.min(t,i),1e4):0}getGenome(){var t;if(this.type!=="locus")return;const e=(t=X(this,lt,NA).genomeStore)==null?void 0:t.getGenome();if(!e)throw new Error("No genome has been defined!");return e}invertToComplex(e){const t=this.scale;if("invert"in t){const i=t.invert(e);return this.toComplex(i)}else throw new Error("The scale does not support inverting!")}toComplex(e){const t=this.getGenome();return t?t.toChromosomal(e):e}fromComplex(e){return s$(e)?this.getGenome().toContinuous(e.chrom,e.pos):e}fromComplexInterval(e){return this.type==="locus"&&Wce(e)?this.getGenome().toContinuousInterval(e):e}}Ol=new WeakMap,Bp=new WeakMap,No=new WeakMap,Kv=new WeakMap,lt=new WeakSet,TA=function(){return this.members[0].view},NA=function(){return X(this,lt,TA).context},Dl=function(e){for(const t of X(this,Bp)[e].values())t({type:e,scaleResolution:this})},RA=function(){return!!Le(this,lt,OA).call(this)},h$=function(){const e=X(this,No);if(!e)return!1;const t=e.domain();return as(e.type)?t.length>2||t.length==2&&(t[0]!==0||t[1]!==0):t.length>0},f$=function(){const e=this.members.map(t=>t.channelDef.scale).filter(t=>t!==void 0);return gS(e,"scale",["domain"])},MA=function(e=!1){const t=Le(this,lt,f$).call(this);if(t===null||t.type=="null")return{type:"null"};const i={...Le(this,lt,g$).call(this,this.type),...t};i.type||(i.type=qce(this.channel,this.type));const s=Le(this,lt,oC).call(this,e);return s&&s.length>0?i.domain=s:Kd(i.type)&&(i.domain=new a$),!i.domain&&i.domainMid!==void 0&&(i.domain=[i.domainMin??0,i.domainMax??1]),this.channel=="y"&&Kd(i.type)&&i.reverse==null&&(i.reverse=!0),i.range&&i.scheme&&delete i.scheme,!("zoom"in i)&&["index","locus"].includes(i.type)&&(i.zoom=!0),Gce(i,this.channel),i},PA=function(){const e=X(this,No).props,t=e.range;if(X(this,Kv).forEach(s=>s.invalidate()),!t||!Ps(t))return;const i=(s,o)=>o?s.slice().reverse():s;if(t.some(Gs)){let s;const o=()=>{X(this,No).range(i(s.map(r=>r()),e.reverse))};s=t.map(r=>{if(Gs(r)){const a=X(this,lt,TA).paramMediator.createExpression(r.expr);return a.addListener(o),X(this,Kv).add(a),()=>a(null)}else return()=>r}),o()}else X(this,No).range(i(t,e.reverse))},oC=function(e=!1){return Le(this,lt,OA).call(this)??(this.type==u$?this.getGenome().getExtent():e?this.getDataDomain():[])},OA=function(){const e=this.members.map(t=>t.channelDef).filter(t=>{var i;return(i=t.scale)==null?void 0:i.domain}).map(t=>l$(t.type,this.fromComplexInterval(t.scale.domain)));if(e.length>0)return e.reduce((t,i)=>t.extendAll(i))},Qu=function(){const e=this.scale.type;return as(e)},FA=function(){const e=this.scale.props,t=e.zoom;if(Kce(t)&&Ps(t.extent))return this.fromComplexInterval(t.extent);if(t)return e.type=="locus"?this.getGenome().getExtent():X(this,No).domain()},g$=function(e){const t=this.channel,i={};return Le(this,lt,RA).call(this)&&(i.zero=!1),Ab(t)?i.nice=!Le(this,lt,RA).call(this):Yd(t)?i.scheme=e==d$?"tableau10":e==c$?"blues":"viridis":FL(t)?i.range=t=="shape"?["circle","square","triangle-up","cross","diamond"]:[]:t=="size"?i.range=[0,400]:t=="angle"&&(i.range=[0,360]),i};function qce(n,e){if(e==Uce||e==u$){if(EH(n))return e;throw new Error(`${n} does not support ${e} data type. Only positional channels do.`)}const t={x:["band","band","linear"],y:["band","band","linear"],size:[void 0,"point","linear"],opacity:[void 0,"point","linear"],fillOpacity:[void 0,"point","linear"],strokeOpacity:[void 0,"point","linear"],color:["ordinal","ordinal","linear"],fill:["ordinal","ordinal","linear"],stroke:["ordinal","ordinal","linear"],strokeWidth:[void 0,void 0,"linear"],shape:["ordinal","ordinal",void 0],dx:[void 0,void 0,"null"],dy:[void 0,void 0,"null"],angle:[void 0,void 0,"linear"]},s=["sample"].includes(n)?"null":t[n]?t[n][[d$,c$,pF].indexOf(e)]:e==pF?"linear":"ordinal";if(s===void 0)throw new Error(`Channel "${n}" is not compatible with "${e}" data type. Use of a proper scale may be needed.`);return s}function Gce(n,e){Ab(e)&&n.type!=="ordinal"&&(n.range=[0,1]),e=="opacity"&&as(n.type)&&(n.clamp=!0)}function Kce(n){return Os(n)}function BA(n){const e=new Set;function t(i){for(const s of Object.values(i.resolutions.scale))e.add(s)}for(const i of Zs(n)){i.visit(t);for(const s of i.getDataAncestors()){if(!s.options.contributesToScaleDomain)break;t(s)}}e.forEach(i=>i.reconfigure())}function qk(...n){for(const e of n)if(e!==void 0)return e}class Yce{constructor(e){this.channel=e,this.members=[]}get scaleResolution(){var e;return(e=_1(this.members))==null?void 0:e.view.getScaleResolution(this.channel)}addMember(e){const{view:t}=e,i=t.getScaleResolution(this.channel);if(!i)throw new Error("Cannot find a scale resolution!");if(this.scaleResolution&&i!==this.scaleResolution)throw new Error(`Shared axes must have a shared scale! Channel: ${this.channel}, existing views: [${this.members.map(s=>s.view.getPathString()).join(", ")}], new view: ${t.getPathString()}.`);this.members.push(e)}getAxisProps(){return WL(this,"axisProps",()=>{const e=this.members.map(t=>{const i=t.view.mark.encoding[t.channel];return"axis"in i&&i.axis});return e.length>0&&e.some(t=>t===null)?null:gS(e.filter(t=>t!==void 0),"axis",["title"])})}getTitle(){const e=o=>{var a;const r=Vae(o.view,o.channel);if(!Sr(r))return{member:o,explicitTitle:qk("axis"in r?(a=r.axis)==null?void 0:a.title:void 0,r.title),implicitTitle:qk(wu(r)?r.field:void 0,T1(r)?r.expr:void 0)}},t=this.members.map(e),i=t.filter(o=>{var r;if(TH(o.member.channel)&&!o.explicitTitle){const a=pf(o.member.channel);return((r=t.find(l=>l.member.view==o.member.view&&l.member.channel==a))==null?void 0:r.explicitTitle)===void 0}return!0}),s=new Set(i.map(o=>qk(o.explicitTitle,o.implicitTitle)).filter(Ti));return s.size?[...s].join(", "):null}}function mF(n,e,{spacing:t,devicePixelRatio:i,offset:s,reverse:o}={}){t=t||0,s=s||0;let r=0,a=0;for(const g of n)r+=Wy(g.px)+(Gk(g)?0:t),a+=Wy(g.grow);r-=t;const l=Math.max(0,e-r),c=i!==void 0?g=>Math.round(g*i)/i:g=>g,d=[],u=[],h=g=>{const p=d.length;if(!p)return;const _=(g?t:0)*(o?-1:1);f-=_;for(let v=0;v0);const _=Wy(p.px)+(a?Wy(p.grow)/a*l:0);o&&(f-=_),u.push({location:c(f),size:c(_)}),o?f-=t:f+=_+t}}return f+=o?t:-t,h(!1),u}function Zce(n){let e=0,t=0;for(const i of n)e=Math.max(e,i.px??0),t=Math.max(t,i.grow??0);return{px:e,grow:t}}var Yv,WA;const e5=class e5{constructor(e,t){Oe(this,Yv);this.width=e,this.height=t}addPadding(e){return Le(this,Yv,WA).call(this,e.width,e.height)}subtractPadding(e){return Le(this,Yv,WA).call(this,-e.width,-e.height)}isGrowing(){return!!(this.width.grow||this.height.grow)}};Yv=new WeakSet,WA=function(e,t){return new e5({px:(this.width.px??0)+e,grow:this.width.grow},{px:(this.height.px??0)+t,grow:this.height.grow})};let Zd=e5;const E_=Object.freeze({px:0,grow:0}),_F=new Zd(E_,E_);function Gk(n){return!n.px&&!n.grow}function Wy(n){return n||0}function Xce(n){return n&&(to(n.px)||to(n.grow))}function p$(n){if(_$(n))throw new Error("parseSizeDef does not accept step-based sizes.");if(Xce(n))return n;if(to(n))return{px:n,grow:0};if(n==="container")return{px:0,grow:1};if(!n)return{px:0,grow:1};throw new Error(`Invalid sizeDef: ${n}`)}class Cs{constructor(e,t,i,s){this.top=e||0,this.right=t||0,this.bottom=i||0,this.left=s||0}get width(){return this.left+this.right}get height(){return this.top+this.bottom}expand(e){return e<=0?this:new Cs(this.top+e,this.right+e,this.bottom+e,this.left+e)}add(e){return new Cs(this.top+e.top,this.right+e.right,this.bottom+e.bottom,this.left+e.left)}subtract(e){return new Cs(this.top-e.top,this.right-e.right,this.bottom-e.bottom,this.left-e.left)}union(e){return new Cs(Math.max(this.top,e.top),Math.max(this.right,e.right),Math.max(this.bottom,e.bottom),Math.max(this.left,e.left))}getHorizontal(){return new Cs(0,this.right,0,this.left)}getVertical(){return new Cs(this.top,0,this.bottom,0)}get horizontalTotal(){return this.left+this.right}get verticalTotal(){return this.top+this.bottom}static createFromConfig(e){return typeof e=="number"?this.createUniformPadding(e):e?this.createFromRecord(e):VA}static createFromRecord(e){return new Cs(e.top,e.right,e.bottom,e.left)}static zero(){return VA}static createUniformPadding(e){return new Cs(e,e,e,e)}}const VA=Cs.createUniformPadding(0);Object.freeze(VA);function B1(n,e){return!e||/^(data:|([A-Za-z]+:)?\/\/)/.test(n)||n.startsWith("/")?n:(e.endsWith("/")||(e+="/"),e+n)}function Qce(n){if(!n)return n;if(/[?#]/.test(n))throw new Error(`Invalid base URL: ${n} - cannot contain query or hash.`);return n.endsWith("/")?n:n+"/"}const Jce="VISIT_SKIP",A_="VISIT_STOP",bF=n=>n;var Wp,Zv,Xv,Qv,Jv,qa,e_,zA,XB;let m$=(XB=class{constructor(e,t,i,s,o,r={}){Oe(this,qa);Oe(this,Wp,{});Oe(this,Zv,{});Oe(this,Xv,{});Oe(this,Qv);Oe(this,Jv);zi(this,"opacityFunction",bF);zi(this,"facetCoords",new gc([],JSON.stringify));var a;if(!e)throw new Error("View spec must be defined!");if(this.context=t,this.layoutParent=i,this.dataParent=s,this.name=e.name||o,this.spec=e,this.resolutions={scale:{},axis:{}},UH(this),this.options={blockEncodingInheritance:!1,contributesToScaleDomain:!0,...r},this.needsAxes={x:!1,y:!1},this.paramMediator=new Rae(()=>{var l;return(l=this.dataParent)==null?void 0:l.paramMediator}),e.params)for(const l of e.params)this.paramMediator.registerParam(l);if(!((a=this.layoutParent)!=null&&a.options.layeredChildren)){const l=c=>this.paramMediator.findMediatorForParam(c)?void 0:this.paramMediator.allocateSetter(c,0);ut(this,Jv,l("height")),ut(this,Qv,l("width"))}}get coords(){return this.facetCoords.values().next().value}getPadding(){return this._cache("size/padding",()=>Cs.createFromConfig(this.spec.padding))}getOverhang(){return Cs.zero()}isScrollable(){return this.spec.viewportWidth!=null||this.spec.viewportHeight!=null}getSize(){return this._cache("size/size",()=>this.isConfiguredVisible()?new Zd(Le(this,qa,e_).call(this,"width"),Le(this,qa,e_).call(this,"height")):_F)}getViewportSize(){if(!this.isScrollable())return this.getSize();if(!this.isConfiguredVisible())return _F;const e=this.getSize();return new Zd(Le(this,qa,e_).call(this,"viewportWidth")??e.width,Le(this,qa,e_).call(this,"viewportHeight")??e.height)}isConfiguredVisible(){return this.context.isViewConfiguredVisible(this)}isVisibleInSpec(){return this.spec.visible??!0}isVisible(){return this.getLayoutAncestors().every(e=>e.isConfiguredVisible())}getEffectiveOpacity(){var e;return this.opacityFunction(((e=this.layoutParent)==null?void 0:e.getEffectiveOpacity())??1)}getPathString(){return this.getLayoutAncestors().map(e=>e.name).reverse().join("/")}getLayoutAncestors(){return Le(this,qa,zA).call(this,"layoutParent")}getDataAncestors(){return Le(this,qa,zA).call(this,"dataParent")}handleBroadcast(e){for(const t of X(this,Wp)[e.type]||[])t(e)}_addBroadcastHandler(e,t){let i=X(this,Wp)[e];i||(i=[],X(this,Wp)[e]=i),i.push(t)}handleInteractionEvent(e,t,i){const s=i?X(this,Zv):X(this,Xv);for(const o of s[t.type]||[])o(e,t)}addInteractionEventListener(e,t,i){const s=i?X(this,Zv):X(this,Xv);let o=s[e];o||(o=[],s[e]=o),o.push(t)}visit(e){try{const t=e(this);if(e.postOrder&&e.postOrder(this),t!==A_)return t}catch(t){throw t.view=this,t}}getDescendants(){const e=[];return this.visit(t=>{e.push(t)}),e}configureViewOpacity(){(!this.opacityFunction||this.opacityFunction===bF)&&(this.opacityFunction=tde(this))}onBeforeRender(){}render(e,t,i={}){var s,o;i.firstFacet&&this.facetCoords.clear(),this.facetCoords.set(i.facetId,i.clipRect?t.intersect(i.clipRect):t),(s=X(this,Qv))==null||s.call(this,t.width),(o=X(this,Jv))==null||o.call(this,t.height)}getEncoding(){const e=this.dataParent&&!this.options.blockEncodingInheritance?this.dataParent.getEncoding():{},t=this.spec.encoding||{},i={...e,...t};for(const[s,o]of Object.entries(i))o===null&&delete i[s];return i}getFacetAccessor(e){if(this.layoutParent)return this.layoutParent.getFacetAccessor(this)}getFacetFields(e){var i;const t=this.getEncoding().sample;return wu(t)?[t.field]:(i=this.layoutParent)==null?void 0:i.getFacetFields(this)}getSampleFacetTexture(){}getScaleResolution(e){const t=pf(e);return this.getDataAncestors().map(i=>i.resolutions.scale[t]).find(i=>i)}getAxisResolution(e){const t=pf(e);return this.getDataAncestors().map(i=>i.resolutions.axis[t]).find(i=>i)}getConfiguredResolution(e,t){var i,s;return(s=(i=this.spec.resolve)==null?void 0:i[t])==null?void 0:s[e]}getConfiguredOrDefaultResolution(e,t){return this.getConfiguredResolution(e,t)??this.getConfiguredResolution("default",t)??this.getDefaultResolution(e,t)}getDefaultResolution(e,t){return"independent"}getBaseUrl(){return Nb(()=>{var e;return(e=this.dataParent)==null?void 0:e.getBaseUrl()},Qce(this.spec.baseUrl))}isPickingSupported(){return!0}getTitleText(){const e=this.spec.title;if(e)return Ti(e)?e:Gs(e.text)?this.paramMediator.evaluateAndGet(e.text.expr):e.text}_cache(e,t){return WL(this,e,t)}_invalidateCacheByPrefix(e,t="self"){switch(t){case"self":sC(this,e);break;case"ancestors":for(const i of this.getLayoutAncestors())sC(i,e);break;case"progeny":this.visit(i=>sC(i,e));break}}invalidateSizeCache(){this._invalidateCacheByPrefix("size/","ancestors")}propagateInteractionEvent(e){}},Wp=new WeakMap,Zv=new WeakMap,Xv=new WeakMap,Qv=new WeakMap,Jv=new WeakMap,qa=new WeakSet,e_=function(e){var s;let t=this.spec[e];const i=e=="viewportWidth"||e=="viewportHeight";if(_$(t)){if(i)throw new jh(`Cannot use step-based size with "${e}"!`,this);const o=t.step,r=(s=this.getScaleResolution(e=="width"?"x":"y"))==null?void 0:s.scale;if(r){let a=0;if(Kd(r.type))a=r.domain().length;else if(["locus","index"].includes(r.type)){const c=r.domain();a=_1(c)-c[0]}else throw new jh(`Cannot use step-based size with "${r.type}" scale!`,this);const l=r;return a=o4(a,l.paddingInner(),l.paddingOuter()),{px:a*o,grow:0}}else throw new jh("Cannot use 'step' size with missing scale!",this)}else return(t&&p$(t))??(i?void 0:{px:0,grow:1})},zA=function(e){const t=[];let i=this;do t.push(i),i=i[e];while(i);return t},XB);function ede(n){return"unitsPerPixel"in n}function tde(n){const e="opacity"in n.spec?n.spec.opacity:void 0;if(e!==void 0){if(to(e))return t=>t*e;if(ede(e)){const t=o=>{var a;const r=(a=n.getScaleResolution(o))==null?void 0:a.scale;if(["linear","index","locus"].includes(r==null?void 0:r.type))return r},i=e.channel?t(e.channel):t("x")??t("y");if(!i)throw new jh("Cannot find a resolved quantitative scale for dynamic opacity!",n);const s=XM().domain(e.unitsPerPixel).range(e.values).clamp(!0);return o=>{const a=YC(i.domain())/1e3;return s(a)*o}}else if(Gs(e)){const t=n.paramMediator.createExpression(e.expr);return t.addListener(()=>n.context.animator.requestRender()),i=>t(null)*i}}return t=>t}const _$=n=>!!(n!=null&&n.step),ide={point:Vle,rect:Mle,rule:Ule,link:Xle,text:nce};var e1,Yx,b$;class Bo extends m${constructor(t,i,s,o,r,a){super(t,i,s,o,r,a);Oe(this,Yx);Oe(this,e1);this.spec=t;const l=ide[this.getMarkType()];if(l)this.mark=new l(this);else throw new Error(`No such mark: ${this.getMarkType()}`);this.resolve(),ut(this,e1,this.paramMediator.allocateSetter("zoomLevel",1)),["x","y"].forEach(c=>{var d;return(d=this.getScaleResolution(c))==null?void 0:d.addEventListener("domain",()=>X(this,e1).call(this,Math.sqrt(this.getZoomLevel())))}),this.needsAxes={x:!0,y:!0},Le(this,Yx,b$).call(this)}render(t,i,s={}){super.render(t,i,s),this.isConfiguredVisible()&&(t.pushView(this,i),t.renderMark(this.mark,s),t.popView(this))}getMarkType(){return typeof this.spec.mark=="object"?this.spec.mark.type:this.spec.mark}resolve(t){t||(this.resolve("scale"),this.resolve("axis"));const i=this.mark.encoding;for(const[s,o]of Object.entries(i)){if(!zo(o))continue;const r=pf(o.resolutionChannel??s);if(!Ib(r)||t=="axis"&&!Ab(r))continue;let a=this;for(;(a.getConfiguredOrDefaultResolution(r,t)=="forced"||a.dataParent&&["shared","excluded","forced"].includes(a.dataParent.getConfiguredOrDefaultResolution(r,t)))&&a.getConfiguredOrDefaultResolution(r,t)!="excluded";)a=a.dataParent;if(t=="axis"&&Ab(s)&&EH(r))a.resolutions[t][r]||(a.resolutions[t][r]=new Yce(r)),a.resolutions[t][r].addMember({view:this,channel:s,channelDef:o});else if(t=="scale"&&Ib(s)){if(!a.resolutions[t][r]){const c=new jce(r);a.resolutions[t][r]=c,c.addEventListener("range",d=>{var u;(u=this.context.glHelper)==null||u.createRangeTexture(d.scaleResolution,!0)})}const l=this.getLayoutAncestors().some(c=>!c.options.contributesToScaleDomain)||zo(o)&&o.contributesToScaleDomain===!1?void 0:this.extractDataDomain.bind(this);a.resolutions[t][r].addMember({view:this,channel:s,channelDef:o,dataDomainSource:l})}}}getDataAccessor(t){var i;return(i=this.mark.encoders[t])==null?void 0:i.dataAccessor}getFacetAccessor(t){const i=this.getDataAccessor("sample");return i||super.getFacetAccessor(this)}getCollector(){return this.context.dataFlow.findCollectorByKey(this)}extractDataDomain(t,i){var o;let s=l$(i);return(((o=this.mark.encoders[t])==null?void 0:o.accessors)??[]).filter(r=>r.scaleChannel).forEach(r=>{if(r.constant)s.extend(r({}));else{const a=this.getCollector();a!=null&&a.completed&&a.visitData(l=>s.extend(r(l)))}}),s}getZoomLevel(){const t=i=>{var s;return((s=this.getScaleResolution(i))==null?void 0:s.getZoomLevel())??1};return Zm.map(t).reduce((i,s)=>i*s,1)}propagateInteractionEvent(t){this.handleInteractionEvent(void 0,t,!0),t.target=this,!t.stopped&&this.handleInteractionEvent(void 0,t,!1)}getDefaultResolution(t,i){return t=="x"?"shared":"independent"}}e1=new WeakMap,Yx=new WeakSet,b$=function(){for(const[t,i]of this.paramMediator.paramConfigs){if(!("select"in i))continue;const s=LH(i.select);if(m4(s)){let r=0;const a=this.paramMediator.getSetter(t),l=()=>{var u;const d=this.context.getCurrentHover();return((u=d==null?void 0:d.mark)==null?void 0:u.unitView)===this?d.datum:null},c=(d,u)=>{const h=u.uiEvent,f=l(),g=f?f[pr]:0;let p;if(s.toggle)if(h.shiftKey){if(f){const v=this.paramMediator.getValue(t);p=Eae(v,{toggle:[f]})}}else p=CH(f?[f]:null);else g!=r&&(r=g,p=wH(f));p!==void 0&&a(p)};this.addInteractionEventListener(["mouseover","pointerover"].includes(s.on)?"mousemove":"click",c)}}};function*w4(n,e=[]){for(const[t,i]of n.entries())if(i instanceof Map)for(const s of w4(i,[...e,t]))yield s;else yield[[...e,t],i]}const v$=2147483647,nde=y$([v$]);function y$(n){let e=0;for(let t=0,i=n.length;tr),i=new Array(n.length);const s=new Array(16);for(let o=0;o{const d=n[t[c]];return o>=nde?d>v$?Math.floor(d/a)%16:0:d>>r&15};for(let c=0;c=0;c--)i[--s[l(c)]]=t[c];[t,i]=[i,t]}return t}var Fl,t1,Ph,Oh,Yo,HA,$A,UA,C$;class w$ extends g4{constructor(t){super();Oe(this,Yo);Oe(this,Fl,[]);Oe(this,t1,di(pr));Oe(this,Ph,[]);Oe(this,Oh);this.params=t??{type:"collect"},this.observers=[],this.facetBatches=new gc([],JSON.stringify),Le(this,Yo,HA).call(this)}get behavior(){return f4}get label(){return"collect"}reset(){super.reset(),Le(this,Yo,HA).call(this)}handle(t){X(this,Fl).push(t)}beginBatch(t){kae(t)&&(ut(this,Fl,[]),this.facetBatches.set(Zs(t.facetId),X(this,Fl)))}complete(){var o,r;ut(this,Fl,[]);const t=(o=this.params)==null?void 0:o.sort,i=t?zW(t.field,t.order):void 0,s=a=>{i&&a.sort(i)};if((r=this.params.groupby)!=null&&r.length){if(this.facetBatches.size>1)throw new Error("TODO: Support faceted data!");const a=this.facetBatches.get(void 0),l=this.params.groupby.map(d=>di(d)),c=l.length>1?sL(a,...l):ode(a,l[0]);this.facetBatches.clear();for(const[d,u]of w4(c))this.facetBatches.set(d,u)}for(const a of this.facetBatches.values())s(a);Le(this,Yo,C$).call(this),Le(this,Yo,$A).call(this),super.complete();for(const a of this.observers)a(this)}repropagate(){for(const t of this.children)t.reset();Le(this,Yo,$A).call(this);for(const t of this.children)t.complete()}getData(){switch(Le(this,Yo,UA).call(this),this.facetBatches.size){case 0:return[];case 1:return[...this.facetBatches.values()][0];default:{const t=this.facetBatches;return{[Symbol.iterator]:function*(){for(const s of t.values())yield*s}}}}}visitData(t){Le(this,Yo,UA).call(this);for(const i of this.facetBatches.values())for(let s=0;sl.start).right,s=X(this,t1),o=em(l=>s(r(l))).left,r=l=>{const c=i(X(this,Oh),l),d=X(this,Oh)[c-1];return!d||l>=d.stop?void 0:this.facetBatches.get(d.facetId)[l-d.start]},a=o(X(this,Ph),t);if(a>=0){const l=r(X(this,Ph)[a]);if(l&&s(l)===t)return l}}}Fl=new WeakMap,t1=new WeakMap,Ph=new WeakMap,Oh=new WeakMap,Yo=new WeakSet,HA=function(){ut(this,Fl,[]),this.facetBatches.clear(),this.facetBatches.set(void 0,X(this,Fl))},$A=function(){if(this.children.length)for(const[t,i]of this.facetBatches.entries()){if(t){const s={type:"facet",facetId:t};for(const o of this.children)o.beginBatch(s)}for(let s=0,o=i.length;s0;){const s=i-1>>1,o=this.values[s];if(t>=o)break;this.ids[i]=this.ids[s],this.values[i]=o,i=s}this.ids[i]=e,this.values[i]=t}pop(){if(this.length===0)return;const e=this.ids[0];if(this.length--,this.length>0){const t=this.ids[0]=this.ids[this.length],i=this.values[0]=this.values[this.length],s=this.length>>1;let o=0;for(;o=i)break;this.ids[o]=l,this.values[o]=c,o=r}this.ids[o]=t,this.values[o]=i}return e}peek(){if(this.length!==0)return this.ids[0]}peekValue(){if(this.length!==0)return this.values[0]}shrink(){this.ids.length=this.values.length=this.length}}class rde extends Hn{get behavior(){return fl}constructor(e){super(e),this.params=e,this.startAccessor=di(e.start),this.endAccessor=di(e.end),this.chromAccessor=e.chrom?di(e.chrom):t=>{},this.weightAccessor=e.weight?di(e.weight):t=>1,this.as={coverage:e.as??"coverage",start:e.asStart??e.start,end:e.asEnd??e.end,chrom:e.asChrom??e.chrom},this.createSegment=new Function("start","end","coverage","chrom","return {"+Object.entries(this.as).filter(([t,i])=>i).map(([t,i])=>`${JSON.stringify(i)}: ${t}`).join(", ")+"};"),this.ends=new pS}reset(){super.reset(),this.initialize()}initialize(){const e=this.as.coverage,t=this.as.end,i=this.as.chrom,s=this.startAccessor,o=this.endAccessor,r=this.chromAccessor,a=this.weightAccessor;let l,c,d,u=0,h=NaN;const f=this.ends;f.clear();const g=v=>{this._propagate(v),l=null},p=(v,b,y)=>{if(v==b)return;let w=!1;l&&(l[e]===y?(l[t]=b,w=!0):l[e]!=0&&g(l)),w||(l=this.createSegment(v,b,y,d))},_=()=>{let v=0;for(;(v=f.peekValue())!==void 0;)p(h,v,u),h=v,u-=f.pop();h=NaN,l&&g(l)};this.handle=v=>{const b=s(v);let y=0;for(;(y=f.peekValue())!==void 0&&y{_(),super.complete()},this.beginBatch=v=>{_(),c=null,super.beginBatch(v)}}}function ade(n,e,t=0,i=n.length){const s=new pS,o=i-t;let r;for(r=0;r=s.peekValue()&&(s.push(r,c),s.pop())}const a=[];let l;for(;(l=s.pop())!==void 0;)a.push(t+l);return a.reverse()}class lde{constructor(e,t=-1/0,i=1/0){this.maxSize=e,this.lowerLimit=t,this.upperLimit=i;const s=this.maxSize*2+1;this.lowerLimits=new Float64Array(s),this.upperLimits=new Float64Array(s),this.lowerChildren=new Int32Array(s),this.upperChildren=new Int32Array(s),this.reset()}reset(){this.lowerLimits.fill(0),this.upperLimits.fill(0),this.lowerChildren.fill(0),this.upperChildren.fill(0),this.n=1,this.lowerLimits[0]=this.lowerLimit,this.upperLimits[0]=this.upperLimit}_findSlot(e,t,i=0){if(e>=this.lowerLimits[i]&&t<=this.upperLimits[i]){const s=this.lowerChildren[i];if(s){const o=this._findSlot(e,t,s);return o>=0?o:this._findSlot(e,t,this.upperChildren[i])}else return i}else return-1}reserve(e,t){if(t-e<=0)throw new Error("Cannot reserve an empty or negative-size slot!");if(this.n+1>this.lowerLimits.length)return!1;const i=this._findSlot(e,t);if(i<0)return!1;const s=this.n++,o=this.n++;return this.lowerLimits[s]=this.lowerLimits[i],this.upperLimits[s]=e,this.lowerLimits[o]=t,this.upperLimits[o]=this.upperLimits[i],this.lowerChildren[i]=s,this.upperChildren[i]=o,!0}}class cde extends Hn{get behavior(){return f4}constructor(e,t){if(super(e),this.params=e,this._data=[],this.channel=e.channel??"x",!["x","y"].includes(this.channel))throw new Error("Invalid channel: "+this.channel);this.posAccessor=di(this.params.pos),this.posBisector=em(this.posAccessor),this.scoreAccessor=di(this.params.score),this.widthAccessor=di(this.params.width),this.laneAccessor=this.params.lane?di(this.params.lane):s=>0,this.padding=this.params.padding??0,this.reservationMaps=new Map,this.resolution=t.getScaleResolution(this.channel);const i=()=>this._filterAndPropagate();this.schedule=()=>t.context.animator.requestTransition(i),this.resolution.addEventListener("domain",s=>this.schedule()),t._addBroadcastHandler("layoutComputed",()=>this.schedule())}complete(){const e=this.posAccessor;this._data.sort((t,i)=>e(t)-e(i)),this._scores=this._data.map(this.scoreAccessor);for(const t of new Set(this._data.map(this.laneAccessor)))this.reservationMaps.set(t,new lde(200));this.schedule(),super.complete()}_filterAndPropagate(){super.reset();const e=this.resolution.scale,t=this.resolution.getAxisLength();if(!t)return;for(const r of this.reservationMaps.values())r.reset();const i=e.domain(),o=ade(this._scores,70,this.posBisector.left(this._data,i[0]),this.posBisector.right(this._data,i[1]));for(const r of o){const a=this._data[r],l=e(this.posAccessor(a))*t,c=this.widthAccessor(a)/2+this.padding;this.reservationMaps.get(this.laneAccessor(a)).reserve(l-c,l+c)&&this._propagate(a)}super.complete()}reset(){super.reset(),this._data=[],this.groups=new Map}handle(e){this._data.push(e)}}class dde extends Hn{constructor(e,t){super(e,t),this.params=e,this.predicate=void 0}initialize(){let e="";if(ude(this.params))e=this.params.expr;else if(hde(this.params))e=SH(this.params);else throw new Error("Invalid filter params: "+JSON.stringify(this.params));this.predicate=this.paramMediator.createExpression(e),this.predicate.addListener(()=>this.repropagate())}handle(e){this.predicate(e)&&this._propagate(e)}}function ude(n){return"expr"in n}function hde(n){return"param"in n}class fde extends Hn{get behavior(){return fl}constructor(e){super(e),this.params=e;const t=e.index;if(e.fields){const i=Zs(e.fields).map(o=>di(o)),s=Zs(e.as||e.fields);if(i.length!==s.length)throw new Error(`Lengths of "fields" (${i.length}), and "as" (${s.length}) do not match!`);this.handle=o=>{const r=i.map((l,c)=>l(o)??[]),a=r[0].length;for(let l=0;l{for(let s=0;s{let a=i(r),l=a,c=!0;const d=t(r);for(const u of pde(d)){if(c)l=a+u;else{a=l+u;const h=Object.assign({},r);h[s]=l,h[o]=a,this._propagate(h)}c=!c}}}}class _de extends Hn{get behavior(){return fl}constructor(e){super(e);const t=Zs(e.field).map(o=>di(o)),i=Zs(e.separator),s=Zs(e.as||e.field);if(t.length!==i.length||t.length!==s.length)throw new Error(`Lengths of "separator" (${i.length}), "fields" (${t.length}), and "as" (${s.length}) do not match!`);this.handle=o=>{if(t.some(l=>!l(o)))return;const r=t.map((l,c)=>l(o).split(i[c]));bde(r,o);const a=r[0].length;for(let l=0;li.length);if(!t.every(i=>i==t[0]))throw new Error("Mismatching number of elements in the fields to be split: "+JSON.stringify(e))}class vde extends Hn{get behavior(){return yu}constructor(e,t){super(e,t),this.params=e,this.as=e.as,this.fn=void 0}initialize(){this.fn=this.paramMediator.createExpression(this.params.expr),this.fn.addListener(()=>this.repropagate())}handle(e){e[this.as]=this.fn(e),this._propagate(e)}}class S$ extends Hn{get behavior(){return yu}constructor(e,t){e={channel:"x",...e},super(e),this.params=e;const i=e.channel;if(!["x","y"].includes(i))throw new Error("Invalid channel: "+i);const s=t.getScaleResolution(i).getGenome();if(!s)throw new Error("LinearizeGenomicCoordinate transform requires a locus scale!");const o=di(e.chrom),r=Zs(e.pos).map(g=>di(g)),a=Zs(e.as);if(r.length!=a.length)throw new Error('The number of "pos" and "as" elements must be equal!');const l=Zs(e.offset);let c;if(l.length==0)c=new Array(r.length).fill(0);else if(l.length==1)c=new Array(r.length).fill(l[0]);else if(l.length==r.length)c=l;else throw new Error(`Invalid "offset" parameter: ${JSON.stringify(e.offset)}!`);const d=new Function("datum","chromOffset","posAccessors",a.map((g,p)=>`datum[${JSON.stringify(g)}] = chromOffset + +posAccessors[${p}](datum) - ${c[p]};`).join(` -`));let u,h=0;const f=g=>{if(g!==u){if(h=s.cumulativeChromPositions.get(g),h===void 0)throw new Error("Unknown chromosome/contig: "+g);u=g}return h};this.handle=g=>{d(g,f(o(g)),r),this._propagate(g)}}}const yde=["Lato-Regular.png"],wde=[{id:87,width:53,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:43.491,chnl:15,x:0,y:0,page:0},{id:124,width:17,height:50,xoffset:0,yoffset:-32.193000000000005,xadvance:10.521,chnl:15,x:0,y:42,page:0},{id:40,width:20,height:49,xoffset:0,yoffset:-32.571000000000005,xadvance:11.214,chnl:15,x:0,y:94,page:0},{id:41,width:19,height:49,xoffset:0,yoffset:-32.571000000000005,xadvance:11.214,chnl:15,x:0,y:145,page:0},{id:36,width:32,height:49,xoffset:0,yoffset:-34.419000000000004,xadvance:24.360000000000003,chnl:15,x:0,y:196,page:0},{id:125,width:21,height:48,xoffset:0,yoffset:-32.193000000000005,xadvance:12.642000000000001,chnl:15,x:0,y:247,page:0},{id:91,width:22,height:48,xoffset:0,yoffset:-32.193000000000005,xadvance:12.852,chnl:15,x:0,y:297,page:0},{id:93,width:19,height:48,xoffset:0,yoffset:-32.193000000000005,xadvance:12.852,chnl:15,x:0,y:347,page:0},{id:123,width:21,height:48,xoffset:0,yoffset:-32.193000000000005,xadvance:12.642000000000001,chnl:15,x:0,y:397,page:0},{id:106,width:19,height:48,xoffset:0,yoffset:-30.639000000000003,xadvance:10.08,chnl:15,x:0,y:447,page:0},{id:81,width:43,height:47,xoffset:0,yoffset:-30.429000000000002,xadvance:33.621,chnl:15,x:21,y:447,page:0},{id:77,width:45,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:38.997,chnl:15,x:66,y:447,page:0},{id:64,width:43,height:44,xoffset:0,yoffset:-28.539,xadvance:35.133,chnl:15,x:23,y:397,page:0},{id:92,width:28,height:43,xoffset:0,yoffset:-30.933000000000003,xadvance:18.984,chnl:15,x:68,y:397,page:0},{id:47,width:28,height:43,xoffset:0,yoffset:-30.933000000000003,xadvance:18.984,chnl:15,x:98,y:397,page:0},{id:109,width:42,height:32,xoffset:0,yoffset:-21.609,xadvance:34.545,chnl:15,x:113,y:447,page:0},{id:119,width:42,height:31,xoffset:0,yoffset:-21.315,xadvance:32.991,chnl:15,x:157,y:447,page:0},{id:42,width:25,height:42,xoffset:0,yoffset:-31.626,xadvance:17.85,chnl:15,x:128,y:397,page:0},{id:37,width:42,height:41,xoffset:0,yoffset:-30.387,xadvance:33.663000000000004,chnl:15,x:155,y:397,page:0},{id:79,width:42,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:33.621,chnl:15,x:199,y:397,page:0},{id:102,width:24,height:41,xoffset:0,yoffset:-30.534000000000002,xadvance:14.721,chnl:15,x:243,y:397,page:0},{id:100,width:31,height:41,xoffset:0,yoffset:-30.933000000000003,xadvance:23.520000000000003,chnl:15,x:269,y:397,page:0},{id:98,width:32,height:41,xoffset:0,yoffset:-30.933000000000003,xadvance:23.520000000000003,chnl:15,x:302,y:397,page:0},{id:56,width:32,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:24.360000000000003,chnl:15,x:336,y:397,page:0},{id:38,width:40,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:29.904000000000003,chnl:15,x:370,y:397,page:0},{id:108,width:17,height:41,xoffset:0,yoffset:-30.933000000000003,xadvance:9.912,chnl:15,x:412,y:397,page:0},{id:107,width:31,height:41,xoffset:0,yoffset:-30.933000000000003,xadvance:21.336000000000002,chnl:15,x:431,y:397,page:0},{id:48,width:33,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:24.360000000000003,chnl:15,x:464,y:397,page:0},{id:71,width:38,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:30.681,chnl:15,x:21,y:347,page:0},{id:83,width:31,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:22.785,chnl:15,x:61,y:347,page:0},{id:63,width:27,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:18.795,chnl:15,x:94,y:347,page:0},{id:105,width:18,height:41,xoffset:0,yoffset:-30.639000000000003,xadvance:10.08,chnl:15,x:123,y:347,page:0},{id:51,width:32,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:24.360000000000003,chnl:15,x:143,y:347,page:0},{id:104,width:31,height:41,xoffset:0,yoffset:-30.933000000000003,xadvance:23.436,chnl:15,x:177,y:347,page:0},{id:67,width:37,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:28.056,chnl:15,x:210,y:347,page:0},{id:88,width:37,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:27.258000000000003,chnl:15,x:249,y:347,page:0},{id:68,width:40,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:31.941000000000003,chnl:15,x:288,y:347,page:0},{id:70,width:32,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:23.751,chnl:15,x:330,y:347,page:0},{id:34,width:23,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:15.561000000000002,chnl:15,x:364,y:347,page:0},{id:72,width:38,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:32.067,chnl:15,x:389,y:347,page:0},{id:73,width:18,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:11.760000000000002,chnl:15,x:429,y:347,page:0},{id:74,width:24,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:17.745,chnl:15,x:449,y:347,page:0},{id:75,width:38,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:27.825000000000003,chnl:15,x:24,y:297,page:0},{id:76,width:31,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:21.567,chnl:15,x:475,y:347,page:0},{id:66,width:35,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:27.153000000000002,chnl:15,x:64,y:297,page:0},{id:78,width:38,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:32.067,chnl:15,x:101,y:297,page:0},{id:33,width:18,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:11.298,chnl:15,x:141,y:297,page:0},{id:80,width:34,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:25.221,chnl:15,x:161,y:297,page:0},{id:65,width:38,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:28.434,chnl:15,x:197,y:297,page:0},{id:82,width:36,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:26.313000000000002,chnl:15,x:237,y:297,page:0},{id:35,width:33,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:275,y:297,page:0},{id:84,width:34,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.801000000000002,chnl:15,x:310,y:297,page:0},{id:85,width:37,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:30.891000000000002,chnl:15,x:346,y:297,page:0},{id:86,width:38,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:28.434,chnl:15,x:385,y:297,page:0},{id:39,width:16,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:8.568000000000001,chnl:15,x:425,y:297,page:0},{id:69,width:32,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.255000000000003,chnl:15,x:443,y:297,page:0},{id:89,width:36,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:26.208000000000002,chnl:15,x:23,y:247,page:0},{id:90,width:34,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:25.284000000000002,chnl:15,x:477,y:297,page:0},{id:49,width:31,height:40,xoffset:0,yoffset:-30.156000000000002,xadvance:24.360000000000003,chnl:15,x:61,y:247,page:0},{id:50,width:32,height:40,xoffset:0,yoffset:-30.429000000000002,xadvance:24.360000000000003,chnl:15,x:94,y:247,page:0},{id:57,width:32,height:40,xoffset:0,yoffset:-30.429000000000002,xadvance:24.360000000000003,chnl:15,x:128,y:247,page:0},{id:94,width:32,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:162,y:247,page:0},{id:96,width:21,height:40,xoffset:0,yoffset:-30.429000000000002,xadvance:16.8,chnl:15,x:196,y:247,page:0},{id:55,width:33,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:219,y:247,page:0},{id:54,width:33,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:254,y:247,page:0},{id:53,width:32,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:289,y:247,page:0},{id:52,width:33,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:323,y:247,page:0},{id:103,width:31,height:39,xoffset:0,yoffset:-21.630000000000003,xadvance:21.84,chnl:15,x:358,y:247,page:0},{id:112,width:32,height:39,xoffset:0,yoffset:-21.651,xadvance:23.541,chnl:15,x:391,y:247,page:0},{id:113,width:31,height:39,xoffset:0,yoffset:-21.651,xadvance:23.520000000000003,chnl:15,x:425,y:247,page:0},{id:116,width:25,height:39,xoffset:0,yoffset:-28.182000000000002,xadvance:15.057,chnl:15,x:458,y:247,page:0},{id:121,width:31,height:38,xoffset:0,yoffset:-21.273,xadvance:21.651,chnl:15,x:34,y:196,page:0},{id:59,width:18,height:36,xoffset:0,yoffset:-20.706,xadvance:10.983,chnl:15,x:485,y:247,page:0},{id:43,width:32,height:34,xoffset:0,yoffset:-24.486,xadvance:24.360000000000003,chnl:15,x:67,y:196,page:0},{id:60,width:30,height:33,xoffset:0,yoffset:-23.331000000000003,xadvance:24.360000000000003,chnl:15,x:101,y:196,page:0},{id:62,width:31,height:33,xoffset:0,yoffset:-23.331000000000003,xadvance:24.360000000000003,chnl:15,x:133,y:196,page:0},{id:117,width:30,height:32,xoffset:0,yoffset:-21.273,xadvance:23.415000000000003,chnl:15,x:166,y:196,page:0},{id:99,width:29,height:32,xoffset:0,yoffset:-21.609,xadvance:20.055,chnl:15,x:198,y:196,page:0},{id:110,width:31,height:32,xoffset:0,yoffset:-21.609,xadvance:23.436,chnl:15,x:229,y:196,page:0},{id:111,width:32,height:32,xoffset:0,yoffset:-21.609,xadvance:23.814,chnl:15,x:262,y:196,page:0},{id:126,width:32,height:26,xoffset:0,yoffset:-16.128,xadvance:24.360000000000003,chnl:15,x:201,y:447,page:0},{id:101,width:31,height:32,xoffset:0,yoffset:-21.609,xadvance:22.176000000000002,chnl:15,x:296,y:196,page:0},{id:114,width:25,height:32,xoffset:0,yoffset:-21.651,xadvance:15.288,chnl:15,x:329,y:196,page:0},{id:115,width:27,height:32,xoffset:0,yoffset:-21.609,xadvance:18.186,chnl:15,x:356,y:196,page:0},{id:97,width:28,height:32,xoffset:0,yoffset:-21.651,xadvance:20.874000000000002,chnl:15,x:385,y:196,page:0},{id:118,width:31,height:31,xoffset:0,yoffset:-21.273,xadvance:21.672,chnl:15,x:415,y:196,page:0},{id:61,width:31,height:29,xoffset:0,yoffset:-19.089000000000002,xadvance:24.360000000000003,chnl:15,x:448,y:196,page:0},{id:120,width:30,height:31,xoffset:0,yoffset:-21.273,xadvance:20.916,chnl:15,x:21,y:145,page:0},{id:58,width:18,height:31,xoffset:0,yoffset:-20.706,xadvance:10.5,chnl:15,x:53,y:145,page:0},{id:122,width:28,height:31,xoffset:0,yoffset:-21.273,xadvance:18.984,chnl:15,x:73,y:145,page:0},{id:95,width:28,height:16,xoffset:0,yoffset:0,xadvance:19.278000000000002,chnl:15,x:235,y:447,page:0},{id:45,width:23,height:24,xoffset:0,yoffset:-14.175,xadvance:15.603000000000002,chnl:15,x:481,y:196,page:0},{id:44,width:17,height:21,xoffset:0,yoffset:-4.956,xadvance:9.534,chnl:15,x:103,y:145,page:0},{id:46,width:18,height:15,xoffset:0,yoffset:-4.956,xadvance:9.912,chnl:15,x:0,y:497,page:0},{id:32,width:0,height:0,xoffset:0,yoffset:0,xadvance:10.752,chnl:15,x:20,y:497,page:0}],Cde={face:"Lato Regular",size:42,bold:0,italic:0,charset:[" ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","\\","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~"],unicode:1,stretchH:100,smooth:1,aa:1,padding:[0,0,0,0],spacing:[2,2]},Sde={lineHeight:50.400000000000006,base:41.454,scaleW:512,scaleH:512,pages:1,packed:0,alphaChnl:0,redChnl:0,greenChnl:0,blueChnl:0},xde=[],x$={pages:yde,chars:wde,info:Cde,common:Sde,kernings:xde};class Lde extends Hn{get behavior(){return yu}constructor(e){super(e),this.params=e;const t=xA(x$),i=di(e.field),s=e.as,o=e.fontSize;this.handle=r=>{const a=i(r);a!==void 0?r[s]=t.measureWidth(a,o):r[s]=0,this._propagate(r)}}}const Dde=65536;class kde extends Hn{get behavior(){return yu}constructor(e){super(e),this.params=e}reset(){super.reset(),this.initialize()}initialize(){const e=this.params,t=e.as||"lane",i=to(e.spacing)?e.spacing:1,s=di(e.start),o=di(e.end);if(!e.preference!=!e.preferredOrder)throw new Error('Must specify both "preference" and "preferredOrder"');if(e.preference){const r=new Float64Array(Dde),a=di(e.preference),l=e.preferredOrder;let c=1/0;this.handle=d=>{const u=s(d);u=0&&r[h]=r.length)throw new Error("Out of lanes!")}r[f]=o(d)+i,d[t]=f,this._propagate(d)}}else{const r=new pS,a=new pS;let l=-1/0,c=0;this.handle=d=>{const u=s(d);for(;r.length&&(r.peekValue()<=u||udi(s)),i=e.as?e.as:t.map(rQ);this.handle=s=>{const o={};for(let r=0;r{const r=s(o);if(Ti(r)){const a=r.match(t);if(a){if(a.length-1!=i.length)throw new Error('The number of RegEx groups and the length of "as" do not match!');for(let l=0;lnew RegExp(h)),i=Zs(e.asValue);if(t.length!=i.length)throw new Error('Lengths of "columnRegex" and "as" are not equal!');const s=e.skipRegex?new RegExp(e.skipRegex):void 0,o=e.asKey||"sample";let r,a,l;const c=h=>{var _;const f=Object.keys(h);for(const v of t)if(!f.some(b=>v.test(b)))throw new Error(`No columns matching the regex ${v.toString()} found in the data!`);const g=new Map;for(const[v,b]of t.entries())for(const y of f){const w=(_=b.exec(y))==null?void 0:_[1];if(w!==void 0){let C=g.get(w);C||(C=[],g.set(w,C)),C[v]=y}}r=[...g.entries()],a=f.filter(v=>!t.some(b=>b.test(v))&&!(s&&s.test(v)));const p=[...a.map(v=>JSON.stringify(v)+": datum["+JSON.stringify(v)+"]"),JSON.stringify(o)+": sampleId",...i.map((v,b)=>JSON.stringify(v)+`: datum[attrs[${b}]]`)];l=new Function("datum","sampleId","attrs",`return { +chrM 16299`,dF={dm6:Xce,hg18:Qce,hg19:Jce,hg38:ede,mm9:tde,mm10:ide};function nde(n){if(!(n in dF))throw new Error(`Unknown assembly: ${n}`);return dF[n].split(` +`).map(e=>{const t=e.split(" ");return{name:t[0],size:parseInt(t[1])}})}const sde=/^([A-Za-z]+:)?\/\//;function Mb(n,e){if(e&&sde.test(e))return e;const t=typeof n=="function"?n():n;if(!t)return e;if(!e)return t;if(/[#?]/.test(t))throw new Error(`Cannot append to a url with query or hash. Append: ${e}, base: ${t}`);return i$(t)+e}function i$(n){const e=n.replace(/[^/]*$/,"");return e===""?void 0:e.endsWith("://")?n+"/":e}class ode{constructor(e){if(this.config={name:"custom",...e},"baseUrl"in e)throw new Error("The `baseUrl` property in genome config has been removed in GenomeSpy v0.52.0. Use `url` instead. See https://genomespy.app/docs/genomic-data/genomic-coordinates/.");if(!b4(e))throw new Error("Not a genome configuration: "+JSON.stringify(e));if(this.chromosomes=[],this.cumulativeChromPositions=new Map,this.chromosomesByName=new Map,this.startByIndex=[],this.totalSize=0,s$(this.config))this.setChromSizes(this.config.contigs);else if(!EA(this.config)){const t=nde(this.config.name);if(t)this.setChromSizes(t);else throw new Error(`Unknown genome: ${this.config.name}. Please provide contigs or a URL. See https://genomespy.app/docs/genomic-data/genomic-coordinates/.`)}}get name(){return this.config.name}async load(e){if(EA(this.config))try{const t=Mb(e,this.config.url),i=await fetch(t);if(!i.ok)throw new Error(`${i.status} ${i.statusText}`);this.setChromSizes(rde(await i.text()))}catch(t){throw new Error(`Could not load chrom sizes: ${this.config.url}. Reason: ${t.message}`)}}hasChrPrefix(){return this.chromosomes.some(e=>e.name.startsWith("chr"))}setChromSizes(e){let t=0;this.startByIndex=[0];for(let i=0;ithis.totalSize)return;e=Math.floor(e);const t=Ud(this.startByIndex,e)-1;if(t>0&&t<=this.chromosomes.length)return this.chromosomes[t-1]}toChromosomal(e){const t=this.toChromosome(e);if(t)return{chrom:t.name,pos:Math.floor(e)-t.continuousStart}}getChromosome(e){return this.chromosomesByName.get(e)}formatInterval(e){return Zce(...this.toChromosomalInterval(e))}toChromosomalInterval(e){const t=this.toChromosomal(e[0]+.5),i=this.toChromosomal(e[1]-.5);return i.pos+=1,[t,i]}toContinuousInterval(e){var s;let[t,i]=e;return i||(i=t),[this.toContinuous(t.chrom,t.pos??0),this.toContinuous(i.chrom,i.pos??((s=this.chromosomesByName.get(i.chrom))==null?void 0:s.size))]}toDiscreteChromosomeIntervals(e){const t=e[0],i=e[1],s=[];if(t.chrom===i.chrom)s.push({chrom:t.chrom,startPos:t.pos,endPos:i.pos});else{const o=this.chromosomes.findIndex(a=>a.name===t.chrom),r=this.chromosomes.findIndex(a=>a.name===i.chrom);s.push({chrom:t.chrom,startPos:t.pos,endPos:this.chromosomes[o].size});for(let a=o+1;aa===void 0)){const a=this.getChromosome(i);return a?[a.continuousStart,a.continuousEnd]:void 0}const s=t[3]||i,o=parseInt(t[2].replace(/,/g,"")),r=t[4]!==void 0?parseInt(t[4].replace(/,/g,"")):o;return[this.toContinuous(i,o-1),this.toContinuous(s,r)]}}}function rde(n){return GQ(n).map(([e,t])=>({name:e,size:parseInt(t)}))}function n$(n){return Ms(n)&&"chrom"in n}function ade(n){return n.every(n$)}function b4(n){return Ms(n)&&("name"in n||EA(n)||s$(n))}function EA(n){return b4(n)&&"url"in n}function s$(n){return b4(n)&&"contigs"in n}class W1 extends Array{constructor(){super(),this.type=void 0}extend(e){return this}extendAll(e){if(e instanceof W1&&e.type!=this.type)throw new Error(`Cannot combine different types of domains: ${this.type} and ${e.type}`);for(const t of e)this.extend(t);return this}extendAllWithAccessor(e,t){for(const i of e)this.extend(t(i));return this}}class Vk extends W1{constructor(){super(),this.type="quantitative"}extend(e){return e==null||Number.isNaN(e)?this:(e=+e,this.length?ethis[1]&&(this[1]=e):(this.push(e),this.push(e)),this)}}class o$ extends W1{constructor(){super(),this.type="ordinal",this.uniqueValues=new Set}extend(e){return e==null||Number.isNaN(e)?this:(this.uniqueValues.has(e)||(this.uniqueValues.add(e),this.push(e)),this)}}class r$ extends o${constructor(){super(),this.type="nominal"}}class lde extends W1{constructor(e){super();let t=0;for(let i=1;ithis.push(i))}extend(e){if(this.includes(e))return this;throw new Error("Piecewise domains are immutable and cannot be unioned!")}}const uF={quantitative:Vk,index:Vk,locus:Vk,nominal:r$,ordinal:o$};function a$(n,e){if(n=="quantitative"&&cde(e)){const t=new lde(e);return t.type=n,t}else if(uF[n]){const t=new uF[n];return t.type=n,e&&t.extendAll(e),t}throw new Error("Unknown type: "+n)}function cde(n){return n&&n.length>0&&n.length!=2&&n.every(e=>typeof e=="number")}function dde(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}function ude(n,e,t){return n*Math.pow(e/n,t)}ti("index",_4,["continuous"]);ti("locus",Dce,["continuous"]);ti("null",p4,[]);const hF="quantitative",l$="ordinal",c$="nominal",d$="locus",hde="index";var Fl,Vp,Ao,Xv,at,AA,IA,kl,TA,u$,h$,NA,RA,Jw,MA,Ju,PA,f$;class fde{constructor(e){Pe(this,at);Pe(this,Fl);Pe(this,Vp,{domain:new Set,range:new Set});Pe(this,Ao);Pe(this,Xv,new Set);this.channel=e,this.members=[],this.type=null,this.name=void 0}addEventListener(e,t){X(this,Vp)[e].add(t)}removeEventListener(e,t){X(this,Vp)[e].delete(t)}addMember(e){var r;const{channel:t,channelDef:i}=e,s=t=="sample"?"nominal":i.type,o=(r=i==null?void 0:i.scale)==null?void 0:r.name;if(o){if(this.name!==void 0&&o!=this.name)throw new Error(`Shared scales have conflicting names: "${o}" vs. "${this.name}"!`);this.name=o}if(!this.type)this.type=s;else if(s!==this.type&&!IH(t))throw new Error(`Can not use shared scale for different data types: ${this.type} vs. ${s}. Use "resolve: independent" for channel ${this.channel}`);this.members.push(e)}getDataDomain(){return this.members.map(e=>{var t;return(t=e.dataDomainSource)==null?void 0:t.call(e,e.channel,this.type)}).filter(e=>!!e).reduce((e,t)=>e.extendAll(t))}reconfigure(){const e=X(this,Ao);if(!e||e.type=="null")return;const t=xe(this,at,u$).call(this),i=e.domain(),s=xe(this,at,NA).call(this,!0);if(e$({...s,range:void 0},e),e.props=s,xe(this,at,RA).call(this),os(e.type)&&dt(this,Fl,xe(this,at,PA).call(this)),!t){xe(this,at,kl).call(this,"domain");return}const o=e.domain();YC(o,i)||(this.isZoomable()?e.domain(i):xe(this,at,Ju).call(this)?(e.domain(i),this.zoomTo(o,500)):xe(this,at,kl).call(this,"domain"))}get scale(){if(X(this,Ao))return X(this,Ao);const e=xe(this,at,NA).call(this),t=Vce({...e,range:void 0});t.props=e,"unknown"in t&&t.unknown(null),dt(this,Ao,t),xe(this,at,RA).call(this),kce(t)&&t.genome(this.getGenome()),os(t.type)&&dt(this,Fl,xe(this,at,PA).call(this));const i=t.range;if(i){const s=()=>xe(this,at,kl).call(this,"range");t.range=function(o){if(arguments.length)i(o),s();else return i()},s()}return t}getDomain(){return this.scale.domain()}getComplexDomain(){var e;return((e=this.getGenome())==null?void 0:e.toChromosomalInterval(this.getDomain()))??this.getDomain()}isZoomed(){return xe(this,at,Ju).call(this)&&YC(xe(this,at,Jw).call(this),this.getDomain())}isZoomable(){return xe(this,at,Ju).call(this)&&!!this.scale.props.zoom}zoom(e,t,i){if(!xe(this,at,Ju).call(this))return!1;const s=this.scale,o=s.domain();let r=[...o],a=s.invert(t);switch(s.props.reverse&&(i=-i),"align"in s&&(a+=s.align()),s.type){case"linear":case"index":case"locus":r=LQ(r,i||0),r=BW(r,a,e);break;case"log":r=DQ(r,i||0),r=WW(r,a,e);break;case"pow":case"sqrt":{const l=s;r=kQ(r,i||0,l.exponent()),r=WE(r,a,e,l.exponent());break}default:throw new Error("Zooming is not implemented for: "+s.type)}return X(this,Fl)&&(r=AQ(r,X(this,Fl)[0],X(this,Fl)[1])),[0,1].some(l=>r[l]!=o[l])?(s.domain(r),xe(this,at,kl).call(this,"domain"),!0):!1}async zoomTo(e,t=!1){if(m1(t)&&(t=t?700:0),!xe(this,at,Ju).call(this))throw new Error("Not a zoomable scale!");const i=this.fromComplexInterval(e),s=X(this,at,IA).animator,o=this.scale,r=o.domain();if(t>0&&r.length==2){const a=r[1]-r[0],l=i[1]-i[0],c=r[0]+a/2,d=i[0]+l/2,u=r[0]==i[0],h=r[1]==i[1];await s.transition({duration:t,easingFunction:dde,onUpdate:f=>{const g=ude(a,l,f),p=a==l?f:(a-g)/(a-l),_=p*d+(1-p)*c,v=[u?r[0]:_-g/2,h?r[1]:_+g/2];o.domain(v),xe(this,at,kl).call(this,"domain")}}),o.domain(i),xe(this,at,kl).call(this,"domain")}else o.domain(i),s==null||s.requestRender(),xe(this,at,kl).call(this,"domain")}resetZoom(){if(!xe(this,at,Ju).call(this))throw new Error("Not a zoomable scale!");const e=this.getDomain(),t=xe(this,at,Jw).call(this);return[0,1].some(i=>t[i]!=e[i])?(X(this,Ao).domain(t),xe(this,at,kl).call(this,"domain"),!0):!1}getZoomLevel(){return this.isZoomable()?HC(X(this,Fl))/HC(this.scale.domain()):1}getAxisLength(){if(this.channel!=="x"&&this.channel!=="y")throw new Error("Axis length is only defined for x and y channels!");const e=this.members.map(t=>{var i;return(i=t.view.coords)==null?void 0:i[this.channel==="x"?"width":"height"]}).filter(t=>t>0);return e.length?e.reduce((t,i)=>Math.min(t,i),1e4):0}getGenome(){var t;if(this.type!=="locus")return;const e=(t=X(this,at,IA).genomeStore)==null?void 0:t.getGenome();if(!e)throw new Error("No genome has been defined!");return e}invertToComplex(e){const t=this.scale;if("invert"in t){const i=t.invert(e);return this.toComplex(i)}else throw new Error("The scale does not support inverting!")}toComplex(e){const t=this.getGenome();return t?t.toChromosomal(e):e}fromComplex(e){return n$(e)?this.getGenome().toContinuous(e.chrom,e.pos):e}fromComplexInterval(e){return this.type==="locus"&&ade(e)?this.getGenome().toContinuousInterval(e):e}}Fl=new WeakMap,Vp=new WeakMap,Ao=new WeakMap,Xv=new WeakMap,at=new WeakSet,AA=function(){return this.members[0].view},IA=function(){return X(this,at,AA).context},kl=function(e){for(const t of X(this,Vp)[e].values())t({type:e,scaleResolution:this})},TA=function(){return!!xe(this,at,MA).call(this)},u$=function(){const e=X(this,Ao);if(!e)return!1;const t=e.domain();return os(e.type)?t.length>2||t.length==2&&(t[0]!==0||t[1]!==0):t.length>0},h$=function(){const e=this.members.map(t=>t.channelDef.scale).filter(t=>t!==void 0);return aS(e,"scale",["domain"])},NA=function(e=!1){const t=xe(this,at,h$).call(this);if(t===null||t.type=="null")return{type:"null"};const i={...xe(this,at,f$).call(this,this.type),...t};i.type||(i.type=gde(this.channel,this.type));const s=xe(this,at,Jw).call(this,e);return s&&s.length>0?i.domain=s:Yd(i.type)&&(i.domain=new r$),!i.domain&&i.domainMid!==void 0&&(i.domain=[i.domainMin??0,i.domainMax??1]),this.channel=="y"&&Yd(i.type)&&i.reverse==null&&(i.reverse=!0),i.range&&i.scheme&&delete i.scheme,!("zoom"in i)&&["index","locus"].includes(i.type)&&(i.zoom=!0),pde(i,this.channel),i},RA=function(){const e=X(this,Ao).props,t=e.range;if(X(this,Xv).forEach(s=>s.invalidate()),!t||!cs(t))return;const i=(s,o)=>o?s.slice().reverse():s;if(t.some(js)){let s;const o=()=>{X(this,Ao).range(i(s.map(r=>r()),e.reverse))};s=t.map(r=>{if(js(r)){const a=X(this,at,AA).paramMediator.createExpression(r.expr);return a.addListener(o),X(this,Xv).add(a),()=>a(null)}else return()=>r}),o()}else X(this,Ao).range(i(t,e.reverse))},Jw=function(e=!1){return xe(this,at,MA).call(this)??(this.type==d$?this.getGenome().getExtent():e?this.getDataDomain():[])},MA=function(){const e=this.members.map(t=>t.channelDef).filter(t=>{var i;return(i=t.scale)==null?void 0:i.domain}).map(t=>a$(t.type,this.fromComplexInterval(t.scale.domain)));if(e.length>0)return e.reduce((t,i)=>t.extendAll(i))},Ju=function(){const e=this.scale.type;return os(e)},PA=function(){const e=this.scale.props,t=e.zoom;if(mde(t)&&cs(t.extent))return this.fromComplexInterval(t.extent);if(t)return e.type=="locus"?this.getGenome().getExtent():X(this,Ao).domain()},f$=function(e){const t=this.channel,i={};return xe(this,at,TA).call(this)&&(i.zero=!1),Tb(t)?i.nice=!xe(this,at,TA).call(this):Zd(t)?i.scheme=e==c$?"tableau10":e==l$?"blues":"viridis":IL(t)?i.range=t=="shape"?["circle","square","triangle-up","cross","diamond"]:[]:t=="size"?i.range=[0,400]:t=="angle"&&(i.range=[0,360]),i};function gde(n,e){if(e==hde||e==d$){if(kH(n))return e;throw new Error(`${n} does not support ${e} data type. Only positional channels do.`)}const t={x:["band","band","linear"],y:["band","band","linear"],size:[void 0,"point","linear"],opacity:[void 0,"point","linear"],fillOpacity:[void 0,"point","linear"],strokeOpacity:[void 0,"point","linear"],color:["ordinal","ordinal","linear"],fill:["ordinal","ordinal","linear"],stroke:["ordinal","ordinal","linear"],strokeWidth:[void 0,void 0,"linear"],shape:["ordinal","ordinal",void 0],dx:[void 0,void 0,"null"],dy:[void 0,void 0,"null"],angle:[void 0,void 0,"linear"],sample:["null",void 0,void 0]},s=["sample"].includes(n)?"null":t[n]?t[n][[c$,l$,hF].indexOf(e)]:e==hF?"linear":"ordinal";if(s===void 0)throw new Error(`Channel "${n}" is not compatible with "${e}" data type. Use of a proper scale may be needed.`);return s}function pde(n,e){Tb(e)&&n.type!=="ordinal"&&(n.range=[0,1]),e=="opacity"&&os(n.type)&&(n.clamp=!0)}function mde(n){return Ms(n)}function OA(n){const e=new Set;function t(i){for(const s of Object.values(i.resolutions.scale))e.add(s)}for(const i of Ks(n)){i.visit(t);for(const s of i.getDataAncestors()){if(!s.options.contributesToScaleDomain)break;t(s)}}e.forEach(i=>i.reconfigure())}function zk(...n){for(const e of n)if(e!==void 0)return e}class _de{constructor(e){this.channel=e,this.members=[]}get scaleResolution(){var e;return(e=v1(this.members))==null?void 0:e.view.getScaleResolution(this.channel)}addMember(e){const{view:t}=e,i=t.getScaleResolution(this.channel);if(!i)throw new Error("Cannot find a scale resolution!");if(this.scaleResolution&&i!==this.scaleResolution)throw new Error(`Shared axes must have a shared scale! Channel: ${this.channel}, existing views: [${this.members.map(s=>s.view.getPathString()).join(", ")}], new view: ${t.getPathString()}.`);this.members.push(e)}getAxisProps(){return NL(this,"axisProps",()=>{const e=this.members.map(t=>{const i=t.view.mark.encoding[t.channel];return"axis"in i&&i.axis});return e.length>0&&e.some(t=>t===null)?null:aS(e.filter(t=>t!==void 0),"axis",["title"])})}getTitle(){const e=o=>{var a;const r=lle(o.view,o.channel);if(!Cr(r))return{member:o,explicitTitle:zk("axis"in r?(a=r.axis)==null?void 0:a.title:void 0,r.title),implicitTitle:zk(Cu(r)?r.field:void 0,R1(r)?r.expr:void 0)}},t=this.members.map(e),i=t.filter(o=>{var r;if(IH(o.member.channel)&&!o.explicitTitle){const a=bf(o.member.channel);return((r=t.find(l=>l.member.view==o.member.view&&l.member.channel==a))==null?void 0:r.explicitTitle)===void 0}return!0}),s=new Set(i.map(o=>zk(o.explicitTitle,o.implicitTitle)).filter(Ti));return s.size?[...s].join(", "):null}}function fF(n,e,{spacing:t,devicePixelRatio:i,offset:s,reverse:o}={}){t=t||0,s=s||0;let r=0,a=0;for(const g of n)r+=Ry(g.px)+(Hk(g)?0:t),a+=Ry(g.grow);r-=t;const l=Math.max(0,e-r),c=i!==void 0?g=>Math.round(g*i)/i:g=>g,d=[],u=[],h=g=>{const p=d.length;if(!p)return;const _=(g?t:0)*(o?-1:1);f-=_;for(let v=0;v0);const _=Ry(p.px)+(a?Ry(p.grow)/a*l:0);o&&(f-=_),u.push({location:c(f),size:c(_)}),o?f-=t:f+=_+t}}return f+=o?t:-t,h(!1),u}function bde(n){let e=0,t=0;for(const i of n)e=Math.max(e,i.px??0),t=Math.max(t,i.grow??0);return{px:e,grow:t}}var Qv,FA;const XP=class XP{constructor(e,t){Pe(this,Qv);this.width=e,this.height=t}addPadding(e){return xe(this,Qv,FA).call(this,e.width,e.height)}subtractPadding(e){return xe(this,Qv,FA).call(this,-e.width,-e.height)}isGrowing(){return!!(this.width.grow||this.height.grow)}};Qv=new WeakSet,FA=function(e,t){return new XP({px:(this.width.px??0)+e,grow:this.width.grow},{px:(this.height.px??0)+t,grow:this.height.grow})};let Xd=XP;const R_=Object.freeze({px:0,grow:0}),gF=new Xd(R_,R_);function Hk(n){return!n.px&&!n.grow}function Ry(n){return n||0}function vde(n){return n&&(Qs(n.px)||Qs(n.grow))}function g$(n){if(m$(n))throw new Error("parseSizeDef does not accept step-based sizes.");if(vde(n))return n;if(Qs(n))return{px:n,grow:0};if(n==="container")return{px:0,grow:1};if(!n)return{px:0,grow:1};throw new Error(`Invalid sizeDef: ${n}`)}class ws{constructor(e,t,i,s){this.top=e||0,this.right=t||0,this.bottom=i||0,this.left=s||0}get width(){return this.left+this.right}get height(){return this.top+this.bottom}expand(e){return e<=0?this:new ws(this.top+e,this.right+e,this.bottom+e,this.left+e)}add(e){return new ws(this.top+e.top,this.right+e.right,this.bottom+e.bottom,this.left+e.left)}subtract(e){return new ws(this.top-e.top,this.right-e.right,this.bottom-e.bottom,this.left-e.left)}union(e){return new ws(Math.max(this.top,e.top),Math.max(this.right,e.right),Math.max(this.bottom,e.bottom),Math.max(this.left,e.left))}getHorizontal(){return new ws(0,this.right,0,this.left)}getVertical(){return new ws(this.top,0,this.bottom,0)}get horizontalTotal(){return this.left+this.right}get verticalTotal(){return this.top+this.bottom}static createFromConfig(e){return typeof e=="number"?this.createUniformPadding(e):e?this.createFromRecord(e):BA}static createFromRecord(e){return new ws(e.top,e.right,e.bottom,e.left)}static zero(){return BA}static createUniformPadding(e){return new ws(e,e,e,e)}}const BA=ws.createUniformPadding(0);Object.freeze(BA);function V1(n,e){return!e||/^(data:|([A-Za-z]+:)?\/\/)/.test(n)||n.startsWith("/")?n:(e.endsWith("/")||(e+="/"),e+n)}function yde(n){if(!n)return n;if(/[?#]/.test(n))throw new Error(`Invalid base URL: ${n} - cannot contain query or hash.`);return n.endsWith("/")?n:n+"/"}const wde="VISIT_SKIP",M_="VISIT_STOP",pF=n=>n;var zp,Jv,e1,t1,i1,ja,o_,WA,GB;let p$=(GB=class{constructor(e,t,i,s,o,r={}){Pe(this,ja);Pe(this,zp,{});Pe(this,Jv,{});Pe(this,e1,{});Pe(this,t1);Pe(this,i1);Ei(this,"opacityFunction",pF);Ei(this,"facetCoords",new gc([],JSON.stringify));var a;if(!e)throw new Error("View spec must be defined!");if(this.context=t,this.layoutParent=i,this.dataParent=s,this.name=e.name||o,this.spec=e,this.resolutions={scale:{},axis:{}},$H(this),this.options={blockEncodingInheritance:!1,contributesToScaleDomain:!0,...r},this.needsAxes={x:!1,y:!1},this.paramMediator=new tle(()=>{var l;return(l=this.dataParent)==null?void 0:l.paramMediator}),e.params)for(const l of e.params)this.paramMediator.registerParam(l);if(!((a=this.layoutParent)!=null&&a.options.layeredChildren)){const l=c=>this.paramMediator.findMediatorForParam(c)?void 0:this.paramMediator.allocateSetter(c,0);dt(this,i1,l("height")),dt(this,t1,l("width"))}}get coords(){return this.facetCoords.values().next().value}getPadding(){return this._cache("size/padding",()=>ws.createFromConfig(this.spec.padding))}getOverhang(){return ws.zero()}isScrollable(){return this.spec.viewportWidth!=null||this.spec.viewportHeight!=null}getSize(){return this._cache("size/size",()=>this.isConfiguredVisible()?new Xd(xe(this,ja,o_).call(this,"width"),xe(this,ja,o_).call(this,"height")):gF)}getViewportSize(){if(!this.isScrollable())return this.getSize();if(!this.isConfiguredVisible())return gF;const e=this.getSize();return new Xd(xe(this,ja,o_).call(this,"viewportWidth")??e.width,xe(this,ja,o_).call(this,"viewportHeight")??e.height)}isConfiguredVisible(){return this.context.isViewConfiguredVisible(this)}isVisibleInSpec(){return this.spec.visible??!0}isVisible(){return this.getLayoutAncestors().every(e=>e.isConfiguredVisible())}getEffectiveOpacity(){var e;return this.opacityFunction(((e=this.layoutParent)==null?void 0:e.getEffectiveOpacity())??1)}getPathString(){return this.getLayoutAncestors().map(e=>e.name).reverse().join("/")}getLayoutAncestors(){return xe(this,ja,WA).call(this,"layoutParent")}getDataAncestors(){return xe(this,ja,WA).call(this,"dataParent")}handleBroadcast(e){for(const t of X(this,zp)[e.type]||[])t(e)}_addBroadcastHandler(e,t){let i=X(this,zp)[e];i||(i=[],X(this,zp)[e]=i),i.push(t)}handleInteractionEvent(e,t,i){const s=i?X(this,Jv):X(this,e1);for(const o of s[t.type]||[])o(e,t)}addInteractionEventListener(e,t,i){const s=i?X(this,Jv):X(this,e1);let o=s[e];o||(o=[],s[e]=o),o.push(t)}visit(e){try{const t=e(this);if(e.postOrder&&e.postOrder(this),t!==M_)return t}catch(t){throw t.view=this,t}}getDescendants(){const e=[];return this.visit(t=>{e.push(t)}),e}configureViewOpacity(){(!this.opacityFunction||this.opacityFunction===pF)&&(this.opacityFunction=Sde(this))}onBeforeRender(){}render(e,t,i={}){var s,o;i.firstFacet&&this.facetCoords.clear(),this.facetCoords.set(i.facetId,i.clipRect?t.intersect(i.clipRect):t),(s=X(this,t1))==null||s.call(this,t.width),(o=X(this,i1))==null||o.call(this,t.height)}getEncoding(){const e=this.dataParent&&!this.options.blockEncodingInheritance?this.dataParent.getEncoding():{},t=this.spec.encoding||{},i={...e,...t};for(const[s,o]of Object.entries(i))o===null&&delete i[s];return i}getFacetAccessor(e){if(this.layoutParent)return this.layoutParent.getFacetAccessor(this)}getFacetFields(e){var i;const t=this.getEncoding().sample;return Cu(t)?[t.field]:(i=this.layoutParent)==null?void 0:i.getFacetFields(this)}getSampleFacetTexture(){}getScaleResolution(e){const t=bf(e);return this.getDataAncestors().map(i=>i.resolutions.scale[t]).find(i=>i)}getAxisResolution(e){const t=bf(e);return this.getDataAncestors().map(i=>i.resolutions.axis[t]).find(i=>i)}getConfiguredResolution(e,t){var i,s;return(s=(i=this.spec.resolve)==null?void 0:i[t])==null?void 0:s[e]}getConfiguredOrDefaultResolution(e,t){return this.getConfiguredResolution(e,t)??this.getConfiguredResolution("default",t)??this.getDefaultResolution(e,t)}getDefaultResolution(e,t){return"independent"}getBaseUrl(){return Mb(()=>{var e;return(e=this.dataParent)==null?void 0:e.getBaseUrl()},yde(this.spec.baseUrl))}isPickingSupported(){return!0}getTitleText(){const e=this.spec.title;if(e)return Ti(e)?e:js(e.text)?this.paramMediator.evaluateAndGet(e.text.expr):e.text}_cache(e,t){return NL(this,e,t)}_invalidateCacheByPrefix(e,t="self"){switch(t){case"self":Qw(this,e);break;case"ancestors":for(const i of this.getLayoutAncestors())Qw(i,e);break;case"progeny":this.visit(i=>Qw(i,e));break}}invalidateSizeCache(){this._invalidateCacheByPrefix("size/","ancestors")}propagateInteractionEvent(e){}},zp=new WeakMap,Jv=new WeakMap,e1=new WeakMap,t1=new WeakMap,i1=new WeakMap,ja=new WeakSet,o_=function(e){var s;let t=this.spec[e];const i=e=="viewportWidth"||e=="viewportHeight";if(m$(t)){if(i)throw new Kh(`Cannot use step-based size with "${e}"!`,this);const o=t.step,r=(s=this.getScaleResolution(e=="width"?"x":"y"))==null?void 0:s.scale;if(r){let a=0;if(Yd(r.type))a=r.domain().length;else if(["locus","index"].includes(r.type)){const c=r.domain();a=v1(c)-c[0]}else throw new Kh(`Cannot use step-based size with "${r.type}" scale!`,this);const l=r;return a=n4(a,l.paddingInner(),l.paddingOuter()),{px:a*o,grow:0}}else throw new Kh("Cannot use 'step' size with missing scale!",this)}else return(t&&g$(t))??(i?void 0:{px:0,grow:1})},WA=function(e){const t=[];let i=this;do t.push(i),i=i[e];while(i);return t},GB);function Cde(n){return"unitsPerPixel"in n}function Sde(n){const e="opacity"in n.spec?n.spec.opacity:void 0;if(e!==void 0){if(Qs(e))return t=>t*e;if(Cde(e)){const t=o=>{var a;const r=(a=n.getScaleResolution(o))==null?void 0:a.scale;if(["linear","index","locus"].includes(r==null?void 0:r.type))return r},i=e.channel?t(e.channel):t("x")??t("y");if(!i)throw new Kh("Cannot find a resolved quantitative scale for dynamic opacity!",n);const s=YM().domain(e.unitsPerPixel).range(e.values).clamp(!0);return o=>{const a=HC(i.domain())/1e3;return s(a)*o}}else if(js(e)){const t=n.paramMediator.createExpression(e.expr);return t.addListener(()=>n.context.animator.requestRender()),i=>t(null)*i}}return t=>t}const m$=n=>!!(n!=null&&n.step),xde={point:lce,rect:ice,rule:hce,link:vce,text:Lce};var n1,Hx,_$;class Po extends p${constructor(t,i,s,o,r,a){super(t,i,s,o,r,a);Pe(this,Hx);Pe(this,n1);this.spec=t;const l=xde[this.getMarkType()];if(l)this.mark=new l(this);else throw new Error(`No such mark: ${this.getMarkType()}`);this.resolve(),dt(this,n1,this.paramMediator.allocateSetter("zoomLevel",1)),["x","y"].forEach(c=>{var d;return(d=this.getScaleResolution(c))==null?void 0:d.addEventListener("domain",()=>X(this,n1).call(this,Math.sqrt(this.getZoomLevel())))}),this.needsAxes={x:!0,y:!0},xe(this,Hx,_$).call(this)}render(t,i,s={}){super.render(t,i,s),this.isConfiguredVisible()&&(t.pushView(this,i),t.renderMark(this.mark,s),t.popView(this))}getMarkType(){return typeof this.spec.mark=="object"?this.spec.mark.type:this.spec.mark}getEncoding(){const t=super.getEncoding(),i=this.mark.getSupportedChannels();for(const s of Object.keys(t))i.includes(s)||delete t[s];return t}resolve(t){t||(this.resolve("scale"),this.resolve("axis"));const i=this.mark.encoding;for(const[s,o]of Object.entries(i)){if(!Vo(o))continue;const r=bf(o.resolutionChannel??s);if(!Nb(r)||t=="axis"&&!Tb(r))continue;let a=this;for(;(a.getConfiguredOrDefaultResolution(r,t)=="forced"||a.dataParent&&["shared","excluded","forced"].includes(a.dataParent.getConfiguredOrDefaultResolution(r,t)))&&a.getConfiguredOrDefaultResolution(r,t)!="excluded";)a=a.dataParent;if(t=="axis"&&Tb(s)&&kH(r))a.resolutions[t][r]||(a.resolutions[t][r]=new _de(r)),a.resolutions[t][r].addMember({view:this,channel:s,channelDef:o});else if(t=="scale"&&Nb(s)){if(!a.resolutions[t][r]){const c=new fde(r);a.resolutions[t][r]=c,c.addEventListener("range",d=>{var u;(u=this.context.glHelper)==null||u.createRangeTexture(d.scaleResolution,!0)})}const l=this.getLayoutAncestors().some(c=>!c.options.contributesToScaleDomain)||Vo(o)&&o.contributesToScaleDomain===!1?void 0:this.extractDataDomain.bind(this);a.resolutions[t][r].addMember({view:this,channel:s,channelDef:o,dataDomainSource:l})}}}getDataAccessor(t){var i;return(i=this.mark.encoders[t])==null?void 0:i.dataAccessor}getFacetAccessor(t){const i=this.getDataAccessor("sample");return i||super.getFacetAccessor(this)}getCollector(){return this.context.dataFlow.findCollectorByKey(this)}extractDataDomain(t,i){var o;let s=a$(i);return(((o=this.mark.encoders[t])==null?void 0:o.accessors)??[]).filter(r=>r.scaleChannel).forEach(r=>{if(r.constant)s.extend(r({}));else{const a=this.getCollector();a!=null&&a.completed&&a.visitData(l=>s.extend(r(l)))}}),s}getZoomLevel(){const t=i=>{var s;return((s=this.getScaleResolution(i))==null?void 0:s.getZoomLevel())??1};return e0.map(t).reduce((i,s)=>i*s,1)}propagateInteractionEvent(t){this.handleInteractionEvent(void 0,t,!0),t.target=this,!t.stopped&&this.handleInteractionEvent(void 0,t,!1)}getDefaultResolution(t,i){return t=="x"?"shared":"independent"}}n1=new WeakMap,Hx=new WeakSet,_$=function(){for(const[t,i]of this.paramMediator.paramConfigs){if(!("select"in i))continue;const s=xH(i.select);if(g4(s)){let r=0;const a=this.paramMediator.getSetter(t),l=()=>{var u;const d=this.context.getCurrentHover();return((u=d==null?void 0:d.mark)==null?void 0:u.unitView)===this?d.datum:null},c=(d,u)=>{const h=u.uiEvent,f=l(),g=f?f[gr]:0;let p;if(s.toggle)if(h.shiftKey){if(f){const v=this.paramMediator.getValue(t);p=Zae(v,{toggle:[f]})}}else p=wH(f?[f]:null);else g!=r&&(r=g,p=yH(f));p!==void 0&&a(p)};this.addInteractionEventListener(["mouseover","pointerover"].includes(s.on)?"mousemove":"click",c)}}};function*v4(n,e=[]){for(const[t,i]of n.entries())if(i instanceof Map)for(const s of v4(i,[...e,t]))yield s;else yield[[...e,t],i]}const b$=2147483647,Lde=v$([b$]);function v$(n){let e=0;for(let t=0,i=n.length;tr),i=new Array(n.length);const s=new Array(16);for(let o=0;o{const d=n[t[c]];return o>=Lde?d>b$?Math.floor(d/a)%16:0:d>>r&15};for(let c=0;c=0;c--)i[--s[l(c)]]=t[c];[t,i]=[i,t]}return t}var Bl,s1,Ph,Oh,Ko,VA,zA,HA,w$;class y$ extends h4{constructor(t){super();Pe(this,Ko);Pe(this,Bl,[]);Pe(this,s1,ci(gr));Pe(this,Ph,[]);Pe(this,Oh);this.params=t??{type:"collect"},this.observers=[],this.facetBatches=new gc([],JSON.stringify),xe(this,Ko,VA).call(this)}get behavior(){return u4}get label(){return"collect"}reset(){super.reset(),xe(this,Ko,VA).call(this)}handle(t){X(this,Bl).push(t)}beginBatch(t){Yae(t)&&(dt(this,Bl,[]),this.facetBatches.set(Ks(t.facetId),X(this,Bl)))}complete(){var o,r;dt(this,Bl,[]);const t=(o=this.params)==null?void 0:o.sort,i=t?VW(t.field,t.order):void 0,s=a=>{i&&a.sort(i)};if((r=this.params.groupby)!=null&&r.length){if(this.facetBatches.size>1)throw new Error("TODO: Support faceted data!");const a=this.facetBatches.get(void 0),l=this.params.groupby.map(d=>ci(d)),c=l.length>1?Xx(a,...l):kde(a,l[0]);this.facetBatches.clear();for(const[d,u]of v4(c))this.facetBatches.set(d,u)}for(const a of this.facetBatches.values())s(a);xe(this,Ko,w$).call(this),xe(this,Ko,zA).call(this),super.complete();for(const a of this.observers)a(this)}repropagate(){for(const t of this.children)t.reset();xe(this,Ko,zA).call(this);for(const t of this.children)t.complete()}getData(){switch(xe(this,Ko,HA).call(this),this.facetBatches.size){case 0:return[];case 1:return[...this.facetBatches.values()][0];default:{const t=this.facetBatches;return{[Symbol.iterator]:function*(){for(const s of t.values())yield*s}}}}}visitData(t){xe(this,Ko,HA).call(this);for(const i of this.facetBatches.values())for(let s=0;sl.start).right,s=X(this,s1),o=nm(l=>s(r(l))).left,r=l=>{const c=i(X(this,Oh),l),d=X(this,Oh)[c-1];return!d||l>=d.stop?void 0:this.facetBatches.get(d.facetId)[l-d.start]},a=o(X(this,Ph),t);if(a>=0){const l=r(X(this,Ph)[a]);if(l&&s(l)===t)return l}}}Bl=new WeakMap,s1=new WeakMap,Ph=new WeakMap,Oh=new WeakMap,Ko=new WeakSet,VA=function(){dt(this,Bl,[]),this.facetBatches.clear(),this.facetBatches.set(void 0,X(this,Bl))},zA=function(){if(this.children.length)for(const[t,i]of this.facetBatches.entries()){if(t){const s={type:"facet",facetId:t};for(const o of this.children)o.beginBatch(s)}for(let s=0,o=i.length;s0;){const s=i-1>>1,o=this.values[s];if(t>=o)break;this.ids[i]=this.ids[s],this.values[i]=o,i=s}this.ids[i]=e,this.values[i]=t}pop(){if(this.length===0)return;const e=this.ids[0];if(this.length--,this.length>0){const t=this.ids[0]=this.ids[this.length],i=this.values[0]=this.values[this.length],s=this.length>>1;let o=0;for(;o=i)break;this.ids[o]=l,this.values[o]=c,o=r}this.ids[o]=t,this.values[o]=i}return e}peek(){if(this.length!==0)return this.ids[0]}peekValue(){if(this.length!==0)return this.values[0]}shrink(){this.ids.length=this.values.length=this.length}}class Ede extends Wn{get behavior(){return gl}constructor(e){super(e),this.params=e,this.startAccessor=ci(e.start),this.endAccessor=ci(e.end),this.chromAccessor=e.chrom?ci(e.chrom):t=>{},this.weightAccessor=e.weight?ci(e.weight):t=>1,this.as={coverage:e.as??"coverage",start:e.asStart??e.start,end:e.asEnd??e.end,chrom:e.asChrom??e.chrom},this.createSegment=new Function("start","end","coverage","chrom","return {"+Object.entries(this.as).filter(([t,i])=>i).map(([t,i])=>`${JSON.stringify(i)}: ${t}`).join(", ")+"};"),this.ends=new lS}reset(){super.reset(),this.initialize()}initialize(){const e=this.as.coverage,t=this.as.end,i=this.as.chrom,s=this.startAccessor,o=this.endAccessor,r=this.chromAccessor,a=this.weightAccessor;let l,c,d,u=0,h=NaN;const f=this.ends;f.clear();const g=v=>{this._propagate(v),l=null},p=(v,b,y)=>{if(v==b)return;let w=!1;l&&(l[e]===y?(l[t]=b,w=!0):l[e]!=0&&g(l)),w||(l=this.createSegment(v,b,y,d))},_=()=>{let v=0;for(;(v=f.peekValue())!==void 0;)p(h,v,u),h=v,u-=f.pop();h=NaN,l&&g(l)};this.handle=v=>{const b=s(v);let y=0;for(;(y=f.peekValue())!==void 0&&y{_(),super.complete()},this.beginBatch=v=>{_(),c=null,super.beginBatch(v)}}}function Ade(n,e,t=0,i=n.length){const s=new lS,o=i-t;let r;for(r=0;r=s.peekValue()&&(s.push(r,c),s.pop())}const a=[];let l;for(;(l=s.pop())!==void 0;)a.push(t+l);return a.reverse()}class Ide{constructor(e,t=-1/0,i=1/0){this.maxSize=e,this.lowerLimit=t,this.upperLimit=i;const s=this.maxSize*2+1;this.lowerLimits=new Float64Array(s),this.upperLimits=new Float64Array(s),this.lowerChildren=new Int32Array(s),this.upperChildren=new Int32Array(s),this.reset()}reset(){this.lowerLimits.fill(0),this.upperLimits.fill(0),this.lowerChildren.fill(0),this.upperChildren.fill(0),this.n=1,this.lowerLimits[0]=this.lowerLimit,this.upperLimits[0]=this.upperLimit}_findSlot(e,t,i=0){if(e>=this.lowerLimits[i]&&t<=this.upperLimits[i]){const s=this.lowerChildren[i];if(s){const o=this._findSlot(e,t,s);return o>=0?o:this._findSlot(e,t,this.upperChildren[i])}else return i}else return-1}reserve(e,t){if(t-e<=0)throw new Error("Cannot reserve an empty or negative-size slot!");if(this.n+1>this.lowerLimits.length)return!1;const i=this._findSlot(e,t);if(i<0)return!1;const s=this.n++,o=this.n++;return this.lowerLimits[s]=this.lowerLimits[i],this.upperLimits[s]=e,this.lowerLimits[o]=t,this.upperLimits[o]=this.upperLimits[i],this.lowerChildren[i]=s,this.upperChildren[i]=o,!0}}class Tde extends Wn{get behavior(){return u4}constructor(e,t){if(super(e),this.params=e,this._data=[],this.channel=e.channel??"x",!["x","y"].includes(this.channel))throw new Error("Invalid channel: "+this.channel);this.posAccessor=ci(this.params.pos),this.posBisector=nm(this.posAccessor),this.scoreAccessor=ci(this.params.score),this.widthAccessor=ci(this.params.width),this.laneAccessor=this.params.lane?ci(this.params.lane):s=>0,this.padding=this.params.padding??0,this.reservationMaps=new Map,this.resolution=t.getScaleResolution(this.channel);const i=()=>this._filterAndPropagate();this.schedule=()=>t.context.animator.requestTransition(i),this.resolution.addEventListener("domain",s=>this.schedule()),t._addBroadcastHandler("layoutComputed",()=>this.schedule())}complete(){const e=this.posAccessor;this._data.sort((t,i)=>e(t)-e(i)),this._scores=this._data.map(this.scoreAccessor);for(const t of new Set(this._data.map(this.laneAccessor)))this.reservationMaps.set(t,new Ide(200));this.schedule(),super.complete()}_filterAndPropagate(){super.reset();const e=this.resolution.scale,t=this.resolution.getAxisLength();if(!t)return;for(const r of this.reservationMaps.values())r.reset();const i=e.domain(),o=Ade(this._scores,70,this.posBisector.left(this._data,i[0]),this.posBisector.right(this._data,i[1]));for(const r of o){const a=this._data[r],l=e(this.posAccessor(a))*t,c=this.widthAccessor(a)/2+this.padding;this.reservationMaps.get(this.laneAccessor(a)).reserve(l-c,l+c)&&this._propagate(a)}super.complete()}reset(){super.reset(),this._data=[],this.groups=new Map}handle(e){this._data.push(e)}}class Nde extends Wn{constructor(e,t){super(e,t),this.params=e,this.predicate=void 0}initialize(){let e="";if(Rde(this.params))e=this.params.expr;else if(Mde(this.params))e=CH(this.params);else throw new Error("Invalid filter params: "+JSON.stringify(this.params));this.predicate=this.paramMediator.createExpression(e),this.predicate.addListener(()=>this.repropagate())}handle(e){this.predicate(e)&&this._propagate(e)}}function Rde(n){return"expr"in n}function Mde(n){return"param"in n}class Pde extends Wn{get behavior(){return gl}constructor(e){super(e),this.params=e;const t=e.index;if(e.fields){const i=Ks(e.fields).map(o=>ci(o)),s=Ks(e.as||e.fields);if(i.length!==s.length)throw new Error(`Lengths of "fields" (${i.length}), and "as" (${s.length}) do not match!`);this.handle=o=>{const r=i.map((l,c)=>l(o)??[]),a=r[0].length;for(let l=0;l{for(let s=0;s{let a=i(r),l=a,c=!0;const d=t(r);for(const u of Fde(d)){if(c)l=a+u;else{a=l+u;const h=Object.assign({},r);h[s]=l,h[o]=a,this._propagate(h)}c=!c}}}}class Wde extends Wn{get behavior(){return gl}constructor(e){super(e);const t=Ks(e.field).map(o=>ci(o)),i=Ks(e.separator),s=Ks(e.as||e.field);if(t.length!==i.length||t.length!==s.length)throw new Error(`Lengths of "separator" (${i.length}), "fields" (${t.length}), and "as" (${s.length}) do not match!`);this.handle=o=>{if(t.some(l=>!l(o)))return;const r=t.map((l,c)=>l(o).split(i[c]));Vde(r,o);const a=r[0].length;for(let l=0;li.length);if(!t.every(i=>i==t[0]))throw new Error("Mismatching number of elements in the fields to be split: "+JSON.stringify(e))}class zde extends Wn{get behavior(){return wu}constructor(e,t){super(e,t),this.params=e,this.as=e.as,this.fn=void 0}initialize(){this.fn=this.paramMediator.createExpression(this.params.expr),this.fn.addListener(()=>this.repropagate())}handle(e){e[this.as]=this.fn(e),this._propagate(e)}}class C$ extends Wn{get behavior(){return wu}constructor(e,t){e={channel:"x",...e},super(e),this.params=e;const i=e.channel;if(!["x","y"].includes(i))throw new Error("Invalid channel: "+i);const s=t.getScaleResolution(i).getGenome();if(!s)throw new Error("LinearizeGenomicCoordinate transform requires a locus scale!");const o=ci(e.chrom),r=Ks(e.pos).map(g=>ci(g)),a=Ks(e.as);if(r.length!=a.length)throw new Error('The number of "pos" and "as" elements must be equal!');const l=Ks(e.offset);let c;if(l.length==0)c=new Array(r.length).fill(0);else if(l.length==1)c=new Array(r.length).fill(l[0]);else if(l.length==r.length)c=l;else throw new Error(`Invalid "offset" parameter: ${JSON.stringify(e.offset)}!`);const d=new Function("datum","chromOffset","posAccessors",a.map((g,p)=>`datum[${JSON.stringify(g)}] = chromOffset + +posAccessors[${p}](datum) - ${c[p]};`).join(` +`));let u,h=0;const f=g=>{if(g!==u){if(h=s.cumulativeChromPositions.get(g),h===void 0)return;u=g}return h};this.handle=g=>{const p=o(g),_=f(p);if(_===void 0)throw new Error(`Unknown chromosome/contig "${p}" in datum: ${JSON.stringify(g)}`);d(g,_,r),this._propagate(g)}}}const Hde=["Lato-Regular.png"],$de=[{id:87,width:53,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:43.491,chnl:15,x:0,y:0,page:0},{id:124,width:17,height:50,xoffset:0,yoffset:-32.193000000000005,xadvance:10.521,chnl:15,x:0,y:42,page:0},{id:40,width:20,height:49,xoffset:0,yoffset:-32.571000000000005,xadvance:11.214,chnl:15,x:0,y:94,page:0},{id:41,width:19,height:49,xoffset:0,yoffset:-32.571000000000005,xadvance:11.214,chnl:15,x:0,y:145,page:0},{id:36,width:32,height:49,xoffset:0,yoffset:-34.419000000000004,xadvance:24.360000000000003,chnl:15,x:0,y:196,page:0},{id:125,width:21,height:48,xoffset:0,yoffset:-32.193000000000005,xadvance:12.642000000000001,chnl:15,x:0,y:247,page:0},{id:91,width:22,height:48,xoffset:0,yoffset:-32.193000000000005,xadvance:12.852,chnl:15,x:0,y:297,page:0},{id:93,width:19,height:48,xoffset:0,yoffset:-32.193000000000005,xadvance:12.852,chnl:15,x:0,y:347,page:0},{id:123,width:21,height:48,xoffset:0,yoffset:-32.193000000000005,xadvance:12.642000000000001,chnl:15,x:0,y:397,page:0},{id:106,width:19,height:48,xoffset:0,yoffset:-30.639000000000003,xadvance:10.08,chnl:15,x:0,y:447,page:0},{id:81,width:43,height:47,xoffset:0,yoffset:-30.429000000000002,xadvance:33.621,chnl:15,x:21,y:447,page:0},{id:77,width:45,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:38.997,chnl:15,x:66,y:447,page:0},{id:64,width:43,height:44,xoffset:0,yoffset:-28.539,xadvance:35.133,chnl:15,x:23,y:397,page:0},{id:92,width:28,height:43,xoffset:0,yoffset:-30.933000000000003,xadvance:18.984,chnl:15,x:68,y:397,page:0},{id:47,width:28,height:43,xoffset:0,yoffset:-30.933000000000003,xadvance:18.984,chnl:15,x:98,y:397,page:0},{id:109,width:42,height:32,xoffset:0,yoffset:-21.609,xadvance:34.545,chnl:15,x:113,y:447,page:0},{id:119,width:42,height:31,xoffset:0,yoffset:-21.315,xadvance:32.991,chnl:15,x:157,y:447,page:0},{id:42,width:25,height:42,xoffset:0,yoffset:-31.626,xadvance:17.85,chnl:15,x:128,y:397,page:0},{id:37,width:42,height:41,xoffset:0,yoffset:-30.387,xadvance:33.663000000000004,chnl:15,x:155,y:397,page:0},{id:79,width:42,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:33.621,chnl:15,x:199,y:397,page:0},{id:102,width:24,height:41,xoffset:0,yoffset:-30.534000000000002,xadvance:14.721,chnl:15,x:243,y:397,page:0},{id:100,width:31,height:41,xoffset:0,yoffset:-30.933000000000003,xadvance:23.520000000000003,chnl:15,x:269,y:397,page:0},{id:98,width:32,height:41,xoffset:0,yoffset:-30.933000000000003,xadvance:23.520000000000003,chnl:15,x:302,y:397,page:0},{id:56,width:32,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:24.360000000000003,chnl:15,x:336,y:397,page:0},{id:38,width:40,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:29.904000000000003,chnl:15,x:370,y:397,page:0},{id:108,width:17,height:41,xoffset:0,yoffset:-30.933000000000003,xadvance:9.912,chnl:15,x:412,y:397,page:0},{id:107,width:31,height:41,xoffset:0,yoffset:-30.933000000000003,xadvance:21.336000000000002,chnl:15,x:431,y:397,page:0},{id:48,width:33,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:24.360000000000003,chnl:15,x:464,y:397,page:0},{id:71,width:38,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:30.681,chnl:15,x:21,y:347,page:0},{id:83,width:31,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:22.785,chnl:15,x:61,y:347,page:0},{id:63,width:27,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:18.795,chnl:15,x:94,y:347,page:0},{id:105,width:18,height:41,xoffset:0,yoffset:-30.639000000000003,xadvance:10.08,chnl:15,x:123,y:347,page:0},{id:51,width:32,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:24.360000000000003,chnl:15,x:143,y:347,page:0},{id:104,width:31,height:41,xoffset:0,yoffset:-30.933000000000003,xadvance:23.436,chnl:15,x:177,y:347,page:0},{id:67,width:37,height:41,xoffset:0,yoffset:-30.429000000000002,xadvance:28.056,chnl:15,x:210,y:347,page:0},{id:88,width:37,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:27.258000000000003,chnl:15,x:249,y:347,page:0},{id:68,width:40,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:31.941000000000003,chnl:15,x:288,y:347,page:0},{id:70,width:32,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:23.751,chnl:15,x:330,y:347,page:0},{id:34,width:23,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:15.561000000000002,chnl:15,x:364,y:347,page:0},{id:72,width:38,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:32.067,chnl:15,x:389,y:347,page:0},{id:73,width:18,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:11.760000000000002,chnl:15,x:429,y:347,page:0},{id:74,width:24,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:17.745,chnl:15,x:449,y:347,page:0},{id:75,width:38,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:27.825000000000003,chnl:15,x:24,y:297,page:0},{id:76,width:31,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:21.567,chnl:15,x:475,y:347,page:0},{id:66,width:35,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:27.153000000000002,chnl:15,x:64,y:297,page:0},{id:78,width:38,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:32.067,chnl:15,x:101,y:297,page:0},{id:33,width:18,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:11.298,chnl:15,x:141,y:297,page:0},{id:80,width:34,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:25.221,chnl:15,x:161,y:297,page:0},{id:65,width:38,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:28.434,chnl:15,x:197,y:297,page:0},{id:82,width:36,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:26.313000000000002,chnl:15,x:237,y:297,page:0},{id:35,width:33,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:275,y:297,page:0},{id:84,width:34,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.801000000000002,chnl:15,x:310,y:297,page:0},{id:85,width:37,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:30.891000000000002,chnl:15,x:346,y:297,page:0},{id:86,width:38,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:28.434,chnl:15,x:385,y:297,page:0},{id:39,width:16,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:8.568000000000001,chnl:15,x:425,y:297,page:0},{id:69,width:32,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.255000000000003,chnl:15,x:443,y:297,page:0},{id:89,width:36,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:26.208000000000002,chnl:15,x:23,y:247,page:0},{id:90,width:34,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:25.284000000000002,chnl:15,x:477,y:297,page:0},{id:49,width:31,height:40,xoffset:0,yoffset:-30.156000000000002,xadvance:24.360000000000003,chnl:15,x:61,y:247,page:0},{id:50,width:32,height:40,xoffset:0,yoffset:-30.429000000000002,xadvance:24.360000000000003,chnl:15,x:94,y:247,page:0},{id:57,width:32,height:40,xoffset:0,yoffset:-30.429000000000002,xadvance:24.360000000000003,chnl:15,x:128,y:247,page:0},{id:94,width:32,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:162,y:247,page:0},{id:96,width:21,height:40,xoffset:0,yoffset:-30.429000000000002,xadvance:16.8,chnl:15,x:196,y:247,page:0},{id:55,width:33,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:219,y:247,page:0},{id:54,width:33,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:254,y:247,page:0},{id:53,width:32,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:289,y:247,page:0},{id:52,width:33,height:40,xoffset:0,yoffset:-30.093000000000004,xadvance:24.360000000000003,chnl:15,x:323,y:247,page:0},{id:103,width:31,height:39,xoffset:0,yoffset:-21.630000000000003,xadvance:21.84,chnl:15,x:358,y:247,page:0},{id:112,width:32,height:39,xoffset:0,yoffset:-21.651,xadvance:23.541,chnl:15,x:391,y:247,page:0},{id:113,width:31,height:39,xoffset:0,yoffset:-21.651,xadvance:23.520000000000003,chnl:15,x:425,y:247,page:0},{id:116,width:25,height:39,xoffset:0,yoffset:-28.182000000000002,xadvance:15.057,chnl:15,x:458,y:247,page:0},{id:121,width:31,height:38,xoffset:0,yoffset:-21.273,xadvance:21.651,chnl:15,x:34,y:196,page:0},{id:59,width:18,height:36,xoffset:0,yoffset:-20.706,xadvance:10.983,chnl:15,x:485,y:247,page:0},{id:43,width:32,height:34,xoffset:0,yoffset:-24.486,xadvance:24.360000000000003,chnl:15,x:67,y:196,page:0},{id:60,width:30,height:33,xoffset:0,yoffset:-23.331000000000003,xadvance:24.360000000000003,chnl:15,x:101,y:196,page:0},{id:62,width:31,height:33,xoffset:0,yoffset:-23.331000000000003,xadvance:24.360000000000003,chnl:15,x:133,y:196,page:0},{id:117,width:30,height:32,xoffset:0,yoffset:-21.273,xadvance:23.415000000000003,chnl:15,x:166,y:196,page:0},{id:99,width:29,height:32,xoffset:0,yoffset:-21.609,xadvance:20.055,chnl:15,x:198,y:196,page:0},{id:110,width:31,height:32,xoffset:0,yoffset:-21.609,xadvance:23.436,chnl:15,x:229,y:196,page:0},{id:111,width:32,height:32,xoffset:0,yoffset:-21.609,xadvance:23.814,chnl:15,x:262,y:196,page:0},{id:126,width:32,height:26,xoffset:0,yoffset:-16.128,xadvance:24.360000000000003,chnl:15,x:201,y:447,page:0},{id:101,width:31,height:32,xoffset:0,yoffset:-21.609,xadvance:22.176000000000002,chnl:15,x:296,y:196,page:0},{id:114,width:25,height:32,xoffset:0,yoffset:-21.651,xadvance:15.288,chnl:15,x:329,y:196,page:0},{id:115,width:27,height:32,xoffset:0,yoffset:-21.609,xadvance:18.186,chnl:15,x:356,y:196,page:0},{id:97,width:28,height:32,xoffset:0,yoffset:-21.651,xadvance:20.874000000000002,chnl:15,x:385,y:196,page:0},{id:118,width:31,height:31,xoffset:0,yoffset:-21.273,xadvance:21.672,chnl:15,x:415,y:196,page:0},{id:61,width:31,height:29,xoffset:0,yoffset:-19.089000000000002,xadvance:24.360000000000003,chnl:15,x:448,y:196,page:0},{id:120,width:30,height:31,xoffset:0,yoffset:-21.273,xadvance:20.916,chnl:15,x:21,y:145,page:0},{id:58,width:18,height:31,xoffset:0,yoffset:-20.706,xadvance:10.5,chnl:15,x:53,y:145,page:0},{id:122,width:28,height:31,xoffset:0,yoffset:-21.273,xadvance:18.984,chnl:15,x:73,y:145,page:0},{id:95,width:28,height:16,xoffset:0,yoffset:0,xadvance:19.278000000000002,chnl:15,x:235,y:447,page:0},{id:45,width:23,height:24,xoffset:0,yoffset:-14.175,xadvance:15.603000000000002,chnl:15,x:481,y:196,page:0},{id:44,width:17,height:21,xoffset:0,yoffset:-4.956,xadvance:9.534,chnl:15,x:103,y:145,page:0},{id:46,width:18,height:15,xoffset:0,yoffset:-4.956,xadvance:9.912,chnl:15,x:0,y:497,page:0},{id:32,width:0,height:0,xoffset:0,yoffset:0,xadvance:10.752,chnl:15,x:20,y:497,page:0}],Ude={face:"Lato Regular",size:42,bold:0,italic:0,charset:[" ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","\\","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~"],unicode:1,stretchH:100,smooth:1,aa:1,padding:[0,0,0,0],spacing:[2,2]},jde={lineHeight:50.400000000000006,base:41.454,scaleW:512,scaleH:512,pages:1,packed:0,alphaChnl:0,redChnl:0,greenChnl:0,blueChnl:0},qde=[],S$={pages:Hde,chars:$de,info:Ude,common:jde,kernings:qde};class Gde extends Wn{get behavior(){return wu}constructor(e){super(e),this.params=e;const t=CA(S$),i=ci(e.field),s=e.as,o=e.fontSize;this.handle=r=>{const a=i(r);a!==void 0?r[s]=t.measureWidth(a,o):r[s]=0,this._propagate(r)}}}const Kde=65536;class Yde extends Wn{get behavior(){return wu}constructor(e){super(e),this.params=e}reset(){super.reset(),this.initialize()}initialize(){const e=this.params,t=e.as||"lane",i=Qs(e.spacing)?e.spacing:1,s=ci(e.start),o=ci(e.end);if(!e.preference!=!e.preferredOrder)throw new Error('Must specify both "preference" and "preferredOrder"');if(e.preference){const r=new Float64Array(Kde),a=ci(e.preference),l=e.preferredOrder;let c=1/0;this.handle=d=>{const u=s(d);u=0&&r[h]=r.length)throw new Error("Out of lanes!")}r[f]=o(d)+i,d[t]=f,this._propagate(d)}}else{const r=new lS,a=new lS;let l=-1/0,c=0;this.handle=d=>{const u=s(d);for(;r.length&&(r.peekValue()<=u||uci(s)),i=e.as?e.as:t.map(_Q);this.handle=s=>{const o={};for(let r=0;r{const r=s(o);if(Ti(r)){const a=r.match(t);if(a){if(a.length-1!=i.length)throw new Error('The number of RegEx groups and the length of "as" do not match!');for(let l=0;lnew RegExp(h)),i=Ks(e.asValue);if(t.length!=i.length)throw new Error('Lengths of "columnRegex" and "as" are not equal!');const s=e.skipRegex?new RegExp(e.skipRegex):void 0,o=e.asKey||"sample";let r,a,l;const c=h=>{var _;const f=Object.keys(h);for(const v of t)if(!f.some(b=>v.test(b)))throw new Error(`No columns matching the regex ${v.toString()} found in the data!`);const g=new Map;for(const[v,b]of t.entries())for(const y of f){const w=(_=b.exec(y))==null?void 0:_[1];if(w!==void 0){let S=g.get(w);S||(S=[],g.set(w,S)),S[v]=y}}r=[...g.entries()],a=f.filter(v=>!t.some(b=>b.test(v))&&!(s&&s.test(v)));const p=[...a.map(v=>JSON.stringify(v)+": datum["+JSON.stringify(v)+"]"),JSON.stringify(o)+": sampleId",...i.map((v,b)=>JSON.stringify(v)+`: datum[attrs[${b}]]`)];l=new Function("datum","sampleId","attrs",`return { `+p.join(`, `)+` -};`)},d=h=>{r||c(h);for(let f=0;f{c(h),d(h),this.handle=d};this.handle=u,this.beginBatch=h=>{yH(h)&&(this.handle=u),super.beginBatch(h)}}}class Tde extends Hn{get behavior(){return yu}constructor(e){super(e),this.params=e,this.buffer=[]}reset(){this.buffer=[]}handle(e){this.buffer.push(e)}complete(){const e=this.params,t=e.as||["y0","y1"],i=e.sort?zW(e.sort.field,e.sort.order):void 0,s=e.field?di(e.field):()=>1,o=e.groupby.map(d=>di(d)),r=eJ(this.buffer,d=>o.map(u=>u(d)).join()).map(d=>d[1]);let a=d=>!0;if(e.baseField){const d=di(e.baseField);a=u=>d(u)!==null}let l,c;switch(e.offset){case"normalize":l=(d,u)=>d/u,c=(d,u)=>Y0(d,u);break;case"center":l=(d,u)=>d-u/2,c=(d,u)=>Y0(d,u);break;case"information":{const d=Math.log2(e.cardinality??4);l=(u,h)=>u/h,c=(u,h)=>{const g=Y0(u,b=>+!a(b)),p=Y0(u,h),_=p-g;let v=0;for(let b=0;bd,c=(d,u)=>1}for(const d of r){i&&d.sort(i);const u=c(d,s);let h=0;for(const f of d){const g=h+s(f);a(f)&&(f[t[0]]=l(h,u),f[t[1]]=l(g,u),this._propagate(f),h=g)}}super.complete()}}class Nde extends Hn{get behavior(){return fl}constructor(e){super(e),this.params=e;const t=di(e.field??"sequence"),[i,s]=e.as??["pos","sequence"];this.handle=o=>{const r=Object.assign({},o,{[s]:"",[i]:0}),a=t(o);for(let l=0;ln.length,valid:KQ,sum:Y0,min:qE,max:jE,mean:rJ,median:aJ,variance:YQ};class Rde extends Hn{get behavior(){return fl}constructor(e){if(super(e),this.params=e,this.buffer=[],this.ops=[],this.as=[],e.fields){if(e.fields.length!=e.ops.length)throw new Error("Fields and ops must have the same length!");if(e.as&&e.as.length!=e.ops.length)throw new Error('If "as" is defined, "fields" and "as" must have the same length!');e.fields.forEach((t,i)=>{const s=di(t),o=vF[e.ops[i]];this.ops.push(r=>o(r,s)),this.as.push(e.as?e.as[i]:`${e.ops[i]}_${e.fields[i]}`)})}else this.ops.push(t=>vF.count(t)),this.as.push("count")}reset(){super.reset(),this.buffer=[]}handle(e){this.buffer.push(e)}complete(){const e=this.params,t=e==null?void 0:e.groupby;if((t==null?void 0:t.length)>0){const i=t.map(o=>di(o)),s=sL(this.buffer,...i);for(const[o,r]of w4(s)){const a={};for(let l=0;l{a[this.as[c]]=l(r)}),this._propagate(a)}}else{const i={};this.ops.forEach((s,o)=>{i[this.as[o]]=s(this.buffer)}),this._propagate(i)}super.complete()}}const Mde={aggregate:Rde,collect:w$,coverage:rde,filterScoredLabels:cde,filter:dde,flatten:fde,flattenCompressedExons:mde,flattenDelimited:_de,flattenSequence:Nde,formula:vde,identifier:wA,linearizeGenomicCoordinate:S$,measureText:Lde,pileup:kde,project:Ede,regexExtract:Ade,regexFold:Ide,sample:YH,stack:Tde};function Pde(n,e){const t=Mde[n.type];if(t)return new t(n,e);throw new Error("Unknown transform: "+n.type)}function L$(n){if(!k$(n)&&!yF(n))return;const e={...n.format};if(e.type??(e.type=yF(n)&&Fde(Fo(n.url))),e.parse??(e.parse="auto"),!e.type)throw new Error("Format for the data source was not defined and it could not be inferred: "+JSON.stringify(n));return e}function Ode(n){var e;return((e=xM(n))==null?void 0:e.responseType)??"text"}function Fde(n){var e;if(Array.isArray(n)&&(n=n[0]),n)return(e=n.match(/\.(csv|tsv|json)/))==null?void 0:e[1]}const D$=n=>typeof n!="object"?Bde:Wde,Bde=n=>({data:n}),Wde=n=>n;function yF(n){return"url"in n}let Xm=class extends g4{constructor(t){super();zi(this,"view");this.view=t}get identifier(){}setLoadingStatus(t,i){this.view.context.setDataLoadingStatus(this.view,t,i)}get paramMediator(){return this.view.paramMediator}handle(t){throw new Error("Source does not handle incoming data!")}async load(){}repropagate(){this.load()}};function k$(n){return"values"in n}class Vde extends Xm{constructor(e,t){var i;if(super(t),this.params=e,typeof e.values=="string"&&!((i=e==null?void 0:e.format)!=null&&i.type))throw new Error("Data format type (csv, dsv, ...) must be specified if a string is provided!")}get label(){return"inlineSource"}isTrivial(){const e=this.params.values,t=Array.isArray(e)?e[0]:e;return!!(t&&Object.keys(t).length==0&&t.constructor===Object)}loadSynchronously(){const e=this.params.values;let t=[],i=s=>s;if(Array.isArray(e))e.length>0&&(t=e,i=D$(e[0]));else if(typeof e=="object")t=[e];else if(typeof e=="string")t=LM(e,L$(this.params));else throw new Error('"values" in data configuration is not an array, object, or a string!');this.reset(),this.beginBatch({type:"file"});for(const s of t)this._propagate(i(s));this.complete()}async load(){this.loadSynchronously()}}function zde(n){return"url"in n}class Hde extends Xm{constructor(e,t){super(t),this.params=OL(t.paramMediator,e,()=>this.load()),this.baseUrl=t==null?void 0:t.getBaseUrl()}get identifier(){return JSON.stringify({params:this.params,baseUrl:this.baseUrl})}get label(){return"urlSource"}async load(){const e=Fo(this.params.url),t=Array.isArray(e)?e:[e],i=L$(this.params),s=Ode(i.type);if(t.length===0||!t[0]){this.reset(),this.complete();return}const o=async a=>{try{const l=Nb(this.baseUrl,a),c=await fetch(l);if(!c.ok)throw new Error(`${c.status} ${c.statusText}`);return typeof c[s]=="function"?c[s]():c.text()}catch(l){throw new Error(`Could not load data: ${a}. Reason: ${l.message}`)}},r=(a,l)=>{try{const c=LM(a,i);this.beginBatch({type:"file",url:l});for(const d of c)this._propagate(d)}catch(c){throw new Error(`Cannot parse: ${l}: ${c.message}`)}};this.setLoadingStatus("loading"),this.reset();try{await Promise.all(t.map(a=>o(a).then(r))),this.setLoadingStatus("complete")}catch(a){this.setLoadingStatus("error",a.message)}this.complete()}}function $de(n){return"sequence"in n}class Ude extends Xm{constructor(e,t){if(super(t),this.sequence=OL(t.paramMediator,e.sequence,()=>this.loadSynchronously()),!("start"in this.sequence))throw new Error("'start' is missing from sequence parameters!");if(!("stop"in this.sequence))throw new Error("'stop' is missing from sequence parameters!")}get label(){return"sequenceSource"}loadSynchronously(){const e=Fo(this.sequence.as)??"data",t=Fo(this.sequence.start)??0,i=Fo(this.sequence.step)??1,s=Fo(this.sequence.stop);this.reset(),this.beginBatch({type:"file"});for(let o=t;o{this.view.isVisible()&&this.onDomainChanged(this.scaleResolution.getDomain(),this.scaleResolution.getComplexDomain())};this.scaleResolution.addEventListener("domain",s),this.view.context.addBroadcastListener("layoutComputed",s)}get genome(){return this.scaleResolution.getGenome()}onDomainChanged(t,i){}requestRender(){this.view.context.animator.requestRender()}async load(){this.reset(),this.complete()}publishData(t){this.reset(),this.beginBatch({type:"file"});for(const i of t)for(const s of i)this._propagate(s);this.complete(),BA(this.view)}}class jde extends C4{constructor(t,i){const s={axis:{},...t};super(i,s.channel);zi(this,"ticks",[]);this.params=t}get label(){return"axisTickSource"}async load(){this.ticks=null,this.onDomainChanged()}onDomainChanged(){const t=this.scaleResolution.scale,i=this.scaleResolution.getAxisLength(),s=this.params.axis,o=c=>25+60*vH(100,700,c),r=to(s.tickCount)?s.tickCount:Math.round(i/o(i)),a=XH(t,r,s.tickMinStep),l=s.values?QH(t,s.values,a):rce(t,a);if(this.ticks==null||!iS(l,this.ticks)){this.ticks=l;const c=lce(t,r,s.format);this.publishData([l.map(d=>({value:d,label:c(d)}))])}}}class qde extends C4{constructor(e,t){super(t,e.channel)}get label(){return"axisGenomeSource"}async load(){this.publishData([this.genome.chromosomes])}}const Gde="modulepreload",Kde=function(n,e){return new URL(n,e).href},wF={},Xs=function(e,t,i){let s=Promise.resolve();if(t&&t.length>0){const o=document.getElementsByTagName("link"),r=document.querySelector("meta[property=csp-nonce]"),a=(r==null?void 0:r.nonce)||(r==null?void 0:r.getAttribute("nonce"));s=Promise.all(t.map(l=>{if(l=Kde(l,i),l in wF)return;wF[l]=!0;const c=l.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(!!i)for(let f=o.length-1;f>=0;f--){const g=o[f];if(g.href===l&&(!c||g.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${l}"]${d}`))return;const h=document.createElement("link");if(h.rel=c?"stylesheet":Gde,c||(h.as="script",h.crossOrigin=""),h.href=l,a&&h.setAttribute("nonce",a),document.head.appendChild(h),c)return new Promise((f,g)=>{h.addEventListener("load",f),h.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${l}`)))})}))}return s.then(()=>e()).catch(o=>{const r=new Event("vite:preloadError",{cancelable:!0});if(r.payload=o,window.dispatchEvent(r),!r.defaultPrevented)throw o})};function Rb(n,e,t=!0){let i,s=r=>{};return function(...a){return new Promise((l,c)=>{const d=()=>{clearTimeout(i),s=u=>{},l(n(...a))};t&&s("debounced"),clearTimeout(i),s=c,i=window.setTimeout(d,typeof e=="function"?e():e)})}}var Vp,zp,Hp,i1;class W1 extends C4{constructor(){super(...arguments);Oe(this,Vp,new AbortController);Oe(this,zp,[0,0]);Oe(this,Hp,[0,0]);Oe(this,i1,0);zi(this,"params")}setupDebouncing(t){const i=()=>Fo(t.debounce),s=t.debounceMode;if(s=="domain")this.onDomainChanged=Rb(this.onDomainChanged.bind(this),i,!1);else if(s=="window")this.loadInterval=Rb(this.loadInterval.bind(this),i,!1);else throw new Error("Invalid debounceMode: "+s)}onDomainChanged(t){var s;ut(this,Hp,t);const i=Fo((s=this.params)==null?void 0:s.windowSize)??-1;t[1]-t[0]>i||this.callIfWindowsChanged(t,i,async o=>{await this.initializedPromise,this.loadInterval(o)})}reloadLastDomain(){const t=X(this,Hp);ut(this,Hp,[0,0]),ut(this,zp,[0,0]),this.onDomainChanged(t)}async loadInterval(t){}async discretizeAndLoad(t,i){X(this,Vp).abort(),this.setLoadingStatus("loading"),ut(this,Vp,new AbortController);const s=X(this,Vp).signal,o=this.genome.continuousToDiscreteChromosomeIntervals(t);try{const r=await Promise.all(o.map(async a=>i(a,s)));if(!s.aborted)return this.setLoadingStatus("complete"),r}catch(r){if(!s.aborted)throw this.setLoadingStatus("error",r.message),r}}callIfWindowsChanged(t,i,s){const o=[Math.max(Math.floor(t[0]/i)*i,0),Math.min(Math.ceil(t[1]/i)*i,this.genome.totalSize)],r=X(this,zp);(i!==X(this,i1)||o[0]r[1])&&(ut(this,zp,o),ut(this,i1,i),s(o))}}Vp=new WeakMap,zp=new WeakMap,Hp=new WeakMap,i1=new WeakMap;class Yde extends W1{constructor(e,t){const i={channel:"x",windowSize:7e3,debounce:200,debounceMode:"window",...e};if(super(t,i.channel),this.params=i,!this.params.url)throw new Error("No URL provided for IndexedFastaSource");this.setupDebouncing(this.params),this.initializedPromise=new Promise(s=>{Promise.all([Xs(()=>import("./index-BHN4ZNUB.js").then(o=>o.i),__vite__mapDeps([0,1]),import.meta.url),Xs(()=>import("./index-Chnxsq0t.js"),__vite__mapDeps([2,3,0,1,4]),import.meta.url),Xs(()=>import("./index-C3Wx-3vw.js"),__vite__mapDeps([5,3,6,0,1]),import.meta.url)]).then(([{Buffer:o},{IndexedFasta:r},{RemoteFile:a}])=>{typeof window<"u"&&(window.Buffer??(window.Buffer=o));const l=c=>new a(B1(c,this.view.getBaseUrl()));this.fasta=new r({fasta:l(this.params.url),fai:l(this.params.indexUrl??this.params.url+".fai")}),s()})})}get label(){return"bigWigSource"}async loadInterval(e){const t=await this.discretizeAndLoad(e,async(i,s)=>this.fasta.getSequence(i.chrom,i.startPos,i.endPos,{signal:s}).then(o=>({chrom:i.chrom,start:i.startPos,sequence:o})));t&&this.publishData([t])}}var $p,Up,n1,jA;class Zde extends W1{constructor(t,i){const s={pixelsPerBin:2,channel:"x",debounce:200,debounceMode:"window",...t},o=OL(i.paramMediator,s,r=>{r.includes("url")?Le(this,n1,jA).call(this).then(()=>this.reloadLastDomain()):r.includes("pixelsPerBin")&&this.reloadLastDomain()});super(i,o.channel);Oe(this,n1);Oe(this,$p,[]);Oe(this,Up);if(this.params=o,!this.params.url)throw new Error("No URL provided for BigWigSource");this.setupDebouncing(this.params),Le(this,n1,jA).call(this)}get label(){return"bigWigSource"}async onDomainChanged(t){await this.initializedPromise;const i=this.scaleResolution.getAxisLength()||700,s=Xde(t,i,X(this,$p)),o=Math.max(s*i,5e3);this.callIfWindowsChanged(t,o,r=>this.loadInterval(r,s))}async loadInterval(t,i){const s=.5/i/Fo(this.params.pixelsPerBin),o=await this.discretizeAndLoad(t,(r,a)=>X(this,Up).getFeatures(r.chrom,r.startPos,r.endPos,{scale:s,signal:a}).then(l=>l.map(c=>({chrom:r.chrom,start:c.start,end:c.end,score:c.score}))));o&&this.publishData(o)}}$p=new WeakMap,Up=new WeakMap,n1=new WeakSet,jA=function(){return this.initializedPromise=new Promise((t,i)=>{Promise.all([Xs(()=>import("./index-Bz61Bwul.js"),__vite__mapDeps([7,0,1,8,3,6]),import.meta.url),Xs(()=>import("./index-C3Wx-3vw.js"),__vite__mapDeps([5,3,6,0,1]),import.meta.url)]).then(([{BigWig:s},{RemoteFile:o}])=>{ut(this,Up,new s({filehandle:new o(B1(Fo(this.params.url),this.view.getBaseUrl()))})),this.setLoadingStatus("loading"),X(this,Up).getHeader().then(r=>{ut(this,$p,r.zoomLevels.map(a=>a.reductionLevel).reverse()),X(this,$p).push(1),this.setLoadingStatus("complete"),t()}).catch(r=>{this.load(),this.setLoadingStatus("error",`${Fo(this.params.url)}: ${r.message}`),i(r)})})}),this.initializedPromise};function Xde(n,e,t){const i=(n[1]-n[0])/e;return t.find(s=>s{r.includes("url")?Le(this,s1,qA).call(this).then(()=>this.reloadLastDomain()):r.includes("windowSize")&&this.reloadLastDomain()});super(i,o.channel);Oe(this,s1);zi(this,"parser");zi(this,"bbi");zi(this,"parseLine");if(this.params=o,!this.params.url)throw new Error("No URL provided for BigBedSource");this.setupDebouncing(this.params),Le(this,s1,qA).call(this)}get label(){return"bigBedSource"}async loadInterval(t){const i=await this.discretizeAndLoad(t,async(s,o)=>this.bbi.getFeatures(s.chrom,s.startPos,s.endPos,{signal:o}).then(r=>r.map(a=>this.parseLine(s.chrom,a))));i&&this.publishData(i)}}s1=new WeakSet,qA=function(){return this.initializedPromise=new Promise((t,i)=>{Promise.all([Xs(()=>import("./index-CVu7TvAd.js"),__vite__mapDeps([9,1]),import.meta.url),Xs(()=>import("./index-Bz61Bwul.js"),__vite__mapDeps([7,0,1,8,3,6]),import.meta.url),Xs(()=>import("./index-C3Wx-3vw.js"),__vite__mapDeps([5,3,6,0,1]),import.meta.url)]).then(([s,{BigBed:o},{RemoteFile:r}])=>{const a=s.default;this.bbi=new o({filehandle:new r(B1(Fo(this.params.url),this.view.getBaseUrl()))}),this.setLoadingStatus("loading"),this.bbi.getHeader().then(async l=>{this.parser=new a({autoSql:l.autoSql});try{const c=Jde(this.parser);this.parseLine=(d,u)=>c(d,u.start,u.end,u.rest)}catch{this.parseLine=(d,u)=>this.parser.parseLine(`${d} ${u.start} ${u.end} ${u.rest}`)}this.setLoadingStatus("complete"),t()}).catch(l=>{this.load(),this.setLoadingStatus("error",`${Fo(this.params.url)}: ${l.message}`),i(l)})})}),this.initializedPromise};function Jde(n){const e=n.autoSql.fields.filter(b=>b.type).slice(3);let t=0,i="",s=0,o={};const r=" ",a=r.charCodeAt(0),l=48,c=45;function d(){let b=i.indexOf(r,t);b<0&&(b=s);const y=i.substring(t,b);return t=b+1,y}function u(){let b=0,y=i.charCodeAt(t),w=1;y===c&&(w=-1,t++,y=i.charCodeAt(t));do{if(y===a){t++;break}b=b*10+y-l,y=i.charCodeAt(++t)}while(t`${JSON.stringify(b.name)}: ${b.isNumeric?"0":"emptyString"}`),f=new Function(` +};`)},d=h=>{r||c(h);for(let f=0;f{c(h),d(h),this.handle=d};this.handle=u,this.beginBatch=h=>{vH(h)&&(this.handle=u),super.beginBatch(h)}}}class Jde extends Wn{get behavior(){return wu}constructor(e){super(e),this.params=e,this.buffer=[]}reset(){this.buffer=[]}handle(e){this.buffer.push(e)}complete(){const e=this.params,t=e.as||["y0","y1"],i=e.sort?VW(e.sort.field,e.sort.order):void 0,s=e.field?ci(e.field):()=>1,o=e.groupby.map(d=>ci(d)),r=uJ(this.buffer,d=>o.map(u=>u(d)).join()).map(d=>d[1]);let a=d=>!0;if(e.baseField){const d=ci(e.baseField);a=u=>d(u)!==null}let l,c;switch(e.offset){case"normalize":l=(d,u)=>d/u,c=(d,u)=>e_(d,u);break;case"center":l=(d,u)=>d-u/2,c=(d,u)=>e_(d,u);break;case"information":{const d=Math.log2(e.cardinality??4);l=(u,h)=>u/h,c=(u,h)=>{const g=e_(u,b=>+!a(b)),p=e_(u,h),_=p-g;let v=0;for(let b=0;bd,c=(d,u)=>1}for(const d of r){i&&d.sort(i);const u=c(d,s);let h=0;for(const f of d){const g=h+s(f);a(f)&&(f[t[0]]=l(h,u),f[t[1]]=l(g,u),this._propagate(f),h=g)}}super.complete()}}class eue extends Wn{get behavior(){return gl}constructor(e){super(e),this.params=e;const t=ci(e.field??"sequence"),[i,s]=e.as??["pos","sequence"];this.handle=o=>{const r=Object.assign({},o,{[s]:"",[i]:0}),a=t(o);for(let l=0;ln.length,valid:oJ,sum:e_,min:UE,max:$E,mean:_J,median:bJ,variance:rJ};class tue extends Wn{get behavior(){return gl}constructor(e){if(super(e),this.params=e,this.buffer=[],this.ops=[],this.as=[],e.fields){if(e.fields.length!=e.ops.length)throw new Error("Fields and ops must have the same length!");if(e.as&&e.as.length!=e.ops.length)throw new Error('If "as" is defined, "fields" and "as" must have the same length!');e.fields.forEach((t,i)=>{const s=ci(t),o=mF[e.ops[i]];this.ops.push(r=>o(r,s)),this.as.push(e.as?e.as[i]:`${e.ops[i]}_${e.fields[i]}`)})}else this.ops.push(t=>mF.count(t)),this.as.push("count")}reset(){super.reset(),this.buffer=[]}handle(e){this.buffer.push(e)}complete(){const e=this.params,t=e==null?void 0:e.groupby;if((t==null?void 0:t.length)>0){const i=t.map(o=>ci(o)),s=Xx(this.buffer,...i);for(const[o,r]of v4(s)){const a={};for(let l=0;l{a[this.as[c]]=l(r)}),this._propagate(a)}}else{const i={};this.ops.forEach((s,o)=>{i[this.as[o]]=s(this.buffer)}),this._propagate(i)}super.complete()}}const iue={aggregate:tue,collect:y$,coverage:Ede,filterScoredLabels:Tde,filter:Nde,flatten:Pde,flattenCompressedExons:Bde,flattenDelimited:Wde,flattenSequence:eue,formula:zde,identifier:vA,linearizeGenomicCoordinate:C$,measureText:Gde,pileup:Yde,project:Zde,regexExtract:Xde,regexFold:Qde,sample:KH,stack:Jde};function nue(n,e){const t=iue[n.type];if(t)return new t(n,e);throw new Error("Unknown transform: "+n.type)}function x$(n){if(!D$(n)&&!_F(n))return;const e={...n.format};if(e.type??(e.type=_F(n)&&oue(Mo(n.url))),e.parse??(e.parse="auto"),!e.type)throw new Error("Format for the data source was not defined and it could not be inferred: "+JSON.stringify(n));return e}function sue(n){var e;return((e=CM(n))==null?void 0:e.responseType)??"text"}function oue(n){var e;if(Array.isArray(n)&&(n=n[0]),n)return(e=n.match(/\.(csv|tsv|json)/))==null?void 0:e[1]}const L$=n=>typeof n!="object"?rue:aue,rue=n=>({data:n}),aue=n=>n;function _F(n){return"url"in n}let t0=class extends h4{constructor(t){super();Ei(this,"view");this.view=t}get identifier(){}setLoadingStatus(t,i){this.view.context.setDataLoadingStatus(this.view,t,i)}get paramMediator(){return this.view.paramMediator}handle(t){throw new Error("Source does not handle incoming data!")}async load(){}repropagate(){this.load()}};function D$(n){return"values"in n}class lue extends t0{constructor(e,t){var i;if(super(t),this.params=e,typeof e.values=="string"&&!((i=e==null?void 0:e.format)!=null&&i.type))throw new Error("Data format type (csv, dsv, ...) must be specified if a string is provided!")}get label(){return"inlineSource"}isTrivial(){const e=this.params.values,t=Array.isArray(e)?e[0]:e;return!!(t&&Object.keys(t).length==0&&t.constructor===Object)}loadSynchronously(){const e=this.params.values;let t=[],i=s=>s;if(Array.isArray(e))e.length>0&&(t=e,i=L$(e[0]));else if(typeof e=="object")t=[e];else if(typeof e=="string")t=SM(e,x$(this.params));else throw new Error('"values" in data configuration is not an array, object, or a string!');this.reset(),this.beginBatch({type:"file"});for(const s of t)this._propagate(i(s));this.complete()}async load(){this.loadSynchronously()}}function cue(n){return"url"in n}class due extends t0{constructor(e,t){super(t),this.params=AL(t.paramMediator,e,()=>this.load()),this.baseUrl=t==null?void 0:t.getBaseUrl()}get identifier(){return JSON.stringify({params:this.params,baseUrl:this.baseUrl})}get label(){return"urlSource"}async load(){const e=Mo(this.params.url),t=Array.isArray(e)?e:[e],i=x$(this.params),s=sue(i.type);if(t.length===0||!t[0]){this.reset(),this.complete();return}const o=async a=>{try{const l=Mb(this.baseUrl,a),c=await fetch(l);if(!c.ok)throw new Error(`${c.status} ${c.statusText}`);return typeof c[s]=="function"?c[s]():c.text()}catch(l){throw new Error(`Could not load data: ${a}. Reason: ${l.message}`)}},r=(a,l)=>{try{const c=SM(a,i);this.beginBatch({type:"file",url:l});for(const d of c)this._propagate(d)}catch(c){throw new Error(`Cannot parse: ${l}: ${c.message}`)}};this.setLoadingStatus("loading"),this.reset();try{await Promise.all(t.map(a=>o(a).then(r))),this.setLoadingStatus("complete")}catch(a){this.setLoadingStatus("error",a.message)}this.complete()}}function uue(n){return"sequence"in n}class hue extends t0{constructor(e,t){if(super(t),this.sequence=AL(t.paramMediator,e.sequence,()=>this.loadSynchronously()),!("start"in this.sequence))throw new Error("'start' is missing from sequence parameters!");if(!("stop"in this.sequence))throw new Error("'stop' is missing from sequence parameters!")}get label(){return"sequenceSource"}loadSynchronously(){const e=Mo(this.sequence.as)??"data",t=Mo(this.sequence.start)??0,i=Mo(this.sequence.step)??1,s=Mo(this.sequence.stop);this.reset(),this.beginBatch({type:"file"});for(let o=t;o{this.view.isVisible()&&this.onDomainChanged(this.scaleResolution.getDomain(),this.scaleResolution.getComplexDomain())};this.scaleResolution.addEventListener("domain",s),this.view.context.addBroadcastListener("layoutComputed",s)}get genome(){return this.scaleResolution.getGenome()}onDomainChanged(t,i){}requestRender(){this.view.context.animator.requestRender()}async load(){this.reset(),this.complete()}publishData(t){this.reset(),this.beginBatch({type:"file"});for(const i of t)for(const s of i)this._propagate(s);this.complete(),OA(this.view)}}class fue extends y4{constructor(t,i){const s={axis:{},...t};super(i,s.channel);Ei(this,"ticks",[]);this.params=t}get label(){return"axisTickSource"}async load(){this.ticks=null,this.onDomainChanged()}onDomainChanged(){const t=this.scaleResolution.scale,i=this.scaleResolution.getAxisLength(),s=this.params.axis,o=c=>25+60*bH(100,700,c),r=Qs(s.tickCount)?s.tickCount:Math.round(i/o(i)),a=ZH(t,r,s.tickMinStep),l=s.values?XH(t,s.values,a):Ece(t,a);if(this.ticks==null||!YC(l,this.ticks)){this.ticks=l;const c=Ice(t,r,s.format);this.publishData([l.map(d=>({value:d,label:c(d)}))])}}}class gue extends y4{constructor(e,t){super(t,e.channel)}get label(){return"axisGenomeSource"}async load(){this.publishData([this.genome.chromosomes])}}function Pb(n,e,t=!0){let i,s=r=>{};return function(...a){return new Promise((l,c)=>{const d=()=>{clearTimeout(i),s=u=>{},l(n(...a))};t&&s("debounced"),clearTimeout(i),s=c,i=window.setTimeout(d,typeof e=="function"?e():e)})}}var Hp,$p,Up,o1;class z1 extends y4{constructor(){super(...arguments);Pe(this,Hp,new AbortController);Pe(this,$p,[0,0]);Pe(this,Up,[0,0]);Pe(this,o1,0);Ei(this,"params")}setupDebouncing(t){const i=()=>Mo(t.debounce),s=t.debounceMode;if(s=="domain")this.onDomainChanged=Pb(this.onDomainChanged.bind(this),i,!1);else if(s=="window")this.loadInterval=Pb(this.loadInterval.bind(this),i,!1);else throw new Error("Invalid debounceMode: "+s)}onDomainChanged(t){var s;dt(this,Up,t);const i=Mo((s=this.params)==null?void 0:s.windowSize)??-1;t[1]-t[0]>i||this.callIfWindowsChanged(t,i,async o=>{await this.initializedPromise,this.loadInterval(o)})}reloadLastDomain(){const t=X(this,Up);dt(this,Up,[0,0]),dt(this,$p,[0,0]),this.onDomainChanged(t)}async loadInterval(t){}async discretizeAndLoad(t,i){X(this,Hp).abort(),this.setLoadingStatus("loading"),dt(this,Hp,new AbortController);const s=X(this,Hp).signal,o=this.genome.continuousToDiscreteChromosomeIntervals(t);try{const r=await Promise.all(o.map(async a=>i(a,s)));if(!s.aborted)return this.setLoadingStatus("complete"),r}catch(r){if(!s.aborted)throw this.setLoadingStatus("error",r.message),r}}callIfWindowsChanged(t,i,s){const o=[Math.max(Math.floor(t[0]/i)*i,0),Math.min(Math.ceil(t[1]/i)*i,this.genome.totalSize)],r=X(this,$p);(i!==X(this,o1)||o[0]r[1])&&(dt(this,$p,o),dt(this,o1,i),s(o))}}Hp=new WeakMap,$p=new WeakMap,Up=new WeakMap,o1=new WeakMap;class pue extends z1{constructor(e,t){const i={channel:"x",windowSize:7e3,debounce:200,debounceMode:"window",...e};if(super(t,i.channel),this.params=i,!this.params.url)throw new Error("No URL provided for IndexedFastaSource");this.setupDebouncing(this.params),this.initializedPromise=new Promise(s=>{Promise.all([Zn(()=>import("./index-CJAFAeH3.js").then(o=>o.i),__vite__mapDeps([0,1]),import.meta.url),Zn(()=>import("./index-ClLbYkVu.js"),__vite__mapDeps([2,3,0,1,4]),import.meta.url),Zn(()=>import("./index-C8ZlFX0-.js"),__vite__mapDeps([5,3,6,0,1]),import.meta.url)]).then(([{Buffer:o},{IndexedFasta:r},{RemoteFile:a}])=>{typeof window<"u"&&(window.Buffer??(window.Buffer=o));const l=c=>new a(V1(c,this.view.getBaseUrl()));this.fasta=new r({fasta:l(this.params.url),fai:l(this.params.indexUrl??this.params.url+".fai")}),s()})})}get label(){return"bigWigSource"}async loadInterval(e){const t=await this.discretizeAndLoad(e,async(i,s)=>this.fasta.getSequence(i.chrom,i.startPos,i.endPos,{signal:s}).then(o=>({chrom:i.chrom,start:i.startPos,sequence:o})));t&&this.publishData([t])}}var jp,qp,r1,$A;class mue extends z1{constructor(t,i){const s={pixelsPerBin:2,channel:"x",debounce:200,debounceMode:"window",...t},o=AL(i.paramMediator,s,r=>{r.includes("url")?xe(this,r1,$A).call(this).then(()=>this.reloadLastDomain()):r.includes("pixelsPerBin")&&this.reloadLastDomain()});super(i,o.channel);Pe(this,r1);Pe(this,jp,[]);Pe(this,qp);if(this.params=o,!this.params.url)throw new Error("No URL provided for BigWigSource");this.setupDebouncing(this.params),xe(this,r1,$A).call(this)}get label(){return"bigWigSource"}async onDomainChanged(t){await this.initializedPromise;const i=this.scaleResolution.getAxisLength()||700,s=_ue(t,i,X(this,jp)),o=Math.max(s*i,5e3);this.callIfWindowsChanged(t,o,r=>this.loadInterval(r,s))}async loadInterval(t,i){const s=.5/i/Mo(this.params.pixelsPerBin),o=await this.discretizeAndLoad(t,(r,a)=>X(this,qp).getFeatures(r.chrom,r.startPos,r.endPos,{scale:s,signal:a}).then(l=>l.map(c=>({chrom:r.chrom,start:c.start,end:c.end,score:c.score}))));o&&this.publishData(o)}}jp=new WeakMap,qp=new WeakMap,r1=new WeakSet,$A=function(){return this.initializedPromise=new Promise((t,i)=>{Promise.all([Zn(()=>import("./index-BoBOlxMr.js"),__vite__mapDeps([7,0,1,8,3,6]),import.meta.url),Zn(()=>import("./index-C8ZlFX0-.js"),__vite__mapDeps([5,3,6,0,1]),import.meta.url)]).then(([{BigWig:s},{RemoteFile:o}])=>{dt(this,qp,new s({filehandle:new o(V1(Mo(this.params.url),this.view.getBaseUrl()))})),this.setLoadingStatus("loading"),X(this,qp).getHeader().then(r=>{dt(this,jp,r.zoomLevels.map(a=>a.reductionLevel).reverse()),X(this,jp).push(1),this.setLoadingStatus("complete"),t()}).catch(r=>{this.load(),this.setLoadingStatus("error",`${Mo(this.params.url)}: ${r.message}`),i(r)})})}),this.initializedPromise};function _ue(n,e,t){const i=(n[1]-n[0])/e;return t.find(s=>s{r.includes("url")?xe(this,a1,UA).call(this).then(()=>this.reloadLastDomain()):r.includes("windowSize")&&this.reloadLastDomain()});super(i,o.channel);Pe(this,a1);Ei(this,"parser");Ei(this,"bbi");Ei(this,"parseLine");if(this.params=o,!this.params.url)throw new Error("No URL provided for BigBedSource");this.setupDebouncing(this.params),xe(this,a1,UA).call(this)}get label(){return"bigBedSource"}async loadInterval(t){const i=await this.discretizeAndLoad(t,async(s,o)=>this.bbi.getFeatures(s.chrom,s.startPos,s.endPos,{signal:o}).then(r=>r.map(a=>this.parseLine(s.chrom,a))));i&&this.publishData(i)}}a1=new WeakSet,UA=function(){return this.initializedPromise=new Promise((t,i)=>{Promise.all([Zn(()=>import("./index-CRu-ZoZD.js"),__vite__mapDeps([9,1]),import.meta.url),Zn(()=>import("./index-BoBOlxMr.js"),__vite__mapDeps([7,0,1,8,3,6]),import.meta.url),Zn(()=>import("./index-C8ZlFX0-.js"),__vite__mapDeps([5,3,6,0,1]),import.meta.url)]).then(([s,{BigBed:o},{RemoteFile:r}])=>{const a=s.default;this.bbi=new o({filehandle:new r(V1(Mo(this.params.url),this.view.getBaseUrl()))}),this.setLoadingStatus("loading"),this.bbi.getHeader().then(async l=>{this.parser=new a({autoSql:l.autoSql});try{const c=vue(this.parser);this.parseLine=(d,u)=>c(d,u.start,u.end,u.rest)}catch{this.parseLine=(d,u)=>this.parser.parseLine(`${d} ${u.start} ${u.end} ${u.rest}`)}this.setLoadingStatus("complete"),t()}).catch(l=>{this.load(),this.setLoadingStatus("error",`${Mo(this.params.url)}: ${l.message}`),i(l)})})}),this.initializedPromise};function vue(n){const e=n.autoSql.fields.filter(b=>b.type).slice(3);let t=0,i="",s=0,o={};const r=" ",a=r.charCodeAt(0),l=48,c=45;function d(){let b=i.indexOf(r,t);b<0&&(b=s);const y=i.substring(t,b);return t=b+1,y}function u(){let b=0,y=i.charCodeAt(t),w=1;y===c&&(w=-1,t++,y=i.charCodeAt(t));do{if(y===a){t++;break}b=b*10+y-l,y=i.charCodeAt(++t)}while(t`${JSON.stringify(b.name)}: ${b.isNumeric?"0":"emptyString"}`),f=new Function(` const emptyString = ""; return function makeTemplate(chrom, chromStart, chromEnd) { return { @@ -2752,78 +2553,78 @@ chrM 16299`,fF={dm6:Ace,hg18:Ice,hg19:Tce,hg38:Nce,mm9:Rce,mm10:Mce};function Pc ${h.join(`, `)} } - };`)(),g=e.map(b=>{const y=b.type,w=JSON.stringify(b.name);if(["ubyte","int","uint"].includes(y))return`d[${w}] = parseInt();`;if(b.isNumeric)return`d[${w}] = Number(parseString());`;if(["char","string","lstring"].includes(y))return`d[${w}] = parseString();`;throw new Error("Unsupported type: "+y)}),p=eue(g,50).map((b,y)=>Function("parseInt","parseString",`return function parseFieldChunk${y}(d) { + };`)(),g=e.map(b=>{const y=b.type,w=JSON.stringify(b.name);if(["ubyte","int","uint"].includes(y))return`d[${w}] = parseInt();`;if(b.isNumeric)return`d[${w}] = Number(parseString());`;if(["char","string","lstring"].includes(y))return`d[${w}] = parseString();`;throw new Error("Unsupported type: "+y)}),p=yue(g,50).map((b,y)=>Function("parseInt","parseString",`return function parseFieldChunk${y}(d) { ${b.join(` `)} - }`)(u,d));function _(b){i=b,s=b.length,t=0}function v(b,y,w,C){_(C),o=f(b,y,w);for(const L of p)L(o);return o}return v}function eue(n,e){return Array.from({length:Math.ceil(n.length/e)},(t,i)=>n.slice(i*e,i*e+e))}var Fh;class tue extends W1{constructor(t,i){const s={channel:"x",windowSize:2e4,debounce:200,debounceMode:"domain",...t};super(i,s.channel);Oe(this,Fh);zi(this,"chrPrefixFixer",t=>t);if(this.params=s,!this.params.url)throw new Error("No URL provided for BamSource");this.setupDebouncing(this.params),this.initializedPromise=new Promise(o=>{Promise.all([Xs(()=>import("./index-DuacAevT.js"),__vite__mapDeps([10,4,0,1,3,6,8]),import.meta.url),Xs(()=>import("./index-C3Wx-3vw.js"),__vite__mapDeps([5,3,6,0,1]),import.meta.url)]).then(([{BamFile:r},{RemoteFile:a}])=>{const l=c=>new a(B1(c,this.view.getBaseUrl()));ut(this,Fh,new r({bamFilehandle:l(this.params.url),baiFilehandle:l(this.params.indexUrl??this.params.url+".bai")})),X(this,Fh).getHeader().then(c=>{var h,f;const d=this.genome.hasChrPrefix(),u=(f=(h=X(this,Fh).indexToChr)==null?void 0:h[0])==null?void 0:f.refName.startsWith("chr");d&&!u?this.chrPrefixFixer=g=>g.replace("chr",""):!d&&u&&(this.chrPrefixFixer=g=>"chr"+g),o()})})})}get label(){return"bamSource"}async loadInterval(t){const i=await this.discretizeAndLoad(t,async(s,o)=>X(this,Fh).getRecordsForRange(this.chrPrefixFixer(s.chrom),s.startPos,s.endPos,{signal:o}).then(r=>r.map(a=>({chrom:s.chrom,start:a.get("start"),end:a.get("end"),name:a.get("name"),MD:a.get("MD"),cigar:a.get("cigar"),mapq:a.get("mq"),strand:a.get("strand")===1?"+":"-"}))));i&&this.publishData(i)}}Fh=new WeakMap;var o1;class iue extends W1{constructor(t,i){const s={channel:"x",windowSize:3e6,debounce:200,debounceMode:"domain",...t};super(i,s.channel);Oe(this,o1);if(this.params=s,!this.params.url)throw new Error("No URL provided for TabixSource");this.setupDebouncing(this.params),this.initializedPromise=new Promise(o=>{Promise.all([Xs(()=>import("./index-BHN4ZNUB.js").then(r=>r.i),__vite__mapDeps([0,1]),import.meta.url),Xs(()=>import("./index-CP8tDUB0.js"),__vite__mapDeps([11,8,1,0,3,4]),import.meta.url),Xs(()=>import("./index-C3Wx-3vw.js"),__vite__mapDeps([5,3,6,0,1]),import.meta.url)]).then(([{Buffer:r},{TabixIndexedFile:a},{RemoteFile:l}])=>{typeof window<"u"&&(window.Buffer??(window.Buffer=r));const c=d=>new l(B1(d,this.view.getBaseUrl()));ut(this,o1,new a({filehandle:c(this.params.url),tbiFilehandle:c(this.params.indexUrl??this.params.url+".tbi")})),o()})})}async loadInterval(t){const i=await this.discretizeAndLoad(t,async(s,o)=>{const r=[];return await X(this,o1).getLines(s.chrom,s.startPos,s.endPos,{lineCallback:a=>{r.push(a)},signal:o}),this._parseFeatures(r)});i&&this.publishData(i)}_parseFeatures(t){return[]}}o1=new WeakMap;var r1;class nue extends iue{constructor(t,i){super(t,i);Oe(this,r1);Xs(()=>import("./index-CdYj4d87.js"),__vite__mapDeps([12,0,1,3]),import.meta.url).then(s=>{ut(this,r1,s.default)})}get label(){return"gff3Source"}_parseFeatures(t){var s;return(s=X(this,r1))==null?void 0:s.parseStringSync(t.join(` -`),{parseSequences:!1})}}r1=new WeakMap;function sue(n,e){if(k$(n))return new Vde(n,e);if(zde(n))return new Hde(n,e);if($de(n))return new Ude(n,e);if(oue(n))return fue(n.lazy,e);throw new Error("Cannot figure out the data source type: "+JSON.stringify(n))}function oue(n){return"lazy"in n}function rue(n){return(n==null?void 0:n.type)=="axisTicks"}function aue(n){return(n==null?void 0:n.type)=="axisGenome"}function lue(n){return(n==null?void 0:n.type)=="indexedFasta"}function cue(n){return(n==null?void 0:n.type)=="bigwig"}function due(n){return(n==null?void 0:n.type)=="bigbed"}function uue(n){return(n==null?void 0:n.type)=="bam"}function hue(n){return(n==null?void 0:n.type)=="gff3"}function fue(n,e){if(rue(n))return new jde(n,e);if(aue(n))return new qde(n,e);if(lue(n))return new Yde(n,e);if(cue(n))return new Zde(n,e);if(due(n))return new Qde(n,e);if(uue(n))return new tue(n,e);if(hue(n))return new nue(n,e);throw new Error("Cannot figure out the data source type: "+JSON.stringify(n))}function gue(n){const e=E$(n).filter(i=>typeof i=="string"),t=new Function("source","return { "+e.map(i=>JSON.stringify(i)).map(i=>`${i}: source[${i}]`).join(`, -`)+" };");return t.properties=e,t}function E$(n){let e=[];do e=e.concat(Object.keys(n)),n=Object.getPrototypeOf(n);while(n&&n!==Object.prototype);return Array.from(new Set(e))}var jp,a1;class mS extends Hn{constructor(){super({type:"clone"});Oe(this,jp);Oe(this,a1,t=>t);const t=i=>{const s=E$(i);(!X(this,jp)||!iS(s,X(this,jp)))&&(ut(this,jp,s),ut(this,a1,gue(i)));const o=X(this,a1);this.handle=r=>this._propagate(o(r)),this.handle(i)};this.handle=t,this.beginBatch=i=>{yH(i)&&(this.handle=t),super.beginBatch(i)}}get behavior(){return fl}}jp=new WeakMap,a1=new WeakMap;function pue(n){return"name"in n}var l1;class A$ extends Xm{constructor(t,i,s){super(i);Oe(this,l1);this.provider=s,this.params=t}get identifier(){return this.params.name}get label(){return"namedSource"}updateDynamicData(t){ut(this,l1,t),this.loadSynchronously()}loadSynchronously(){const t=X(this,l1)??this.provider(this.params.name)??[];let i=s=>s;if(Array.isArray(t))t.length>0&&(i=D$(t[0]));else throw new Error(`Named data "${this.params.name}" is not an array!`);this.reset(),this.beginBatch({type:"file"});for(const s of t)this._propagate(i(s));this.complete()}async load(){this.loadSynchronously()}}l1=new WeakMap;class I${constructor(){this._dataSourcesByHost=new Map,this._collectorsByHost=new Map,this._observers=new Map}get dataSources(){return[...new Set(this._dataSourcesByHost.values()).values()]}get collectors(){return[...this._collectorsByHost.values()]}addObserver(e,t){let i=this._observers.get(t);i||(i=[],this._observers.set(t,i)),i.push(e)}_relayObserverCallback(e,t){const i=this._observers.get(t);if(i)for(const s of i)s(e)}addDataSource(e,t){this._dataSourcesByHost.set(t,e)}findDataSourceByKey(e){return this._dataSourcesByHost.get(e)}findNamedDataSource(e){let t,i=[];for(const[s,o]of this._dataSourcesByHost.entries())if(o instanceof A$&&e==o.identifier){if(t&&t!==o)throw new Error(`Found multiple instances of named data: ${e}. Data flow optimization is broken (it's a bug).`);t=o,i.push(s)}if(t)return{dataSource:t,hosts:i}}addCollector(e,t){this._collectorsByHost.set(t,e),e.observers.push(i=>this._relayObserverCallback(i,t))}findCollectorByKey(e){return this._collectorsByHost.get(e)}initialize(){for(const e of this.dataSources)e.visit(t=>t.initialize())}}function mue(n,e){const t=new Map,i=[];for(const s of n)t.set(s,{ref:s,children:[]});for(const s of t.values()){const o=t.get(e(s.ref));o?o.children.push(s):i.push(s)}return i}function T$(n,e,t){var s,o;const i=(s=e.preOrder)==null?void 0:s.call(e,n);if(i)return i;for(const r of t(n)){const a=T$(r,e,t);if(a==="stop")return a}return(o=e.postOrder)==null?void 0:o.call(e,n)}function _ue(n,e){return T$(n,e,t=>t.children)}function bue(n,e){const t=[],i=[];let s;const o=e??new I$,r=[];function a(f,g=()=>{}){if(!s)throw g()||new Error("Cannot append data flow node, no parent exist!");return s.addChild(f),s=f,t.push(f),f}function l(f,g){return a(f,()=>new Error("Cannot append a transform because no (inherited) data are available! "))}function c(f,g){for(const p of f){let _;try{_=Pde(p,g)}catch(v){throw console.warn(v),new Error(`Cannot initialize "${p.type}" transform: ${v}`)}_.behavior&yu&&l(new mS),l(_)}}function d(){return t.findLastIndex(f=>f instanceof wA)>t.findLastIndex(f=>f instanceof Xm)}const u=f=>{if(f.spec.data){const g=pue(f.spec.data)?new A$(f.spec.data,f,f.context.getNamedDataFromProvider):sue(f.spec.data,f);s=g,t.push(g),o.addDataSource(g,f)}if(f.spec.transform&&c(f.spec.transform,f),f instanceof Bo){if(!s)throw new Error(`A unit view (${f.getPathString()}) has no (inherited) data source`);const g=vue(f);if(g){r.push(g.rewrite);for(const _ of g.transforms)l(_)}f.mark.isPickingParticipant()&&!d()&&(l(new mS),l(new wA({type:"identifier"})));const p=new w$({type:"collect",groupby:f.getFacetFields(),sort:yue(f,g==null?void 0:g.rewrittenEncoding)});a(p),o.addCollector(p,f)}},h=mue(n.getDescendants(),f=>f.dataParent);for(const f of h)_ue(f,{preOrder:g=>{i.push({view:g.ref,nodeStackDepth:t.length}),u(g.ref)},postOrder:()=>{const{nodeStackDepth:g}=i.pop();t.length=g,s=t.at(-1)}});return r.forEach(f=>f()),o}function vue(n){var o;const e=[],t={},i=[];for(const[r,a]of Object.entries(n.getEncoding())){const l=r;Ab(l)&&kH(a)&&i.push({channel:l,chromPosDef:a})}const s=sL(i,r=>pf(r.channel),r=>r.chromPosDef.chrom);for(const[r,a]of s.entries())for(const[l,c]of a.entries()){const d=[],u=[],h=[];for(const{channel:f,chromPosDef:g}of c){const p=b=>b.replace(/[^A-Za-z0-9_]/g,""),_=["_linearized_",p(g.chrom),"_",p(g.pos)].join(""),v={...((o=n.spec.encoding)==null?void 0:o[f])??n.getEncoding()[f]??{},field:_};delete v.chrom,delete v.pos,!v.type&&g.type&&(v.type=g.type),t[f]=v,d.push(g.pos),h.push(g.offset??0),u.push(_)}e.push(new mS),e.push(new S$({type:"linearizeGenomicCoordinate",channel:r,chrom:l,pos:d,offset:h,as:u},n))}return e.length?{transforms:e,rewrittenEncoding:t,rewrite:()=>{n.spec.encoding={...n.spec.encoding,...t},xle(n.mark,"encoding")}}:void 0}function yue(n,e){var i;const t={...n.getEncoding(),...e}.x;if(zo(t)&&(i=n.getScaleResolution("x"))!=null&&i.isZoomable()){if(wu(t))return"buildIndex"in t&&t.buildIndex?{field:t.field}:null;if(!I1(t)){if(T1(t))throw new Error("A zoomable x channel must be mapped to a field.")}}}function N$(n,e=void 0){if(n.parent!==e)return!1;for(const t of n.children)if(!N$(t,n))return!1;return!0}function GA(n,e=!1){if(n.behavior&f4&&(e=!0),n instanceof mS)if(e)e=!1;else{const t=n.children[0];n.excise(),t&&GA(t,e);return}n.behavior&fl&&(e=!1);for(let t=0,i=n.children.length;t1)}function wue(n){const e=[...n._dataSourcesByHost.entries()],t=new Map;for(const i of e){const s=i[1];s.identifier&&!t.has(s.identifier)&&t.set(s.identifier,s)}n._dataSourcesByHost.clear();for(let[i,s]of e){const o=t.get(s.identifier);o&&(o.adoptChildrenOf(s),s=o),n.addDataSource(s,i)}}function Cue(n){if(GA(n),!N$(n))throw new Error("Encountered a bug! There's a problem in the data flow structure.")}function Sue(n){wue(n);for(const e of n.dataSources)Cue(e)}function xue(n){const e=new Set;n.visit(t=>{for(const i of Object.values(t.resolutions.scale)){const s=i.name;if(s&&e.has(s))throw new Error(`The same scale name "${s}" occurs in multiple scale resolutions!`);e.add(s)}})}function Lue(n){for(const e of Zm){const t=n.getScaleResolution(e);t&&!t.name&&t.isZoomable()&&(t.name=`${e}_at_root`)}}async function Due(n,e,t){const i=n.import;if(!("url"in i))throw new Error("Not an url import: "+JSON.stringify(i));const s=Nb(e,i.url);let o;try{const r=await fetch(s);if(!r.ok)throw new Error(`${r.status} ${r.statusText}`);o=await r.json()}catch(r){throw new Error(`Could not load imported view spec: ${s}. Reason: ${r.message}`)}if(t.isViewSpec(o))return o.baseUrl=Nb(n$(i.url),o.baseUrl),o;throw new Error(`The imported spec "${s}" is not a view spec: ${JSON.stringify(n)}`)}function kue(n){const e=n.getSize(),t=n.getPadding(),i=(s,o)=>s.grow>0?void 0:s.px+o;return{width:i(e.width,t.horizontalTotal),height:i(e.height,t.verticalTotal)}}function _l(n){return()=>n}const $r=class $r{static create(e,t,i,s){return new $r(_l(e),_l(t),_l(i),_l(s))}_offset(e,t){const i=this["_"+e];if(t===0)return i;switch(typeof t){case"number":return()=>i()+t;case"function":return()=>i()+t();default:throw new Error("Not a number of function")}}_passThrough(e){return this._offset(e,0)}constructor(e,t,i,s){this._x=e,this._y=t,this._width=i,this._height=s}get x(){return this._x()}get y(){return this._y()}get width(){return this._width()}get height(){return this._height()}get x2(){return this._x()+this._width()}get y2(){return this._y()+this._height()}equals(e){return e?this===e||this.x===e.x&&this.y===e.y&&this.width===e.width&&this.height===e.height:!1}modify(e){if(!Object.keys(e).length)return this;const t=i=>{const s=e[i];return typeof s=="number"?_l(s):typeof s=="function"?s:this._passThrough(i)};return new $r(t("x"),t("y"),t("width"),t("height"))}translate(e,t){return e===0&&t===0?this:new $r(this._offset("x",e),this._offset("y",t),this._passThrough("width"),this._passThrough("height"))}translateBy(e){return this.translate(e.x,e.y)}expand(e,t=1){return e.left==0&&e.top==0&&e.right==0&&e.bottom==0?this:new $r(e.left?this._offset("x",-e.left*t):this._passThrough("x"),e.top?this._offset("y",-e.top*t):this._passThrough("y"),e.width?this._offset("width",e.width*t):this._passThrough("width"),e.height?this._offset("height",e.height*t):this._passThrough("height"))}shrink(e){return this.expand(e,-1)}intersect(e){return this===e||e==null?this:new $r(()=>Math.max(this.x,e.x),()=>Math.max(this.y,e.y),()=>Math.min(this.x2,e.x2)-Math.max(this.x,e.x),()=>Math.min(this.y2,e.y2)-Math.max(this.y,e.y))}union(e){return this===e||e==null?this:new $r(()=>Math.min(this.x,e.x),()=>Math.min(this.y,e.y),()=>Math.max(this.x2,e.x2)-Math.min(this.x,e.x),()=>Math.max(this.y2,e.y2)-Math.min(this.y,e.y))}isDefined(){return this.width>=0&&this.height>=0}flatten(){return new $r(_l(this.x),_l(this.y),_l(this.width),_l(this.height))}containsPoint(e,t){return e>=this.x&&e=this.y&&t()=>{e&&r()},s=r=>()=>{e&&t&&r()},o=sL(this.buffer.reverse(),r=>r.mark);for(const[r,a]of[...o.entries()].reverse()){if(!r.isReady())continue;this.batch.push(()=>{e=r.unitView.getEffectiveOpacity()>0}),this.batch.push(...r.prepareRender(this.globalOptions).map(c=>i(c)));let l;for(const c of a){const d=c.coords;d.equals(l)||this.batch.push(i(()=>{t=r.setViewport(d,c.clipRect)})),this.batch.push(s(c.callback)),l=c.coords}}}}class Eue extends R${constructor(...e){super({}),this.contexts=e}pushView(e,t){for(const i of this.contexts)i.pushView(e,t)}popView(e){for(const t of this.contexts)t.popView(e)}renderMark(e,t){for(const i of this.contexts)i.renderMark(e,t)}}class Aue{constructor(e,t){this.point=e,this.uiEvent=t,this.stopped=!1,this.target=void 0}stopPropagation(){this.stopped=!0}get type(){return this.uiEvent.type}}class Ba{static fromMouseEvent(e){return new Ba(e.clientX,e.clientY)}constructor(e,t){this.x=e,this.y=t}subtract(e){return new Ba(this.x-e.x,this.y-e.y)}add(e){return new Ba(this.x-e.x,this.y-e.y)}multiply(e){return new Ba(this.x*e,this.y*e)}get length(){return Math.sqrt(this.x**2+this.y**2)}equals(e){return e?e===this||e.x===this.x&&e.y===this.y:!1}}const Iue=n=>new Promise(e=>setTimeout(e,n));function Tue(n){const e=n.requestAnimationFrame||window.requestAnimationFrame,t=n.signal,i=()=>new Promise((s,o)=>{if(t!=null&&t.aborted)return o("aborted");const r=performance.now(),a=r+(n.duration||1e3),l=typeof n.from=="number"?n.from:0,c=typeof n.to=="number"?n.to:1,d=n.easingFunction||(p=>p),u=p=>(p-r)/(a-r),h=p=>p*(c-l)+l,f=p=>Math.max(0,Math.min(1,p)),g=p=>{t!=null&&t.aborted?o("aborted"):(n.onUpdate(h(d(f(u(p))))),p=0&&this.transitions.splice(t,1)}requestRender(){this._renderRequested?this._warn&&console.warn("Render already requested!"):(this._renderRequested=!0,window.requestAnimationFrame(e=>{this._renderRequested=!1;const t=this.transitions;this.transitions=[];let i;for(;i=t.shift();)i(e);this._renderCallback(e)}))}transition(e){return Tue({requestAnimationFrame:t=>this.requestTransition(t),...e})}}function S4(n,e,t,i,s){let o=0,r=!0,a=structuredClone(s),l=a;function c(h,f,g,p){return f+(h-f)*Math.pow(2,-g/p)}function d(h){if(r)return;const f=h-o;o=h;for(const p of Object.keys(l))a[p]=c(a[p],l[p],f,t);e(a);let g=-1/0;for(const p of Object.keys(l))g=Math.max(g,Math.abs(l[p]-a[p]));gd(p))}function u(h){l=h,r&&(r=!1,o=+document.timeline.currentTime,d(o))}return u.stop=()=>{r=!0},u}class Rue{constructor(e){this.genomes=new Map,this.baseUrl=e}async initialize(e){const t=new Fce(e);return this.genomes.set(t.name,t),Promise.all([...this.genomes.values()].map(i=>i.load(this.baseUrl)))}getGenome(e){if(!this.genomes.size)throw new Error("No genomes have been configured!");if(e){const t=this.genomes.get(e);if(!t)throw new Error(`No genome with the name ${e} has been configured!`);return t}else{if(this.genomes.size>1)throw new Error("Cannot pick a default genome! More than one have been configured!");return this.genomes.values().next().value}}}const Mue=""+new URL("Lato-Regular-BEY4SZ9T.png",import.meta.url).href,Pue={thin:100,light:300,regular:400,normal:400,medium:500,bold:700,black:900};class Oue{constructor(e){this._webGLHelper=e,this.fontRepository="https://raw.githubusercontent.com/etiennepinchon/aframe-fonts/master/fonts/",this._fonts=new gc([],JSON.stringify),this._metadataPromises=new Map,this._fontPromises=new Map,this._promises=[],this._defaultFontEntry={metrics:xA(x$),texture:e?this._createTextureNow(Mue):void 0}}async waitUntilReady(){await Promise.all(this._promises)}getFont(e,t="normal",i="regular"){if(Ti(i)&&(i=Pue[i.toLowerCase()],!i))throw new Error("Unknown font weight: "+i);const s={family:e,style:t,weight:i};let o=this._fonts.get(s);return o||(o={metrics:void 0,texture:void 0},this._fonts.set(s,o),this._promises.push(this._loadFontEntry(o,s))),o}async _loadFontEntry(e,t){try{const i=await this._loadMetadata(t.family),s=Bue(i,t),o=this.fontRepository+SF(t.family)+"/"+s.replace(/\.\w+/,""),r=this._createTexture(o+".png"),a=this._loadFont(o+".json");e.texture=await r,e.metrics=await a}catch{console.warn(`Cannot load font: "${t.family}". Using the embedded default font.`),e.metrics=this._defaultFontEntry.metrics,e.texture=this._defaultFontEntry.texture}}_loadFont(e){let t=this._fontPromises.get(e);return t||(t=fetch(e).then(i=>{if(!i.ok)throw new Error("Could not load font: "+i.status);return i}).then(i=>i.json()).then(i=>xA(i)),this._fontPromises.set(e,t)),t}_loadMetadata(e){const t=SF(e);let i=this._metadataPromises.get(t);if(!i){const s=this.fontRepository+t+"/METADATA.pb";i=fetch(s).then(o=>{if(!o.ok)throw new Error("Could not load font metadata. Response status: "+o.status+", url: "+s);return o}).then(o=>o.text()).then(o=>Fue(o)).catch(o=>{console.warn(o.message)}),this._metadataPromises.set(t,i)}return i}getDefaultFont(){return this._defaultFontEntry}_createTexture(e){const t=this._webGLHelper.gl;return new Promise((i,s)=>{Sb(t,{src:e,min:t.LINEAR},(o,r,a)=>{o?s(o):i(r)})})}_createTextureNow(e){const t=this._webGLHelper.gl;let i;const s=new Promise((o,r)=>{i=Sb(t,{src:e,min:t.LINEAR},(a,l,c)=>{a?r(a):o(l)})});return this._promises.push(s),i}}function SF(n){return n.toLowerCase().replaceAll(/[^\w]/g,"")}function Fue(n){const e=n.split(` -`),t=[];let i;for(const s of e)if(s.startsWith("fonts {")&&(i={name:void 0,style:void 0,weight:void 0,filename:void 0,post_script_name:void 0,full_name:void 0,copyright:void 0}),s.startsWith("}")&&(t.push(i),i=void 0),i){let o=s.match(/^\s*([A-Za-z_]+):[ ]?"(.*)"$/);if(o){const r=o[1];i[r]=o[2]}if(o=s.match(/^\s*([A-Za-z_]+):[ ]?(\d+)$/),o){const r=o[1];i[r]=+o[2]}}return t}function Bue(n,e){let t,i=Number.POSITIVE_INFINITY;for(const s of n)if(e.family.localeCompare(s.name,void 0,{sensitivity:"accent"})==0&&e.style==s.style){const o=Math.abs(e.weight-s.weight);o"))i={identifier:s.match(/>(\S+)/)[1],sequence:""},t.push(i);else if(i)i.sequence+=s.trim();else throw new Error("Invalid fasta file!");return t}class Vue{constructor(e,t){this.animator=e,this.disabled=!!t,this.maxDistance=500,this.callback=null,this.targetValue=0,this.lastValue=0,this.smoother=S4(e,i=>{var o;const s=i.x-this.lastValue;this.lastValue=i.x,(o=this.callback)==null||o.call(this,s)},40,.1,{x:0})}cancel(){this.lastValue!==this.targetValue&&(this.targetValue=$W([this.lastValue,this.targetValue],.3),this.smoother({x:this.targetValue}))}setMomentum(e,t){if(this.disabled){t(e);return}this.callback=t;const i=dm(this.targetValue+e-this.lastValue,-this.maxDistance,this.maxDistance);this.targetValue=this.lastValue+i,this.smoother({x:this.targetValue})}}function zue(n){const e={},t=["string","number","boolean"],i=["wheelDelta","wheelDeltaX","wheelDeltaY"];for(const s in n){const o=s;!i.includes(s)&&t.includes(typeof n[o])&&(e[o]=n[o])}return e}const xF=new Map;async function Hue(n,e,t){const i=n.symbol;let s=xF.get(i)??await jue(n.symbol);return s?(xF.set(i,s),It` + }`)(u,d));function _(b){i=b,s=b.length,t=0}function v(b,y,w,S){_(S),o=f(b,y,w);for(const L of p)L(o);return o}return v}function yue(n,e){return Array.from({length:Math.ceil(n.length/e)},(t,i)=>n.slice(i*e,i*e+e))}var Fh;class wue extends z1{constructor(t,i){const s={channel:"x",windowSize:2e4,debounce:200,debounceMode:"domain",...t};super(i,s.channel);Pe(this,Fh);Ei(this,"chrPrefixFixer",t=>t);if(this.params=s,!this.params.url)throw new Error("No URL provided for BamSource");this.setupDebouncing(this.params),this.initializedPromise=new Promise(o=>{Promise.all([Zn(()=>import("./index-N9VUB_9p.js"),__vite__mapDeps([10,4,0,1,3,6,8]),import.meta.url),Zn(()=>import("./index-C8ZlFX0-.js"),__vite__mapDeps([5,3,6,0,1]),import.meta.url)]).then(([{BamFile:r},{RemoteFile:a}])=>{const l=c=>new a(V1(c,this.view.getBaseUrl()));dt(this,Fh,new r({bamFilehandle:l(this.params.url),baiFilehandle:l(this.params.indexUrl??this.params.url+".bai")})),X(this,Fh).getHeader().then(c=>{var h,f;const d=this.genome.hasChrPrefix(),u=(f=(h=X(this,Fh).indexToChr)==null?void 0:h[0])==null?void 0:f.refName.startsWith("chr");d&&!u?this.chrPrefixFixer=g=>g.replace("chr",""):!d&&u&&(this.chrPrefixFixer=g=>"chr"+g),o()})})})}get label(){return"bamSource"}async loadInterval(t){const i=await this.discretizeAndLoad(t,async(s,o)=>X(this,Fh).getRecordsForRange(this.chrPrefixFixer(s.chrom),s.startPos,s.endPos,{signal:o}).then(r=>r.map(a=>({chrom:s.chrom,start:a.get("start"),end:a.get("end"),name:a.get("name"),MD:a.get("MD"),cigar:a.get("cigar"),mapq:a.get("mq"),strand:a.get("strand")===1?"+":"-"}))));i&&this.publishData(i)}}Fh=new WeakMap;var l1;class Cue extends z1{constructor(t,i){const s={channel:"x",windowSize:3e6,debounce:200,debounceMode:"domain",...t};super(i,s.channel);Pe(this,l1);if(this.params=s,!this.params.url)throw new Error("No URL provided for TabixSource");this.setupDebouncing(this.params),this.initializedPromise=new Promise(o=>{Promise.all([Zn(()=>import("./index-CJAFAeH3.js").then(r=>r.i),__vite__mapDeps([0,1]),import.meta.url),Zn(()=>import("./index-5ps_llgo.js"),__vite__mapDeps([11,8,1,0,3,6,4]),import.meta.url),Zn(()=>import("./index-C8ZlFX0-.js"),__vite__mapDeps([5,3,6,0,1]),import.meta.url)]).then(([{Buffer:r},{TabixIndexedFile:a},{RemoteFile:l}])=>{typeof window<"u"&&(window.Buffer??(window.Buffer=r));const c=d=>new l(V1(d,this.view.getBaseUrl()));dt(this,l1,new a({filehandle:c(this.params.url),tbiFilehandle:c(this.params.indexUrl??this.params.url+".tbi")})),o()})})}async loadInterval(t){const i=await this.discretizeAndLoad(t,async(s,o)=>{const r=[];return await X(this,l1).getLines(s.chrom,s.startPos,s.endPos,{lineCallback:a=>{r.push(a)},signal:o}),this._parseFeatures(r)});i&&this.publishData(i)}_parseFeatures(t){return[]}}l1=new WeakMap;var c1;class Sue extends Cue{constructor(t,i){super(t,i);Pe(this,c1);Zn(()=>import("./index-bwxybPiq.js"),__vite__mapDeps([12,0,1,3]),import.meta.url).then(s=>{dt(this,c1,s.default)})}get label(){return"gff3Source"}_parseFeatures(t){var s;return(s=X(this,c1))==null?void 0:s.parseStringSync(t.join(` +`),{parseSequences:!1})}}c1=new WeakMap;function xue(n,e){if(D$(n))return new lue(n,e);if(cue(n))return new due(n,e);if(uue(n))return new hue(n,e);if(Lue(n))return Rue(n.lazy,e);throw new Error("Cannot figure out the data source type: "+JSON.stringify(n))}function Lue(n){return"lazy"in n}function Due(n){return(n==null?void 0:n.type)=="axisTicks"}function kue(n){return(n==null?void 0:n.type)=="axisGenome"}function Eue(n){return(n==null?void 0:n.type)=="indexedFasta"}function Aue(n){return(n==null?void 0:n.type)=="bigwig"}function Iue(n){return(n==null?void 0:n.type)=="bigbed"}function Tue(n){return(n==null?void 0:n.type)=="bam"}function Nue(n){return(n==null?void 0:n.type)=="gff3"}function Rue(n,e){if(Due(n))return new fue(n,e);if(kue(n))return new gue(n,e);if(Eue(n))return new pue(n,e);if(Aue(n))return new mue(n,e);if(Iue(n))return new bue(n,e);if(Tue(n))return new wue(n,e);if(Nue(n))return new Sue(n,e);throw new Error("Cannot figure out the data source type: "+JSON.stringify(n))}function Mue(n){const e=k$(n).filter(i=>typeof i=="string"),t=new Function("source","return { "+e.map(i=>JSON.stringify(i)).map(i=>`${i}: source[${i}]`).join(`, +`)+" };");return t.properties=e,t}function k$(n){let e=[];do e=e.concat(Object.keys(n)),n=Object.getPrototypeOf(n);while(n&&n!==Object.prototype);return Array.from(new Set(e))}var Gp,d1;class cS extends Wn{constructor(){super({type:"clone"});Pe(this,Gp);Pe(this,d1,t=>t);const t=i=>{const s=k$(i);(!X(this,Gp)||!YC(s,X(this,Gp)))&&(dt(this,Gp,s),dt(this,d1,Mue(i)));const o=X(this,d1);this.handle=r=>this._propagate(o(r)),this.handle(i)};this.handle=t,this.beginBatch=i=>{vH(i)&&(this.handle=t),super.beginBatch(i)}}get behavior(){return gl}}Gp=new WeakMap,d1=new WeakMap;function Pue(n){return"name"in n}var u1;class E$ extends t0{constructor(t,i,s){super(i);Pe(this,u1);this.provider=s,this.params=t}get identifier(){return this.params.name}get label(){return"namedSource"}updateDynamicData(t){dt(this,u1,t),this.loadSynchronously()}loadSynchronously(){const t=X(this,u1)??this.provider(this.params.name)??[];let i=s=>s;if(Array.isArray(t))t.length>0&&(i=L$(t[0]));else throw new Error(`Named data "${this.params.name}" is not an array!`);this.reset(),this.beginBatch({type:"file"});for(const s of t)this._propagate(i(s));this.complete()}async load(){this.loadSynchronously()}}u1=new WeakMap;class A${constructor(){this._dataSourcesByHost=new Map,this._collectorsByHost=new Map,this._observers=new Map}get dataSources(){return[...new Set(this._dataSourcesByHost.values()).values()]}get collectors(){return[...this._collectorsByHost.values()]}addObserver(e,t){let i=this._observers.get(t);i||(i=[],this._observers.set(t,i)),i.push(e)}_relayObserverCallback(e,t){const i=this._observers.get(t);if(i)for(const s of i)s(e)}addDataSource(e,t){this._dataSourcesByHost.set(t,e)}findDataSourceByKey(e){return this._dataSourcesByHost.get(e)}findNamedDataSource(e){let t,i=[];for(const[s,o]of this._dataSourcesByHost.entries())if(o instanceof E$&&e==o.identifier){if(t&&t!==o)throw new Error(`Found multiple instances of named data: ${e}. Data flow optimization is broken (it's a bug).`);t=o,i.push(s)}if(t)return{dataSource:t,hosts:i}}addCollector(e,t){this._collectorsByHost.set(t,e),e.observers.push(i=>this._relayObserverCallback(i,t))}findCollectorByKey(e){return this._collectorsByHost.get(e)}initialize(){for(const e of this.dataSources)e.visit(t=>t.initialize())}}function Oue(n,e){const t=new Map,i=[];for(const s of n)t.set(s,{ref:s,children:[]});for(const s of t.values()){const o=t.get(e(s.ref));o?o.children.push(s):i.push(s)}return i}function I$(n,e,t){var s,o;const i=(s=e.preOrder)==null?void 0:s.call(e,n);if(i)return i;for(const r of t(n)){const a=I$(r,e,t);if(a==="stop")return a}return(o=e.postOrder)==null?void 0:o.call(e,n)}function Fue(n,e){return I$(n,e,t=>t.children)}function Bue(n,e){const t=[],i=[];let s;const o=e??new A$,r=[];function a(f,g=()=>{}){if(!s)throw g()||new Error("Cannot append data flow node, no parent exist!");return s.addChild(f),s=f,t.push(f),f}function l(f,g){return a(f,()=>new Error("Cannot append a transform because no (inherited) data are available! "))}function c(f,g){for(const p of f){let _;try{_=nue(p,g)}catch(v){throw console.warn(v),new Error(`Cannot initialize "${p.type}" transform: ${v}`)}_.behavior&wu&&l(new cS),l(_)}}function d(){return t.findLastIndex(f=>f instanceof vA)>t.findLastIndex(f=>f instanceof t0)}const u=f=>{if(f.spec.data){const g=Pue(f.spec.data)?new E$(f.spec.data,f,f.context.getNamedDataFromProvider):xue(f.spec.data,f);s=g,t.push(g),o.addDataSource(g,f)}if(f.spec.transform&&c(f.spec.transform,f),f instanceof Po){if(!s)throw new Error(`A unit view (${f.getPathString()}) has no (inherited) data source`);const g=Wue(f);if(g){r.push(g.rewrite);for(const _ of g.transforms)l(_)}f.mark.isPickingParticipant()&&!d()&&(l(new cS),l(new vA({type:"identifier"})));const p=new y$({type:"collect",groupby:f.getFacetFields(),sort:Vue(f,g==null?void 0:g.rewrittenEncoding)});a(p),o.addCollector(p,f)}},h=Oue(n.getDescendants(),f=>f.dataParent);for(const f of h)Fue(f,{preOrder:g=>{i.push({view:g.ref,nodeStackDepth:t.length}),u(g.ref)},postOrder:()=>{const{nodeStackDepth:g}=i.pop();t.length=g,s=t.at(-1)}});return r.forEach(f=>f()),o}function Wue(n){var o;const e=[],t={},i=[];for(const[r,a]of Object.entries(n.getEncoding())){const l=r;Tb(l)&&DH(a)&&i.push({channel:l,chromPosDef:a})}const s=Xx(i,r=>bf(r.channel),r=>r.chromPosDef.chrom);for(const[r,a]of s.entries())for(const[l,c]of a.entries()){const d=[],u=[],h=[];for(const{channel:f,chromPosDef:g}of c){const p=b=>b.replace(/[^A-Za-z0-9_]/g,""),_=["_linearized_",p(g.chrom),"_",p(g.pos)].join(""),v={...((o=n.spec.encoding)==null?void 0:o[f])??n.getEncoding()[f]??{},field:_};delete v.chrom,delete v.pos,!v.type&&g.type&&(v.type=g.type),t[f]=v,d.push(g.pos),h.push(g.offset??0),u.push(_)}e.push(new cS),e.push(new C$({type:"linearizeGenomicCoordinate",channel:r,chrom:l,pos:d,offset:h,as:u},n))}return e.length?{transforms:e,rewrittenEncoding:t,rewrite:()=>{n.spec.encoding={...n.spec.encoding,...t},qle(n.mark,"encoding")}}:void 0}function Vue(n,e){var i;const t={...n.getEncoding(),...e}.x;if(Vo(t)&&(i=n.getScaleResolution("x"))!=null&&i.isZoomable()){if(Cu(t))return"buildIndex"in t&&t.buildIndex?{field:t.field}:null;if(!N1(t)){if(R1(t))throw new Error("A zoomable x channel must be mapped to a field.")}}}function T$(n,e=void 0){if(n.parent!==e)return!1;for(const t of n.children)if(!T$(t,n))return!1;return!0}function jA(n,e=!1){if(n.behavior&u4&&(e=!0),n instanceof cS)if(e)e=!1;else{const t=n.children[0];n.excise(),t&&jA(t,e);return}n.behavior&gl&&(e=!1);for(let t=0,i=n.children.length;t1)}function zue(n){const e=[...n._dataSourcesByHost.entries()],t=new Map;for(const i of e){const s=i[1];s.identifier&&!t.has(s.identifier)&&t.set(s.identifier,s)}n._dataSourcesByHost.clear();for(let[i,s]of e){const o=t.get(s.identifier);o&&(o.adoptChildrenOf(s),s=o),n.addDataSource(s,i)}}function Hue(n){if(jA(n),!T$(n))throw new Error("Encountered a bug! There's a problem in the data flow structure.")}function $ue(n){zue(n);for(const e of n.dataSources)Hue(e)}function Uue(n){const e=new Set;n.visit(t=>{for(const i of Object.values(t.resolutions.scale)){const s=i.name;if(s&&e.has(s))throw new Error(`The same scale name "${s}" occurs in multiple scale resolutions!`);e.add(s)}})}function jue(n){for(const e of e0){const t=n.getScaleResolution(e);t&&!t.name&&t.isZoomable()&&(t.name=`${e}_at_root`)}}async function que(n,e,t){const i=n.import;if(!("url"in i))throw new Error("Not an url import: "+JSON.stringify(i));const s=Mb(e,i.url);let o;try{const r=await fetch(s);if(!r.ok)throw new Error(`${r.status} ${r.statusText}`);o=await r.json()}catch(r){throw new Error(`Could not load imported view spec: ${s}. Reason: ${r.message}`)}if(t.isViewSpec(o))return o.baseUrl=Mb(i$(i.url),o.baseUrl),o;throw new Error(`The imported spec "${s}" is not a view spec: ${JSON.stringify(n)}`)}function Gue(n){const e=n.getSize(),t=n.getPadding(),i=(s,o)=>s.grow>0?void 0:s.px+o;return{width:i(e.width,t.horizontalTotal),height:i(e.height,t.verticalTotal)}}function bl(n){return()=>n}const Hr=class Hr{static create(e,t,i,s){return new Hr(bl(e),bl(t),bl(i),bl(s))}_offset(e,t){const i=this["_"+e];if(t===0)return i;switch(typeof t){case"number":return()=>i()+t;case"function":return()=>i()+t();default:throw new Error("Not a number of function")}}_passThrough(e){return this._offset(e,0)}constructor(e,t,i,s){this._x=e,this._y=t,this._width=i,this._height=s}get x(){return this._x()}get y(){return this._y()}get width(){return this._width()}get height(){return this._height()}get x2(){return this._x()+this._width()}get y2(){return this._y()+this._height()}equals(e){return e?this===e||this.x===e.x&&this.y===e.y&&this.width===e.width&&this.height===e.height:!1}modify(e){if(!Object.keys(e).length)return this;const t=i=>{const s=e[i];return typeof s=="number"?bl(s):typeof s=="function"?s:this._passThrough(i)};return new Hr(t("x"),t("y"),t("width"),t("height"))}translate(e,t){return e===0&&t===0?this:new Hr(this._offset("x",e),this._offset("y",t),this._passThrough("width"),this._passThrough("height"))}translateBy(e){return this.translate(e.x,e.y)}expand(e,t=1){return e.left==0&&e.top==0&&e.right==0&&e.bottom==0?this:new Hr(e.left?this._offset("x",-e.left*t):this._passThrough("x"),e.top?this._offset("y",-e.top*t):this._passThrough("y"),e.width?this._offset("width",e.width*t):this._passThrough("width"),e.height?this._offset("height",e.height*t):this._passThrough("height"))}shrink(e){return this.expand(e,-1)}intersect(e){return this===e||e==null?this:new Hr(()=>Math.max(this.x,e.x),()=>Math.max(this.y,e.y),()=>Math.min(this.x2,e.x2)-Math.max(this.x,e.x),()=>Math.min(this.y2,e.y2)-Math.max(this.y,e.y))}union(e){return this===e||e==null?this:new Hr(()=>Math.min(this.x,e.x),()=>Math.min(this.y,e.y),()=>Math.max(this.x2,e.x2)-Math.min(this.x,e.x),()=>Math.max(this.y2,e.y2)-Math.min(this.y,e.y))}isDefined(){return this.width>=0&&this.height>=0}flatten(){return new Hr(bl(this.x),bl(this.y),bl(this.width),bl(this.height))}containsPoint(e,t){return e>=this.x&&e=this.y&&t()=>{e&&r()},s=r=>()=>{e&&t&&r()},o=Xx(this.buffer.reverse(),r=>r.mark);for(const[r,a]of[...o.entries()].reverse()){if(!r.isReady())continue;this.batch.push(()=>{e=r.unitView.getEffectiveOpacity()>0}),this.batch.push(...r.prepareRender(this.globalOptions).map(c=>i(c)));let l;for(const c of a){const d=c.coords;d.equals(l)||this.batch.push(i(()=>{t=r.setViewport(d,c.clipRect)})),this.batch.push(s(c.callback)),l=c.coords}}}}class Kue extends N${constructor(...e){super({}),this.contexts=e}pushView(e,t){for(const i of this.contexts)i.pushView(e,t)}popView(e){for(const t of this.contexts)t.popView(e)}renderMark(e,t){for(const i of this.contexts)i.renderMark(e,t)}}class Yue{constructor(e,t){this.point=e,this.uiEvent=t,this.stopped=!1,this.target=void 0}stopPropagation(){this.stopped=!0}get type(){return this.uiEvent.type}}class Fa{static fromMouseEvent(e){return new Fa(e.clientX,e.clientY)}constructor(e,t){this.x=e,this.y=t}subtract(e){return new Fa(this.x-e.x,this.y-e.y)}add(e){return new Fa(this.x-e.x,this.y-e.y)}multiply(e){return new Fa(this.x*e,this.y*e)}get length(){return Math.sqrt(this.x**2+this.y**2)}equals(e){return e?e===this||e.x===this.x&&e.y===this.y:!1}}const Zue=n=>new Promise(e=>setTimeout(e,n));function Xue(n){const e=n.requestAnimationFrame||window.requestAnimationFrame,t=n.signal,i=()=>new Promise((s,o)=>{if(t!=null&&t.aborted)return o("aborted");const r=performance.now(),a=r+(n.duration||1e3),l=typeof n.from=="number"?n.from:0,c=typeof n.to=="number"?n.to:1,d=n.easingFunction||(p=>p),u=p=>(p-r)/(a-r),h=p=>p*(c-l)+l,f=p=>Math.max(0,Math.min(1,p)),g=p=>{t!=null&&t.aborted?o("aborted"):(n.onUpdate(h(d(f(u(p))))),p=0&&this.transitions.splice(t,1)}requestRender(){this._renderRequested?this._warn&&console.warn("Render already requested!"):(this._renderRequested=!0,window.requestAnimationFrame(e=>{this._renderRequested=!1;const t=this.transitions;this.transitions=[];let i;for(;i=t.shift();)i(e);this._renderCallback(e)}))}transition(e){return Xue({requestAnimationFrame:t=>this.requestTransition(t),...e})}}function w4(n,e,t,i,s){let o=0,r=!0,a=structuredClone(s),l=a;function c(h,f,g,p){return f+(h-f)*Math.pow(2,-g/p)}function d(h){if(r)return;const f=h-o;o=h;for(const p of Object.keys(l))a[p]=c(a[p],l[p],f,t);e(a);let g=-1/0;for(const p of Object.keys(l))g=Math.max(g,Math.abs(l[p]-a[p]));gd(p))}function u(h){l=h,r&&(r=!1,o=+document.timeline.currentTime,d(o))}return u.stop=()=>{r=!0},u}class Jue{constructor(e){this.genomes=new Map,this.baseUrl=e}async initialize(e){const t=new ode(e);return this.genomes.set(t.name,t),Promise.all([...this.genomes.values()].map(i=>i.load(this.baseUrl)))}getGenome(e){if(!this.genomes.size)throw new Error("No genomes have been configured!");if(e){const t=this.genomes.get(e);if(!t)throw new Error(`No genome with the name ${e} has been configured!`);return t}else{if(this.genomes.size>1)throw new Error("Cannot pick a default genome! More than one have been configured!");return this.genomes.values().next().value}}}const ehe=""+new URL("Lato-Regular-BEY4SZ9T.png",import.meta.url).href,the={thin:100,light:300,regular:400,normal:400,medium:500,bold:700,black:900};class ihe{constructor(e){this._webGLHelper=e,this.fontRepository="https://raw.githubusercontent.com/etiennepinchon/aframe-fonts/master/fonts/",this._fonts=new gc([],JSON.stringify),this._metadataPromises=new Map,this._fontPromises=new Map,this._promises=[],this._defaultFontEntry={metrics:CA(S$),texture:e?this._createTextureNow(ehe):void 0}}async waitUntilReady(){await Promise.all(this._promises)}getFont(e,t="normal",i="regular"){if(Ti(i)&&(i=the[i.toLowerCase()],!i))throw new Error("Unknown font weight: "+i);const s={family:e,style:t,weight:i};let o=this._fonts.get(s);return o||(o={metrics:void 0,texture:void 0},this._fonts.set(s,o),this._promises.push(this._loadFontEntry(o,s))),o}async _loadFontEntry(e,t){try{const i=await this._loadMetadata(t.family),s=she(i,t),o=this.fontRepository+vF(t.family)+"/"+s.replace(/\.\w+/,""),r=this._createTexture(o+".png"),a=this._loadFont(o+".json");e.texture=await r,e.metrics=await a}catch{console.warn(`Cannot load font: "${t.family}". Using the embedded default font.`),e.metrics=this._defaultFontEntry.metrics,e.texture=this._defaultFontEntry.texture}}_loadFont(e){let t=this._fontPromises.get(e);return t||(t=fetch(e).then(i=>{if(!i.ok)throw new Error("Could not load font: "+i.status);return i}).then(i=>i.json()).then(i=>CA(i)),this._fontPromises.set(e,t)),t}_loadMetadata(e){const t=vF(e);let i=this._metadataPromises.get(t);if(!i){const s=this.fontRepository+t+"/METADATA.pb";i=fetch(s).then(o=>{if(!o.ok)throw new Error("Could not load font metadata. Response status: "+o.status+", url: "+s);return o}).then(o=>o.text()).then(o=>nhe(o)).catch(o=>{console.warn(o.message)}),this._metadataPromises.set(t,i)}return i}getDefaultFont(){return this._defaultFontEntry}_createTexture(e){const t=this._webGLHelper.gl;return new Promise((i,s)=>{Lb(t,{src:e,min:t.LINEAR},(o,r,a)=>{o?s(o):i(r)})})}_createTextureNow(e){const t=this._webGLHelper.gl;let i;const s=new Promise((o,r)=>{i=Lb(t,{src:e,min:t.LINEAR},(a,l,c)=>{a?r(a):o(l)})});return this._promises.push(s),i}}function vF(n){return n.toLowerCase().replaceAll(/[^\w]/g,"")}function nhe(n){const e=n.split(` +`),t=[];let i;for(const s of e)if(s.startsWith("fonts {")&&(i={name:void 0,style:void 0,weight:void 0,filename:void 0,post_script_name:void 0,full_name:void 0,copyright:void 0}),s.startsWith("}")&&(t.push(i),i=void 0),i){let o=s.match(/^\s*([A-Za-z_]+):[ ]?"(.*)"$/);if(o){const r=o[1];i[r]=o[2]}if(o=s.match(/^\s*([A-Za-z_]+):[ ]?(\d+)$/),o){const r=o[1];i[r]=+o[2]}}return t}function she(n,e){let t,i=Number.POSITIVE_INFINITY;for(const s of n)if(e.family.localeCompare(s.name,void 0,{sensitivity:"accent"})==0&&e.style==s.style){const o=Math.abs(e.weight-s.weight);o"))i={identifier:s.match(/>(\S+)/)[1],sequence:""},t.push(i);else if(i)i.sequence+=s.trim();else throw new Error("Invalid fasta file!");return t}class rhe{constructor(e,t){this.animator=e,this.disabled=!!t,this.maxDistance=500,this.callback=null,this.targetValue=0,this.lastValue=0,this.smoother=w4(e,i=>{var o;const s=i.x-this.lastValue;this.lastValue=i.x,(o=this.callback)==null||o.call(this,s)},40,.1,{x:0})}cancel(){this.lastValue!==this.targetValue&&(this.targetValue=HW([this.lastValue,this.targetValue],.3),this.smoother({x:this.targetValue}))}setMomentum(e,t){if(this.disabled){t(e);return}this.callback=t;const i=fm(this.targetValue+e-this.lastValue,-this.maxDistance,this.maxDistance);this.targetValue=this.lastValue+i,this.smoother({x:this.targetValue})}}function ahe(n){const e={},t=["string","number","boolean"],i=["wheelDelta","wheelDeltaX","wheelDeltaY"];for(const s in n){const o=s;!i.includes(s)&&t.includes(typeof n[o])&&(e[o]=n[o])}return e}const yF=new Map;async function lhe(n,e,t){const i=n.symbol;let s=yF.get(i)??await uhe(n.symbol);return s?(yF.set(i,s),Lt`
${s.name} ${s.description}

${s.summary}

Source: NCBI RefSeq Gene

- `):null}async function $ue(n){console.log("Searching: "+n);const e={mode:"cors"},i=(await fetch(`https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=gene&term=${n}[GENE]&sort=relevance&retmode=json`,e).then(s=>s.json())).esearchresult.idlist[0];return i?(await fetch(`https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=gene&id=${i}&retmode=json`,e).then(r=>r.json())).result[i]:null}const Uue=Rb($ue,500);function jue(n){return Uue(n)}const que=Ts(".4~r"),Gue=Ts(".4~e");function M$(n){return n==null?It` NA `:Ti(n)?n.substring(0,30):Number.isInteger(n)?""+n:to(n)?Math.abs(n)>Math.pow(10,8)||Math.abs(n)[M$(e),t{var d;for(const[u,h]of Object.entries(e.encoders))if((d=h==null?void 0:h.dataAccessor)!=null&&d.fields.includes(l))switch(u){case"color":case"fill":case"stroke":return It` + `):null}async function che(n){console.log("Searching: "+n);const e={mode:"cors"},i=(await fetch(`https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=gene&term=${n}[GENE]&sort=relevance&retmode=json`,e).then(s=>s.json())).esearchresult.idlist[0];return i?(await fetch(`https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=gene&id=${i}&retmode=json`,e).then(r=>r.json())).result[i]:null}const dhe=Pb(che,500);function uhe(n){return dhe(n)}const hhe=Is(".4~r"),fhe=Is(".4~e");function R$(n){return n==null?Lt` NA `:Ti(n)?n.substring(0,30):Number.isInteger(n)?""+n:Qs(n)?Math.abs(n)>Math.pow(10,8)||Math.abs(n)[R$(e),t{var d;for(const[u,h]of Object.entries(e.encoders))if((d=h==null?void 0:h.dataAccessor)!=null&&d.fields.includes(l))switch(u){case"color":case"fill":case"stroke":return Lt` - `}return""},s=Object.entries(n).filter(([l,c])=>!l.startsWith("_"));if(s.length===0)return;const o=It` + `}return""},s=Object.entries(n).filter(([l,c])=>!l.startsWith("_"));if(s.length===0)return;const o=Lt` - ${s.map(([l,c])=>It` + ${s.map(([l,c])=>Lt` - + `)}
${l}${M$(c)} ${i(l,n)}${R$(c)} ${i(l,n)}
- `,r=e.unitView.getTitleText(),a=r?It` + `,r=e.unitView.getTitleText(),a=r?Lt`
${r}
- `:"";return It`${a}${o}`}class V1 extends m${constructor(e,t,i,s,o,r){super(e,t,i,s,o,r),this.spec=e}async initializeChildren(){}*[Symbol.iterator](){}replaceChild(e,t){throw new Error("Not implemented")}visit(e){let t;try{t=e(this)}catch(i){throw i.view=this,i}if(t===A_)return t;if(t!==Jce){e.beforeChildren&&e.beforeChildren(this);for(const i of this){const s=i.visit(e);if(s===A_)return s}e.afterChildren&&e.afterChildren(this),e.postOrder&&e.postOrder(this)}}findDescendantByPath(e){for(const t of this)if(t.name===e[0]){if(e.length==1)return t;if(t instanceof V1)return t.findDescendantByPath(e.slice(1))}}findChildByName(e){for(const t of this)if(t.name===e)return t}findDescendantByName(e){let t;return this.visit(i=>{if(i.name==e)return t=i,A_}),t}getDefaultResolution(e,t){return"shared"}}var Bl;class z1 extends V1{constructor(t,i,s,o,r,a){super(t,i,s,o,r,{layersChildren:!0,...a});Oe(this,Bl,[]);this.spec=t,this.needsAxes={x:!0,y:!0}}async initializeChildren(){ut(this,Bl,await Promise.all(this.spec.layer.map((t,i)=>this.context.createOrImportView(t,this,this,"grid"+i,s=>{if(!JA(s)&&!QA(s))throw new jh("LayerView accepts only unit or layer specs as children!",this)}))))}get children(){return X(this,Bl).slice()}*[Symbol.iterator](){for(const t of X(this,Bl))yield t}render(t,i,s={}){if(super.render(t,i,s),!!this.isConfiguredVisible()){t.pushView(this,i);for(const o of X(this,Bl))o.render(t,i,s);t.popView(this)}}propagateInteractionEvent(t){this.handleInteractionEvent(void 0,t,!0);for(let i=X(this,Bl).length-1;i>=0;i--)if(X(this,Bl)[i].propagateInteractionEvent(t),t.stopped)return;this.handleInteractionEvent(void 0,t,!1)}}Bl=new WeakMap;class LF{constructor(e,t){this.n=e,this.maxCols=t??1/0}get nRows(){return this.maxCols==1/0?1:Math.ceil(this.n/this.maxCols)}get nCols(){return Math.min(this.n,this.maxCols)}get rowIndices(){const e=[],t=this.nCols,i=this.nRows;for(let s=0;s=this.maxCols)return;i=t*this.nCols+e}return i=this.n))return[e%this.nCols,Math.floor(e/this.nCols)]}}const Yue="chromosome_ticks_and_labels",Zue={x:"width",y:"height"};function KA(n){return n=="x"?"y":"x"}const _S={x:["bottom","top"],y:["left","right"]},x4=Object.fromEntries(Object.entries(_S).map(([n,e])=>e.map(t=>[t,n])).flat(1));function Xd(n){return x4[n]}class P$ extends z1{constructor(e,t,i,s,o,r){const a=t=="locus",l={...a?Que:O$,...Xue(t,e),...e};super(a?Jue(l,t):F$(l,t),i,s,o,`axis_${e.orient}`,{blockEncodingInheritance:!0,contributesToScaleDomain:!1,...r}),this.axisProps=l}getSize(){const e={px:this.getPerpendicularSize()},t={grow:1};return x4[this.axisProps.orient]=="x"?new Zd(t,e):new Zd(e,t)}getPerpendicularSize(){return L4(this.axisProps)}isPickingSupported(){return!1}}function L4(n){const e=Xd(n.orient);let t=n.ticks&&n.tickSize||0;return n.labels&&(t+=n.labelPadding,e=="x"?t+=n.labelFontSize:t+=30),n.title&&(t+=n.titlePadding+n.titleFontSize),t=Math.min(n.maxExtent||1/0,Math.max(n.minExtent||0,t)),t}const O$={values:null,minExtent:20,maxExtent:1/0,offset:0,domain:!0,domainWidth:1,domainColor:"gray",domainDash:null,domainDashOffset:0,domainCap:"square",ticks:!0,tickSize:5,tickWidth:1,tickColor:"gray",tickDash:null,tickDashOffset:0,tickCap:"square",tickCount:null,tickMinStep:null,labels:!0,labelAlign:"center",labelBaseline:"middle",labelPadding:4,labelFontSize:10,labelLimit:180,labelColor:"black",format:null,titleColor:"black",titleFont:"sans-serif",titleFontSize:10,titlePadding:3};function Xue(n,e){const t=e.orient,i=n=="nominal"||n=="ordinal";let s="center",o="middle",r=e.labelAngle??((t=="top"||t=="bottom")&&i?-90:0);switch(t){case"left":s="right";break;case"right":s="left";break;case"top":case"bottom":Math.abs(r)>30?(s=r>0==(t=="bottom")?"left":"right",o="middle"):o=t=="top"?"alphabetic":"top";break}return{labelAlign:s,labelAngle:r,labelBaseline:o}}function F$(n,e){const t={...n,extent:L4(n)},i=Xd(t.orient),s=KA(i),o=t.orient=="bottom"||t.orient=="right"?1:-1,r=t.orient=="bottom"||t.orient=="left"?1:0,a=()=>({name:"domain",data:{values:[{}]},mark:{type:"rule",clip:!1,strokeDash:t.domainDash,strokeCap:t.domainCap,color:t.domainColor,[s]:r,size:t.domainWidth}}),l=()=>({name:"labels",mark:{type:"text",clip:!1,align:t.labelAlign,angle:t.labelAngle,baseline:t.labelBaseline,[s+"Offset"]:(t.tickSize+t.labelPadding)*o,[s]:r,size:t.labelFontSize,color:t.labelColor,minBufferSize:1500},encoding:{[i]:{field:"value",type:e},text:{field:"label"}}}),c=()=>({name:"ticks",mark:{type:"rule",clip:!1,strokeDash:t.tickDash,strokeCap:t.tickCap,color:t.tickColor,size:t.tickWidth,minBufferSize:300},encoding:{[s]:{value:r},[s+"2"]:{value:r-t.tickSize/t.extent*(r?1:-1)}}}),d=()=>({name:"title",data:{values:[{}]},mark:{type:"text",clip:!1,align:"center",baseline:t.orient=="bottom"?"bottom":"top",angle:[0,90,0,-90][["top","right","bottom","left"].indexOf(t.orient)],text:t.title,color:t.titleColor,[i]:.5,[s]:1-r}}),u=()=>{const f={name:"ticks_and_labels",encoding:{[i]:{field:"value",type:e}},layer:[]};return t.ticks&&f.layer.push(c()),t.labels&&f.layer.push(l()),f},h={resolve:{scale:{[i]:"forced"}},[Zue[KA(i)]]:t.extent,data:{lazy:{type:"axisTicks",channel:i,axis:n}},layer:[]};return t.domain&&h.layer.push(a()),(t.ticks||t.labels)&&h.layer.push(u()),t.title&&h.layer.push(d()),h}const Que={...O$,chromTicks:!0,chromTickSize:18,chromTickWidth:1,chromTickColor:"#989898",chromTickDash:[4,2],chromTickDashOffset:1,chromLabels:!0,chromLabelFontSize:13,chromLabelFontWeight:"normal",chromLabelFontStyle:"normal",chromLabelColor:"black",chromLabelAlign:"left",chromLabelPadding:7};function Jue(n,e){const t={...n,extent:L4(n)},i=Xd(t.orient),s=KA(i),o=t.orient=="bottom"||t.orient=="left"?1:0,r=()=>({name:"chromosome_ticks",mark:{type:"rule",strokeDash:n.chromTickDash,strokeDashOffset:n.chromTickDashOffset,[s]:o,[s+"2"]:o-t.chromTickSize/t.extent*(o?1:-1),color:n.chromTickColor,size:t.chromTickWidth}}),a=()=>{let d;switch(t.orient){case"top":d={y:0,angle:0,paddingX:4,dy:-t.chromLabelPadding,viewportEdgeFadeWidthLeft:20,viewportEdgeFadeWidthRight:20,viewportEdgeFadeDistanceRight:-10,viewportEdgeFadeDistanceLeft:-20};break;case"bottom":d={y:1,angle:0,paddingX:4,dy:t.chromLabelPadding+t.chromLabelFontSize*.73,viewportEdgeFadeWidthLeft:20,viewportEdgeFadeWidthRight:20,viewportEdgeFadeDistanceRight:-10,viewportEdgeFadeDistanceLeft:-20};break;case"left":d={x:1,angle:-90,paddingY:4,dy:-t.chromLabelPadding,viewportEdgeFadeWidthBottom:20,viewportEdgeFadeWidthTop:20,viewportEdgeFadeDistanceBottom:-20,viewportEdgeFadeDistanceTop:-10};break;case"right":d={x:0,angle:90,align:"right",paddingY:4,dy:-t.chromLabelPadding};break;default:d={}}return{name:"chromosome_labels",mark:{type:"text",size:t.chromLabelFontSize,font:t.chromLabelFont,fontWeight:t.chromLabelFontWeight,fontStyle:t.chromLabelFontStyle,color:t.chromLabelColor,align:n.chromLabelAlign,baseline:"alphabetic",clip:!1,...d},encoding:{[i+"2"]:{field:"continuousEnd",type:e},text:{field:"name"}}}};let l;switch(t.orient){case"bottom":case"top":l={};break;case"left":l={labelAngle:-90,labelAlign:"center",labelPadding:6};break;case"right":l={labelAngle:90,labelAlign:"center",labelPadding:6};break;default:l={}}const c=F$({...n,...l},e);if(n.chromTicks||n.chromLabels){const d={name:Yue,data:{lazy:{type:"axisGenome",channel:Xd(t.orient)}},encoding:{[i]:{field:"continuousStart",type:e,band:0}},layer:[]};if(n.chromTicks&&d.layer.push(r()),n.chromLabels){d.layer.push(a());let u;c.layer.filter(h=>h.name=="ticks_and_labels").forEach(h=>h.layer.filter(f=>f.name=="labels").forEach(f=>{u=f.mark})),u&&(t.orient=="top"||t.orient=="bottom"?(u.viewportEdgeFadeWidthLeft=30,u.viewportEdgeFadeDistanceLeft=40):(u.viewportEdgeFadeWidthBottom=30,u.viewportEdgeFadeDistanceBottom=40))}c.layer.push(d)}return c}class ehe extends z1{constructor(e,t,i,s,o,r){const l={...t=="locus"?the:B$,...e};super(ohe(l,t),i,s,o,`axisGrid_${e.orient}`,{blockEncodingInheritance:!0,contributesToScaleDomain:!1,...r}),this.axisProps=l}getOrient(){return this.axisProps.orient}isPickingSupported(){return!1}}const B$={values:null,grid:!1,gridCap:"butt",gridColor:"lightgray",gridDash:null,gridOpacity:1,gridWidth:1,tickCount:null,tickMinStep:null},the={...B$,chromGrid:!1,chromGridCap:"butt",chromGridColor:"gray",chromGridDash:[1,5],chromGridOpacity:1,chromGridWidth:1};function ihe(n,e){const t=n,i=Xd(t.orient);return{name:"grid_lines",data:{lazy:{type:"axisTicks",channel:i,axis:n}},mark:{type:"rule",strokeDash:t.gridDash,strokeCap:t.gridCap,color:t.gridColor,size:t.gridWidth,opacity:t.gridOpacity,minBufferSize:300},encoding:{[i]:{field:"value",type:e}}}}function nhe(n,e){const t=n,i=Xd(t.orient);return{name:"chromosome_lines",data:{lazy:{type:"axisGenome",channel:i}},mark:{type:"rule",strokeDash:t.chromGridDash,strokeCap:t.chromGridCap,color:t.chromGridColor,size:t.chromGridWidth,opacity:t.chromGridOpacity},encoding:{[i]:{field:"continuousStart",type:e,band:0}}}}function she(n,e){const t=n,i=Xd(t.orient);return{name:"chromosome_fill",data:{lazy:{type:"axisGenome",channel:i}},mark:{type:"rect"},encoding:{[i]:{field:"continuousStart",type:e,band:0},[i+"2"]:{field:"continuousEnd",band:0},fill:{field:"odd",type:"nominal",scale:{domain:[!1,!0],range:[t.chromGridFillEven??"white",t.chromGridFillOdd??"white"]}},opacity:{field:"odd",type:"nominal",scale:{type:"ordinal",domain:[!1,!0],range:[t.chromGridFillEven?1:0,t.chromGridFillOdd?1:0]}}}}}function ohe(n,e){const t={...n},i=[];return t.chromGrid&&(t.chromGridFillOdd||t.chromGridFillEven)&&i.push(she(t,e)),t.chromGrid&&t.chromGridOpacity>0&&i.push(nhe(t,e)),t.grid&&t.gridOpacity>0&&i.push(ihe(t,e)),{name:"grid_layers",configurableVisibility:!1,resolve:{scale:{[Xd(n.orient)]:"forced",fill:"independent",opacity:"independent"}},layer:i}}const DF={anchor:"middle",frame:"group",offset:10,orient:"top",align:void 0,angle:0,baseline:"alphabetic",dx:0,dy:0,color:void 0,font:void 0,fontSize:12,fontStyle:"normal",fontWeight:"normal"},rhe={orient:"left",anchor:"middle",align:"right",baseline:"middle",angle:0,fontSize:12},ahe={orient:"top",anchor:"start",align:"left",baseline:"top",offset:-10,dx:10,fontSize:12},lhe={start:0,middle:.5,end:1},che={start:"left",middle:"center",end:"right"};function dhe(n){if(!n)return;const e=Ti(n)?{text:n}:n;if(!e.text||e.orient=="none")return;const t={"track-title":rhe,overlay:ahe}[e.style]??{},i={...DF,...t,...e};let s={},o={x:0,y:0};const r=lhe[i.anchor??"middle"];switch(i.orient){case"top":o={x:r,y:1},s={baseline:"alphabetic",angle:0};break;case"right":o={x:1,y:1-r},s={baseline:"alphabetic",angle:90};break;case"bottom":o={x:r,y:0},s={baseline:"top",angle:0};break;case"left":o={x:0,y:r},s={baseline:"alphabetic",angle:-90};break}const a={...DF,...s,...t,...e},l={xOffset:0,yOffset:0};switch(i.orient){case"top":l.yOffset=-a.offset;break;case"right":l.xOffset=a.offset;break;case"bottom":l.yOffset=a.offset;break;case"left":l.xOffset=-a.offset;break}return{configurableVisibility:!1,data:{values:[{}]},mark:{type:"text",tooltip:null,clip:!1,...o,...l,text:a.text,align:a.align??che[a.anchor],angle:a.angle,baseline:a.baseline,dx:a.dx,dy:a.dy,color:a.color,font:a.font,size:a.fontSize,fontStyle:a.fontStyle,fontWeight:a.fontWeight}}}var Bh,sd,od;class uhe{constructor(e){Oe(this,Bh);Oe(this,sd,0);Oe(this,od,0);ut(this,Bh,new Array(e))}push(e){X(this,Bh)[X(this,sd)]=e,ut(this,sd,(X(this,sd)+1)%this.size),ut(this,od,Math.min(X(this,od)+1,this.size))}get(){const e=X(this,Bh);return X(this,od){const h=Ba.fromMouseEvent(u);o.push({point:h,timestamp:performance.now()});const f=h.subtract(a);t({x:a.x,y:a.y,xDelta:f.x,yDelta:f.y,zDelta:0}),a=h},c=()=>{const h=performance.now(),f=o.get().filter(y=>h-y.timestamp<160);if(f.length<5||!s||ghe(f))return;const g=f.at(-1),p=f[0],_=g.point.subtract(p.point).multiply(1/(g.timestamp-p.timestamp));let v=a.x,b=a.y;Hu=S4(s,y=>{t({x:y.x,y:y.y,xDelta:v-y.x,yDelta:b-y.y,zDelta:0}),v=y.x,b=y.y},150,.5,{x:v,y:b}),Hu({x:a.x-_.x*250,y:a.y-_.y*250})},d=()=>{document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",d),c()};document.addEventListener("mouseup",d,!1),document.addEventListener("mousemove",l,!1)}}function ghe(n){const e=n[Math.floor(n.length/2)],t=e.point.subtract(n[0].point).multiply(e.timestamp-n[0].timestamp),i=n.at(-1).point.subtract(e.point).multiply(n.at(-1).timestamp-e.timestamp),s=t.length;return i.length/s<.4}var qp,Gp,Ro,Wh,Kp,jt,Ju,V$,t_,YA,ZA,XA,z$,rC,H$;class phe extends V1{constructor(t,i,s,o,r,a,l){super(t,i,s,o,r,l);Oe(this,jt);Oe(this,qp,1/0);Oe(this,Gp,10);Oe(this,Ro,[]);Oe(this,Wh,{});Oe(this,Kp,0);this.spec=t,ut(this,Gp,t.spacing??10),ut(this,qp,a),ut(this,Ro,[]),this.wrappingFacet=!1}appendChild(t){t.layoutParent??(t.layoutParent=this),X(this,Ro).push(new AF(t,this,X(this,Kp))),a5(this,Kp)._++}setChildren(t){ut(this,Ro,[]);for(const i of t)this.appendChild(i)}replaceChild(t,i){const s=X(this,Ro).findIndex(o=>o.view==t);if(s>=0)X(this,Ro)[s]=new AF(i,this,X(this,Kp));else throw new Error("Not my child view!")}get children(){return X(this,Ro).map(t=>t.view)}get childCount(){return X(this,Ro).length}async createAxes(){const t=[];for(const i of Zm){const s=this.resolutions.axis[i];if(s){const o=s.getAxisProps();if(o){const r={title:s.getTitle(),orient:_S[i][0],...o},a=new P$(r,s.scaleResolution.type,this.context,this,this);t.push(a.initializeChildren()),X(this,Wh)[i]=a}}}return Promise.all([...t,...X(this,Ro).map(i=>i.createAxes())])}*[Symbol.iterator](){for(const t of X(this,Ro))yield*t.getChildren();for(const t of Object.values(X(this,Wh)))yield t}getOverhang(){return Le(this,jt,z$).call(this).union(Le(this,jt,rC).call(this))}getSize(){return this._cache("size",()=>new Zd(Le(this,jt,ZA).call(this,"column"),Le(this,jt,ZA).call(this,"row")).addPadding(Le(this,jt,rC).call(this)))}render(t,i,s={}){if(super.render(t,i,s),!this.isConfiguredVisible())return;this.layoutParent||(i=i.shrink(this.getPadding())),i=i.shrink(Le(this,jt,rC).call(this)),t.pushView(this,i);const o={devicePixelRatio:this.context.devicePixelRatio},r=mF(Le(this,jt,YA).call(this,"column"),i.width,o),a=mF(Le(this,jt,YA).call(this,"row"),i.height,o),l=new LF(X(this,jt,Ju).length,X(this,qp)??1/0),c=d=>Math.round(d*devicePixelRatio)/devicePixelRatio;for(const[d,u]of X(this,jt,Ju).entries()){const{view:h,axes:f,gridLines:g,background:p,backgroundStroke:_,title:v}=u,[b,y]=l.getCellCoords(d),w=r[Le(this,jt,XA).call(this,"column",b)],C=a[Le(this,jt,XA).call(this,"row",y)],L=h.getViewportSize(),x=h.getSize(),D=h.getOverhang(),k=w.location-D.left,P=C.location-D.top,O=(Dt,Nt)=>(Dt[Nt].grow?(Nt=="width"?w:C).size:Dt[Nt].px)+D[Nt],M=O(L,"width"),R=O(L,"height"),z=O(x,"width"),G=O(x,"height"),te=u.scrollbars.horizontal,ae=u.scrollbars.vertical,fe=te?()=>c(te.viewportOffset):()=>0,oe=ae?()=>c(ae.viewportOffset):()=>0,Se=new nc(()=>i.x+k,()=>i.y+P,()=>M,()=>R),Ie=h.isScrollable(),me=Ie?new nc(()=>i.x+k-fe(),()=>i.y+P-oe(),()=>z,()=>G):Se;u.coords=Se;const ie=s.clipRect?Se.intersect(s.clipRect):Se;p==null||p.render(t,ie,{...s,clipRect:void 0});for(const Dt of Object.values(g))Dt.render(t,Se,s);const Xt=vhe(h)||Ie;Xt&&h.render(t,me,{...s,clipRect:ie}),_==null||_.render(t,ie,{...s,clipRect:void 0});for(const[Dt,Nt]of Object.entries(f)){const Ge=Dt=="left"||Dt=="right"?"vertical":"horizontal",si=u.scrollbars[Ge],ke=si?Se.modify(Ge=="vertical"?{y:()=>me.y,height:G}:{x:()=>me.x,width:z}):Se,Ve=EF(ke,Dt,Nt);let ge=s.clipRect;si&&(ge=Ve.intersect(ge).intersect(si?Se.modify(Ge=="vertical"?{x:-1e5,width:2e5}:{y:-1e5,height:2e5}):void 0)),Nt.render(t,Ve,{...s,clipRect:ge})}for(const Dt of Object.values(X(this,Wh))){const Ge=Dt.axisProps.orient;(Ge=="left"&&b==0||Ge=="right"&&b==l.nCols-1||Ge=="top"&&y==0||Ge=="bottom"&&y==l.nRows-1)&&Dt.render(t,EF(Se.shrink(u.view.getOverhang()),Ge,Dt),s)}Xt||h.render(t,me,s);for(const Dt of Object.values(u.scrollbars))Dt.updateScrollbar(Se,me),Dt.render(t,i,s);v==null||v.render(t,Se,s)}t.popView(this)}propagateInteractionEvent(t){if(this.handleInteractionEvent(void 0,t,!0),t.stopped)return;const i=X(this,jt,Ju).find(o=>o.coords.containsPoint(t.point.x,t.point.y));for(const o of Object.values((i==null?void 0:i.scrollbars)??{}))if(o.coords.containsPoint(t.point.x,t.point.y)&&(o.propagateInteractionEvent(t),t.stopped))return;const s=i==null?void 0:i.view;s&&(s.propagateInteractionEvent(t),(s instanceof Bo||s instanceof z1)&&fhe(t,i.coords,o=>Le(this,jt,H$).call(this,i.coords,i.view,o),this.context.getCurrentHover(),this.context.animator)),!t.stopped&&this.handleInteractionEvent(void 0,t,!1)}getDefaultResolution(t,i){return"independent"}}qp=new WeakMap,Gp=new WeakMap,Ro=new WeakMap,Wh=new WeakMap,Kp=new WeakMap,jt=new WeakSet,Ju=function(){return X(this,Ro).filter(t=>t.view.isConfiguredVisible())},V$=function(){return new LF(X(this,jt,Ju).length,X(this,qp)??1/0)},t_=function(t){const i=t=="column"?"width":"height",s=(o,r)=>o.map(a=>{const c=X(this,jt,Ju)[a].getOverhangAndPadding();return t=="column"?r?c.right:c.left:r?c.bottom:c.top}).reduce((a,l)=>Math.max(a,l),0);return this._cache(`size/directionSizes/${t}`,()=>X(this,jt,V$)[t=="column"?"colIndices":"rowIndices"].map(o=>({axisBefore:s(o,0),axisAfter:s(o,1),view:Zce(o.map(r=>X(this,jt,Ju)[r].view.getViewportSize()[i]))})))},YA=function(t){const i=Le(this,jt,t_).call(this,t),s=[];s.push(E_);for(const[o,r]of i.entries())o>0&&s.push({px:X(this,Gp),grow:0}),(o==0||this.wrappingFacet)&&s.push(E_),s.push({px:r.axisBefore,grow:0}),s.push(r.view),s.push({px:r.axisAfter,grow:0}),(o==i.length-1||this.wrappingFacet)&&s.push(E_);return s},ZA=function(t){let i=0,s=0;const o=t=="row"?this.spec.height:this.spec.width;if(o||o===0)return p$(o);const r=Le(this,jt,t_).call(this,t);for(const[a,l]of r.entries())a>0&&(s+=X(this,Gp)),(a==0||this.wrappingFacet)&&(s+=0),s+=l.axisBefore,s+=l.view.px??0,i+=l.view.grow??0,s+=l.axisAfter,(a==r.length-1||this.wrappingFacet)&&(s+=0);return{px:s,grow:i}},XA=function(t,i){return t=="row"&&this.wrappingFacet?1+6*i+2:2+4*i+1},z$=function(){const t=Le(this,jt,t_).call(this,"column"),i=Le(this,jt,t_).call(this,"row");return!t.length||!i.length?Cs.zero():new Cs(i.at(0).axisBefore,t.at(-1).axisAfter,i.at(-1).axisAfter,t.at(0).axisBefore)},rC=function(){const t=i=>{const s=x4[i],o=X(this,Wh)[s];return(o==null?void 0:o.axisProps.orient)!==i?0:Math.max(o.getPerpendicularSize()+o.axisProps.offset,0)};return new Cs(t("top"),t("right"),t("bottom"),t("left"))},H$=function(t,i,s){for(const[o,r]of Object.entries(bhe(i))){if(r.size<=0)continue;const a=t.normalizePoint(s.x,s.y),l=t.normalizePoint(s.x+s.xDelta,s.y+s.yDelta),c={x:l.x-a.x,y:l.y-a.y};for(const d of r)d.zoom(2**s.zDelta,o=="y"?1-a[o]:a[o],o=="x"?c.x:-c.y)}this.context.animator.requestRender()};function mhe(n){if(!(!n||!n.fill||n.fillOpacity===0))return{configurableVisibility:!1,data:{values:[{}]},mark:{color:n.fill,opacity:n.fillOpacity??1,type:"rect",clip:!1,tooltip:null,minHeight:1,minOpacity:0}}}function _he(n){if(!(!n||!n.stroke||n.strokeWidth===0||n.strokeOpacity===0))return{configurableVisibility:!1,resolve:{scale:{x:"excluded",y:"excluded"},axis:{x:"excluded",y:"excluded"}},data:{values:[{x:0,y:0,x2:1,y2:0},{x:1,y:0,x2:1,y2:1},{x:1,y:1,x2:0,y2:1},{x:0,y:1,x2:0,y2:0}]},mark:{size:n.strokeWidth??1,color:n.stroke??"lightgray",strokeCap:"square",opacity:n.strokeOpacity??1,type:"rule",clip:!1,tooltip:null},encoding:{x:{field:"x",type:"quantitative",scale:null},y:{field:"y",type:"quantitative",scale:null},x2:{field:"x2"},y2:{field:"y2"}}}}function bhe(n){const e={x:new Set,y:new Set};return n.visit(t=>{for(const[i,s]of Object.entries(e)){const o=t.getScaleResolution(i);o&&o.isZoomable()&&s.add(o)}}),e}function vhe(n){let e=!0;return n.visit(t=>{t instanceof Bo&&e&&(e=t.mark.properties.clip===!0)}),e}function EF(n,e,t){const i=t.axisProps,s=t.getPerpendicularSize();if(e=="bottom")return n.translate(0,n.height+i.offset).modify({height:s});if(e=="top")return n.translate(0,-s-i.offset).modify({height:s});if(e=="left")return n.translate(-s-i.offset,0).modify({width:s});if(e=="right")return n.translate(n.width+i.offset,0).modify({width:s})}class AF{constructor(e,t,i){if(this.layoutParent=t,this.view=e,this.serial=i,this.background=void 0,this.backgroundStroke=void 0,this.axes={},this.gridLines={},this.scrollbars={},this.title=void 0,this.coords=nc.ZERO,e.needsAxes.x||e.needsAxes.y){const s=e.spec,o="view"in s?s==null?void 0:s.view:void 0,r=mhe(o);r&&(this.background=new Bo(r,t.context,t,e,"background"+i,{blockEncodingInheritance:!0}));const a=_he(o);a&&(this.backgroundStroke=new Bo(a,t.context,t,e,"backgroundStroke"+i,{blockEncodingInheritance:!0}));const l=dhe(e.spec.title);if(l){const c=new Bo(l,t.context,t,e,"title"+i,{blockEncodingInheritance:!0});this.title=c}}e.spec.viewportWidth!=null&&(this.scrollbars.horizontal=new IF(this,"horizontal")),e.spec.viewportHeight!=null&&(this.scrollbars.vertical=new IF(this,"vertical"))}*getChildren(){this.background&&(yield this.background),this.backgroundStroke&&(yield this.backgroundStroke),this.title&&(yield this.title),yield*Object.values(this.axes),yield*Object.values(this.gridLines),yield this.view,yield*Object.values(this.scrollbars)}async createAxes(){const{view:e,axes:t,gridLines:i}=this,s=(a,l)=>{const c=a.getAxisProps();if(c===null)return;const d=c?{...c}:{};if(!d.orient){for(const u of _S[l])if(!t[u]){d.orient=u;break}if(!d.orient)throw new Error("No slots available for an axis! Perhaps a LayerView has more than two children?")}if(d.title??(d.title=a.getTitle()),!_S[l].includes(d.orient))throw new Error(`Invalid axis orientation "${d.orient}" on channel "${l}"!`);return d},o=async(a,l,c)=>{const d=s(a,l);if(d){if(t[d.orient])throw new Error(`An axis with the orient "${d.orient}" already exists!`);const u=new P$(d,a.scaleResolution.type,this.layoutParent.context,this.layoutParent,c);t[d.orient]=u,await u.initializeChildren()}},r=async(a,l,c)=>{const d=s(a,l);if(d&&(d.grid||d.chromGrid)){const u=new ehe(d,a.scaleResolution.type,this.layoutParent.context,this.layoutParent,c);i[d.orient]=u,await u.initializeChildren()}};for(const a of["x","y"])if(e.needsAxes[a]){const l=e.resolutions.axis[a];if(!l)continue;await o(l,a,e)}for(const a of["x","y"])if(e.needsAxes[a]&&e.getConfiguredOrDefaultResolution(a,"axis")!="excluded"){const l=e.getAxisResolution(a);if(!l)continue;await r(l,a,e)}if(e instanceof z1){for(const a of e)for(const[l,c]of Object.entries(a.resolutions.axis)){const d=c.getAxisProps();d&&d.orient&&await o(c,l,a)}for(const a of e)for(const[l,c]of Object.entries(a.resolutions.axis)){const d=c.getAxisProps();d&&!d.orient&&await o(c,l,a)}}[...Object.values(t),...Object.values(i)].forEach(a=>a.visit(l=>{l instanceof Bo&&l.resolve("scale")}))}getOverhang(){const e=t=>{const i=this.axes[t];return i?Math.max(i.getPerpendicularSize()+i.axisProps.offset,0):0};return new Cs(e("top"),e("right"),e("bottom"),e("left")).add(this.view.getOverhang())}getOverhangAndPadding(){return this.getOverhang().add(this.view.getPadding())}}var Yp,c1,rd,Vh;class IF extends Bo{constructor(t,i){const s={scrollbarSize:8,scrollbarPadding:2};super({data:{values:[{}]},mark:{type:"rect",fill:"#b0b0b0",fillOpacity:.6,stroke:"white",strokeWidth:1,strokeOpacity:1,cornerRadius:5,clip:!1},configurableVisibility:!1},t.layoutParent.context,t.layoutParent,t.view,"scrollbar-"+i,{blockEncodingInheritance:!0});Oe(this,Yp);Oe(this,c1,nc.ZERO);Oe(this,rd,0);Oe(this,Vh,0);zi(this,"viewportOffset",0);this.config=s,ut(this,Yp,i),this.interpolateViewportOffset=S4(this.context.animator,o=>{this.viewportOffset=o.x},50,.4,{x:this.viewportOffset}),this.addInteractionEventListener("mousedown",(o,r)=>{if(r.stopPropagation(),X(this,rd)<=0)return;const a=f=>i=="vertical"?f.clientY:f.clientX,l=r.uiEvent;l.preventDefault();const c=this.scrollOffset,d=a(l),u=f=>{const g=dm(a(f)-d+c,0,X(this,rd));this.interpolateViewportOffset({x:g/X(this,rd)*X(this,Vh)})},h=()=>{document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",h)};document.addEventListener("mouseup",h,!1),document.addEventListener("mousemove",u,!1)})}get scrollOffset(){return this.viewportOffset/X(this,Vh)*X(this,rd)}render(t,i,s){super.render(t,X(this,c1),s)}updateScrollbar(t,i){const s=this.config.scrollbarPadding,o=this.config.scrollbarSize,r=X(this,Yp)=="horizontal"?"width":"height",a=Math.min(1,t[r]/i[r]),l=t[r]-2*s,c=a*l;ut(this,rd,l-c),ut(this,Vh,i[r]-t[r]),this.viewportOffset=dm(this.viewportOffset,0,X(this,Vh)),ut(this,c1,X(this,Yp)=="vertical"?new nc(()=>t.x+t.width-o-s,()=>t.y+s+this.scrollOffset,()=>o,()=>c):new nc(()=>t.x+s+this.scrollOffset,()=>t.y+t.height-o-s,()=>c,()=>o))}}Yp=new WeakMap,c1=new WeakMap,rd=new WeakMap,Vh=new WeakMap;class Kk extends phe{constructor(e,t,i,s,o){super(e,t,i,s,o,eI(e)?e.columns:aC(e)?1:1/0),this.spec=e}async initializeChildren(){const e=this.spec,t=eI(e)?e.concat:aC(e)?e.vconcat:e.hconcat;this.setChildren(await Promise.all(t.map((i,s)=>this.context.createOrImportView(i,this,this,"grid"+s)))),await this.createAxes()}getDefaultResolution(e,t){return t=="axis"?"independent":aC(this.spec)&&e==="x"||j$(this.spec)&&e==="y"?"shared":"independent"}}const $$="viewRoot";var Zp;class yhe{constructor(e={}){Oe(this,Zp,new Map);this.options={allowImport:!0,wrapRoot:!0,...e};const t=i=>(s,o,r,a,l)=>new i(s,o,r,a,s.name??l);this.addViewType(JA,t(z1)),this.addViewType(QA,t(Bo)),this.addViewType(aC,t(Kk)),this.addViewType(j$,t(Kk)),this.addViewType(eI,t(Kk)),this.addViewType(She,()=>{throw new Error("SampleView is not supported by the @genome-spy/core package. Use @genome-spy/app instead!")})}addViewType(e,t){X(this,Zp).set(e,t)}createView(e,t,i,s,o){for(const[r,a]of X(this,Zp))if(r(e))return a(e,t,i,s,o);throw new Error("Invalid spec, cannot figure out the view type from the properties: "+JSON.stringify([...Object.keys(e)]))}isViewSpec(e){const t=[...X(this,Zp).keys()].filter(i=>i(e));if(t.length>1)throw new Error("Ambiguous spec. Cannot create a view!");return t.length==1}async createOrImportView(e,t,i,s,o,r){let a;if(Che(e)){let c;if("url"in e.import)if(this.options.allowImport)c=await Due(e,s.getBaseUrl(),t);else throw new jh("Importing views is not allowed!",i);else if("template"in e.import)c=U$(e.import.template,s);else throw new Error("Invalid import: "+JSON.stringify(e));r==null||r(c),whe(c,e),a=c}else a=e;!s&&this.options.wrapRoot&&(QA(a)||JA(a))&&o===$$&&(a={name:"implicitRoot",vconcat:[a]});const l=this.createView(a,t,i,s,o);return l instanceof V1&&await l.initializeChildren(),l}}Zp=new WeakMap;function U$(n,e){var i,s;const t=(s=(i=e.spec)==null?void 0:i.templates)==null?void 0:s[n];if(t)return structuredClone(t);if(e.dataParent)return U$(n,e.dataParent);throw new Error(`Cannot find template "${n}" in current view or its ancestors!`)}function whe(n,e){e.name!=null&&(n.name=e.name);const t=Ps(e.params)?e.params:Os(e.params)?Object.entries(e.params).map(([i,s])=>({name:i,value:s})):[];if(t.length){n.params??(n.params=[]);for(const i of t){const s=n.params.findIndex(o=>o.name==i.name);s>=0&&(n.params[s]=i)}for(const i of t)n.params.some(s=>s.name==i.name)||n.params.push(i)}}function QA(n){return"mark"in n&&(Ti(n.mark)||Os(n.mark))}function JA(n){return"layer"in n&&Os(n.layer)}function Che(n){return"import"in n}function aC(n){return"vconcat"in n&&Ps(n.vconcat)}function j$(n){return"hconcat"in n&&Ps(n.hconcat)}function eI(n){return"concat"in n&&Ps(n.concat)}function She(n){return"samples"in n&&Os(n.samples)&&"spec"in n&&Os(n.spec)}function xhe(n){const e=Math.floor(Math.random()*16777215).toString(16),t=[];for(const i of n.paramConfigs.values()){if(!Mae(i))continue;const s=i.bind;if(!s||!("input"in s))continue;const o=i.name,r=n.getSetter(o),a=n.getValue(o),l=s.name??o,c=s.debounce?Rb(r,s.debounce,!1):r,d=`${e}-param-${o}`;if(s.input=="range")t.push(It` + `:"";return Lt`${a}${o}`}class H1 extends p${constructor(e,t,i,s,o,r){super(e,t,i,s,o,r),this.spec=e}async initializeChildren(){}*[Symbol.iterator](){}replaceChild(e,t){throw new Error("Not implemented")}visit(e){let t;try{t=e(this)}catch(i){throw i.view=this,i}if(t===M_)return t;if(t!==wde){e.beforeChildren&&e.beforeChildren(this);for(const i of this){const s=i.visit(e);if(s===M_)return s}e.afterChildren&&e.afterChildren(this),e.postOrder&&e.postOrder(this)}}findDescendantByPath(e){for(const t of this)if(t.name===e[0]){if(e.length==1)return t;if(t instanceof H1)return t.findDescendantByPath(e.slice(1))}}findChildByName(e){for(const t of this)if(t.name===e)return t}findDescendantByName(e){let t;return this.visit(i=>{if(i.name==e)return t=i,M_}),t}getDefaultResolution(e,t){return"shared"}}var Wl;class $1 extends H1{constructor(t,i,s,o,r,a){super(t,i,s,o,r,{layersChildren:!0,...a});Pe(this,Wl,[]);this.spec=t,this.needsAxes={x:!0,y:!0}}async initializeChildren(){dt(this,Wl,await Promise.all(this.spec.layer.map((t,i)=>this.context.createOrImportView(t,this,this,"grid"+i,s=>{if(!XA(s)&&!ZA(s))throw new Kh("LayerView accepts only unit or layer specs as children!",this)}))))}get children(){return X(this,Wl).slice()}*[Symbol.iterator](){for(const t of X(this,Wl))yield t}render(t,i,s={}){if(super.render(t,i,s),!!this.isConfiguredVisible()){t.pushView(this,i);for(const o of X(this,Wl))o.render(t,i,s);t.popView(this)}}propagateInteractionEvent(t){this.handleInteractionEvent(void 0,t,!0);for(let i=X(this,Wl).length-1;i>=0;i--)if(X(this,Wl)[i].propagateInteractionEvent(t),t.stopped)return;this.handleInteractionEvent(void 0,t,!1)}}Wl=new WeakMap;class wF{constructor(e,t){this.n=e,this.maxCols=t??1/0}get nRows(){return this.maxCols==1/0?1:Math.ceil(this.n/this.maxCols)}get nCols(){return Math.min(this.n,this.maxCols)}get rowIndices(){const e=[],t=this.nCols,i=this.nRows;for(let s=0;s=this.maxCols)return;i=t*this.nCols+e}return i=this.n))return[e%this.nCols,Math.floor(e/this.nCols)]}}const phe="chromosome_ticks_and_labels",mhe={x:"width",y:"height"};function qA(n){return n=="x"?"y":"x"}const dS={x:["bottom","top"],y:["left","right"]},C4=Object.fromEntries(Object.entries(dS).map(([n,e])=>e.map(t=>[t,n])).flat(1));function Qd(n){return C4[n]}class M$ extends $1{constructor(e,t,i,s,o,r){const a=t=="locus",l={...a?bhe:P$,..._he(t,e),...e};super(a?vhe(l,t):O$(l,t),i,s,o,`axis_${e.orient}`,{blockEncodingInheritance:!0,contributesToScaleDomain:!1,...r}),this.axisProps=l}getSize(){const e={px:this.getPerpendicularSize()},t={grow:1};return C4[this.axisProps.orient]=="x"?new Xd(t,e):new Xd(e,t)}getPerpendicularSize(){return S4(this.axisProps)}isPickingSupported(){return!1}}function S4(n){const e=Qd(n.orient);let t=n.ticks&&n.tickSize||0;return n.labels&&(t+=n.labelPadding,e=="x"?t+=n.labelFontSize:t+=30),n.title&&(t+=n.titlePadding+n.titleFontSize),t=Math.min(n.maxExtent||1/0,Math.max(n.minExtent||0,t)),t}const P$={values:null,minExtent:20,maxExtent:1/0,offset:0,domain:!0,domainWidth:1,domainColor:"gray",domainDash:null,domainDashOffset:0,domainCap:"square",ticks:!0,tickSize:5,tickWidth:1,tickColor:"gray",tickDash:null,tickDashOffset:0,tickCap:"square",tickCount:null,tickMinStep:null,labels:!0,labelAlign:"center",labelBaseline:"middle",labelPadding:4,labelFontSize:10,labelLimit:180,labelColor:"black",format:null,titleColor:"black",titleFont:"sans-serif",titleFontSize:10,titlePadding:3};function _he(n,e){const t=e.orient,i=n=="nominal"||n=="ordinal";let s="center",o="middle",r=e.labelAngle??((t=="top"||t=="bottom")&&i?-90:0);switch(t){case"left":s="right";break;case"right":s="left";break;case"top":case"bottom":Math.abs(r)>30?(s=r>0==(t=="bottom")?"left":"right",o="middle"):o=t=="top"?"alphabetic":"top";break}return{labelAlign:s,labelAngle:r,labelBaseline:o}}function O$(n,e){const t={...n,extent:S4(n)},i=Qd(t.orient),s=qA(i),o=t.orient=="bottom"||t.orient=="right"?1:-1,r=t.orient=="bottom"||t.orient=="left"?1:0,a=()=>({name:"domain",data:{values:[{}]},mark:{type:"rule",clip:!1,strokeDash:t.domainDash,strokeCap:t.domainCap,color:t.domainColor,[s]:r,size:t.domainWidth}}),l=()=>({name:"labels",mark:{type:"text",clip:!1,align:t.labelAlign,angle:t.labelAngle,baseline:t.labelBaseline,[s+"Offset"]:(t.tickSize+t.labelPadding)*o,[s]:r,size:t.labelFontSize,color:t.labelColor,minBufferSize:1500},encoding:{[i]:{field:"value",type:e},text:{field:"label"}}}),c=()=>({name:"ticks",mark:{type:"rule",clip:!1,strokeDash:t.tickDash,strokeCap:t.tickCap,color:t.tickColor,size:t.tickWidth,minBufferSize:300},encoding:{[s]:{value:r},[s+"2"]:{value:r-t.tickSize/t.extent*(r?1:-1)}}}),d=()=>({name:"title",data:{values:[{}]},mark:{type:"text",clip:!1,align:"center",baseline:t.orient=="bottom"?"bottom":"top",angle:[0,90,0,-90][["top","right","bottom","left"].indexOf(t.orient)],text:t.title,color:t.titleColor,[i]:.5,[s]:1-r}}),u=()=>{const f={name:"ticks_and_labels",encoding:{[i]:{field:"value",type:e}},layer:[]};return t.ticks&&f.layer.push(c()),t.labels&&f.layer.push(l()),f},h={resolve:{scale:{[i]:"forced"}},[mhe[qA(i)]]:t.extent,data:{lazy:{type:"axisTicks",channel:i,axis:n}},layer:[]};return t.domain&&h.layer.push(a()),(t.ticks||t.labels)&&h.layer.push(u()),t.title&&h.layer.push(d()),h}const bhe={...P$,chromTicks:!0,chromTickSize:18,chromTickWidth:1,chromTickColor:"#989898",chromTickDash:[4,2],chromTickDashOffset:1,chromLabels:!0,chromLabelFontSize:13,chromLabelFontWeight:"normal",chromLabelFontStyle:"normal",chromLabelColor:"black",chromLabelAlign:"left",chromLabelPadding:7};function vhe(n,e){const t={...n,extent:S4(n)},i=Qd(t.orient),s=qA(i),o=t.orient=="bottom"||t.orient=="left"?1:0,r=()=>({name:"chromosome_ticks",mark:{type:"rule",strokeDash:n.chromTickDash,strokeDashOffset:n.chromTickDashOffset,[s]:o,[s+"2"]:o-t.chromTickSize/t.extent*(o?1:-1),color:n.chromTickColor,size:t.chromTickWidth}}),a=()=>{let d;switch(t.orient){case"top":d={y:0,angle:0,paddingX:4,dy:-t.chromLabelPadding,viewportEdgeFadeWidthLeft:20,viewportEdgeFadeWidthRight:20,viewportEdgeFadeDistanceRight:-10,viewportEdgeFadeDistanceLeft:-20};break;case"bottom":d={y:1,angle:0,paddingX:4,dy:t.chromLabelPadding+t.chromLabelFontSize*.73,viewportEdgeFadeWidthLeft:20,viewportEdgeFadeWidthRight:20,viewportEdgeFadeDistanceRight:-10,viewportEdgeFadeDistanceLeft:-20};break;case"left":d={x:1,angle:-90,paddingY:4,dy:-t.chromLabelPadding,viewportEdgeFadeWidthBottom:20,viewportEdgeFadeWidthTop:20,viewportEdgeFadeDistanceBottom:-20,viewportEdgeFadeDistanceTop:-10};break;case"right":d={x:0,angle:90,align:"right",paddingY:4,dy:-t.chromLabelPadding};break;default:d={}}return{name:"chromosome_labels",mark:{type:"text",size:t.chromLabelFontSize,font:t.chromLabelFont,fontWeight:t.chromLabelFontWeight,fontStyle:t.chromLabelFontStyle,color:t.chromLabelColor,align:n.chromLabelAlign,baseline:"alphabetic",clip:!1,...d},encoding:{[i+"2"]:{field:"continuousEnd",type:e},text:{field:"name"}}}};let l;switch(t.orient){case"bottom":case"top":l={};break;case"left":l={labelAngle:-90,labelAlign:"center",labelPadding:6};break;case"right":l={labelAngle:90,labelAlign:"center",labelPadding:6};break;default:l={}}const c=O$({...n,...l},e);if(n.chromTicks||n.chromLabels){const d={name:phe,data:{lazy:{type:"axisGenome",channel:Qd(t.orient)}},encoding:{[i]:{field:"continuousStart",type:e,band:0}},layer:[]};if(n.chromTicks&&d.layer.push(r()),n.chromLabels){d.layer.push(a());let u;c.layer.filter(h=>h.name=="ticks_and_labels").forEach(h=>h.layer.filter(f=>f.name=="labels").forEach(f=>{u=f.mark})),u&&(t.orient=="top"||t.orient=="bottom"?(u.viewportEdgeFadeWidthLeft=30,u.viewportEdgeFadeDistanceLeft=40):(u.viewportEdgeFadeWidthBottom=30,u.viewportEdgeFadeDistanceBottom=40))}c.layer.push(d)}return c}class yhe extends $1{constructor(e,t,i,s,o,r){const l={...t=="locus"?whe:F$,...e};super(Lhe(l,t),i,s,o,`axisGrid_${e.orient}`,{blockEncodingInheritance:!0,contributesToScaleDomain:!1,...r}),this.axisProps=l}getOrient(){return this.axisProps.orient}isPickingSupported(){return!1}}const F$={values:null,grid:!1,gridCap:"butt",gridColor:"lightgray",gridDash:null,gridOpacity:1,gridWidth:1,tickCount:null,tickMinStep:null},whe={...F$,chromGrid:!1,chromGridCap:"butt",chromGridColor:"gray",chromGridDash:[1,5],chromGridOpacity:1,chromGridWidth:1};function Che(n,e){const t=n,i=Qd(t.orient);return{name:"grid_lines",data:{lazy:{type:"axisTicks",channel:i,axis:n}},mark:{type:"rule",strokeDash:t.gridDash,strokeCap:t.gridCap,color:t.gridColor,size:t.gridWidth,opacity:t.gridOpacity,minBufferSize:300},encoding:{[i]:{field:"value",type:e}}}}function She(n,e){const t=n,i=Qd(t.orient);return{name:"chromosome_lines",data:{lazy:{type:"axisGenome",channel:i}},mark:{type:"rule",strokeDash:t.chromGridDash,strokeCap:t.chromGridCap,color:t.chromGridColor,size:t.chromGridWidth,opacity:t.chromGridOpacity},encoding:{[i]:{field:"continuousStart",type:e,band:0}}}}function xhe(n,e){const t=n,i=Qd(t.orient);return{name:"chromosome_fill",data:{lazy:{type:"axisGenome",channel:i}},mark:{type:"rect"},encoding:{[i]:{field:"continuousStart",type:e,band:0},[i+"2"]:{field:"continuousEnd",band:0},fill:{field:"odd",type:"nominal",scale:{domain:[!1,!0],range:[t.chromGridFillEven??"white",t.chromGridFillOdd??"white"]}},opacity:{field:"odd",type:"nominal",scale:{type:"ordinal",domain:[!1,!0],range:[t.chromGridFillEven?1:0,t.chromGridFillOdd?1:0]}}}}}function Lhe(n,e){const t={...n},i=[];return t.chromGrid&&(t.chromGridFillOdd||t.chromGridFillEven)&&i.push(xhe(t,e)),t.chromGrid&&t.chromGridOpacity>0&&i.push(She(t,e)),t.grid&&t.gridOpacity>0&&i.push(Che(t,e)),{name:"grid_layers",configurableVisibility:!1,resolve:{scale:{[Qd(n.orient)]:"forced",fill:"independent",opacity:"independent"}},layer:i}}const CF={anchor:"middle",frame:"group",offset:10,orient:"top",align:void 0,angle:0,baseline:"alphabetic",dx:0,dy:0,color:void 0,font:void 0,fontSize:12,fontStyle:"normal",fontWeight:"normal"},Dhe={orient:"left",anchor:"middle",align:"right",baseline:"middle",angle:0,fontSize:12},khe={orient:"top",anchor:"start",align:"left",baseline:"top",offset:-10,dx:10,fontSize:12},Ehe={start:0,middle:.5,end:1},Ahe={start:"left",middle:"center",end:"right"};function Ihe(n){if(!n)return;const e=Ti(n)?{text:n}:n;if(!e.text||e.orient=="none")return;const t={"track-title":Dhe,overlay:khe}[e.style]??{},i={...CF,...t,...e};let s={},o={x:0,y:0};const r=Ehe[i.anchor??"middle"];switch(i.orient){case"top":o={x:r,y:1},s={baseline:"alphabetic",angle:0};break;case"right":o={x:1,y:1-r},s={baseline:"alphabetic",angle:90};break;case"bottom":o={x:r,y:0},s={baseline:"top",angle:0};break;case"left":o={x:0,y:r},s={baseline:"alphabetic",angle:-90};break}const a={...CF,...s,...t,...e},l={xOffset:0,yOffset:0};switch(i.orient){case"top":l.yOffset=-a.offset;break;case"right":l.xOffset=a.offset;break;case"bottom":l.yOffset=a.offset;break;case"left":l.xOffset=-a.offset;break}return{configurableVisibility:!1,data:{values:[{}]},mark:{type:"text",tooltip:null,clip:!1,...o,...l,text:a.text,align:a.align??Ahe[a.anchor],angle:a.angle,baseline:a.baseline,dx:a.dx,dy:a.dy,color:a.color,font:a.font,size:a.fontSize,fontStyle:a.fontStyle,fontWeight:a.fontWeight}}}var Bh,sd,od;class The{constructor(e){Pe(this,Bh);Pe(this,sd,0);Pe(this,od,0);dt(this,Bh,new Array(e))}push(e){X(this,Bh)[X(this,sd)]=e,dt(this,sd,(X(this,sd)+1)%this.size),dt(this,od,Math.min(X(this,od)+1,this.size))}get(){const e=X(this,Bh);return X(this,od){const h=Fa.fromMouseEvent(u);o.push({point:h,timestamp:performance.now()});const f=h.subtract(a);t({x:a.x,y:a.y,xDelta:f.x,yDelta:f.y,zDelta:0}),a=h},c=()=>{const h=performance.now(),f=o.get().filter(y=>h-y.timestamp<160);if(f.length<5||!s||Mhe(f))return;const g=f.at(-1),p=f[0],_=g.point.subtract(p.point).multiply(1/(g.timestamp-p.timestamp));let v=a.x,b=a.y;$u=w4(s,y=>{t({x:y.x,y:y.y,xDelta:v-y.x,yDelta:b-y.y,zDelta:0}),v=y.x,b=y.y},150,.5,{x:v,y:b}),$u({x:a.x-_.x*250,y:a.y-_.y*250})},d=()=>{document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",d),c()};document.addEventListener("mouseup",d,!1),document.addEventListener("mousemove",l,!1)}}function Mhe(n){const e=n[Math.floor(n.length/2)],t=e.point.subtract(n[0].point).multiply(e.timestamp-n[0].timestamp),i=n.at(-1).point.subtract(e.point).multiply(n.at(-1).timestamp-e.timestamp),s=t.length;return i.length/s<.4}var Kp,Yp,Io,Wh,Zp,Ut,eh,W$,r_,GA,KA,YA,V$,eC,z$;class Phe extends H1{constructor(t,i,s,o,r,a,l){super(t,i,s,o,r,l);Pe(this,Ut);Pe(this,Kp,1/0);Pe(this,Yp,10);Pe(this,Io,[]);Pe(this,Wh,{});Pe(this,Zp,0);this.spec=t,dt(this,Yp,t.spacing??10),dt(this,Kp,a),dt(this,Io,[]),this.wrappingFacet=!1}appendChild(t){t.layoutParent??(t.layoutParent=this),X(this,Io).push(new LF(t,this,X(this,Zp))),s5(this,Zp)._++}setChildren(t){dt(this,Io,[]);for(const i of t)this.appendChild(i)}replaceChild(t,i){const s=X(this,Io).findIndex(o=>o.view==t);if(s>=0)X(this,Io)[s]=new LF(i,this,X(this,Zp));else throw new Error("Not my child view!")}get children(){return X(this,Io).map(t=>t.view)}get childCount(){return X(this,Io).length}async createAxes(){const t=[];for(const i of e0){const s=this.resolutions.axis[i];if(s){const o=s.getAxisProps();if(o){const r={title:s.getTitle(),orient:dS[i][0],...o},a=new M$(r,s.scaleResolution.type,this.context,this,this);t.push(a.initializeChildren()),X(this,Wh)[i]=a}}}return Promise.all([...t,...X(this,Io).map(i=>i.createAxes())])}*[Symbol.iterator](){for(const t of X(this,Io))yield*t.getChildren();for(const t of Object.values(X(this,Wh)))yield t}getOverhang(){return xe(this,Ut,V$).call(this).union(xe(this,Ut,eC).call(this))}getSize(){return this._cache("size",()=>new Xd(xe(this,Ut,KA).call(this,"column"),xe(this,Ut,KA).call(this,"row")).addPadding(xe(this,Ut,eC).call(this)))}render(t,i,s={}){if(super.render(t,i,s),!this.isConfiguredVisible())return;this.layoutParent||(i=i.shrink(this.getPadding())),i=i.shrink(xe(this,Ut,eC).call(this)),t.pushView(this,i);const o={devicePixelRatio:this.context.devicePixelRatio},r=fF(xe(this,Ut,GA).call(this,"column"),i.width,o),a=fF(xe(this,Ut,GA).call(this,"row"),i.height,o),l=new wF(X(this,Ut,eh).length,X(this,Kp)??1/0),c=d=>Math.round(d*devicePixelRatio)/devicePixelRatio;for(const[d,u]of X(this,Ut,eh).entries()){const{view:h,axes:f,gridLines:g,background:p,backgroundStroke:_,title:v}=u,[b,y]=l.getCellCoords(d),w=r[xe(this,Ut,YA).call(this,"column",b)],S=a[xe(this,Ut,YA).call(this,"row",y)],L=h.getViewportSize(),x=h.getSize(),D=h.getOverhang(),k=w.location-D.left,P=S.location-D.top,O=(Dt,Tt)=>(Dt[Tt].grow?(Tt=="width"?w:S).size:Dt[Tt].px)+D[Tt],M=O(L,"width"),R=O(L,"height"),z=O(x,"width"),G=O(x,"height"),te=u.scrollbars.horizontal,ae=u.scrollbars.vertical,fe=te?()=>c(te.viewportOffset):()=>0,oe=ae?()=>c(ae.viewportOffset):()=>0,Se=new sc(()=>i.x+k,()=>i.y+P,()=>M,()=>R),Ie=h.isScrollable(),me=Ie?new sc(()=>i.x+k-fe(),()=>i.y+P-oe(),()=>z,()=>G):Se;u.coords=Se;const ie=s.clipRect?Se.intersect(s.clipRect):Se;p==null||p.render(t,ie,{...s,clipRect:void 0});for(const Dt of Object.values(g))Dt.render(t,Se,s);const Zt=Whe(h)||Ie;Zt&&h.render(t,me,{...s,clipRect:ie}),_==null||_.render(t,ie,{...s,clipRect:void 0});for(const[Dt,Tt]of Object.entries(f)){const qe=Dt=="left"||Dt=="right"?"vertical":"horizontal",ni=u.scrollbars[qe],ke=ni?Se.modify(qe=="vertical"?{y:()=>me.y,height:G}:{x:()=>me.x,width:z}):Se,Ve=xF(ke,Dt,Tt);let ge=s.clipRect;ni&&(ge=Ve.intersect(ge).intersect(ni?Se.modify(qe=="vertical"?{x:-1e5,width:2e5}:{y:-1e5,height:2e5}):void 0)),Tt.render(t,Ve,{...s,clipRect:ge})}for(const Dt of Object.values(X(this,Wh))){const qe=Dt.axisProps.orient;(qe=="left"&&b==0||qe=="right"&&b==l.nCols-1||qe=="top"&&y==0||qe=="bottom"&&y==l.nRows-1)&&Dt.render(t,xF(Se.shrink(u.view.getOverhang()),qe,Dt),s)}Zt||h.render(t,me,s);for(const Dt of Object.values(u.scrollbars))Dt.updateScrollbar(Se,me),Dt.render(t,i,s);v==null||v.render(t,Se,s)}t.popView(this)}propagateInteractionEvent(t){if(this.handleInteractionEvent(void 0,t,!0),t.stopped)return;const i=X(this,Ut,eh).find(o=>o.coords.containsPoint(t.point.x,t.point.y));for(const o of Object.values((i==null?void 0:i.scrollbars)??{}))if(o.coords.containsPoint(t.point.x,t.point.y)&&(o.propagateInteractionEvent(t),t.stopped))return;const s=i==null?void 0:i.view;s&&(s.propagateInteractionEvent(t),(s instanceof Po||s instanceof $1)&&Rhe(t,i.coords,o=>xe(this,Ut,z$).call(this,i.coords,i.view,o),this.context.getCurrentHover(),this.context.animator)),!t.stopped&&this.handleInteractionEvent(void 0,t,!1)}getDefaultResolution(t,i){return"independent"}}Kp=new WeakMap,Yp=new WeakMap,Io=new WeakMap,Wh=new WeakMap,Zp=new WeakMap,Ut=new WeakSet,eh=function(){return X(this,Io).filter(t=>t.view.isConfiguredVisible())},W$=function(){return new wF(X(this,Ut,eh).length,X(this,Kp)??1/0)},r_=function(t){const i=t=="column"?"width":"height",s=(o,r)=>o.map(a=>{const c=X(this,Ut,eh)[a].getOverhangAndPadding();return t=="column"?r?c.right:c.left:r?c.bottom:c.top}).reduce((a,l)=>Math.max(a,l),0);return this._cache(`size/directionSizes/${t}`,()=>X(this,Ut,W$)[t=="column"?"colIndices":"rowIndices"].map(o=>({axisBefore:s(o,0),axisAfter:s(o,1),view:bde(o.map(r=>X(this,Ut,eh)[r].view.getViewportSize()[i]))})))},GA=function(t){const i=xe(this,Ut,r_).call(this,t),s=[];s.push(R_);for(const[o,r]of i.entries())o>0&&s.push({px:X(this,Yp),grow:0}),(o==0||this.wrappingFacet)&&s.push(R_),s.push({px:r.axisBefore,grow:0}),s.push(r.view),s.push({px:r.axisAfter,grow:0}),(o==i.length-1||this.wrappingFacet)&&s.push(R_);return s},KA=function(t){let i=0,s=0;const o=t=="row"?this.spec.height:this.spec.width;if(o||o===0)return g$(o);const r=xe(this,Ut,r_).call(this,t);for(const[a,l]of r.entries())a>0&&(s+=X(this,Yp)),(a==0||this.wrappingFacet)&&(s+=0),s+=l.axisBefore,s+=l.view.px??0,i+=l.view.grow??0,s+=l.axisAfter,(a==r.length-1||this.wrappingFacet)&&(s+=0);return{px:s,grow:i}},YA=function(t,i){return t=="row"&&this.wrappingFacet?1+6*i+2:2+4*i+1},V$=function(){const t=xe(this,Ut,r_).call(this,"column"),i=xe(this,Ut,r_).call(this,"row");return!t.length||!i.length?ws.zero():new ws(i.at(0).axisBefore,t.at(-1).axisAfter,i.at(-1).axisAfter,t.at(0).axisBefore)},eC=function(){const t=i=>{const s=C4[i],o=X(this,Wh)[s];return(o==null?void 0:o.axisProps.orient)!==i?0:Math.max(o.getPerpendicularSize()+(o.axisProps.offset??0),0)};return new ws(t("top"),t("right"),t("bottom"),t("left"))},z$=function(t,i,s){for(const[o,r]of Object.entries(Bhe(i))){if(r.size<=0)continue;const a=t.normalizePoint(s.x,s.y),l=t.normalizePoint(s.x+s.xDelta,s.y+s.yDelta),c={x:l.x-a.x,y:l.y-a.y};for(const d of r)d.zoom(2**s.zDelta,o=="y"?1-a[o]:a[o],o=="x"?c.x:-c.y)}this.context.animator.requestRender()};function Ohe(n){if(!(!n||!n.fill||n.fillOpacity===0))return{configurableVisibility:!1,data:{values:[{}]},mark:{color:n.fill,opacity:n.fillOpacity??1,type:"rect",clip:!1,tooltip:null,minHeight:1,minOpacity:0}}}function Fhe(n){if(!(!n||!n.stroke||n.strokeWidth===0||n.strokeOpacity===0))return{configurableVisibility:!1,resolve:{scale:{x:"excluded",y:"excluded"},axis:{x:"excluded",y:"excluded"}},data:{values:[{x:0,y:0,x2:1,y2:0},{x:1,y:0,x2:1,y2:1},{x:1,y:1,x2:0,y2:1},{x:0,y:1,x2:0,y2:0}]},mark:{size:n.strokeWidth??1,color:n.stroke??"lightgray",strokeCap:"square",opacity:n.strokeOpacity??1,type:"rule",clip:!1,tooltip:null},encoding:{x:{field:"x",type:"quantitative",scale:null},y:{field:"y",type:"quantitative",scale:null},x2:{field:"x2"},y2:{field:"y2"}}}}function Bhe(n){const e={x:new Set,y:new Set};return n.visit(t=>{for(const[i,s]of Object.entries(e)){const o=t.getScaleResolution(i);o&&o.isZoomable()&&s.add(o)}}),e}function Whe(n){let e=!0;return n.visit(t=>{t instanceof Po&&e&&(e=t.mark.properties.clip===!0)}),e}function xF(n,e,t){const i=t.axisProps,s=t.getPerpendicularSize();if(e=="bottom")return n.translate(0,n.height+i.offset).modify({height:s});if(e=="top")return n.translate(0,-s-i.offset).modify({height:s});if(e=="left")return n.translate(-s-i.offset,0).modify({width:s});if(e=="right")return n.translate(n.width+i.offset,0).modify({width:s})}class LF{constructor(e,t,i){if(this.layoutParent=t,this.view=e,this.serial=i,this.background=void 0,this.backgroundStroke=void 0,this.axes={},this.gridLines={},this.scrollbars={},this.title=void 0,this.coords=sc.ZERO,e.needsAxes.x||e.needsAxes.y){const s=e.spec,o="view"in s?s==null?void 0:s.view:void 0,r=Ohe(o);r&&(this.background=new Po(r,t.context,t,e,"background"+i,{blockEncodingInheritance:!0}));const a=Fhe(o);a&&(this.backgroundStroke=new Po(a,t.context,t,e,"backgroundStroke"+i,{blockEncodingInheritance:!0}));const l=Ihe(e.spec.title);if(l){const c=new Po(l,t.context,t,e,"title"+i,{blockEncodingInheritance:!0});this.title=c}}e.spec.viewportWidth!=null&&(this.scrollbars.horizontal=new DF(this,"horizontal")),e.spec.viewportHeight!=null&&(this.scrollbars.vertical=new DF(this,"vertical"))}*getChildren(){this.background&&(yield this.background),this.backgroundStroke&&(yield this.backgroundStroke),this.title&&(yield this.title),yield*Object.values(this.axes),yield*Object.values(this.gridLines),yield this.view,yield*Object.values(this.scrollbars)}async createAxes(){const{view:e,axes:t,gridLines:i}=this,s=(a,l)=>{const c=a.getAxisProps();if(c===null)return;const d=c?{...c}:{};if(!d.orient){for(const u of dS[l])if(!t[u]){d.orient=u;break}if(!d.orient)throw new Error("No slots available for an axis! Perhaps a LayerView has more than two children?")}if(d.title??(d.title=a.getTitle()),!dS[l].includes(d.orient))throw new Error(`Invalid axis orientation "${d.orient}" on channel "${l}"!`);return d},o=async(a,l,c)=>{const d=s(a,l);if(d){if(t[d.orient])throw new Error(`An axis with the orient "${d.orient}" already exists!`);const u=new M$(d,a.scaleResolution.type,this.layoutParent.context,this.layoutParent,c);t[d.orient]=u,await u.initializeChildren()}},r=async(a,l,c)=>{const d=s(a,l);if(d&&(d.grid||d.chromGrid)){const u=new yhe(d,a.scaleResolution.type,this.layoutParent.context,this.layoutParent,c);i[d.orient]=u,await u.initializeChildren()}};for(const a of["x","y"])if(e.needsAxes[a]){const l=e.resolutions.axis[a];if(!l)continue;await o(l,a,e)}for(const a of["x","y"])if(e.needsAxes[a]&&e.getConfiguredOrDefaultResolution(a,"axis")!="excluded"){const l=e.getAxisResolution(a);if(!l)continue;await r(l,a,e)}if(e instanceof $1){for(const a of e)for(const[l,c]of Object.entries(a.resolutions.axis)){const d=c.getAxisProps();d&&d.orient&&await o(c,l,a)}for(const a of e)for(const[l,c]of Object.entries(a.resolutions.axis)){const d=c.getAxisProps();d&&!d.orient&&await o(c,l,a)}}[...Object.values(t),...Object.values(i)].forEach(a=>a.visit(l=>{l instanceof Po&&l.resolve("scale")}))}getOverhang(){const e=t=>{const i=this.axes[t];return i?Math.max(i.getPerpendicularSize()+(i.axisProps.offset??0),0):0};return new ws(e("top"),e("right"),e("bottom"),e("left")).add(this.view.getOverhang())}getOverhangAndPadding(){return this.getOverhang().add(this.view.getPadding())}}var Xp,h1,rd,Vh;class DF extends Po{constructor(t,i){const s={scrollbarSize:8,scrollbarPadding:2};super({data:{values:[{}]},mark:{type:"rect",fill:"#b0b0b0",fillOpacity:.6,stroke:"white",strokeWidth:1,strokeOpacity:1,cornerRadius:5,clip:!1},configurableVisibility:!1},t.layoutParent.context,t.layoutParent,t.view,"scrollbar-"+i,{blockEncodingInheritance:!0});Pe(this,Xp);Pe(this,h1,sc.ZERO);Pe(this,rd,0);Pe(this,Vh,0);Ei(this,"viewportOffset",0);this.config=s,dt(this,Xp,i),this.interpolateViewportOffset=w4(this.context.animator,o=>{this.viewportOffset=o.x},50,.4,{x:this.viewportOffset}),this.addInteractionEventListener("mousedown",(o,r)=>{if(r.stopPropagation(),X(this,rd)<=0)return;const a=f=>i=="vertical"?f.clientY:f.clientX,l=r.uiEvent;l.preventDefault();const c=this.scrollOffset,d=a(l),u=f=>{const g=fm(a(f)-d+c,0,X(this,rd));this.interpolateViewportOffset({x:g/X(this,rd)*X(this,Vh)})},h=()=>{document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",h)};document.addEventListener("mouseup",h,!1),document.addEventListener("mousemove",u,!1)})}get scrollOffset(){return this.viewportOffset/X(this,Vh)*X(this,rd)}render(t,i,s){super.render(t,X(this,h1),s)}updateScrollbar(t,i){const s=this.config.scrollbarPadding,o=this.config.scrollbarSize,r=X(this,Xp)=="horizontal"?"width":"height",a=Math.min(1,t[r]/i[r]),l=t[r]-2*s,c=a*l;dt(this,rd,l-c),dt(this,Vh,i[r]-t[r]),this.viewportOffset=fm(this.viewportOffset,0,X(this,Vh)),dt(this,h1,X(this,Xp)=="vertical"?new sc(()=>t.x+t.width-o-s,()=>t.y+s+this.scrollOffset,()=>o,()=>c):new sc(()=>t.x+s+this.scrollOffset,()=>t.y+t.height-o-s,()=>c,()=>o))}}Xp=new WeakMap,h1=new WeakMap,rd=new WeakMap,Vh=new WeakMap;class $k extends Phe{constructor(e,t,i,s,o){super(e,t,i,s,o,QA(e)?e.columns:tC(e)?1:1/0),this.spec=e}async initializeChildren(){const e=this.spec,t=QA(e)?e.concat:tC(e)?e.vconcat:e.hconcat;this.setChildren(await Promise.all(t.map((i,s)=>this.context.createOrImportView(i,this,this,"grid"+s)))),await this.createAxes()}getDefaultResolution(e,t){return t=="axis"?"independent":tC(this.spec)&&e==="x"||U$(this.spec)&&e==="y"?"shared":"independent"}}const H$="viewRoot";var Qp;class Vhe{constructor(e={}){Pe(this,Qp,new Map);this.options={allowImport:!0,wrapRoot:!0,...e};const t=i=>(s,o,r,a,l)=>new i(s,o,r,a,s.name??l);this.addViewType(XA,t($1)),this.addViewType(ZA,t(Po)),this.addViewType(tC,t($k)),this.addViewType(U$,t($k)),this.addViewType(QA,t($k)),this.addViewType($he,()=>{throw new Error("SampleView is not supported by the @genome-spy/core package. Use @genome-spy/app instead!")})}addViewType(e,t){X(this,Qp).set(e,t)}createView(e,t,i,s,o){for(const[r,a]of X(this,Qp))if(r(e))return a(e,t,i,s,o);throw new Error("Invalid spec, cannot figure out the view type from the properties: "+JSON.stringify([...Object.keys(e)]))}isViewSpec(e){const t=[...X(this,Qp).keys()].filter(i=>i(e));if(t.length>1)throw new Error("Ambiguous spec. Cannot create a view!");return t.length==1}async createOrImportView(e,t,i,s,o,r){let a;if(Hhe(e)){let c;if("url"in e.import)if(this.options.allowImport)c=await que(e,s.getBaseUrl(),t);else throw new Kh("Importing views is not allowed!",i);else if("template"in e.import)c=$$(e.import.template,s);else throw new Error("Invalid import: "+JSON.stringify(e));r==null||r(c),zhe(c,e),a=c}else a=e;!s&&this.options.wrapRoot&&(ZA(a)||XA(a))&&o===H$&&(a={name:"implicitRoot",vconcat:[a]});const l=this.createView(a,t,i,s,o);return l instanceof H1&&await l.initializeChildren(),l}}Qp=new WeakMap;function $$(n,e){var i,s;const t=(s=(i=e.spec)==null?void 0:i.templates)==null?void 0:s[n];if(t)return structuredClone(t);if(e.dataParent)return $$(n,e.dataParent);throw new Error(`Cannot find template "${n}" in current view or its ancestors!`)}function zhe(n,e){e.name!=null&&(n.name=e.name);const t=cs(e.params)?e.params:Ms(e.params)?Object.entries(e.params).map(([i,s])=>({name:i,value:s})):[];if(t.length){n.params??(n.params=[]);for(const i of t){const s=n.params.findIndex(o=>o.name==i.name);s>=0&&(n.params[s]=i)}for(const i of t)n.params.some(s=>s.name==i.name)||n.params.push(i)}}function ZA(n){return"mark"in n&&(Ti(n.mark)||Ms(n.mark))}function XA(n){return"layer"in n&&Ms(n.layer)}function Hhe(n){return"import"in n}function tC(n){return"vconcat"in n&&cs(n.vconcat)}function U$(n){return"hconcat"in n&&cs(n.hconcat)}function QA(n){return"concat"in n&&cs(n.concat)}function $he(n){return"samples"in n&&Ms(n.samples)&&"spec"in n&&Ms(n.spec)}function Uhe(n){const e=Math.floor(Math.random()*16777215).toString(16),t=[];for(const i of n.paramConfigs.values()){if(!ile(i))continue;const s=i.bind;if(!s||!("input"in s))continue;const o=i.name,r=n.getSetter(o),a=n.getValue(o),l=s.name??o,c=s.debounce?Pb(r,s.debounce,!1):r,d=`${e}-param-${o}`;if(s.input=="range")t.push(Lt`
{c(u.target.valueAsNumber),u.target.nextElementSibling.textContent=u.target.valueAsNumber}} />${a} -
`);else if(s.input=="checkbox")t.push(It` + `);else if(s.input=="checkbox")t.push(Lt` c(u.target.checked)} - />`);else if(s.input=="radio")t.push(It`${l} + />`);else if(s.input=="radio")t.push(Lt`${l}
- ${s.options.map((u,h)=>{var f;return It``})} -
`);else if(s.input=="select")t.push(It` + ${s.options.map((u,h)=>{var f;return Lt``})} + `);else if(s.input=="select")t.push(Lt` `);else if(s.input=="text"||s.input=="number"||s.input=="color")t.push(It` + ${s.options.map((u,h)=>{var f;return Lt``})} + `);else if(s.input=="text"||s.input=="number"||s.input=="color")t.push(Lt`
u.target.select()} @input=${u=>{c(s.input=="number"?u.target.valueAsNumber:u.target.value)}} /> -
`);else throw new Error("Unsupported input type: "+s.input);s.description&&t.push(It`
${s.description}
`)}return t}xM("fasta",Wue);var Cr,lC,q$,G$,K$;class Lhe{constructor(e,t,i={}){Oe(this,Cr);this.container=e,this.options=i,i.inputBindingContainer??(i.inputBindingContainer="default"),this._destructionCallbacks=[],this.spec=t,this.viewFactory=new yhe,this.namedDataProviders=[],this.animator=new Nue(()=>this.renderAll()),this.genomeStore=void 0,this.viewVisibilityPredicate=s=>s.isVisibleInSpec(),this._renderingContext=void 0,this._pickingContext=void 0,this._dirtyPickingBuffer=!1,this._currentHover=void 0,this._wheelInertia=new Vue(this.animator),this._keyboardListeners=new Map,this._eventListeners=new Map,this._extraBroadcastListeners=new Map,this.tooltipHandlers={default:Kue,refseqgene:Hue,...i.tooltipHandlers??{}},this.viewRoot=void 0,this._loadingViews=new Map,this._inputBindingContainer=void 0,this._mouseDownCoords=void 0}registerNamedDataProvider(e){this.namedDataProviders.unshift(e)}getNamedDataFromProvider(e){for(const t of this.namedDataProviders){const i=t(e);if(i)return i}}updateNamedData(e,t){const i=this.viewRoot.context.dataFlow.findNamedDataSource(e);if(!i)throw new Error("No such named data source: "+e);i.dataSource.updateDynamicData(t),BA(i.hosts),this.animator.requestRender()}broadcast(e,t){var s;const i={type:e,payload:t};this.viewRoot.visit(o=>o.handleBroadcast(i)),(s=this._extraBroadcastListeners.get(e))==null||s.forEach(o=>o(i))}_updateLoadingIndicators(){const e=[],t=()=>[...this._loadingViews.values()].some(i=>i.status=="loading"||i.status=="error");for(const[i,s]of this._loadingViews){const o=i.coords;if(o){const r={left:`${o.x}px`,top:`${o.y}px`,width:`${o.width}px`,height:`${o.height}px`};e.push(It`
+
`);else throw new Error("Unsupported input type: "+s.input);s.description&&t.push(Lt`
${s.description}
`)}return t}CM("fasta",ohe);var wr,iC,j$,q$,G$;class jhe{constructor(e,t,i={}){Pe(this,wr);this.container=e,this.options=i,i.inputBindingContainer??(i.inputBindingContainer="default"),this._destructionCallbacks=[],this.spec=t,this.viewFactory=new Vhe,this.namedDataProviders=[],this.animator=new Que(()=>this.renderAll()),this.genomeStore=void 0,this.viewVisibilityPredicate=s=>s.isVisibleInSpec(),this._renderingContext=void 0,this._pickingContext=void 0,this._dirtyPickingBuffer=!1,this._currentHover=void 0,this._wheelInertia=new rhe(this.animator),this._keyboardListeners=new Map,this._eventListeners=new Map,this._extraBroadcastListeners=new Map,this.tooltipHandlers={default:ghe,refseqgene:lhe,...i.tooltipHandlers??{}},this.viewRoot=void 0,this._loadingViews=new Map,this._inputBindingContainer=void 0,this._mouseDownCoords=void 0}registerNamedDataProvider(e){this.namedDataProviders.unshift(e)}getNamedDataFromProvider(e){for(const t of this.namedDataProviders){const i=t(e);if(i)return i}}updateNamedData(e,t){const i=this.viewRoot.context.dataFlow.findNamedDataSource(e);if(!i)throw new Error("No such named data source: "+e);i.dataSource.updateDynamicData(t),OA(i.hosts),this.animator.requestRender()}broadcast(e,t){var s;const i={type:e,payload:t};this.viewRoot.visit(o=>o.handleBroadcast(i)),(s=this._extraBroadcastListeners.get(e))==null||s.forEach(o=>o(i))}_updateLoadingIndicators(){const e=[],t=()=>[...this._loadingViews.values()].some(i=>i.status=="loading"||i.status=="error");for(const[i,s]of this._loadingViews){const o=i.coords;if(o){const r={left:`${o.x}px`,top:`${o.y}px`,width:`${o.width}px`,height:`${o.height}px`};e.push(Lt`
- ${s.status=="error"?It`Loading - failed${s.detail?It`: ${s.detail}`:$i}`:It` - + failed${s.detail?Lt`: ${s.detail}`:zi}`:Lt` + Loading... `}
-
`)}}t()?this.loadingIndicatorsElement.style.display="block":setTimeout(()=>{t()||(this.loadingIndicatorsElement.style.display="none")},3e3),Qp(e,this.loadingIndicatorsElement)}destroy(){var t;const e=X(this,Cr,lC);this.container.classList.remove("genome-spy"),e.classList.remove("loading");for(const[i,s]of this._keyboardListeners)for(const o of s)document.removeEventListener(i,o);for(this._destructionCallbacks.forEach(i=>i()),this._glHelper.finalize(),(t=this._inputBindingContainer)==null||t.remove();this.container.firstChild;)this.container.firstChild.remove()}async _prepareViewsAndData(){this.spec.genome&&(this.genomeStore=new Rue(this.spec.baseUrl),await this.genomeStore.initialize(this.spec.genome));const e=this,t={dataFlow:new I$,glHelper:this._glHelper,animator:this.animator,genomeStore:this.genomeStore,fontManager:new Oue(this._glHelper),get devicePixelRatio(){return e._glHelper.dpr},requestLayoutReflow:()=>{},updateTooltip:this.updateTooltip.bind(this),getNamedDataFromProvider:this.getNamedDataFromProvider.bind(this),getCurrentHover:()=>this._currentHover,setDataLoadingStatus:(l,c,d)=>{this._loadingViews.set(l,{status:c,detail:d}),this._updateLoadingIndicators()},addKeyboardListener:(l,c)=>{document.addEventListener(l,c);let d=this._keyboardListeners.get(l);d||(d=[],this._keyboardListeners.set(l,d)),d.push(c)},addBroadcastListener(l,c){const d=e._extraBroadcastListeners;let u=d.get(l);u||(u=new Set,d.set(l,u)),u.add(c)},removeBroadcastListener(l,c){var u;(u=e._extraBroadcastListeners.get(l))==null||u.delete(c)},isViewConfiguredVisible:e.viewVisibilityPredicate,isViewSpec:l=>e.viewFactory.isViewSpec(l),createView:function(l,c,d,u){return e.viewFactory.createView(l,t,c,d,u)},createOrImportView:async function(l,c,d,u,h){return e.viewFactory.createOrImportView(l,t,c,d,u,h)}},i=this.spec;i.datasets&&this.registerNamedDataProvider(l=>i.datasets[l]),this.viewRoot=await t.createOrImportView(i,null,null,$$),X(this,Cr,lC).style.flexGrow=this.viewRoot.getSize().height.grow>0?"1":"0",Le(this,Cr,q$).call(this),xue(this.viewRoot),Lue(this.viewRoot);const s=this.viewRoot.getDescendants();s.forEach(l=>l.configureViewOpacity()),this._glHelper.invalidateSize(),Le(this,Cr,G$).call(this);const o=s.filter(l=>l instanceof Bo),r=bue(this.viewRoot,t.dataFlow);Sue(r),this.broadcast("dataFlowBuilt",r),o.forEach(l=>l.mark.initializeEncoders());const a=Promise.all(o.map(l=>l.mark.initializeGraphics()));for(const l of o)r.addObserver(c=>{l.mark.initializeData(),l.mark.updateGraphicsData(),t.animator.requestRender()},l);await t.fontManager.waitUntilReady(),r.initialize(),await Promise.all(r.dataSources.map(l=>l.load())),BA(this.viewRoot),this.broadcast("dataLoaded"),await a;for(const l of o)l.mark.finalizeGraphicsInitialization();t.requestLayoutReflow=this.computeLayout.bind(this),this.viewRoot.visit(l=>sC(l,"size")),this._glHelper.invalidateSize()}async launch(){try{return Le(this,Cr,K$).call(this),await this._prepareViewsAndData(),this.registerMouseEvents(),this.computeLayout(),this.animator.requestRender(),!0}catch(e){const t=`${e.view?`At "${e.view.getPathString()}": `:""}${e.toString()}`;return console.error(e.stack),Dhe(this.container,t),!1}finally{X(this,Cr,lC).classList.remove("loading"),window.setTimeout(()=>{this.loadingMessageElement.style.display="none"},2e3)}}registerMouseEvents(){const e=this._glHelper.canvas;let t=performance.now();const i=s=>{var a,l;const o=performance.now(),r=o-t<200;if(s instanceof MouseEvent){const c=e.getBoundingClientRect(),d=new Ba(s.clientX-c.left-e.clientLeft,s.clientY-c.top-e.clientTop);s.type=="mousemove"&&!r&&(this.tooltip.handleMouseMove(s),this._tooltipUpdateRequested=!1,s.buttons==0&&!kF()&&(this.renderPickingFramebuffer(),this._handlePicking(d.x,d.y)));const u=h=>{this.viewRoot.propagateInteractionEvent(new Aue(d,h)),this._tooltipUpdateRequested||this.tooltip.clear()};if(s.type!="wheel"&&this._wheelInertia.cancel(),(s.type=="mousedown"||s.type=="mouseup")&&!kF())this.renderPickingFramebuffer();else if(s.type=="wheel"){t=o,this._tooltipUpdateRequested=!1;const h=s;if(Math.abs(h.deltaX)>Math.abs(h.deltaY))this._currentHover=null,this._wheelInertia.cancel();else{const f=zue(h);this._wheelInertia.setMomentum(h.deltaY*(h.deltaMode?80:1),g=>{const p=new WheelEvent("wheel",{...f,deltaMode:0,deltaX:0,deltaY:g});u(p)}),h.preventDefault();return}}if(s.type=="click"){const h=this._currentHover?{type:s.type,viewPath:this._currentHover.mark.unitView.getLayoutAncestors().map(f=>f.name).reverse(),datum:this._currentHover.datum}:{type:s.type,viewPath:null,datum:null};(a=this._eventListeners.get("click"))==null||a.forEach(f=>f(h))}(s.type!="click"||((l=this._mouseDownCoords)==null?void 0:l.subtract(Ba.fromMouseEvent(s)).length)<3)&&u(s)}};["mousedown","mouseup","wheel","click","mousemove","gesturechange","contextmenu"].forEach(s=>e.addEventListener(s,i)),e.addEventListener("mousedown",s=>{this._mouseDownCoords=Ba.fromMouseEvent(s),document.addEventListener("mouseup",()=>this.tooltip.popEnabledState(),{once:!0}),this.tooltip.pushEnabledState(!1)}),e.addEventListener("dragstart",s=>s.stopPropagation())}_handlePicking(e,t){var o;const i=this._glHelper.readPickingPixel(e,t),s=i[0]|i[1]<<8|i[2]<<16|i[3]<<24;if(s==0){this._currentHover=null;return}if(s!==((o=this._currentHover)==null?void 0:o.uniqueId)&&(this._currentHover=null),this._currentHover||this.viewRoot.visit(r=>{if(r instanceof Bo){if(r.mark.isPickingParticipant()&&[...r.facetCoords.values()].some(a=>a.containsPoint(e,t))){const a=r.getCollector().findDatumByUniqueId(s);a&&(this._currentHover={mark:r.mark,datum:a,uniqueId:s})}if(this._currentHover)return A_}}),this._currentHover){const r=this._currentHover.mark;this.updateTooltip(this._currentHover.datum,async a=>{if(!r.isPickingParticipant())return;const l=r.properties.tooltip;if(l!==null){const c=(l==null?void 0:l.handler)??"default",d=this.tooltipHandlers[c];if(!d)throw new Error("No such tooltip handler: "+c);return d(a,r,l==null?void 0:l.params)}})}}updateTooltip(e,t){if(!this._tooltipUpdateRequested||!e)this.tooltip.updateWithDatum(e,t),this._tooltipUpdateRequested=!0;else throw new Error("Tooltip has already been updated! Duplicate event handler?")}computeLayout(){const e=this.viewRoot;if(!e)return;this.broadcast("layout");const t=this._glHelper.getLogicalCanvasSize();if(isNaN(t.width)||isNaN(t.height)){console.log(`NaN in canvas size: ${t.width}x${t.height}. Skipping computeLayout().`);return}this._renderingContext=new CF({picking:!1},this._glHelper),this._pickingContext=new CF({picking:!0},this._glHelper),e.render(new Eue(this._renderingContext,this._pickingContext),nc.create(0,0,t.width,t.height)),this._updateLoadingIndicators(),this.broadcast("layoutComputed")}renderAll(){var e;(e=this._renderingContext)==null||e.render(),this._dirtyPickingBuffer=!0}renderPickingFramebuffer(){this._dirtyPickingBuffer&&(this._pickingContext.render(),this._dirtyPickingBuffer=!1)}getSearchableViews(){const e=[];return this.viewRoot.visit(t=>{t instanceof Bo&&t.getDataAccessor("search")&&e.push(t)}),e}getNamedScaleResolutions(){const e=new Map;return this.viewRoot.visit(t=>{for(const i of Object.values(t.resolutions.scale))i.name&&e.set(i.name,i)}),e}}Cr=new WeakSet,lC=function(){return this.container.querySelector(".canvas-wrapper")},q$=function(){const e=[];this.viewRoot.visit(i=>{const s=i.paramMediator;e.push(...xhe(s))});const t=this.options.inputBindingContainer;if(!(!t||t=="none"||!e.length)){if(this._inputBindingContainer=Vy("div",{className:"gs-input-bindings"}),t=="default")this.container.appendChild(this._inputBindingContainer);else if(t instanceof HTMLElement)t.appendChild(this._inputBindingContainer);else throw new Error("Invalid inputBindingContainer");e.length&&Qp(It`
${e}
`,this._inputBindingContainer)}},G$=function(){const e=this.viewRoot.paramMediator.allocateSetter("devicePixelRatio",window.devicePixelRatio),t=()=>{this._glHelper.invalidateSize(),e(window.devicePixelRatio),this.computeLayout(),this.renderAll()};if(this.viewRoot.getSize().isGrowing()){const o=new ResizeObserver(t);o.observe(this.container),this._destructionCallbacks.push(()=>o.disconnect())}let i=null;const s=()=>{i!=null&&(i(),t());const o=matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);o.addEventListener("change",s),i=()=>{o.removeEventListener("change",s)}};s(),i&&this._destructionCallbacks.push(i)},K$=function(){this.container.classList.add("genome-spy");const e=document.createElement("style");e.innerHTML=Jee,this.container.appendChild(e);const t=Vy("div",{class:"canvas-wrapper"});this.container.appendChild(t),t.classList.add("loading"),this._glHelper=new Ele(t,()=>this.viewRoot?kue(this.viewRoot):{width:void 0,height:void 0},this.spec.background,{powerPreference:this.options.powerPreference??"default"}),this.loadingMessageElement=Vy("div",{class:"loading-message",innerHTML:'
Loading...
'}),t.appendChild(this.loadingMessageElement),this.loadingIndicatorsElement=Vy("div",{class:"loading-indicators"}),t.appendChild(this.loadingIndicatorsElement),this.tooltip=new tte(this.container),this.loadingMessageElement.querySelector(".message").addEventListener("transitionend",()=>{this.loadingMessageElement.style.display="none"})};function Dhe(n,e){const t=document.createElement("div");t.className="message-box";const i=document.createElement("div");i.textContent=e,t.appendChild(i),n.appendChild(t)}function Vy(n,e){const t=document.createElement(n);for(const[i,s]of Object.entries(e))["innerHTML","innerText","className"].includes(i)&&(t[i]=s),t.setAttribute(i,s);return t}const khe="data:image/svg+xml,%3csvg%20viewBox='0%200%2032%2032'%20xmlns='http://www.w3.org/2000/svg'%20fill-rule='evenodd'%20clip-rule='evenodd'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-miterlimit='1.5'%3e%3cpath%20d='M4.7%2021.2s.4%202.3%201.3%203.6C7%2026%209.8%2028%209.8%2028s3.4-2.6%206.4-8.5c0%200%201%20.1%201.9-.4.9-.6.8-.4%201-1.2%200%200%202.9.5%206.6%200%202.1-.3%204.3-1%206.2-2.5%200%200-1.1-1.7-2.5-5.1-.5-1.3-2-1.8-4.6-4.6l-8.2%208.6-11.9%206.9z'%20fill-opacity='.1'/%3e%3cpath%20d='M12.7%2014.8s-4-1.8-12%202.7c0%200%201%203.7%202.5%205.3%201.4%201.5%202.3%203.6%204.6%204.6%200%200%204.7-3%206.9-9.2l3-2s4.7%202.8%2012.6-1.6c0%200-.6-3.3-3-6-2.6-3-3.8-4.7-3.8-4.7s-4.1%202.3-7.5%209.3l-3.3%201.6z'%20fill='%237fbbdd'/%3e%3cpath%20d='M12.4%2015.5c-.7-.5-2.4-.8-4.4-.4-2%20.4-4%201.3-4.8%201.8-.5.3-1.2%201-1.2%201.4%200%20.7.3%201.8.8%202.4.3.3.7.5%201.4.6.8%200%202.5-1.4%203.5-2%201-.6%201.6-.8%202.7-1.2l-2.9%202.4c-1.3%201.2-2.2%201.5-2.4%202.3%200%20.5%200%201.4.5%201.8.4.5.6.8%201.6.8.6%200%201%200%202.6-1.5.9-.9%202.3-3%202.7-3.7.6-1.1%201-2.2.7-3-.2-1-.4-1.4-.8-1.7zM17.4%2014.2c-.3-.5-.9-1.2-.2-2.5l1.9-3c.5-.8%202-2.3%202.6-2.6.6-.4%201.5-.6%202-.2.6.4%201%201%201.3%201.5.4.6.7%201.3.2%202-.7%201-1.6.9-2.8%201.7-1.2.8-1.9%201.2-2.5%201.9l3.8-1.8c1.3-.6%202.7-1.1%203.4-.7.8.5.8.7%201%201.4.3%201-.2%201.9-.8%202.4-.5.6-1.5.9-2.6%201.2-1.4.4-4.5%201-5.8.5-1.3-.5-1.3-1.4-1.5-1.8z'%20fill='%23fff'/%3e%3cpath%20d='M12.7%2014.8s-4-1.8-12%202.7c0%200%201%203.7%202.5%205.3%201.4%201.5%202.3%203.6%204.6%204.6%200%200%204.7-3%206.9-9.2l3-2s4.7%202.8%2012.6-1.6c0%200-.6-3.3-3-6-2.6-3-3.8-4.7-3.8-4.7s-4.1%202.3-7.5%209.3l-3.3%201.6z'%20fill='none'%20stroke='%23000'%20stroke-width='.5'/%3e%3cpath%20d='M12.4%2014.9s2.1-2%203-2c1.1%200%202.3%202.7%202.3%203.5%200%20.8-2.1%202.4-3.1%202.3%200%200%200-1.2-.7-2.6-.8-1.3-1.5-1.2-1.5-1.2z'%20fill='%237fbbdd'/%3e%3cpath%20d='M13.8%2015.3c.9.8.6%202%201.4%201.8%201-.2%201.4-.8%201.3-1.5%200-.7%200-.8-.4-1.6-.3-.7-1-1.1-2-.5-.7.5-1.4%201.3-1.4%201.3s.2-.3%201.1.5z'%20fill='%23fff'/%3e%3cpath%20d='M12.4%2014.9s2.1-2%203-2c1.1%200%202.3%202.7%202.3%203.5%200%20.8-2.1%202.4-3.1%202.3%200%200%200-1.2-.7-2.6-.8-1.3-1.5-1.2-1.5-1.2z'%20fill='none'%20stroke='%23000'%20stroke-width='.5'/%3e%3c/svg%3e";async function Ehe(n,e,t={}){let i;if(Ti(n)){if(i=document.querySelector(n),!i)throw new Error(`No such element: ${n}`)}else if(n instanceof HTMLElement)i=n;else throw new Error(`Invalid element: ${n}`);let s;try{const o=Os(e)?e:await Ihe(e);if(o.baseUrl??(o.baseUrl=""),o.width??(o.width="container"),o.padding??(o.padding=10),i==document.body){const r=document.createElement("div");r.style.position="fixed",r.style.inset="0",r.style.overflow="hidden",i.appendChild(r),i=r}s=new Lhe(i,o,t),Ahe(s,t),await s.launch()}catch(o){i.innerText=o.toString(),console.error(o)}return{finalize(){for(s.destroy();i.firstChild;)i.firstChild.remove()},addEventListener(o,r){const a=s._eventListeners;let l=a.get(o);l||(l=new Set,a.set(o,l)),l.add(r)},removeEventListener(o,r){var l;(l=s._eventListeners.get(o))==null||l.delete(r)},getScaleResolutionByName(o){return s.getNamedScaleResolutions().get(o)},updateNamedData:s.updateNamedData.bind(s)}}function Ahe(n,e){e.namedDataProvider&&n.registerNamedDataProvider(e.namedDataProvider)}async function Ihe(n){let e;try{const t=await fetch(n);if(!t.ok)throw new Error(`${t.status} ${t.statusText}`);e=await t.json()}catch(t){throw new Error(`Could not load or parse configuration: ${n}, reason: ${t.message}`)}if(!e.baseUrl){const t=n.match(/^[^?#]*\//);e.baseUrl=t&&t[0]||"./"}return e}const The=`{ + `)}}t()?this.loadingIndicatorsElement.style.display="block":setTimeout(()=>{t()||(this.loadingIndicatorsElement.style.display="none")},3e3),em(e,this.loadingIndicatorsElement)}destroy(){var t;const e=X(this,wr,iC);this.container.classList.remove("genome-spy"),e.classList.remove("loading");for(const[i,s]of this._keyboardListeners)for(const o of s)document.removeEventListener(i,o);for(this._destructionCallbacks.forEach(i=>i()),this._glHelper.finalize(),(t=this._inputBindingContainer)==null||t.remove();this.container.firstChild;)this.container.firstChild.remove()}async _prepareViewsAndData(){this.spec.genome&&(this.genomeStore=new Jue(this.spec.baseUrl),await this.genomeStore.initialize(this.spec.genome));const e=this,t={dataFlow:new A$,glHelper:this._glHelper,animator:this.animator,genomeStore:this.genomeStore,fontManager:new ihe(this._glHelper),get devicePixelRatio(){return e._glHelper.dpr},requestLayoutReflow:()=>{},updateTooltip:this.updateTooltip.bind(this),getNamedDataFromProvider:this.getNamedDataFromProvider.bind(this),getCurrentHover:()=>this._currentHover,setDataLoadingStatus:(l,c,d)=>{this._loadingViews.set(l,{status:c,detail:d}),this._updateLoadingIndicators()},addKeyboardListener:(l,c)=>{document.addEventListener(l,c);let d=this._keyboardListeners.get(l);d||(d=[],this._keyboardListeners.set(l,d)),d.push(c)},addBroadcastListener(l,c){const d=e._extraBroadcastListeners;let u=d.get(l);u||(u=new Set,d.set(l,u)),u.add(c)},removeBroadcastListener(l,c){var u;(u=e._extraBroadcastListeners.get(l))==null||u.delete(c)},isViewConfiguredVisible:e.viewVisibilityPredicate,isViewSpec:l=>e.viewFactory.isViewSpec(l),createView:function(l,c,d,u){return e.viewFactory.createView(l,t,c,d,u)},createOrImportView:async function(l,c,d,u,h){return e.viewFactory.createOrImportView(l,t,c,d,u,h)}},i=this.spec;i.datasets&&this.registerNamedDataProvider(l=>i.datasets[l]),this.viewRoot=await t.createOrImportView(i,null,null,H$),X(this,wr,iC).style.flexGrow=this.viewRoot.getSize().height.grow>0?"1":"0",xe(this,wr,j$).call(this),Uue(this.viewRoot),jue(this.viewRoot);const s=this.viewRoot.getDescendants();s.forEach(l=>l.configureViewOpacity()),this._glHelper.invalidateSize(),xe(this,wr,q$).call(this);const o=s.filter(l=>l instanceof Po),r=Bue(this.viewRoot,t.dataFlow);$ue(r),this.broadcast("dataFlowBuilt",r),o.forEach(l=>l.mark.initializeEncoders());const a=Promise.all(o.map(l=>l.mark.initializeGraphics()));for(const l of o)r.addObserver(c=>{l.mark.initializeData();try{l.mark.updateGraphicsData()}catch(d){throw d.view=l,d}t.animator.requestRender()},l);await t.fontManager.waitUntilReady(),r.initialize(),await Promise.all(r.dataSources.map(l=>l.load())),OA(this.viewRoot),this.broadcast("dataLoaded"),await a;for(const l of o)l.mark.finalizeGraphicsInitialization();t.requestLayoutReflow=this.computeLayout.bind(this),this.viewRoot.visit(l=>Qw(l,"size")),this._glHelper.invalidateSize()}async launch(){try{return xe(this,wr,G$).call(this),await this._prepareViewsAndData(),this.registerMouseEvents(),this.computeLayout(),this.animator.requestRender(),!0}catch(e){const t=`${e.view?`At "${e.view.getPathString()}": `:""}${e.toString()}`;return console.error(e.stack),qhe(this.container,t),!1}finally{X(this,wr,iC).classList.remove("loading"),window.setTimeout(()=>{this.loadingMessageElement.style.display="none"},2e3)}}registerMouseEvents(){const e=this._glHelper.canvas;let t=performance.now();const i=s=>{var a,l;const o=performance.now(),r=o-t<200;if(s instanceof MouseEvent){const c=e.getBoundingClientRect(),d=new Fa(s.clientX-c.left-e.clientLeft,s.clientY-c.top-e.clientTop);s.type=="mousemove"&&!r&&(this.tooltip.handleMouseMove(s),this._tooltipUpdateRequested=!1,s.buttons==0&&!SF()&&(this.renderPickingFramebuffer(),this._handlePicking(d.x,d.y)));const u=h=>{this.viewRoot.propagateInteractionEvent(new Yue(d,h)),this._tooltipUpdateRequested||this.tooltip.clear()};if(s.type!="wheel"&&this._wheelInertia.cancel(),(s.type=="mousedown"||s.type=="mouseup")&&!SF())this.renderPickingFramebuffer();else if(s.type=="wheel"){t=o,this._tooltipUpdateRequested=!1;const h=s;if(Math.abs(h.deltaX)>Math.abs(h.deltaY))this._currentHover=null,this._wheelInertia.cancel();else{const f=ahe(h);this._wheelInertia.setMomentum(h.deltaY*(h.deltaMode?80:1),g=>{const p=new WheelEvent("wheel",{...f,deltaMode:0,deltaX:0,deltaY:g});u(p)}),h.preventDefault();return}}if(s.type=="click"){const h=this._currentHover?{type:s.type,viewPath:this._currentHover.mark.unitView.getLayoutAncestors().map(f=>f.name).reverse(),datum:this._currentHover.datum}:{type:s.type,viewPath:null,datum:null};(a=this._eventListeners.get("click"))==null||a.forEach(f=>f(h))}(s.type!="click"||((l=this._mouseDownCoords)==null?void 0:l.subtract(Fa.fromMouseEvent(s)).length)<3)&&u(s)}};["mousedown","mouseup","wheel","click","mousemove","gesturechange","contextmenu"].forEach(s=>e.addEventListener(s,i)),e.addEventListener("mousedown",s=>{this._mouseDownCoords=Fa.fromMouseEvent(s),document.addEventListener("mouseup",()=>this.tooltip.popEnabledState(),{once:!0}),this.tooltip.pushEnabledState(!1)}),e.addEventListener("dragstart",s=>s.stopPropagation())}_handlePicking(e,t){var o;const i=this._glHelper.readPickingPixel(e,t),s=i[0]|i[1]<<8|i[2]<<16|i[3]<<24;if(s==0){this._currentHover=null;return}if(s!==((o=this._currentHover)==null?void 0:o.uniqueId)&&(this._currentHover=null),this._currentHover||this.viewRoot.visit(r=>{if(r instanceof Po){if(r.mark.isPickingParticipant()&&[...r.facetCoords.values()].some(a=>a.containsPoint(e,t))){const a=r.getCollector().findDatumByUniqueId(s);a&&(this._currentHover={mark:r.mark,datum:a,uniqueId:s})}if(this._currentHover)return M_}}),this._currentHover){const r=this._currentHover.mark;this.updateTooltip(this._currentHover.datum,async a=>{if(!r.isPickingParticipant())return;const l=r.properties.tooltip;if(l!==null){const c=(l==null?void 0:l.handler)??"default",d=this.tooltipHandlers[c];if(!d)throw new Error("No such tooltip handler: "+c);return d(a,r,l==null?void 0:l.params)}})}}updateTooltip(e,t){if(!this._tooltipUpdateRequested||!e)this.tooltip.updateWithDatum(e,t),this._tooltipUpdateRequested=!0;else throw new Error("Tooltip has already been updated! Duplicate event handler?")}computeLayout(){const e=this.viewRoot;if(!e)return;this.broadcast("layout");const t=this._glHelper.getLogicalCanvasSize();if(isNaN(t.width)||isNaN(t.height)){console.log(`NaN in canvas size: ${t.width}x${t.height}. Skipping computeLayout().`);return}this._renderingContext=new bF({picking:!1},this._glHelper),this._pickingContext=new bF({picking:!0},this._glHelper),e.render(new Kue(this._renderingContext,this._pickingContext),sc.create(0,0,t.width,t.height)),this._updateLoadingIndicators(),this.broadcast("layoutComputed")}renderAll(){var e;(e=this._renderingContext)==null||e.render(),this._dirtyPickingBuffer=!0}renderPickingFramebuffer(){this._dirtyPickingBuffer&&(this._pickingContext.render(),this._dirtyPickingBuffer=!1)}getSearchableViews(){const e=[];return this.viewRoot.visit(t=>{t instanceof Po&&t.getDataAccessor("search")&&e.push(t)}),e}getNamedScaleResolutions(){const e=new Map;return this.viewRoot.visit(t=>{for(const i of Object.values(t.resolutions.scale))i.name&&e.set(i.name,i)}),e}}wr=new WeakSet,iC=function(){return this.container.querySelector(".canvas-wrapper")},j$=function(){const e=[];this.viewRoot.visit(i=>{const s=i.paramMediator;e.push(...Uhe(s))});const t=this.options.inputBindingContainer;if(!(!t||t=="none"||!e.length)){if(this._inputBindingContainer=My("div",{className:"gs-input-bindings"}),t=="default")this.container.appendChild(this._inputBindingContainer);else if(t instanceof HTMLElement)t.appendChild(this._inputBindingContainer);else throw new Error("Invalid inputBindingContainer");e.length&&em(Lt`
${e}
`,this._inputBindingContainer)}},q$=function(){const e=this.viewRoot.paramMediator.allocateSetter("devicePixelRatio",window.devicePixelRatio),t=()=>{this._glHelper.invalidateSize(),e(window.devicePixelRatio),this.computeLayout(),this.renderAll()};if(this.viewRoot.getSize().isGrowing()){const o=new ResizeObserver(t);o.observe(this.container),this._destructionCallbacks.push(()=>o.disconnect())}let i=null;const s=()=>{i!=null&&(i(),t());const o=matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);o.addEventListener("change",s),i=()=>{o.removeEventListener("change",s)}};s(),i&&this._destructionCallbacks.push(i)},G$=function(){this.container.classList.add("genome-spy");const e=document.createElement("style");e.innerHTML=dte,this.container.appendChild(e);const t=My("div",{class:"canvas-wrapper"});this.container.appendChild(t),t.classList.add("loading"),this._glHelper=new Zle(t,()=>this.viewRoot?Gue(this.viewRoot):{width:void 0,height:void 0},this.spec.background,{powerPreference:this.options.powerPreference??"default"}),this.loadingMessageElement=My("div",{class:"loading-message",innerHTML:'
Loading...
'}),t.appendChild(this.loadingMessageElement),this.loadingIndicatorsElement=My("div",{class:"loading-indicators"}),t.appendChild(this.loadingIndicatorsElement),this.tooltip=new hte(this.container),this.loadingMessageElement.querySelector(".message").addEventListener("transitionend",()=>{this.loadingMessageElement.style.display="none"})};function qhe(n,e){const t=document.createElement("div");t.className="message-box";const i=document.createElement("div");i.textContent=e,t.appendChild(i),n.appendChild(t)}function My(n,e){const t=document.createElement(n);for(const[i,s]of Object.entries(e))["innerHTML","innerText","className"].includes(i)&&(t[i]=s),t.setAttribute(i,s);return t}const Ghe="data:image/svg+xml,%3csvg%20viewBox='0%200%2032%2032'%20xmlns='http://www.w3.org/2000/svg'%20fill-rule='evenodd'%20clip-rule='evenodd'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-miterlimit='1.5'%3e%3cpath%20d='M4.7%2021.2s.4%202.3%201.3%203.6C7%2026%209.8%2028%209.8%2028s3.4-2.6%206.4-8.5c0%200%201%20.1%201.9-.4.9-.6.8-.4%201-1.2%200%200%202.9.5%206.6%200%202.1-.3%204.3-1%206.2-2.5%200%200-1.1-1.7-2.5-5.1-.5-1.3-2-1.8-4.6-4.6l-8.2%208.6-11.9%206.9z'%20fill-opacity='.1'/%3e%3cpath%20d='M12.7%2014.8s-4-1.8-12%202.7c0%200%201%203.7%202.5%205.3%201.4%201.5%202.3%203.6%204.6%204.6%200%200%204.7-3%206.9-9.2l3-2s4.7%202.8%2012.6-1.6c0%200-.6-3.3-3-6-2.6-3-3.8-4.7-3.8-4.7s-4.1%202.3-7.5%209.3l-3.3%201.6z'%20fill='%237fbbdd'/%3e%3cpath%20d='M12.4%2015.5c-.7-.5-2.4-.8-4.4-.4-2%20.4-4%201.3-4.8%201.8-.5.3-1.2%201-1.2%201.4%200%20.7.3%201.8.8%202.4.3.3.7.5%201.4.6.8%200%202.5-1.4%203.5-2%201-.6%201.6-.8%202.7-1.2l-2.9%202.4c-1.3%201.2-2.2%201.5-2.4%202.3%200%20.5%200%201.4.5%201.8.4.5.6.8%201.6.8.6%200%201%200%202.6-1.5.9-.9%202.3-3%202.7-3.7.6-1.1%201-2.2.7-3-.2-1-.4-1.4-.8-1.7zM17.4%2014.2c-.3-.5-.9-1.2-.2-2.5l1.9-3c.5-.8%202-2.3%202.6-2.6.6-.4%201.5-.6%202-.2.6.4%201%201%201.3%201.5.4.6.7%201.3.2%202-.7%201-1.6.9-2.8%201.7-1.2.8-1.9%201.2-2.5%201.9l3.8-1.8c1.3-.6%202.7-1.1%203.4-.7.8.5.8.7%201%201.4.3%201-.2%201.9-.8%202.4-.5.6-1.5.9-2.6%201.2-1.4.4-4.5%201-5.8.5-1.3-.5-1.3-1.4-1.5-1.8z'%20fill='%23fff'/%3e%3cpath%20d='M12.7%2014.8s-4-1.8-12%202.7c0%200%201%203.7%202.5%205.3%201.4%201.5%202.3%203.6%204.6%204.6%200%200%204.7-3%206.9-9.2l3-2s4.7%202.8%2012.6-1.6c0%200-.6-3.3-3-6-2.6-3-3.8-4.7-3.8-4.7s-4.1%202.3-7.5%209.3l-3.3%201.6z'%20fill='none'%20stroke='%23000'%20stroke-width='.5'/%3e%3cpath%20d='M12.4%2014.9s2.1-2%203-2c1.1%200%202.3%202.7%202.3%203.5%200%20.8-2.1%202.4-3.1%202.3%200%200%200-1.2-.7-2.6-.8-1.3-1.5-1.2-1.5-1.2z'%20fill='%237fbbdd'/%3e%3cpath%20d='M13.8%2015.3c.9.8.6%202%201.4%201.8%201-.2%201.4-.8%201.3-1.5%200-.7%200-.8-.4-1.6-.3-.7-1-1.1-2-.5-.7.5-1.4%201.3-1.4%201.3s.2-.3%201.1.5z'%20fill='%23fff'/%3e%3cpath%20d='M12.4%2014.9s2.1-2%203-2c1.1%200%202.3%202.7%202.3%203.5%200%20.8-2.1%202.4-3.1%202.3%200%200%200-1.2-.7-2.6-.8-1.3-1.5-1.2-1.5-1.2z'%20fill='none'%20stroke='%23000'%20stroke-width='.5'/%3e%3c/svg%3e";async function Khe(n,e,t={}){let i;if(Ti(n)){if(i=document.querySelector(n),!i)throw new Error(`No such element: ${n}`)}else if(n instanceof HTMLElement)i=n;else throw new Error(`Invalid element: ${n}`);let s;try{const o=Ms(e)?e:await Zhe(e);if(o.baseUrl??(o.baseUrl=""),o.width??(o.width="container"),o.padding??(o.padding=10),i==document.body){const r=document.createElement("div");r.style.position="fixed",r.style.inset="0",r.style.overflow="hidden",i.appendChild(r),i=r}s=new jhe(i,o,t),Yhe(s,t),await s.launch()}catch(o){i.innerText=o.toString(),console.error(o)}return{finalize(){for(s.destroy();i.firstChild;)i.firstChild.remove()},addEventListener(o,r){const a=s._eventListeners;let l=a.get(o);l||(l=new Set,a.set(o,l)),l.add(r)},removeEventListener(o,r){var l;(l=s._eventListeners.get(o))==null||l.delete(r)},getScaleResolutionByName(o){return s.getNamedScaleResolutions().get(o)},updateNamedData:s.updateNamedData.bind(s)}}function Yhe(n,e){e.namedDataProvider&&n.registerNamedDataProvider(e.namedDataProvider)}async function Zhe(n){let e;try{const t=await fetch(n);if(!t.ok)throw new Error(`${t.status} ${t.statusText}`);e=await t.json()}catch(t){throw new Error(`Could not load or parse configuration: ${n}, reason: ${t.message}`)}if(!e.baseUrl){const t=n.match(/^[^?#]*\//);e.baseUrl=t&&t[0]||"./"}return e}const Xhe=`{ "data": { "sequence": { "start": 0, "stop": 60, "as": "x" } }, @@ -2871,38 +2672,38 @@ chrM 16299`,fF={dm6:Ace,hg18:Ice,hg19:Tce,hg38:Nce,mm9:Rce,mm10:Mce};function Pc } } } -`;function Ao(n,e=0){return n[n.length-(1+e)]}function Nhe(n){if(n.length===0)throw new Error("Invalid tail call");return[n.slice(0,n.length-1),n[n.length-1]]}function Zi(n,e,t=(i,s)=>i===s){if(n===e)return!0;if(!n||!e||n.length!==e.length)return!1;for(let i=0,s=n.length;it(n[i],e))}function Mhe(n,e){let t=0,i=n-1;for(;t<=i;){const s=(t+i)/2|0,o=e(s);if(o<0)t=s+1;else if(o>0)i=s-1;else return s}return-(t+1)}function*Z$(n,e){let t,i;for(const s of n)i!==void 0&&e(i,s)?t.push(s):(t&&(yield t),t=[s]),i=s;t&&(yield t)}function X$(n,e){for(let t=0;t<=n.length;t++)e(t===0?void 0:n[t-1],t===n.length?void 0:n[t])}function Phe(n,e){for(let t=0;t!!e)}function TF(n){let e=0;for(let t=0;t0}function mf(n,e=t=>t){const t=new Set;return n.filter(i=>{const s=e(i);return t.has(s)?!1:(t.add(s),!0)})}function Q$(n,e){return n.length>0?n[0]:e}function is(n,e){let t=typeof e=="number"?n:0;typeof e=="number"?t=n:(t=0,e=n);const i=[];if(t<=e)for(let s=t;se;s--)i.push(s);return i}function zL(n,e,t){const i=n.slice(0,e),s=n.slice(e);return i.concat(t,s)}function Yk(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.unshift(e))}function zy(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.push(e))}function tI(n,e){for(const t of e)n.push(t)}function J$(n){return Array.isArray(n)?n:[n]}function Fhe(n,e,t){const i=eU(n,e),s=n.length,o=t.length;n.length=s+o;for(let r=s-1;r>=i;r--)n[r+o]=n[r];for(let r=0;r0}n.isGreaterThan=i;function s(o){return o===0}n.isNeitherLessOrGreaterThan=s,n.greaterThan=1,n.lessThan=-1,n.neitherLessOrGreaterThan=0})(Mb||(Mb={}));function mr(n,e){return(t,i)=>e(n(t),n(i))}function Bhe(...n){return(e,t)=>{for(const i of n){const s=i(e,t);if(!Mb.isNeitherLessOrGreaterThan(s))return s}return Mb.neitherLessOrGreaterThan}}const Ld=(n,e)=>n-e,Whe=(n,e)=>Ld(n?1:0,e?1:0);function tU(n){return(e,t)=>-n(e,t)}class _c{constructor(e){this.items=e,this.firstIdx=0,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t=0&&e(this.items[t]);)t--;const i=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,i}peek(){if(this.length!==0)return this.items[this.firstIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){const t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}}class Xa{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new Xa(t=>this.iterate(i=>e(i)?t(i):!0))}map(e){return new Xa(t=>this.iterate(i=>t(e(i))))}findLast(e){let t;return this.iterate(i=>(e(i)&&(t=i),!0)),t}findLastMaxBy(e){let t,i=!0;return this.iterate(s=>((i||Mb.isGreaterThan(e(s,t)))&&(i=!1,t=s),!0)),t}}Xa.empty=new Xa(n=>{});function Ms(n){return typeof n=="string"}function Ds(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)&&!(n instanceof RegExp)&&!(n instanceof Date)}function Vhe(n){const e=Object.getPrototypeOf(Uint8Array);return typeof n=="object"&&n instanceof e}function Qd(n){return typeof n=="number"&&!isNaN(n)}function RF(n){return!!n&&typeof n[Symbol.iterator]=="function"}function iU(n){return n===!0||n===!1}function Ks(n){return typeof n>"u"}function bS(n){return!bo(n)}function bo(n){return Ks(n)||n===null}function Ls(n,e){if(!n)throw new Error("Unexpected type")}function iI(n){if(bo(n))throw new Error("Assertion Failed: argument is undefined or null");return n}function vS(n){return typeof n=="function"}function zhe(n,e){const t=Math.min(n.length,e.length);for(let i=0;i{e[t]=i&&typeof i=="object"?Nl(i):i}),e}function $he(n){if(!n||typeof n!="object")return n;const e=[n];for(;e.length>0;){const t=e.shift();Object.freeze(t);for(const i in t)if(nU.call(t,i)){const s=t[i];typeof s=="object"&&!Object.isFrozen(s)&&!Vhe(s)&&e.push(s)}}return n}const nU=Object.prototype.hasOwnProperty;function sU(n,e){return nI(n,e,new Set)}function nI(n,e,t){if(bo(n))return n;const i=e(n);if(typeof i<"u")return i;if(Array.isArray(n)){const s=[];for(const o of n)s.push(nI(o,e,t));return s}if(Ds(n)){if(t.has(n))throw new Error("Cannot clone recursive data-structure");t.add(n);const s={};for(const o in n)nU.call(n,o)&&(s[o]=nI(n[o],e,t));return t.delete(n),s}return n}function HL(n,e,t=!0){return Ds(n)?(Ds(e)&&Object.keys(e).forEach(i=>{i in n?t&&(Ds(n[i])&&Ds(e[i])?HL(n[i],e[i],t):n[i]=e[i]):n[i]=e[i]}),n):e}function Lo(n,e){if(n===e)return!0;if(n==null||e===null||e===void 0||typeof n!=typeof e||typeof n!="object"||Array.isArray(n)!==Array.isArray(e))return!1;let t,i;if(Array.isArray(n)){if(n.length!==e.length)return!1;for(t=0;tfunction(){const o=Array.prototype.slice.call(arguments,0);return e(s,o)},i={};for(const s of n)i[s]=t(s);return i}let qhe=typeof document<"u"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function Ghe(n,e){let t;return e.length===0?t=n:t=n.replace(/\{(\d+)\}/g,(i,s)=>{const o=s[0],r=e[o];let a=i;return typeof r=="string"?a=r:(typeof r=="number"||typeof r=="boolean"||r===void 0||r===null)&&(a=String(r)),a}),qhe&&(t="["+t.replace(/[aouei]/g,"$&$&")+"]"),t}function m(n,e,...t){return Ghe(e,t)}var Zk;const Pg="en";let yS=!1,wS=!1,cC=!1,oU=!1,k4=!1,E4=!1,rU=!1,Hy,Xk=Pg,MF=Pg,Khe,Wr;const _r=typeof self=="object"?self:typeof globalThis=="object"?globalThis:{};let ns;typeof _r.vscode<"u"&&typeof _r.vscode.process<"u"?ns=_r.vscode.process:typeof process<"u"&&(ns=process);const Yhe=typeof((Zk=ns==null?void 0:ns.versions)===null||Zk===void 0?void 0:Zk.electron)=="string",Zhe=Yhe&&(ns==null?void 0:ns.type)==="renderer";if(typeof navigator=="object"&&!Zhe)Wr=navigator.userAgent,yS=Wr.indexOf("Windows")>=0,wS=Wr.indexOf("Macintosh")>=0,E4=(Wr.indexOf("Macintosh")>=0||Wr.indexOf("iPad")>=0||Wr.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,cC=Wr.indexOf("Linux")>=0,rU=(Wr==null?void 0:Wr.indexOf("Mobi"))>=0,k4=!0,m({key:"ensureLoaderPluginIsLoaded",comment:["{Locked}"]},"_"),Hy=Pg,Xk=Hy,MF=navigator.language;else if(typeof ns=="object"){yS=ns.platform==="win32",wS=ns.platform==="darwin",cC=ns.platform==="linux",cC&&ns.env.SNAP&&ns.env.SNAP_REVISION,ns.env.CI||ns.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Hy=Pg,Xk=Pg;const n=ns.env.VSCODE_NLS_CONFIG;if(n)try{const e=JSON.parse(n),t=e.availableLanguages["*"];Hy=e.locale,MF=e.osLocale,Xk=t||Pg,Khe=e._translationsConfigFile}catch{}oU=!0}else console.error("Unable to resolve platform.");const Fs=yS,mt=wS,Jn=cC,dp=oU,Qm=k4,Xhe=k4&&typeof _r.importScripts=="function",Jd=E4,Qhe=rU,tl=Wr,Jhe=typeof _r.postMessage=="function"&&!_r.importScripts,aU=(()=>{if(Jhe){const n=[];_r.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,s=n.length;i{const i=++e;n.push({id:i,callback:t}),_r.postMessage({vscodeScheduleAsyncWork:i},"*")}}return n=>setTimeout(n)})(),wo=wS||E4?2:yS?1:3;let PF=!0,OF=!1;function efe(){if(!OF){OF=!0;const n=new Uint8Array(2);n[0]=1,n[1]=2,PF=new Uint16Array(n.buffer)[0]===513}return PF}const lU=!!(tl&&tl.indexOf("Chrome")>=0),tfe=!!(tl&&tl.indexOf("Firefox")>=0),ife=!!(!lU&&tl&&tl.indexOf("Safari")>=0),nfe=!!(tl&&tl.indexOf("Edg/")>=0);tl&&tl.indexOf("Android")>=0;const In={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}};var ht;(function(n){function e(b){return b&&typeof b=="object"&&typeof b[Symbol.iterator]=="function"}n.is=e;const t=Object.freeze([]);function i(){return t}n.empty=i;function*s(b){yield b}n.single=s;function o(b){return e(b)?b:s(b)}n.wrap=o;function r(b){return b||t}n.from=r;function*a(b){for(let y=b.length-1;y>=0;y--)yield b[y]}n.reverse=a;function l(b){return!b||b[Symbol.iterator]().next().done===!0}n.isEmpty=l;function c(b){return b[Symbol.iterator]().next().value}n.first=c;function d(b,y){for(const w of b)if(y(w))return!0;return!1}n.some=d;function u(b,y){for(const w of b)if(y(w))return w}n.find=u;function*h(b,y){for(const w of b)y(w)&&(yield w)}n.filter=h;function*f(b,y){let w=0;for(const C of b)yield y(C,w++)}n.map=f;function*g(...b){for(const y of b)for(const w of y)yield w}n.concat=g;function p(b,y,w){let C=w;for(const L of b)C=y(C,L);return C}n.reduce=p;function*_(b,y,w=b.length){for(y<0&&(y+=b.length),w<0?w+=b.length:w>b.length&&(w=b.length);y{s||(s=!0,this._remove(i))}}shift(){if(this._first!==Ri.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Ri.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Ri.Undefined&&e.next!==Ri.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Ri.Undefined&&e.next===Ri.Undefined?(this._first=Ri.Undefined,this._last=Ri.Undefined):e.next===Ri.Undefined?(this._last=this._last.prev,this._last.next=Ri.Undefined):e.prev===Ri.Undefined&&(this._first=this._first.next,this._first.prev=Ri.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Ri.Undefined;)yield e.element,e=e.next}}const cU="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function sfe(n=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of cU)n.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const A4=sfe();function dU(n){let e=A4;if(n&&n instanceof RegExp)if(n.global)e=n;else{let t="g";n.ignoreCase&&(t+="i"),n.multiline&&(t+="m"),n.unicode&&(t+="u"),e=new RegExp(n.source,t)}return e.lastIndex=0,e}const uU=new ks;uU.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function Pb(n,e,t,i,s){if(s||(s=ht.first(uU)),t.length>s.maxLen){let c=n-s.maxLen/2;return c<0?c=0:i+=c,t=t.substring(c,n+s.maxLen/2),Pb(n,e,t,i,s)}const o=Date.now(),r=n-1-i;let a=-1,l=null;for(let c=1;!(Date.now()-o>=s.timeBudget);c++){const d=r-s.windowSize*c;e.lastIndex=Math.max(0,d);const u=ofe(e,t,r,a);if(!u&&l||(l=u,d<=0))break;a=d}if(l){const c={word:l[0],startColumn:i+1+l.index,endColumn:i+1+l.index+l[0].length};return e.lastIndex=0,c}return null}function ofe(n,e,t,i){let s;for(;s=n.exec(e);){const o=s.index||0;if(o<=t&&n.lastIndex>=t)return s;if(i>0&&o>i)return null}return null}const Wc=8;class hU{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class fU{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class Qt{constructor(e,t,i,s){this.id=e,this.name=t,this.defaultValue=i,this.schema=s}applyUpdate(e,t){return $L(e,t)}compute(e,t,i){return i}}class I_{constructor(e,t){this.newValue=e,this.didChange=t}}function $L(n,e){if(typeof n!="object"||typeof e!="object"||!n||!e)return new I_(e,n!==e);if(Array.isArray(n)||Array.isArray(e)){const i=Array.isArray(n)&&Array.isArray(e)&&Zi(n,e);return new I_(e,!i)}let t=!1;for(const i in e)if(e.hasOwnProperty(i)){const s=$L(n[i],e[i]);s.didChange&&(n[i]=s.newValue,t=!0)}return new I_(n,t)}class H1{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return $L(e,t)}validate(e){return this.defaultValue}}class Jm{constructor(e,t,i,s){this.id=e,this.name=t,this.defaultValue=i,this.schema=s}applyUpdate(e,t){return $L(e,t)}validate(e){return typeof e>"u"?this.defaultValue:e}compute(e,t,i){return i}}function ve(n,e){return typeof n>"u"?e:n==="false"?!1:!!n}class st extends Jm{constructor(e,t,i,s=void 0){typeof s<"u"&&(s.type="boolean",s.default=i),super(e,t,i,s)}validate(e){return ve(e,this.defaultValue)}}function eh(n,e,t,i){if(typeof n>"u")return e;let s=parseInt(n,10);return isNaN(s)?e:(s=Math.max(t,s),s=Math.min(i,s),s|0)}class At extends Jm{static clampedInt(e,t,i,s){return eh(e,t,i,s)}constructor(e,t,i,s,o,r=void 0){typeof r<"u"&&(r.type="integer",r.default=i,r.minimum=s,r.maximum=o),super(e,t,i,r),this.minimum=s,this.maximum=o}validate(e){return At.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function rfe(n,e,t,i){if(typeof n>"u")return e;const s=cr.float(n,e);return cr.clamp(s,t,i)}class cr extends Jm{static clamp(e,t,i){return ei?i:e}static float(e,t){if(typeof e=="number")return e;if(typeof e>"u")return t;const i=parseFloat(e);return isNaN(i)?t:i}constructor(e,t,i,s,o){typeof o<"u"&&(o.type="number",o.default=i),super(e,t,i,o),this.validationFn=s}validate(e){return this.validationFn(cr.float(e,this.defaultValue))}}class Us extends Jm{static string(e,t){return typeof e!="string"?t:e}constructor(e,t,i,s=void 0){typeof s<"u"&&(s.type="string",s.default=i),super(e,t,i,s)}validate(e){return Us.string(e,this.defaultValue)}}function Li(n,e,t,i){return typeof n!="string"?e:i&&n in i?i[n]:t.indexOf(n)===-1?e:n}class oi extends Jm{constructor(e,t,i,s,o=void 0){typeof o<"u"&&(o.type="string",o.enum=s,o.default=i),super(e,t,i,o),this._allowedValues=s}validate(e){return Li(e,this.defaultValue,this._allowedValues)}}class $y extends Qt{constructor(e,t,i,s,o,r,a=void 0){typeof a<"u"&&(a.type="string",a.enum=o,a.default=s),super(e,t,i,a),this._allowedValues=o,this._convert=r}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}}function afe(n){switch(n){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class lfe extends Qt{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[m("accessibilitySupport.auto","Use platform APIs to detect when a Screen Reader is attached"),m("accessibilitySupport.on","Optimize for usage with a Screen Reader"),m("accessibilitySupport.off","Assume a screen reader is not attached")],default:"auto",tags:["accessibility"],description:m("accessibilitySupport","Controls if the UI should run in a mode where it is optimized for screen readers.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,i){return i===0?e.accessibilitySupport:i}}class cfe extends Qt{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(23,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:m("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:m("comments.ignoreEmptyLines","Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertSpace:ve(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:ve(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function dfe(n){switch(n){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var pn;(function(n){n[n.Line=1]="Line",n[n.Block=2]="Block",n[n.Underline=3]="Underline",n[n.LineThin=4]="LineThin",n[n.BlockOutline=5]="BlockOutline",n[n.UnderlineThin=6]="UnderlineThin"})(pn||(pn={}));function ufe(n){switch(n){case"line":return pn.Line;case"block":return pn.Block;case"underline":return pn.Underline;case"line-thin":return pn.LineThin;case"block-outline":return pn.BlockOutline;case"underline-thin":return pn.UnderlineThin}}class hfe extends H1{constructor(){super(140)}compute(e,t,i){const s=["monaco-editor"];return t.get(39)&&s.push(t.get(39)),e.extraEditorClassName&&s.push(e.extraEditorClassName),t.get(73)==="default"?s.push("mouse-default"):t.get(73)==="copy"&&s.push("mouse-copy"),t.get(110)&&s.push("showUnused"),t.get(138)&&s.push("showDeprecated"),s.join(" ")}}class ffe extends st{constructor(){super(37,"emptySelectionClipboard",!0,{description:m("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}class gfe extends Qt{constructor(){const e={cursorMoveOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0};super(41,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:m("find.cursorMoveOnType","Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[m("editor.find.seedSearchStringFromSelection.never","Never seed search string from the editor selection."),m("editor.find.seedSearchStringFromSelection.always","Always seed search string from the editor selection, including word at cursor position."),m("editor.find.seedSearchStringFromSelection.selection","Only seed search string from the editor selection.")],description:m("find.seedSearchStringFromSelection","Controls whether the search string in the Find Widget is seeded from the editor selection.")},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[m("editor.find.autoFindInSelection.never","Never turn on Find in Selection automatically (default)."),m("editor.find.autoFindInSelection.always","Always turn on Find in Selection automatically."),m("editor.find.autoFindInSelection.multiline","Turn on Find in Selection automatically when multiple lines of content are selected.")],description:m("find.autoFindInSelection","Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:m("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:mt},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:m("find.addExtraSpaceOnTop","Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")},"editor.find.loop":{type:"boolean",default:e.loop,description:m("find.loop","Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{cursorMoveOnType:ve(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection=="boolean"?e.seedSearchStringFromSelection?"always":"never":Li(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":Li(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:ve(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:ve(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:ve(t.loop,this.defaultValue.loop)}}}class Mo extends Qt{constructor(){super(51,"fontLigatures",Mo.OFF,{anyOf:[{type:"boolean",description:m("fontLigatures","Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.")},{type:"string",description:m("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:m("fontLigaturesGeneral","Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?Mo.OFF:e==="true"?Mo.ON:e:e?Mo.ON:Mo.OFF}}Mo.OFF='"liga" off, "calt" off';Mo.ON='"liga" on, "calt" on';class Qr extends Qt{constructor(){super(54,"fontVariations",Qr.OFF,{anyOf:[{type:"boolean",description:m("fontVariations","Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.")},{type:"string",description:m("fontVariationSettings","Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.")}],description:m("fontVariationsGeneral","Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?Qr.OFF:e==="true"?Qr.TRANSLATE:e:e?Qr.TRANSLATE:Qr.OFF}compute(e,t,i){return e.fontInfo.fontVariationSettings}}Qr.OFF="normal";Qr.TRANSLATE="translate";class pfe extends H1{constructor(){super(50)}compute(e,t,i){return e.fontInfo}}class mfe extends Jm{constructor(){super(52,"fontSize",Ho.fontSize,{type:"number",minimum:6,maximum:100,default:Ho.fontSize,description:m("fontSize","Controls the font size in pixels.")})}validate(e){const t=cr.float(e,this.defaultValue);return t===0?Ho.fontSize:cr.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}class Aa extends Qt{constructor(){super(53,"fontWeight",Ho.fontWeight,{anyOf:[{type:"number",minimum:Aa.MINIMUM_VALUE,maximum:Aa.MAXIMUM_VALUE,errorMessage:m("fontWeightErrorMessage",'Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.')},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:Aa.SUGGESTION_VALUES}],default:Ho.fontWeight,description:m("fontWeight",'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return e==="normal"||e==="bold"?e:String(At.clampedInt(e,Ho.fontWeight,Aa.MINIMUM_VALUE,Aa.MAXIMUM_VALUE))}}Aa.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"];Aa.MINIMUM_VALUE=1;Aa.MAXIMUM_VALUE=1e3;class _fe extends Qt{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[m("editor.gotoLocation.multiple.peek","Show Peek view of the results (default)"),m("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a Peek view"),m("editor.gotoLocation.multiple.goto","Go to the primary result and enable Peek-less navigation to others")]},i=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(58,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:m("editor.gotoLocation.multiple.deprecated","This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":Object.assign({description:m("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleTypeDefinitions":Object.assign({description:m("editor.editor.gotoLocation.multipleTypeDefinitions","Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleDeclarations":Object.assign({description:m("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleImplementations":Object.assign({description:m("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleReferences":Object.assign({description:m("editor.editor.gotoLocation.multipleReferences","Controls the behavior the 'Go to References'-command when multiple target locations exist.")},t),"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:i,description:m("alternativeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:i,description:m("alternativeTypeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:i,description:m("alternativeDeclarationCommand","Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:i,description:m("alternativeImplementationCommand","Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:i,description:m("alternativeReferenceCommand","Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){var t,i,s,o,r;if(!e||typeof e!="object")return this.defaultValue;const a=e;return{multiple:Li(a.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:(t=a.multipleDefinitions)!==null&&t!==void 0?t:Li(a.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:(i=a.multipleTypeDefinitions)!==null&&i!==void 0?i:Li(a.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:(s=a.multipleDeclarations)!==null&&s!==void 0?s:Li(a.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:(o=a.multipleImplementations)!==null&&o!==void 0?o:Li(a.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:(r=a.multipleReferences)!==null&&r!==void 0?r:Li(a.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:Us.string(a.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:Us.string(a.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:Us.string(a.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:Us.string(a.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:Us.string(a.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}class bfe extends Qt{constructor(){const e={enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0};super(60,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:m("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:m("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:m("hover.sticky","Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.hidingDelay":{type:"integer",minimum:0,default:e.hidingDelay,description:m("hover.hidingDelay","Controls the delay in milliseconds after thich the hover is hidden. Requires `editor.hover.sticky` to be enabled.")},"editor.hover.above":{type:"boolean",default:e.above,description:m("hover.above","Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:ve(t.enabled,this.defaultValue.enabled),delay:At.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:ve(t.sticky,this.defaultValue.sticky),hidingDelay:At.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:ve(t.above,this.defaultValue.above)}}}class up extends H1{constructor(){super(143)}compute(e,t,i){return up.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio,glyphMarginDecorationLaneCount:e.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,i=Math.floor(e.paddingTop/e.lineHeight);let s=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(s=Math.max(s,t-1));const o=(i+e.viewLineCount+s)/(e.pixelRatio*e.height),r=Math.floor(e.viewLineCount/o);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:i,extraLinesBeyondLastLine:s,desiredRatio:o,minimapLineCount:r}}static _computeMinimapLayout(e,t){const i=e.outerWidth,s=e.outerHeight,o=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(o*s),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:s};const r=t.stableMinimapLayoutInput,a=r&&e.outerHeight===r.outerHeight&&e.lineHeight===r.lineHeight&&e.typicalHalfwidthCharacterWidth===r.typicalHalfwidthCharacterWidth&&e.pixelRatio===r.pixelRatio&&e.scrollBeyondLastLine===r.scrollBeyondLastLine&&e.paddingTop===r.paddingTop&&e.paddingBottom===r.paddingBottom&&e.minimap.enabled===r.minimap.enabled&&e.minimap.side===r.minimap.side&&e.minimap.size===r.minimap.size&&e.minimap.showSlider===r.minimap.showSlider&&e.minimap.renderCharacters===r.minimap.renderCharacters&&e.minimap.maxColumn===r.minimap.maxColumn&&e.minimap.scale===r.minimap.scale&&e.verticalScrollbarWidth===r.verticalScrollbarWidth&&e.isViewportWrapping===r.isViewportWrapping,l=e.lineHeight,c=e.typicalHalfwidthCharacterWidth,d=e.scrollBeyondLastLine,u=e.minimap.renderCharacters;let h=o>=2?Math.round(e.minimap.scale*2):e.minimap.scale;const f=e.minimap.maxColumn,g=e.minimap.size,p=e.minimap.side,_=e.verticalScrollbarWidth,v=e.viewLineCount,b=e.remainingWidth,y=e.isViewportWrapping,w=u?2:3;let C=Math.floor(o*s);const L=C/o;let x=!1,D=!1,k=w*h,P=h/o,O=1;if(g==="fill"||g==="fit"){const{typicalViewportLineCount:fe,extraLinesBeforeFirstLine:oe,extraLinesBeyondLastLine:Se,desiredRatio:Ie,minimapLineCount:me}=up.computeContainedMinimapLineCount({viewLineCount:v,scrollBeyondLastLine:d,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:s,lineHeight:l,pixelRatio:o});if(v/me>1)x=!0,D=!0,h=1,k=1,P=h/o;else{let Xt=!1,Dt=h+1;if(g==="fit"){const Nt=Math.ceil((oe+v+Se)*k);y&&a&&b<=t.stableFitRemainingWidth?(Xt=!0,Dt=t.stableFitMaxMinimapScale):Xt=Nt>C}if(g==="fill"||Xt){x=!0;const Nt=h;k=Math.min(l*o,Math.max(1,Math.floor(1/Ie))),y&&a&&b<=t.stableFitRemainingWidth&&(Dt=t.stableFitMaxMinimapScale),h=Math.min(Dt,Math.max(1,Math.floor(k/w))),h>Nt&&(O=Math.min(2,h/Nt)),P=h/o/O,C=Math.ceil(Math.max(fe,oe+v+Se)*k),y?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=b,t.stableFitMaxMinimapScale=h):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const M=Math.floor(f*P),R=Math.min(M,Math.max(0,Math.floor((b-_-2)*P/(c+P)))+Wc);let z=Math.floor(o*R);const G=z/o;z=Math.floor(z*O);const te=u?1:2,ae=p==="left"?0:i-R-_;return{renderMinimap:te,minimapLeft:ae,minimapWidth:R,minimapHeightIsEditorHeight:x,minimapIsSampling:D,minimapScale:h,minimapLineHeight:k,minimapCanvasInnerWidth:z,minimapCanvasInnerHeight:C,minimapCanvasOuterWidth:G,minimapCanvasOuterHeight:L}}static computeLayout(e,t){const i=t.outerWidth|0,s=t.outerHeight|0,o=t.lineHeight|0,r=t.lineNumbersDigitCount|0,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,c=t.pixelRatio,d=t.viewLineCount,u=e.get(135),h=u==="inherit"?e.get(134):u,f=h==="inherit"?e.get(130):h,g=e.get(133),p=t.isDominatedByLongLines,_=e.get(57),v=e.get(67).renderType!==0,b=e.get(68),y=e.get(104),w=e.get(83),C=e.get(72),L=e.get(102),x=L.verticalScrollbarSize,D=L.verticalHasArrows,k=L.arrowSize,P=L.horizontalScrollbarSize,O=e.get(43),M=e.get(109)!=="never";let R=e.get(65);O&&M&&(R+=16);let z=0;if(v){const si=Math.max(r,b);z=Math.round(si*l)}let G=0;_&&(G=o*t.glyphMarginDecorationLaneCount);let te=0,ae=te+G,fe=ae+z,oe=fe+R;const Se=i-G-z-R;let Ie=!1,me=!1,ie=-1;h==="inherit"&&p?(Ie=!0,me=!0):f==="on"||f==="bounded"?me=!0:f==="wordWrapColumn"&&(ie=g);const Xt=up._computeMinimapLayout({outerWidth:i,outerHeight:s,lineHeight:o,typicalHalfwidthCharacterWidth:a,pixelRatio:c,scrollBeyondLastLine:y,paddingTop:w.top,paddingBottom:w.bottom,minimap:C,verticalScrollbarWidth:x,viewLineCount:d,remainingWidth:Se,isViewportWrapping:me},t.memory||new fU);Xt.renderMinimap!==0&&Xt.minimapLeft===0&&(te+=Xt.minimapWidth,ae+=Xt.minimapWidth,fe+=Xt.minimapWidth,oe+=Xt.minimapWidth);const Dt=Se-Xt.minimapWidth,Nt=Math.max(1,Math.floor((Dt-x-2)/a)),Ge=D?k:0;return me&&(ie=Math.max(1,Nt),f==="bounded"&&(ie=Math.min(ie,g))),{width:i,height:s,glyphMarginLeft:te,glyphMarginWidth:G,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:ae,lineNumbersWidth:z,decorationsLeft:fe,decorationsWidth:R,contentLeft:oe,contentWidth:Dt,minimap:Xt,viewportColumn:Nt,isWordWrapMinified:Ie,isViewportWrapping:me,wrappingColumn:ie,verticalScrollbarWidth:x,horizontalScrollbarHeight:P,overviewRuler:{top:Ge,width:x,height:s-2*Ge,right:0}}}}class vfe extends Qt{constructor(){super(137,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[m("wrappingStrategy.simple","Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),m("wrappingStrategy.advanced","Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")],type:"string",enum:["simple","advanced"],default:"simple",description:m("wrappingStrategy","Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")}})}validate(e){return Li(e,"simple",["simple","advanced"])}compute(e,t,i){return t.get(2)===2?"advanced":i}}class yfe extends Qt{constructor(){const e={enabled:!0};super(64,"lightbulb",e,{"editor.lightbulb.enabled":{type:"boolean",default:e.enabled,description:m("codeActions","Enables the Code Action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:ve(e.enabled,this.defaultValue.enabled)}}}class wfe extends Qt{constructor(){const e={enabled:!1,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(114,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:m("editor.stickyScroll.enabled","Shows the nested current scopes during the scroll at the top of the editor.")},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:10,description:m("editor.stickyScroll.maxLineCount","Defines the maximum number of sticky lines to show.")},"editor.stickyScroll.defaultModel":{type:"string",enum:["outlineModel","foldingProviderModel","indentationModel"],default:e.defaultModel,description:m("editor.stickyScroll.defaultModel","Defines the model to use for determining which lines to stick. If the outline model does not exist, it will fall back on the folding provider model which falls back on the indentation model. This order is respected in all three cases.")},"editor.stickyScroll.scrollWithEditor":{type:"boolean",default:e.scrollWithEditor,description:m("editor.stickyScroll.scrollWithEditor","Enable scrolling of the sticky scroll widget with the editor's horizontal scrollbar.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:ve(t.enabled,this.defaultValue.enabled),maxLineCount:At.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,10),defaultModel:Li(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:ve(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}class Cfe extends Qt{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1};super(139,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:m("inlayHints.enable","Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[m("editor.inlayHints.on","Inlay hints are enabled"),m("editor.inlayHints.onUnlessPressed","Inlay hints are showing by default and hide when holding {0}",mt?"Ctrl+Option":"Ctrl+Alt"),m("editor.inlayHints.offUnlessPressed","Inlay hints are hidden by default and show when holding {0}",mt?"Ctrl+Option":"Ctrl+Alt"),m("editor.inlayHints.off","Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:m("inlayHints.fontSize","Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.","`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:m("inlayHints.fontFamily","Controls font family of inlay hints in the editor. When set to empty, the {0} is used.","`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:"boolean",default:e.padding,description:m("inlayHints.padding","Enables the padding around the inlay hints in the editor.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return typeof t.enabled=="boolean"&&(t.enabled=t.enabled?"on":"off"),{enabled:Li(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:At.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:Us.string(t.fontFamily,this.defaultValue.fontFamily),padding:ve(t.padding,this.defaultValue.padding)}}}class Sfe extends Qt{constructor(){super(65,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):At.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,i){return i<0?At.clampedInt(-i*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):i}}class xfe extends cr{constructor(){super(66,"lineHeight",Ho.lineHeight,e=>cr.clamp(e,0,150),{markdownDescription:m("lineHeight",`Controls the line height. +`;function Do(n,e=0){return n[n.length-(1+e)]}function Qhe(n){if(n.length===0)throw new Error("Invalid tail call");return[n.slice(0,n.length-1),n[n.length-1]]}function Yi(n,e,t=(i,s)=>i===s){if(n===e)return!0;if(!n||!e||n.length!==e.length)return!1;for(let i=0,s=n.length;it(n[i],e))}function efe(n,e){let t=0,i=n-1;for(;t<=i;){const s=(t+i)/2|0,o=e(s);if(o<0)t=s+1;else if(o>0)i=s-1;else return s}return-(t+1)}function*Y$(n,e){let t,i;for(const s of n)i!==void 0&&e(i,s)?t.push(s):(t&&(yield t),t=[s]),i=s;t&&(yield t)}function Z$(n,e){for(let t=0;t<=n.length;t++)e(t===0?void 0:n[t-1],t===n.length?void 0:n[t])}function tfe(n,e){for(let t=0;t!!e)}function kF(n){let e=0;for(let t=0;t0}function vf(n,e=t=>t){const t=new Set;return n.filter(i=>{const s=e(i);return t.has(s)?!1:(t.add(s),!0)})}function X$(n,e){return n.length>0?n[0]:e}function es(n,e){let t=typeof e=="number"?n:0;typeof e=="number"?t=n:(t=0,e=n);const i=[];if(t<=e)for(let s=t;se;s--)i.push(s);return i}function ML(n,e,t){const i=n.slice(0,e),s=n.slice(e);return i.concat(t,s)}function Uk(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.unshift(e))}function Py(n,e){const t=n.indexOf(e);t>-1&&(n.splice(t,1),n.push(e))}function JA(n,e){for(const t of e)n.push(t)}function Q$(n){return Array.isArray(n)?n:[n]}function nfe(n,e,t){const i=J$(n,e),s=n.length,o=t.length;n.length=s+o;for(let r=s-1;r>=i;r--)n[r+o]=n[r];for(let r=0;r0}n.isGreaterThan=i;function s(o){return o===0}n.isNeitherLessOrGreaterThan=s,n.greaterThan=1,n.lessThan=-1,n.neitherLessOrGreaterThan=0})(Ob||(Ob={}));function pr(n,e){return(t,i)=>e(n(t),n(i))}function sfe(...n){return(e,t)=>{for(const i of n){const s=i(e,t);if(!Ob.isNeitherLessOrGreaterThan(s))return s}return Ob.neitherLessOrGreaterThan}}const Dd=(n,e)=>n-e,ofe=(n,e)=>Dd(n?1:0,e?1:0);function eU(n){return(e,t)=>-n(e,t)}class _c{constructor(e){this.items=e,this.firstIdx=0,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t=0&&e(this.items[t]);)t--;const i=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,i}peek(){if(this.length!==0)return this.items[this.firstIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){const t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}}class Za{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new Za(t=>this.iterate(i=>e(i)?t(i):!0))}map(e){return new Za(t=>this.iterate(i=>t(e(i))))}findLast(e){let t;return this.iterate(i=>(e(i)&&(t=i),!0)),t}findLastMaxBy(e){let t,i=!0;return this.iterate(s=>((i||Ob.isGreaterThan(e(s,t)))&&(i=!1,t=s),!0)),t}}Za.empty=new Za(n=>{});function Rs(n){return typeof n=="string"}function Ls(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)&&!(n instanceof RegExp)&&!(n instanceof Date)}function rfe(n){const e=Object.getPrototypeOf(Uint8Array);return typeof n=="object"&&n instanceof e}function Jd(n){return typeof n=="number"&&!isNaN(n)}function AF(n){return!!n&&typeof n[Symbol.iterator]=="function"}function tU(n){return n===!0||n===!1}function qs(n){return typeof n>"u"}function uS(n){return!po(n)}function po(n){return qs(n)||n===null}function xs(n,e){if(!n)throw new Error("Unexpected type")}function eI(n){if(po(n))throw new Error("Assertion Failed: argument is undefined or null");return n}function hS(n){return typeof n=="function"}function afe(n,e){const t=Math.min(n.length,e.length);for(let i=0;i{e[t]=i&&typeof i=="object"?Rl(i):i}),e}function cfe(n){if(!n||typeof n!="object")return n;const e=[n];for(;e.length>0;){const t=e.shift();Object.freeze(t);for(const i in t)if(iU.call(t,i)){const s=t[i];typeof s=="object"&&!Object.isFrozen(s)&&!rfe(s)&&e.push(s)}}return n}const iU=Object.prototype.hasOwnProperty;function nU(n,e){return tI(n,e,new Set)}function tI(n,e,t){if(po(n))return n;const i=e(n);if(typeof i<"u")return i;if(Array.isArray(n)){const s=[];for(const o of n)s.push(tI(o,e,t));return s}if(Ls(n)){if(t.has(n))throw new Error("Cannot clone recursive data-structure");t.add(n);const s={};for(const o in n)iU.call(n,o)&&(s[o]=tI(n[o],e,t));return t.delete(n),s}return n}function PL(n,e,t=!0){return Ls(n)?(Ls(e)&&Object.keys(e).forEach(i=>{i in n?t&&(Ls(n[i])&&Ls(e[i])?PL(n[i],e[i],t):n[i]=e[i]):n[i]=e[i]}),n):e}function Co(n,e){if(n===e)return!0;if(n==null||e===null||e===void 0||typeof n!=typeof e||typeof n!="object"||Array.isArray(n)!==Array.isArray(e))return!1;let t,i;if(Array.isArray(n)){if(n.length!==e.length)return!1;for(t=0;tfunction(){const o=Array.prototype.slice.call(arguments,0);return e(s,o)},i={};for(const s of n)i[s]=t(s);return i}let hfe=typeof document<"u"&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function ffe(n,e){let t;return e.length===0?t=n:t=n.replace(/\{(\d+)\}/g,(i,s)=>{const o=s[0],r=e[o];let a=i;return typeof r=="string"?a=r:(typeof r=="number"||typeof r=="boolean"||r===void 0||r===null)&&(a=String(r)),a}),hfe&&(t="["+t.replace(/[aouei]/g,"$&$&")+"]"),t}function m(n,e,...t){return ffe(e,t)}var jk;const Fg="en";let fS=!1,gS=!1,nC=!1,sU=!1,L4=!1,D4=!1,oU=!1,Oy,qk=Fg,IF=Fg,gfe,Br;const mr=typeof self=="object"?self:typeof globalThis=="object"?globalThis:{};let ts;typeof mr.vscode<"u"&&typeof mr.vscode.process<"u"?ts=mr.vscode.process:typeof process<"u"&&(ts=process);const pfe=typeof((jk=ts==null?void 0:ts.versions)===null||jk===void 0?void 0:jk.electron)=="string",mfe=pfe&&(ts==null?void 0:ts.type)==="renderer";if(typeof navigator=="object"&&!mfe)Br=navigator.userAgent,fS=Br.indexOf("Windows")>=0,gS=Br.indexOf("Macintosh")>=0,D4=(Br.indexOf("Macintosh")>=0||Br.indexOf("iPad")>=0||Br.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,nC=Br.indexOf("Linux")>=0,oU=(Br==null?void 0:Br.indexOf("Mobi"))>=0,L4=!0,m({key:"ensureLoaderPluginIsLoaded",comment:["{Locked}"]},"_"),Oy=Fg,qk=Oy,IF=navigator.language;else if(typeof ts=="object"){fS=ts.platform==="win32",gS=ts.platform==="darwin",nC=ts.platform==="linux",nC&&ts.env.SNAP&&ts.env.SNAP_REVISION,ts.env.CI||ts.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Oy=Fg,qk=Fg;const n=ts.env.VSCODE_NLS_CONFIG;if(n)try{const e=JSON.parse(n),t=e.availableLanguages["*"];Oy=e.locale,IF=e.osLocale,qk=t||Fg,gfe=e._translationsConfigFile}catch{}sU=!0}else console.error("Unable to resolve platform.");const Ps=fS,pt=gS,Xn=nC,hp=sU,i0=L4,_fe=L4&&typeof mr.importScripts=="function",eu=D4,bfe=oU,tl=Br,vfe=typeof mr.postMessage=="function"&&!mr.importScripts,rU=(()=>{if(vfe){const n=[];mr.addEventListener("message",t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,s=n.length;i{const i=++e;n.push({id:i,callback:t}),mr.postMessage({vscodeScheduleAsyncWork:i},"*")}}return n=>setTimeout(n)})(),bo=gS||D4?2:fS?1:3;let TF=!0,NF=!1;function yfe(){if(!NF){NF=!0;const n=new Uint8Array(2);n[0]=1,n[1]=2,TF=new Uint16Array(n.buffer)[0]===513}return TF}const aU=!!(tl&&tl.indexOf("Chrome")>=0),wfe=!!(tl&&tl.indexOf("Firefox")>=0),Cfe=!!(!aU&&tl&&tl.indexOf("Safari")>=0),Sfe=!!(tl&&tl.indexOf("Edg/")>=0);tl&&tl.indexOf("Android")>=0;const En={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}};var ut;(function(n){function e(b){return b&&typeof b=="object"&&typeof b[Symbol.iterator]=="function"}n.is=e;const t=Object.freeze([]);function i(){return t}n.empty=i;function*s(b){yield b}n.single=s;function o(b){return e(b)?b:s(b)}n.wrap=o;function r(b){return b||t}n.from=r;function*a(b){for(let y=b.length-1;y>=0;y--)yield b[y]}n.reverse=a;function l(b){return!b||b[Symbol.iterator]().next().done===!0}n.isEmpty=l;function c(b){return b[Symbol.iterator]().next().value}n.first=c;function d(b,y){for(const w of b)if(y(w))return!0;return!1}n.some=d;function u(b,y){for(const w of b)if(y(w))return w}n.find=u;function*h(b,y){for(const w of b)y(w)&&(yield w)}n.filter=h;function*f(b,y){let w=0;for(const S of b)yield y(S,w++)}n.map=f;function*g(...b){for(const y of b)for(const w of y)yield w}n.concat=g;function p(b,y,w){let S=w;for(const L of b)S=y(S,L);return S}n.reduce=p;function*_(b,y,w=b.length){for(y<0&&(y+=b.length),w<0?w+=b.length:w>b.length&&(w=b.length);y{s||(s=!0,this._remove(i))}}shift(){if(this._first!==Ri.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Ri.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Ri.Undefined&&e.next!==Ri.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Ri.Undefined&&e.next===Ri.Undefined?(this._first=Ri.Undefined,this._last=Ri.Undefined):e.next===Ri.Undefined?(this._last=this._last.prev,this._last.next=Ri.Undefined):e.prev===Ri.Undefined&&(this._first=this._first.next,this._first.prev=Ri.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Ri.Undefined;)yield e.element,e=e.next}}const lU="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";function xfe(n=""){let e="(-?\\d*\\.\\d\\w*)|([^";for(const t of lU)n.indexOf(t)>=0||(e+="\\"+t);return e+="\\s]+)",new RegExp(e,"g")}const k4=xfe();function cU(n){let e=k4;if(n&&n instanceof RegExp)if(n.global)e=n;else{let t="g";n.ignoreCase&&(t+="i"),n.multiline&&(t+="m"),n.unicode&&(t+="u"),e=new RegExp(n.source,t)}return e.lastIndex=0,e}const dU=new Ds;dU.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function Fb(n,e,t,i,s){if(s||(s=ut.first(dU)),t.length>s.maxLen){let c=n-s.maxLen/2;return c<0?c=0:i+=c,t=t.substring(c,n+s.maxLen/2),Fb(n,e,t,i,s)}const o=Date.now(),r=n-1-i;let a=-1,l=null;for(let c=1;!(Date.now()-o>=s.timeBudget);c++){const d=r-s.windowSize*c;e.lastIndex=Math.max(0,d);const u=Lfe(e,t,r,a);if(!u&&l||(l=u,d<=0))break;a=d}if(l){const c={word:l[0],startColumn:i+1+l.index,endColumn:i+1+l.index+l[0].length};return e.lastIndex=0,c}return null}function Lfe(n,e,t,i){let s;for(;s=n.exec(e);){const o=s.index||0;if(o<=t&&n.lastIndex>=t)return s;if(i>0&&o>i)return null}return null}const Wc=8;class uU{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class hU{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class Xt{constructor(e,t,i,s){this.id=e,this.name=t,this.defaultValue=i,this.schema=s}applyUpdate(e,t){return OL(e,t)}compute(e,t,i){return i}}class P_{constructor(e,t){this.newValue=e,this.didChange=t}}function OL(n,e){if(typeof n!="object"||typeof e!="object"||!n||!e)return new P_(e,n!==e);if(Array.isArray(n)||Array.isArray(e)){const i=Array.isArray(n)&&Array.isArray(e)&&Yi(n,e);return new P_(e,!i)}let t=!1;for(const i in e)if(e.hasOwnProperty(i)){const s=OL(n[i],e[i]);s.didChange&&(n[i]=s.newValue,t=!0)}return new P_(n,t)}class U1{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return OL(e,t)}validate(e){return this.defaultValue}}class n0{constructor(e,t,i,s){this.id=e,this.name=t,this.defaultValue=i,this.schema=s}applyUpdate(e,t){return OL(e,t)}validate(e){return typeof e>"u"?this.defaultValue:e}compute(e,t,i){return i}}function ve(n,e){return typeof n>"u"?e:n==="false"?!1:!!n}class nt extends n0{constructor(e,t,i,s=void 0){typeof s<"u"&&(s.type="boolean",s.default=i),super(e,t,i,s)}validate(e){return ve(e,this.defaultValue)}}function th(n,e,t,i){if(typeof n>"u")return e;let s=parseInt(n,10);return isNaN(s)?e:(s=Math.max(t,s),s=Math.min(i,s),s|0)}class At extends n0{static clampedInt(e,t,i,s){return th(e,t,i,s)}constructor(e,t,i,s,o,r=void 0){typeof r<"u"&&(r.type="integer",r.default=i,r.minimum=s,r.maximum=o),super(e,t,i,r),this.minimum=s,this.maximum=o}validate(e){return At.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function Dfe(n,e,t,i){if(typeof n>"u")return e;const s=lr.float(n,e);return lr.clamp(s,t,i)}class lr extends n0{static clamp(e,t,i){return ei?i:e}static float(e,t){if(typeof e=="number")return e;if(typeof e>"u")return t;const i=parseFloat(e);return isNaN(i)?t:i}constructor(e,t,i,s,o){typeof o<"u"&&(o.type="number",o.default=i),super(e,t,i,o),this.validationFn=s}validate(e){return this.validationFn(lr.float(e,this.defaultValue))}}class Hs extends n0{static string(e,t){return typeof e!="string"?t:e}constructor(e,t,i,s=void 0){typeof s<"u"&&(s.type="string",s.default=i),super(e,t,i,s)}validate(e){return Hs.string(e,this.defaultValue)}}function xi(n,e,t,i){return typeof n!="string"?e:i&&n in i?i[n]:t.indexOf(n)===-1?e:n}class si extends n0{constructor(e,t,i,s,o=void 0){typeof o<"u"&&(o.type="string",o.enum=s,o.default=i),super(e,t,i,o),this._allowedValues=s}validate(e){return xi(e,this.defaultValue,this._allowedValues)}}class Fy extends Xt{constructor(e,t,i,s,o,r,a=void 0){typeof a<"u"&&(a.type="string",a.enum=o,a.default=s),super(e,t,i,a),this._allowedValues=o,this._convert=r}validate(e){return typeof e!="string"?this.defaultValue:this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}}function kfe(n){switch(n){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}class Efe extends Xt{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[m("accessibilitySupport.auto","Use platform APIs to detect when a Screen Reader is attached"),m("accessibilitySupport.on","Optimize for usage with a Screen Reader"),m("accessibilitySupport.off","Assume a screen reader is not attached")],default:"auto",tags:["accessibility"],description:m("accessibilitySupport","Controls if the UI should run in a mode where it is optimized for screen readers.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,i){return i===0?e.accessibilitySupport:i}}class Afe extends Xt{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(23,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:m("comments.insertSpace","Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:m("comments.ignoreEmptyLines","Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertSpace:ve(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:ve(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}function Ife(n){switch(n){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}var fn;(function(n){n[n.Line=1]="Line",n[n.Block=2]="Block",n[n.Underline=3]="Underline",n[n.LineThin=4]="LineThin",n[n.BlockOutline=5]="BlockOutline",n[n.UnderlineThin=6]="UnderlineThin"})(fn||(fn={}));function Tfe(n){switch(n){case"line":return fn.Line;case"block":return fn.Block;case"underline":return fn.Underline;case"line-thin":return fn.LineThin;case"block-outline":return fn.BlockOutline;case"underline-thin":return fn.UnderlineThin}}class Nfe extends U1{constructor(){super(140)}compute(e,t,i){const s=["monaco-editor"];return t.get(39)&&s.push(t.get(39)),e.extraEditorClassName&&s.push(e.extraEditorClassName),t.get(73)==="default"?s.push("mouse-default"):t.get(73)==="copy"&&s.push("mouse-copy"),t.get(110)&&s.push("showUnused"),t.get(138)&&s.push("showDeprecated"),s.join(" ")}}class Rfe extends nt{constructor(){super(37,"emptySelectionClipboard",!0,{description:m("emptySelectionClipboard","Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}class Mfe extends Xt{constructor(){const e={cursorMoveOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0};super(41,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:m("find.cursorMoveOnType","Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[m("editor.find.seedSearchStringFromSelection.never","Never seed search string from the editor selection."),m("editor.find.seedSearchStringFromSelection.always","Always seed search string from the editor selection, including word at cursor position."),m("editor.find.seedSearchStringFromSelection.selection","Only seed search string from the editor selection.")],description:m("find.seedSearchStringFromSelection","Controls whether the search string in the Find Widget is seeded from the editor selection.")},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[m("editor.find.autoFindInSelection.never","Never turn on Find in Selection automatically (default)."),m("editor.find.autoFindInSelection.always","Always turn on Find in Selection automatically."),m("editor.find.autoFindInSelection.multiline","Turn on Find in Selection automatically when multiple lines of content are selected.")],description:m("find.autoFindInSelection","Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:m("find.globalFindClipboard","Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:pt},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:m("find.addExtraSpaceOnTop","Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")},"editor.find.loop":{type:"boolean",default:e.loop,description:m("find.loop","Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{cursorMoveOnType:ve(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:typeof e.seedSearchStringFromSelection=="boolean"?e.seedSearchStringFromSelection?"always":"never":xi(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:typeof e.autoFindInSelection=="boolean"?e.autoFindInSelection?"always":"never":xi(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:ve(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:ve(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:ve(t.loop,this.defaultValue.loop)}}}class To extends Xt{constructor(){super(51,"fontLigatures",To.OFF,{anyOf:[{type:"boolean",description:m("fontLigatures","Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.")},{type:"string",description:m("fontFeatureSettings","Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:m("fontLigaturesGeneral","Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?To.OFF:e==="true"?To.ON:e:e?To.ON:To.OFF}}To.OFF='"liga" off, "calt" off';To.ON='"liga" on, "calt" on';class Xr extends Xt{constructor(){super(54,"fontVariations",Xr.OFF,{anyOf:[{type:"boolean",description:m("fontVariations","Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.")},{type:"string",description:m("fontVariationSettings","Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.")}],description:m("fontVariationsGeneral","Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property."),default:!1})}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e==="false"?Xr.OFF:e==="true"?Xr.TRANSLATE:e:e?Xr.TRANSLATE:Xr.OFF}compute(e,t,i){return e.fontInfo.fontVariationSettings}}Xr.OFF="normal";Xr.TRANSLATE="translate";class Pfe extends U1{constructor(){super(50)}compute(e,t,i){return e.fontInfo}}class Ofe extends n0{constructor(){super(52,"fontSize",zo.fontSize,{type:"number",minimum:6,maximum:100,default:zo.fontSize,description:m("fontSize","Controls the font size in pixels.")})}validate(e){const t=lr.float(e,this.defaultValue);return t===0?zo.fontSize:lr.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}class ka extends Xt{constructor(){super(53,"fontWeight",zo.fontWeight,{anyOf:[{type:"number",minimum:ka.MINIMUM_VALUE,maximum:ka.MAXIMUM_VALUE,errorMessage:m("fontWeightErrorMessage",'Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.')},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:ka.SUGGESTION_VALUES}],default:zo.fontWeight,description:m("fontWeight",'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return e==="normal"||e==="bold"?e:String(At.clampedInt(e,zo.fontWeight,ka.MINIMUM_VALUE,ka.MAXIMUM_VALUE))}}ka.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"];ka.MINIMUM_VALUE=1;ka.MAXIMUM_VALUE=1e3;class Ffe extends Xt{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[m("editor.gotoLocation.multiple.peek","Show Peek view of the results (default)"),m("editor.gotoLocation.multiple.gotoAndPeek","Go to the primary result and show a Peek view"),m("editor.gotoLocation.multiple.goto","Go to the primary result and enable Peek-less navigation to others")]},i=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(58,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:m("editor.gotoLocation.multiple.deprecated","This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":Object.assign({description:m("editor.editor.gotoLocation.multipleDefinitions","Controls the behavior the 'Go to Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleTypeDefinitions":Object.assign({description:m("editor.editor.gotoLocation.multipleTypeDefinitions","Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleDeclarations":Object.assign({description:m("editor.editor.gotoLocation.multipleDeclarations","Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleImplementations":Object.assign({description:m("editor.editor.gotoLocation.multipleImplemenattions","Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleReferences":Object.assign({description:m("editor.editor.gotoLocation.multipleReferences","Controls the behavior the 'Go to References'-command when multiple target locations exist.")},t),"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:i,description:m("alternativeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:i,description:m("alternativeTypeDefinitionCommand","Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:i,description:m("alternativeDeclarationCommand","Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:i,description:m("alternativeImplementationCommand","Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:i,description:m("alternativeReferenceCommand","Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){var t,i,s,o,r;if(!e||typeof e!="object")return this.defaultValue;const a=e;return{multiple:xi(a.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:(t=a.multipleDefinitions)!==null&&t!==void 0?t:xi(a.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:(i=a.multipleTypeDefinitions)!==null&&i!==void 0?i:xi(a.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:(s=a.multipleDeclarations)!==null&&s!==void 0?s:xi(a.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:(o=a.multipleImplementations)!==null&&o!==void 0?o:xi(a.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:(r=a.multipleReferences)!==null&&r!==void 0?r:xi(a.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:Hs.string(a.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:Hs.string(a.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:Hs.string(a.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:Hs.string(a.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:Hs.string(a.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}class Bfe extends Xt{constructor(){const e={enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0};super(60,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:m("hover.enabled","Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:m("hover.delay","Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:m("hover.sticky","Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.hidingDelay":{type:"integer",minimum:0,default:e.hidingDelay,description:m("hover.hidingDelay","Controls the delay in milliseconds after thich the hover is hidden. Requires `editor.hover.sticky` to be enabled.")},"editor.hover.above":{type:"boolean",default:e.above,description:m("hover.above","Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:ve(t.enabled,this.defaultValue.enabled),delay:At.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:ve(t.sticky,this.defaultValue.sticky),hidingDelay:At.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:ve(t.above,this.defaultValue.above)}}}class fp extends U1{constructor(){super(143)}compute(e,t,i){return fp.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio,glyphMarginDecorationLaneCount:e.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,i=Math.floor(e.paddingTop/e.lineHeight);let s=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(s=Math.max(s,t-1));const o=(i+e.viewLineCount+s)/(e.pixelRatio*e.height),r=Math.floor(e.viewLineCount/o);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:i,extraLinesBeyondLastLine:s,desiredRatio:o,minimapLineCount:r}}static _computeMinimapLayout(e,t){const i=e.outerWidth,s=e.outerHeight,o=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(o*s),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:s};const r=t.stableMinimapLayoutInput,a=r&&e.outerHeight===r.outerHeight&&e.lineHeight===r.lineHeight&&e.typicalHalfwidthCharacterWidth===r.typicalHalfwidthCharacterWidth&&e.pixelRatio===r.pixelRatio&&e.scrollBeyondLastLine===r.scrollBeyondLastLine&&e.paddingTop===r.paddingTop&&e.paddingBottom===r.paddingBottom&&e.minimap.enabled===r.minimap.enabled&&e.minimap.side===r.minimap.side&&e.minimap.size===r.minimap.size&&e.minimap.showSlider===r.minimap.showSlider&&e.minimap.renderCharacters===r.minimap.renderCharacters&&e.minimap.maxColumn===r.minimap.maxColumn&&e.minimap.scale===r.minimap.scale&&e.verticalScrollbarWidth===r.verticalScrollbarWidth&&e.isViewportWrapping===r.isViewportWrapping,l=e.lineHeight,c=e.typicalHalfwidthCharacterWidth,d=e.scrollBeyondLastLine,u=e.minimap.renderCharacters;let h=o>=2?Math.round(e.minimap.scale*2):e.minimap.scale;const f=e.minimap.maxColumn,g=e.minimap.size,p=e.minimap.side,_=e.verticalScrollbarWidth,v=e.viewLineCount,b=e.remainingWidth,y=e.isViewportWrapping,w=u?2:3;let S=Math.floor(o*s);const L=S/o;let x=!1,D=!1,k=w*h,P=h/o,O=1;if(g==="fill"||g==="fit"){const{typicalViewportLineCount:fe,extraLinesBeforeFirstLine:oe,extraLinesBeyondLastLine:Se,desiredRatio:Ie,minimapLineCount:me}=fp.computeContainedMinimapLineCount({viewLineCount:v,scrollBeyondLastLine:d,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:s,lineHeight:l,pixelRatio:o});if(v/me>1)x=!0,D=!0,h=1,k=1,P=h/o;else{let Zt=!1,Dt=h+1;if(g==="fit"){const Tt=Math.ceil((oe+v+Se)*k);y&&a&&b<=t.stableFitRemainingWidth?(Zt=!0,Dt=t.stableFitMaxMinimapScale):Zt=Tt>S}if(g==="fill"||Zt){x=!0;const Tt=h;k=Math.min(l*o,Math.max(1,Math.floor(1/Ie))),y&&a&&b<=t.stableFitRemainingWidth&&(Dt=t.stableFitMaxMinimapScale),h=Math.min(Dt,Math.max(1,Math.floor(k/w))),h>Tt&&(O=Math.min(2,h/Tt)),P=h/o/O,S=Math.ceil(Math.max(fe,oe+v+Se)*k),y?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=b,t.stableFitMaxMinimapScale=h):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const M=Math.floor(f*P),R=Math.min(M,Math.max(0,Math.floor((b-_-2)*P/(c+P)))+Wc);let z=Math.floor(o*R);const G=z/o;z=Math.floor(z*O);const te=u?1:2,ae=p==="left"?0:i-R-_;return{renderMinimap:te,minimapLeft:ae,minimapWidth:R,minimapHeightIsEditorHeight:x,minimapIsSampling:D,minimapScale:h,minimapLineHeight:k,minimapCanvasInnerWidth:z,minimapCanvasInnerHeight:S,minimapCanvasOuterWidth:G,minimapCanvasOuterHeight:L}}static computeLayout(e,t){const i=t.outerWidth|0,s=t.outerHeight|0,o=t.lineHeight|0,r=t.lineNumbersDigitCount|0,a=t.typicalHalfwidthCharacterWidth,l=t.maxDigitWidth,c=t.pixelRatio,d=t.viewLineCount,u=e.get(135),h=u==="inherit"?e.get(134):u,f=h==="inherit"?e.get(130):h,g=e.get(133),p=t.isDominatedByLongLines,_=e.get(57),v=e.get(67).renderType!==0,b=e.get(68),y=e.get(104),w=e.get(83),S=e.get(72),L=e.get(102),x=L.verticalScrollbarSize,D=L.verticalHasArrows,k=L.arrowSize,P=L.horizontalScrollbarSize,O=e.get(43),M=e.get(109)!=="never";let R=e.get(65);O&&M&&(R+=16);let z=0;if(v){const ni=Math.max(r,b);z=Math.round(ni*l)}let G=0;_&&(G=o*t.glyphMarginDecorationLaneCount);let te=0,ae=te+G,fe=ae+z,oe=fe+R;const Se=i-G-z-R;let Ie=!1,me=!1,ie=-1;h==="inherit"&&p?(Ie=!0,me=!0):f==="on"||f==="bounded"?me=!0:f==="wordWrapColumn"&&(ie=g);const Zt=fp._computeMinimapLayout({outerWidth:i,outerHeight:s,lineHeight:o,typicalHalfwidthCharacterWidth:a,pixelRatio:c,scrollBeyondLastLine:y,paddingTop:w.top,paddingBottom:w.bottom,minimap:S,verticalScrollbarWidth:x,viewLineCount:d,remainingWidth:Se,isViewportWrapping:me},t.memory||new hU);Zt.renderMinimap!==0&&Zt.minimapLeft===0&&(te+=Zt.minimapWidth,ae+=Zt.minimapWidth,fe+=Zt.minimapWidth,oe+=Zt.minimapWidth);const Dt=Se-Zt.minimapWidth,Tt=Math.max(1,Math.floor((Dt-x-2)/a)),qe=D?k:0;return me&&(ie=Math.max(1,Tt),f==="bounded"&&(ie=Math.min(ie,g))),{width:i,height:s,glyphMarginLeft:te,glyphMarginWidth:G,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:ae,lineNumbersWidth:z,decorationsLeft:fe,decorationsWidth:R,contentLeft:oe,contentWidth:Dt,minimap:Zt,viewportColumn:Tt,isWordWrapMinified:Ie,isViewportWrapping:me,wrappingColumn:ie,verticalScrollbarWidth:x,horizontalScrollbarHeight:P,overviewRuler:{top:qe,width:x,height:s-2*qe,right:0}}}}class Wfe extends Xt{constructor(){super(137,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[m("wrappingStrategy.simple","Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),m("wrappingStrategy.advanced","Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")],type:"string",enum:["simple","advanced"],default:"simple",description:m("wrappingStrategy","Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")}})}validate(e){return xi(e,"simple",["simple","advanced"])}compute(e,t,i){return t.get(2)===2?"advanced":i}}class Vfe extends Xt{constructor(){const e={enabled:!0};super(64,"lightbulb",e,{"editor.lightbulb.enabled":{type:"boolean",default:e.enabled,description:m("codeActions","Enables the Code Action lightbulb in the editor.")}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{enabled:ve(e.enabled,this.defaultValue.enabled)}}}class zfe extends Xt{constructor(){const e={enabled:!1,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(114,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:m("editor.stickyScroll.enabled","Shows the nested current scopes during the scroll at the top of the editor.")},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:10,description:m("editor.stickyScroll.maxLineCount","Defines the maximum number of sticky lines to show.")},"editor.stickyScroll.defaultModel":{type:"string",enum:["outlineModel","foldingProviderModel","indentationModel"],default:e.defaultModel,description:m("editor.stickyScroll.defaultModel","Defines the model to use for determining which lines to stick. If the outline model does not exist, it will fall back on the folding provider model which falls back on the indentation model. This order is respected in all three cases.")},"editor.stickyScroll.scrollWithEditor":{type:"boolean",default:e.scrollWithEditor,description:m("editor.stickyScroll.scrollWithEditor","Enable scrolling of the sticky scroll widget with the editor's horizontal scrollbar.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:ve(t.enabled,this.defaultValue.enabled),maxLineCount:At.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,10),defaultModel:xi(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:ve(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}class Hfe extends Xt{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1};super(139,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:m("inlayHints.enable","Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[m("editor.inlayHints.on","Inlay hints are enabled"),m("editor.inlayHints.onUnlessPressed","Inlay hints are showing by default and hide when holding {0}",pt?"Ctrl+Option":"Ctrl+Alt"),m("editor.inlayHints.offUnlessPressed","Inlay hints are hidden by default and show when holding {0}",pt?"Ctrl+Option":"Ctrl+Alt"),m("editor.inlayHints.off","Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:m("inlayHints.fontSize","Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.","`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:m("inlayHints.fontFamily","Controls font family of inlay hints in the editor. When set to empty, the {0} is used.","`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:"boolean",default:e.padding,description:m("inlayHints.padding","Enables the padding around the inlay hints in the editor.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return typeof t.enabled=="boolean"&&(t.enabled=t.enabled?"on":"off"),{enabled:xi(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:At.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:Hs.string(t.fontFamily,this.defaultValue.fontFamily),padding:ve(t.padding,this.defaultValue.padding)}}}class $fe extends Xt{constructor(){super(65,"lineDecorationsWidth",10)}validate(e){return typeof e=="string"&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):At.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,i){return i<0?At.clampedInt(-i*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):i}}class Ufe extends lr{constructor(){super(66,"lineHeight",zo.lineHeight,e=>lr.clamp(e,0,150),{markdownDescription:m("lineHeight",`Controls the line height. - Use 0 to automatically compute the line height from the font size. - Values between 0 and 8 will be used as a multiplier with the font size. - - Values greater than or equal to 8 will be used as effective values.`)})}compute(e,t,i){return e.fontInfo.lineHeight}}class Lfe extends Qt{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:!1,renderCharacters:!0,maxColumn:120,scale:1};super(72,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:m("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:m("minimap.autohide","Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[m("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),m("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),m("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:m("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:m("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:m("minimap.showSlider","Controls when the minimap slider is shown.")},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:m("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:m("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:m("minimap.maxColumn","Limit the width of the minimap to render at most a certain number of columns.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:ve(t.enabled,this.defaultValue.enabled),autohide:ve(t.autohide,this.defaultValue.autohide),size:Li(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:Li(t.side,this.defaultValue.side,["right","left"]),showSlider:Li(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:ve(t.renderCharacters,this.defaultValue.renderCharacters),scale:At.clampedInt(t.scale,1,1,3),maxColumn:At.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}function Dfe(n){return n==="ctrlCmd"?mt?"metaKey":"ctrlKey":"altKey"}class kfe extends Qt{constructor(){super(83,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:m("padding.top","Controls the amount of space between the top edge of the editor and the first line.")},"editor.padding.bottom":{type:"number",default:0,minimum:0,maximum:1e3,description:m("padding.bottom","Controls the amount of space between the bottom edge of the editor and the last line.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{top:At.clampedInt(t.top,0,0,1e3),bottom:At.clampedInt(t.bottom,0,0,1e3)}}}class Efe extends Qt{constructor(){const e={enabled:!0,cycle:!0};super(85,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:m("parameterHints.enabled","Enables a pop-up that shows parameter documentation and type information as you type.")},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:m("parameterHints.cycle","Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:ve(t.enabled,this.defaultValue.enabled),cycle:ve(t.cycle,this.defaultValue.cycle)}}}class Afe extends H1{constructor(){super(141)}compute(e,t,i){return e.pixelRatio}}class Ife extends Qt{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[m("on","Quick suggestions show inside the suggest widget"),m("inline","Quick suggestions show as ghost text"),m("off","Quick suggestions are disabled")]}];super(88,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:m("quickSuggestions.strings","Enable quick suggestions inside strings.")},comments:{anyOf:t,default:e.comments,description:m("quickSuggestions.comments","Enable quick suggestions inside comments.")},other:{anyOf:t,default:e.other,description:m("quickSuggestions.other","Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:m("quickSuggestions","Controls whether suggestions should automatically show up while typing. This can be controlled for typing in comments, strings, and other code. Quick suggestion can be configured to show as ghost text or with the suggest widget. Also be aware of the '{0}'-setting which controls if suggestions are triggered by special characters.","#editor.suggestOnTriggerCharacters#")}),this.defaultValue=e}validate(e){if(typeof e=="boolean"){const c=e?"on":"off";return{comments:c,strings:c,other:c}}if(!e||typeof e!="object")return this.defaultValue;const{other:t,comments:i,strings:s}=e,o=["on","inline","off"];let r,a,l;return typeof t=="boolean"?r=t?"on":"off":r=Li(t,this.defaultValue.other,o),typeof i=="boolean"?a=i?"on":"off":a=Li(i,this.defaultValue.comments,o),typeof s=="boolean"?l=s?"on":"off":l=Li(s,this.defaultValue.strings,o),{other:r,comments:a,strings:l}}}class Tfe extends Qt{constructor(){super(67,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[m("lineNumbers.off","Line numbers are not rendered."),m("lineNumbers.on","Line numbers are rendered as absolute number."),m("lineNumbers.relative","Line numbers are rendered as distance in lines to cursor position."),m("lineNumbers.interval","Line numbers are rendered every 10 lines.")],default:"on",description:m("lineNumbers","Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,i=this.defaultValue.renderFn;return typeof e<"u"&&(typeof e=="function"?(t=4,i=e):e==="interval"?t=3:e==="relative"?t=2:e==="on"?t=1:t=0),{renderType:t,renderFn:i}}}function CS(n){const e=n.get(97);return e==="editable"?n.get(90):e!=="on"}class Nfe extends Qt{constructor(){const e=[],t={type:"number",description:m("rulers.size","Number of monospace characters at which this editor ruler will render.")};super(101,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:m("rulers.color","Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:m("rulers","Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.")})}validate(e){if(Array.isArray(e)){const t=[];for(const i of e)if(typeof i=="number")t.push({column:At.clampedInt(i,0,0,1e4),color:null});else if(i&&typeof i=="object"){const s=i;t.push({column:At.clampedInt(s.column,0,0,1e4),color:s.color})}return t.sort((i,s)=>i.column-s.column),t}return this.defaultValue}}class Rfe extends Qt{constructor(){super(91,"readOnlyMessage",void 0)}validate(e){return!e||typeof e!="object"?this.defaultValue:e}}function FF(n,e){if(typeof n!="string")return e;switch(n){case"hidden":return 2;case"visible":return 3;default:return 1}}let Mfe=class extends Qt{constructor(){const e={vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:12,horizontalSliderSize:12,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,alwaysConsumeMouseWheel:!0,scrollByPage:!1};super(102,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[m("scrollbar.vertical.auto","The vertical scrollbar will be visible only when necessary."),m("scrollbar.vertical.visible","The vertical scrollbar will always be visible."),m("scrollbar.vertical.fit","The vertical scrollbar will always be hidden.")],default:"auto",description:m("scrollbar.vertical","Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[m("scrollbar.horizontal.auto","The horizontal scrollbar will be visible only when necessary."),m("scrollbar.horizontal.visible","The horizontal scrollbar will always be visible."),m("scrollbar.horizontal.fit","The horizontal scrollbar will always be hidden.")],default:"auto",description:m("scrollbar.horizontal","Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:m("scrollbar.verticalScrollbarSize","The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:m("scrollbar.horizontalScrollbarSize","The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:m("scrollbar.scrollByPage","Controls whether clicks scroll by page or jump to click position.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e,i=At.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),s=At.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:At.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:FF(t.vertical,this.defaultValue.vertical),horizontal:FF(t.horizontal,this.defaultValue.horizontal),useShadows:ve(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:ve(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:ve(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:ve(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:ve(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:At.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:s,verticalSliderSize:At.clampedInt(t.verticalSliderSize,s,0,1e3),scrollByPage:ve(t.scrollByPage,this.defaultValue.scrollByPage)}}};const Or="inUntrustedWorkspace",$u={allowedCharacters:"editor.unicodeHighlight.allowedCharacters",invisibleCharacters:"editor.unicodeHighlight.invisibleCharacters",nonBasicASCII:"editor.unicodeHighlight.nonBasicASCII",ambiguousCharacters:"editor.unicodeHighlight.ambiguousCharacters",includeComments:"editor.unicodeHighlight.includeComments",includeStrings:"editor.unicodeHighlight.includeStrings",allowedLocales:"editor.unicodeHighlight.allowedLocales"};class Pfe extends Qt{constructor(){const e={nonBasicASCII:Or,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:Or,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(124,"unicodeHighlight",e,{[$u.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Or],default:e.nonBasicASCII,description:m("unicodeHighlight.nonBasicASCII","Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.")},[$u.invisibleCharacters]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:m("unicodeHighlight.invisibleCharacters","Controls whether characters that just reserve space or have no width at all are highlighted.")},[$u.ambiguousCharacters]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:m("unicodeHighlight.ambiguousCharacters","Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.")},[$u.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Or],default:e.includeComments,description:m("unicodeHighlight.includeComments","Controls whether characters in comments should also be subject to Unicode highlighting.")},[$u.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Or],default:e.includeStrings,description:m("unicodeHighlight.includeStrings","Controls whether characters in strings should also be subject to Unicode highlighting.")},[$u.allowedCharacters]:{restricted:!0,type:"object",default:e.allowedCharacters,description:m("unicodeHighlight.allowedCharacters","Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[$u.allowedLocales]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:m("unicodeHighlight.allowedLocales","Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let i=!1;t.allowedCharacters&&e&&(Lo(e.allowedCharacters,t.allowedCharacters)||(e=Object.assign(Object.assign({},e),{allowedCharacters:t.allowedCharacters}),i=!0)),t.allowedLocales&&e&&(Lo(e.allowedLocales,t.allowedLocales)||(e=Object.assign(Object.assign({},e),{allowedLocales:t.allowedLocales}),i=!0));const s=super.applyUpdate(e,t);return i?new I_(s.newValue,!0):s}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{nonBasicASCII:hp(t.nonBasicASCII,Or,[!0,!1,Or]),invisibleCharacters:ve(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:ve(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:hp(t.includeComments,Or,[!0,!1,Or]),includeStrings:hp(t.includeStrings,Or,[!0,!1,Or]),allowedCharacters:this.validateBooleanMap(e.allowedCharacters,this.defaultValue.allowedCharacters),allowedLocales:this.validateBooleanMap(e.allowedLocales,this.defaultValue.allowedLocales)}}validateBooleanMap(e,t){if(typeof e!="object"||!e)return t;const i={};for(const[s,o]of Object.entries(e))o===!0&&(i[s]=!0);return i}}class Ofe extends Qt{constructor(){const e={enabled:!0,mode:"subwordSmart",showToolbar:"onHover",suppressSuggestions:!1,keepOnBlur:!1};super(62,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:m("inlineSuggest.enabled","Controls whether to automatically show inline suggestions in the editor.")},"editor.inlineSuggest.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover"],enumDescriptions:[m("inlineSuggest.showToolbar.always","Show the inline suggestion toolbar whenever an inline suggestion is shown."),m("inlineSuggest.showToolbar.onHover","Show the inline suggestion toolbar when hovering over an inline suggestion.")],description:m("inlineSuggest.showToolbar","Controls when to show the inline suggestion toolbar.")},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:e.suppressSuggestions,description:m("inlineSuggest.suppressSuggestions","Controls how inline suggestions interact with the suggest widget. If enabled, the suggest widget is not shown automatically when inline suggestions are available.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:ve(t.enabled,this.defaultValue.enabled),mode:Li(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:Li(t.showToolbar,this.defaultValue.showToolbar,["always","onHover"]),suppressSuggestions:ve(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:ve(t.keepOnBlur,this.defaultValue.keepOnBlur)}}}class Ffe extends Qt{constructor(){const e={enabled:In.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:In.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(15,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:m("bracketPairColorization.enabled","Controls whether bracket pair colorization is enabled or not. Use {0} to override the bracket highlight colors.","`#workbench.colorCustomizations#`")},"editor.bracketPairColorization.independentColorPoolPerBracketType":{type:"boolean",default:e.independentColorPoolPerBracketType,description:m("bracketPairColorization.independentColorPoolPerBracketType","Controls whether each bracket type has its own independent color pool.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:ve(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:ve(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}}class Bfe extends Qt{constructor(){const e={bracketPairs:!1,bracketPairsHorizontal:"active",highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(16,"guides",e,{"editor.guides.bracketPairs":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[m("editor.guides.bracketPairs.true","Enables bracket pair guides."),m("editor.guides.bracketPairs.active","Enables bracket pair guides only for the active bracket pair."),m("editor.guides.bracketPairs.false","Disables bracket pair guides.")],default:e.bracketPairs,description:m("editor.guides.bracketPairs","Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[m("editor.guides.bracketPairsHorizontal.true","Enables horizontal guides as addition to vertical bracket pair guides."),m("editor.guides.bracketPairsHorizontal.active","Enables horizontal guides only for the active bracket pair."),m("editor.guides.bracketPairsHorizontal.false","Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:m("editor.guides.bracketPairsHorizontal","Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:m("editor.guides.highlightActiveBracketPair","Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:m("editor.guides.indentation","Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[m("editor.guides.highlightActiveIndentation.true","Highlights the active indent guide."),m("editor.guides.highlightActiveIndentation.always","Highlights the active indent guide even if bracket guides are highlighted."),m("editor.guides.highlightActiveIndentation.false","Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:m("editor.guides.highlightActiveIndentation","Controls whether the editor should highlight the active indent guide.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{bracketPairs:hp(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:hp(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:ve(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:ve(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:hp(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}function hp(n,e,t){const i=t.indexOf(n);return i===-1?e:t[i]}class Wfe extends Qt{constructor(){const e={insertMode:"insert",filterGraceful:!0,snippetsPreventQuickSuggestions:!1,localityBonus:!1,shareSuggestSelections:!1,selectionMode:"always",showIcons:!0,showStatusBar:!1,preview:!1,previewMode:"subwordSmart",showInlineDetails:!0,showMethods:!0,showFunctions:!0,showConstructors:!0,showDeprecated:!0,matchOnWordStartOnly:!0,showFields:!0,showVariables:!0,showClasses:!0,showStructs:!0,showInterfaces:!0,showModules:!0,showProperties:!0,showEvents:!0,showOperators:!0,showUnits:!0,showValues:!0,showConstants:!0,showEnums:!0,showEnumMembers:!0,showKeywords:!0,showWords:!0,showColors:!0,showFiles:!0,showReferences:!0,showFolders:!0,showTypeParameters:!0,showSnippets:!0,showUsers:!0,showIssues:!0};super(117,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[m("suggest.insertMode.insert","Insert suggestion without overwriting text right of the cursor."),m("suggest.insertMode.replace","Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:m("suggest.insertMode","Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.")},"editor.suggest.filterGraceful":{type:"boolean",default:e.filterGraceful,description:m("suggest.filterGraceful","Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:m("suggest.localityBonus","Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:m("suggest.shareSuggestSelections","Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")},"editor.suggest.selectionMode":{type:"string",enum:["always","never","whenTriggerCharacter","whenQuickSuggestion"],enumDescriptions:[m("suggest.insertMode.always","Always select a suggestion when automatically triggering IntelliSense."),m("suggest.insertMode.never","Never select a suggestion when automatically triggering IntelliSense."),m("suggest.insertMode.whenTriggerCharacter","Select a suggestion only when triggering IntelliSense from a trigger character."),m("suggest.insertMode.whenQuickSuggestion","Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:m("suggest.selectionMode","Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions (`#editor.quickSuggestions#` and `#editor.suggestOnTriggerCharacters#`) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:m("suggest.snippetsPreventQuickSuggestions","Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:m("suggest.showIcons","Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:m("suggest.showStatusBar","Controls the visibility of the status bar at the bottom of the suggest widget.")},"editor.suggest.preview":{type:"boolean",default:e.preview,description:m("suggest.preview","Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:m("suggest.showInlineDetails","Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:m("suggest.maxVisibleSuggestions.dep","This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:m("deprecated","This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.")},"editor.suggest.showMethods":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showMethods","When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showFunctions","When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showConstructors","When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showDeprecated","When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.matchOnWordStartOnly","When enabled IntelliSense filtering requires that the first character matches on a word start. For example, `c` on `Console` or `WebContext` but _not_ on `description`. When disabled IntelliSense will show more results but still sorts them by match quality.")},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showFields","When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showVariables","When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showClasss","When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showStructs","When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showInterfaces","When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showModules","When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showPropertys","When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showEvents","When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showOperators","When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showUnits","When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showValues","When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showConstants","When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showEnums","When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showEnumMembers","When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showKeywords","When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showTexts","When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showColors","When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showFiles","When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showReferences","When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showCustomcolors","When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showFolders","When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showTypeParameters","When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showSnippets","When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showUsers","When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showIssues","When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertMode:Li(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:ve(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:ve(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:ve(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:ve(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:Li(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:ve(t.showIcons,this.defaultValue.showIcons),showStatusBar:ve(t.showStatusBar,this.defaultValue.showStatusBar),preview:ve(t.preview,this.defaultValue.preview),previewMode:Li(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:ve(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:ve(t.showMethods,this.defaultValue.showMethods),showFunctions:ve(t.showFunctions,this.defaultValue.showFunctions),showConstructors:ve(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:ve(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:ve(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:ve(t.showFields,this.defaultValue.showFields),showVariables:ve(t.showVariables,this.defaultValue.showVariables),showClasses:ve(t.showClasses,this.defaultValue.showClasses),showStructs:ve(t.showStructs,this.defaultValue.showStructs),showInterfaces:ve(t.showInterfaces,this.defaultValue.showInterfaces),showModules:ve(t.showModules,this.defaultValue.showModules),showProperties:ve(t.showProperties,this.defaultValue.showProperties),showEvents:ve(t.showEvents,this.defaultValue.showEvents),showOperators:ve(t.showOperators,this.defaultValue.showOperators),showUnits:ve(t.showUnits,this.defaultValue.showUnits),showValues:ve(t.showValues,this.defaultValue.showValues),showConstants:ve(t.showConstants,this.defaultValue.showConstants),showEnums:ve(t.showEnums,this.defaultValue.showEnums),showEnumMembers:ve(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:ve(t.showKeywords,this.defaultValue.showKeywords),showWords:ve(t.showWords,this.defaultValue.showWords),showColors:ve(t.showColors,this.defaultValue.showColors),showFiles:ve(t.showFiles,this.defaultValue.showFiles),showReferences:ve(t.showReferences,this.defaultValue.showReferences),showFolders:ve(t.showFolders,this.defaultValue.showFolders),showTypeParameters:ve(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:ve(t.showSnippets,this.defaultValue.showSnippets),showUsers:ve(t.showUsers,this.defaultValue.showUsers),showIssues:ve(t.showIssues,this.defaultValue.showIssues)}}}class Vfe extends Qt{constructor(){super(112,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:m("selectLeadingAndTrailingWhitespace","Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:m("selectSubwords","Whether subwords (like 'foo' in 'fooBar' or 'foo_bar') should be selected."),default:!0,type:"boolean"}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{selectLeadingAndTrailingWhitespace:ve(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:ve(e.selectSubwords,this.defaultValue.selectSubwords)}}}class zfe extends Qt{constructor(){super(136,"wrappingIndent",1,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[m("wrappingIndent.none","No indentation. Wrapped lines begin at column 1."),m("wrappingIndent.same","Wrapped lines get the same indentation as the parent."),m("wrappingIndent.indent","Wrapped lines get +1 indentation toward the parent."),m("wrappingIndent.deepIndent","Wrapped lines get +2 indentation toward the parent.")],description:m("wrappingIndent","Controls the indentation of wrapped lines."),default:"same"}})}validate(e){switch(e){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}return 1}compute(e,t,i){return t.get(2)===2?0:i}}class Hfe extends H1{constructor(){super(144)}compute(e,t,i){const s=t.get(143);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:s.isWordWrapMinified,isViewportWrapping:s.isViewportWrapping,wrappingColumn:s.wrappingColumn}}}class $fe extends Qt{constructor(){const e={enabled:!0,showDropSelector:"afterDrop"};super(36,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:m("dropIntoEditor.enabled","Controls whether you can drag and drop a file into a text editor by holding down `shift` (instead of opening the file in an editor).")},"editor.dropIntoEditor.showDropSelector":{type:"string",markdownDescription:m("dropIntoEditor.showDropSelector","Controls if a widget is shown when dropping files into the editor. This widget lets you control how the file is dropped."),enum:["afterDrop","never"],enumDescriptions:[m("dropIntoEditor.showDropSelector.afterDrop","Show the drop selector widget after a file is dropped into the editor."),m("dropIntoEditor.showDropSelector.never","Never show the drop selector widget. Instead the default drop provider is always used.")],default:"afterDrop"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:ve(t.enabled,this.defaultValue.enabled),showDropSelector:Li(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}}class Ufe extends Qt{constructor(){const e={enabled:!0,showPasteSelector:"afterPaste"};super(84,"pasteAs",e,{"editor.pasteAs.enabled":{type:"boolean",default:e.enabled,markdownDescription:m("pasteAs.enabled","Controls whether you can paste content in different ways.")},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:m("pasteAs.showPasteSelector","Controls if a widget is shown when pasting content in to the editor. This widget lets you control how the file is pasted."),enum:["afterPaste","never"],enumDescriptions:[m("pasteAs.showPasteSelector.afterPaste","Show the paste selector widget after content is pasted into the editor."),m("pasteAs.showPasteSelector.never","Never show the paste selector widget. Instead the default pasting behavior is always used.")],default:"afterPaste"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:ve(t.enabled,this.defaultValue.enabled),showPasteSelector:Li(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}}const jfe="Consolas, 'Courier New', monospace",qfe="Menlo, Monaco, 'Courier New', monospace",Gfe="'Droid Sans Mono', 'monospace', monospace",Ho={fontFamily:mt?qfe:Jn?Gfe:jfe,fontWeight:"normal",fontSize:mt?12:14,lineHeight:0,letterSpacing:0},Og=[];function Q(n){return Og[n.id]=n,n}const Ff={acceptSuggestionOnCommitCharacter:Q(new st(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:m("acceptSuggestionOnCommitCharacter","Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.")})),acceptSuggestionOnEnter:Q(new oi(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",m("acceptSuggestionOnEnterSmart","Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:m("acceptSuggestionOnEnter","Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),accessibilitySupport:Q(new lfe),accessibilityPageSize:Q(new At(3,"accessibilityPageSize",10,1,1073741824,{description:m("accessibilityPageSize","Controls the number of lines in the editor that can be read out by a screen reader at once. When we detect a screen reader we automatically set the default to be 500. Warning: this has a performance implication for numbers larger than the default."),tags:["accessibility"]})),ariaLabel:Q(new Us(4,"ariaLabel",m("editorViewAccessibleLabel","Editor content"))),ariaRequired:Q(new st(5,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:Q(new st(8,"screenReaderAnnounceInlineSuggestion",!0,{description:m("screenReaderAnnounceInlineSuggestion","Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:Q(new oi(6,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",m("editor.autoClosingBrackets.languageDefined","Use language configurations to determine when to autoclose brackets."),m("editor.autoClosingBrackets.beforeWhitespace","Autoclose brackets only when the cursor is to the left of whitespace."),""],description:m("autoClosingBrackets","Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingComments:Q(new oi(7,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",m("editor.autoClosingComments.languageDefined","Use language configurations to determine when to autoclose comments."),m("editor.autoClosingComments.beforeWhitespace","Autoclose comments only when the cursor is to the left of whitespace."),""],description:m("autoClosingComments","Controls whether the editor should automatically close comments after the user adds an opening comment.")})),autoClosingDelete:Q(new oi(9,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",m("editor.autoClosingDelete.auto","Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:m("autoClosingDelete","Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:Q(new oi(10,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",m("editor.autoClosingOvertype.auto","Type over closing quotes or brackets only if they were automatically inserted."),""],description:m("autoClosingOvertype","Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:Q(new oi(11,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",m("editor.autoClosingQuotes.languageDefined","Use language configurations to determine when to autoclose quotes."),m("editor.autoClosingQuotes.beforeWhitespace","Autoclose quotes only when the cursor is to the left of whitespace."),""],description:m("autoClosingQuotes","Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:Q(new $y(12,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],afe,{enumDescriptions:[m("editor.autoIndent.none","The editor will not insert indentation automatically."),m("editor.autoIndent.keep","The editor will keep the current line's indentation."),m("editor.autoIndent.brackets","The editor will keep the current line's indentation and honor language defined brackets."),m("editor.autoIndent.advanced","The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),m("editor.autoIndent.full","The editor will keep the current line's indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages.")],description:m("autoIndent","Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:Q(new st(13,"automaticLayout",!1)),autoSurround:Q(new oi(14,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[m("editor.autoSurround.languageDefined","Use language configurations to determine when to automatically surround selections."),m("editor.autoSurround.quotes","Surround with quotes but not brackets."),m("editor.autoSurround.brackets","Surround with brackets but not quotes."),""],description:m("autoSurround","Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:Q(new Ffe),bracketPairGuides:Q(new Bfe),stickyTabStops:Q(new st(115,"stickyTabStops",!1,{description:m("stickyTabStops","Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:Q(new st(17,"codeLens",!0,{description:m("codeLens","Controls whether the editor shows CodeLens.")})),codeLensFontFamily:Q(new Us(18,"codeLensFontFamily","",{description:m("codeLensFontFamily","Controls the font family for CodeLens.")})),codeLensFontSize:Q(new At(19,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:m("codeLensFontSize","Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:Q(new st(20,"colorDecorators",!0,{description:m("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:Q(new oi(146,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[m("editor.colorDecoratorActivatedOn.clickAndHover","Make the color picker appear both on click and hover of the color decorator"),m("editor.colorDecoratorActivatedOn.hover","Make the color picker appear on hover of the color decorator"),m("editor.colorDecoratorActivatedOn.click","Make the color picker appear on click of the color decorator")],description:m("colorDecoratorActivatedOn","Controls the condition to make a color picker appear from a color decorator")})),colorDecoratorsLimit:Q(new At(21,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:m("colorDecoratorsLimit","Controls the max number of color decorators that can be rendered in an editor at once.")})),columnSelection:Q(new st(22,"columnSelection",!1,{description:m("columnSelection","Enable that the selection with the mouse and keys is doing column selection.")})),comments:Q(new cfe),contextmenu:Q(new st(24,"contextmenu",!0)),copyWithSyntaxHighlighting:Q(new st(25,"copyWithSyntaxHighlighting",!0,{description:m("copyWithSyntaxHighlighting","Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:Q(new $y(26,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],dfe,{description:m("cursorBlinking","Control the cursor animation style.")})),cursorSmoothCaretAnimation:Q(new oi(27,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[m("cursorSmoothCaretAnimation.off","Smooth caret animation is disabled."),m("cursorSmoothCaretAnimation.explicit","Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),m("cursorSmoothCaretAnimation.on","Smooth caret animation is always enabled.")],description:m("cursorSmoothCaretAnimation","Controls whether the smooth caret animation should be enabled.")})),cursorStyle:Q(new $y(28,"cursorStyle",pn.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],ufe,{description:m("cursorStyle","Controls the cursor style.")})),cursorSurroundingLines:Q(new At(29,"cursorSurroundingLines",0,0,1073741824,{description:m("cursorSurroundingLines","Controls the minimal number of visible leading lines (minimum 0) and trailing lines (minimum 1) surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.")})),cursorSurroundingLinesStyle:Q(new oi(30,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[m("cursorSurroundingLinesStyle.default","`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),m("cursorSurroundingLinesStyle.all","`cursorSurroundingLines` is enforced always.")],markdownDescription:m("cursorSurroundingLinesStyle","Controls when `#cursorSurroundingLines#` should be enforced.")})),cursorWidth:Q(new At(31,"cursorWidth",0,0,1073741824,{markdownDescription:m("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:Q(new st(32,"disableLayerHinting",!1)),disableMonospaceOptimizations:Q(new st(33,"disableMonospaceOptimizations",!1)),domReadOnly:Q(new st(34,"domReadOnly",!1)),dragAndDrop:Q(new st(35,"dragAndDrop",!0,{description:m("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:Q(new ffe),dropIntoEditor:Q(new $fe),stickyScroll:Q(new wfe),experimentalWhitespaceRendering:Q(new oi(38,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[m("experimentalWhitespaceRendering.svg","Use a new rendering method with svgs."),m("experimentalWhitespaceRendering.font","Use a new rendering method with font characters."),m("experimentalWhitespaceRendering.off","Use the stable rendering method.")],description:m("experimentalWhitespaceRendering","Controls whether whitespace is rendered with a new, experimental method.")})),extraEditorClassName:Q(new Us(39,"extraEditorClassName","")),fastScrollSensitivity:Q(new cr(40,"fastScrollSensitivity",5,n=>n<=0?5:n,{markdownDescription:m("fastScrollSensitivity","Scrolling speed multiplier when pressing `Alt`.")})),find:Q(new gfe),fixedOverflowWidgets:Q(new st(42,"fixedOverflowWidgets",!1)),folding:Q(new st(43,"folding",!0,{description:m("folding","Controls whether the editor has code folding enabled.")})),foldingStrategy:Q(new oi(44,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[m("foldingStrategy.auto","Use a language-specific folding strategy if available, else the indentation-based one."),m("foldingStrategy.indentation","Use the indentation-based folding strategy.")],description:m("foldingStrategy","Controls the strategy for computing folding ranges.")})),foldingHighlight:Q(new st(45,"foldingHighlight",!0,{description:m("foldingHighlight","Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:Q(new st(46,"foldingImportsByDefault",!1,{description:m("foldingImportsByDefault","Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:Q(new At(47,"foldingMaximumRegions",5e3,10,65e3,{description:m("foldingMaximumRegions","The maximum number of foldable regions. Increasing this value may result in the editor becoming less responsive when the current source has a large number of foldable regions.")})),unfoldOnClickAfterEndOfLine:Q(new st(48,"unfoldOnClickAfterEndOfLine",!1,{description:m("unfoldOnClickAfterEndOfLine","Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:Q(new Us(49,"fontFamily",Ho.fontFamily,{description:m("fontFamily","Controls the font family.")})),fontInfo:Q(new pfe),fontLigatures2:Q(new Mo),fontSize:Q(new mfe),fontWeight:Q(new Aa),fontVariations:Q(new Qr),formatOnPaste:Q(new st(55,"formatOnPaste",!1,{description:m("formatOnPaste","Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.")})),formatOnType:Q(new st(56,"formatOnType",!1,{description:m("formatOnType","Controls whether the editor should automatically format the line after typing.")})),glyphMargin:Q(new st(57,"glyphMargin",!0,{description:m("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:Q(new _fe),hideCursorInOverviewRuler:Q(new st(59,"hideCursorInOverviewRuler",!1,{description:m("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")})),hover:Q(new bfe),inDiffEditor:Q(new st(61,"inDiffEditor",!1)),letterSpacing:Q(new cr(63,"letterSpacing",Ho.letterSpacing,n=>cr.clamp(n,-5,20),{description:m("letterSpacing","Controls the letter spacing in pixels.")})),lightbulb:Q(new yfe),lineDecorationsWidth:Q(new Sfe),lineHeight:Q(new xfe),lineNumbers:Q(new Tfe),lineNumbersMinChars:Q(new At(68,"lineNumbersMinChars",5,1,300)),linkedEditing:Q(new st(69,"linkedEditing",!1,{description:m("linkedEditing","Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),links:Q(new st(70,"links",!0,{description:m("links","Controls whether the editor should detect links and make them clickable.")})),matchBrackets:Q(new oi(71,"matchBrackets","always",["always","near","never"],{description:m("matchBrackets","Highlight matching brackets.")})),minimap:Q(new Lfe),mouseStyle:Q(new oi(73,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:Q(new cr(74,"mouseWheelScrollSensitivity",1,n=>n===0?1:n,{markdownDescription:m("mouseWheelScrollSensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:Q(new st(75,"mouseWheelZoom",!1,{markdownDescription:m("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:Q(new st(76,"multiCursorMergeOverlapping",!0,{description:m("multiCursorMergeOverlapping","Merge multiple cursors when they are overlapping.")})),multiCursorModifier:Q(new $y(77,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],Dfe,{markdownEnumDescriptions:[m("multiCursorModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),m("multiCursorModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:m({key:"multiCursorModifier",comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},"The modifier to be used to add multiple cursors with the mouse. The Go to Definition and Open Link mouse gestures will adapt such that they do not conflict with the [multicursor modifier](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).")})),multiCursorPaste:Q(new oi(78,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[m("multiCursorPaste.spread","Each cursor pastes a single line of the text."),m("multiCursorPaste.full","Each cursor pastes the full text.")],markdownDescription:m("multiCursorPaste","Controls pasting when the line count of the pasted text matches the cursor count.")})),multiCursorLimit:Q(new At(79,"multiCursorLimit",1e4,1,1e5,{markdownDescription:m("multiCursorLimit","Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:Q(new st(80,"occurrencesHighlight",!0,{description:m("occurrencesHighlight","Controls whether the editor should highlight semantic symbol occurrences.")})),overviewRulerBorder:Q(new st(81,"overviewRulerBorder",!0,{description:m("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:Q(new At(82,"overviewRulerLanes",3,0,3)),padding:Q(new kfe),pasteAs:Q(new Ufe),parameterHints:Q(new Efe),peekWidgetDefaultFocus:Q(new oi(86,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[m("peekWidgetDefaultFocus.tree","Focus the tree when opening peek"),m("peekWidgetDefaultFocus.editor","Focus the editor when opening peek")],description:m("peekWidgetDefaultFocus","Controls whether to focus the inline editor or the tree in the peek widget.")})),definitionLinkOpensInPeek:Q(new st(87,"definitionLinkOpensInPeek",!1,{description:m("definitionLinkOpensInPeek","Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:Q(new Ife),quickSuggestionsDelay:Q(new At(89,"quickSuggestionsDelay",10,0,1073741824,{description:m("quickSuggestionsDelay","Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:Q(new st(90,"readOnly",!1)),readOnlyMessage:Q(new Rfe),renameOnType:Q(new st(92,"renameOnType",!1,{description:m("renameOnType","Controls whether the editor auto renames on type."),markdownDeprecationMessage:m("renameOnTypeDeprecate","Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:Q(new st(93,"renderControlCharacters",!0,{description:m("renderControlCharacters","Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:Q(new oi(94,"renderFinalNewline",Jn?"dimmed":"on",["off","on","dimmed"],{description:m("renderFinalNewline","Render last line number when the file ends with a newline.")})),renderLineHighlight:Q(new oi(95,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",m("renderLineHighlight.all","Highlights both the gutter and the current line.")],description:m("renderLineHighlight","Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:Q(new st(96,"renderLineHighlightOnlyWhenFocus",!1,{description:m("renderLineHighlightOnlyWhenFocus","Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:Q(new oi(97,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:Q(new oi(98,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",m("renderWhitespace.boundary","Render whitespace characters except for single spaces between words."),m("renderWhitespace.selection","Render whitespace characters only on selected text."),m("renderWhitespace.trailing","Render only trailing whitespace characters."),""],description:m("renderWhitespace","Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:Q(new At(99,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:Q(new st(100,"roundedSelection",!0,{description:m("roundedSelection","Controls whether selections should have rounded corners.")})),rulers:Q(new Nfe),scrollbar:Q(new Mfe),scrollBeyondLastColumn:Q(new At(103,"scrollBeyondLastColumn",4,0,1073741824,{description:m("scrollBeyondLastColumn","Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:Q(new st(104,"scrollBeyondLastLine",!0,{description:m("scrollBeyondLastLine","Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:Q(new st(105,"scrollPredominantAxis",!0,{description:m("scrollPredominantAxis","Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.")})),selectionClipboard:Q(new st(106,"selectionClipboard",!0,{description:m("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:Jn})),selectionHighlight:Q(new st(107,"selectionHighlight",!0,{description:m("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:Q(new st(108,"selectOnLineNumbers",!0)),showFoldingControls:Q(new oi(109,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[m("showFoldingControls.always","Always show the folding controls."),m("showFoldingControls.never","Never show the folding controls and reduce the gutter size."),m("showFoldingControls.mouseover","Only show the folding controls when the mouse is over the gutter.")],description:m("showFoldingControls","Controls when the folding controls on the gutter are shown.")})),showUnused:Q(new st(110,"showUnused",!0,{description:m("showUnused","Controls fading out of unused code.")})),showDeprecated:Q(new st(138,"showDeprecated",!0,{description:m("showDeprecated","Controls strikethrough deprecated variables.")})),inlayHints:Q(new Cfe),snippetSuggestions:Q(new oi(111,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[m("snippetSuggestions.top","Show snippet suggestions on top of other suggestions."),m("snippetSuggestions.bottom","Show snippet suggestions below other suggestions."),m("snippetSuggestions.inline","Show snippets suggestions with other suggestions."),m("snippetSuggestions.none","Do not show snippet suggestions.")],description:m("snippetSuggestions","Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:Q(new Vfe),smoothScrolling:Q(new st(113,"smoothScrolling",!1,{description:m("smoothScrolling","Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:Q(new At(116,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:Q(new Wfe),inlineSuggest:Q(new Ofe),inlineCompletionsAccessibilityVerbose:Q(new st(147,"inlineCompletionsAccessibilityVerbose",!1,{description:m("inlineCompletionsAccessibilityVerbose","Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.")})),suggestFontSize:Q(new At(118,"suggestFontSize",0,0,1e3,{markdownDescription:m("suggestFontSize","Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),suggestLineHeight:Q(new At(119,"suggestLineHeight",0,0,1e3,{markdownDescription:m("suggestLineHeight","Line height for the suggest widget. When set to {0}, the value of {1} is used. The minimum value is 8.","`0`","`#editor.lineHeight#`")})),suggestOnTriggerCharacters:Q(new st(120,"suggestOnTriggerCharacters",!0,{description:m("suggestOnTriggerCharacters","Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:Q(new oi(121,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[m("suggestSelection.first","Always select the first suggestion."),m("suggestSelection.recentlyUsed","Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),m("suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:m("suggestSelection","Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:Q(new oi(122,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[m("tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),m("tabCompletion.off","Disable tab completions."),m("tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:m("tabCompletion","Enables tab completions.")})),tabIndex:Q(new At(123,"tabIndex",0,-1,1073741824)),unicodeHighlight:Q(new Pfe),unusualLineTerminators:Q(new oi(125,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[m("unusualLineTerminators.auto","Unusual line terminators are automatically removed."),m("unusualLineTerminators.off","Unusual line terminators are ignored."),m("unusualLineTerminators.prompt","Unusual line terminators prompt to be removed.")],description:m("unusualLineTerminators","Remove unusual line terminators that might cause problems.")})),useShadowDOM:Q(new st(126,"useShadowDOM",!0)),useTabStops:Q(new st(127,"useTabStops",!0,{description:m("useTabStops","Inserting and deleting whitespace follows tab stops.")})),wordBreak:Q(new oi(128,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[m("wordBreak.normal","Use the default line break rule."),m("wordBreak.keepAll","Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.")],description:m("wordBreak","Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),wordSeparators:Q(new Us(129,"wordSeparators",cU,{description:m("wordSeparators","Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:Q(new oi(130,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[m("wordWrap.off","Lines will never wrap."),m("wordWrap.on","Lines will wrap at the viewport width."),m({key:"wordWrap.wordWrapColumn",comment:["- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at `#editor.wordWrapColumn#`."),m({key:"wordWrap.bounded",comment:["- viewport means the edge of the visible window size.","- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:m({key:"wordWrap",comment:["- 'off', 'on', 'wordWrapColumn' and 'bounded' refer to values the setting can take and should not be localized.","- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Controls how lines should wrap.")})),wordWrapBreakAfterCharacters:Q(new Us(131,"wordWrapBreakAfterCharacters"," })]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:Q(new Us(132,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),wordWrapColumn:Q(new At(133,"wordWrapColumn",80,1,1073741824,{markdownDescription:m({key:"wordWrapColumn",comment:["- `editor.wordWrap` refers to a different setting and should not be localized.","- 'wordWrapColumn' and 'bounded' refer to values the different setting can take and should not be localized."]},"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:Q(new oi(134,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:Q(new oi(135,"wordWrapOverride2","inherit",["off","on","inherit"])),editorClassName:Q(new hfe),defaultColorDecorators:Q(new st(145,"defaultColorDecorators",!1,{markdownDescription:m("defaultColorDecorators","Controls whether inline color decorations should be shown using the default document color provider")})),pixelRatio:Q(new Afe),tabFocusMode:Q(new st(142,"tabFocusMode",!1,{markdownDescription:m("tabFocusMode","Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:Q(new up),wrappingInfo:Q(new Hfe),wrappingIndent:Q(new zfe),wrappingStrategy:Q(new vfe)};class Kfe{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?um.isErrorNoTelemetry(e)?new um(e.message+` + - Values greater than or equal to 8 will be used as effective values.`)})}compute(e,t,i){return e.fontInfo.lineHeight}}class jfe extends Xt{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:!1,renderCharacters:!0,maxColumn:120,scale:1};super(72,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:m("minimap.enabled","Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:m("minimap.autohide","Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[m("minimap.size.proportional","The minimap has the same size as the editor contents (and might scroll)."),m("minimap.size.fill","The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),m("minimap.size.fit","The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:m("minimap.size","Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:m("minimap.side","Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:m("minimap.showSlider","Controls when the minimap slider is shown.")},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:m("minimap.scale","Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:m("minimap.renderCharacters","Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:m("minimap.maxColumn","Limit the width of the minimap to render at most a certain number of columns.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:ve(t.enabled,this.defaultValue.enabled),autohide:ve(t.autohide,this.defaultValue.autohide),size:xi(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:xi(t.side,this.defaultValue.side,["right","left"]),showSlider:xi(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:ve(t.renderCharacters,this.defaultValue.renderCharacters),scale:At.clampedInt(t.scale,1,1,3),maxColumn:At.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}function qfe(n){return n==="ctrlCmd"?pt?"metaKey":"ctrlKey":"altKey"}class Gfe extends Xt{constructor(){super(83,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:m("padding.top","Controls the amount of space between the top edge of the editor and the first line.")},"editor.padding.bottom":{type:"number",default:0,minimum:0,maximum:1e3,description:m("padding.bottom","Controls the amount of space between the bottom edge of the editor and the last line.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{top:At.clampedInt(t.top,0,0,1e3),bottom:At.clampedInt(t.bottom,0,0,1e3)}}}class Kfe extends Xt{constructor(){const e={enabled:!0,cycle:!0};super(85,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:m("parameterHints.enabled","Enables a pop-up that shows parameter documentation and type information as you type.")},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:m("parameterHints.cycle","Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:ve(t.enabled,this.defaultValue.enabled),cycle:ve(t.cycle,this.defaultValue.cycle)}}}class Yfe extends U1{constructor(){super(141)}compute(e,t,i){return e.pixelRatio}}class Zfe extends Xt{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[m("on","Quick suggestions show inside the suggest widget"),m("inline","Quick suggestions show as ghost text"),m("off","Quick suggestions are disabled")]}];super(88,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:m("quickSuggestions.strings","Enable quick suggestions inside strings.")},comments:{anyOf:t,default:e.comments,description:m("quickSuggestions.comments","Enable quick suggestions inside comments.")},other:{anyOf:t,default:e.other,description:m("quickSuggestions.other","Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:m("quickSuggestions","Controls whether suggestions should automatically show up while typing. This can be controlled for typing in comments, strings, and other code. Quick suggestion can be configured to show as ghost text or with the suggest widget. Also be aware of the '{0}'-setting which controls if suggestions are triggered by special characters.","#editor.suggestOnTriggerCharacters#")}),this.defaultValue=e}validate(e){if(typeof e=="boolean"){const c=e?"on":"off";return{comments:c,strings:c,other:c}}if(!e||typeof e!="object")return this.defaultValue;const{other:t,comments:i,strings:s}=e,o=["on","inline","off"];let r,a,l;return typeof t=="boolean"?r=t?"on":"off":r=xi(t,this.defaultValue.other,o),typeof i=="boolean"?a=i?"on":"off":a=xi(i,this.defaultValue.comments,o),typeof s=="boolean"?l=s?"on":"off":l=xi(s,this.defaultValue.strings,o),{other:r,comments:a,strings:l}}}class Xfe extends Xt{constructor(){super(67,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[m("lineNumbers.off","Line numbers are not rendered."),m("lineNumbers.on","Line numbers are rendered as absolute number."),m("lineNumbers.relative","Line numbers are rendered as distance in lines to cursor position."),m("lineNumbers.interval","Line numbers are rendered every 10 lines.")],default:"on",description:m("lineNumbers","Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,i=this.defaultValue.renderFn;return typeof e<"u"&&(typeof e=="function"?(t=4,i=e):e==="interval"?t=3:e==="relative"?t=2:e==="on"?t=1:t=0),{renderType:t,renderFn:i}}}function pS(n){const e=n.get(97);return e==="editable"?n.get(90):e!=="on"}class Qfe extends Xt{constructor(){const e=[],t={type:"number",description:m("rulers.size","Number of monospace characters at which this editor ruler will render.")};super(101,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:m("rulers.color","Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:m("rulers","Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.")})}validate(e){if(Array.isArray(e)){const t=[];for(const i of e)if(typeof i=="number")t.push({column:At.clampedInt(i,0,0,1e4),color:null});else if(i&&typeof i=="object"){const s=i;t.push({column:At.clampedInt(s.column,0,0,1e4),color:s.color})}return t.sort((i,s)=>i.column-s.column),t}return this.defaultValue}}class Jfe extends Xt{constructor(){super(91,"readOnlyMessage",void 0)}validate(e){return!e||typeof e!="object"?this.defaultValue:e}}function RF(n,e){if(typeof n!="string")return e;switch(n){case"hidden":return 2;case"visible":return 3;default:return 1}}let ege=class extends Xt{constructor(){const e={vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:12,horizontalSliderSize:12,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,alwaysConsumeMouseWheel:!0,scrollByPage:!1};super(102,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[m("scrollbar.vertical.auto","The vertical scrollbar will be visible only when necessary."),m("scrollbar.vertical.visible","The vertical scrollbar will always be visible."),m("scrollbar.vertical.fit","The vertical scrollbar will always be hidden.")],default:"auto",description:m("scrollbar.vertical","Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[m("scrollbar.horizontal.auto","The horizontal scrollbar will be visible only when necessary."),m("scrollbar.horizontal.visible","The horizontal scrollbar will always be visible."),m("scrollbar.horizontal.fit","The horizontal scrollbar will always be hidden.")],default:"auto",description:m("scrollbar.horizontal","Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:m("scrollbar.verticalScrollbarSize","The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:m("scrollbar.horizontalScrollbarSize","The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:m("scrollbar.scrollByPage","Controls whether clicks scroll by page or jump to click position.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e,i=At.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),s=At.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:At.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:RF(t.vertical,this.defaultValue.vertical),horizontal:RF(t.horizontal,this.defaultValue.horizontal),useShadows:ve(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:ve(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:ve(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:ve(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:ve(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:At.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:s,verticalSliderSize:At.clampedInt(t.verticalSliderSize,s,0,1e3),scrollByPage:ve(t.scrollByPage,this.defaultValue.scrollByPage)}}};const Pr="inUntrustedWorkspace",Uu={allowedCharacters:"editor.unicodeHighlight.allowedCharacters",invisibleCharacters:"editor.unicodeHighlight.invisibleCharacters",nonBasicASCII:"editor.unicodeHighlight.nonBasicASCII",ambiguousCharacters:"editor.unicodeHighlight.ambiguousCharacters",includeComments:"editor.unicodeHighlight.includeComments",includeStrings:"editor.unicodeHighlight.includeStrings",allowedLocales:"editor.unicodeHighlight.allowedLocales"};class tge extends Xt{constructor(){const e={nonBasicASCII:Pr,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:Pr,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(124,"unicodeHighlight",e,{[Uu.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Pr],default:e.nonBasicASCII,description:m("unicodeHighlight.nonBasicASCII","Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.")},[Uu.invisibleCharacters]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:m("unicodeHighlight.invisibleCharacters","Controls whether characters that just reserve space or have no width at all are highlighted.")},[Uu.ambiguousCharacters]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:m("unicodeHighlight.ambiguousCharacters","Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.")},[Uu.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Pr],default:e.includeComments,description:m("unicodeHighlight.includeComments","Controls whether characters in comments should also be subject to Unicode highlighting.")},[Uu.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Pr],default:e.includeStrings,description:m("unicodeHighlight.includeStrings","Controls whether characters in strings should also be subject to Unicode highlighting.")},[Uu.allowedCharacters]:{restricted:!0,type:"object",default:e.allowedCharacters,description:m("unicodeHighlight.allowedCharacters","Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[Uu.allowedLocales]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:m("unicodeHighlight.allowedLocales","Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let i=!1;t.allowedCharacters&&e&&(Co(e.allowedCharacters,t.allowedCharacters)||(e=Object.assign(Object.assign({},e),{allowedCharacters:t.allowedCharacters}),i=!0)),t.allowedLocales&&e&&(Co(e.allowedLocales,t.allowedLocales)||(e=Object.assign(Object.assign({},e),{allowedLocales:t.allowedLocales}),i=!0));const s=super.applyUpdate(e,t);return i?new P_(s.newValue,!0):s}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{nonBasicASCII:gp(t.nonBasicASCII,Pr,[!0,!1,Pr]),invisibleCharacters:ve(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:ve(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:gp(t.includeComments,Pr,[!0,!1,Pr]),includeStrings:gp(t.includeStrings,Pr,[!0,!1,Pr]),allowedCharacters:this.validateBooleanMap(e.allowedCharacters,this.defaultValue.allowedCharacters),allowedLocales:this.validateBooleanMap(e.allowedLocales,this.defaultValue.allowedLocales)}}validateBooleanMap(e,t){if(typeof e!="object"||!e)return t;const i={};for(const[s,o]of Object.entries(e))o===!0&&(i[s]=!0);return i}}class ige extends Xt{constructor(){const e={enabled:!0,mode:"subwordSmart",showToolbar:"onHover",suppressSuggestions:!1,keepOnBlur:!1};super(62,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:m("inlineSuggest.enabled","Controls whether to automatically show inline suggestions in the editor.")},"editor.inlineSuggest.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover"],enumDescriptions:[m("inlineSuggest.showToolbar.always","Show the inline suggestion toolbar whenever an inline suggestion is shown."),m("inlineSuggest.showToolbar.onHover","Show the inline suggestion toolbar when hovering over an inline suggestion.")],description:m("inlineSuggest.showToolbar","Controls when to show the inline suggestion toolbar.")},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:e.suppressSuggestions,description:m("inlineSuggest.suppressSuggestions","Controls how inline suggestions interact with the suggest widget. If enabled, the suggest widget is not shown automatically when inline suggestions are available.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:ve(t.enabled,this.defaultValue.enabled),mode:xi(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:xi(t.showToolbar,this.defaultValue.showToolbar,["always","onHover"]),suppressSuggestions:ve(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:ve(t.keepOnBlur,this.defaultValue.keepOnBlur)}}}class nge extends Xt{constructor(){const e={enabled:En.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:En.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(15,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:m("bracketPairColorization.enabled","Controls whether bracket pair colorization is enabled or not. Use {0} to override the bracket highlight colors.","`#workbench.colorCustomizations#`")},"editor.bracketPairColorization.independentColorPoolPerBracketType":{type:"boolean",default:e.independentColorPoolPerBracketType,description:m("bracketPairColorization.independentColorPoolPerBracketType","Controls whether each bracket type has its own independent color pool.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:ve(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:ve(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}}class sge extends Xt{constructor(){const e={bracketPairs:!1,bracketPairsHorizontal:"active",highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(16,"guides",e,{"editor.guides.bracketPairs":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[m("editor.guides.bracketPairs.true","Enables bracket pair guides."),m("editor.guides.bracketPairs.active","Enables bracket pair guides only for the active bracket pair."),m("editor.guides.bracketPairs.false","Disables bracket pair guides.")],default:e.bracketPairs,description:m("editor.guides.bracketPairs","Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[m("editor.guides.bracketPairsHorizontal.true","Enables horizontal guides as addition to vertical bracket pair guides."),m("editor.guides.bracketPairsHorizontal.active","Enables horizontal guides only for the active bracket pair."),m("editor.guides.bracketPairsHorizontal.false","Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:m("editor.guides.bracketPairsHorizontal","Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:m("editor.guides.highlightActiveBracketPair","Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:m("editor.guides.indentation","Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[m("editor.guides.highlightActiveIndentation.true","Highlights the active indent guide."),m("editor.guides.highlightActiveIndentation.always","Highlights the active indent guide even if bracket guides are highlighted."),m("editor.guides.highlightActiveIndentation.false","Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:m("editor.guides.highlightActiveIndentation","Controls whether the editor should highlight the active indent guide.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{bracketPairs:gp(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:gp(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:ve(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:ve(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:gp(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}function gp(n,e,t){const i=t.indexOf(n);return i===-1?e:t[i]}class oge extends Xt{constructor(){const e={insertMode:"insert",filterGraceful:!0,snippetsPreventQuickSuggestions:!1,localityBonus:!1,shareSuggestSelections:!1,selectionMode:"always",showIcons:!0,showStatusBar:!1,preview:!1,previewMode:"subwordSmart",showInlineDetails:!0,showMethods:!0,showFunctions:!0,showConstructors:!0,showDeprecated:!0,matchOnWordStartOnly:!0,showFields:!0,showVariables:!0,showClasses:!0,showStructs:!0,showInterfaces:!0,showModules:!0,showProperties:!0,showEvents:!0,showOperators:!0,showUnits:!0,showValues:!0,showConstants:!0,showEnums:!0,showEnumMembers:!0,showKeywords:!0,showWords:!0,showColors:!0,showFiles:!0,showReferences:!0,showFolders:!0,showTypeParameters:!0,showSnippets:!0,showUsers:!0,showIssues:!0};super(117,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[m("suggest.insertMode.insert","Insert suggestion without overwriting text right of the cursor."),m("suggest.insertMode.replace","Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:m("suggest.insertMode","Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.")},"editor.suggest.filterGraceful":{type:"boolean",default:e.filterGraceful,description:m("suggest.filterGraceful","Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:m("suggest.localityBonus","Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:m("suggest.shareSuggestSelections","Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")},"editor.suggest.selectionMode":{type:"string",enum:["always","never","whenTriggerCharacter","whenQuickSuggestion"],enumDescriptions:[m("suggest.insertMode.always","Always select a suggestion when automatically triggering IntelliSense."),m("suggest.insertMode.never","Never select a suggestion when automatically triggering IntelliSense."),m("suggest.insertMode.whenTriggerCharacter","Select a suggestion only when triggering IntelliSense from a trigger character."),m("suggest.insertMode.whenQuickSuggestion","Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:m("suggest.selectionMode","Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions (`#editor.quickSuggestions#` and `#editor.suggestOnTriggerCharacters#`) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:m("suggest.snippetsPreventQuickSuggestions","Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:m("suggest.showIcons","Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:m("suggest.showStatusBar","Controls the visibility of the status bar at the bottom of the suggest widget.")},"editor.suggest.preview":{type:"boolean",default:e.preview,description:m("suggest.preview","Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:m("suggest.showInlineDetails","Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:m("suggest.maxVisibleSuggestions.dep","This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:m("deprecated","This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.")},"editor.suggest.showMethods":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showMethods","When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showFunctions","When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showConstructors","When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showDeprecated","When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.matchOnWordStartOnly","When enabled IntelliSense filtering requires that the first character matches on a word start. For example, `c` on `Console` or `WebContext` but _not_ on `description`. When disabled IntelliSense will show more results but still sorts them by match quality.")},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showFields","When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showVariables","When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showClasss","When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showStructs","When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showInterfaces","When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showModules","When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showPropertys","When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showEvents","When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showOperators","When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showUnits","When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showValues","When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showConstants","When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showEnums","When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showEnumMembers","When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showKeywords","When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showTexts","When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showColors","When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showFiles","When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showReferences","When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showCustomcolors","When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showFolders","When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showTypeParameters","When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showSnippets","When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showUsers","When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:m("editor.suggest.showIssues","When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertMode:xi(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:ve(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:ve(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:ve(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:ve(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:xi(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:ve(t.showIcons,this.defaultValue.showIcons),showStatusBar:ve(t.showStatusBar,this.defaultValue.showStatusBar),preview:ve(t.preview,this.defaultValue.preview),previewMode:xi(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:ve(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:ve(t.showMethods,this.defaultValue.showMethods),showFunctions:ve(t.showFunctions,this.defaultValue.showFunctions),showConstructors:ve(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:ve(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:ve(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:ve(t.showFields,this.defaultValue.showFields),showVariables:ve(t.showVariables,this.defaultValue.showVariables),showClasses:ve(t.showClasses,this.defaultValue.showClasses),showStructs:ve(t.showStructs,this.defaultValue.showStructs),showInterfaces:ve(t.showInterfaces,this.defaultValue.showInterfaces),showModules:ve(t.showModules,this.defaultValue.showModules),showProperties:ve(t.showProperties,this.defaultValue.showProperties),showEvents:ve(t.showEvents,this.defaultValue.showEvents),showOperators:ve(t.showOperators,this.defaultValue.showOperators),showUnits:ve(t.showUnits,this.defaultValue.showUnits),showValues:ve(t.showValues,this.defaultValue.showValues),showConstants:ve(t.showConstants,this.defaultValue.showConstants),showEnums:ve(t.showEnums,this.defaultValue.showEnums),showEnumMembers:ve(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:ve(t.showKeywords,this.defaultValue.showKeywords),showWords:ve(t.showWords,this.defaultValue.showWords),showColors:ve(t.showColors,this.defaultValue.showColors),showFiles:ve(t.showFiles,this.defaultValue.showFiles),showReferences:ve(t.showReferences,this.defaultValue.showReferences),showFolders:ve(t.showFolders,this.defaultValue.showFolders),showTypeParameters:ve(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:ve(t.showSnippets,this.defaultValue.showSnippets),showUsers:ve(t.showUsers,this.defaultValue.showUsers),showIssues:ve(t.showIssues,this.defaultValue.showIssues)}}}class rge extends Xt{constructor(){super(112,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:m("selectLeadingAndTrailingWhitespace","Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:m("selectSubwords","Whether subwords (like 'foo' in 'fooBar' or 'foo_bar') should be selected."),default:!0,type:"boolean"}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{selectLeadingAndTrailingWhitespace:ve(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:ve(e.selectSubwords,this.defaultValue.selectSubwords)}}}class age extends Xt{constructor(){super(136,"wrappingIndent",1,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[m("wrappingIndent.none","No indentation. Wrapped lines begin at column 1."),m("wrappingIndent.same","Wrapped lines get the same indentation as the parent."),m("wrappingIndent.indent","Wrapped lines get +1 indentation toward the parent."),m("wrappingIndent.deepIndent","Wrapped lines get +2 indentation toward the parent.")],description:m("wrappingIndent","Controls the indentation of wrapped lines."),default:"same"}})}validate(e){switch(e){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}return 1}compute(e,t,i){return t.get(2)===2?0:i}}class lge extends U1{constructor(){super(144)}compute(e,t,i){const s=t.get(143);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:s.isWordWrapMinified,isViewportWrapping:s.isViewportWrapping,wrappingColumn:s.wrappingColumn}}}class cge extends Xt{constructor(){const e={enabled:!0,showDropSelector:"afterDrop"};super(36,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:m("dropIntoEditor.enabled","Controls whether you can drag and drop a file into a text editor by holding down `shift` (instead of opening the file in an editor).")},"editor.dropIntoEditor.showDropSelector":{type:"string",markdownDescription:m("dropIntoEditor.showDropSelector","Controls if a widget is shown when dropping files into the editor. This widget lets you control how the file is dropped."),enum:["afterDrop","never"],enumDescriptions:[m("dropIntoEditor.showDropSelector.afterDrop","Show the drop selector widget after a file is dropped into the editor."),m("dropIntoEditor.showDropSelector.never","Never show the drop selector widget. Instead the default drop provider is always used.")],default:"afterDrop"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:ve(t.enabled,this.defaultValue.enabled),showDropSelector:xi(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}}class dge extends Xt{constructor(){const e={enabled:!0,showPasteSelector:"afterPaste"};super(84,"pasteAs",e,{"editor.pasteAs.enabled":{type:"boolean",default:e.enabled,markdownDescription:m("pasteAs.enabled","Controls whether you can paste content in different ways.")},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:m("pasteAs.showPasteSelector","Controls if a widget is shown when pasting content in to the editor. This widget lets you control how the file is pasted."),enum:["afterPaste","never"],enumDescriptions:[m("pasteAs.showPasteSelector.afterPaste","Show the paste selector widget after content is pasted into the editor."),m("pasteAs.showPasteSelector.never","Never show the paste selector widget. Instead the default pasting behavior is always used.")],default:"afterPaste"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:ve(t.enabled,this.defaultValue.enabled),showPasteSelector:xi(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}}const uge="Consolas, 'Courier New', monospace",hge="Menlo, Monaco, 'Courier New', monospace",fge="'Droid Sans Mono', 'monospace', monospace",zo={fontFamily:pt?hge:Xn?fge:uge,fontWeight:"normal",fontSize:pt?12:14,lineHeight:0,letterSpacing:0},Bg=[];function Q(n){return Bg[n.id]=n,n}const Vf={acceptSuggestionOnCommitCharacter:Q(new nt(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:m("acceptSuggestionOnCommitCharacter","Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.")})),acceptSuggestionOnEnter:Q(new si(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",m("acceptSuggestionOnEnterSmart","Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:m("acceptSuggestionOnEnter","Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),accessibilitySupport:Q(new Efe),accessibilityPageSize:Q(new At(3,"accessibilityPageSize",10,1,1073741824,{description:m("accessibilityPageSize","Controls the number of lines in the editor that can be read out by a screen reader at once. When we detect a screen reader we automatically set the default to be 500. Warning: this has a performance implication for numbers larger than the default."),tags:["accessibility"]})),ariaLabel:Q(new Hs(4,"ariaLabel",m("editorViewAccessibleLabel","Editor content"))),ariaRequired:Q(new nt(5,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:Q(new nt(8,"screenReaderAnnounceInlineSuggestion",!0,{description:m("screenReaderAnnounceInlineSuggestion","Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:Q(new si(6,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",m("editor.autoClosingBrackets.languageDefined","Use language configurations to determine when to autoclose brackets."),m("editor.autoClosingBrackets.beforeWhitespace","Autoclose brackets only when the cursor is to the left of whitespace."),""],description:m("autoClosingBrackets","Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingComments:Q(new si(7,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",m("editor.autoClosingComments.languageDefined","Use language configurations to determine when to autoclose comments."),m("editor.autoClosingComments.beforeWhitespace","Autoclose comments only when the cursor is to the left of whitespace."),""],description:m("autoClosingComments","Controls whether the editor should automatically close comments after the user adds an opening comment.")})),autoClosingDelete:Q(new si(9,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",m("editor.autoClosingDelete.auto","Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:m("autoClosingDelete","Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:Q(new si(10,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",m("editor.autoClosingOvertype.auto","Type over closing quotes or brackets only if they were automatically inserted."),""],description:m("autoClosingOvertype","Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:Q(new si(11,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",m("editor.autoClosingQuotes.languageDefined","Use language configurations to determine when to autoclose quotes."),m("editor.autoClosingQuotes.beforeWhitespace","Autoclose quotes only when the cursor is to the left of whitespace."),""],description:m("autoClosingQuotes","Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:Q(new Fy(12,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],kfe,{enumDescriptions:[m("editor.autoIndent.none","The editor will not insert indentation automatically."),m("editor.autoIndent.keep","The editor will keep the current line's indentation."),m("editor.autoIndent.brackets","The editor will keep the current line's indentation and honor language defined brackets."),m("editor.autoIndent.advanced","The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),m("editor.autoIndent.full","The editor will keep the current line's indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages.")],description:m("autoIndent","Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:Q(new nt(13,"automaticLayout",!1)),autoSurround:Q(new si(14,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[m("editor.autoSurround.languageDefined","Use language configurations to determine when to automatically surround selections."),m("editor.autoSurround.quotes","Surround with quotes but not brackets."),m("editor.autoSurround.brackets","Surround with brackets but not quotes."),""],description:m("autoSurround","Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:Q(new nge),bracketPairGuides:Q(new sge),stickyTabStops:Q(new nt(115,"stickyTabStops",!1,{description:m("stickyTabStops","Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:Q(new nt(17,"codeLens",!0,{description:m("codeLens","Controls whether the editor shows CodeLens.")})),codeLensFontFamily:Q(new Hs(18,"codeLensFontFamily","",{description:m("codeLensFontFamily","Controls the font family for CodeLens.")})),codeLensFontSize:Q(new At(19,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:m("codeLensFontSize","Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:Q(new nt(20,"colorDecorators",!0,{description:m("colorDecorators","Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:Q(new si(146,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[m("editor.colorDecoratorActivatedOn.clickAndHover","Make the color picker appear both on click and hover of the color decorator"),m("editor.colorDecoratorActivatedOn.hover","Make the color picker appear on hover of the color decorator"),m("editor.colorDecoratorActivatedOn.click","Make the color picker appear on click of the color decorator")],description:m("colorDecoratorActivatedOn","Controls the condition to make a color picker appear from a color decorator")})),colorDecoratorsLimit:Q(new At(21,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:m("colorDecoratorsLimit","Controls the max number of color decorators that can be rendered in an editor at once.")})),columnSelection:Q(new nt(22,"columnSelection",!1,{description:m("columnSelection","Enable that the selection with the mouse and keys is doing column selection.")})),comments:Q(new Afe),contextmenu:Q(new nt(24,"contextmenu",!0)),copyWithSyntaxHighlighting:Q(new nt(25,"copyWithSyntaxHighlighting",!0,{description:m("copyWithSyntaxHighlighting","Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:Q(new Fy(26,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],Ife,{description:m("cursorBlinking","Control the cursor animation style.")})),cursorSmoothCaretAnimation:Q(new si(27,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[m("cursorSmoothCaretAnimation.off","Smooth caret animation is disabled."),m("cursorSmoothCaretAnimation.explicit","Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),m("cursorSmoothCaretAnimation.on","Smooth caret animation is always enabled.")],description:m("cursorSmoothCaretAnimation","Controls whether the smooth caret animation should be enabled.")})),cursorStyle:Q(new Fy(28,"cursorStyle",fn.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],Tfe,{description:m("cursorStyle","Controls the cursor style.")})),cursorSurroundingLines:Q(new At(29,"cursorSurroundingLines",0,0,1073741824,{description:m("cursorSurroundingLines","Controls the minimal number of visible leading lines (minimum 0) and trailing lines (minimum 1) surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.")})),cursorSurroundingLinesStyle:Q(new si(30,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[m("cursorSurroundingLinesStyle.default","`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),m("cursorSurroundingLinesStyle.all","`cursorSurroundingLines` is enforced always.")],markdownDescription:m("cursorSurroundingLinesStyle","Controls when `#cursorSurroundingLines#` should be enforced.")})),cursorWidth:Q(new At(31,"cursorWidth",0,0,1073741824,{markdownDescription:m("cursorWidth","Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:Q(new nt(32,"disableLayerHinting",!1)),disableMonospaceOptimizations:Q(new nt(33,"disableMonospaceOptimizations",!1)),domReadOnly:Q(new nt(34,"domReadOnly",!1)),dragAndDrop:Q(new nt(35,"dragAndDrop",!0,{description:m("dragAndDrop","Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:Q(new Rfe),dropIntoEditor:Q(new cge),stickyScroll:Q(new zfe),experimentalWhitespaceRendering:Q(new si(38,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[m("experimentalWhitespaceRendering.svg","Use a new rendering method with svgs."),m("experimentalWhitespaceRendering.font","Use a new rendering method with font characters."),m("experimentalWhitespaceRendering.off","Use the stable rendering method.")],description:m("experimentalWhitespaceRendering","Controls whether whitespace is rendered with a new, experimental method.")})),extraEditorClassName:Q(new Hs(39,"extraEditorClassName","")),fastScrollSensitivity:Q(new lr(40,"fastScrollSensitivity",5,n=>n<=0?5:n,{markdownDescription:m("fastScrollSensitivity","Scrolling speed multiplier when pressing `Alt`.")})),find:Q(new Mfe),fixedOverflowWidgets:Q(new nt(42,"fixedOverflowWidgets",!1)),folding:Q(new nt(43,"folding",!0,{description:m("folding","Controls whether the editor has code folding enabled.")})),foldingStrategy:Q(new si(44,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[m("foldingStrategy.auto","Use a language-specific folding strategy if available, else the indentation-based one."),m("foldingStrategy.indentation","Use the indentation-based folding strategy.")],description:m("foldingStrategy","Controls the strategy for computing folding ranges.")})),foldingHighlight:Q(new nt(45,"foldingHighlight",!0,{description:m("foldingHighlight","Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:Q(new nt(46,"foldingImportsByDefault",!1,{description:m("foldingImportsByDefault","Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:Q(new At(47,"foldingMaximumRegions",5e3,10,65e3,{description:m("foldingMaximumRegions","The maximum number of foldable regions. Increasing this value may result in the editor becoming less responsive when the current source has a large number of foldable regions.")})),unfoldOnClickAfterEndOfLine:Q(new nt(48,"unfoldOnClickAfterEndOfLine",!1,{description:m("unfoldOnClickAfterEndOfLine","Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:Q(new Hs(49,"fontFamily",zo.fontFamily,{description:m("fontFamily","Controls the font family.")})),fontInfo:Q(new Pfe),fontLigatures2:Q(new To),fontSize:Q(new Ofe),fontWeight:Q(new ka),fontVariations:Q(new Xr),formatOnPaste:Q(new nt(55,"formatOnPaste",!1,{description:m("formatOnPaste","Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.")})),formatOnType:Q(new nt(56,"formatOnType",!1,{description:m("formatOnType","Controls whether the editor should automatically format the line after typing.")})),glyphMargin:Q(new nt(57,"glyphMargin",!0,{description:m("glyphMargin","Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:Q(new Ffe),hideCursorInOverviewRuler:Q(new nt(59,"hideCursorInOverviewRuler",!1,{description:m("hideCursorInOverviewRuler","Controls whether the cursor should be hidden in the overview ruler.")})),hover:Q(new Bfe),inDiffEditor:Q(new nt(61,"inDiffEditor",!1)),letterSpacing:Q(new lr(63,"letterSpacing",zo.letterSpacing,n=>lr.clamp(n,-5,20),{description:m("letterSpacing","Controls the letter spacing in pixels.")})),lightbulb:Q(new Vfe),lineDecorationsWidth:Q(new $fe),lineHeight:Q(new Ufe),lineNumbers:Q(new Xfe),lineNumbersMinChars:Q(new At(68,"lineNumbersMinChars",5,1,300)),linkedEditing:Q(new nt(69,"linkedEditing",!1,{description:m("linkedEditing","Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),links:Q(new nt(70,"links",!0,{description:m("links","Controls whether the editor should detect links and make them clickable.")})),matchBrackets:Q(new si(71,"matchBrackets","always",["always","near","never"],{description:m("matchBrackets","Highlight matching brackets.")})),minimap:Q(new jfe),mouseStyle:Q(new si(73,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:Q(new lr(74,"mouseWheelScrollSensitivity",1,n=>n===0?1:n,{markdownDescription:m("mouseWheelScrollSensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:Q(new nt(75,"mouseWheelZoom",!1,{markdownDescription:m("mouseWheelZoom","Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:Q(new nt(76,"multiCursorMergeOverlapping",!0,{description:m("multiCursorMergeOverlapping","Merge multiple cursors when they are overlapping.")})),multiCursorModifier:Q(new Fy(77,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],qfe,{markdownEnumDescriptions:[m("multiCursorModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),m("multiCursorModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:m({key:"multiCursorModifier",comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},"The modifier to be used to add multiple cursors with the mouse. The Go to Definition and Open Link mouse gestures will adapt such that they do not conflict with the [multicursor modifier](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).")})),multiCursorPaste:Q(new si(78,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[m("multiCursorPaste.spread","Each cursor pastes a single line of the text."),m("multiCursorPaste.full","Each cursor pastes the full text.")],markdownDescription:m("multiCursorPaste","Controls pasting when the line count of the pasted text matches the cursor count.")})),multiCursorLimit:Q(new At(79,"multiCursorLimit",1e4,1,1e5,{markdownDescription:m("multiCursorLimit","Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:Q(new nt(80,"occurrencesHighlight",!0,{description:m("occurrencesHighlight","Controls whether the editor should highlight semantic symbol occurrences.")})),overviewRulerBorder:Q(new nt(81,"overviewRulerBorder",!0,{description:m("overviewRulerBorder","Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:Q(new At(82,"overviewRulerLanes",3,0,3)),padding:Q(new Gfe),pasteAs:Q(new dge),parameterHints:Q(new Kfe),peekWidgetDefaultFocus:Q(new si(86,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[m("peekWidgetDefaultFocus.tree","Focus the tree when opening peek"),m("peekWidgetDefaultFocus.editor","Focus the editor when opening peek")],description:m("peekWidgetDefaultFocus","Controls whether to focus the inline editor or the tree in the peek widget.")})),definitionLinkOpensInPeek:Q(new nt(87,"definitionLinkOpensInPeek",!1,{description:m("definitionLinkOpensInPeek","Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:Q(new Zfe),quickSuggestionsDelay:Q(new At(89,"quickSuggestionsDelay",10,0,1073741824,{description:m("quickSuggestionsDelay","Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:Q(new nt(90,"readOnly",!1)),readOnlyMessage:Q(new Jfe),renameOnType:Q(new nt(92,"renameOnType",!1,{description:m("renameOnType","Controls whether the editor auto renames on type."),markdownDeprecationMessage:m("renameOnTypeDeprecate","Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:Q(new nt(93,"renderControlCharacters",!0,{description:m("renderControlCharacters","Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:Q(new si(94,"renderFinalNewline",Xn?"dimmed":"on",["off","on","dimmed"],{description:m("renderFinalNewline","Render last line number when the file ends with a newline.")})),renderLineHighlight:Q(new si(95,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",m("renderLineHighlight.all","Highlights both the gutter and the current line.")],description:m("renderLineHighlight","Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:Q(new nt(96,"renderLineHighlightOnlyWhenFocus",!1,{description:m("renderLineHighlightOnlyWhenFocus","Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:Q(new si(97,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:Q(new si(98,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",m("renderWhitespace.boundary","Render whitespace characters except for single spaces between words."),m("renderWhitespace.selection","Render whitespace characters only on selected text."),m("renderWhitespace.trailing","Render only trailing whitespace characters."),""],description:m("renderWhitespace","Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:Q(new At(99,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:Q(new nt(100,"roundedSelection",!0,{description:m("roundedSelection","Controls whether selections should have rounded corners.")})),rulers:Q(new Qfe),scrollbar:Q(new ege),scrollBeyondLastColumn:Q(new At(103,"scrollBeyondLastColumn",4,0,1073741824,{description:m("scrollBeyondLastColumn","Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:Q(new nt(104,"scrollBeyondLastLine",!0,{description:m("scrollBeyondLastLine","Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:Q(new nt(105,"scrollPredominantAxis",!0,{description:m("scrollPredominantAxis","Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.")})),selectionClipboard:Q(new nt(106,"selectionClipboard",!0,{description:m("selectionClipboard","Controls whether the Linux primary clipboard should be supported."),included:Xn})),selectionHighlight:Q(new nt(107,"selectionHighlight",!0,{description:m("selectionHighlight","Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:Q(new nt(108,"selectOnLineNumbers",!0)),showFoldingControls:Q(new si(109,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[m("showFoldingControls.always","Always show the folding controls."),m("showFoldingControls.never","Never show the folding controls and reduce the gutter size."),m("showFoldingControls.mouseover","Only show the folding controls when the mouse is over the gutter.")],description:m("showFoldingControls","Controls when the folding controls on the gutter are shown.")})),showUnused:Q(new nt(110,"showUnused",!0,{description:m("showUnused","Controls fading out of unused code.")})),showDeprecated:Q(new nt(138,"showDeprecated",!0,{description:m("showDeprecated","Controls strikethrough deprecated variables.")})),inlayHints:Q(new Hfe),snippetSuggestions:Q(new si(111,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[m("snippetSuggestions.top","Show snippet suggestions on top of other suggestions."),m("snippetSuggestions.bottom","Show snippet suggestions below other suggestions."),m("snippetSuggestions.inline","Show snippets suggestions with other suggestions."),m("snippetSuggestions.none","Do not show snippet suggestions.")],description:m("snippetSuggestions","Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:Q(new rge),smoothScrolling:Q(new nt(113,"smoothScrolling",!1,{description:m("smoothScrolling","Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:Q(new At(116,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:Q(new oge),inlineSuggest:Q(new ige),inlineCompletionsAccessibilityVerbose:Q(new nt(147,"inlineCompletionsAccessibilityVerbose",!1,{description:m("inlineCompletionsAccessibilityVerbose","Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.")})),suggestFontSize:Q(new At(118,"suggestFontSize",0,0,1e3,{markdownDescription:m("suggestFontSize","Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),suggestLineHeight:Q(new At(119,"suggestLineHeight",0,0,1e3,{markdownDescription:m("suggestLineHeight","Line height for the suggest widget. When set to {0}, the value of {1} is used. The minimum value is 8.","`0`","`#editor.lineHeight#`")})),suggestOnTriggerCharacters:Q(new nt(120,"suggestOnTriggerCharacters",!0,{description:m("suggestOnTriggerCharacters","Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:Q(new si(121,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[m("suggestSelection.first","Always select the first suggestion."),m("suggestSelection.recentlyUsed","Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),m("suggestSelection.recentlyUsedByPrefix","Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:m("suggestSelection","Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:Q(new si(122,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[m("tabCompletion.on","Tab complete will insert the best matching suggestion when pressing tab."),m("tabCompletion.off","Disable tab completions."),m("tabCompletion.onlySnippets","Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:m("tabCompletion","Enables tab completions.")})),tabIndex:Q(new At(123,"tabIndex",0,-1,1073741824)),unicodeHighlight:Q(new tge),unusualLineTerminators:Q(new si(125,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[m("unusualLineTerminators.auto","Unusual line terminators are automatically removed."),m("unusualLineTerminators.off","Unusual line terminators are ignored."),m("unusualLineTerminators.prompt","Unusual line terminators prompt to be removed.")],description:m("unusualLineTerminators","Remove unusual line terminators that might cause problems.")})),useShadowDOM:Q(new nt(126,"useShadowDOM",!0)),useTabStops:Q(new nt(127,"useTabStops",!0,{description:m("useTabStops","Inserting and deleting whitespace follows tab stops.")})),wordBreak:Q(new si(128,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[m("wordBreak.normal","Use the default line break rule."),m("wordBreak.keepAll","Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.")],description:m("wordBreak","Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),wordSeparators:Q(new Hs(129,"wordSeparators",lU,{description:m("wordSeparators","Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:Q(new si(130,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[m("wordWrap.off","Lines will never wrap."),m("wordWrap.on","Lines will wrap at the viewport width."),m({key:"wordWrap.wordWrapColumn",comment:["- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at `#editor.wordWrapColumn#`."),m({key:"wordWrap.bounded",comment:["- viewport means the edge of the visible window size.","- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:m({key:"wordWrap",comment:["- 'off', 'on', 'wordWrapColumn' and 'bounded' refer to values the setting can take and should not be localized.","- `editor.wordWrapColumn` refers to a different setting and should not be localized."]},"Controls how lines should wrap.")})),wordWrapBreakAfterCharacters:Q(new Hs(131,"wordWrapBreakAfterCharacters"," })]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),wordWrapBreakBeforeCharacters:Q(new Hs(132,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),wordWrapColumn:Q(new At(133,"wordWrapColumn",80,1,1073741824,{markdownDescription:m({key:"wordWrapColumn",comment:["- `editor.wordWrap` refers to a different setting and should not be localized.","- 'wordWrapColumn' and 'bounded' refer to values the different setting can take and should not be localized."]},"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:Q(new si(134,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:Q(new si(135,"wordWrapOverride2","inherit",["off","on","inherit"])),editorClassName:Q(new Nfe),defaultColorDecorators:Q(new nt(145,"defaultColorDecorators",!1,{markdownDescription:m("defaultColorDecorators","Controls whether inline color decorations should be shown using the default document color provider")})),pixelRatio:Q(new Yfe),tabFocusMode:Q(new nt(142,"tabFocusMode",!1,{markdownDescription:m("tabFocusMode","Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:Q(new fp),wrappingInfo:Q(new lge),wrappingIndent:Q(new age),wrappingStrategy:Q(new Wfe)};class gge{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?gm.isErrorNoTelemetry(e)?new gm(e.message+` `+e.stack):new Error(e.message+` -`+e.stack):e},0)}}emit(e){this.listeners.forEach(t=>{t(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}}const gU=new Kfe;function _t(n){Bf(n)||gU.onUnexpectedError(n)}function wc(n){Bf(n)||gU.onUnexpectedExternalError(n)}function BF(n){if(n instanceof Error){const{name:e,message:t}=n,i=n.stacktrace||n.stack;return{$isError:!0,name:e,message:t,stack:i,noTelemetry:um.isErrorNoTelemetry(n)}}return n}const SS="Canceled";function Bf(n){return n instanceof e0?!0:n instanceof Error&&n.name===SS&&n.message===SS}class e0 extends Error{constructor(){super(SS),this.name=this.message}}function Yfe(){const n=new Error(SS);return n.name=n.message,n}function oc(n){return n?new Error(`Illegal argument: ${n}`):new Error("Illegal argument")}function I4(n){return n?new Error(`Illegal state: ${n}`):new Error("Illegal state")}class Zfe extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class um extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof um)return e;const t=new um;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class Gi extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,Gi.prototype)}}function hm(n){const e=this;let t=!1,i;return function(){return t||(t=!0,i=n.apply(e,arguments)),i}}function Xfe(n){return typeof n.dispose=="function"&&n.dispose.length===0}function Bt(n){if(ht.is(n)){const e=[];for(const t of n)if(t)try{t.dispose()}catch(i){e.push(i)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(n)?[]:n}else if(n)return n.dispose(),n}function br(...n){return Ze(()=>Bt(n))}function Ze(n){return{dispose:hm(()=>{n()})}}class pe{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Bt(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?pe.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}deleteAndLeak(e){e&&this._toDispose.has(e)&&this._toDispose.delete(e)}}pe.DISABLE_DISPOSED_WARNING=!1;class Y{constructor(){this._store=new pe,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}}Y.None=Object.freeze({dispose(){}});class ra{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)===null||t===void 0||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)===null||e===void 0||e.dispose(),this._value=void 0}}class Qfe{constructor(e){this.object=e}dispose(){}}class T4{constructor(){this._store=new Map,this._isDisposed=!1}dispose(){this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{Bt(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,i=!1){var s;this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),i||(s=this._store.get(e))===null||s===void 0||s.dispose(),this._store.set(e,t)}deleteAndDispose(e){var t;(t=this._store.get(e))===null||t===void 0||t.dispose(),this._store.delete(e)}[Symbol.iterator](){return this._store[Symbol.iterator]()}}const Jfe=globalThis.performance&&typeof globalThis.performance.now=="function";class Cu{static create(e){return new Cu(e)}constructor(e){this._now=Jfe&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}}var ue;(function(n){n.None=()=>Y.None;function e(M,R){return u(M,()=>{},0,void 0,!0,void 0,R)}n.defer=e;function t(M){return(R,z=null,G)=>{let te=!1,ae;return ae=M(fe=>{if(!te)return ae?ae.dispose():te=!0,R.call(z,fe)},null,G),te&&ae.dispose(),ae}}n.once=t;function i(M,R,z){return c((G,te=null,ae)=>M(fe=>G.call(te,R(fe)),null,ae),z)}n.map=i;function s(M,R,z){return c((G,te=null,ae)=>M(fe=>{R(fe),G.call(te,fe)},null,ae),z)}n.forEach=s;function o(M,R,z){return c((G,te=null,ae)=>M(fe=>R(fe)&&G.call(te,fe),null,ae),z)}n.filter=o;function r(M){return M}n.signal=r;function a(...M){return(R,z=null,G)=>{const te=br(...M.map(ae=>ae(fe=>R.call(z,fe))));return d(te,G)}}n.any=a;function l(M,R,z,G){let te=z;return i(M,ae=>(te=R(te,ae),te),G)}n.reduce=l;function c(M,R){let z;const G={onWillAddFirstListener(){z=M(te.fire,te)},onDidRemoveLastListener(){z==null||z.dispose()}},te=new B(G);return R==null||R.add(te),te.event}function d(M,R){return R instanceof Array?R.push(M):R&&R.add(M),M}function u(M,R,z=100,G=!1,te=!1,ae,fe){let oe,Se,Ie,me=0,ie;const Xt={leakWarningThreshold:ae,onWillAddFirstListener(){oe=M(Nt=>{me++,Se=R(Se,Nt),G&&!Ie&&(Dt.fire(Se),Se=void 0),ie=()=>{const Ge=Se;Se=void 0,Ie=void 0,(!G||me>1)&&Dt.fire(Ge),me=0},typeof z=="number"?(clearTimeout(Ie),Ie=setTimeout(ie,z)):Ie===void 0&&(Ie=0,queueMicrotask(ie))})},onWillRemoveListener(){te&&me>0&&(ie==null||ie())},onDidRemoveLastListener(){ie=void 0,oe.dispose()}},Dt=new B(Xt);return fe==null||fe.add(Dt),Dt.event}n.debounce=u;function h(M,R=0,z){return n.debounce(M,(G,te)=>G?(G.push(te),G):[te],R,void 0,!0,void 0,z)}n.accumulate=h;function f(M,R=(G,te)=>G===te,z){let G=!0,te;return o(M,ae=>{const fe=G||!R(ae,te);return G=!1,te=ae,fe},z)}n.latch=f;function g(M,R,z){return[n.filter(M,R,z),n.filter(M,G=>!R(G),z)]}n.split=g;function p(M,R=!1,z=[],G){let te=z.slice(),ae=M(Se=>{te?te.push(Se):oe.fire(Se)});G&&G.add(ae);const fe=()=>{te==null||te.forEach(Se=>oe.fire(Se)),te=null},oe=new B({onWillAddFirstListener(){ae||(ae=M(Se=>oe.fire(Se)),G&&G.add(ae))},onDidAddFirstListener(){te&&(R?setTimeout(fe):fe())},onDidRemoveLastListener(){ae&&ae.dispose(),ae=null}});return G&&G.add(oe),oe.event}n.buffer=p;function _(M,R){return(G,te,ae)=>{const fe=R(new b);return M(function(oe){const Se=fe.evaluate(oe);Se!==v&&G.call(te,Se)},void 0,ae)}}n.chain=_;const v=Symbol("HaltChainable");class b{constructor(){this.steps=[]}map(R){return this.steps.push(R),this}forEach(R){return this.steps.push(z=>(R(z),z)),this}filter(R){return this.steps.push(z=>R(z)?z:v),this}reduce(R,z){let G=z;return this.steps.push(te=>(G=R(G,te),G)),this}latch(R=(z,G)=>z===G){let z=!0,G;return this.steps.push(te=>{const ae=z||!R(te,G);return z=!1,G=te,ae?te:v}),this}evaluate(R){for(const z of this.steps)if(R=z(R),R===v)break;return R}}function y(M,R,z=G=>G){const G=(...oe)=>fe.fire(z(...oe)),te=()=>M.on(R,G),ae=()=>M.removeListener(R,G),fe=new B({onWillAddFirstListener:te,onDidRemoveLastListener:ae});return fe.event}n.fromNodeEventEmitter=y;function w(M,R,z=G=>G){const G=(...oe)=>fe.fire(z(...oe)),te=()=>M.addEventListener(R,G),ae=()=>M.removeEventListener(R,G),fe=new B({onWillAddFirstListener:te,onDidRemoveLastListener:ae});return fe.event}n.fromDOMEventEmitter=w;function C(M){return new Promise(R=>t(M)(R))}n.toPromise=C;function L(M){const R=new B;return M.then(z=>{R.fire(z)},()=>{R.fire(void 0)}).finally(()=>{R.dispose()}),R.event}n.fromPromise=L;function x(M,R){return R(void 0),M(z=>R(z))}n.runAndSubscribe=x;function D(M,R){let z=null;function G(ae){z==null||z.dispose(),z=new pe,R(ae,z)}G(void 0);const te=M(ae=>G(ae));return Ze(()=>{te.dispose(),z==null||z.dispose()})}n.runAndSubscribeWithStore=D;class k{constructor(R,z){this._observable=R,this._counter=0,this._hasChanged=!1;const G={onWillAddFirstListener:()=>{R.addObserver(this)},onDidRemoveLastListener:()=>{R.removeObserver(this)}};this.emitter=new B(G),z&&z.add(this.emitter)}beginUpdate(R){this._counter++}handlePossibleChange(R){}handleChange(R,z){this._hasChanged=!0}endUpdate(R){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function P(M,R){return new k(M,R).emitter.event}n.fromObservable=P;function O(M){return R=>{let z=0,G=!1;const te={beginUpdate(){z++},endUpdate(){z--,z===0&&(M.reportChanges(),G&&(G=!1,R()))},handlePossibleChange(){},handleChange(){G=!0}};return M.addObserver(te),M.reportChanges(),{dispose(){M.removeObserver(te)}}}}n.fromObservableLight=O})(ue||(ue={}));class fm{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${fm._idPool++}`,fm.all.add(this)}start(e){this._stopWatch=new Cu,this.listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}}fm.all=new Set;fm._idPool=0;let ege=-1;class tge{constructor(e,t=Math.random().toString(18).slice(2,5)){this.threshold=e,this.name=t,this._warnCountdown=0}dispose(){var e;(e=this._stacks)===null||e===void 0||e.clear()}check(e,t){const i=this.threshold;if(i<=0||t{const o=this._stacks.get(e.value)||0;this._stacks.set(e.value,o-1)}}}class N4{static create(){var e;return new N4((e=new Error().stack)!==null&&e!==void 0?e:"")}constructor(e){this.value=e}print(){console.warn(this.value.split(` +`+e.stack):e},0)}}emit(e){this.listeners.forEach(t=>{t(e)})}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}}const fU=new gge;function mt(n){zf(n)||fU.onUnexpectedError(n)}function wc(n){zf(n)||fU.onUnexpectedExternalError(n)}function MF(n){if(n instanceof Error){const{name:e,message:t}=n,i=n.stacktrace||n.stack;return{$isError:!0,name:e,message:t,stack:i,noTelemetry:gm.isErrorNoTelemetry(n)}}return n}const mS="Canceled";function zf(n){return n instanceof s0?!0:n instanceof Error&&n.name===mS&&n.message===mS}class s0 extends Error{constructor(){super(mS),this.name=this.message}}function pge(){const n=new Error(mS);return n.name=n.message,n}function rc(n){return n?new Error(`Illegal argument: ${n}`):new Error("Illegal argument")}function E4(n){return n?new Error(`Illegal state: ${n}`):new Error("Illegal state")}class mge extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class gm extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof gm)return e;const t=new gm;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}}class qi extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,qi.prototype)}}function pm(n){const e=this;let t=!1,i;return function(){return t||(t=!0,i=n.apply(e,arguments)),i}}function _ge(n){return typeof n.dispose=="function"&&n.dispose.length===0}function Ft(n){if(ut.is(n)){const e=[];for(const t of n)if(t)try{t.dispose()}catch(i){e.push(i)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(n)?[]:n}else if(n)return n.dispose(),n}function _r(...n){return Ye(()=>Ft(n))}function Ye(n){return{dispose:pm(()=>{n()})}}class pe{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Ft(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?pe.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}deleteAndLeak(e){e&&this._toDispose.has(e)&&this._toDispose.delete(e)}}pe.DISABLE_DISPOSED_WARNING=!1;class Y{constructor(){this._store=new pe,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}}Y.None=Object.freeze({dispose(){}});class sa{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)===null||t===void 0||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)===null||e===void 0||e.dispose(),this._value=void 0}}class bge{constructor(e){this.object=e}dispose(){}}class A4{constructor(){this._store=new Map,this._isDisposed=!1}dispose(){this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{Ft(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,i=!1){var s;this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),i||(s=this._store.get(e))===null||s===void 0||s.dispose(),this._store.set(e,t)}deleteAndDispose(e){var t;(t=this._store.get(e))===null||t===void 0||t.dispose(),this._store.delete(e)}[Symbol.iterator](){return this._store[Symbol.iterator]()}}const vge=globalThis.performance&&typeof globalThis.performance.now=="function";class Su{static create(e){return new Su(e)}constructor(e){this._now=vge&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}}var ue;(function(n){n.None=()=>Y.None;function e(M,R){return u(M,()=>{},0,void 0,!0,void 0,R)}n.defer=e;function t(M){return(R,z=null,G)=>{let te=!1,ae;return ae=M(fe=>{if(!te)return ae?ae.dispose():te=!0,R.call(z,fe)},null,G),te&&ae.dispose(),ae}}n.once=t;function i(M,R,z){return c((G,te=null,ae)=>M(fe=>G.call(te,R(fe)),null,ae),z)}n.map=i;function s(M,R,z){return c((G,te=null,ae)=>M(fe=>{R(fe),G.call(te,fe)},null,ae),z)}n.forEach=s;function o(M,R,z){return c((G,te=null,ae)=>M(fe=>R(fe)&&G.call(te,fe),null,ae),z)}n.filter=o;function r(M){return M}n.signal=r;function a(...M){return(R,z=null,G)=>{const te=_r(...M.map(ae=>ae(fe=>R.call(z,fe))));return d(te,G)}}n.any=a;function l(M,R,z,G){let te=z;return i(M,ae=>(te=R(te,ae),te),G)}n.reduce=l;function c(M,R){let z;const G={onWillAddFirstListener(){z=M(te.fire,te)},onDidRemoveLastListener(){z==null||z.dispose()}},te=new B(G);return R==null||R.add(te),te.event}function d(M,R){return R instanceof Array?R.push(M):R&&R.add(M),M}function u(M,R,z=100,G=!1,te=!1,ae,fe){let oe,Se,Ie,me=0,ie;const Zt={leakWarningThreshold:ae,onWillAddFirstListener(){oe=M(Tt=>{me++,Se=R(Se,Tt),G&&!Ie&&(Dt.fire(Se),Se=void 0),ie=()=>{const qe=Se;Se=void 0,Ie=void 0,(!G||me>1)&&Dt.fire(qe),me=0},typeof z=="number"?(clearTimeout(Ie),Ie=setTimeout(ie,z)):Ie===void 0&&(Ie=0,queueMicrotask(ie))})},onWillRemoveListener(){te&&me>0&&(ie==null||ie())},onDidRemoveLastListener(){ie=void 0,oe.dispose()}},Dt=new B(Zt);return fe==null||fe.add(Dt),Dt.event}n.debounce=u;function h(M,R=0,z){return n.debounce(M,(G,te)=>G?(G.push(te),G):[te],R,void 0,!0,void 0,z)}n.accumulate=h;function f(M,R=(G,te)=>G===te,z){let G=!0,te;return o(M,ae=>{const fe=G||!R(ae,te);return G=!1,te=ae,fe},z)}n.latch=f;function g(M,R,z){return[n.filter(M,R,z),n.filter(M,G=>!R(G),z)]}n.split=g;function p(M,R=!1,z=[],G){let te=z.slice(),ae=M(Se=>{te?te.push(Se):oe.fire(Se)});G&&G.add(ae);const fe=()=>{te==null||te.forEach(Se=>oe.fire(Se)),te=null},oe=new B({onWillAddFirstListener(){ae||(ae=M(Se=>oe.fire(Se)),G&&G.add(ae))},onDidAddFirstListener(){te&&(R?setTimeout(fe):fe())},onDidRemoveLastListener(){ae&&ae.dispose(),ae=null}});return G&&G.add(oe),oe.event}n.buffer=p;function _(M,R){return(G,te,ae)=>{const fe=R(new b);return M(function(oe){const Se=fe.evaluate(oe);Se!==v&&G.call(te,Se)},void 0,ae)}}n.chain=_;const v=Symbol("HaltChainable");class b{constructor(){this.steps=[]}map(R){return this.steps.push(R),this}forEach(R){return this.steps.push(z=>(R(z),z)),this}filter(R){return this.steps.push(z=>R(z)?z:v),this}reduce(R,z){let G=z;return this.steps.push(te=>(G=R(G,te),G)),this}latch(R=(z,G)=>z===G){let z=!0,G;return this.steps.push(te=>{const ae=z||!R(te,G);return z=!1,G=te,ae?te:v}),this}evaluate(R){for(const z of this.steps)if(R=z(R),R===v)break;return R}}function y(M,R,z=G=>G){const G=(...oe)=>fe.fire(z(...oe)),te=()=>M.on(R,G),ae=()=>M.removeListener(R,G),fe=new B({onWillAddFirstListener:te,onDidRemoveLastListener:ae});return fe.event}n.fromNodeEventEmitter=y;function w(M,R,z=G=>G){const G=(...oe)=>fe.fire(z(...oe)),te=()=>M.addEventListener(R,G),ae=()=>M.removeEventListener(R,G),fe=new B({onWillAddFirstListener:te,onDidRemoveLastListener:ae});return fe.event}n.fromDOMEventEmitter=w;function S(M){return new Promise(R=>t(M)(R))}n.toPromise=S;function L(M){const R=new B;return M.then(z=>{R.fire(z)},()=>{R.fire(void 0)}).finally(()=>{R.dispose()}),R.event}n.fromPromise=L;function x(M,R){return R(void 0),M(z=>R(z))}n.runAndSubscribe=x;function D(M,R){let z=null;function G(ae){z==null||z.dispose(),z=new pe,R(ae,z)}G(void 0);const te=M(ae=>G(ae));return Ye(()=>{te.dispose(),z==null||z.dispose()})}n.runAndSubscribeWithStore=D;class k{constructor(R,z){this._observable=R,this._counter=0,this._hasChanged=!1;const G={onWillAddFirstListener:()=>{R.addObserver(this)},onDidRemoveLastListener:()=>{R.removeObserver(this)}};this.emitter=new B(G),z&&z.add(this.emitter)}beginUpdate(R){this._counter++}handlePossibleChange(R){}handleChange(R,z){this._hasChanged=!0}endUpdate(R){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function P(M,R){return new k(M,R).emitter.event}n.fromObservable=P;function O(M){return R=>{let z=0,G=!1;const te={beginUpdate(){z++},endUpdate(){z--,z===0&&(M.reportChanges(),G&&(G=!1,R()))},handlePossibleChange(){},handleChange(){G=!0}};return M.addObserver(te),M.reportChanges(),{dispose(){M.removeObserver(te)}}}}n.fromObservableLight=O})(ue||(ue={}));class mm{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${mm._idPool++}`,mm.all.add(this)}start(e){this._stopWatch=new Su,this.listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}}mm.all=new Set;mm._idPool=0;let yge=-1;class wge{constructor(e,t=Math.random().toString(18).slice(2,5)){this.threshold=e,this.name=t,this._warnCountdown=0}dispose(){var e;(e=this._stacks)===null||e===void 0||e.clear()}check(e,t){const i=this.threshold;if(i<=0||t{const o=this._stacks.get(e.value)||0;this._stacks.set(e.value,o-1)}}}class I4{static create(){var e;return new I4((e=new Error().stack)!==null&&e!==void 0?e:"")}constructor(e){this.value=e}print(){console.warn(this.value.split(` `).slice(2).join(` -`))}}class Qk{constructor(e){this.value=e}}const ige=2;let B=class{constructor(e){var t,i,s,o,r;this._size=0,this._options=e,this._leakageMon=!((t=this._options)===null||t===void 0)&&t.leakWarningThreshold?new tge((s=(i=this._options)===null||i===void 0?void 0:i.leakWarningThreshold)!==null&&s!==void 0?s:ege):void 0,this._perfMon=!((o=this._options)===null||o===void 0)&&o._profName?new fm(this._options._profName):void 0,this._deliveryQueue=(r=this._options)===null||r===void 0?void 0:r.deliveryQueue}dispose(){var e,t,i,s;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)===null||e===void 0?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(i=(t=this._options)===null||t===void 0?void 0:t.onDidRemoveLastListener)===null||i===void 0||i.call(t),(s=this._leakageMon)===null||s===void 0||s.dispose())}get event(){var e;return(e=this._event)!==null&&e!==void 0||(this._event=(t,i,s)=>{var o,r,a,l,c;if(this._leakageMon&&this._size>this._leakageMon.threshold*3)return console.warn(`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far`),Y.None;if(this._disposed)return Y.None;i&&(t=t.bind(i));const d=new Qk(t);let u;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(d.stack=N4.create(),u=this._leakageMon.check(d.stack,this._size+1)),this._listeners?this._listeners instanceof Qk?((c=this._deliveryQueue)!==null&&c!==void 0||(this._deliveryQueue=new pU),this._listeners=[this._listeners,d]):this._listeners.push(d):((r=(o=this._options)===null||o===void 0?void 0:o.onWillAddFirstListener)===null||r===void 0||r.call(o,this),this._listeners=d,(l=(a=this._options)===null||a===void 0?void 0:a.onDidAddFirstListener)===null||l===void 0||l.call(a,this)),this._size++;const h=Ze(()=>{u==null||u(),this._removeListener(d)});return s instanceof pe?s.add(h):Array.isArray(s)&&s.push(h),h}),this._event}_removeListener(e){var t,i,s,o;if((i=(t=this._options)===null||t===void 0?void 0:t.onWillRemoveListener)===null||i===void 0||i.call(t,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(o=(s=this._options)===null||s===void 0?void 0:s.onDidRemoveLastListener)===null||o===void 0||o.call(s,this),this._size=0;return}const r=this._listeners,a=r.indexOf(e);if(a===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,r[a]=void 0;const l=this._deliveryQueue.current===this;if(this._size*ige<=r.length){let c=0;for(let d=0;d0}};const nge=()=>new pU;class pU{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}class Ob extends B{constructor(e){super(e),this._isPaused=0,this._eventQueue=new ks,this._mergeFn=e==null?void 0:e.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){const e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(this._isPaused!==0?this._eventQueue.push(e):super.fire(e))}}class mU extends Ob{constructor(e){var t;super(e),this._delay=(t=e.delay)!==null&&t!==void 0?t:100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}}class sge extends B{constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e==null?void 0:e.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),this._queuedEvents.length===1&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(t=>super.fire(t)),this._queuedEvents=[]}))}}class oge{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new B({onWillAddFirstListener:()=>this.onFirstListenerAdd(),onDidRemoveLastListener:()=>this.onLastListenerRemove()})}get event(){return this.emitter.event}add(e){const t={event:e,listener:null};return this.events.push(t),this.hasListeners&&this.hook(t),Ze(hm(()=>{this.hasListeners&&this.unhook(t);const s=this.events.indexOf(t);this.events.splice(s,1)}))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(e=>this.hook(e))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(e=>this.unhook(e))}hook(e){e.listener=e.event(t=>this.emitter.fire(t))}unhook(e){e.listener&&e.listener.dispose(),e.listener=null}dispose(){this.emitter.dispose()}}class R4{constructor(){this.buffers=[]}wrapEvent(e){return(t,i,s)=>e(o=>{const r=this.buffers[this.buffers.length-1];r?r.push(()=>t.call(i,o)):t.call(i,o)},void 0,s)}bufferEvents(e){const t=[];this.buffers.push(t);const i=e();return this.buffers.pop(),t.forEach(s=>s()),i}}class WF{constructor(){this.listening=!1,this.inputEvent=ue.None,this.inputEventListener=Y.None,this.emitter=new B({onDidAddFirstListener:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onDidRemoveLastListener:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}const _U=Object.freeze(function(n,e){const t=setTimeout(n.bind(e),0);return{dispose(){clearTimeout(t)}}});var ln;(function(n){function e(t){return t===n.None||t===n.Cancelled||t instanceof dC?!0:!t||typeof t!="object"?!1:typeof t.isCancellationRequested=="boolean"&&typeof t.onCancellationRequested=="function"}n.isCancellationToken=e,n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:ue.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:_U})})(ln||(ln={}));class dC{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?_U:(this._emitter||(this._emitter=new B),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}let Ir=class{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new dC),this._token}cancel(){this._token?this._token instanceof dC&&this._token.cancel():this._token=ln.Cancelled}dispose(e=!1){var t;e&&this.cancel(),(t=this._parentListener)===null||t===void 0||t.dispose(),this._token?this._token instanceof dC&&this._token.dispose():this._token=ln.None}};class M4{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}}const uC=new M4,oI=new M4,rI=new M4,bU=new Array(230),rge=Object.create(null),age=Object.create(null),P4=[];for(let n=0;n<=193;n++)P4[n]=-1;(function(){const n="",e=[[1,0,"None",0,"unknown",0,"VK_UNKNOWN",n,n],[1,1,"Hyper",0,n,0,n,n,n],[1,2,"Super",0,n,0,n,n,n],[1,3,"Fn",0,n,0,n,n,n],[1,4,"FnLock",0,n,0,n,n,n],[1,5,"Suspend",0,n,0,n,n,n],[1,6,"Resume",0,n,0,n,n,n],[1,7,"Turbo",0,n,0,n,n,n],[1,8,"Sleep",0,n,0,"VK_SLEEP",n,n],[1,9,"WakeUp",0,n,0,n,n,n],[0,10,"KeyA",31,"A",65,"VK_A",n,n],[0,11,"KeyB",32,"B",66,"VK_B",n,n],[0,12,"KeyC",33,"C",67,"VK_C",n,n],[0,13,"KeyD",34,"D",68,"VK_D",n,n],[0,14,"KeyE",35,"E",69,"VK_E",n,n],[0,15,"KeyF",36,"F",70,"VK_F",n,n],[0,16,"KeyG",37,"G",71,"VK_G",n,n],[0,17,"KeyH",38,"H",72,"VK_H",n,n],[0,18,"KeyI",39,"I",73,"VK_I",n,n],[0,19,"KeyJ",40,"J",74,"VK_J",n,n],[0,20,"KeyK",41,"K",75,"VK_K",n,n],[0,21,"KeyL",42,"L",76,"VK_L",n,n],[0,22,"KeyM",43,"M",77,"VK_M",n,n],[0,23,"KeyN",44,"N",78,"VK_N",n,n],[0,24,"KeyO",45,"O",79,"VK_O",n,n],[0,25,"KeyP",46,"P",80,"VK_P",n,n],[0,26,"KeyQ",47,"Q",81,"VK_Q",n,n],[0,27,"KeyR",48,"R",82,"VK_R",n,n],[0,28,"KeyS",49,"S",83,"VK_S",n,n],[0,29,"KeyT",50,"T",84,"VK_T",n,n],[0,30,"KeyU",51,"U",85,"VK_U",n,n],[0,31,"KeyV",52,"V",86,"VK_V",n,n],[0,32,"KeyW",53,"W",87,"VK_W",n,n],[0,33,"KeyX",54,"X",88,"VK_X",n,n],[0,34,"KeyY",55,"Y",89,"VK_Y",n,n],[0,35,"KeyZ",56,"Z",90,"VK_Z",n,n],[0,36,"Digit1",22,"1",49,"VK_1",n,n],[0,37,"Digit2",23,"2",50,"VK_2",n,n],[0,38,"Digit3",24,"3",51,"VK_3",n,n],[0,39,"Digit4",25,"4",52,"VK_4",n,n],[0,40,"Digit5",26,"5",53,"VK_5",n,n],[0,41,"Digit6",27,"6",54,"VK_6",n,n],[0,42,"Digit7",28,"7",55,"VK_7",n,n],[0,43,"Digit8",29,"8",56,"VK_8",n,n],[0,44,"Digit9",30,"9",57,"VK_9",n,n],[0,45,"Digit0",21,"0",48,"VK_0",n,n],[1,46,"Enter",3,"Enter",13,"VK_RETURN",n,n],[1,47,"Escape",9,"Escape",27,"VK_ESCAPE",n,n],[1,48,"Backspace",1,"Backspace",8,"VK_BACK",n,n],[1,49,"Tab",2,"Tab",9,"VK_TAB",n,n],[1,50,"Space",10,"Space",32,"VK_SPACE",n,n],[0,51,"Minus",88,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[0,52,"Equal",86,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[0,53,"BracketLeft",92,"[",219,"VK_OEM_4","[","OEM_4"],[0,54,"BracketRight",94,"]",221,"VK_OEM_6","]","OEM_6"],[0,55,"Backslash",93,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,56,"IntlHash",0,n,0,n,n,n],[0,57,"Semicolon",85,";",186,"VK_OEM_1",";","OEM_1"],[0,58,"Quote",95,"'",222,"VK_OEM_7","'","OEM_7"],[0,59,"Backquote",91,"`",192,"VK_OEM_3","`","OEM_3"],[0,60,"Comma",87,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[0,61,"Period",89,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[0,62,"Slash",90,"/",191,"VK_OEM_2","/","OEM_2"],[1,63,"CapsLock",8,"CapsLock",20,"VK_CAPITAL",n,n],[1,64,"F1",59,"F1",112,"VK_F1",n,n],[1,65,"F2",60,"F2",113,"VK_F2",n,n],[1,66,"F3",61,"F3",114,"VK_F3",n,n],[1,67,"F4",62,"F4",115,"VK_F4",n,n],[1,68,"F5",63,"F5",116,"VK_F5",n,n],[1,69,"F6",64,"F6",117,"VK_F6",n,n],[1,70,"F7",65,"F7",118,"VK_F7",n,n],[1,71,"F8",66,"F8",119,"VK_F8",n,n],[1,72,"F9",67,"F9",120,"VK_F9",n,n],[1,73,"F10",68,"F10",121,"VK_F10",n,n],[1,74,"F11",69,"F11",122,"VK_F11",n,n],[1,75,"F12",70,"F12",123,"VK_F12",n,n],[1,76,"PrintScreen",0,n,0,n,n,n],[1,77,"ScrollLock",84,"ScrollLock",145,"VK_SCROLL",n,n],[1,78,"Pause",7,"PauseBreak",19,"VK_PAUSE",n,n],[1,79,"Insert",19,"Insert",45,"VK_INSERT",n,n],[1,80,"Home",14,"Home",36,"VK_HOME",n,n],[1,81,"PageUp",11,"PageUp",33,"VK_PRIOR",n,n],[1,82,"Delete",20,"Delete",46,"VK_DELETE",n,n],[1,83,"End",13,"End",35,"VK_END",n,n],[1,84,"PageDown",12,"PageDown",34,"VK_NEXT",n,n],[1,85,"ArrowRight",17,"RightArrow",39,"VK_RIGHT","Right",n],[1,86,"ArrowLeft",15,"LeftArrow",37,"VK_LEFT","Left",n],[1,87,"ArrowDown",18,"DownArrow",40,"VK_DOWN","Down",n],[1,88,"ArrowUp",16,"UpArrow",38,"VK_UP","Up",n],[1,89,"NumLock",83,"NumLock",144,"VK_NUMLOCK",n,n],[1,90,"NumpadDivide",113,"NumPad_Divide",111,"VK_DIVIDE",n,n],[1,91,"NumpadMultiply",108,"NumPad_Multiply",106,"VK_MULTIPLY",n,n],[1,92,"NumpadSubtract",111,"NumPad_Subtract",109,"VK_SUBTRACT",n,n],[1,93,"NumpadAdd",109,"NumPad_Add",107,"VK_ADD",n,n],[1,94,"NumpadEnter",3,n,0,n,n,n],[1,95,"Numpad1",99,"NumPad1",97,"VK_NUMPAD1",n,n],[1,96,"Numpad2",100,"NumPad2",98,"VK_NUMPAD2",n,n],[1,97,"Numpad3",101,"NumPad3",99,"VK_NUMPAD3",n,n],[1,98,"Numpad4",102,"NumPad4",100,"VK_NUMPAD4",n,n],[1,99,"Numpad5",103,"NumPad5",101,"VK_NUMPAD5",n,n],[1,100,"Numpad6",104,"NumPad6",102,"VK_NUMPAD6",n,n],[1,101,"Numpad7",105,"NumPad7",103,"VK_NUMPAD7",n,n],[1,102,"Numpad8",106,"NumPad8",104,"VK_NUMPAD8",n,n],[1,103,"Numpad9",107,"NumPad9",105,"VK_NUMPAD9",n,n],[1,104,"Numpad0",98,"NumPad0",96,"VK_NUMPAD0",n,n],[1,105,"NumpadDecimal",112,"NumPad_Decimal",110,"VK_DECIMAL",n,n],[0,106,"IntlBackslash",97,"OEM_102",226,"VK_OEM_102",n,n],[1,107,"ContextMenu",58,"ContextMenu",93,n,n,n],[1,108,"Power",0,n,0,n,n,n],[1,109,"NumpadEqual",0,n,0,n,n,n],[1,110,"F13",71,"F13",124,"VK_F13",n,n],[1,111,"F14",72,"F14",125,"VK_F14",n,n],[1,112,"F15",73,"F15",126,"VK_F15",n,n],[1,113,"F16",74,"F16",127,"VK_F16",n,n],[1,114,"F17",75,"F17",128,"VK_F17",n,n],[1,115,"F18",76,"F18",129,"VK_F18",n,n],[1,116,"F19",77,"F19",130,"VK_F19",n,n],[1,117,"F20",78,"F20",131,"VK_F20",n,n],[1,118,"F21",79,"F21",132,"VK_F21",n,n],[1,119,"F22",80,"F22",133,"VK_F22",n,n],[1,120,"F23",81,"F23",134,"VK_F23",n,n],[1,121,"F24",82,"F24",135,"VK_F24",n,n],[1,122,"Open",0,n,0,n,n,n],[1,123,"Help",0,n,0,n,n,n],[1,124,"Select",0,n,0,n,n,n],[1,125,"Again",0,n,0,n,n,n],[1,126,"Undo",0,n,0,n,n,n],[1,127,"Cut",0,n,0,n,n,n],[1,128,"Copy",0,n,0,n,n,n],[1,129,"Paste",0,n,0,n,n,n],[1,130,"Find",0,n,0,n,n,n],[1,131,"AudioVolumeMute",117,"AudioVolumeMute",173,"VK_VOLUME_MUTE",n,n],[1,132,"AudioVolumeUp",118,"AudioVolumeUp",175,"VK_VOLUME_UP",n,n],[1,133,"AudioVolumeDown",119,"AudioVolumeDown",174,"VK_VOLUME_DOWN",n,n],[1,134,"NumpadComma",110,"NumPad_Separator",108,"VK_SEPARATOR",n,n],[0,135,"IntlRo",115,"ABNT_C1",193,"VK_ABNT_C1",n,n],[1,136,"KanaMode",0,n,0,n,n,n],[0,137,"IntlYen",0,n,0,n,n,n],[1,138,"Convert",0,n,0,n,n,n],[1,139,"NonConvert",0,n,0,n,n,n],[1,140,"Lang1",0,n,0,n,n,n],[1,141,"Lang2",0,n,0,n,n,n],[1,142,"Lang3",0,n,0,n,n,n],[1,143,"Lang4",0,n,0,n,n,n],[1,144,"Lang5",0,n,0,n,n,n],[1,145,"Abort",0,n,0,n,n,n],[1,146,"Props",0,n,0,n,n,n],[1,147,"NumpadParenLeft",0,n,0,n,n,n],[1,148,"NumpadParenRight",0,n,0,n,n,n],[1,149,"NumpadBackspace",0,n,0,n,n,n],[1,150,"NumpadMemoryStore",0,n,0,n,n,n],[1,151,"NumpadMemoryRecall",0,n,0,n,n,n],[1,152,"NumpadMemoryClear",0,n,0,n,n,n],[1,153,"NumpadMemoryAdd",0,n,0,n,n,n],[1,154,"NumpadMemorySubtract",0,n,0,n,n,n],[1,155,"NumpadClear",131,"Clear",12,"VK_CLEAR",n,n],[1,156,"NumpadClearEntry",0,n,0,n,n,n],[1,0,n,5,"Ctrl",17,"VK_CONTROL",n,n],[1,0,n,4,"Shift",16,"VK_SHIFT",n,n],[1,0,n,6,"Alt",18,"VK_MENU",n,n],[1,0,n,57,"Meta",91,"VK_COMMAND",n,n],[1,157,"ControlLeft",5,n,0,"VK_LCONTROL",n,n],[1,158,"ShiftLeft",4,n,0,"VK_LSHIFT",n,n],[1,159,"AltLeft",6,n,0,"VK_LMENU",n,n],[1,160,"MetaLeft",57,n,0,"VK_LWIN",n,n],[1,161,"ControlRight",5,n,0,"VK_RCONTROL",n,n],[1,162,"ShiftRight",4,n,0,"VK_RSHIFT",n,n],[1,163,"AltRight",6,n,0,"VK_RMENU",n,n],[1,164,"MetaRight",57,n,0,"VK_RWIN",n,n],[1,165,"BrightnessUp",0,n,0,n,n,n],[1,166,"BrightnessDown",0,n,0,n,n,n],[1,167,"MediaPlay",0,n,0,n,n,n],[1,168,"MediaRecord",0,n,0,n,n,n],[1,169,"MediaFastForward",0,n,0,n,n,n],[1,170,"MediaRewind",0,n,0,n,n,n],[1,171,"MediaTrackNext",124,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK",n,n],[1,172,"MediaTrackPrevious",125,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK",n,n],[1,173,"MediaStop",126,"MediaStop",178,"VK_MEDIA_STOP",n,n],[1,174,"Eject",0,n,0,n,n,n],[1,175,"MediaPlayPause",127,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE",n,n],[1,176,"MediaSelect",128,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT",n,n],[1,177,"LaunchMail",129,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL",n,n],[1,178,"LaunchApp2",130,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2",n,n],[1,179,"LaunchApp1",0,n,0,"VK_MEDIA_LAUNCH_APP1",n,n],[1,180,"SelectTask",0,n,0,n,n,n],[1,181,"LaunchScreenSaver",0,n,0,n,n,n],[1,182,"BrowserSearch",120,"BrowserSearch",170,"VK_BROWSER_SEARCH",n,n],[1,183,"BrowserHome",121,"BrowserHome",172,"VK_BROWSER_HOME",n,n],[1,184,"BrowserBack",122,"BrowserBack",166,"VK_BROWSER_BACK",n,n],[1,185,"BrowserForward",123,"BrowserForward",167,"VK_BROWSER_FORWARD",n,n],[1,186,"BrowserStop",0,n,0,"VK_BROWSER_STOP",n,n],[1,187,"BrowserRefresh",0,n,0,"VK_BROWSER_REFRESH",n,n],[1,188,"BrowserFavorites",0,n,0,"VK_BROWSER_FAVORITES",n,n],[1,189,"ZoomToggle",0,n,0,n,n,n],[1,190,"MailReply",0,n,0,n,n,n],[1,191,"MailForward",0,n,0,n,n,n],[1,192,"MailSend",0,n,0,n,n,n],[1,0,n,114,"KeyInComposition",229,n,n,n],[1,0,n,116,"ABNT_C2",194,"VK_ABNT_C2",n,n],[1,0,n,96,"OEM_8",223,"VK_OEM_8",n,n],[1,0,n,0,n,0,"VK_KANA",n,n],[1,0,n,0,n,0,"VK_HANGUL",n,n],[1,0,n,0,n,0,"VK_JUNJA",n,n],[1,0,n,0,n,0,"VK_FINAL",n,n],[1,0,n,0,n,0,"VK_HANJA",n,n],[1,0,n,0,n,0,"VK_KANJI",n,n],[1,0,n,0,n,0,"VK_CONVERT",n,n],[1,0,n,0,n,0,"VK_NONCONVERT",n,n],[1,0,n,0,n,0,"VK_ACCEPT",n,n],[1,0,n,0,n,0,"VK_MODECHANGE",n,n],[1,0,n,0,n,0,"VK_SELECT",n,n],[1,0,n,0,n,0,"VK_PRINT",n,n],[1,0,n,0,n,0,"VK_EXECUTE",n,n],[1,0,n,0,n,0,"VK_SNAPSHOT",n,n],[1,0,n,0,n,0,"VK_HELP",n,n],[1,0,n,0,n,0,"VK_APPS",n,n],[1,0,n,0,n,0,"VK_PROCESSKEY",n,n],[1,0,n,0,n,0,"VK_PACKET",n,n],[1,0,n,0,n,0,"VK_DBE_SBCSCHAR",n,n],[1,0,n,0,n,0,"VK_DBE_DBCSCHAR",n,n],[1,0,n,0,n,0,"VK_ATTN",n,n],[1,0,n,0,n,0,"VK_CRSEL",n,n],[1,0,n,0,n,0,"VK_EXSEL",n,n],[1,0,n,0,n,0,"VK_EREOF",n,n],[1,0,n,0,n,0,"VK_PLAY",n,n],[1,0,n,0,n,0,"VK_ZOOM",n,n],[1,0,n,0,n,0,"VK_NONAME",n,n],[1,0,n,0,n,0,"VK_PA1",n,n],[1,0,n,0,n,0,"VK_OEM_CLEAR",n,n]],t=[],i=[];for(const s of e){const[o,r,a,l,c,d,u,h,f]=s;if(i[r]||(i[r]=!0,rge[a]=r,age[a.toLowerCase()]=r,o&&(P4[r]=l)),!t[l]){if(t[l]=!0,!c)throw new Error(`String representation missing for key code ${l} around scan code ${a}`);uC.define(l,c),oI.define(l,h||c),rI.define(l,f||h||c)}d&&(bU[d]=l)}})();var Vl;(function(n){function e(a){return uC.keyCodeToStr(a)}n.toString=e;function t(a){return uC.strToKeyCode(a)}n.fromString=t;function i(a){return oI.keyCodeToStr(a)}n.toUserSettingsUS=i;function s(a){return rI.keyCodeToStr(a)}n.toUserSettingsGeneral=s;function o(a){return oI.strToKeyCode(a)||rI.strToKeyCode(a)}n.fromUserSettings=o;function r(a){if(a>=98&&a<=113)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return uC.keyCodeToStr(a)}n.toElectronAccelerator=r})(Vl||(Vl={}));function Bn(n,e){const t=(e&65535)<<16>>>0;return(n|t)>>>0}var VF={};let fp;if(typeof _r.vscode<"u"&&typeof _r.vscode.process<"u"){const n=_r.vscode.process;fp={get platform(){return n.platform},get arch(){return n.arch},get env(){return n.env},cwd(){return n.cwd()}}}else typeof process<"u"?fp={get platform(){return process.platform},get arch(){return process.arch},get env(){return VF},cwd(){return VF.VSCODE_CWD||process.cwd()}}:fp={get platform(){return Fs?"win32":mt?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};const xS=fp.cwd,vU=fp.env,lge=fp.platform,cge=65,dge=97,uge=90,hge=122,Dd=46,Gn=47,ho=92,Rc=58,fge=63;class yU extends Error{constructor(e,t,i){let s;typeof t=="string"&&t.indexOf("not ")===0?(s="must not be",t=t.replace(/^not /,"")):s="must be";const o=e.indexOf(".")!==-1?"property":"argument";let r=`The "${e}" ${o} ${s} of type ${t}`;r+=`. Received type ${typeof i}`,super(r),this.code="ERR_INVALID_ARG_TYPE"}}function gge(n,e){if(n===null||typeof n!="object")throw new yU(e,"Object",n)}function en(n,e){if(typeof n!="string")throw new yU(e,"string",n)}const Su=lge==="win32";function St(n){return n===Gn||n===ho}function aI(n){return n===Gn}function Mc(n){return n>=cge&&n<=uge||n>=dge&&n<=hge}function LS(n,e,t,i){let s="",o=0,r=-1,a=0,l=0;for(let c=0;c<=n.length;++c){if(c2){const d=s.lastIndexOf(t);d===-1?(s="",o=0):(s=s.slice(0,d),o=s.length-1-s.lastIndexOf(t)),r=c,a=0;continue}else if(s.length!==0){s="",o=0,r=c,a=0;continue}}e&&(s+=s.length>0?`${t}..`:"..",o=2)}else s.length>0?s+=`${t}${n.slice(r+1,c)}`:s=n.slice(r+1,c),o=c-r-1;r=c,a=0}else l===Dd&&a!==-1?++a:a=-1}return s}function wU(n,e){gge(e,"pathObject");const t=e.dir||e.root,i=e.base||`${e.name||""}${e.ext||""}`;return t?t===e.root?`${t}${i}`:`${t}${n}${i}`:i}const Ys={resolve(...n){let e="",t="",i=!1;for(let s=n.length-1;s>=-1;s--){let o;if(s>=0){if(o=n[s],en(o,"path"),o.length===0)continue}else e.length===0?o=xS():(o=vU[`=${e}`]||xS(),(o===void 0||o.slice(0,2).toLowerCase()!==e.toLowerCase()&&o.charCodeAt(2)===ho)&&(o=`${e}\\`));const r=o.length;let a=0,l="",c=!1;const d=o.charCodeAt(0);if(r===1)St(d)&&(a=1,c=!0);else if(St(d))if(c=!0,St(o.charCodeAt(1))){let u=2,h=u;for(;u2&&St(o.charCodeAt(2))&&(c=!0,a=3));if(l.length>0)if(e.length>0){if(l.toLowerCase()!==e.toLowerCase())continue}else e=l;if(i){if(e.length>0)break}else if(t=`${o.slice(a)}\\${t}`,i=c,c&&e.length>0)break}return t=LS(t,!i,"\\",St),i?`${e}\\${t}`:`${e}${t}`||"."},normalize(n){en(n,"path");const e=n.length;if(e===0)return".";let t=0,i,s=!1;const o=n.charCodeAt(0);if(e===1)return aI(o)?"\\":n;if(St(o))if(s=!0,St(n.charCodeAt(1))){let a=2,l=a;for(;a2&&St(n.charCodeAt(2))&&(s=!0,t=3));let r=t0&&St(n.charCodeAt(e-1))&&(r+="\\"),i===void 0?s?`\\${r}`:r:s?`${i}\\${r}`:`${i}${r}`},isAbsolute(n){en(n,"path");const e=n.length;if(e===0)return!1;const t=n.charCodeAt(0);return St(t)||e>2&&Mc(t)&&n.charCodeAt(1)===Rc&&St(n.charCodeAt(2))},join(...n){if(n.length===0)return".";let e,t;for(let o=0;o0&&(e===void 0?e=t=r:e+=`\\${r}`)}if(e===void 0)return".";let i=!0,s=0;if(typeof t=="string"&&St(t.charCodeAt(0))){++s;const o=t.length;o>1&&St(t.charCodeAt(1))&&(++s,o>2&&(St(t.charCodeAt(2))?++s:i=!1))}if(i){for(;s=2&&(e=`\\${e.slice(s)}`)}return Ys.normalize(e)},relative(n,e){if(en(n,"from"),en(e,"to"),n===e)return"";const t=Ys.resolve(n),i=Ys.resolve(e);if(t===i||(n=t.toLowerCase(),e=i.toLowerCase(),n===e))return"";let s=0;for(;ss&&n.charCodeAt(o-1)===ho;)o--;const r=o-s;let a=0;for(;aa&&e.charCodeAt(l-1)===ho;)l--;const c=l-a,d=rd){if(e.charCodeAt(a+h)===ho)return i.slice(a+h+1);if(h===2)return i.slice(a+h)}r>d&&(n.charCodeAt(s+h)===ho?u=h:h===2&&(u=3)),u===-1&&(u=0)}let f="";for(h=s+u+1;h<=o;++h)(h===o||n.charCodeAt(h)===ho)&&(f+=f.length===0?"..":"\\..");return a+=u,f.length>0?`${f}${i.slice(a,l)}`:(i.charCodeAt(a)===ho&&++a,i.slice(a,l))},toNamespacedPath(n){if(typeof n!="string"||n.length===0)return n;const e=Ys.resolve(n);if(e.length<=2)return n;if(e.charCodeAt(0)===ho){if(e.charCodeAt(1)===ho){const t=e.charCodeAt(2);if(t!==fge&&t!==Dd)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(Mc(e.charCodeAt(0))&&e.charCodeAt(1)===Rc&&e.charCodeAt(2)===ho)return`\\\\?\\${e}`;return n},dirname(n){en(n,"path");const e=n.length;if(e===0)return".";let t=-1,i=0;const s=n.charCodeAt(0);if(e===1)return St(s)?n:".";if(St(s)){if(t=i=1,St(n.charCodeAt(1))){let a=2,l=a;for(;a2&&St(n.charCodeAt(2))?3:2,i=t);let o=-1,r=!0;for(let a=e-1;a>=i;--a)if(St(n.charCodeAt(a))){if(!r){o=a;break}}else r=!1;if(o===-1){if(t===-1)return".";o=t}return n.slice(0,o)},basename(n,e){e!==void 0&&en(e,"ext"),en(n,"path");let t=0,i=-1,s=!0,o;if(n.length>=2&&Mc(n.charCodeAt(0))&&n.charCodeAt(1)===Rc&&(t=2),e!==void 0&&e.length>0&&e.length<=n.length){if(e===n)return"";let r=e.length-1,a=-1;for(o=n.length-1;o>=t;--o){const l=n.charCodeAt(o);if(St(l)){if(!s){t=o+1;break}}else a===-1&&(s=!1,a=o+1),r>=0&&(l===e.charCodeAt(r)?--r===-1&&(i=o):(r=-1,i=a))}return t===i?i=a:i===-1&&(i=n.length),n.slice(t,i)}for(o=n.length-1;o>=t;--o)if(St(n.charCodeAt(o))){if(!s){t=o+1;break}}else i===-1&&(s=!1,i=o+1);return i===-1?"":n.slice(t,i)},extname(n){en(n,"path");let e=0,t=-1,i=0,s=-1,o=!0,r=0;n.length>=2&&n.charCodeAt(1)===Rc&&Mc(n.charCodeAt(0))&&(e=i=2);for(let a=n.length-1;a>=e;--a){const l=n.charCodeAt(a);if(St(l)){if(!o){i=a+1;break}continue}s===-1&&(o=!1,s=a+1),l===Dd?t===-1?t=a:r!==1&&(r=1):t!==-1&&(r=-1)}return t===-1||s===-1||r===0||r===1&&t===s-1&&t===i+1?"":n.slice(t,s)},format:wU.bind(null,"\\"),parse(n){en(n,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return e;const t=n.length;let i=0,s=n.charCodeAt(0);if(t===1)return St(s)?(e.root=e.dir=n,e):(e.base=e.name=n,e);if(St(s)){if(i=1,St(n.charCodeAt(1))){let u=2,h=u;for(;u0&&(e.root=n.slice(0,i));let o=-1,r=i,a=-1,l=!0,c=n.length-1,d=0;for(;c>=i;--c){if(s=n.charCodeAt(c),St(s)){if(!l){r=c+1;break}continue}a===-1&&(l=!1,a=c+1),s===Dd?o===-1?o=c:d!==1&&(d=1):o!==-1&&(d=-1)}return a!==-1&&(o===-1||d===0||d===1&&o===a-1&&o===r+1?e.base=e.name=n.slice(r,a):(e.name=n.slice(r,o),e.base=n.slice(r,a),e.ext=n.slice(o,a))),r>0&&r!==i?e.dir=n.slice(0,r-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},pge=(()=>{if(Su){const n=/\\/g;return()=>{const e=xS().replace(n,"/");return e.slice(e.indexOf("/"))}}return()=>xS()})(),Fi={resolve(...n){let e="",t=!1;for(let i=n.length-1;i>=-1&&!t;i--){const s=i>=0?n[i]:pge();en(s,"path"),s.length!==0&&(e=`${s}/${e}`,t=s.charCodeAt(0)===Gn)}return e=LS(e,!t,"/",aI),t?`/${e}`:e.length>0?e:"."},normalize(n){if(en(n,"path"),n.length===0)return".";const e=n.charCodeAt(0)===Gn,t=n.charCodeAt(n.length-1)===Gn;return n=LS(n,!e,"/",aI),n.length===0?e?"/":t?"./":".":(t&&(n+="/"),e?`/${n}`:n)},isAbsolute(n){return en(n,"path"),n.length>0&&n.charCodeAt(0)===Gn},join(...n){if(n.length===0)return".";let e;for(let t=0;t0&&(e===void 0?e=i:e+=`/${i}`)}return e===void 0?".":Fi.normalize(e)},relative(n,e){if(en(n,"from"),en(e,"to"),n===e||(n=Fi.resolve(n),e=Fi.resolve(e),n===e))return"";const t=1,i=n.length,s=i-t,o=1,r=e.length-o,a=sa){if(e.charCodeAt(o+c)===Gn)return e.slice(o+c+1);if(c===0)return e.slice(o+c)}else s>a&&(n.charCodeAt(t+c)===Gn?l=c:c===0&&(l=0));let d="";for(c=t+l+1;c<=i;++c)(c===i||n.charCodeAt(c)===Gn)&&(d+=d.length===0?"..":"/..");return`${d}${e.slice(o+l)}`},toNamespacedPath(n){return n},dirname(n){if(en(n,"path"),n.length===0)return".";const e=n.charCodeAt(0)===Gn;let t=-1,i=!0;for(let s=n.length-1;s>=1;--s)if(n.charCodeAt(s)===Gn){if(!i){t=s;break}}else i=!1;return t===-1?e?"/":".":e&&t===1?"//":n.slice(0,t)},basename(n,e){e!==void 0&&en(e,"ext"),en(n,"path");let t=0,i=-1,s=!0,o;if(e!==void 0&&e.length>0&&e.length<=n.length){if(e===n)return"";let r=e.length-1,a=-1;for(o=n.length-1;o>=0;--o){const l=n.charCodeAt(o);if(l===Gn){if(!s){t=o+1;break}}else a===-1&&(s=!1,a=o+1),r>=0&&(l===e.charCodeAt(r)?--r===-1&&(i=o):(r=-1,i=a))}return t===i?i=a:i===-1&&(i=n.length),n.slice(t,i)}for(o=n.length-1;o>=0;--o)if(n.charCodeAt(o)===Gn){if(!s){t=o+1;break}}else i===-1&&(s=!1,i=o+1);return i===-1?"":n.slice(t,i)},extname(n){en(n,"path");let e=-1,t=0,i=-1,s=!0,o=0;for(let r=n.length-1;r>=0;--r){const a=n.charCodeAt(r);if(a===Gn){if(!s){t=r+1;break}continue}i===-1&&(s=!1,i=r+1),a===Dd?e===-1?e=r:o!==1&&(o=1):e!==-1&&(o=-1)}return e===-1||i===-1||o===0||o===1&&e===i-1&&e===t+1?"":n.slice(e,i)},format:wU.bind(null,"/"),parse(n){en(n,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return e;const t=n.charCodeAt(0)===Gn;let i;t?(e.root="/",i=1):i=0;let s=-1,o=0,r=-1,a=!0,l=n.length-1,c=0;for(;l>=i;--l){const d=n.charCodeAt(l);if(d===Gn){if(!a){o=l+1;break}continue}r===-1&&(a=!1,r=l+1),d===Dd?s===-1?s=l:c!==1&&(c=1):s!==-1&&(c=-1)}if(r!==-1){const d=o===0&&t?1:o;s===-1||c===0||c===1&&s===r-1&&s===o+1?e.base=e.name=n.slice(d,r):(e.name=n.slice(d,s),e.base=n.slice(d,r),e.ext=n.slice(s,r))}return o>0?e.dir=n.slice(0,o-1):t&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};Fi.win32=Ys.win32=Ys;Fi.posix=Ys.posix=Fi;const CU=Su?Ys.normalize:Fi.normalize,mge=Su?Ys.resolve:Fi.resolve,_ge=Su?Ys.relative:Fi.relative,bge=Su?Ys.dirname:Fi.dirname,SU=Su?Ys.basename:Fi.basename,vge=Su?Ys.extname:Fi.extname,kd=Su?Ys.sep:Fi.sep,yge=/^\w[\w\d+.-]*$/,wge=/^\//,Cge=/^\/\//;function Sge(n,e){if(!n.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${n.authority}", path: "${n.path}", query: "${n.query}", fragment: "${n.fragment}"}`);if(n.scheme&&!yge.test(n.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(n.path){if(n.authority){if(!wge.test(n.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(Cge.test(n.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function xge(n,e){return!n&&!e?"file":n}function Lge(n,e){switch(n){case"https":case"http":case"file":e?e[0]!==Yr&&(e=Yr+e):e=Yr;break}return e}const wi="",Yr="/",Dge=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class je{static isUri(e){return e instanceof je?!0:e?typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function":!1}constructor(e,t,i,s,o,r=!1){typeof e=="object"?(this.scheme=e.scheme||wi,this.authority=e.authority||wi,this.path=e.path||wi,this.query=e.query||wi,this.fragment=e.fragment||wi):(this.scheme=xge(e,r),this.authority=t||wi,this.path=Lge(this.scheme,i||wi),this.query=s||wi,this.fragment=o||wi,Sge(this,r))}get fsPath(){return DS(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:i,path:s,query:o,fragment:r}=e;return t===void 0?t=this.scheme:t===null&&(t=wi),i===void 0?i=this.authority:i===null&&(i=wi),s===void 0?s=this.path:s===null&&(s=wi),o===void 0?o=this.query:o===null&&(o=wi),r===void 0?r=this.fragment:r===null&&(r=wi),t===this.scheme&&i===this.authority&&s===this.path&&o===this.query&&r===this.fragment?this:new dg(t,i,s,o,r)}static parse(e,t=!1){const i=Dge.exec(e);return i?new dg(i[2]||wi,Uy(i[4]||wi),Uy(i[5]||wi),Uy(i[7]||wi),Uy(i[9]||wi),t):new dg(wi,wi,wi,wi,wi)}static file(e){let t=wi;if(Fs&&(e=e.replace(/\\/g,Yr)),e[0]===Yr&&e[1]===Yr){const i=e.indexOf(Yr,2);i===-1?(t=e.substring(2),e=Yr):(t=e.substring(2,i),e=e.substring(i)||Yr)}return new dg("file",t,e,wi,wi)}static from(e,t){return new dg(e.scheme,e.authority,e.path,e.query,e.fragment,t)}static joinPath(e,...t){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let i;return Fs&&e.scheme==="file"?i=je.file(Ys.join(DS(e,!0),...t)).path:i=Fi.join(e.path,...t),e.with({path:i})}toString(e=!1){return lI(this,e)}toJSON(){return this}static revive(e){var t,i;if(e){if(e instanceof je)return e;{const s=new dg(e);return s._formatted=(t=e.external)!==null&&t!==void 0?t:null,s._fsPath=e._sep===xU&&(i=e.fsPath)!==null&&i!==void 0?i:null,s}}else return e}}const xU=Fs?1:void 0;let dg=class extends je{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=DS(this,!1)),this._fsPath}toString(e=!1){return e?lI(this,!0):(this._formatted||(this._formatted=lI(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=xU),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}};const LU={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function zF(n,e,t){let i,s=-1;for(let o=0;o=97&&r<=122||r>=65&&r<=90||r>=48&&r<=57||r===45||r===46||r===95||r===126||e&&r===47||t&&r===91||t&&r===93||t&&r===58)s!==-1&&(i+=encodeURIComponent(n.substring(s,o)),s=-1),i!==void 0&&(i+=n.charAt(o));else{i===void 0&&(i=n.substr(0,o));const a=LU[r];a!==void 0?(s!==-1&&(i+=encodeURIComponent(n.substring(s,o)),s=-1),i+=a):s===-1&&(s=o)}}return s!==-1&&(i+=encodeURIComponent(n.substring(s))),i!==void 0?i:n}function kge(n){let e;for(let t=0;t1&&n.scheme==="file"?t=`//${n.authority}${n.path}`:n.path.charCodeAt(0)===47&&(n.path.charCodeAt(1)>=65&&n.path.charCodeAt(1)<=90||n.path.charCodeAt(1)>=97&&n.path.charCodeAt(1)<=122)&&n.path.charCodeAt(2)===58?e?t=n.path.substr(1):t=n.path[1].toLowerCase()+n.path.substr(2):t=n.path,Fs&&(t=t.replace(/\//g,"\\")),t}function lI(n,e){const t=e?kge:zF;let i="",{scheme:s,authority:o,path:r,query:a,fragment:l}=n;if(s&&(i+=s,i+=":"),(o||s==="file")&&(i+=Yr,i+=Yr),o){let c=o.indexOf("@");if(c!==-1){const d=o.substr(0,c);o=o.substr(c+1),c=d.lastIndexOf(":"),c===-1?i+=t(d,!1,!1):(i+=t(d.substr(0,c),!1,!1),i+=":",i+=t(d.substr(c+1),!1,!0)),i+="@"}o=o.toLowerCase(),c=o.lastIndexOf(":"),c===-1?i+=t(o,!1,!0):(i+=t(o.substr(0,c),!1,!0),i+=o.substr(c))}if(r){if(r.length>=3&&r.charCodeAt(0)===47&&r.charCodeAt(2)===58){const c=r.charCodeAt(1);c>=65&&c<=90&&(r=`/${String.fromCharCode(c+32)}:${r.substr(3)}`)}else if(r.length>=2&&r.charCodeAt(1)===58){const c=r.charCodeAt(0);c>=65&&c<=90&&(r=`${String.fromCharCode(c+32)}:${r.substr(2)}`)}i+=t(r,!0,!1)}return a&&(i+="?",i+=t(a,!1,!1)),l&&(i+="#",i+=e?l:zF(l,!1,!1)),i}function DU(n){try{return decodeURIComponent(n)}catch{return n.length>3?n.substr(0,3)+DU(n.substr(3)):n}}const HF=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function Uy(n){return n.match(HF)?n.replace(HF,e=>DU(e)):n}let V=class th{constructor(e,t){this.lineNumber=e,this.column=t}with(e=this.lineNumber,t=this.column){return e===this.lineNumber&&t===this.column?this:new th(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return th.equals(this,e)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return th.isBefore(this,e)}static isBefore(e,t){return e.lineNumberi||e===i&&t>s?(this.startLineNumber=i,this.startColumn=s,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=i,this.endColumn=s)}isEmpty(){return cn.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return cn.containsPosition(this,e)}static containsPosition(e,t){return!(t.lineNumbere.endLineNumber||t.lineNumber===e.startLineNumber&&t.columne.endColumn)}static strictContainsPosition(e,t){return!(t.lineNumbere.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<=e.startColumn||t.lineNumber===e.endLineNumber&&t.column>=e.endColumn)}containsRange(e){return cn.containsRange(this,e)}static containsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumne.endColumn)}strictContainsRange(e){return cn.strictContainsRange(this,e)}static strictContainsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)}plusRange(e){return cn.plusRange(this,e)}static plusRange(e,t){let i,s,o,r;return t.startLineNumbere.endLineNumber?(o=t.endLineNumber,r=t.endColumn):t.endLineNumber===e.endLineNumber?(o=t.endLineNumber,r=Math.max(t.endColumn,e.endColumn)):(o=e.endLineNumber,r=e.endColumn),new cn(i,s,o,r)}intersectRanges(e){return cn.intersectRanges(this,e)}static intersectRanges(e,t){let i=e.startLineNumber,s=e.startColumn,o=e.endLineNumber,r=e.endColumn;const a=t.startLineNumber,l=t.startColumn,c=t.endLineNumber,d=t.endColumn;return ic?(o=c,r=d):o===c&&(r=Math.min(r,d)),i>o||i===o&&s>r?null:new cn(i,s,o,r)}equalsRange(e){return cn.equalsRange(this,e)}static equalsRange(e,t){return!e&&!t?!0:!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return cn.getEndPosition(this)}static getEndPosition(e){return new V(e.endLineNumber,e.endColumn)}getStartPosition(){return cn.getStartPosition(this)}static getStartPosition(e){return new V(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new cn(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new cn(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return cn.collapseToStart(this)}static collapseToStart(e){return new cn(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return cn.collapseToEnd(this)}static collapseToEnd(e){return new cn(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new cn(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}static fromPositions(e,t=e){return new cn(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new cn(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,t){return!(e.endLineNumbere.startLineNumber}toJSON(){return this}},ct=class sr extends N{constructor(e,t,i,s){super(e,t,i,s),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=i,this.positionColumn=s}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return sr.selectionsEqual(this,e)}static selectionsEqual(e,t){return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn}getDirection(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?0:1}setEndPosition(e,t){return this.getDirection()===0?new sr(this.startLineNumber,this.startColumn,e,t):new sr(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new V(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new V(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return this.getDirection()===0?new sr(e,t,this.endLineNumber,this.endColumn):new sr(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new sr(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return t===0?new sr(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new sr(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new sr(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)}static selectionsArrEqual(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(let i=0,s=e.length;i{this._tokenizationSupports.get(e)===t&&(this._tokenizationSupports.delete(e),this.handleChange([e]))})}get(e){return this._tokenizationSupports.get(e)||null}registerFactory(e,t){var i;(i=this._factories.get(e))===null||i===void 0||i.dispose();const s=new Age(this,e,t);return this._factories.set(e,s),Ze(()=>{const o=this._factories.get(e);!o||o!==s||(this._factories.delete(e),o.dispose())})}getOrCreate(e){return dI(this,void 0,void 0,function*(){const t=this.get(e);if(t)return t;const i=this._factories.get(e);return!i||i.isResolved?null:(yield i.resolve(),this.get(e))})}isResolved(e){if(this.get(e))return!0;const i=this._factories.get(e);return!!(!i||i.isResolved)}setColorMap(e){this._colorMap=e,this._onDidChange.fire({changedLanguages:Array.from(this._tokenizationSupports.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>2?this._colorMap[2]:null}};class Age extends Y{get isResolved(){return this._isResolved}constructor(e,t,i){super(),this._registry=e,this._languageId=t,this._factory=i,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}dispose(){this._isDisposed=!0,super.dispose()}resolve(){return dI(this,void 0,void 0,function*(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise})}_create(){return dI(this,void 0,void 0,function*(){const e=yield this._factory.tokenizationSupport;this._isResolved=!0,e&&!this._isDisposed&&this._register(this._registry.register(this._languageId,e))})}}let Fb=class{constructor(e,t,i){this.offset=e,this.type=t,this.language=i,this._tokenBrand=void 0}toString(){return"("+this.offset+", "+this.type+")"}};class O4{constructor(e,t){this.tokens=e,this.endState=t,this._tokenizationResultBrand=void 0}}class UL{constructor(e,t){this.tokens=e,this.endState=t,this._encodedTokenizationResultBrand=void 0}}var $F;(function(n){const e=new Map;e.set(0,se.symbolMethod),e.set(1,se.symbolFunction),e.set(2,se.symbolConstructor),e.set(3,se.symbolField),e.set(4,se.symbolVariable),e.set(5,se.symbolClass),e.set(6,se.symbolStruct),e.set(7,se.symbolInterface),e.set(8,se.symbolModule),e.set(9,se.symbolProperty),e.set(10,se.symbolEvent),e.set(11,se.symbolOperator),e.set(12,se.symbolUnit),e.set(13,se.symbolValue),e.set(15,se.symbolEnum),e.set(14,se.symbolConstant),e.set(15,se.symbolEnum),e.set(16,se.symbolEnumMember),e.set(17,se.symbolKeyword),e.set(27,se.symbolSnippet),e.set(18,se.symbolText),e.set(19,se.symbolColor),e.set(20,se.symbolFile),e.set(21,se.symbolReference),e.set(22,se.symbolCustomColor),e.set(23,se.symbolFolder),e.set(24,se.symbolTypeParameter),e.set(25,se.account),e.set(26,se.issues);function t(o){let r=e.get(o);return r||(console.info("No codicon found for CompletionItemKind "+o),r=se.symbolProperty),r}n.toIcon=t;const i=new Map;i.set("method",0),i.set("function",1),i.set("constructor",2),i.set("field",3),i.set("variable",4),i.set("class",5),i.set("struct",6),i.set("interface",7),i.set("module",8),i.set("property",9),i.set("event",10),i.set("operator",11),i.set("unit",12),i.set("value",13),i.set("constant",14),i.set("enum",15),i.set("enum-member",16),i.set("enumMember",16),i.set("keyword",17),i.set("snippet",27),i.set("text",18),i.set("color",19),i.set("file",20),i.set("reference",21),i.set("customcolor",22),i.set("folder",23),i.set("type-parameter",24),i.set("typeParameter",24),i.set("account",25),i.set("issue",26);function s(o,r){let a=i.get(o);return typeof a>"u"&&!r&&(a=9),a}n.fromString=s})($F||($F={}));var uI;(function(n){n[n.Automatic=0]="Automatic",n[n.Explicit=1]="Explicit"})(uI||(uI={}));class Ige{constructor(e,t,i,s){this.range=e,this.text=t,this.completionKind=i,this.isSnippetText=s}equals(e){return N.lift(this.range).equalsRange(e.range)&&this.text===e.text&&this.completionKind===e.completionKind&&this.isSnippetText===e.isSnippetText}}var UF;(function(n){n[n.Invoke=1]="Invoke",n[n.TriggerCharacter=2]="TriggerCharacter",n[n.ContentChange=3]="ContentChange"})(UF||(UF={}));var jF;(function(n){n[n.Text=0]="Text",n[n.Read=1]="Read",n[n.Write=2]="Write"})(jF||(jF={}));function Tge(n){return n&&je.isUri(n.uri)&&N.isIRange(n.range)&&(N.isIRange(n.originSelectionRange)||N.isIRange(n.targetSelectionRange))}m("Array","array"),m("Boolean","boolean"),m("Class","class"),m("Constant","constant"),m("Constructor","constructor"),m("Enum","enumeration"),m("EnumMember","enumeration member"),m("Event","event"),m("Field","field"),m("File","file"),m("Function","function"),m("Interface","interface"),m("Key","key"),m("Method","method"),m("Module","module"),m("Namespace","namespace"),m("Null","null"),m("Number","number"),m("Object","object"),m("Operator","operator"),m("Package","package"),m("Property","property"),m("String","string"),m("Struct","struct"),m("TypeParameter","type parameter"),m("Variable","variable");var hI;(function(n){const e=new Map;e.set(0,se.symbolFile),e.set(1,se.symbolModule),e.set(2,se.symbolNamespace),e.set(3,se.symbolPackage),e.set(4,se.symbolClass),e.set(5,se.symbolMethod),e.set(6,se.symbolProperty),e.set(7,se.symbolField),e.set(8,se.symbolConstructor),e.set(9,se.symbolEnum),e.set(10,se.symbolInterface),e.set(11,se.symbolFunction),e.set(12,se.symbolVariable),e.set(13,se.symbolConstant),e.set(14,se.symbolString),e.set(15,se.symbolNumber),e.set(16,se.symbolBoolean),e.set(17,se.symbolArray),e.set(18,se.symbolObject),e.set(19,se.symbolKey),e.set(20,se.symbolNull),e.set(21,se.symbolEnumMember),e.set(22,se.symbolStruct),e.set(23,se.symbolEvent),e.set(24,se.symbolOperator),e.set(25,se.symbolTypeParameter);function t(i){let s=e.get(i);return s||(console.info("No codicon found for SymbolKind "+i),s=se.symbolProperty),s}n.toIcon=t})(hI||(hI={}));class cs{static fromValue(e){switch(e){case"comment":return cs.Comment;case"imports":return cs.Imports;case"region":return cs.Region}return new cs(e)}constructor(e){this.value=e}}cs.Comment=new cs("comment");cs.Imports=new cs("imports");cs.Region=new cs("region");var qF;(function(n){function e(t){return!t||typeof t!="object"?!1:typeof t.id=="string"&&typeof t.title=="string"}n.is=e})(qF||(qF={}));var GF;(function(n){n[n.Type=1]="Type",n[n.Parameter=2]="Parameter"})(GF||(GF={}));class Nge{constructor(e){this.createSupport=e,this._tokenizationSupport=null}dispose(){this._tokenizationSupport&&this._tokenizationSupport.then(e=>{e&&e.dispose()})}get tokenizationSupport(){return this._tokenizationSupport||(this._tokenizationSupport=this.createSupport()),this._tokenizationSupport}}const xi=new Ege;var fI;(function(n){n[n.Unknown=0]="Unknown",n[n.Disabled=1]="Disabled",n[n.Enabled=2]="Enabled"})(fI||(fI={}));var gI;(function(n){n[n.Invoke=1]="Invoke",n[n.Auto=2]="Auto"})(gI||(gI={}));var pI;(function(n){n[n.None=0]="None",n[n.KeepWhitespace=1]="KeepWhitespace",n[n.InsertAsSnippet=4]="InsertAsSnippet"})(pI||(pI={}));var mI;(function(n){n[n.Method=0]="Method",n[n.Function=1]="Function",n[n.Constructor=2]="Constructor",n[n.Field=3]="Field",n[n.Variable=4]="Variable",n[n.Class=5]="Class",n[n.Struct=6]="Struct",n[n.Interface=7]="Interface",n[n.Module=8]="Module",n[n.Property=9]="Property",n[n.Event=10]="Event",n[n.Operator=11]="Operator",n[n.Unit=12]="Unit",n[n.Value=13]="Value",n[n.Constant=14]="Constant",n[n.Enum=15]="Enum",n[n.EnumMember=16]="EnumMember",n[n.Keyword=17]="Keyword",n[n.Text=18]="Text",n[n.Color=19]="Color",n[n.File=20]="File",n[n.Reference=21]="Reference",n[n.Customcolor=22]="Customcolor",n[n.Folder=23]="Folder",n[n.TypeParameter=24]="TypeParameter",n[n.User=25]="User",n[n.Issue=26]="Issue",n[n.Snippet=27]="Snippet"})(mI||(mI={}));var _I;(function(n){n[n.Deprecated=1]="Deprecated"})(_I||(_I={}));var bI;(function(n){n[n.Invoke=0]="Invoke",n[n.TriggerCharacter=1]="TriggerCharacter",n[n.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(bI||(bI={}));var vI;(function(n){n[n.EXACT=0]="EXACT",n[n.ABOVE=1]="ABOVE",n[n.BELOW=2]="BELOW"})(vI||(vI={}));var yI;(function(n){n[n.NotSet=0]="NotSet",n[n.ContentFlush=1]="ContentFlush",n[n.RecoverFromMarkers=2]="RecoverFromMarkers",n[n.Explicit=3]="Explicit",n[n.Paste=4]="Paste",n[n.Undo=5]="Undo",n[n.Redo=6]="Redo"})(yI||(yI={}));var wI;(function(n){n[n.LF=1]="LF",n[n.CRLF=2]="CRLF"})(wI||(wI={}));var CI;(function(n){n[n.Text=0]="Text",n[n.Read=1]="Read",n[n.Write=2]="Write"})(CI||(CI={}));var SI;(function(n){n[n.None=0]="None",n[n.Keep=1]="Keep",n[n.Brackets=2]="Brackets",n[n.Advanced=3]="Advanced",n[n.Full=4]="Full"})(SI||(SI={}));var xI;(function(n){n[n.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",n[n.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",n[n.accessibilitySupport=2]="accessibilitySupport",n[n.accessibilityPageSize=3]="accessibilityPageSize",n[n.ariaLabel=4]="ariaLabel",n[n.ariaRequired=5]="ariaRequired",n[n.autoClosingBrackets=6]="autoClosingBrackets",n[n.autoClosingComments=7]="autoClosingComments",n[n.screenReaderAnnounceInlineSuggestion=8]="screenReaderAnnounceInlineSuggestion",n[n.autoClosingDelete=9]="autoClosingDelete",n[n.autoClosingOvertype=10]="autoClosingOvertype",n[n.autoClosingQuotes=11]="autoClosingQuotes",n[n.autoIndent=12]="autoIndent",n[n.automaticLayout=13]="automaticLayout",n[n.autoSurround=14]="autoSurround",n[n.bracketPairColorization=15]="bracketPairColorization",n[n.guides=16]="guides",n[n.codeLens=17]="codeLens",n[n.codeLensFontFamily=18]="codeLensFontFamily",n[n.codeLensFontSize=19]="codeLensFontSize",n[n.colorDecorators=20]="colorDecorators",n[n.colorDecoratorsLimit=21]="colorDecoratorsLimit",n[n.columnSelection=22]="columnSelection",n[n.comments=23]="comments",n[n.contextmenu=24]="contextmenu",n[n.copyWithSyntaxHighlighting=25]="copyWithSyntaxHighlighting",n[n.cursorBlinking=26]="cursorBlinking",n[n.cursorSmoothCaretAnimation=27]="cursorSmoothCaretAnimation",n[n.cursorStyle=28]="cursorStyle",n[n.cursorSurroundingLines=29]="cursorSurroundingLines",n[n.cursorSurroundingLinesStyle=30]="cursorSurroundingLinesStyle",n[n.cursorWidth=31]="cursorWidth",n[n.disableLayerHinting=32]="disableLayerHinting",n[n.disableMonospaceOptimizations=33]="disableMonospaceOptimizations",n[n.domReadOnly=34]="domReadOnly",n[n.dragAndDrop=35]="dragAndDrop",n[n.dropIntoEditor=36]="dropIntoEditor",n[n.emptySelectionClipboard=37]="emptySelectionClipboard",n[n.experimentalWhitespaceRendering=38]="experimentalWhitespaceRendering",n[n.extraEditorClassName=39]="extraEditorClassName",n[n.fastScrollSensitivity=40]="fastScrollSensitivity",n[n.find=41]="find",n[n.fixedOverflowWidgets=42]="fixedOverflowWidgets",n[n.folding=43]="folding",n[n.foldingStrategy=44]="foldingStrategy",n[n.foldingHighlight=45]="foldingHighlight",n[n.foldingImportsByDefault=46]="foldingImportsByDefault",n[n.foldingMaximumRegions=47]="foldingMaximumRegions",n[n.unfoldOnClickAfterEndOfLine=48]="unfoldOnClickAfterEndOfLine",n[n.fontFamily=49]="fontFamily",n[n.fontInfo=50]="fontInfo",n[n.fontLigatures=51]="fontLigatures",n[n.fontSize=52]="fontSize",n[n.fontWeight=53]="fontWeight",n[n.fontVariations=54]="fontVariations",n[n.formatOnPaste=55]="formatOnPaste",n[n.formatOnType=56]="formatOnType",n[n.glyphMargin=57]="glyphMargin",n[n.gotoLocation=58]="gotoLocation",n[n.hideCursorInOverviewRuler=59]="hideCursorInOverviewRuler",n[n.hover=60]="hover",n[n.inDiffEditor=61]="inDiffEditor",n[n.inlineSuggest=62]="inlineSuggest",n[n.letterSpacing=63]="letterSpacing",n[n.lightbulb=64]="lightbulb",n[n.lineDecorationsWidth=65]="lineDecorationsWidth",n[n.lineHeight=66]="lineHeight",n[n.lineNumbers=67]="lineNumbers",n[n.lineNumbersMinChars=68]="lineNumbersMinChars",n[n.linkedEditing=69]="linkedEditing",n[n.links=70]="links",n[n.matchBrackets=71]="matchBrackets",n[n.minimap=72]="minimap",n[n.mouseStyle=73]="mouseStyle",n[n.mouseWheelScrollSensitivity=74]="mouseWheelScrollSensitivity",n[n.mouseWheelZoom=75]="mouseWheelZoom",n[n.multiCursorMergeOverlapping=76]="multiCursorMergeOverlapping",n[n.multiCursorModifier=77]="multiCursorModifier",n[n.multiCursorPaste=78]="multiCursorPaste",n[n.multiCursorLimit=79]="multiCursorLimit",n[n.occurrencesHighlight=80]="occurrencesHighlight",n[n.overviewRulerBorder=81]="overviewRulerBorder",n[n.overviewRulerLanes=82]="overviewRulerLanes",n[n.padding=83]="padding",n[n.pasteAs=84]="pasteAs",n[n.parameterHints=85]="parameterHints",n[n.peekWidgetDefaultFocus=86]="peekWidgetDefaultFocus",n[n.definitionLinkOpensInPeek=87]="definitionLinkOpensInPeek",n[n.quickSuggestions=88]="quickSuggestions",n[n.quickSuggestionsDelay=89]="quickSuggestionsDelay",n[n.readOnly=90]="readOnly",n[n.readOnlyMessage=91]="readOnlyMessage",n[n.renameOnType=92]="renameOnType",n[n.renderControlCharacters=93]="renderControlCharacters",n[n.renderFinalNewline=94]="renderFinalNewline",n[n.renderLineHighlight=95]="renderLineHighlight",n[n.renderLineHighlightOnlyWhenFocus=96]="renderLineHighlightOnlyWhenFocus",n[n.renderValidationDecorations=97]="renderValidationDecorations",n[n.renderWhitespace=98]="renderWhitespace",n[n.revealHorizontalRightPadding=99]="revealHorizontalRightPadding",n[n.roundedSelection=100]="roundedSelection",n[n.rulers=101]="rulers",n[n.scrollbar=102]="scrollbar",n[n.scrollBeyondLastColumn=103]="scrollBeyondLastColumn",n[n.scrollBeyondLastLine=104]="scrollBeyondLastLine",n[n.scrollPredominantAxis=105]="scrollPredominantAxis",n[n.selectionClipboard=106]="selectionClipboard",n[n.selectionHighlight=107]="selectionHighlight",n[n.selectOnLineNumbers=108]="selectOnLineNumbers",n[n.showFoldingControls=109]="showFoldingControls",n[n.showUnused=110]="showUnused",n[n.snippetSuggestions=111]="snippetSuggestions",n[n.smartSelect=112]="smartSelect",n[n.smoothScrolling=113]="smoothScrolling",n[n.stickyScroll=114]="stickyScroll",n[n.stickyTabStops=115]="stickyTabStops",n[n.stopRenderingLineAfter=116]="stopRenderingLineAfter",n[n.suggest=117]="suggest",n[n.suggestFontSize=118]="suggestFontSize",n[n.suggestLineHeight=119]="suggestLineHeight",n[n.suggestOnTriggerCharacters=120]="suggestOnTriggerCharacters",n[n.suggestSelection=121]="suggestSelection",n[n.tabCompletion=122]="tabCompletion",n[n.tabIndex=123]="tabIndex",n[n.unicodeHighlighting=124]="unicodeHighlighting",n[n.unusualLineTerminators=125]="unusualLineTerminators",n[n.useShadowDOM=126]="useShadowDOM",n[n.useTabStops=127]="useTabStops",n[n.wordBreak=128]="wordBreak",n[n.wordSeparators=129]="wordSeparators",n[n.wordWrap=130]="wordWrap",n[n.wordWrapBreakAfterCharacters=131]="wordWrapBreakAfterCharacters",n[n.wordWrapBreakBeforeCharacters=132]="wordWrapBreakBeforeCharacters",n[n.wordWrapColumn=133]="wordWrapColumn",n[n.wordWrapOverride1=134]="wordWrapOverride1",n[n.wordWrapOverride2=135]="wordWrapOverride2",n[n.wrappingIndent=136]="wrappingIndent",n[n.wrappingStrategy=137]="wrappingStrategy",n[n.showDeprecated=138]="showDeprecated",n[n.inlayHints=139]="inlayHints",n[n.editorClassName=140]="editorClassName",n[n.pixelRatio=141]="pixelRatio",n[n.tabFocusMode=142]="tabFocusMode",n[n.layoutInfo=143]="layoutInfo",n[n.wrappingInfo=144]="wrappingInfo",n[n.defaultColorDecorators=145]="defaultColorDecorators",n[n.colorDecoratorsActivatedOn=146]="colorDecoratorsActivatedOn",n[n.inlineCompletionsAccessibilityVerbose=147]="inlineCompletionsAccessibilityVerbose"})(xI||(xI={}));var LI;(function(n){n[n.TextDefined=0]="TextDefined",n[n.LF=1]="LF",n[n.CRLF=2]="CRLF"})(LI||(LI={}));var DI;(function(n){n[n.LF=0]="LF",n[n.CRLF=1]="CRLF"})(DI||(DI={}));var kI;(function(n){n[n.Left=1]="Left",n[n.Right=2]="Right"})(kI||(kI={}));var EI;(function(n){n[n.None=0]="None",n[n.Indent=1]="Indent",n[n.IndentOutdent=2]="IndentOutdent",n[n.Outdent=3]="Outdent"})(EI||(EI={}));var AI;(function(n){n[n.Both=0]="Both",n[n.Right=1]="Right",n[n.Left=2]="Left",n[n.None=3]="None"})(AI||(AI={}));var II;(function(n){n[n.Type=1]="Type",n[n.Parameter=2]="Parameter"})(II||(II={}));var TI;(function(n){n[n.Automatic=0]="Automatic",n[n.Explicit=1]="Explicit"})(TI||(TI={}));var NI;(function(n){n[n.DependsOnKbLayout=-1]="DependsOnKbLayout",n[n.Unknown=0]="Unknown",n[n.Backspace=1]="Backspace",n[n.Tab=2]="Tab",n[n.Enter=3]="Enter",n[n.Shift=4]="Shift",n[n.Ctrl=5]="Ctrl",n[n.Alt=6]="Alt",n[n.PauseBreak=7]="PauseBreak",n[n.CapsLock=8]="CapsLock",n[n.Escape=9]="Escape",n[n.Space=10]="Space",n[n.PageUp=11]="PageUp",n[n.PageDown=12]="PageDown",n[n.End=13]="End",n[n.Home=14]="Home",n[n.LeftArrow=15]="LeftArrow",n[n.UpArrow=16]="UpArrow",n[n.RightArrow=17]="RightArrow",n[n.DownArrow=18]="DownArrow",n[n.Insert=19]="Insert",n[n.Delete=20]="Delete",n[n.Digit0=21]="Digit0",n[n.Digit1=22]="Digit1",n[n.Digit2=23]="Digit2",n[n.Digit3=24]="Digit3",n[n.Digit4=25]="Digit4",n[n.Digit5=26]="Digit5",n[n.Digit6=27]="Digit6",n[n.Digit7=28]="Digit7",n[n.Digit8=29]="Digit8",n[n.Digit9=30]="Digit9",n[n.KeyA=31]="KeyA",n[n.KeyB=32]="KeyB",n[n.KeyC=33]="KeyC",n[n.KeyD=34]="KeyD",n[n.KeyE=35]="KeyE",n[n.KeyF=36]="KeyF",n[n.KeyG=37]="KeyG",n[n.KeyH=38]="KeyH",n[n.KeyI=39]="KeyI",n[n.KeyJ=40]="KeyJ",n[n.KeyK=41]="KeyK",n[n.KeyL=42]="KeyL",n[n.KeyM=43]="KeyM",n[n.KeyN=44]="KeyN",n[n.KeyO=45]="KeyO",n[n.KeyP=46]="KeyP",n[n.KeyQ=47]="KeyQ",n[n.KeyR=48]="KeyR",n[n.KeyS=49]="KeyS",n[n.KeyT=50]="KeyT",n[n.KeyU=51]="KeyU",n[n.KeyV=52]="KeyV",n[n.KeyW=53]="KeyW",n[n.KeyX=54]="KeyX",n[n.KeyY=55]="KeyY",n[n.KeyZ=56]="KeyZ",n[n.Meta=57]="Meta",n[n.ContextMenu=58]="ContextMenu",n[n.F1=59]="F1",n[n.F2=60]="F2",n[n.F3=61]="F3",n[n.F4=62]="F4",n[n.F5=63]="F5",n[n.F6=64]="F6",n[n.F7=65]="F7",n[n.F8=66]="F8",n[n.F9=67]="F9",n[n.F10=68]="F10",n[n.F11=69]="F11",n[n.F12=70]="F12",n[n.F13=71]="F13",n[n.F14=72]="F14",n[n.F15=73]="F15",n[n.F16=74]="F16",n[n.F17=75]="F17",n[n.F18=76]="F18",n[n.F19=77]="F19",n[n.F20=78]="F20",n[n.F21=79]="F21",n[n.F22=80]="F22",n[n.F23=81]="F23",n[n.F24=82]="F24",n[n.NumLock=83]="NumLock",n[n.ScrollLock=84]="ScrollLock",n[n.Semicolon=85]="Semicolon",n[n.Equal=86]="Equal",n[n.Comma=87]="Comma",n[n.Minus=88]="Minus",n[n.Period=89]="Period",n[n.Slash=90]="Slash",n[n.Backquote=91]="Backquote",n[n.BracketLeft=92]="BracketLeft",n[n.Backslash=93]="Backslash",n[n.BracketRight=94]="BracketRight",n[n.Quote=95]="Quote",n[n.OEM_8=96]="OEM_8",n[n.IntlBackslash=97]="IntlBackslash",n[n.Numpad0=98]="Numpad0",n[n.Numpad1=99]="Numpad1",n[n.Numpad2=100]="Numpad2",n[n.Numpad3=101]="Numpad3",n[n.Numpad4=102]="Numpad4",n[n.Numpad5=103]="Numpad5",n[n.Numpad6=104]="Numpad6",n[n.Numpad7=105]="Numpad7",n[n.Numpad8=106]="Numpad8",n[n.Numpad9=107]="Numpad9",n[n.NumpadMultiply=108]="NumpadMultiply",n[n.NumpadAdd=109]="NumpadAdd",n[n.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",n[n.NumpadSubtract=111]="NumpadSubtract",n[n.NumpadDecimal=112]="NumpadDecimal",n[n.NumpadDivide=113]="NumpadDivide",n[n.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",n[n.ABNT_C1=115]="ABNT_C1",n[n.ABNT_C2=116]="ABNT_C2",n[n.AudioVolumeMute=117]="AudioVolumeMute",n[n.AudioVolumeUp=118]="AudioVolumeUp",n[n.AudioVolumeDown=119]="AudioVolumeDown",n[n.BrowserSearch=120]="BrowserSearch",n[n.BrowserHome=121]="BrowserHome",n[n.BrowserBack=122]="BrowserBack",n[n.BrowserForward=123]="BrowserForward",n[n.MediaTrackNext=124]="MediaTrackNext",n[n.MediaTrackPrevious=125]="MediaTrackPrevious",n[n.MediaStop=126]="MediaStop",n[n.MediaPlayPause=127]="MediaPlayPause",n[n.LaunchMediaPlayer=128]="LaunchMediaPlayer",n[n.LaunchMail=129]="LaunchMail",n[n.LaunchApp2=130]="LaunchApp2",n[n.Clear=131]="Clear",n[n.MAX_VALUE=132]="MAX_VALUE"})(NI||(NI={}));var RI;(function(n){n[n.Hint=1]="Hint",n[n.Info=2]="Info",n[n.Warning=4]="Warning",n[n.Error=8]="Error"})(RI||(RI={}));var MI;(function(n){n[n.Unnecessary=1]="Unnecessary",n[n.Deprecated=2]="Deprecated"})(MI||(MI={}));var PI;(function(n){n[n.Inline=1]="Inline",n[n.Gutter=2]="Gutter"})(PI||(PI={}));var OI;(function(n){n[n.UNKNOWN=0]="UNKNOWN",n[n.TEXTAREA=1]="TEXTAREA",n[n.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",n[n.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",n[n.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",n[n.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",n[n.CONTENT_TEXT=6]="CONTENT_TEXT",n[n.CONTENT_EMPTY=7]="CONTENT_EMPTY",n[n.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",n[n.CONTENT_WIDGET=9]="CONTENT_WIDGET",n[n.OVERVIEW_RULER=10]="OVERVIEW_RULER",n[n.SCROLLBAR=11]="SCROLLBAR",n[n.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",n[n.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"})(OI||(OI={}));var FI;(function(n){n[n.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",n[n.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",n[n.TOP_CENTER=2]="TOP_CENTER"})(FI||(FI={}));var BI;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=4]="Right",n[n.Full=7]="Full"})(BI||(BI={}));var WI;(function(n){n[n.Left=0]="Left",n[n.Right=1]="Right",n[n.None=2]="None",n[n.LeftOfInjectedText=3]="LeftOfInjectedText",n[n.RightOfInjectedText=4]="RightOfInjectedText"})(WI||(WI={}));var VI;(function(n){n[n.Off=0]="Off",n[n.On=1]="On",n[n.Relative=2]="Relative",n[n.Interval=3]="Interval",n[n.Custom=4]="Custom"})(VI||(VI={}));var zI;(function(n){n[n.None=0]="None",n[n.Text=1]="Text",n[n.Blocks=2]="Blocks"})(zI||(zI={}));var HI;(function(n){n[n.Smooth=0]="Smooth",n[n.Immediate=1]="Immediate"})(HI||(HI={}));var $I;(function(n){n[n.Auto=1]="Auto",n[n.Hidden=2]="Hidden",n[n.Visible=3]="Visible"})($I||($I={}));var UI;(function(n){n[n.LTR=0]="LTR",n[n.RTL=1]="RTL"})(UI||(UI={}));var jI;(function(n){n[n.Invoke=1]="Invoke",n[n.TriggerCharacter=2]="TriggerCharacter",n[n.ContentChange=3]="ContentChange"})(jI||(jI={}));var qI;(function(n){n[n.File=0]="File",n[n.Module=1]="Module",n[n.Namespace=2]="Namespace",n[n.Package=3]="Package",n[n.Class=4]="Class",n[n.Method=5]="Method",n[n.Property=6]="Property",n[n.Field=7]="Field",n[n.Constructor=8]="Constructor",n[n.Enum=9]="Enum",n[n.Interface=10]="Interface",n[n.Function=11]="Function",n[n.Variable=12]="Variable",n[n.Constant=13]="Constant",n[n.String=14]="String",n[n.Number=15]="Number",n[n.Boolean=16]="Boolean",n[n.Array=17]="Array",n[n.Object=18]="Object",n[n.Key=19]="Key",n[n.Null=20]="Null",n[n.EnumMember=21]="EnumMember",n[n.Struct=22]="Struct",n[n.Event=23]="Event",n[n.Operator=24]="Operator",n[n.TypeParameter=25]="TypeParameter"})(qI||(qI={}));var GI;(function(n){n[n.Deprecated=1]="Deprecated"})(GI||(GI={}));var KI;(function(n){n[n.Hidden=0]="Hidden",n[n.Blink=1]="Blink",n[n.Smooth=2]="Smooth",n[n.Phase=3]="Phase",n[n.Expand=4]="Expand",n[n.Solid=5]="Solid"})(KI||(KI={}));var YI;(function(n){n[n.Line=1]="Line",n[n.Block=2]="Block",n[n.Underline=3]="Underline",n[n.LineThin=4]="LineThin",n[n.BlockOutline=5]="BlockOutline",n[n.UnderlineThin=6]="UnderlineThin"})(YI||(YI={}));var ZI;(function(n){n[n.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",n[n.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",n[n.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",n[n.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(ZI||(ZI={}));var XI;(function(n){n[n.None=0]="None",n[n.Same=1]="Same",n[n.Indent=2]="Indent",n[n.DeepIndent=3]="DeepIndent"})(XI||(XI={}));let $1=class{static chord(e,t){return Bn(e,t)}};$1.CtrlCmd=2048;$1.Shift=1024;$1.Alt=512;$1.WinCtrl=256;function EU(){return{editor:void 0,languages:void 0,CancellationTokenSource:Ir,Emitter:B,KeyCode:NI,KeyMod:$1,Position:V,Range:N,Selection:ct,SelectionDirection:UI,MarkerSeverity:RI,MarkerTag:MI,Uri:je,Token:Fb}}class Rge{constructor(e){this.fn=e,this.lastCache=void 0,this.lastArgKey=void 0}get(e){const t=JSON.stringify(e);return this.lastArgKey!==t&&(this.lastArgKey=t,this.lastCache=this.fn(e)),this.lastCache}}class KF{get cachedValues(){return this._map}constructor(e){this.fn=e,this._map=new Map}get(e){if(this._map.has(e))return this._map.get(e);const t=this.fn(e);return this._map.set(e,t),t}}class Wf{constructor(e){this.executor=e,this._didRun=!1}get value(){if(!this._didRun)try{this._value=this.executor()}catch(e){this._error=e}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}var gm;function Mge(n){return!n||typeof n!="string"?!0:n.trim().length===0}const Pge=/{(\d+)}/g;function Bb(n,...e){return e.length===0?n:n.replace(Pge,function(t,i){const s=parseInt(i,10);return isNaN(s)||s<0||s>=e.length?t:e[s]})}function kS(n){return n.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}function xr(n){return n.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function jL(n,e){if(!n||!e)return n;const t=e.length;if(t===0||n.length===0)return n;let i=0;for(;n.indexOf(e,i)===i;)i=i+t;return n.substring(i)}function Oge(n,e){if(!n||!e)return n;const t=e.length,i=n.length;if(t===0||i===0)return n;let s=i,o=-1;for(;o=n.lastIndexOf(e,s-1),!(o===-1||o+t!==s);){if(o===0)return"";s=o}return n.substring(0,s)}function Fge(n){return n.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function AU(n,e,t={}){if(!n)throw new Error("Cannot create regex from empty string");e||(n=xr(n)),t.wholeWord&&(/\B/.test(n.charAt(0))||(n="\\b"+n),/\B/.test(n.charAt(n.length-1))||(n=n+"\\b"));let i="";return t.global&&(i+="g"),t.matchCase||(i+="i"),t.multiline&&(i+="m"),t.unicode&&(i+="u"),new RegExp(n,i)}function Bge(n){return n.source==="^"||n.source==="^$"||n.source==="$"||n.source==="^\\s*$"?!1:!!(n.exec("")&&n.lastIndex===0)}function Vf(n){return n.split(/\r\n|\r|\n/)}function Qs(n){for(let e=0,t=n.length;e=0;t--){const i=n.charCodeAt(t);if(i!==32&&i!==9)return t}return-1}function Wb(n,e){return ne?1:0}function F4(n,e,t=0,i=n.length,s=0,o=e.length){for(;tc)return 1}const r=i-t,a=o-s;return ra?1:0}function YF(n,e){return U1(n,e,0,n.length,0,e.length)}function U1(n,e,t=0,i=n.length,s=0,o=e.length){for(;t=128||c>=128)return F4(n.toLowerCase(),e.toLowerCase(),t,i,s,o);Fg(l)&&(l-=32),Fg(c)&&(c-=32);const d=l-c;if(d!==0)return d}const r=i-t,a=o-s;return ra?1:0}function jy(n){return n>=48&&n<=57}function Fg(n){return n>=97&&n<=122}function qc(n){return n>=65&&n<=90}function Bg(n,e){return n.length===e.length&&U1(n,e)===0}function B4(n,e){const t=e.length;return e.length>n.length?!1:U1(n,e,0,t)===0}function ES(n,e){const t=Math.min(n.length,e.length);let i;for(i=0;i1){const i=n.charCodeAt(e-2);if(sn(i))return W4(i,t)}return t}class V4{get offset(){return this._offset}constructor(e,t=0){this._str=e,this._len=e.length,this._offset=t}setOffset(e){this._offset=e}prevCodePoint(){const e=Wge(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){const e=AS(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}}class IS{get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new V4(e,t)}nextGraphemeLength(){const e=ad.getInstance(),t=this._iterator,i=t.offset;let s=e.getGraphemeBreakType(t.nextCodePoint());for(;!t.eol();){const o=t.offset,r=e.getGraphemeBreakType(t.nextCodePoint());if(ZF(s,r)){t.setOffset(o);break}s=r}return t.offset-i}prevGraphemeLength(){const e=ad.getInstance(),t=this._iterator,i=t.offset;let s=e.getGraphemeBreakType(t.prevCodePoint());for(;t.offset>0;){const o=t.offset,r=e.getGraphemeBreakType(t.prevCodePoint());if(ZF(r,s)){t.setOffset(o);break}s=r}return i-t.offset}eol(){return this._iterator.eol()}}function z4(n,e){return new IS(n,e).nextGraphemeLength()}function IU(n,e){return new IS(n,e).prevGraphemeLength()}function Vge(n,e){e>0&&pm(n.charCodeAt(e))&&e--;const t=e+z4(n,e);return[t-IU(n,t),t]}let Jk;function zge(){return/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/}function Vb(n){return Jk||(Jk=zge()),Jk.test(n)}const Hge=/^[\t\n\r\x20-\x7E]*$/;function H4(n){return Hge.test(n)}const TU=/[\u2028\u2029]/;function NU(n){return TU.test(n)}function eu(n){return n>=11904&&n<=55215||n>=63744&&n<=64255||n>=65281&&n<=65374}function $4(n){return n>=127462&&n<=127487||n===8986||n===8987||n===9200||n===9203||n>=9728&&n<=10175||n===11088||n===11093||n>=127744&&n<=128591||n>=128640&&n<=128764||n>=128992&&n<=129008||n>=129280&&n<=129535||n>=129648&&n<=129782}const $ge="\uFEFF";function U4(n){return!!(n&&n.length>0&&n.charCodeAt(0)===65279)}function Uge(n,e=!1){return n?(e&&(n=n.replace(/\\./g,"")),n.toLowerCase()!==n):!1}function RU(n){return n=n%(2*26),n<26?String.fromCharCode(97+n):String.fromCharCode(65+n-26)}function ZF(n,e){return n===0?e!==5&&e!==7:n===2&&e===3?!1:n===4||n===2||n===3||e===4||e===2||e===3?!0:!(n===8&&(e===8||e===9||e===11||e===12)||(n===11||n===9)&&(e===9||e===10)||(n===12||n===10)&&e===10||e===5||e===13||e===7||n===1||n===13&&e===14||n===6&&e===6)}class ad{static getInstance(){return ad._INSTANCE||(ad._INSTANCE=new ad),ad._INSTANCE}constructor(){this._data=jge()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;const t=this._data,i=t.length/3;let s=1;for(;s<=i;)if(et[3*s+1])s=2*s+1;else return t[3*s+2];return 0}}ad._INSTANCE=null;function jge(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}function qge(n,e){if(n===0)return 0;const t=Gge(n,e);if(t!==void 0)return t;const i=new V4(e,n);return i.prevCodePoint(),i.offset}function Gge(n,e){const t=new V4(e,n);let i=t.prevCodePoint();for(;Kge(i)||i===65039||i===8419;){if(t.offset===0)return;i=t.prevCodePoint()}if(!$4(i))return;let s=t.offset;return s>0&&t.prevCodePoint()===8205&&(s=t.offset),s}function Kge(n){return 127995<=n&&n<=127999}class _f{static getInstance(e){return gm.cache.get(Array.from(e))}static getLocales(){return gm._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}getPrimaryConfusable(e){return this.confusableDictionary.get(e)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}}gm=_f;_f.ambiguousCharacterData=new Wf(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,8218,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,8242,96,1370,96,1523,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71922,67,71913,67,65315,67,8557,67,8450,67,8493,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71919,87,71910,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,66293,90,71909,90,65338,90,8484,90,8488,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65297,49,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"cs":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"es":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"fr":[65374,126,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"it":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ja":[8211,45,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65292,44,65307,59],"ko":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pt-BR":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ru":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"zh-hans":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41],"zh-hant":[8211,45,65374,126,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65307,59]}'));_f.cache=new Rge(n=>{function e(c){const d=new Map;for(let u=0;u!c.startsWith("_")&&c in s);o.length===0&&(o=["_default"]);let r;for(const c of o){const d=e(s[c]);r=i(r,d)}const a=e(s._common),l=t(a,r);return new gm(l)});_f._locales=new Wf(()=>Object.keys(gm.ambiguousCharacterData.value).filter(n=>!n.startsWith("_")));class Ed{static getRawData(){return JSON.parse("[9,10,11,12,13,32,127,160,173,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12288,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999]")}static getData(){return this._data||(this._data=new Set(Ed.getRawData())),this._data}static isInvisibleCharacter(e){return Ed.getData().has(e)}static get codePoints(){return Ed.getData()}}Ed._data=void 0;class JI{constructor(){this._zoomFactor=1}getZoomFactor(){return this._zoomFactor}}JI.INSTANCE=new JI;class Yge extends Y{constructor(){super(),this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(!0),this._mediaQueryList=null,this._handleChange(!1)}_handleChange(e){var t;(t=this._mediaQueryList)===null||t===void 0||t.removeEventListener("change",this._listener),this._mediaQueryList=window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),e&&this._onDidChange.fire()}}class Zge extends Y{get value(){return this._value}constructor(){super(),this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio();const e=this._register(new Yge);this._register(e.onDidChange(()=>{this._value=this._getPixelRatio(),this._onDidChange.fire(this._value)}))}_getPixelRatio(){const e=document.createElement("canvas").getContext("2d"),t=window.devicePixelRatio||1,i=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return t/i}}class Xge{constructor(){this._pixelRatioMonitor=null}_getOrCreatePixelRatioMonitor(){return this._pixelRatioMonitor||(this._pixelRatioMonitor=new Zge),this._pixelRatioMonitor}get value(){return this._getOrCreatePixelRatioMonitor().value}get onDidChange(){return this._getOrCreatePixelRatioMonitor().onDidChange}}function MU(n,e){typeof n=="string"&&(n=window.matchMedia(n)),n.addEventListener("change",e)}const TS=new Xge;function Qge(){return JI.INSTANCE.getZoomFactor()}const t0=navigator.userAgent,Lr=t0.indexOf("Firefox")>=0,qh=t0.indexOf("AppleWebKit")>=0,j4=t0.indexOf("Chrome")>=0,bc=!j4&&t0.indexOf("Safari")>=0,PU=!j4&&!bc&&qh;t0.indexOf("Electron/")>=0;const XF=t0.indexOf("Android")>=0;let hC=!1;if(window.matchMedia){const n=window.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=window.matchMedia("(display-mode: fullscreen)");hC=n.matches,MU(n,({matches:t})=>{hC&&e.matches||(hC=t)})}function Jge(){return hC}class OU{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingLeft="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){const t=Fr(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=Fr(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=Fr(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=Fr(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=Fr(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=Fr(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=Fr(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingLeft(e){const t=Fr(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){const t=Fr(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){const t=Fr(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=Fr(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}}function Fr(n){return typeof n=="number"?`${n}px`:n}function vt(n){return new OU(n)}function Mn(n,e){n instanceof OU?(n.setFontFamily(e.getMassagedFontFamily()),n.setFontWeight(e.fontWeight),n.setFontSize(e.fontSize),n.setFontFeatureSettings(e.fontFeatureSettings),n.setFontVariationSettings(e.fontVariationSettings),n.setLineHeight(e.lineHeight),n.setLetterSpacing(e.letterSpacing)):(n.style.fontFamily=e.getMassagedFontFamily(),n.style.fontWeight=e.fontWeight,n.style.fontSize=e.fontSize+"px",n.style.fontFeatureSettings=e.fontFeatureSettings,n.style.fontVariationSettings=e.fontVariationSettings,n.style.lineHeight=e.lineHeight+"px",n.style.letterSpacing=e.letterSpacing+"px")}class epe{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class q4{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(){this._createDomElements(),document.body.appendChild(this._container),this._readFromDomElements(),document.body.removeChild(this._container),this._container=null,this._testElements=null}_createDomElements(){const e=document.createElement("div");e.style.position="absolute",e.style.top="-50000px",e.style.width="50000px";const t=document.createElement("div");Mn(t,this._bareFontInfo),e.appendChild(t);const i=document.createElement("div");Mn(i,this._bareFontInfo),i.style.fontWeight="bold",e.appendChild(i);const s=document.createElement("div");Mn(s,this._bareFontInfo),s.style.fontStyle="italic",e.appendChild(s);const o=[];for(const r of this._requests){let a;r.type===0&&(a=t),r.type===2&&(a=i),r.type===1&&(a=s),a.appendChild(document.createElement("br"));const l=document.createElement("span");q4._render(l,r),a.appendChild(l),o.push(l)}this._container=e,this._testElements=o}static _render(e,t){if(t.chr===" "){let i=" ";for(let s=0;s<8;s++)i+=i;e.innerText=i}else{let i=t.chr;for(let s=0;s<8;s++)i+=i;e.textContent=i}}_readFromDomElements(){for(let e=0,t=this._requests.length;e{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings()},5e3))}_evictUntrustedReadings(){const e=this._cache.getValues();let t=!1;for(const i of e)i.isTrusted||(t=!0,this._cache.remove(i));t&&this._onDidChange.fire()}readFontInfo(e){if(!this._cache.has(e)){let t=this._actualReadFontInfo(e);(t.typicalHalfwidthCharacterWidth<=2||t.typicalFullwidthCharacterWidth<=2||t.spaceWidth<=2||t.maxDigitWidth<=2)&&(t=new eT({pixelRatio:TS.value,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,fontVariationSettings:t.fontVariationSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:t.isMonospace,typicalHalfwidthCharacterWidth:Math.max(t.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(t.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:t.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(t.spaceWidth,5),middotWidth:Math.max(t.middotWidth,5),wsmiddotWidth:Math.max(t.wsmiddotWidth,5),maxDigitWidth:Math.max(t.maxDigitWidth,5)},!1)),this._writeToCache(e,t)}return this._cache.get(e)}_createRequest(e,t,i,s){const o=new epe(e,t);return i.push(o),s==null||s.push(o),o}_actualReadFontInfo(e){const t=[],i=[],s=this._createRequest("n",0,t,i),o=this._createRequest("m",0,t,null),r=this._createRequest(" ",0,t,i),a=this._createRequest("0",0,t,i),l=this._createRequest("1",0,t,i),c=this._createRequest("2",0,t,i),d=this._createRequest("3",0,t,i),u=this._createRequest("4",0,t,i),h=this._createRequest("5",0,t,i),f=this._createRequest("6",0,t,i),g=this._createRequest("7",0,t,i),p=this._createRequest("8",0,t,i),_=this._createRequest("9",0,t,i),v=this._createRequest("→",0,t,i),b=this._createRequest("→",0,t,null),y=this._createRequest("·",0,t,i),w=this._createRequest("⸱",0,t,null),C="|/-_ilm%";for(let P=0,O=C.length;P.001){x=!1;break}}let k=!0;return x&&b.width!==D&&(k=!1),b.width>v.width&&(k=!1),new eT({pixelRatio:TS.value,fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontSize:e.fontSize,fontFeatureSettings:e.fontFeatureSettings,fontVariationSettings:e.fontVariationSettings,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,isMonospace:x,typicalHalfwidthCharacterWidth:s.width,typicalFullwidthCharacterWidth:o.width,canUseHalfwidthRightwardsArrow:k,spaceWidth:r.width,middotWidth:y.width,wsmiddotWidth:w.width,maxDigitWidth:L},!0)}}class QF{constructor(){this._keys=Object.create(null),this._values=Object.create(null)}has(e){const t=e.getId();return!!this._values[t]}get(e){const t=e.getId();return this._values[t]}put(e,t){const i=e.getId();this._keys[i]=e,this._values[i]=t}remove(e){const t=e.getId();delete this._keys[t],delete this._values[t]}getValues(){return Object.keys(this._keys).map(e=>this._values[e])}}const tT=new spe;var ta;(function(n){n.serviceIds=new Map,n.DI_TARGET="$di$target",n.DI_DEPENDENCIES="$di$dependencies";function e(t){return t[n.DI_DEPENDENCIES]||[]}n.getServiceDependencies=e})(ta||(ta={}));const yt=at("instantiationService");function ope(n,e,t){e[ta.DI_TARGET]===e?e[ta.DI_DEPENDENCIES].push({id:n,index:t}):(e[ta.DI_DEPENDENCIES]=[{id:n,index:t}],e[ta.DI_TARGET]=e)}function at(n){if(ta.serviceIds.has(n))return ta.serviceIds.get(n);const e=function(t,i,s){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");ope(e,t,s)};return e.toString=()=>n,ta.serviceIds.set(n,e),e}const qt=at("codeEditorService"),fs=at("modelService"),xu=at("textModelService");var mm=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class Do extends Y{constructor(e,t="",i="",s=!0,o){super(),this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=e,this._label=t,this._cssClass=i,this._enabled=s,this._actionCallback=o}get id(){return this._id}get label(){return this._label}set label(e){this._setLabel(e)}_setLabel(e){this._label!==e&&(this._label=e,this._onDidChange.fire({label:e}))}get tooltip(){return this._tooltip||""}set tooltip(e){this._setTooltip(e)}_setTooltip(e){this._tooltip!==e&&(this._tooltip=e,this._onDidChange.fire({tooltip:e}))}get class(){return this._cssClass}set class(e){this._setClass(e)}_setClass(e){this._cssClass!==e&&(this._cssClass=e,this._onDidChange.fire({class:e}))}get enabled(){return this._enabled}set enabled(e){this._setEnabled(e)}_setEnabled(e){this._enabled!==e&&(this._enabled=e,this._onDidChange.fire({enabled:e}))}get checked(){return this._checked}set checked(e){this._setChecked(e)}_setChecked(e){this._checked!==e&&(this._checked=e,this._onDidChange.fire({checked:e}))}run(e,t){return mm(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(e))})}}class _m extends Y{constructor(){super(...arguments),this._onWillRun=this._register(new B),this.onWillRun=this._onWillRun.event,this._onDidRun=this._register(new B),this.onDidRun=this._onDidRun.event}run(e,t){return mm(this,void 0,void 0,function*(){if(!e.enabled)return;this._onWillRun.fire({action:e});let i;try{yield this.runAction(e,t)}catch(s){i=s}this._onDidRun.fire({action:e,error:i})})}runAction(e,t){return mm(this,void 0,void 0,function*(){yield e.run(t)})}}class Pn{constructor(){this.id=Pn.ID,this.label="",this.tooltip="",this.class="separator",this.enabled=!1,this.checked=!1}static join(...e){let t=[];for(const i of e)i.length&&(t.length?t=[...t,new Pn,...i]:t=i);return t}run(){return mm(this,void 0,void 0,function*(){})}}Pn.ID="vs.actions.separator";class qL{get actions(){return this._actions}constructor(e,t,i,s){this.tooltip="",this.enabled=!0,this.checked=void 0,this.id=e,this.label=t,this.class=s,this._actions=i}run(){return mm(this,void 0,void 0,function*(){})}}class GL extends Do{constructor(){super(GL.ID,m("submenu.empty","(empty)"),void 0,!1)}}GL.ID="vs.actions.empty";function T_(n){var e,t;return{id:n.id,label:n.label,class:void 0,enabled:(e=n.enabled)!==null&&e!==void 0?e:!0,checked:(t=n.checked)!==null&&t!==void 0?t:!1,run:(...i)=>mm(this,void 0,void 0,function*(){return n.run(...i)}),tooltip:n.label}}var iT;(function(n){function e(t){return t&&typeof t=="object"&&typeof t.id=="string"}n.isThemeColor=e})(iT||(iT={}));var Te;(function(n){n.iconNameSegment="[A-Za-z0-9]+",n.iconNameExpression="[A-Za-z0-9-]+",n.iconModifierExpression="~[A-Za-z]+",n.iconNameCharacter="[A-Za-z0-9~-]";const e=new RegExp(`^(${n.iconNameExpression})(${n.iconModifierExpression})?$`);function t(h){const f=e.exec(h.id);if(!f)return t(se.error);const[,g,p]=f,_=["codicon","codicon-"+g];return p&&_.push("codicon-modifier-"+p.substring(1)),_}n.asClassNameArray=t;function i(h){return t(h).join(" ")}n.asClassName=i;function s(h){return"."+t(h).join(".")}n.asCSSSelector=s;function o(h){return h&&typeof h=="object"&&typeof h.id=="string"&&(typeof h.color>"u"||iT.isThemeColor(h.color))}n.isThemeIcon=o;const r=new RegExp(`^\\$\\((${n.iconNameExpression}(?:${n.iconModifierExpression})?)\\)$`);function a(h){const f=r.exec(h);if(!f)return;const[,g]=f;return{id:g}}n.fromString=a;function l(h){return{id:h}}n.fromId=l;function c(h,f){let g=h.id;const p=g.lastIndexOf("~");return p!==-1&&(g=g.substring(0,p)),f&&(g=`${g}~${f}`),{id:g}}n.modify=c;function d(h){const f=h.id.lastIndexOf("~");if(f!==-1)return h.id.substring(f+1)}n.getModifier=d;function u(h,f){var g,p;return h.id===f.id&&((g=h.color)===null||g===void 0?void 0:g.id)===((p=f.color)===null||p===void 0?void 0:p.id)}n.isEqual=u})(Te||(Te={}));const gs=at("commandService"),Zt=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new B,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(n,e){if(!n)throw new Error("invalid command");if(typeof n=="string"){if(!e)throw new Error("invalid command");return this.registerCommand({id:n,handler:e})}if(n.description){const r=[];for(const l of n.description.args)r.push(l.constraint);const a=n.handler;n.handler=function(l,...c){return zhe(c,r),a(l,...c)}}const{id:t}=n;let i=this._commands.get(t);i||(i=new ks,this._commands.set(t,i));const s=i.unshift(n),o=Ze(()=>{s();const r=this._commands.get(t);r!=null&&r.isEmpty()&&this._commands.delete(t)});return this._onDidRegisterCommand.fire(t),o}registerCommandAlias(n,e){return Zt.registerCommand(n,(t,...i)=>t.get(gs).executeCommand(e,...i))}getCommand(n){const e=this._commands.get(n);if(!(!e||e.isEmpty()))return ht.first(e)}getCommands(){const n=new Map;for(const e of this._commands.keys()){const t=this.getCommand(e);t&&n.set(e,t)}return n}};Zt.registerCommand("noop",()=>{});function t2(...n){switch(n.length){case 1:return m("contextkey.scanner.hint.didYouMean1","Did you mean {0}?",n[0]);case 2:return m("contextkey.scanner.hint.didYouMean2","Did you mean {0} or {1}?",n[0],n[1]);case 3:return m("contextkey.scanner.hint.didYouMean3","Did you mean {0}, {1} or {2}?",n[0],n[1],n[2]);default:return}}const rpe=m("contextkey.scanner.hint.didYouForgetToOpenOrCloseQuote","Did you forget to open or close the quote?"),ape=m("contextkey.scanner.hint.didYouForgetToEscapeSlash","Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'.");class Ia{constructor(){this._input="",this._start=0,this._current=0,this._tokens=[],this._errors=[],this.stringRe=/[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy}static getLexeme(e){switch(e.type){case 0:return"(";case 1:return")";case 2:return"!";case 3:return e.isTripleEq?"===":"==";case 4:return e.isTripleEq?"!==":"!=";case 5:return"<";case 6:return"<=";case 7:return">=";case 8:return">=";case 9:return"=~";case 10:return e.lexeme;case 11:return"true";case 12:return"false";case 13:return"in";case 14:return"not";case 15:return"&&";case 16:return"||";case 17:return e.lexeme;case 18:return e.lexeme;case 19:return e.lexeme;case 20:return"EOF";default:throw I4(`unhandled token type: ${JSON.stringify(e)}; have you forgotten to add a case?`)}}reset(e){return this._input=e,this._start=0,this._current=0,this._tokens=[],this._errors=[],this}scan(){for(;!this._isAtEnd();)switch(this._start=this._current,this._advance()){case 40:this._addToken(0);break;case 41:this._addToken(1);break;case 33:if(this._match(61)){const t=this._match(61);this._tokens.push({type:4,offset:this._start,isTripleEq:t})}else this._addToken(2);break;case 39:this._quotedString();break;case 47:this._regex();break;case 61:if(this._match(61)){const t=this._match(61);this._tokens.push({type:3,offset:this._start,isTripleEq:t})}else this._match(126)?this._addToken(9):this._error(t2("==","=~"));break;case 60:this._addToken(this._match(61)?6:5);break;case 62:this._addToken(this._match(61)?8:7);break;case 38:this._match(38)?this._addToken(15):this._error(t2("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(t2("||"));break;case 32:case 13:case 9:case 10:case 160:break;default:this._string()}return this._start=this._current,this._addToken(20),Array.from(this._tokens)}_match(e){return this._isAtEnd()||this._input.charCodeAt(this._current)!==e?!1:(this._current++,!0)}_advance(){return this._input.charCodeAt(this._current++)}_peek(){return this._isAtEnd()?0:this._input.charCodeAt(this._current)}_addToken(e){this._tokens.push({type:e,offset:this._start})}_error(e){const t=this._start,i=this._input.substring(this._start,this._current),s={type:19,offset:this._start,lexeme:i};this._errors.push({offset:t,lexeme:i,additionalInfo:e}),this._tokens.push(s)}_string(){this.stringRe.lastIndex=this._start;const e=this.stringRe.exec(this._input);if(e){this._current=this._start+e[0].length;const t=this._input.substring(this._start,this._current),i=Ia._keywords.get(t);i?this._addToken(i):this._tokens.push({type:17,lexeme:t,offset:this._start})}}_quotedString(){for(;this._peek()!==39&&!this._isAtEnd();)this._advance();if(this._isAtEnd()){this._error(rpe);return}this._advance(),this._tokens.push({type:18,lexeme:this._input.substring(this._start+1,this._current-1),offset:this._start+1})}_regex(){let e=this._current,t=!1,i=!1;for(;;){if(e>=this._input.length){this._current=e,this._error(ape);return}const o=this._input.charCodeAt(e);if(t)t=!1;else if(o===47&&!i){e++;break}else o===91?i=!0:o===92?t=!0:o===93&&(i=!1);e++}for(;e=this._input.length}}Ia._regexFlags=new Set(["i","g","s","m","y","u"].map(n=>n.charCodeAt(0)));Ia._keywords=new Map([["not",14],["in",13],["false",12],["true",11]]);const Wn=new Map;Wn.set("false",!1);Wn.set("true",!0);Wn.set("isMac",mt);Wn.set("isLinux",Jn);Wn.set("isWindows",Fs);Wn.set("isWeb",Qm);Wn.set("isMacNative",mt&&!Qm);Wn.set("isEdge",nfe);Wn.set("isFirefox",tfe);Wn.set("isChrome",lU);Wn.set("isSafari",ife);const lpe=Object.prototype.hasOwnProperty,cpe={regexParsingWithErrorRecovery:!0},dpe=m("contextkey.parser.error.emptyString","Empty context key expression"),upe=m("contextkey.parser.error.emptyString.hint","Did you forget to write an expression? You can also put 'false' or 'true' to always evaluate to false or true, respectively."),hpe=m("contextkey.parser.error.noInAfterNot","'in' after 'not'."),JF=m("contextkey.parser.error.closingParenthesis","closing parenthesis ')'"),fpe=m("contextkey.parser.error.unexpectedToken","Unexpected token"),gpe=m("contextkey.parser.error.unexpectedToken.hint","Did you forget to put && or || before the token?"),ppe=m("contextkey.parser.error.unexpectedEOF","Unexpected end of expression"),mpe=m("contextkey.parser.error.unexpectedEOF.hint","Did you forget to put a context key?");let FU=class i_{constructor(e=cpe){this._config=e,this._scanner=new Ia,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(e){if(e===""){this._parsingErrors.push({message:dpe,offset:0,lexeme:"",additionalInfo:upe});return}this._tokens=this._scanner.reset(e).scan(),this._current=0,this._parsingErrors=[];try{const t=this._expr();if(!this._isAtEnd()){const i=this._peek(),s=i.type===17?gpe:void 0;throw this._parsingErrors.push({message:fpe,offset:i.offset,lexeme:Ia.getLexeme(i),additionalInfo:s}),i_._parseError}return t}catch(t){if(t!==i_._parseError)throw t;return}}_expr(){return this._or()}_or(){const e=[this._and()];for(;this._matchOne(16);){const t=this._and();e.push(t)}return e.length===1?e[0]:xe.or(...e)}_and(){const e=[this._term()];for(;this._matchOne(15);){const t=this._term();e.push(t)}return e.length===1?e[0]:xe.and(...e)}_term(){if(this._matchOne(2)){const e=this._peek();switch(e.type){case 11:return this._advance(),us.INSTANCE;case 12:return this._advance(),Bs.INSTANCE;case 0:{this._advance();const t=this._expr();return this._consume(1,JF),t==null?void 0:t.negate()}case 17:return this._advance(),$f.create(e.lexeme);default:throw this._errExpectedButGot("KEY | true | false | '(' expression ')'",e)}}return this._primary()}_primary(){const e=this._peek();switch(e.type){case 11:return this._advance(),xe.true();case 12:return this._advance(),xe.false();case 0:{this._advance();const t=this._expr();return this._consume(1,JF),t}case 17:{const t=e.lexeme;if(this._advance(),this._matchOne(9)){const s=this._peek();if(!this._config.regexParsingWithErrorRecovery){if(this._advance(),s.type!==10)throw this._errExpectedButGot("REGEX",s);const o=s.lexeme,r=o.lastIndexOf("/"),a=r===o.length-1?void 0:this._removeFlagsGY(o.substring(r+1));let l;try{l=new RegExp(o.substring(1,r),a)}catch{throw this._errExpectedButGot("REGEX",s)}return zb.create(t,l)}switch(s.type){case 10:case 19:{const o=[s.lexeme];this._advance();let r=this._peek(),a=0;for(let h=0;h=0){const c=o.slice(a+1,l),d=o[l+1]==="i"?"i":"";try{r=new RegExp(c,d)}catch{throw this._errExpectedButGot("REGEX",s)}}}if(r===null)throw this._errExpectedButGot("REGEX",s);return zb.create(t,r)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,hpe);const s=this._value();return xe.notIn(t,s)}switch(this._peek().type){case 3:{this._advance();const s=this._value();if(this._previous().type===18)return xe.equals(t,s);switch(s){case"true":return xe.has(t);case"false":return xe.not(t);default:return xe.equals(t,s)}}case 4:{this._advance();const s=this._value();if(this._previous().type===18)return xe.notEquals(t,s);switch(s){case"true":return xe.not(t);case"false":return xe.has(t);default:return xe.notEquals(t,s)}}case 5:return this._advance(),eD.create(t,this._value());case 6:return this._advance(),tD.create(t,this._value());case 7:return this._advance(),QL.create(t,this._value());case 8:return this._advance(),JL.create(t,this._value());case 13:return this._advance(),xe.in(t,this._value());default:return xe.has(t)}}case 20:throw this._parsingErrors.push({message:ppe,offset:e.offset,lexeme:"",additionalInfo:mpe}),i_._parseError;default:throw this._errExpectedButGot(`true | false | KEY +`))}}class Gk{constructor(e){this.value=e}}const Cge=2;let B=class{constructor(e){var t,i,s,o,r;this._size=0,this._options=e,this._leakageMon=!((t=this._options)===null||t===void 0)&&t.leakWarningThreshold?new wge((s=(i=this._options)===null||i===void 0?void 0:i.leakWarningThreshold)!==null&&s!==void 0?s:yge):void 0,this._perfMon=!((o=this._options)===null||o===void 0)&&o._profName?new mm(this._options._profName):void 0,this._deliveryQueue=(r=this._options)===null||r===void 0?void 0:r.deliveryQueue}dispose(){var e,t,i,s;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)===null||e===void 0?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(i=(t=this._options)===null||t===void 0?void 0:t.onDidRemoveLastListener)===null||i===void 0||i.call(t),(s=this._leakageMon)===null||s===void 0||s.dispose())}get event(){var e;return(e=this._event)!==null&&e!==void 0||(this._event=(t,i,s)=>{var o,r,a,l,c;if(this._leakageMon&&this._size>this._leakageMon.threshold*3)return console.warn(`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far`),Y.None;if(this._disposed)return Y.None;i&&(t=t.bind(i));const d=new Gk(t);let u;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(d.stack=I4.create(),u=this._leakageMon.check(d.stack,this._size+1)),this._listeners?this._listeners instanceof Gk?((c=this._deliveryQueue)!==null&&c!==void 0||(this._deliveryQueue=new gU),this._listeners=[this._listeners,d]):this._listeners.push(d):((r=(o=this._options)===null||o===void 0?void 0:o.onWillAddFirstListener)===null||r===void 0||r.call(o,this),this._listeners=d,(l=(a=this._options)===null||a===void 0?void 0:a.onDidAddFirstListener)===null||l===void 0||l.call(a,this)),this._size++;const h=Ye(()=>{u==null||u(),this._removeListener(d)});return s instanceof pe?s.add(h):Array.isArray(s)&&s.push(h),h}),this._event}_removeListener(e){var t,i,s,o;if((i=(t=this._options)===null||t===void 0?void 0:t.onWillRemoveListener)===null||i===void 0||i.call(t,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(o=(s=this._options)===null||s===void 0?void 0:s.onDidRemoveLastListener)===null||o===void 0||o.call(s,this),this._size=0;return}const r=this._listeners,a=r.indexOf(e);if(a===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,r[a]=void 0;const l=this._deliveryQueue.current===this;if(this._size*Cge<=r.length){let c=0;for(let d=0;d0}};const Sge=()=>new gU;class gU{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}class Bb extends B{constructor(e){super(e),this._isPaused=0,this._eventQueue=new Ds,this._mergeFn=e==null?void 0:e.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){const e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(this._isPaused!==0?this._eventQueue.push(e):super.fire(e))}}class pU extends Bb{constructor(e){var t;super(e),this._delay=(t=e.delay)!==null&&t!==void 0?t:100}fire(e){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}}class xge extends B{constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e==null?void 0:e.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),this._queuedEvents.length===1&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(t=>super.fire(t)),this._queuedEvents=[]}))}}class Lge{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new B({onWillAddFirstListener:()=>this.onFirstListenerAdd(),onDidRemoveLastListener:()=>this.onLastListenerRemove()})}get event(){return this.emitter.event}add(e){const t={event:e,listener:null};return this.events.push(t),this.hasListeners&&this.hook(t),Ye(pm(()=>{this.hasListeners&&this.unhook(t);const s=this.events.indexOf(t);this.events.splice(s,1)}))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach(e=>this.hook(e))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach(e=>this.unhook(e))}hook(e){e.listener=e.event(t=>this.emitter.fire(t))}unhook(e){e.listener&&e.listener.dispose(),e.listener=null}dispose(){this.emitter.dispose()}}class T4{constructor(){this.buffers=[]}wrapEvent(e){return(t,i,s)=>e(o=>{const r=this.buffers[this.buffers.length-1];r?r.push(()=>t.call(i,o)):t.call(i,o)},void 0,s)}bufferEvents(e){const t=[];this.buffers.push(t);const i=e();return this.buffers.pop(),t.forEach(s=>s()),i}}class PF{constructor(){this.listening=!1,this.inputEvent=ue.None,this.inputEventListener=Y.None,this.emitter=new B({onDidAddFirstListener:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onDidRemoveLastListener:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}const mU=Object.freeze(function(n,e){const t=setTimeout(n.bind(e),0);return{dispose(){clearTimeout(t)}}});var rn;(function(n){function e(t){return t===n.None||t===n.Cancelled||t instanceof sC?!0:!t||typeof t!="object"?!1:typeof t.isCancellationRequested=="boolean"&&typeof t.onCancellationRequested=="function"}n.isCancellationToken=e,n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:ue.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:mU})})(rn||(rn={}));class sC{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?mU:(this._emitter||(this._emitter=new B),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}let Ar=class{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new sC),this._token}cancel(){this._token?this._token instanceof sC&&this._token.cancel():this._token=rn.Cancelled}dispose(e=!1){var t;e&&this.cancel(),(t=this._parentListener)===null||t===void 0||t.dispose(),this._token?this._token instanceof sC&&this._token.dispose():this._token=rn.None}};class N4{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}}const oC=new N4,nI=new N4,sI=new N4,_U=new Array(230),Dge=Object.create(null),kge=Object.create(null),R4=[];for(let n=0;n<=193;n++)R4[n]=-1;(function(){const n="",e=[[1,0,"None",0,"unknown",0,"VK_UNKNOWN",n,n],[1,1,"Hyper",0,n,0,n,n,n],[1,2,"Super",0,n,0,n,n,n],[1,3,"Fn",0,n,0,n,n,n],[1,4,"FnLock",0,n,0,n,n,n],[1,5,"Suspend",0,n,0,n,n,n],[1,6,"Resume",0,n,0,n,n,n],[1,7,"Turbo",0,n,0,n,n,n],[1,8,"Sleep",0,n,0,"VK_SLEEP",n,n],[1,9,"WakeUp",0,n,0,n,n,n],[0,10,"KeyA",31,"A",65,"VK_A",n,n],[0,11,"KeyB",32,"B",66,"VK_B",n,n],[0,12,"KeyC",33,"C",67,"VK_C",n,n],[0,13,"KeyD",34,"D",68,"VK_D",n,n],[0,14,"KeyE",35,"E",69,"VK_E",n,n],[0,15,"KeyF",36,"F",70,"VK_F",n,n],[0,16,"KeyG",37,"G",71,"VK_G",n,n],[0,17,"KeyH",38,"H",72,"VK_H",n,n],[0,18,"KeyI",39,"I",73,"VK_I",n,n],[0,19,"KeyJ",40,"J",74,"VK_J",n,n],[0,20,"KeyK",41,"K",75,"VK_K",n,n],[0,21,"KeyL",42,"L",76,"VK_L",n,n],[0,22,"KeyM",43,"M",77,"VK_M",n,n],[0,23,"KeyN",44,"N",78,"VK_N",n,n],[0,24,"KeyO",45,"O",79,"VK_O",n,n],[0,25,"KeyP",46,"P",80,"VK_P",n,n],[0,26,"KeyQ",47,"Q",81,"VK_Q",n,n],[0,27,"KeyR",48,"R",82,"VK_R",n,n],[0,28,"KeyS",49,"S",83,"VK_S",n,n],[0,29,"KeyT",50,"T",84,"VK_T",n,n],[0,30,"KeyU",51,"U",85,"VK_U",n,n],[0,31,"KeyV",52,"V",86,"VK_V",n,n],[0,32,"KeyW",53,"W",87,"VK_W",n,n],[0,33,"KeyX",54,"X",88,"VK_X",n,n],[0,34,"KeyY",55,"Y",89,"VK_Y",n,n],[0,35,"KeyZ",56,"Z",90,"VK_Z",n,n],[0,36,"Digit1",22,"1",49,"VK_1",n,n],[0,37,"Digit2",23,"2",50,"VK_2",n,n],[0,38,"Digit3",24,"3",51,"VK_3",n,n],[0,39,"Digit4",25,"4",52,"VK_4",n,n],[0,40,"Digit5",26,"5",53,"VK_5",n,n],[0,41,"Digit6",27,"6",54,"VK_6",n,n],[0,42,"Digit7",28,"7",55,"VK_7",n,n],[0,43,"Digit8",29,"8",56,"VK_8",n,n],[0,44,"Digit9",30,"9",57,"VK_9",n,n],[0,45,"Digit0",21,"0",48,"VK_0",n,n],[1,46,"Enter",3,"Enter",13,"VK_RETURN",n,n],[1,47,"Escape",9,"Escape",27,"VK_ESCAPE",n,n],[1,48,"Backspace",1,"Backspace",8,"VK_BACK",n,n],[1,49,"Tab",2,"Tab",9,"VK_TAB",n,n],[1,50,"Space",10,"Space",32,"VK_SPACE",n,n],[0,51,"Minus",88,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[0,52,"Equal",86,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[0,53,"BracketLeft",92,"[",219,"VK_OEM_4","[","OEM_4"],[0,54,"BracketRight",94,"]",221,"VK_OEM_6","]","OEM_6"],[0,55,"Backslash",93,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,56,"IntlHash",0,n,0,n,n,n],[0,57,"Semicolon",85,";",186,"VK_OEM_1",";","OEM_1"],[0,58,"Quote",95,"'",222,"VK_OEM_7","'","OEM_7"],[0,59,"Backquote",91,"`",192,"VK_OEM_3","`","OEM_3"],[0,60,"Comma",87,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[0,61,"Period",89,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[0,62,"Slash",90,"/",191,"VK_OEM_2","/","OEM_2"],[1,63,"CapsLock",8,"CapsLock",20,"VK_CAPITAL",n,n],[1,64,"F1",59,"F1",112,"VK_F1",n,n],[1,65,"F2",60,"F2",113,"VK_F2",n,n],[1,66,"F3",61,"F3",114,"VK_F3",n,n],[1,67,"F4",62,"F4",115,"VK_F4",n,n],[1,68,"F5",63,"F5",116,"VK_F5",n,n],[1,69,"F6",64,"F6",117,"VK_F6",n,n],[1,70,"F7",65,"F7",118,"VK_F7",n,n],[1,71,"F8",66,"F8",119,"VK_F8",n,n],[1,72,"F9",67,"F9",120,"VK_F9",n,n],[1,73,"F10",68,"F10",121,"VK_F10",n,n],[1,74,"F11",69,"F11",122,"VK_F11",n,n],[1,75,"F12",70,"F12",123,"VK_F12",n,n],[1,76,"PrintScreen",0,n,0,n,n,n],[1,77,"ScrollLock",84,"ScrollLock",145,"VK_SCROLL",n,n],[1,78,"Pause",7,"PauseBreak",19,"VK_PAUSE",n,n],[1,79,"Insert",19,"Insert",45,"VK_INSERT",n,n],[1,80,"Home",14,"Home",36,"VK_HOME",n,n],[1,81,"PageUp",11,"PageUp",33,"VK_PRIOR",n,n],[1,82,"Delete",20,"Delete",46,"VK_DELETE",n,n],[1,83,"End",13,"End",35,"VK_END",n,n],[1,84,"PageDown",12,"PageDown",34,"VK_NEXT",n,n],[1,85,"ArrowRight",17,"RightArrow",39,"VK_RIGHT","Right",n],[1,86,"ArrowLeft",15,"LeftArrow",37,"VK_LEFT","Left",n],[1,87,"ArrowDown",18,"DownArrow",40,"VK_DOWN","Down",n],[1,88,"ArrowUp",16,"UpArrow",38,"VK_UP","Up",n],[1,89,"NumLock",83,"NumLock",144,"VK_NUMLOCK",n,n],[1,90,"NumpadDivide",113,"NumPad_Divide",111,"VK_DIVIDE",n,n],[1,91,"NumpadMultiply",108,"NumPad_Multiply",106,"VK_MULTIPLY",n,n],[1,92,"NumpadSubtract",111,"NumPad_Subtract",109,"VK_SUBTRACT",n,n],[1,93,"NumpadAdd",109,"NumPad_Add",107,"VK_ADD",n,n],[1,94,"NumpadEnter",3,n,0,n,n,n],[1,95,"Numpad1",99,"NumPad1",97,"VK_NUMPAD1",n,n],[1,96,"Numpad2",100,"NumPad2",98,"VK_NUMPAD2",n,n],[1,97,"Numpad3",101,"NumPad3",99,"VK_NUMPAD3",n,n],[1,98,"Numpad4",102,"NumPad4",100,"VK_NUMPAD4",n,n],[1,99,"Numpad5",103,"NumPad5",101,"VK_NUMPAD5",n,n],[1,100,"Numpad6",104,"NumPad6",102,"VK_NUMPAD6",n,n],[1,101,"Numpad7",105,"NumPad7",103,"VK_NUMPAD7",n,n],[1,102,"Numpad8",106,"NumPad8",104,"VK_NUMPAD8",n,n],[1,103,"Numpad9",107,"NumPad9",105,"VK_NUMPAD9",n,n],[1,104,"Numpad0",98,"NumPad0",96,"VK_NUMPAD0",n,n],[1,105,"NumpadDecimal",112,"NumPad_Decimal",110,"VK_DECIMAL",n,n],[0,106,"IntlBackslash",97,"OEM_102",226,"VK_OEM_102",n,n],[1,107,"ContextMenu",58,"ContextMenu",93,n,n,n],[1,108,"Power",0,n,0,n,n,n],[1,109,"NumpadEqual",0,n,0,n,n,n],[1,110,"F13",71,"F13",124,"VK_F13",n,n],[1,111,"F14",72,"F14",125,"VK_F14",n,n],[1,112,"F15",73,"F15",126,"VK_F15",n,n],[1,113,"F16",74,"F16",127,"VK_F16",n,n],[1,114,"F17",75,"F17",128,"VK_F17",n,n],[1,115,"F18",76,"F18",129,"VK_F18",n,n],[1,116,"F19",77,"F19",130,"VK_F19",n,n],[1,117,"F20",78,"F20",131,"VK_F20",n,n],[1,118,"F21",79,"F21",132,"VK_F21",n,n],[1,119,"F22",80,"F22",133,"VK_F22",n,n],[1,120,"F23",81,"F23",134,"VK_F23",n,n],[1,121,"F24",82,"F24",135,"VK_F24",n,n],[1,122,"Open",0,n,0,n,n,n],[1,123,"Help",0,n,0,n,n,n],[1,124,"Select",0,n,0,n,n,n],[1,125,"Again",0,n,0,n,n,n],[1,126,"Undo",0,n,0,n,n,n],[1,127,"Cut",0,n,0,n,n,n],[1,128,"Copy",0,n,0,n,n,n],[1,129,"Paste",0,n,0,n,n,n],[1,130,"Find",0,n,0,n,n,n],[1,131,"AudioVolumeMute",117,"AudioVolumeMute",173,"VK_VOLUME_MUTE",n,n],[1,132,"AudioVolumeUp",118,"AudioVolumeUp",175,"VK_VOLUME_UP",n,n],[1,133,"AudioVolumeDown",119,"AudioVolumeDown",174,"VK_VOLUME_DOWN",n,n],[1,134,"NumpadComma",110,"NumPad_Separator",108,"VK_SEPARATOR",n,n],[0,135,"IntlRo",115,"ABNT_C1",193,"VK_ABNT_C1",n,n],[1,136,"KanaMode",0,n,0,n,n,n],[0,137,"IntlYen",0,n,0,n,n,n],[1,138,"Convert",0,n,0,n,n,n],[1,139,"NonConvert",0,n,0,n,n,n],[1,140,"Lang1",0,n,0,n,n,n],[1,141,"Lang2",0,n,0,n,n,n],[1,142,"Lang3",0,n,0,n,n,n],[1,143,"Lang4",0,n,0,n,n,n],[1,144,"Lang5",0,n,0,n,n,n],[1,145,"Abort",0,n,0,n,n,n],[1,146,"Props",0,n,0,n,n,n],[1,147,"NumpadParenLeft",0,n,0,n,n,n],[1,148,"NumpadParenRight",0,n,0,n,n,n],[1,149,"NumpadBackspace",0,n,0,n,n,n],[1,150,"NumpadMemoryStore",0,n,0,n,n,n],[1,151,"NumpadMemoryRecall",0,n,0,n,n,n],[1,152,"NumpadMemoryClear",0,n,0,n,n,n],[1,153,"NumpadMemoryAdd",0,n,0,n,n,n],[1,154,"NumpadMemorySubtract",0,n,0,n,n,n],[1,155,"NumpadClear",131,"Clear",12,"VK_CLEAR",n,n],[1,156,"NumpadClearEntry",0,n,0,n,n,n],[1,0,n,5,"Ctrl",17,"VK_CONTROL",n,n],[1,0,n,4,"Shift",16,"VK_SHIFT",n,n],[1,0,n,6,"Alt",18,"VK_MENU",n,n],[1,0,n,57,"Meta",91,"VK_COMMAND",n,n],[1,157,"ControlLeft",5,n,0,"VK_LCONTROL",n,n],[1,158,"ShiftLeft",4,n,0,"VK_LSHIFT",n,n],[1,159,"AltLeft",6,n,0,"VK_LMENU",n,n],[1,160,"MetaLeft",57,n,0,"VK_LWIN",n,n],[1,161,"ControlRight",5,n,0,"VK_RCONTROL",n,n],[1,162,"ShiftRight",4,n,0,"VK_RSHIFT",n,n],[1,163,"AltRight",6,n,0,"VK_RMENU",n,n],[1,164,"MetaRight",57,n,0,"VK_RWIN",n,n],[1,165,"BrightnessUp",0,n,0,n,n,n],[1,166,"BrightnessDown",0,n,0,n,n,n],[1,167,"MediaPlay",0,n,0,n,n,n],[1,168,"MediaRecord",0,n,0,n,n,n],[1,169,"MediaFastForward",0,n,0,n,n,n],[1,170,"MediaRewind",0,n,0,n,n,n],[1,171,"MediaTrackNext",124,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK",n,n],[1,172,"MediaTrackPrevious",125,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK",n,n],[1,173,"MediaStop",126,"MediaStop",178,"VK_MEDIA_STOP",n,n],[1,174,"Eject",0,n,0,n,n,n],[1,175,"MediaPlayPause",127,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE",n,n],[1,176,"MediaSelect",128,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT",n,n],[1,177,"LaunchMail",129,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL",n,n],[1,178,"LaunchApp2",130,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2",n,n],[1,179,"LaunchApp1",0,n,0,"VK_MEDIA_LAUNCH_APP1",n,n],[1,180,"SelectTask",0,n,0,n,n,n],[1,181,"LaunchScreenSaver",0,n,0,n,n,n],[1,182,"BrowserSearch",120,"BrowserSearch",170,"VK_BROWSER_SEARCH",n,n],[1,183,"BrowserHome",121,"BrowserHome",172,"VK_BROWSER_HOME",n,n],[1,184,"BrowserBack",122,"BrowserBack",166,"VK_BROWSER_BACK",n,n],[1,185,"BrowserForward",123,"BrowserForward",167,"VK_BROWSER_FORWARD",n,n],[1,186,"BrowserStop",0,n,0,"VK_BROWSER_STOP",n,n],[1,187,"BrowserRefresh",0,n,0,"VK_BROWSER_REFRESH",n,n],[1,188,"BrowserFavorites",0,n,0,"VK_BROWSER_FAVORITES",n,n],[1,189,"ZoomToggle",0,n,0,n,n,n],[1,190,"MailReply",0,n,0,n,n,n],[1,191,"MailForward",0,n,0,n,n,n],[1,192,"MailSend",0,n,0,n,n,n],[1,0,n,114,"KeyInComposition",229,n,n,n],[1,0,n,116,"ABNT_C2",194,"VK_ABNT_C2",n,n],[1,0,n,96,"OEM_8",223,"VK_OEM_8",n,n],[1,0,n,0,n,0,"VK_KANA",n,n],[1,0,n,0,n,0,"VK_HANGUL",n,n],[1,0,n,0,n,0,"VK_JUNJA",n,n],[1,0,n,0,n,0,"VK_FINAL",n,n],[1,0,n,0,n,0,"VK_HANJA",n,n],[1,0,n,0,n,0,"VK_KANJI",n,n],[1,0,n,0,n,0,"VK_CONVERT",n,n],[1,0,n,0,n,0,"VK_NONCONVERT",n,n],[1,0,n,0,n,0,"VK_ACCEPT",n,n],[1,0,n,0,n,0,"VK_MODECHANGE",n,n],[1,0,n,0,n,0,"VK_SELECT",n,n],[1,0,n,0,n,0,"VK_PRINT",n,n],[1,0,n,0,n,0,"VK_EXECUTE",n,n],[1,0,n,0,n,0,"VK_SNAPSHOT",n,n],[1,0,n,0,n,0,"VK_HELP",n,n],[1,0,n,0,n,0,"VK_APPS",n,n],[1,0,n,0,n,0,"VK_PROCESSKEY",n,n],[1,0,n,0,n,0,"VK_PACKET",n,n],[1,0,n,0,n,0,"VK_DBE_SBCSCHAR",n,n],[1,0,n,0,n,0,"VK_DBE_DBCSCHAR",n,n],[1,0,n,0,n,0,"VK_ATTN",n,n],[1,0,n,0,n,0,"VK_CRSEL",n,n],[1,0,n,0,n,0,"VK_EXSEL",n,n],[1,0,n,0,n,0,"VK_EREOF",n,n],[1,0,n,0,n,0,"VK_PLAY",n,n],[1,0,n,0,n,0,"VK_ZOOM",n,n],[1,0,n,0,n,0,"VK_NONAME",n,n],[1,0,n,0,n,0,"VK_PA1",n,n],[1,0,n,0,n,0,"VK_OEM_CLEAR",n,n]],t=[],i=[];for(const s of e){const[o,r,a,l,c,d,u,h,f]=s;if(i[r]||(i[r]=!0,Dge[a]=r,kge[a.toLowerCase()]=r,o&&(R4[r]=l)),!t[l]){if(t[l]=!0,!c)throw new Error(`String representation missing for key code ${l} around scan code ${a}`);oC.define(l,c),nI.define(l,h||c),sI.define(l,f||h||c)}d&&(_U[d]=l)}})();var zl;(function(n){function e(a){return oC.keyCodeToStr(a)}n.toString=e;function t(a){return oC.strToKeyCode(a)}n.fromString=t;function i(a){return nI.keyCodeToStr(a)}n.toUserSettingsUS=i;function s(a){return sI.keyCodeToStr(a)}n.toUserSettingsGeneral=s;function o(a){return nI.strToKeyCode(a)||sI.strToKeyCode(a)}n.fromUserSettings=o;function r(a){if(a>=98&&a<=113)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return oC.keyCodeToStr(a)}n.toElectronAccelerator=r})(zl||(zl={}));function Pn(n,e){const t=(e&65535)<<16>>>0;return(n|t)>>>0}var OF={};let pp;if(typeof mr.vscode<"u"&&typeof mr.vscode.process<"u"){const n=mr.vscode.process;pp={get platform(){return n.platform},get arch(){return n.arch},get env(){return n.env},cwd(){return n.cwd()}}}else typeof process<"u"?pp={get platform(){return process.platform},get arch(){return process.arch},get env(){return OF},cwd(){return OF.VSCODE_CWD||process.cwd()}}:pp={get platform(){return Ps?"win32":pt?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};const _S=pp.cwd,bU=pp.env,Ege=pp.platform,Age=65,Ige=97,Tge=90,Nge=122,kd=46,Un=47,lo=92,Rc=58,Rge=63;class vU extends Error{constructor(e,t,i){let s;typeof t=="string"&&t.indexOf("not ")===0?(s="must not be",t=t.replace(/^not /,"")):s="must be";const o=e.indexOf(".")!==-1?"property":"argument";let r=`The "${e}" ${o} ${s} of type ${t}`;r+=`. Received type ${typeof i}`,super(r),this.code="ERR_INVALID_ARG_TYPE"}}function Mge(n,e){if(n===null||typeof n!="object")throw new vU(e,"Object",n)}function Ji(n,e){if(typeof n!="string")throw new vU(e,"string",n)}const xu=Ege==="win32";function Ct(n){return n===Un||n===lo}function oI(n){return n===Un}function Mc(n){return n>=Age&&n<=Tge||n>=Ige&&n<=Nge}function bS(n,e,t,i){let s="",o=0,r=-1,a=0,l=0;for(let c=0;c<=n.length;++c){if(c2){const d=s.lastIndexOf(t);d===-1?(s="",o=0):(s=s.slice(0,d),o=s.length-1-s.lastIndexOf(t)),r=c,a=0;continue}else if(s.length!==0){s="",o=0,r=c,a=0;continue}}e&&(s+=s.length>0?`${t}..`:"..",o=2)}else s.length>0?s+=`${t}${n.slice(r+1,c)}`:s=n.slice(r+1,c),o=c-r-1;r=c,a=0}else l===kd&&a!==-1?++a:a=-1}return s}function yU(n,e){Mge(e,"pathObject");const t=e.dir||e.root,i=e.base||`${e.name||""}${e.ext||""}`;return t?t===e.root?`${t}${i}`:`${t}${n}${i}`:i}const Gs={resolve(...n){let e="",t="",i=!1;for(let s=n.length-1;s>=-1;s--){let o;if(s>=0){if(o=n[s],Ji(o,"path"),o.length===0)continue}else e.length===0?o=_S():(o=bU[`=${e}`]||_S(),(o===void 0||o.slice(0,2).toLowerCase()!==e.toLowerCase()&&o.charCodeAt(2)===lo)&&(o=`${e}\\`));const r=o.length;let a=0,l="",c=!1;const d=o.charCodeAt(0);if(r===1)Ct(d)&&(a=1,c=!0);else if(Ct(d))if(c=!0,Ct(o.charCodeAt(1))){let u=2,h=u;for(;u2&&Ct(o.charCodeAt(2))&&(c=!0,a=3));if(l.length>0)if(e.length>0){if(l.toLowerCase()!==e.toLowerCase())continue}else e=l;if(i){if(e.length>0)break}else if(t=`${o.slice(a)}\\${t}`,i=c,c&&e.length>0)break}return t=bS(t,!i,"\\",Ct),i?`${e}\\${t}`:`${e}${t}`||"."},normalize(n){Ji(n,"path");const e=n.length;if(e===0)return".";let t=0,i,s=!1;const o=n.charCodeAt(0);if(e===1)return oI(o)?"\\":n;if(Ct(o))if(s=!0,Ct(n.charCodeAt(1))){let a=2,l=a;for(;a2&&Ct(n.charCodeAt(2))&&(s=!0,t=3));let r=t0&&Ct(n.charCodeAt(e-1))&&(r+="\\"),i===void 0?s?`\\${r}`:r:s?`${i}\\${r}`:`${i}${r}`},isAbsolute(n){Ji(n,"path");const e=n.length;if(e===0)return!1;const t=n.charCodeAt(0);return Ct(t)||e>2&&Mc(t)&&n.charCodeAt(1)===Rc&&Ct(n.charCodeAt(2))},join(...n){if(n.length===0)return".";let e,t;for(let o=0;o0&&(e===void 0?e=t=r:e+=`\\${r}`)}if(e===void 0)return".";let i=!0,s=0;if(typeof t=="string"&&Ct(t.charCodeAt(0))){++s;const o=t.length;o>1&&Ct(t.charCodeAt(1))&&(++s,o>2&&(Ct(t.charCodeAt(2))?++s:i=!1))}if(i){for(;s=2&&(e=`\\${e.slice(s)}`)}return Gs.normalize(e)},relative(n,e){if(Ji(n,"from"),Ji(e,"to"),n===e)return"";const t=Gs.resolve(n),i=Gs.resolve(e);if(t===i||(n=t.toLowerCase(),e=i.toLowerCase(),n===e))return"";let s=0;for(;ss&&n.charCodeAt(o-1)===lo;)o--;const r=o-s;let a=0;for(;aa&&e.charCodeAt(l-1)===lo;)l--;const c=l-a,d=rd){if(e.charCodeAt(a+h)===lo)return i.slice(a+h+1);if(h===2)return i.slice(a+h)}r>d&&(n.charCodeAt(s+h)===lo?u=h:h===2&&(u=3)),u===-1&&(u=0)}let f="";for(h=s+u+1;h<=o;++h)(h===o||n.charCodeAt(h)===lo)&&(f+=f.length===0?"..":"\\..");return a+=u,f.length>0?`${f}${i.slice(a,l)}`:(i.charCodeAt(a)===lo&&++a,i.slice(a,l))},toNamespacedPath(n){if(typeof n!="string"||n.length===0)return n;const e=Gs.resolve(n);if(e.length<=2)return n;if(e.charCodeAt(0)===lo){if(e.charCodeAt(1)===lo){const t=e.charCodeAt(2);if(t!==Rge&&t!==kd)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(Mc(e.charCodeAt(0))&&e.charCodeAt(1)===Rc&&e.charCodeAt(2)===lo)return`\\\\?\\${e}`;return n},dirname(n){Ji(n,"path");const e=n.length;if(e===0)return".";let t=-1,i=0;const s=n.charCodeAt(0);if(e===1)return Ct(s)?n:".";if(Ct(s)){if(t=i=1,Ct(n.charCodeAt(1))){let a=2,l=a;for(;a2&&Ct(n.charCodeAt(2))?3:2,i=t);let o=-1,r=!0;for(let a=e-1;a>=i;--a)if(Ct(n.charCodeAt(a))){if(!r){o=a;break}}else r=!1;if(o===-1){if(t===-1)return".";o=t}return n.slice(0,o)},basename(n,e){e!==void 0&&Ji(e,"ext"),Ji(n,"path");let t=0,i=-1,s=!0,o;if(n.length>=2&&Mc(n.charCodeAt(0))&&n.charCodeAt(1)===Rc&&(t=2),e!==void 0&&e.length>0&&e.length<=n.length){if(e===n)return"";let r=e.length-1,a=-1;for(o=n.length-1;o>=t;--o){const l=n.charCodeAt(o);if(Ct(l)){if(!s){t=o+1;break}}else a===-1&&(s=!1,a=o+1),r>=0&&(l===e.charCodeAt(r)?--r===-1&&(i=o):(r=-1,i=a))}return t===i?i=a:i===-1&&(i=n.length),n.slice(t,i)}for(o=n.length-1;o>=t;--o)if(Ct(n.charCodeAt(o))){if(!s){t=o+1;break}}else i===-1&&(s=!1,i=o+1);return i===-1?"":n.slice(t,i)},extname(n){Ji(n,"path");let e=0,t=-1,i=0,s=-1,o=!0,r=0;n.length>=2&&n.charCodeAt(1)===Rc&&Mc(n.charCodeAt(0))&&(e=i=2);for(let a=n.length-1;a>=e;--a){const l=n.charCodeAt(a);if(Ct(l)){if(!o){i=a+1;break}continue}s===-1&&(o=!1,s=a+1),l===kd?t===-1?t=a:r!==1&&(r=1):t!==-1&&(r=-1)}return t===-1||s===-1||r===0||r===1&&t===s-1&&t===i+1?"":n.slice(t,s)},format:yU.bind(null,"\\"),parse(n){Ji(n,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return e;const t=n.length;let i=0,s=n.charCodeAt(0);if(t===1)return Ct(s)?(e.root=e.dir=n,e):(e.base=e.name=n,e);if(Ct(s)){if(i=1,Ct(n.charCodeAt(1))){let u=2,h=u;for(;u0&&(e.root=n.slice(0,i));let o=-1,r=i,a=-1,l=!0,c=n.length-1,d=0;for(;c>=i;--c){if(s=n.charCodeAt(c),Ct(s)){if(!l){r=c+1;break}continue}a===-1&&(l=!1,a=c+1),s===kd?o===-1?o=c:d!==1&&(d=1):o!==-1&&(d=-1)}return a!==-1&&(o===-1||d===0||d===1&&o===a-1&&o===r+1?e.base=e.name=n.slice(r,a):(e.name=n.slice(r,o),e.base=n.slice(r,a),e.ext=n.slice(o,a))),r>0&&r!==i?e.dir=n.slice(0,r-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},Pge=(()=>{if(xu){const n=/\\/g;return()=>{const e=_S().replace(n,"/");return e.slice(e.indexOf("/"))}}return()=>_S()})(),Oi={resolve(...n){let e="",t=!1;for(let i=n.length-1;i>=-1&&!t;i--){const s=i>=0?n[i]:Pge();Ji(s,"path"),s.length!==0&&(e=`${s}/${e}`,t=s.charCodeAt(0)===Un)}return e=bS(e,!t,"/",oI),t?`/${e}`:e.length>0?e:"."},normalize(n){if(Ji(n,"path"),n.length===0)return".";const e=n.charCodeAt(0)===Un,t=n.charCodeAt(n.length-1)===Un;return n=bS(n,!e,"/",oI),n.length===0?e?"/":t?"./":".":(t&&(n+="/"),e?`/${n}`:n)},isAbsolute(n){return Ji(n,"path"),n.length>0&&n.charCodeAt(0)===Un},join(...n){if(n.length===0)return".";let e;for(let t=0;t0&&(e===void 0?e=i:e+=`/${i}`)}return e===void 0?".":Oi.normalize(e)},relative(n,e){if(Ji(n,"from"),Ji(e,"to"),n===e||(n=Oi.resolve(n),e=Oi.resolve(e),n===e))return"";const t=1,i=n.length,s=i-t,o=1,r=e.length-o,a=sa){if(e.charCodeAt(o+c)===Un)return e.slice(o+c+1);if(c===0)return e.slice(o+c)}else s>a&&(n.charCodeAt(t+c)===Un?l=c:c===0&&(l=0));let d="";for(c=t+l+1;c<=i;++c)(c===i||n.charCodeAt(c)===Un)&&(d+=d.length===0?"..":"/..");return`${d}${e.slice(o+l)}`},toNamespacedPath(n){return n},dirname(n){if(Ji(n,"path"),n.length===0)return".";const e=n.charCodeAt(0)===Un;let t=-1,i=!0;for(let s=n.length-1;s>=1;--s)if(n.charCodeAt(s)===Un){if(!i){t=s;break}}else i=!1;return t===-1?e?"/":".":e&&t===1?"//":n.slice(0,t)},basename(n,e){e!==void 0&&Ji(e,"ext"),Ji(n,"path");let t=0,i=-1,s=!0,o;if(e!==void 0&&e.length>0&&e.length<=n.length){if(e===n)return"";let r=e.length-1,a=-1;for(o=n.length-1;o>=0;--o){const l=n.charCodeAt(o);if(l===Un){if(!s){t=o+1;break}}else a===-1&&(s=!1,a=o+1),r>=0&&(l===e.charCodeAt(r)?--r===-1&&(i=o):(r=-1,i=a))}return t===i?i=a:i===-1&&(i=n.length),n.slice(t,i)}for(o=n.length-1;o>=0;--o)if(n.charCodeAt(o)===Un){if(!s){t=o+1;break}}else i===-1&&(s=!1,i=o+1);return i===-1?"":n.slice(t,i)},extname(n){Ji(n,"path");let e=-1,t=0,i=-1,s=!0,o=0;for(let r=n.length-1;r>=0;--r){const a=n.charCodeAt(r);if(a===Un){if(!s){t=r+1;break}continue}i===-1&&(s=!1,i=r+1),a===kd?e===-1?e=r:o!==1&&(o=1):e!==-1&&(o=-1)}return e===-1||i===-1||o===0||o===1&&e===i-1&&e===t+1?"":n.slice(e,i)},format:yU.bind(null,"/"),parse(n){Ji(n,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return e;const t=n.charCodeAt(0)===Un;let i;t?(e.root="/",i=1):i=0;let s=-1,o=0,r=-1,a=!0,l=n.length-1,c=0;for(;l>=i;--l){const d=n.charCodeAt(l);if(d===Un){if(!a){o=l+1;break}continue}r===-1&&(a=!1,r=l+1),d===kd?s===-1?s=l:c!==1&&(c=1):s!==-1&&(c=-1)}if(r!==-1){const d=o===0&&t?1:o;s===-1||c===0||c===1&&s===r-1&&s===o+1?e.base=e.name=n.slice(d,r):(e.name=n.slice(d,s),e.base=n.slice(d,r),e.ext=n.slice(s,r))}return o>0?e.dir=n.slice(0,o-1):t&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};Oi.win32=Gs.win32=Gs;Oi.posix=Gs.posix=Oi;const wU=xu?Gs.normalize:Oi.normalize,Oge=xu?Gs.resolve:Oi.resolve,Fge=xu?Gs.relative:Oi.relative,Bge=xu?Gs.dirname:Oi.dirname,CU=xu?Gs.basename:Oi.basename,Wge=xu?Gs.extname:Oi.extname,Ed=xu?Gs.sep:Oi.sep,Vge=/^\w[\w\d+.-]*$/,zge=/^\//,Hge=/^\/\//;function $ge(n,e){if(!n.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${n.authority}", path: "${n.path}", query: "${n.query}", fragment: "${n.fragment}"}`);if(n.scheme&&!Vge.test(n.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(n.path){if(n.authority){if(!zge.test(n.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(Hge.test(n.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function Uge(n,e){return!n&&!e?"file":n}function jge(n,e){switch(n){case"https":case"http":case"file":e?e[0]!==Kr&&(e=Kr+e):e=Kr;break}return e}const yi="",Kr="/",qge=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class Ue{static isUri(e){return e instanceof Ue?!0:e?typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function":!1}constructor(e,t,i,s,o,r=!1){typeof e=="object"?(this.scheme=e.scheme||yi,this.authority=e.authority||yi,this.path=e.path||yi,this.query=e.query||yi,this.fragment=e.fragment||yi):(this.scheme=Uge(e,r),this.authority=t||yi,this.path=jge(this.scheme,i||yi),this.query=s||yi,this.fragment=o||yi,$ge(this,r))}get fsPath(){return vS(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:i,path:s,query:o,fragment:r}=e;return t===void 0?t=this.scheme:t===null&&(t=yi),i===void 0?i=this.authority:i===null&&(i=yi),s===void 0?s=this.path:s===null&&(s=yi),o===void 0?o=this.query:o===null&&(o=yi),r===void 0?r=this.fragment:r===null&&(r=yi),t===this.scheme&&i===this.authority&&s===this.path&&o===this.query&&r===this.fragment?this:new fg(t,i,s,o,r)}static parse(e,t=!1){const i=qge.exec(e);return i?new fg(i[2]||yi,By(i[4]||yi),By(i[5]||yi),By(i[7]||yi),By(i[9]||yi),t):new fg(yi,yi,yi,yi,yi)}static file(e){let t=yi;if(Ps&&(e=e.replace(/\\/g,Kr)),e[0]===Kr&&e[1]===Kr){const i=e.indexOf(Kr,2);i===-1?(t=e.substring(2),e=Kr):(t=e.substring(2,i),e=e.substring(i)||Kr)}return new fg("file",t,e,yi,yi)}static from(e,t){return new fg(e.scheme,e.authority,e.path,e.query,e.fragment,t)}static joinPath(e,...t){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let i;return Ps&&e.scheme==="file"?i=Ue.file(Gs.join(vS(e,!0),...t)).path:i=Oi.join(e.path,...t),e.with({path:i})}toString(e=!1){return rI(this,e)}toJSON(){return this}static revive(e){var t,i;if(e){if(e instanceof Ue)return e;{const s=new fg(e);return s._formatted=(t=e.external)!==null&&t!==void 0?t:null,s._fsPath=e._sep===SU&&(i=e.fsPath)!==null&&i!==void 0?i:null,s}}else return e}}const SU=Ps?1:void 0;let fg=class extends Ue{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=vS(this,!1)),this._fsPath}toString(e=!1){return e?rI(this,!0):(this._formatted||(this._formatted=rI(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=SU),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}};const xU={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function FF(n,e,t){let i,s=-1;for(let o=0;o=97&&r<=122||r>=65&&r<=90||r>=48&&r<=57||r===45||r===46||r===95||r===126||e&&r===47||t&&r===91||t&&r===93||t&&r===58)s!==-1&&(i+=encodeURIComponent(n.substring(s,o)),s=-1),i!==void 0&&(i+=n.charAt(o));else{i===void 0&&(i=n.substr(0,o));const a=xU[r];a!==void 0?(s!==-1&&(i+=encodeURIComponent(n.substring(s,o)),s=-1),i+=a):s===-1&&(s=o)}}return s!==-1&&(i+=encodeURIComponent(n.substring(s))),i!==void 0?i:n}function Gge(n){let e;for(let t=0;t1&&n.scheme==="file"?t=`//${n.authority}${n.path}`:n.path.charCodeAt(0)===47&&(n.path.charCodeAt(1)>=65&&n.path.charCodeAt(1)<=90||n.path.charCodeAt(1)>=97&&n.path.charCodeAt(1)<=122)&&n.path.charCodeAt(2)===58?e?t=n.path.substr(1):t=n.path[1].toLowerCase()+n.path.substr(2):t=n.path,Ps&&(t=t.replace(/\//g,"\\")),t}function rI(n,e){const t=e?Gge:FF;let i="",{scheme:s,authority:o,path:r,query:a,fragment:l}=n;if(s&&(i+=s,i+=":"),(o||s==="file")&&(i+=Kr,i+=Kr),o){let c=o.indexOf("@");if(c!==-1){const d=o.substr(0,c);o=o.substr(c+1),c=d.lastIndexOf(":"),c===-1?i+=t(d,!1,!1):(i+=t(d.substr(0,c),!1,!1),i+=":",i+=t(d.substr(c+1),!1,!0)),i+="@"}o=o.toLowerCase(),c=o.lastIndexOf(":"),c===-1?i+=t(o,!1,!0):(i+=t(o.substr(0,c),!1,!0),i+=o.substr(c))}if(r){if(r.length>=3&&r.charCodeAt(0)===47&&r.charCodeAt(2)===58){const c=r.charCodeAt(1);c>=65&&c<=90&&(r=`/${String.fromCharCode(c+32)}:${r.substr(3)}`)}else if(r.length>=2&&r.charCodeAt(1)===58){const c=r.charCodeAt(0);c>=65&&c<=90&&(r=`${String.fromCharCode(c+32)}:${r.substr(2)}`)}i+=t(r,!0,!1)}return a&&(i+="?",i+=t(a,!1,!1)),l&&(i+="#",i+=e?l:FF(l,!1,!1)),i}function LU(n){try{return decodeURIComponent(n)}catch{return n.length>3?n.substr(0,3)+LU(n.substr(3)):n}}const BF=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function By(n){return n.match(BF)?n.replace(BF,e=>LU(e)):n}let V=class ih{constructor(e,t){this.lineNumber=e,this.column=t}with(e=this.lineNumber,t=this.column){return e===this.lineNumber&&t===this.column?this:new ih(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return ih.equals(this,e)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return ih.isBefore(this,e)}static isBefore(e,t){return e.lineNumberi||e===i&&t>s?(this.startLineNumber=i,this.startColumn=s,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=i,this.endColumn=s)}isEmpty(){return an.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return an.containsPosition(this,e)}static containsPosition(e,t){return!(t.lineNumbere.endLineNumber||t.lineNumber===e.startLineNumber&&t.columne.endColumn)}static strictContainsPosition(e,t){return!(t.lineNumbere.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<=e.startColumn||t.lineNumber===e.endLineNumber&&t.column>=e.endColumn)}containsRange(e){return an.containsRange(this,e)}static containsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumne.endColumn)}strictContainsRange(e){return an.strictContainsRange(this,e)}static strictContainsRange(e,t){return!(t.startLineNumbere.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)}plusRange(e){return an.plusRange(this,e)}static plusRange(e,t){let i,s,o,r;return t.startLineNumbere.endLineNumber?(o=t.endLineNumber,r=t.endColumn):t.endLineNumber===e.endLineNumber?(o=t.endLineNumber,r=Math.max(t.endColumn,e.endColumn)):(o=e.endLineNumber,r=e.endColumn),new an(i,s,o,r)}intersectRanges(e){return an.intersectRanges(this,e)}static intersectRanges(e,t){let i=e.startLineNumber,s=e.startColumn,o=e.endLineNumber,r=e.endColumn;const a=t.startLineNumber,l=t.startColumn,c=t.endLineNumber,d=t.endColumn;return ic?(o=c,r=d):o===c&&(r=Math.min(r,d)),i>o||i===o&&s>r?null:new an(i,s,o,r)}equalsRange(e){return an.equalsRange(this,e)}static equalsRange(e,t){return!e&&!t?!0:!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return an.getEndPosition(this)}static getEndPosition(e){return new V(e.endLineNumber,e.endColumn)}getStartPosition(){return an.getStartPosition(this)}static getStartPosition(e){return new V(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new an(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new an(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return an.collapseToStart(this)}static collapseToStart(e){return new an(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return an.collapseToEnd(this)}static collapseToEnd(e){return new an(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new an(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}static fromPositions(e,t=e){return new an(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new an(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,t){return!(e.endLineNumbere.startLineNumber}toJSON(){return this}},lt=class nr extends N{constructor(e,t,i,s){super(e,t,i,s),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=i,this.positionColumn=s}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return nr.selectionsEqual(this,e)}static selectionsEqual(e,t){return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn}getDirection(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?0:1}setEndPosition(e,t){return this.getDirection()===0?new nr(this.startLineNumber,this.startColumn,e,t):new nr(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new V(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new V(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return this.getDirection()===0?new nr(e,t,this.endLineNumber,this.endColumn):new nr(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new nr(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return t===0?new nr(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new nr(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new nr(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)}static selectionsArrEqual(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(let i=0,s=e.length;i{this._tokenizationSupports.get(e)===t&&(this._tokenizationSupports.delete(e),this.handleChange([e]))})}get(e){return this._tokenizationSupports.get(e)||null}registerFactory(e,t){var i;(i=this._factories.get(e))===null||i===void 0||i.dispose();const s=new Yge(this,e,t);return this._factories.set(e,s),Ye(()=>{const o=this._factories.get(e);!o||o!==s||(this._factories.delete(e),o.dispose())})}getOrCreate(e){return lI(this,void 0,void 0,function*(){const t=this.get(e);if(t)return t;const i=this._factories.get(e);return!i||i.isResolved?null:(yield i.resolve(),this.get(e))})}isResolved(e){if(this.get(e))return!0;const i=this._factories.get(e);return!!(!i||i.isResolved)}setColorMap(e){this._colorMap=e,this._onDidChange.fire({changedLanguages:Array.from(this._tokenizationSupports.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>2?this._colorMap[2]:null}};class Yge extends Y{get isResolved(){return this._isResolved}constructor(e,t,i){super(),this._registry=e,this._languageId=t,this._factory=i,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}dispose(){this._isDisposed=!0,super.dispose()}resolve(){return lI(this,void 0,void 0,function*(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise})}_create(){return lI(this,void 0,void 0,function*(){const e=yield this._factory.tokenizationSupport;this._isResolved=!0,e&&!this._isDisposed&&this._register(this._registry.register(this._languageId,e))})}}let Wb=class{constructor(e,t,i){this.offset=e,this.type=t,this.language=i,this._tokenBrand=void 0}toString(){return"("+this.offset+", "+this.type+")"}};class M4{constructor(e,t){this.tokens=e,this.endState=t,this._tokenizationResultBrand=void 0}}class FL{constructor(e,t){this.tokens=e,this.endState=t,this._encodedTokenizationResultBrand=void 0}}var WF;(function(n){const e=new Map;e.set(0,se.symbolMethod),e.set(1,se.symbolFunction),e.set(2,se.symbolConstructor),e.set(3,se.symbolField),e.set(4,se.symbolVariable),e.set(5,se.symbolClass),e.set(6,se.symbolStruct),e.set(7,se.symbolInterface),e.set(8,se.symbolModule),e.set(9,se.symbolProperty),e.set(10,se.symbolEvent),e.set(11,se.symbolOperator),e.set(12,se.symbolUnit),e.set(13,se.symbolValue),e.set(15,se.symbolEnum),e.set(14,se.symbolConstant),e.set(15,se.symbolEnum),e.set(16,se.symbolEnumMember),e.set(17,se.symbolKeyword),e.set(27,se.symbolSnippet),e.set(18,se.symbolText),e.set(19,se.symbolColor),e.set(20,se.symbolFile),e.set(21,se.symbolReference),e.set(22,se.symbolCustomColor),e.set(23,se.symbolFolder),e.set(24,se.symbolTypeParameter),e.set(25,se.account),e.set(26,se.issues);function t(o){let r=e.get(o);return r||(console.info("No codicon found for CompletionItemKind "+o),r=se.symbolProperty),r}n.toIcon=t;const i=new Map;i.set("method",0),i.set("function",1),i.set("constructor",2),i.set("field",3),i.set("variable",4),i.set("class",5),i.set("struct",6),i.set("interface",7),i.set("module",8),i.set("property",9),i.set("event",10),i.set("operator",11),i.set("unit",12),i.set("value",13),i.set("constant",14),i.set("enum",15),i.set("enum-member",16),i.set("enumMember",16),i.set("keyword",17),i.set("snippet",27),i.set("text",18),i.set("color",19),i.set("file",20),i.set("reference",21),i.set("customcolor",22),i.set("folder",23),i.set("type-parameter",24),i.set("typeParameter",24),i.set("account",25),i.set("issue",26);function s(o,r){let a=i.get(o);return typeof a>"u"&&!r&&(a=9),a}n.fromString=s})(WF||(WF={}));var cI;(function(n){n[n.Automatic=0]="Automatic",n[n.Explicit=1]="Explicit"})(cI||(cI={}));class Zge{constructor(e,t,i,s){this.range=e,this.text=t,this.completionKind=i,this.isSnippetText=s}equals(e){return N.lift(this.range).equalsRange(e.range)&&this.text===e.text&&this.completionKind===e.completionKind&&this.isSnippetText===e.isSnippetText}}var VF;(function(n){n[n.Invoke=1]="Invoke",n[n.TriggerCharacter=2]="TriggerCharacter",n[n.ContentChange=3]="ContentChange"})(VF||(VF={}));var zF;(function(n){n[n.Text=0]="Text",n[n.Read=1]="Read",n[n.Write=2]="Write"})(zF||(zF={}));function Xge(n){return n&&Ue.isUri(n.uri)&&N.isIRange(n.range)&&(N.isIRange(n.originSelectionRange)||N.isIRange(n.targetSelectionRange))}m("Array","array"),m("Boolean","boolean"),m("Class","class"),m("Constant","constant"),m("Constructor","constructor"),m("Enum","enumeration"),m("EnumMember","enumeration member"),m("Event","event"),m("Field","field"),m("File","file"),m("Function","function"),m("Interface","interface"),m("Key","key"),m("Method","method"),m("Module","module"),m("Namespace","namespace"),m("Null","null"),m("Number","number"),m("Object","object"),m("Operator","operator"),m("Package","package"),m("Property","property"),m("String","string"),m("Struct","struct"),m("TypeParameter","type parameter"),m("Variable","variable");var dI;(function(n){const e=new Map;e.set(0,se.symbolFile),e.set(1,se.symbolModule),e.set(2,se.symbolNamespace),e.set(3,se.symbolPackage),e.set(4,se.symbolClass),e.set(5,se.symbolMethod),e.set(6,se.symbolProperty),e.set(7,se.symbolField),e.set(8,se.symbolConstructor),e.set(9,se.symbolEnum),e.set(10,se.symbolInterface),e.set(11,se.symbolFunction),e.set(12,se.symbolVariable),e.set(13,se.symbolConstant),e.set(14,se.symbolString),e.set(15,se.symbolNumber),e.set(16,se.symbolBoolean),e.set(17,se.symbolArray),e.set(18,se.symbolObject),e.set(19,se.symbolKey),e.set(20,se.symbolNull),e.set(21,se.symbolEnumMember),e.set(22,se.symbolStruct),e.set(23,se.symbolEvent),e.set(24,se.symbolOperator),e.set(25,se.symbolTypeParameter);function t(i){let s=e.get(i);return s||(console.info("No codicon found for SymbolKind "+i),s=se.symbolProperty),s}n.toIcon=t})(dI||(dI={}));class as{static fromValue(e){switch(e){case"comment":return as.Comment;case"imports":return as.Imports;case"region":return as.Region}return new as(e)}constructor(e){this.value=e}}as.Comment=new as("comment");as.Imports=new as("imports");as.Region=new as("region");var HF;(function(n){function e(t){return!t||typeof t!="object"?!1:typeof t.id=="string"&&typeof t.title=="string"}n.is=e})(HF||(HF={}));var $F;(function(n){n[n.Type=1]="Type",n[n.Parameter=2]="Parameter"})($F||($F={}));class Qge{constructor(e){this.createSupport=e,this._tokenizationSupport=null}dispose(){this._tokenizationSupport&&this._tokenizationSupport.then(e=>{e&&e.dispose()})}get tokenizationSupport(){return this._tokenizationSupport||(this._tokenizationSupport=this.createSupport()),this._tokenizationSupport}}const Si=new Kge;var uI;(function(n){n[n.Unknown=0]="Unknown",n[n.Disabled=1]="Disabled",n[n.Enabled=2]="Enabled"})(uI||(uI={}));var hI;(function(n){n[n.Invoke=1]="Invoke",n[n.Auto=2]="Auto"})(hI||(hI={}));var fI;(function(n){n[n.None=0]="None",n[n.KeepWhitespace=1]="KeepWhitespace",n[n.InsertAsSnippet=4]="InsertAsSnippet"})(fI||(fI={}));var gI;(function(n){n[n.Method=0]="Method",n[n.Function=1]="Function",n[n.Constructor=2]="Constructor",n[n.Field=3]="Field",n[n.Variable=4]="Variable",n[n.Class=5]="Class",n[n.Struct=6]="Struct",n[n.Interface=7]="Interface",n[n.Module=8]="Module",n[n.Property=9]="Property",n[n.Event=10]="Event",n[n.Operator=11]="Operator",n[n.Unit=12]="Unit",n[n.Value=13]="Value",n[n.Constant=14]="Constant",n[n.Enum=15]="Enum",n[n.EnumMember=16]="EnumMember",n[n.Keyword=17]="Keyword",n[n.Text=18]="Text",n[n.Color=19]="Color",n[n.File=20]="File",n[n.Reference=21]="Reference",n[n.Customcolor=22]="Customcolor",n[n.Folder=23]="Folder",n[n.TypeParameter=24]="TypeParameter",n[n.User=25]="User",n[n.Issue=26]="Issue",n[n.Snippet=27]="Snippet"})(gI||(gI={}));var pI;(function(n){n[n.Deprecated=1]="Deprecated"})(pI||(pI={}));var mI;(function(n){n[n.Invoke=0]="Invoke",n[n.TriggerCharacter=1]="TriggerCharacter",n[n.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(mI||(mI={}));var _I;(function(n){n[n.EXACT=0]="EXACT",n[n.ABOVE=1]="ABOVE",n[n.BELOW=2]="BELOW"})(_I||(_I={}));var bI;(function(n){n[n.NotSet=0]="NotSet",n[n.ContentFlush=1]="ContentFlush",n[n.RecoverFromMarkers=2]="RecoverFromMarkers",n[n.Explicit=3]="Explicit",n[n.Paste=4]="Paste",n[n.Undo=5]="Undo",n[n.Redo=6]="Redo"})(bI||(bI={}));var vI;(function(n){n[n.LF=1]="LF",n[n.CRLF=2]="CRLF"})(vI||(vI={}));var yI;(function(n){n[n.Text=0]="Text",n[n.Read=1]="Read",n[n.Write=2]="Write"})(yI||(yI={}));var wI;(function(n){n[n.None=0]="None",n[n.Keep=1]="Keep",n[n.Brackets=2]="Brackets",n[n.Advanced=3]="Advanced",n[n.Full=4]="Full"})(wI||(wI={}));var CI;(function(n){n[n.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",n[n.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",n[n.accessibilitySupport=2]="accessibilitySupport",n[n.accessibilityPageSize=3]="accessibilityPageSize",n[n.ariaLabel=4]="ariaLabel",n[n.ariaRequired=5]="ariaRequired",n[n.autoClosingBrackets=6]="autoClosingBrackets",n[n.autoClosingComments=7]="autoClosingComments",n[n.screenReaderAnnounceInlineSuggestion=8]="screenReaderAnnounceInlineSuggestion",n[n.autoClosingDelete=9]="autoClosingDelete",n[n.autoClosingOvertype=10]="autoClosingOvertype",n[n.autoClosingQuotes=11]="autoClosingQuotes",n[n.autoIndent=12]="autoIndent",n[n.automaticLayout=13]="automaticLayout",n[n.autoSurround=14]="autoSurround",n[n.bracketPairColorization=15]="bracketPairColorization",n[n.guides=16]="guides",n[n.codeLens=17]="codeLens",n[n.codeLensFontFamily=18]="codeLensFontFamily",n[n.codeLensFontSize=19]="codeLensFontSize",n[n.colorDecorators=20]="colorDecorators",n[n.colorDecoratorsLimit=21]="colorDecoratorsLimit",n[n.columnSelection=22]="columnSelection",n[n.comments=23]="comments",n[n.contextmenu=24]="contextmenu",n[n.copyWithSyntaxHighlighting=25]="copyWithSyntaxHighlighting",n[n.cursorBlinking=26]="cursorBlinking",n[n.cursorSmoothCaretAnimation=27]="cursorSmoothCaretAnimation",n[n.cursorStyle=28]="cursorStyle",n[n.cursorSurroundingLines=29]="cursorSurroundingLines",n[n.cursorSurroundingLinesStyle=30]="cursorSurroundingLinesStyle",n[n.cursorWidth=31]="cursorWidth",n[n.disableLayerHinting=32]="disableLayerHinting",n[n.disableMonospaceOptimizations=33]="disableMonospaceOptimizations",n[n.domReadOnly=34]="domReadOnly",n[n.dragAndDrop=35]="dragAndDrop",n[n.dropIntoEditor=36]="dropIntoEditor",n[n.emptySelectionClipboard=37]="emptySelectionClipboard",n[n.experimentalWhitespaceRendering=38]="experimentalWhitespaceRendering",n[n.extraEditorClassName=39]="extraEditorClassName",n[n.fastScrollSensitivity=40]="fastScrollSensitivity",n[n.find=41]="find",n[n.fixedOverflowWidgets=42]="fixedOverflowWidgets",n[n.folding=43]="folding",n[n.foldingStrategy=44]="foldingStrategy",n[n.foldingHighlight=45]="foldingHighlight",n[n.foldingImportsByDefault=46]="foldingImportsByDefault",n[n.foldingMaximumRegions=47]="foldingMaximumRegions",n[n.unfoldOnClickAfterEndOfLine=48]="unfoldOnClickAfterEndOfLine",n[n.fontFamily=49]="fontFamily",n[n.fontInfo=50]="fontInfo",n[n.fontLigatures=51]="fontLigatures",n[n.fontSize=52]="fontSize",n[n.fontWeight=53]="fontWeight",n[n.fontVariations=54]="fontVariations",n[n.formatOnPaste=55]="formatOnPaste",n[n.formatOnType=56]="formatOnType",n[n.glyphMargin=57]="glyphMargin",n[n.gotoLocation=58]="gotoLocation",n[n.hideCursorInOverviewRuler=59]="hideCursorInOverviewRuler",n[n.hover=60]="hover",n[n.inDiffEditor=61]="inDiffEditor",n[n.inlineSuggest=62]="inlineSuggest",n[n.letterSpacing=63]="letterSpacing",n[n.lightbulb=64]="lightbulb",n[n.lineDecorationsWidth=65]="lineDecorationsWidth",n[n.lineHeight=66]="lineHeight",n[n.lineNumbers=67]="lineNumbers",n[n.lineNumbersMinChars=68]="lineNumbersMinChars",n[n.linkedEditing=69]="linkedEditing",n[n.links=70]="links",n[n.matchBrackets=71]="matchBrackets",n[n.minimap=72]="minimap",n[n.mouseStyle=73]="mouseStyle",n[n.mouseWheelScrollSensitivity=74]="mouseWheelScrollSensitivity",n[n.mouseWheelZoom=75]="mouseWheelZoom",n[n.multiCursorMergeOverlapping=76]="multiCursorMergeOverlapping",n[n.multiCursorModifier=77]="multiCursorModifier",n[n.multiCursorPaste=78]="multiCursorPaste",n[n.multiCursorLimit=79]="multiCursorLimit",n[n.occurrencesHighlight=80]="occurrencesHighlight",n[n.overviewRulerBorder=81]="overviewRulerBorder",n[n.overviewRulerLanes=82]="overviewRulerLanes",n[n.padding=83]="padding",n[n.pasteAs=84]="pasteAs",n[n.parameterHints=85]="parameterHints",n[n.peekWidgetDefaultFocus=86]="peekWidgetDefaultFocus",n[n.definitionLinkOpensInPeek=87]="definitionLinkOpensInPeek",n[n.quickSuggestions=88]="quickSuggestions",n[n.quickSuggestionsDelay=89]="quickSuggestionsDelay",n[n.readOnly=90]="readOnly",n[n.readOnlyMessage=91]="readOnlyMessage",n[n.renameOnType=92]="renameOnType",n[n.renderControlCharacters=93]="renderControlCharacters",n[n.renderFinalNewline=94]="renderFinalNewline",n[n.renderLineHighlight=95]="renderLineHighlight",n[n.renderLineHighlightOnlyWhenFocus=96]="renderLineHighlightOnlyWhenFocus",n[n.renderValidationDecorations=97]="renderValidationDecorations",n[n.renderWhitespace=98]="renderWhitespace",n[n.revealHorizontalRightPadding=99]="revealHorizontalRightPadding",n[n.roundedSelection=100]="roundedSelection",n[n.rulers=101]="rulers",n[n.scrollbar=102]="scrollbar",n[n.scrollBeyondLastColumn=103]="scrollBeyondLastColumn",n[n.scrollBeyondLastLine=104]="scrollBeyondLastLine",n[n.scrollPredominantAxis=105]="scrollPredominantAxis",n[n.selectionClipboard=106]="selectionClipboard",n[n.selectionHighlight=107]="selectionHighlight",n[n.selectOnLineNumbers=108]="selectOnLineNumbers",n[n.showFoldingControls=109]="showFoldingControls",n[n.showUnused=110]="showUnused",n[n.snippetSuggestions=111]="snippetSuggestions",n[n.smartSelect=112]="smartSelect",n[n.smoothScrolling=113]="smoothScrolling",n[n.stickyScroll=114]="stickyScroll",n[n.stickyTabStops=115]="stickyTabStops",n[n.stopRenderingLineAfter=116]="stopRenderingLineAfter",n[n.suggest=117]="suggest",n[n.suggestFontSize=118]="suggestFontSize",n[n.suggestLineHeight=119]="suggestLineHeight",n[n.suggestOnTriggerCharacters=120]="suggestOnTriggerCharacters",n[n.suggestSelection=121]="suggestSelection",n[n.tabCompletion=122]="tabCompletion",n[n.tabIndex=123]="tabIndex",n[n.unicodeHighlighting=124]="unicodeHighlighting",n[n.unusualLineTerminators=125]="unusualLineTerminators",n[n.useShadowDOM=126]="useShadowDOM",n[n.useTabStops=127]="useTabStops",n[n.wordBreak=128]="wordBreak",n[n.wordSeparators=129]="wordSeparators",n[n.wordWrap=130]="wordWrap",n[n.wordWrapBreakAfterCharacters=131]="wordWrapBreakAfterCharacters",n[n.wordWrapBreakBeforeCharacters=132]="wordWrapBreakBeforeCharacters",n[n.wordWrapColumn=133]="wordWrapColumn",n[n.wordWrapOverride1=134]="wordWrapOverride1",n[n.wordWrapOverride2=135]="wordWrapOverride2",n[n.wrappingIndent=136]="wrappingIndent",n[n.wrappingStrategy=137]="wrappingStrategy",n[n.showDeprecated=138]="showDeprecated",n[n.inlayHints=139]="inlayHints",n[n.editorClassName=140]="editorClassName",n[n.pixelRatio=141]="pixelRatio",n[n.tabFocusMode=142]="tabFocusMode",n[n.layoutInfo=143]="layoutInfo",n[n.wrappingInfo=144]="wrappingInfo",n[n.defaultColorDecorators=145]="defaultColorDecorators",n[n.colorDecoratorsActivatedOn=146]="colorDecoratorsActivatedOn",n[n.inlineCompletionsAccessibilityVerbose=147]="inlineCompletionsAccessibilityVerbose"})(CI||(CI={}));var SI;(function(n){n[n.TextDefined=0]="TextDefined",n[n.LF=1]="LF",n[n.CRLF=2]="CRLF"})(SI||(SI={}));var xI;(function(n){n[n.LF=0]="LF",n[n.CRLF=1]="CRLF"})(xI||(xI={}));var LI;(function(n){n[n.Left=1]="Left",n[n.Right=2]="Right"})(LI||(LI={}));var DI;(function(n){n[n.None=0]="None",n[n.Indent=1]="Indent",n[n.IndentOutdent=2]="IndentOutdent",n[n.Outdent=3]="Outdent"})(DI||(DI={}));var kI;(function(n){n[n.Both=0]="Both",n[n.Right=1]="Right",n[n.Left=2]="Left",n[n.None=3]="None"})(kI||(kI={}));var EI;(function(n){n[n.Type=1]="Type",n[n.Parameter=2]="Parameter"})(EI||(EI={}));var AI;(function(n){n[n.Automatic=0]="Automatic",n[n.Explicit=1]="Explicit"})(AI||(AI={}));var II;(function(n){n[n.DependsOnKbLayout=-1]="DependsOnKbLayout",n[n.Unknown=0]="Unknown",n[n.Backspace=1]="Backspace",n[n.Tab=2]="Tab",n[n.Enter=3]="Enter",n[n.Shift=4]="Shift",n[n.Ctrl=5]="Ctrl",n[n.Alt=6]="Alt",n[n.PauseBreak=7]="PauseBreak",n[n.CapsLock=8]="CapsLock",n[n.Escape=9]="Escape",n[n.Space=10]="Space",n[n.PageUp=11]="PageUp",n[n.PageDown=12]="PageDown",n[n.End=13]="End",n[n.Home=14]="Home",n[n.LeftArrow=15]="LeftArrow",n[n.UpArrow=16]="UpArrow",n[n.RightArrow=17]="RightArrow",n[n.DownArrow=18]="DownArrow",n[n.Insert=19]="Insert",n[n.Delete=20]="Delete",n[n.Digit0=21]="Digit0",n[n.Digit1=22]="Digit1",n[n.Digit2=23]="Digit2",n[n.Digit3=24]="Digit3",n[n.Digit4=25]="Digit4",n[n.Digit5=26]="Digit5",n[n.Digit6=27]="Digit6",n[n.Digit7=28]="Digit7",n[n.Digit8=29]="Digit8",n[n.Digit9=30]="Digit9",n[n.KeyA=31]="KeyA",n[n.KeyB=32]="KeyB",n[n.KeyC=33]="KeyC",n[n.KeyD=34]="KeyD",n[n.KeyE=35]="KeyE",n[n.KeyF=36]="KeyF",n[n.KeyG=37]="KeyG",n[n.KeyH=38]="KeyH",n[n.KeyI=39]="KeyI",n[n.KeyJ=40]="KeyJ",n[n.KeyK=41]="KeyK",n[n.KeyL=42]="KeyL",n[n.KeyM=43]="KeyM",n[n.KeyN=44]="KeyN",n[n.KeyO=45]="KeyO",n[n.KeyP=46]="KeyP",n[n.KeyQ=47]="KeyQ",n[n.KeyR=48]="KeyR",n[n.KeyS=49]="KeyS",n[n.KeyT=50]="KeyT",n[n.KeyU=51]="KeyU",n[n.KeyV=52]="KeyV",n[n.KeyW=53]="KeyW",n[n.KeyX=54]="KeyX",n[n.KeyY=55]="KeyY",n[n.KeyZ=56]="KeyZ",n[n.Meta=57]="Meta",n[n.ContextMenu=58]="ContextMenu",n[n.F1=59]="F1",n[n.F2=60]="F2",n[n.F3=61]="F3",n[n.F4=62]="F4",n[n.F5=63]="F5",n[n.F6=64]="F6",n[n.F7=65]="F7",n[n.F8=66]="F8",n[n.F9=67]="F9",n[n.F10=68]="F10",n[n.F11=69]="F11",n[n.F12=70]="F12",n[n.F13=71]="F13",n[n.F14=72]="F14",n[n.F15=73]="F15",n[n.F16=74]="F16",n[n.F17=75]="F17",n[n.F18=76]="F18",n[n.F19=77]="F19",n[n.F20=78]="F20",n[n.F21=79]="F21",n[n.F22=80]="F22",n[n.F23=81]="F23",n[n.F24=82]="F24",n[n.NumLock=83]="NumLock",n[n.ScrollLock=84]="ScrollLock",n[n.Semicolon=85]="Semicolon",n[n.Equal=86]="Equal",n[n.Comma=87]="Comma",n[n.Minus=88]="Minus",n[n.Period=89]="Period",n[n.Slash=90]="Slash",n[n.Backquote=91]="Backquote",n[n.BracketLeft=92]="BracketLeft",n[n.Backslash=93]="Backslash",n[n.BracketRight=94]="BracketRight",n[n.Quote=95]="Quote",n[n.OEM_8=96]="OEM_8",n[n.IntlBackslash=97]="IntlBackslash",n[n.Numpad0=98]="Numpad0",n[n.Numpad1=99]="Numpad1",n[n.Numpad2=100]="Numpad2",n[n.Numpad3=101]="Numpad3",n[n.Numpad4=102]="Numpad4",n[n.Numpad5=103]="Numpad5",n[n.Numpad6=104]="Numpad6",n[n.Numpad7=105]="Numpad7",n[n.Numpad8=106]="Numpad8",n[n.Numpad9=107]="Numpad9",n[n.NumpadMultiply=108]="NumpadMultiply",n[n.NumpadAdd=109]="NumpadAdd",n[n.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",n[n.NumpadSubtract=111]="NumpadSubtract",n[n.NumpadDecimal=112]="NumpadDecimal",n[n.NumpadDivide=113]="NumpadDivide",n[n.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",n[n.ABNT_C1=115]="ABNT_C1",n[n.ABNT_C2=116]="ABNT_C2",n[n.AudioVolumeMute=117]="AudioVolumeMute",n[n.AudioVolumeUp=118]="AudioVolumeUp",n[n.AudioVolumeDown=119]="AudioVolumeDown",n[n.BrowserSearch=120]="BrowserSearch",n[n.BrowserHome=121]="BrowserHome",n[n.BrowserBack=122]="BrowserBack",n[n.BrowserForward=123]="BrowserForward",n[n.MediaTrackNext=124]="MediaTrackNext",n[n.MediaTrackPrevious=125]="MediaTrackPrevious",n[n.MediaStop=126]="MediaStop",n[n.MediaPlayPause=127]="MediaPlayPause",n[n.LaunchMediaPlayer=128]="LaunchMediaPlayer",n[n.LaunchMail=129]="LaunchMail",n[n.LaunchApp2=130]="LaunchApp2",n[n.Clear=131]="Clear",n[n.MAX_VALUE=132]="MAX_VALUE"})(II||(II={}));var TI;(function(n){n[n.Hint=1]="Hint",n[n.Info=2]="Info",n[n.Warning=4]="Warning",n[n.Error=8]="Error"})(TI||(TI={}));var NI;(function(n){n[n.Unnecessary=1]="Unnecessary",n[n.Deprecated=2]="Deprecated"})(NI||(NI={}));var RI;(function(n){n[n.Inline=1]="Inline",n[n.Gutter=2]="Gutter"})(RI||(RI={}));var MI;(function(n){n[n.UNKNOWN=0]="UNKNOWN",n[n.TEXTAREA=1]="TEXTAREA",n[n.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",n[n.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",n[n.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",n[n.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",n[n.CONTENT_TEXT=6]="CONTENT_TEXT",n[n.CONTENT_EMPTY=7]="CONTENT_EMPTY",n[n.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",n[n.CONTENT_WIDGET=9]="CONTENT_WIDGET",n[n.OVERVIEW_RULER=10]="OVERVIEW_RULER",n[n.SCROLLBAR=11]="SCROLLBAR",n[n.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",n[n.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"})(MI||(MI={}));var PI;(function(n){n[n.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",n[n.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",n[n.TOP_CENTER=2]="TOP_CENTER"})(PI||(PI={}));var OI;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=4]="Right",n[n.Full=7]="Full"})(OI||(OI={}));var FI;(function(n){n[n.Left=0]="Left",n[n.Right=1]="Right",n[n.None=2]="None",n[n.LeftOfInjectedText=3]="LeftOfInjectedText",n[n.RightOfInjectedText=4]="RightOfInjectedText"})(FI||(FI={}));var BI;(function(n){n[n.Off=0]="Off",n[n.On=1]="On",n[n.Relative=2]="Relative",n[n.Interval=3]="Interval",n[n.Custom=4]="Custom"})(BI||(BI={}));var WI;(function(n){n[n.None=0]="None",n[n.Text=1]="Text",n[n.Blocks=2]="Blocks"})(WI||(WI={}));var VI;(function(n){n[n.Smooth=0]="Smooth",n[n.Immediate=1]="Immediate"})(VI||(VI={}));var zI;(function(n){n[n.Auto=1]="Auto",n[n.Hidden=2]="Hidden",n[n.Visible=3]="Visible"})(zI||(zI={}));var HI;(function(n){n[n.LTR=0]="LTR",n[n.RTL=1]="RTL"})(HI||(HI={}));var $I;(function(n){n[n.Invoke=1]="Invoke",n[n.TriggerCharacter=2]="TriggerCharacter",n[n.ContentChange=3]="ContentChange"})($I||($I={}));var UI;(function(n){n[n.File=0]="File",n[n.Module=1]="Module",n[n.Namespace=2]="Namespace",n[n.Package=3]="Package",n[n.Class=4]="Class",n[n.Method=5]="Method",n[n.Property=6]="Property",n[n.Field=7]="Field",n[n.Constructor=8]="Constructor",n[n.Enum=9]="Enum",n[n.Interface=10]="Interface",n[n.Function=11]="Function",n[n.Variable=12]="Variable",n[n.Constant=13]="Constant",n[n.String=14]="String",n[n.Number=15]="Number",n[n.Boolean=16]="Boolean",n[n.Array=17]="Array",n[n.Object=18]="Object",n[n.Key=19]="Key",n[n.Null=20]="Null",n[n.EnumMember=21]="EnumMember",n[n.Struct=22]="Struct",n[n.Event=23]="Event",n[n.Operator=24]="Operator",n[n.TypeParameter=25]="TypeParameter"})(UI||(UI={}));var jI;(function(n){n[n.Deprecated=1]="Deprecated"})(jI||(jI={}));var qI;(function(n){n[n.Hidden=0]="Hidden",n[n.Blink=1]="Blink",n[n.Smooth=2]="Smooth",n[n.Phase=3]="Phase",n[n.Expand=4]="Expand",n[n.Solid=5]="Solid"})(qI||(qI={}));var GI;(function(n){n[n.Line=1]="Line",n[n.Block=2]="Block",n[n.Underline=3]="Underline",n[n.LineThin=4]="LineThin",n[n.BlockOutline=5]="BlockOutline",n[n.UnderlineThin=6]="UnderlineThin"})(GI||(GI={}));var KI;(function(n){n[n.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",n[n.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",n[n.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",n[n.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(KI||(KI={}));var YI;(function(n){n[n.None=0]="None",n[n.Same=1]="Same",n[n.Indent=2]="Indent",n[n.DeepIndent=3]="DeepIndent"})(YI||(YI={}));let j1=class{static chord(e,t){return Pn(e,t)}};j1.CtrlCmd=2048;j1.Shift=1024;j1.Alt=512;j1.WinCtrl=256;function kU(){return{editor:void 0,languages:void 0,CancellationTokenSource:Ar,Emitter:B,KeyCode:II,KeyMod:j1,Position:V,Range:N,Selection:lt,SelectionDirection:HI,MarkerSeverity:TI,MarkerTag:NI,Uri:Ue,Token:Wb}}class Jge{constructor(e){this.fn=e,this.lastCache=void 0,this.lastArgKey=void 0}get(e){const t=JSON.stringify(e);return this.lastArgKey!==t&&(this.lastArgKey=t,this.lastCache=this.fn(e)),this.lastCache}}class UF{get cachedValues(){return this._map}constructor(e){this.fn=e,this._map=new Map}get(e){if(this._map.has(e))return this._map.get(e);const t=this.fn(e);return this._map.set(e,t),t}}class Hf{constructor(e){this.executor=e,this._didRun=!1}get value(){if(!this._didRun)try{this._value=this.executor()}catch(e){this._error=e}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}var _m;function epe(n){return!n||typeof n!="string"?!0:n.trim().length===0}const tpe=/{(\d+)}/g;function Vb(n,...e){return e.length===0?n:n.replace(tpe,function(t,i){const s=parseInt(i,10);return isNaN(s)||s<0||s>=e.length?t:e[s]})}function yS(n){return n.replace(/[<>&]/g,function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}})}function Sr(n){return n.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function BL(n,e){if(!n||!e)return n;const t=e.length;if(t===0||n.length===0)return n;let i=0;for(;n.indexOf(e,i)===i;)i=i+t;return n.substring(i)}function ipe(n,e){if(!n||!e)return n;const t=e.length,i=n.length;if(t===0||i===0)return n;let s=i,o=-1;for(;o=n.lastIndexOf(e,s-1),!(o===-1||o+t!==s);){if(o===0)return"";s=o}return n.substring(0,s)}function npe(n){return n.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function EU(n,e,t={}){if(!n)throw new Error("Cannot create regex from empty string");e||(n=Sr(n)),t.wholeWord&&(/\B/.test(n.charAt(0))||(n="\\b"+n),/\B/.test(n.charAt(n.length-1))||(n=n+"\\b"));let i="";return t.global&&(i+="g"),t.matchCase||(i+="i"),t.multiline&&(i+="m"),t.unicode&&(i+="u"),new RegExp(n,i)}function spe(n){return n.source==="^"||n.source==="^$"||n.source==="$"||n.source==="^\\s*$"?!1:!!(n.exec("")&&n.lastIndex===0)}function $f(n){return n.split(/\r\n|\r|\n/)}function Ys(n){for(let e=0,t=n.length;e=0;t--){const i=n.charCodeAt(t);if(i!==32&&i!==9)return t}return-1}function zb(n,e){return ne?1:0}function P4(n,e,t=0,i=n.length,s=0,o=e.length){for(;tc)return 1}const r=i-t,a=o-s;return ra?1:0}function jF(n,e){return q1(n,e,0,n.length,0,e.length)}function q1(n,e,t=0,i=n.length,s=0,o=e.length){for(;t=128||c>=128)return P4(n.toLowerCase(),e.toLowerCase(),t,i,s,o);Wg(l)&&(l-=32),Wg(c)&&(c-=32);const d=l-c;if(d!==0)return d}const r=i-t,a=o-s;return ra?1:0}function Wy(n){return n>=48&&n<=57}function Wg(n){return n>=97&&n<=122}function qc(n){return n>=65&&n<=90}function Vg(n,e){return n.length===e.length&&q1(n,e)===0}function O4(n,e){const t=e.length;return e.length>n.length?!1:q1(n,e,0,t)===0}function wS(n,e){const t=Math.min(n.length,e.length);let i;for(i=0;i1){const i=n.charCodeAt(e-2);if(tn(i))return F4(i,t)}return t}class B4{get offset(){return this._offset}constructor(e,t=0){this._str=e,this._len=e.length,this._offset=t}setOffset(e){this._offset=e}prevCodePoint(){const e=ope(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){const e=CS(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}}class SS{get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new B4(e,t)}nextGraphemeLength(){const e=ld.getInstance(),t=this._iterator,i=t.offset;let s=e.getGraphemeBreakType(t.nextCodePoint());for(;!t.eol();){const o=t.offset,r=e.getGraphemeBreakType(t.nextCodePoint());if(qF(s,r)){t.setOffset(o);break}s=r}return t.offset-i}prevGraphemeLength(){const e=ld.getInstance(),t=this._iterator,i=t.offset;let s=e.getGraphemeBreakType(t.prevCodePoint());for(;t.offset>0;){const o=t.offset,r=e.getGraphemeBreakType(t.prevCodePoint());if(qF(r,s)){t.setOffset(o);break}s=r}return i-t.offset}eol(){return this._iterator.eol()}}function W4(n,e){return new SS(n,e).nextGraphemeLength()}function AU(n,e){return new SS(n,e).prevGraphemeLength()}function rpe(n,e){e>0&&bm(n.charCodeAt(e))&&e--;const t=e+W4(n,e);return[t-AU(n,t),t]}let Kk;function ape(){return/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/}function Hb(n){return Kk||(Kk=ape()),Kk.test(n)}const lpe=/^[\t\n\r\x20-\x7E]*$/;function V4(n){return lpe.test(n)}const IU=/[\u2028\u2029]/;function TU(n){return IU.test(n)}function tu(n){return n>=11904&&n<=55215||n>=63744&&n<=64255||n>=65281&&n<=65374}function z4(n){return n>=127462&&n<=127487||n===8986||n===8987||n===9200||n===9203||n>=9728&&n<=10175||n===11088||n===11093||n>=127744&&n<=128591||n>=128640&&n<=128764||n>=128992&&n<=129008||n>=129280&&n<=129535||n>=129648&&n<=129782}const cpe="\uFEFF";function H4(n){return!!(n&&n.length>0&&n.charCodeAt(0)===65279)}function dpe(n,e=!1){return n?(e&&(n=n.replace(/\\./g,"")),n.toLowerCase()!==n):!1}function NU(n){return n=n%(2*26),n<26?String.fromCharCode(97+n):String.fromCharCode(65+n-26)}function qF(n,e){return n===0?e!==5&&e!==7:n===2&&e===3?!1:n===4||n===2||n===3||e===4||e===2||e===3?!0:!(n===8&&(e===8||e===9||e===11||e===12)||(n===11||n===9)&&(e===9||e===10)||(n===12||n===10)&&e===10||e===5||e===13||e===7||n===1||n===13&&e===14||n===6&&e===6)}class ld{static getInstance(){return ld._INSTANCE||(ld._INSTANCE=new ld),ld._INSTANCE}constructor(){this._data=upe()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;const t=this._data,i=t.length/3;let s=1;for(;s<=i;)if(et[3*s+1])s=2*s+1;else return t[3*s+2];return 0}}ld._INSTANCE=null;function upe(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}function hpe(n,e){if(n===0)return 0;const t=fpe(n,e);if(t!==void 0)return t;const i=new B4(e,n);return i.prevCodePoint(),i.offset}function fpe(n,e){const t=new B4(e,n);let i=t.prevCodePoint();for(;gpe(i)||i===65039||i===8419;){if(t.offset===0)return;i=t.prevCodePoint()}if(!z4(i))return;let s=t.offset;return s>0&&t.prevCodePoint()===8205&&(s=t.offset),s}function gpe(n){return 127995<=n&&n<=127999}class yf{static getInstance(e){return _m.cache.get(Array.from(e))}static getLocales(){return _m._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}getPrimaryConfusable(e){return this.confusableDictionary.get(e)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}}_m=yf;yf.ambiguousCharacterData=new Hf(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,8218,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,8242,96,1370,96,1523,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71922,67,71913,67,65315,67,8557,67,8450,67,8493,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71919,87,71910,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,66293,90,71909,90,65338,90,8484,90,8488,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65297,49,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"cs":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"es":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"fr":[65374,126,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"it":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ja":[8211,45,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65292,44,65307,59],"ko":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pt-BR":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ru":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"zh-hans":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41],"zh-hant":[8211,45,65374,126,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65307,59]}'));yf.cache=new Jge(n=>{function e(c){const d=new Map;for(let u=0;u!c.startsWith("_")&&c in s);o.length===0&&(o=["_default"]);let r;for(const c of o){const d=e(s[c]);r=i(r,d)}const a=e(s._common),l=t(a,r);return new _m(l)});yf._locales=new Hf(()=>Object.keys(_m.ambiguousCharacterData.value).filter(n=>!n.startsWith("_")));class Ad{static getRawData(){return JSON.parse("[9,10,11,12,13,32,127,160,173,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12288,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999]")}static getData(){return this._data||(this._data=new Set(Ad.getRawData())),this._data}static isInvisibleCharacter(e){return Ad.getData().has(e)}static get codePoints(){return Ad.getData()}}Ad._data=void 0;class XI{constructor(){this._zoomFactor=1}getZoomFactor(){return this._zoomFactor}}XI.INSTANCE=new XI;class ppe extends Y{constructor(){super(),this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(!0),this._mediaQueryList=null,this._handleChange(!1)}_handleChange(e){var t;(t=this._mediaQueryList)===null||t===void 0||t.removeEventListener("change",this._listener),this._mediaQueryList=window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),e&&this._onDidChange.fire()}}class mpe extends Y{get value(){return this._value}constructor(){super(),this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio();const e=this._register(new ppe);this._register(e.onDidChange(()=>{this._value=this._getPixelRatio(),this._onDidChange.fire(this._value)}))}_getPixelRatio(){const e=document.createElement("canvas").getContext("2d"),t=window.devicePixelRatio||1,i=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return t/i}}class _pe{constructor(){this._pixelRatioMonitor=null}_getOrCreatePixelRatioMonitor(){return this._pixelRatioMonitor||(this._pixelRatioMonitor=new mpe),this._pixelRatioMonitor}get value(){return this._getOrCreatePixelRatioMonitor().value}get onDidChange(){return this._getOrCreatePixelRatioMonitor().onDidChange}}function RU(n,e){typeof n=="string"&&(n=window.matchMedia(n)),n.addEventListener("change",e)}const xS=new _pe;function bpe(){return XI.INSTANCE.getZoomFactor()}const o0=navigator.userAgent,xr=o0.indexOf("Firefox")>=0,Yh=o0.indexOf("AppleWebKit")>=0,$4=o0.indexOf("Chrome")>=0,bc=!$4&&o0.indexOf("Safari")>=0,MU=!$4&&!bc&&Yh;o0.indexOf("Electron/")>=0;const GF=o0.indexOf("Android")>=0;let rC=!1;if(window.matchMedia){const n=window.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=window.matchMedia("(display-mode: fullscreen)");rC=n.matches,RU(n,({matches:t})=>{rC&&e.matches||(rC=t)})}function vpe(){return rC}class PU{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingLeft="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){const t=Or(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=Or(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=Or(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=Or(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=Or(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=Or(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=Or(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingLeft(e){const t=Or(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){const t=Or(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){const t=Or(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=Or(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}}function Or(n){return typeof n=="number"?`${n}px`:n}function bt(n){return new PU(n)}function Nn(n,e){n instanceof PU?(n.setFontFamily(e.getMassagedFontFamily()),n.setFontWeight(e.fontWeight),n.setFontSize(e.fontSize),n.setFontFeatureSettings(e.fontFeatureSettings),n.setFontVariationSettings(e.fontVariationSettings),n.setLineHeight(e.lineHeight),n.setLetterSpacing(e.letterSpacing)):(n.style.fontFamily=e.getMassagedFontFamily(),n.style.fontWeight=e.fontWeight,n.style.fontSize=e.fontSize+"px",n.style.fontFeatureSettings=e.fontFeatureSettings,n.style.fontVariationSettings=e.fontVariationSettings,n.style.lineHeight=e.lineHeight+"px",n.style.letterSpacing=e.letterSpacing+"px")}class ype{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class U4{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(){this._createDomElements(),document.body.appendChild(this._container),this._readFromDomElements(),document.body.removeChild(this._container),this._container=null,this._testElements=null}_createDomElements(){const e=document.createElement("div");e.style.position="absolute",e.style.top="-50000px",e.style.width="50000px";const t=document.createElement("div");Nn(t,this._bareFontInfo),e.appendChild(t);const i=document.createElement("div");Nn(i,this._bareFontInfo),i.style.fontWeight="bold",e.appendChild(i);const s=document.createElement("div");Nn(s,this._bareFontInfo),s.style.fontStyle="italic",e.appendChild(s);const o=[];for(const r of this._requests){let a;r.type===0&&(a=t),r.type===2&&(a=i),r.type===1&&(a=s),a.appendChild(document.createElement("br"));const l=document.createElement("span");U4._render(l,r),a.appendChild(l),o.push(l)}this._container=e,this._testElements=o}static _render(e,t){if(t.chr===" "){let i=" ";for(let s=0;s<8;s++)i+=i;e.innerText=i}else{let i=t.chr;for(let s=0;s<8;s++)i+=i;e.textContent=i}}_readFromDomElements(){for(let e=0,t=this._requests.length;e{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings()},5e3))}_evictUntrustedReadings(){const e=this._cache.getValues();let t=!1;for(const i of e)i.isTrusted||(t=!0,this._cache.remove(i));t&&this._onDidChange.fire()}readFontInfo(e){if(!this._cache.has(e)){let t=this._actualReadFontInfo(e);(t.typicalHalfwidthCharacterWidth<=2||t.typicalFullwidthCharacterWidth<=2||t.spaceWidth<=2||t.maxDigitWidth<=2)&&(t=new QI({pixelRatio:xS.value,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,fontVariationSettings:t.fontVariationSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:t.isMonospace,typicalHalfwidthCharacterWidth:Math.max(t.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(t.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:t.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(t.spaceWidth,5),middotWidth:Math.max(t.middotWidth,5),wsmiddotWidth:Math.max(t.wsmiddotWidth,5),maxDigitWidth:Math.max(t.maxDigitWidth,5)},!1)),this._writeToCache(e,t)}return this._cache.get(e)}_createRequest(e,t,i,s){const o=new ype(e,t);return i.push(o),s==null||s.push(o),o}_actualReadFontInfo(e){const t=[],i=[],s=this._createRequest("n",0,t,i),o=this._createRequest("m",0,t,null),r=this._createRequest(" ",0,t,i),a=this._createRequest("0",0,t,i),l=this._createRequest("1",0,t,i),c=this._createRequest("2",0,t,i),d=this._createRequest("3",0,t,i),u=this._createRequest("4",0,t,i),h=this._createRequest("5",0,t,i),f=this._createRequest("6",0,t,i),g=this._createRequest("7",0,t,i),p=this._createRequest("8",0,t,i),_=this._createRequest("9",0,t,i),v=this._createRequest("→",0,t,i),b=this._createRequest("→",0,t,null),y=this._createRequest("·",0,t,i),w=this._createRequest("⸱",0,t,null),S="|/-_ilm%";for(let P=0,O=S.length;P.001){x=!1;break}}let k=!0;return x&&b.width!==D&&(k=!1),b.width>v.width&&(k=!1),new QI({pixelRatio:xS.value,fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontSize:e.fontSize,fontFeatureSettings:e.fontFeatureSettings,fontVariationSettings:e.fontVariationSettings,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,isMonospace:x,typicalHalfwidthCharacterWidth:s.width,typicalFullwidthCharacterWidth:o.width,canUseHalfwidthRightwardsArrow:k,spaceWidth:r.width,middotWidth:y.width,wsmiddotWidth:w.width,maxDigitWidth:L},!0)}}class KF{constructor(){this._keys=Object.create(null),this._values=Object.create(null)}has(e){const t=e.getId();return!!this._values[t]}get(e){const t=e.getId();return this._values[t]}put(e,t){const i=e.getId();this._keys[i]=e,this._values[i]=t}remove(e){const t=e.getId();delete this._keys[t],delete this._values[t]}getValues(){return Object.keys(this._keys).map(e=>this._values[e])}}const JI=new xpe;var Jr;(function(n){n.serviceIds=new Map,n.DI_TARGET="$di$target",n.DI_DEPENDENCIES="$di$dependencies";function e(t){return t[n.DI_DEPENDENCIES]||[]}n.getServiceDependencies=e})(Jr||(Jr={}));const vt=rt("instantiationService");function Lpe(n,e,t){e[Jr.DI_TARGET]===e?e[Jr.DI_DEPENDENCIES].push({id:n,index:t}):(e[Jr.DI_DEPENDENCIES]=[{id:n,index:t}],e[Jr.DI_TARGET]=e)}function rt(n){if(Jr.serviceIds.has(n))return Jr.serviceIds.get(n);const e=function(t,i,s){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Lpe(e,t,s)};return e.toString=()=>n,Jr.serviceIds.set(n,e),e}const jt=rt("codeEditorService"),hs=rt("modelService"),Lu=rt("textModelService");var vm=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class So extends Y{constructor(e,t="",i="",s=!0,o){super(),this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=e,this._label=t,this._cssClass=i,this._enabled=s,this._actionCallback=o}get id(){return this._id}get label(){return this._label}set label(e){this._setLabel(e)}_setLabel(e){this._label!==e&&(this._label=e,this._onDidChange.fire({label:e}))}get tooltip(){return this._tooltip||""}set tooltip(e){this._setTooltip(e)}_setTooltip(e){this._tooltip!==e&&(this._tooltip=e,this._onDidChange.fire({tooltip:e}))}get class(){return this._cssClass}set class(e){this._setClass(e)}_setClass(e){this._cssClass!==e&&(this._cssClass=e,this._onDidChange.fire({class:e}))}get enabled(){return this._enabled}set enabled(e){this._setEnabled(e)}_setEnabled(e){this._enabled!==e&&(this._enabled=e,this._onDidChange.fire({enabled:e}))}get checked(){return this._checked}set checked(e){this._setChecked(e)}_setChecked(e){this._checked!==e&&(this._checked=e,this._onDidChange.fire({checked:e}))}run(e,t){return vm(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(e))})}}class ym extends Y{constructor(){super(...arguments),this._onWillRun=this._register(new B),this.onWillRun=this._onWillRun.event,this._onDidRun=this._register(new B),this.onDidRun=this._onDidRun.event}run(e,t){return vm(this,void 0,void 0,function*(){if(!e.enabled)return;this._onWillRun.fire({action:e});let i;try{yield this.runAction(e,t)}catch(s){i=s}this._onDidRun.fire({action:e,error:i})})}runAction(e,t){return vm(this,void 0,void 0,function*(){yield e.run(t)})}}class Rn{constructor(){this.id=Rn.ID,this.label="",this.tooltip="",this.class="separator",this.enabled=!1,this.checked=!1}static join(...e){let t=[];for(const i of e)i.length&&(t.length?t=[...t,new Rn,...i]:t=i);return t}run(){return vm(this,void 0,void 0,function*(){})}}Rn.ID="vs.actions.separator";class WL{get actions(){return this._actions}constructor(e,t,i,s){this.tooltip="",this.enabled=!0,this.checked=void 0,this.id=e,this.label=t,this.class=s,this._actions=i}run(){return vm(this,void 0,void 0,function*(){})}}class VL extends So{constructor(){super(VL.ID,m("submenu.empty","(empty)"),void 0,!1)}}VL.ID="vs.actions.empty";function O_(n){var e,t;return{id:n.id,label:n.label,class:void 0,enabled:(e=n.enabled)!==null&&e!==void 0?e:!0,checked:(t=n.checked)!==null&&t!==void 0?t:!1,run:(...i)=>vm(this,void 0,void 0,function*(){return n.run(...i)}),tooltip:n.label}}var eT;(function(n){function e(t){return t&&typeof t=="object"&&typeof t.id=="string"}n.isThemeColor=e})(eT||(eT={}));var Te;(function(n){n.iconNameSegment="[A-Za-z0-9]+",n.iconNameExpression="[A-Za-z0-9-]+",n.iconModifierExpression="~[A-Za-z]+",n.iconNameCharacter="[A-Za-z0-9~-]";const e=new RegExp(`^(${n.iconNameExpression})(${n.iconModifierExpression})?$`);function t(h){const f=e.exec(h.id);if(!f)return t(se.error);const[,g,p]=f,_=["codicon","codicon-"+g];return p&&_.push("codicon-modifier-"+p.substring(1)),_}n.asClassNameArray=t;function i(h){return t(h).join(" ")}n.asClassName=i;function s(h){return"."+t(h).join(".")}n.asCSSSelector=s;function o(h){return h&&typeof h=="object"&&typeof h.id=="string"&&(typeof h.color>"u"||eT.isThemeColor(h.color))}n.isThemeIcon=o;const r=new RegExp(`^\\$\\((${n.iconNameExpression}(?:${n.iconModifierExpression})?)\\)$`);function a(h){const f=r.exec(h);if(!f)return;const[,g]=f;return{id:g}}n.fromString=a;function l(h){return{id:h}}n.fromId=l;function c(h,f){let g=h.id;const p=g.lastIndexOf("~");return p!==-1&&(g=g.substring(0,p)),f&&(g=`${g}~${f}`),{id:g}}n.modify=c;function d(h){const f=h.id.lastIndexOf("~");if(f!==-1)return h.id.substring(f+1)}n.getModifier=d;function u(h,f){var g,p;return h.id===f.id&&((g=h.color)===null||g===void 0?void 0:g.id)===((p=f.color)===null||p===void 0?void 0:p.id)}n.isEqual=u})(Te||(Te={}));const fs=rt("commandService"),Yt=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new B,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(n,e){if(!n)throw new Error("invalid command");if(typeof n=="string"){if(!e)throw new Error("invalid command");return this.registerCommand({id:n,handler:e})}if(n.description){const r=[];for(const l of n.description.args)r.push(l.constraint);const a=n.handler;n.handler=function(l,...c){return afe(c,r),a(l,...c)}}const{id:t}=n;let i=this._commands.get(t);i||(i=new Ds,this._commands.set(t,i));const s=i.unshift(n),o=Ye(()=>{s();const r=this._commands.get(t);r!=null&&r.isEmpty()&&this._commands.delete(t)});return this._onDidRegisterCommand.fire(t),o}registerCommandAlias(n,e){return Yt.registerCommand(n,(t,...i)=>t.get(fs).executeCommand(e,...i))}getCommand(n){const e=this._commands.get(n);if(!(!e||e.isEmpty()))return ut.first(e)}getCommands(){const n=new Map;for(const e of this._commands.keys()){const t=this.getCommand(e);t&&n.set(e,t)}return n}};Yt.registerCommand("noop",()=>{});function Zk(...n){switch(n.length){case 1:return m("contextkey.scanner.hint.didYouMean1","Did you mean {0}?",n[0]);case 2:return m("contextkey.scanner.hint.didYouMean2","Did you mean {0} or {1}?",n[0],n[1]);case 3:return m("contextkey.scanner.hint.didYouMean3","Did you mean {0}, {1} or {2}?",n[0],n[1],n[2]);default:return}}const Dpe=m("contextkey.scanner.hint.didYouForgetToOpenOrCloseQuote","Did you forget to open or close the quote?"),kpe=m("contextkey.scanner.hint.didYouForgetToEscapeSlash","Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'.");class Ea{constructor(){this._input="",this._start=0,this._current=0,this._tokens=[],this._errors=[],this.stringRe=/[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy}static getLexeme(e){switch(e.type){case 0:return"(";case 1:return")";case 2:return"!";case 3:return e.isTripleEq?"===":"==";case 4:return e.isTripleEq?"!==":"!=";case 5:return"<";case 6:return"<=";case 7:return">=";case 8:return">=";case 9:return"=~";case 10:return e.lexeme;case 11:return"true";case 12:return"false";case 13:return"in";case 14:return"not";case 15:return"&&";case 16:return"||";case 17:return e.lexeme;case 18:return e.lexeme;case 19:return e.lexeme;case 20:return"EOF";default:throw E4(`unhandled token type: ${JSON.stringify(e)}; have you forgotten to add a case?`)}}reset(e){return this._input=e,this._start=0,this._current=0,this._tokens=[],this._errors=[],this}scan(){for(;!this._isAtEnd();)switch(this._start=this._current,this._advance()){case 40:this._addToken(0);break;case 41:this._addToken(1);break;case 33:if(this._match(61)){const t=this._match(61);this._tokens.push({type:4,offset:this._start,isTripleEq:t})}else this._addToken(2);break;case 39:this._quotedString();break;case 47:this._regex();break;case 61:if(this._match(61)){const t=this._match(61);this._tokens.push({type:3,offset:this._start,isTripleEq:t})}else this._match(126)?this._addToken(9):this._error(Zk("==","=~"));break;case 60:this._addToken(this._match(61)?6:5);break;case 62:this._addToken(this._match(61)?8:7);break;case 38:this._match(38)?this._addToken(15):this._error(Zk("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(Zk("||"));break;case 32:case 13:case 9:case 10:case 160:break;default:this._string()}return this._start=this._current,this._addToken(20),Array.from(this._tokens)}_match(e){return this._isAtEnd()||this._input.charCodeAt(this._current)!==e?!1:(this._current++,!0)}_advance(){return this._input.charCodeAt(this._current++)}_peek(){return this._isAtEnd()?0:this._input.charCodeAt(this._current)}_addToken(e){this._tokens.push({type:e,offset:this._start})}_error(e){const t=this._start,i=this._input.substring(this._start,this._current),s={type:19,offset:this._start,lexeme:i};this._errors.push({offset:t,lexeme:i,additionalInfo:e}),this._tokens.push(s)}_string(){this.stringRe.lastIndex=this._start;const e=this.stringRe.exec(this._input);if(e){this._current=this._start+e[0].length;const t=this._input.substring(this._start,this._current),i=Ea._keywords.get(t);i?this._addToken(i):this._tokens.push({type:17,lexeme:t,offset:this._start})}}_quotedString(){for(;this._peek()!==39&&!this._isAtEnd();)this._advance();if(this._isAtEnd()){this._error(Dpe);return}this._advance(),this._tokens.push({type:18,lexeme:this._input.substring(this._start+1,this._current-1),offset:this._start+1})}_regex(){let e=this._current,t=!1,i=!1;for(;;){if(e>=this._input.length){this._current=e,this._error(kpe);return}const o=this._input.charCodeAt(e);if(t)t=!1;else if(o===47&&!i){e++;break}else o===91?i=!0:o===92?t=!0:o===93&&(i=!1);e++}for(;e=this._input.length}}Ea._regexFlags=new Set(["i","g","s","m","y","u"].map(n=>n.charCodeAt(0)));Ea._keywords=new Map([["not",14],["in",13],["false",12],["true",11]]);const On=new Map;On.set("false",!1);On.set("true",!0);On.set("isMac",pt);On.set("isLinux",Xn);On.set("isWindows",Ps);On.set("isWeb",i0);On.set("isMacNative",pt&&!i0);On.set("isEdge",Sfe);On.set("isFirefox",wfe);On.set("isChrome",aU);On.set("isSafari",Cfe);const Epe=Object.prototype.hasOwnProperty,Ape={regexParsingWithErrorRecovery:!0},Ipe=m("contextkey.parser.error.emptyString","Empty context key expression"),Tpe=m("contextkey.parser.error.emptyString.hint","Did you forget to write an expression? You can also put 'false' or 'true' to always evaluate to false or true, respectively."),Npe=m("contextkey.parser.error.noInAfterNot","'in' after 'not'."),YF=m("contextkey.parser.error.closingParenthesis","closing parenthesis ')'"),Rpe=m("contextkey.parser.error.unexpectedToken","Unexpected token"),Mpe=m("contextkey.parser.error.unexpectedToken.hint","Did you forget to put && or || before the token?"),Ppe=m("contextkey.parser.error.unexpectedEOF","Unexpected end of expression"),Ope=m("contextkey.parser.error.unexpectedEOF.hint","Did you forget to put a context key?");let OU=class a_{constructor(e=Ape){this._config=e,this._scanner=new Ea,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(e){if(e===""){this._parsingErrors.push({message:Ipe,offset:0,lexeme:"",additionalInfo:Tpe});return}this._tokens=this._scanner.reset(e).scan(),this._current=0,this._parsingErrors=[];try{const t=this._expr();if(!this._isAtEnd()){const i=this._peek(),s=i.type===17?Mpe:void 0;throw this._parsingErrors.push({message:Rpe,offset:i.offset,lexeme:Ea.getLexeme(i),additionalInfo:s}),a_._parseError}return t}catch(t){if(t!==a_._parseError)throw t;return}}_expr(){return this._or()}_or(){const e=[this._and()];for(;this._matchOne(16);){const t=this._and();e.push(t)}return e.length===1?e[0]:Le.or(...e)}_and(){const e=[this._term()];for(;this._matchOne(15);){const t=this._term();e.push(t)}return e.length===1?e[0]:Le.and(...e)}_term(){if(this._matchOne(2)){const e=this._peek();switch(e.type){case 11:return this._advance(),ds.INSTANCE;case 12:return this._advance(),Os.INSTANCE;case 0:{this._advance();const t=this._expr();return this._consume(1,YF),t==null?void 0:t.negate()}case 17:return this._advance(),qf.create(e.lexeme);default:throw this._errExpectedButGot("KEY | true | false | '(' expression ')'",e)}}return this._primary()}_primary(){const e=this._peek();switch(e.type){case 11:return this._advance(),Le.true();case 12:return this._advance(),Le.false();case 0:{this._advance();const t=this._expr();return this._consume(1,YF),t}case 17:{const t=e.lexeme;if(this._advance(),this._matchOne(9)){const s=this._peek();if(!this._config.regexParsingWithErrorRecovery){if(this._advance(),s.type!==10)throw this._errExpectedButGot("REGEX",s);const o=s.lexeme,r=o.lastIndexOf("/"),a=r===o.length-1?void 0:this._removeFlagsGY(o.substring(r+1));let l;try{l=new RegExp(o.substring(1,r),a)}catch{throw this._errExpectedButGot("REGEX",s)}return $b.create(t,l)}switch(s.type){case 10:case 19:{const o=[s.lexeme];this._advance();let r=this._peek(),a=0;for(let h=0;h=0){const c=o.slice(a+1,l),d=o[l+1]==="i"?"i":"";try{r=new RegExp(c,d)}catch{throw this._errExpectedButGot("REGEX",s)}}}if(r===null)throw this._errExpectedButGot("REGEX",s);return $b.create(t,r)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,Npe);const s=this._value();return Le.notIn(t,s)}switch(this._peek().type){case 3:{this._advance();const s=this._value();if(this._previous().type===18)return Le.equals(t,s);switch(s){case"true":return Le.has(t);case"false":return Le.not(t);default:return Le.equals(t,s)}}case 4:{this._advance();const s=this._value();if(this._previous().type===18)return Le.notEquals(t,s);switch(s){case"true":return Le.not(t);case"false":return Le.has(t);default:return Le.notEquals(t,s)}}case 5:return this._advance(),GL.create(t,this._value());case 6:return this._advance(),KL.create(t,this._value());case 7:return this._advance(),jL.create(t,this._value());case 8:return this._advance(),qL.create(t,this._value());case 13:return this._advance(),Le.in(t,this._value());default:return Le.has(t)}}case 20:throw this._parsingErrors.push({message:Ppe,offset:e.offset,lexeme:"",additionalInfo:Ope}),a_._parseError;default:throw this._errExpectedButGot(`true | false | KEY | KEY '=~' REGEX | KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value`,this._peek())}}_value(){const e=this._peek();switch(e.type){case 17:case 18:return this._advance(),e.lexeme;case 11:return this._advance(),"true";case 12:return this._advance(),"false";case 13:return this._advance(),"in";default:return""}}_removeFlagsGY(e){return e.replaceAll(this._flagsGYRe,"")}_previous(){return this._tokens[this._current-1]}_matchOne(e){return this._check(e)?(this._advance(),!0):!1}_advance(){return this._isAtEnd()||this._current++,this._previous()}_consume(e,t){if(this._check(e))return this._advance();throw this._errExpectedButGot(t,this._peek())}_errExpectedButGot(e,t,i){const s=m("contextkey.parser.error.expectedButGot",`Expected: {0} -Received: '{1}'.`,e,Ia.getLexeme(t)),o=t.offset,r=Ia.getLexeme(t);return this._parsingErrors.push({message:s,offset:o,lexeme:r,additionalInfo:i}),i_._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===20}};FU._parseError=new Error;class xe{static false(){return us.INSTANCE}static true(){return Bs.INSTANCE}static has(e){return Hf.create(e)}static equals(e,t){return j1.create(e,t)}static notEquals(e,t){return ZL.create(e,t)}static regex(e,t){return zb.create(e,t)}static in(e,t){return KL.create(e,t)}static notIn(e,t){return YL.create(e,t)}static not(e){return $f.create(e)}static and(...e){return Lh.create(e,null,!0)}static or(...e){return zl.create(e,null,!0)}static deserialize(e){return e==null?void 0:this._parser.parse(e)}}xe._parser=new FU({regexParsingWithErrorRecovery:!1});function _pe(n,e){const t=n?n.substituteConstants():void 0,i=e?e.substituteConstants():void 0;return!t&&!i?!0:!t||!i?!1:t.equals(i)}function N_(n,e){return n.cmp(e)}class us{constructor(){this.type=0}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!1}serialize(){return"false"}keys(){return[]}negate(){return Bs.INSTANCE}}us.INSTANCE=new us;class Bs{constructor(){this.type=1}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!0}serialize(){return"true"}keys(){return[]}negate(){return us.INSTANCE}}Bs.INSTANCE=new Bs;class Hf{static create(e,t=null){const i=Wn.get(e);return typeof i=="boolean"?i?Bs.INSTANCE:us.INSTANCE:new Hf(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=2}cmp(e){return e.type!==this.type?this.type-e.type:WU(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=Wn.get(this.key);return typeof e=="boolean"?e?Bs.INSTANCE:us.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=$f.create(this.key,this)),this.negated}}class j1{static create(e,t,i=null){if(typeof t=="boolean")return t?Hf.create(e,i):$f.create(e,i);const s=Wn.get(e);return typeof s=="boolean"?t===(s?"true":"false")?Bs.INSTANCE:us.INSTANCE:new j1(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=4}cmp(e){return e.type!==this.type?this.type-e.type:Uf(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){const e=Wn.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?Bs.INSTANCE:us.INSTANCE}return this}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=ZL.create(this.key,this.value,this)),this.negated}}class KL{static create(e,t){return new KL(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=10,this.negated=null}cmp(e){return e.type!==this.type?this.type-e.type:Uf(this.key,this.valueKey,e.key,e.valueKey)}equals(e){return e.type===this.type?this.key===e.key&&this.valueKey===e.valueKey:!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.valueKey),i=e.getValue(this.key);return Array.isArray(t)?t.includes(i):typeof i=="string"&&typeof t=="object"&&t!==null?lpe.call(t,i):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=YL.create(this.key,this.valueKey)),this.negated}}class YL{static create(e,t){return new YL(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=11,this._negated=KL.create(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:this._negated.cmp(e._negated)}equals(e){return e.type===this.type?this._negated.equals(e._negated):!1}substituteConstants(){return this}evaluate(e){return!this._negated.evaluate(e)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}negate(){return this._negated}}class ZL{static create(e,t,i=null){if(typeof t=="boolean")return t?$f.create(e,i):Hf.create(e,i);const s=Wn.get(e);return typeof s=="boolean"?t===(s?"true":"false")?us.INSTANCE:Bs.INSTANCE:new ZL(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=5}cmp(e){return e.type!==this.type?this.type-e.type:Uf(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){const e=Wn.get(this.key);if(typeof e=="boolean"){const t=e?"true":"false";return this.value===t?us.INSTANCE:Bs.INSTANCE}return this}evaluate(e){return e.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=j1.create(this.key,this.value,this)),this.negated}}class $f{static create(e,t=null){const i=Wn.get(e);return typeof i=="boolean"?i?us.INSTANCE:Bs.INSTANCE:new $f(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=3}cmp(e){return e.type!==this.type?this.type-e.type:WU(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=Wn.get(this.key);return typeof e=="boolean"?e?us.INSTANCE:Bs.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Hf.create(this.key,this)),this.negated}}function XL(n,e){if(typeof n=="string"){const t=parseFloat(n);isNaN(t)||(n=t)}return typeof n=="string"||typeof n=="number"?e(n):us.INSTANCE}class QL{static create(e,t,i=null){return XL(t,s=>new QL(e,s,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=12}cmp(e){return e.type!==this.type?this.type-e.type:Uf(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=tD.create(this.key,this.value,this)),this.negated}}class JL{static create(e,t,i=null){return XL(t,s=>new JL(e,s,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=13}cmp(e){return e.type!==this.type?this.type-e.type:Uf(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=eD.create(this.key,this.value,this)),this.negated}}class eD{static create(e,t,i=null){return XL(t,s=>new eD(e,s,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=14}cmp(e){return e.type!==this.type?this.type-e.type:Uf(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))new tD(e,s,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=15}cmp(e){return e.type!==this.type?this.type-e.type:Uf(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=QL.create(this.key,this.value,this)),this.negated}}class zb{static create(e,t){return new zb(e,t)}constructor(e,t){this.key=e,this.regexp=t,this.type=7,this.negated=null}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.keye.key)return 1;const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return ti?1:0}equals(e){if(e.type===this.type){const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return this.key===e.key&&t===i}return!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.key);return this.regexp?this.regexp.test(t):!1}serialize(){const e=this.regexp?`/${this.regexp.source}/${this.regexp.flags}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=G4.create(this)),this.negated}}class G4{static create(e){return new G4(e)}constructor(e){this._actual=e,this.type=8}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type?this._actual.equals(e._actual):!1}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){return`!(${this._actual.serialize()})`}keys(){return this._actual.keys()}negate(){return this._actual}}function BU(n){let e=null;for(let t=0,i=n.length;te.expr.length)return 1;for(let t=0,i=this.expr.length;t1;){const r=s[s.length-1];if(r.type!==9)break;s.pop();const a=s.pop(),l=s.length===0,c=zl.create(r.expr.map(d=>Lh.create([d,a],null,i)),null,l);c&&(s.push(c),s.sort(N_))}if(s.length===1)return s[0];if(i){for(let r=0;re.serialize()).join(" && ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());this.negated=zl.create(e,this,!0)}return this.negated}}class zl{static create(e,t,i){return zl._normalizeArr(e,t,i)}constructor(e,t){this.expr=e,this.negated=t,this.type=9}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.lengthe.expr.length)return 1;for(let t=0,i=this.expr.length;te.serialize()).join(" || ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());for(;e.length>1;){const t=e.shift(),i=e.shift(),s=[];for(const o of t9(t))for(const r of t9(i))s.push(Lh.create([o,r],null,!1));e.unshift(zl.create(s,null,!1))}this.negated=zl.create(e,this,!0)}return this.negated}}class _e extends Hf{static all(){return _e._info.values()}constructor(e,t,i){super(e,null),this._defaultValue=t,typeof i=="object"?_e._info.push(Object.assign(Object.assign({},i),{key:e})):i!==!0&&_e._info.push({key:e,description:i,type:t!=null?typeof t:void 0})}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return j1.create(this.key,e)}}_e._info=[];const tt=at("contextKeyService");function WU(n,e){return ne?1:0}function Uf(n,e,t,i){return nt?1:ei?1:0}function nT(n,e){if(n.type===0||e.type===1)return!0;if(n.type===9)return e.type===9?e9(n.expr,e.expr):!1;if(e.type===9){for(const t of e.expr)if(nT(n,t))return!0;return!1}if(n.type===6){if(e.type===6)return e9(e.expr,n.expr);for(const t of n.expr)if(nT(t,e))return!0;return!1}return n.equals(e)}function e9(n,e){let t=0,i=0;for(;t>>0,i=(n&4294901760)>>>16;return i!==0?new i2([qy(t,e),qy(i,e)]):new i2([qy(t,e)])}else{const t=[];for(let i=0;i{a(),this._cachedMergedKeybindings=null})}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(Cpe)),this._cachedMergedKeybindings.slice(0)}}const Ws=new Y4,wpe={EditorModes:"platform.keybindingsRegistry"};_n.add(wpe.EditorModes,Ws);function Cpe(n,e){if(n.weight1!==e.weight1)return n.weight1-e.weight1;if(n.command&&e.command){if(n.commande.command)return 1}return n.weight2-e.weight2}var Spe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},i9=function(n,e){return function(t,i){e(t,i,n)}},xpe=function(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(n);st===e}}Hl._all=new Map;const dr=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new sge({merge:Hl.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(n){return this._commands.set(n.id,n),this._onDidChangeMenu.fire(Hl.for(I.CommandPalette)),Ze(()=>{this._commands.delete(n.id)&&this._onDidChangeMenu.fire(Hl.for(I.CommandPalette))})}getCommand(n){return this._commands.get(n)}getCommands(){const n=new Map;return this._commands.forEach((e,t)=>n.set(t,e)),n}appendMenuItem(n,e){let t=this._menuItems.get(n);t||(t=new ks,this._menuItems.set(n,t));const i=t.push(e);return this._onDidChangeMenu.fire(Hl.for(n)),Ze(()=>{i(),this._onDidChangeMenu.fire(Hl.for(n))})}appendMenuItems(n){const e=new pe;for(const{id:t,item:i}of n)e.add(this.appendMenuItem(t,i));return e}getMenuItems(n){let e;return this._menuItems.has(n)?e=[...this._menuItems.get(n)]:e=[],n===I.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(n){const e=new Set;for(const t of n)n_(t)&&(e.add(t.command.id),t.alt&&e.add(t.alt.id));this._commands.forEach((t,i)=>{e.has(i)||n.push({command:t})})}};class NS extends qL{constructor(e,t,i){super(`submenuitem.${e.submenu.id}`,typeof e.title=="string"?e.title:e.title.value,i,"submenu"),this.item=e,this.hideActions=t}}let il=fC=class{static label(e,t){return t!=null&&t.renderShortTitle&&e.shortTitle?typeof e.shortTitle=="string"?e.shortTitle:e.shortTitle.value:typeof e.title=="string"?e.title:e.title.value}constructor(e,t,i,s,o,r){var a,l;this.hideActions=s,this._commandService=r,this.id=e.id,this.label=fC.label(e,i),this.tooltip=(l=typeof e.tooltip=="string"?e.tooltip:(a=e.tooltip)===null||a===void 0?void 0:a.value)!==null&&l!==void 0?l:"",this.enabled=!e.precondition||o.contextMatchesRules(e.precondition),this.checked=void 0;let c;if(e.toggled){const d=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=o.contextMatchesRules(d.condition),this.checked&&d.tooltip&&(this.tooltip=typeof d.tooltip=="string"?d.tooltip:d.tooltip.value),this.checked&&Te.isThemeIcon(d.icon)&&(c=d.icon),this.checked&&d.title&&(this.label=typeof d.title=="string"?d.title:d.title.value)}c||(c=Te.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new fC(t,void 0,i,s,o,r):void 0,this._options=i,this.class=c&&Te.asClassName(c)}run(...e){var t,i;let s=[];return!((t=this._options)===null||t===void 0)&&t.arg&&(s=[...s,this._options.arg]),!((i=this._options)===null||i===void 0)&&i.shouldForwardArgs&&(s=[...s,...e]),this._commandService.executeCommand(this.id,...s)}};il=fC=Spe([i9(4,tt),i9(5,gs)],il);class i0{constructor(e){this.desc=e}}function Vs(n){const e=new pe,t=new n,i=t.desc,{f1:s,menu:o,keybinding:r,description:a}=i,l=xpe(i,["f1","menu","keybinding","description"]);if(e.add(Zt.registerCommand({id:l.id,handler:(c,...d)=>t.run(c,...d),description:a})),Array.isArray(o))for(const c of o)e.add(dr.appendMenuItem(c.id,Object.assign({command:Object.assign(Object.assign({},l),{precondition:c.precondition===null?void 0:l.precondition})},c)));else o&&e.add(dr.appendMenuItem(o.id,Object.assign({command:Object.assign(Object.assign({},l),{precondition:o.precondition===null?void 0:l.precondition})},o)));if(s&&(e.add(dr.appendMenuItem(I.CommandPalette,{command:l,when:l.precondition})),e.add(dr.addCommand(l))),Array.isArray(r))for(const c of r)e.add(Ws.registerKeybindingRule(Object.assign(Object.assign({},c),{id:l.id,when:l.precondition?xe.and(l.precondition,c.when):c.when})));else r&&e.add(Ws.registerKeybindingRule(Object.assign(Object.assign({},r),{id:l.id,when:l.precondition?xe.and(l.precondition,r.when):r.when})));return e}const Cc=at("telemetryService"),Sc=at("logService");var Cn;(function(n){n[n.Off=0]="Off",n[n.Trace=1]="Trace",n[n.Debug=2]="Debug",n[n.Info=3]="Info",n[n.Warning=4]="Warning",n[n.Error=5]="Error"})(Cn||(Cn={}));const zU=Cn.Info;class HU extends Y{constructor(){super(...arguments),this.level=zU,this._onDidChangeLogLevel=this._register(new B),this.onDidChangeLogLevel=this._onDidChangeLogLevel.event}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}checkLogLevel(e){return this.level!==Cn.Off&&this.level<=e}}class Dpe extends HU{constructor(e=zU,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.checkLogLevel(Cn.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...t):console.log(e,...t))}debug(e,...t){this.checkLogLevel(Cn.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...t):console.log(e,...t))}info(e,...t){this.checkLogLevel(Cn.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...t):console.log(e,...t))}warn(e,...t){this.checkLogLevel(Cn.Warning)&&(this.useColors?console.log("%c WARN","color: #993",e,...t):console.log(e,...t))}error(e,...t){this.checkLogLevel(Cn.Error)&&(this.useColors?console.log("%c ERR","color: #f33",e,...t):console.error(e,...t))}dispose(){}}class kpe extends HU{constructor(e){super(),this.loggers=e,e.length&&this.setLevel(e[0].getLevel())}setLevel(e){for(const t of this.loggers)t.setLevel(e);super.setLevel(e)}trace(e,...t){for(const i of this.loggers)i.trace(e,...t)}debug(e,...t){for(const i of this.loggers)i.debug(e,...t)}info(e,...t){for(const i of this.loggers)i.info(e,...t)}warn(e,...t){for(const i of this.loggers)i.warn(e,...t)}error(e,...t){for(const i of this.loggers)i.error(e,...t)}dispose(){for(const e of this.loggers)e.dispose()}}function Epe(n){switch(n){case Cn.Trace:return"trace";case Cn.Debug:return"debug";case Cn.Info:return"info";case Cn.Warning:return"warn";case Cn.Error:return"error";case Cn.Off:return"off"}}new _e("logLevel",Epe(Cn.Info));const Z4={clipboard:{writeText:dp||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:dp||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},keyboard:dp||Jge()?0:navigator.keyboard||bc?1:2,touch:"ontouchstart"in window||navigator.maxTouchPoints>0,pointerEvents:window.PointerEvent&&("ontouchstart"in window||window.navigator.maxTouchPoints>0||navigator.maxTouchPoints>0)};function Ape(n){if(n.charCode){const t=String.fromCharCode(n.charCode).toUpperCase();return Vl.fromString(t)}const e=n.keyCode;if(e===3)return 7;if(Lr)switch(e){case 59:return 85;case 60:if(Jn)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(mt)return 57;break}else if(qh){if(mt&&e===93)return 57;if(!mt&&e===92)return 57}return bU[e]||0}const Ipe=mt?256:2048,Tpe=512,Npe=1024,Rpe=mt?2048:256;class Ht{constructor(e){this._standardKeyboardEventBrand=!0;const t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=t.getModifierState("AltGraph"),this.keyCode=Ape(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=Ipe),this.altKey&&(t|=Tpe),this.shiftKey&&(t|=Npe),this.metaKey&&(t|=Rpe),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new bf(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}}let n9=!1,w0=null;function Mpe(n){if(!n.parent||n.parent===n)return null;try{const e=n.location,t=n.parent.location;if(e.origin!=="null"&&t.origin!=="null"&&e.origin!==t.origin)return n9=!0,null}catch{return n9=!0,null}return n.parent}class Ppe{static getSameOriginWindowChain(){if(!w0){w0=[];let e=window,t;do t=Mpe(e),t?w0.push({window:e,iframeElement:e.frameElement||null}):w0.push({window:e,iframeElement:null}),e=t;while(e)}return w0.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let i=0,s=0;const o=this.getSameOriginWindowChain();for(const r of o){if(i+=r.window.scrollY,s+=r.window.scrollX,r.window===t||!r.iframeElement)break;const a=r.iframeElement.getBoundingClientRect();i+=a.top,s+=a.left}return{top:i,left:s}}}class ur{constructor(e){this.timestamp=Date.now(),this.browserEvent=e,this.leftButton=e.button===0,this.middleButton=e.button===1,this.rightButton=e.button===2,this.buttons=e.buttons,this.target=e.target,this.detail=e.detail||1,e.type==="dblclick"&&(this.detail=2),this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey,typeof e.pageX=="number"?(this.posx=e.pageX,this.posy=e.pageY):(this.posx=e.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=e.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);const t=Ppe.getPositionOfChildWindowRelativeToAncestorWindow(window,e.view);this.posx-=t.left,this.posy-=t.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}class vf{constructor(e,t=0,i=0){if(this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=i,this.deltaX=t,e){const s=e,o=e;if(typeof s.wheelDeltaY<"u")this.deltaY=s.wheelDeltaY/120;else if(typeof o.VERTICAL_AXIS<"u"&&o.axis===o.VERTICAL_AXIS)this.deltaY=-o.detail/3;else if(e.type==="wheel"){const r=e;r.deltaMode===r.DOM_DELTA_LINE?Lr&&!mt?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof s.wheelDeltaX<"u")bc&&Fs?this.deltaX=-(s.wheelDeltaX/120):this.deltaX=s.wheelDeltaX/120;else if(typeof o.HORIZONTAL_AXIS<"u"&&o.axis===o.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){const r=e;r.deltaMode===r.DOM_DELTA_LINE?Lr&&!mt?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)===null||e===void 0||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)===null||e===void 0||e.stopPropagation()}}/*! @license DOMPurify 3.0.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.5/LICENSE */const{entries:$U,setPrototypeOf:s9,isFrozen:Ope,getPrototypeOf:Fpe,getOwnPropertyDescriptor:Bpe}=Object;let{freeze:io,seal:aa,create:Wpe}=Object,{apply:oT,construct:rT}=typeof Reflect<"u"&&Reflect;oT||(oT=function(e,t,i){return e.apply(t,i)});io||(io=function(e){return e});aa||(aa=function(e){return e});rT||(rT=function(e,t){return new e(...t)});const Vpe=Dr(Array.prototype.forEach),o9=Dr(Array.prototype.pop),C0=Dr(Array.prototype.push),gC=Dr(String.prototype.toLowerCase),s2=Dr(String.prototype.toString),zpe=Dr(String.prototype.match),Br=Dr(String.prototype.replace),Hpe=Dr(String.prototype.indexOf),$pe=Dr(String.prototype.trim),Io=Dr(RegExp.prototype.test),S0=Upe(TypeError);function Dr(n){return function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s/gm),Ype=aa(/\${[\w\W]*}/gm),Zpe=aa(/^data-[\-\w.\u00B7-\uFFFF]/),Xpe=aa(/^aria-[\-\w]+$/),UU=aa(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Qpe=aa(/^(?:\w+script|data):/i),Jpe=aa(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),jU=aa(/^html$/i);var d9=Object.freeze({__proto__:null,MUSTACHE_EXPR:Gpe,ERB_EXPR:Kpe,TMPLIT_EXPR:Ype,DATA_ATTR:Zpe,ARIA_ATTR:Xpe,IS_ALLOWED_URI:UU,IS_SCRIPT_OR_DATA:Qpe,ATTR_WHITESPACE:Jpe,DOCTYPE_NAME:jU});const eme=()=>typeof window>"u"?null:window,tme=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null;const s="data-tt-policy-suffix";t&&t.hasAttribute(s)&&(i=t.getAttribute(s));const o="dompurify"+(i?"#"+i:"");try{return e.createPolicy(o,{createHTML(r){return r},createScriptURL(r){return r}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function qU(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:eme();const e=Ke=>qU(Ke);if(e.version="3.0.5",e.removed=[],!n||!n.document||n.document.nodeType!==9)return e.isSupported=!1,e;const t=n.document,i=t.currentScript;let{document:s}=n;const{DocumentFragment:o,HTMLTemplateElement:r,Node:a,Element:l,NodeFilter:c,NamedNodeMap:d=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:u,DOMParser:h,trustedTypes:f}=n,g=l.prototype,p=Gy(g,"cloneNode"),_=Gy(g,"nextSibling"),v=Gy(g,"childNodes"),b=Gy(g,"parentNode");if(typeof r=="function"){const Ke=s.createElement("template");Ke.content&&Ke.content.ownerDocument&&(s=Ke.content.ownerDocument)}let y,w="";const{implementation:C,createNodeIterator:L,createDocumentFragment:x,getElementsByTagName:D}=s,{importNode:k}=t;let P={};e.isSupported=typeof $U=="function"&&typeof b=="function"&&C&&C.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:O,ERB_EXPR:M,TMPLIT_EXPR:R,DATA_ATTR:z,ARIA_ATTR:G,IS_SCRIPT_OR_DATA:te,ATTR_WHITESPACE:ae}=d9;let{IS_ALLOWED_URI:fe}=d9,oe=null;const Se=xt({},[...r9,...o2,...r2,...a2,...a9]);let Ie=null;const me=xt({},[...l9,...l2,...c9,...Ky]);let ie=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Xt=null,Dt=null,Nt=!0,Ge=!0,si=!1,ke=!0,Ve=!1,ge=!1,he=!1,Ei=!1,kt=!1,Tt=!1,yi=!1,er=!0,Mu=!1;const ck="user-content-";let J=!0,q=!1,U={},A=null;const T=xt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let W=null;const F=xt({},["audio","video","img","source","image","track"]);let Z=null;const ce=xt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ce="http://www.w3.org/1998/Math/MathML",De="http://www.w3.org/2000/svg",He="http://www.w3.org/1999/xhtml";let Fe=He,Rt=!1,Et=null;const Re=xt({},[Ce,De,He],s2);let hi;const fi=["application/xhtml+xml","text/html"],tr="text/html";let Ct,Vi=null;const Pu=s.createElement("form"),Ou=function(j){return j instanceof RegExp||j instanceof Function},Mr=function(j){if(!(Vi&&Vi===j)){if((!j||typeof j!="object")&&(j={}),j=ug(j),hi=fi.indexOf(j.PARSER_MEDIA_TYPE)===-1?hi=tr:hi=j.PARSER_MEDIA_TYPE,Ct=hi==="application/xhtml+xml"?s2:gC,oe="ALLOWED_TAGS"in j?xt({},j.ALLOWED_TAGS,Ct):Se,Ie="ALLOWED_ATTR"in j?xt({},j.ALLOWED_ATTR,Ct):me,Et="ALLOWED_NAMESPACES"in j?xt({},j.ALLOWED_NAMESPACES,s2):Re,Z="ADD_URI_SAFE_ATTR"in j?xt(ug(ce),j.ADD_URI_SAFE_ATTR,Ct):ce,W="ADD_DATA_URI_TAGS"in j?xt(ug(F),j.ADD_DATA_URI_TAGS,Ct):F,A="FORBID_CONTENTS"in j?xt({},j.FORBID_CONTENTS,Ct):T,Xt="FORBID_TAGS"in j?xt({},j.FORBID_TAGS,Ct):{},Dt="FORBID_ATTR"in j?xt({},j.FORBID_ATTR,Ct):{},U="USE_PROFILES"in j?j.USE_PROFILES:!1,Nt=j.ALLOW_ARIA_ATTR!==!1,Ge=j.ALLOW_DATA_ATTR!==!1,si=j.ALLOW_UNKNOWN_PROTOCOLS||!1,ke=j.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ve=j.SAFE_FOR_TEMPLATES||!1,ge=j.WHOLE_DOCUMENT||!1,kt=j.RETURN_DOM||!1,Tt=j.RETURN_DOM_FRAGMENT||!1,yi=j.RETURN_TRUSTED_TYPE||!1,Ei=j.FORCE_BODY||!1,er=j.SANITIZE_DOM!==!1,Mu=j.SANITIZE_NAMED_PROPS||!1,J=j.KEEP_CONTENT!==!1,q=j.IN_PLACE||!1,fe=j.ALLOWED_URI_REGEXP||UU,Fe=j.NAMESPACE||He,ie=j.CUSTOM_ELEMENT_HANDLING||{},j.CUSTOM_ELEMENT_HANDLING&&Ou(j.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ie.tagNameCheck=j.CUSTOM_ELEMENT_HANDLING.tagNameCheck),j.CUSTOM_ELEMENT_HANDLING&&Ou(j.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ie.attributeNameCheck=j.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),j.CUSTOM_ELEMENT_HANDLING&&typeof j.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ie.allowCustomizedBuiltInElements=j.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ve&&(Ge=!1),Tt&&(kt=!0),U&&(oe=xt({},[...a9]),Ie=[],U.html===!0&&(xt(oe,r9),xt(Ie,l9)),U.svg===!0&&(xt(oe,o2),xt(Ie,l2),xt(Ie,Ky)),U.svgFilters===!0&&(xt(oe,r2),xt(Ie,l2),xt(Ie,Ky)),U.mathMl===!0&&(xt(oe,a2),xt(Ie,c9),xt(Ie,Ky))),j.ADD_TAGS&&(oe===Se&&(oe=ug(oe)),xt(oe,j.ADD_TAGS,Ct)),j.ADD_ATTR&&(Ie===me&&(Ie=ug(Ie)),xt(Ie,j.ADD_ATTR,Ct)),j.ADD_URI_SAFE_ATTR&&xt(Z,j.ADD_URI_SAFE_ATTR,Ct),j.FORBID_CONTENTS&&(A===T&&(A=ug(A)),xt(A,j.FORBID_CONTENTS,Ct)),J&&(oe["#text"]=!0),ge&&xt(oe,["html","head","body"]),oe.table&&(xt(oe,["tbody"]),delete Xt.tbody),j.TRUSTED_TYPES_POLICY){if(typeof j.TRUSTED_TYPES_POLICY.createHTML!="function")throw S0('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof j.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw S0('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');y=j.TRUSTED_TYPES_POLICY,w=y.createHTML("")}else y===void 0&&(y=tme(f,i)),y!==null&&typeof w=="string"&&(w=y.createHTML(""));io&&io(j),Vi=j}},Ic=xt({},["mi","mo","mn","ms","mtext"]),Fu=xt({},["foreignobject","desc","title","annotation-xml"]),Bu=xt({},["title","style","font","a","script"]),rg=xt({},o2);xt(rg,r2),xt(rg,jpe);const Wu=xt({},a2);xt(Wu,qpe);const dk=function(j){let be=b(j);(!be||!be.tagName)&&(be={namespaceURI:Fe,tagName:"template"});const Ne=gC(j.tagName),gi=gC(be.tagName);return Et[j.namespaceURI]?j.namespaceURI===De?be.namespaceURI===He?Ne==="svg":be.namespaceURI===Ce?Ne==="svg"&&(gi==="annotation-xml"||Ic[gi]):!!rg[Ne]:j.namespaceURI===Ce?be.namespaceURI===He?Ne==="math":be.namespaceURI===De?Ne==="math"&&Fu[gi]:!!Wu[Ne]:j.namespaceURI===He?be.namespaceURI===De&&!Fu[gi]||be.namespaceURI===Ce&&!Ic[gi]?!1:!Wu[Ne]&&(Bu[Ne]||!rg[Ne]):!!(hi==="application/xhtml+xml"&&Et[j.namespaceURI]):!1},ma=function(j){C0(e.removed,{element:j});try{j.parentNode.removeChild(j)}catch{j.remove()}},h0=function(j,be){try{C0(e.removed,{attribute:be.getAttributeNode(j),from:be})}catch{C0(e.removed,{attribute:null,from:be})}if(be.removeAttribute(j),j==="is"&&!Ie[j])if(kt||Tt)try{ma(be)}catch{}else try{be.setAttribute(j,"")}catch{}},f0=function(j){let be,Ne;if(Ei)j=""+j;else{const ir=zpe(j,/^[\r\n\t ]+/);Ne=ir&&ir[0]}hi==="application/xhtml+xml"&&Fe===He&&(j=''+j+"");const gi=y?y.createHTML(j):j;if(Fe===He)try{be=new h().parseFromString(gi,hi)}catch{}if(!be||!be.documentElement){be=C.createDocument(Fe,"template",null);try{be.documentElement.innerHTML=Rt?w:gi}catch{}}const Un=be.body||be.documentElement;return j&&Ne&&Un.insertBefore(s.createTextNode(Ne),Un.childNodes[0]||null),Fe===He?D.call(be,ge?"html":"body")[0]:ge?be.documentElement:Un},vy=function(j){return L.call(j.ownerDocument||j,j,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},YY=function(j){return j instanceof u&&(typeof j.nodeName!="string"||typeof j.textContent!="string"||typeof j.removeChild!="function"||!(j.attributes instanceof d)||typeof j.removeAttribute!="function"||typeof j.setAttribute!="function"||typeof j.namespaceURI!="string"||typeof j.insertBefore!="function"||typeof j.hasChildNodes!="function")},yy=function(j){return typeof a=="object"?j instanceof a:j&&typeof j=="object"&&typeof j.nodeType=="number"&&typeof j.nodeName=="string"},ml=function(j,be,Ne){P[j]&&Vpe(P[j],gi=>{gi.call(e,be,Ne,Vi)})},t5=function(j){let be;if(ml("beforeSanitizeElements",j,null),YY(j))return ma(j),!0;const Ne=Ct(j.nodeName);if(ml("uponSanitizeElement",j,{tagName:Ne,allowedTags:oe}),j.hasChildNodes()&&!yy(j.firstElementChild)&&(!yy(j.content)||!yy(j.content.firstElementChild))&&Io(/<[/\w]/g,j.innerHTML)&&Io(/<[/\w]/g,j.textContent))return ma(j),!0;if(!oe[Ne]||Xt[Ne]){if(!Xt[Ne]&&n5(Ne)&&(ie.tagNameCheck instanceof RegExp&&Io(ie.tagNameCheck,Ne)||ie.tagNameCheck instanceof Function&&ie.tagNameCheck(Ne)))return!1;if(J&&!A[Ne]){const gi=b(j)||j.parentNode,Un=v(j)||j.childNodes;if(Un&&gi){const ir=Un.length;for(let qi=ir-1;qi>=0;--qi)gi.insertBefore(p(Un[qi],!0),_(j))}}return ma(j),!0}return j instanceof l&&!dk(j)||(Ne==="noscript"||Ne==="noembed"||Ne==="noframes")&&Io(/<\/no(script|embed|frames)/i,j.innerHTML)?(ma(j),!0):(Ve&&j.nodeType===3&&(be=j.textContent,be=Br(be,O," "),be=Br(be,M," "),be=Br(be,R," "),j.textContent!==be&&(C0(e.removed,{element:j.cloneNode()}),j.textContent=be)),ml("afterSanitizeElements",j,null),!1)},i5=function(j,be,Ne){if(er&&(be==="id"||be==="name")&&(Ne in s||Ne in Pu))return!1;if(!(Ge&&!Dt[be]&&Io(z,be))){if(!(Nt&&Io(G,be))){if(!Ie[be]||Dt[be]){if(!(n5(j)&&(ie.tagNameCheck instanceof RegExp&&Io(ie.tagNameCheck,j)||ie.tagNameCheck instanceof Function&&ie.tagNameCheck(j))&&(ie.attributeNameCheck instanceof RegExp&&Io(ie.attributeNameCheck,be)||ie.attributeNameCheck instanceof Function&&ie.attributeNameCheck(be))||be==="is"&&ie.allowCustomizedBuiltInElements&&(ie.tagNameCheck instanceof RegExp&&Io(ie.tagNameCheck,Ne)||ie.tagNameCheck instanceof Function&&ie.tagNameCheck(Ne))))return!1}else if(!Z[be]){if(!Io(fe,Br(Ne,ae,""))){if(!((be==="src"||be==="xlink:href"||be==="href")&&j!=="script"&&Hpe(Ne,"data:")===0&&W[j])){if(!(si&&!Io(te,Br(Ne,ae,"")))){if(Ne)return!1}}}}}}return!0},n5=function(j){return j.indexOf("-")>0},s5=function(j){let be,Ne,gi,Un;ml("beforeSanitizeAttributes",j,null);const{attributes:ir}=j;if(!ir)return;const qi={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ie};for(Un=ir.length;Un--;){be=ir[Un];const{name:_a,namespaceURI:uk}=be;if(Ne=_a==="value"?be.value:$pe(be.value),gi=Ct(_a),qi.attrName=gi,qi.attrValue=Ne,qi.keepAttr=!0,qi.forceKeepAttr=void 0,ml("uponSanitizeAttribute",j,qi),Ne=qi.attrValue,qi.forceKeepAttr||(h0(_a,j),!qi.keepAttr))continue;if(!ke&&Io(/\/>/i,Ne)){h0(_a,j);continue}Ve&&(Ne=Br(Ne,O," "),Ne=Br(Ne,M," "),Ne=Br(Ne,R," "));const o5=Ct(j.nodeName);if(i5(o5,gi,Ne)){if(Mu&&(gi==="id"||gi==="name")&&(h0(_a,j),Ne=ck+Ne),y&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!uk)switch(f.getAttributeType(o5,gi)){case"TrustedHTML":{Ne=y.createHTML(Ne);break}case"TrustedScriptURL":{Ne=y.createScriptURL(Ne);break}}try{uk?j.setAttributeNS(uk,_a,Ne):j.setAttribute(_a,Ne),o9(e.removed)}catch{}}}ml("afterSanitizeAttributes",j,null)},ZY=function Ke(j){let be;const Ne=vy(j);for(ml("beforeSanitizeShadowDOM",j,null);be=Ne.nextNode();)ml("uponSanitizeShadowNode",be,null),!t5(be)&&(be.content instanceof o&&Ke(be.content),s5(be));ml("afterSanitizeShadowDOM",j,null)};return e.sanitize=function(Ke){let j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},be,Ne,gi,Un;if(Rt=!Ke,Rt&&(Ke=""),typeof Ke!="string"&&!yy(Ke))if(typeof Ke.toString=="function"){if(Ke=Ke.toString(),typeof Ke!="string")throw S0("dirty is not a string, aborting")}else throw S0("toString is not a function");if(!e.isSupported)return Ke;if(he||Mr(j),e.removed=[],typeof Ke=="string"&&(q=!1),q){if(Ke.nodeName){const _a=Ct(Ke.nodeName);if(!oe[_a]||Xt[_a])throw S0("root node is forbidden and cannot be sanitized in-place")}}else if(Ke instanceof a)be=f0(""),Ne=be.ownerDocument.importNode(Ke,!0),Ne.nodeType===1&&Ne.nodeName==="BODY"||Ne.nodeName==="HTML"?be=Ne:be.appendChild(Ne);else{if(!kt&&!Ve&&!ge&&Ke.indexOf("<")===-1)return y&&yi?y.createHTML(Ke):Ke;if(be=f0(Ke),!be)return kt?null:yi?w:""}be&&Ei&&ma(be.firstChild);const ir=vy(q?Ke:be);for(;gi=ir.nextNode();)t5(gi)||(gi.content instanceof o&&ZY(gi.content),s5(gi));if(q)return Ke;if(kt){if(Tt)for(Un=x.call(be.ownerDocument);be.firstChild;)Un.appendChild(be.firstChild);else Un=be;return(Ie.shadowroot||Ie.shadowrootmode)&&(Un=k.call(t,Un,!0)),Un}let qi=ge?be.outerHTML:be.innerHTML;return ge&&oe["!doctype"]&&be.ownerDocument&&be.ownerDocument.doctype&&be.ownerDocument.doctype.name&&Io(jU,be.ownerDocument.doctype.name)&&(qi=" -`+qi),Ve&&(qi=Br(qi,O," "),qi=Br(qi,M," "),qi=Br(qi,R," ")),y&&yi?y.createHTML(qi):qi},e.setConfig=function(Ke){Mr(Ke),he=!0},e.clearConfig=function(){Vi=null,he=!1},e.isValidAttribute=function(Ke,j,be){Vi||Mr({});const Ne=Ct(Ke),gi=Ct(j);return i5(Ne,gi,be)},e.addHook=function(Ke,j){typeof j=="function"&&(P[Ke]=P[Ke]||[],C0(P[Ke],j))},e.removeHook=function(Ke){if(P[Ke])return o9(P[Ke])},e.removeHooks=function(Ke){P[Ke]&&(P[Ke]=[])},e.removeAllHooks=function(){P={}},e}var gl=qU();gl.version;gl.isSupported;const GU=gl.sanitize;gl.setConfig;gl.clearConfig;gl.isValidAttribute;const KU=gl.addHook,YU=gl.removeHook;gl.removeHooks;gl.removeAllHooks;var it;(function(n){n.inMemory="inmemory",n.vscode="vscode",n.internal="private",n.walkThrough="walkThrough",n.walkThroughSnippet="walkThroughSnippet",n.http="http",n.https="https",n.file="file",n.mailto="mailto",n.untitled="untitled",n.data="data",n.command="command",n.vscodeRemote="vscode-remote",n.vscodeRemoteResource="vscode-remote-resource",n.vscodeManagedRemoteResource="vscode-managed-remote-resource",n.vscodeUserData="vscode-userdata",n.vscodeCustomEditor="vscode-custom-editor",n.vscodeNotebookCell="vscode-notebook-cell",n.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",n.vscodeNotebookCellOutput="vscode-notebook-cell-output",n.vscodeInteractiveInput="vscode-interactive-input",n.vscodeSettings="vscode-settings",n.vscodeWorkspaceTrust="vscode-workspace-trust",n.vscodeTerminal="vscode-terminal",n.vscodeChatSesssion="vscode-chat-editor",n.webviewPanel="webview-panel",n.vscodeWebview="vscode-webview",n.extension="extension",n.vscodeFileResource="vscode-file",n.tmp="tmp",n.vsls="vsls",n.vscodeSourceControl="vscode-scm"})(it||(it={}));const ime="tkn";class nme{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._remoteResourcesPath=`/${it.vscodeRemoteResource}`}setPreferredWebSchema(e){this._preferredWebSchema=e}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return _t(a),e}const t=e.authority;let i=this._hosts[t];i&&i.indexOf(":")!==-1&&i.indexOf("[")===-1&&(i=`[${i}]`);const s=this._ports[t],o=this._connectionTokens[t];let r=`path=${encodeURIComponent(e.path)}`;return typeof o=="string"&&(r+=`&${ime}=${encodeURIComponent(o)}`),je.from({scheme:Qm?this._preferredWebSchema:it.vscodeRemoteResource,authority:`${i}:${s}`,path:this._remoteResourcesPath,query:r})}}const ZU=new nme;class $b{uriToBrowserUri(e){return e.scheme===it.vscodeRemote?ZU.rewrite(e):e.scheme===it.file&&(dp||Xhe&&_r.origin===`${it.vscodeFileResource}://${$b.FALLBACK_AUTHORITY}`)?e.with({scheme:it.vscodeFileResource,authority:e.authority||$b.FALLBACK_AUTHORITY,query:null,fragment:null}):e}}$b.FALLBACK_AUTHORITY="vscode-app";const XU=new $b;var u9;(function(n){const e=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);n.CoopAndCoep=Object.freeze(e.get("3"));const t="vscode-coi";function i(o){let r;typeof o=="string"?r=new URL(o).searchParams:o instanceof URL?r=o.searchParams:je.isUri(o)&&(r=new URL(o.toString(!0)).searchParams);const a=r==null?void 0:r.get(t);if(a)return e.get(a)}n.getHeadersFromQuery=i;function s(o,r,a){if(!globalThis.crossOriginIsolated)return;const l=r&&a?"3":a?"2":"1";o instanceof URLSearchParams?o.set(t,l):o[t]=l}n.addSearchParam=s})(u9||(u9={}));const{registerWindow:p3e,getWindows:sme,onDidCreateWindow:m3e}=function(){const n=[],e=new B;return{onDidCreateWindow:e.event,registerWindow(t){n.push(t);const i=new pe;return i.add(Ze(()=>{const s=n.indexOf(t);s!==-1&&n.splice(s,1)})),e.fire({window:t,disposableStore:i}),i},getWindows(){return n}}}();function ko(n){for(;n.firstChild;)n.firstChild.remove()}function X4(n){var e;return(e=n==null?void 0:n.isConnected)!==null&&e!==void 0?e:!1}class ome{constructor(e,t,i,s){this._node=e,this._type=t,this._handler=i,this._options=s||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}}function K(n,e,t,i){return new ome(n,e,t,i)}function QU(n){return function(e){return n(new ur(e))}}function rme(n){return function(e){return n(new Ht(e))}}const ji=function(e,t,i,s){let o=i;return t==="click"||t==="mousedown"?o=QU(i):(t==="keydown"||t==="keypress"||t==="keyup")&&(o=rme(i)),K(e,t,o,s)},ame=function(e,t,i){const s=QU(t);return lme(e,s,i)};function lme(n,e,t){return K(n,Jd&&Z4.pointerEvents?de.POINTER_DOWN:de.MOUSE_DOWN,e,t)}let JU,qo;class c2{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){_t(e)}}static sort(e,t){return t.priority-e.priority}}(function(){let n=[],e=null,t=!1,i=!1;const s=()=>{for(t=!1,e=n,n=[],i=!0;e.length>0;)e.sort(c2.sort),e.shift().execute();i=!1};qo=(o,r=0)=>{const a=new c2(o,r);return n.push(a),t||(t=!0,requestAnimationFrame(s)),a},JU=(o,r)=>{if(i){const a=new c2(o,r);return e.push(a),a}else return qo(o,r)}})();function iD(n){return n.ownerDocument.defaultView.getComputedStyle(n,null)}function nD(n){var e;const t=n.ownerDocument,i=(e=t.defaultView)===null||e===void 0?void 0:e.window;if(n!==t.body)return new ei(n.clientWidth,n.clientHeight);if(Jd&&(i!=null&&i.visualViewport))return new ei(i.visualViewport.width,i.visualViewport.height);if(i!=null&&i.innerWidth&&i.innerHeight)return new ei(i.innerWidth,i.innerHeight);if(t.body&&t.body.clientWidth&&t.body.clientHeight)return new ei(t.body.clientWidth,t.body.clientHeight);if(t.documentElement&&t.documentElement.clientWidth&&t.documentElement.clientHeight)return new ei(t.documentElement.clientWidth,t.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class _i{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){const s=iD(e),o=s?s.getPropertyValue(t):"0";return _i.convertToPixels(e,o)}static getBorderLeftWidth(e){return _i.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return _i.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return _i.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return _i.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return _i.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return _i.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return _i.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return _i.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return _i.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return _i.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return _i.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return _i.getDimension(e,"margin-bottom","marginBottom")}}class ei{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new ei(e,t):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof ei?e:new ei(e.width,e.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}}ei.None=new ei(0,0);function ej(n){let e=n.offsetParent,t=n.offsetTop,i=n.offsetLeft;for(;(n=n.parentNode)!==null&&n!==n.ownerDocument.body&&n!==n.ownerDocument.documentElement;){t-=n.scrollTop;const s=tj(n)?null:iD(n);s&&(i-=s.direction!=="rtl"?n.scrollLeft:-n.scrollLeft),n===e&&(i+=_i.getBorderLeftWidth(n),t+=_i.getBorderTopWidth(n),t+=n.offsetTop,i+=n.offsetLeft,e=n.offsetParent)}return{left:i,top:t}}function Rn(n){var e,t,i,s;const o=n.getBoundingClientRect();return{left:o.left+((t=(e=n.ownerDocument.defaultView)===null||e===void 0?void 0:e.scrollX)!==null&&t!==void 0?t:0),top:o.top+((s=(i=n.ownerDocument.defaultView)===null||i===void 0?void 0:i.scrollY)!==null&&s!==void 0?s:0),width:o.width,height:o.height}}function cme(n){let e=n,t=1;do{const i=iD(e).zoom;i!=null&&i!=="1"&&(t*=i),e=e.parentElement}while(e!==null&&e!==e.ownerDocument.documentElement);return t}function ws(n){const e=_i.getMarginLeft(n)+_i.getMarginRight(n);return n.offsetWidth+e}function d2(n){const e=_i.getBorderLeftWidth(n)+_i.getBorderRightWidth(n),t=_i.getPaddingLeft(n)+_i.getPaddingRight(n);return n.offsetWidth-e-t}function dme(n){const e=_i.getBorderTopWidth(n)+_i.getBorderBottomWidth(n),t=_i.getPaddingTop(n)+_i.getPaddingBottom(n);return n.offsetHeight-e-t}function Dh(n){const e=_i.getMarginTop(n)+_i.getMarginBottom(n);return n.offsetHeight+e}function Sn(n,e){for(;n;){if(n===e)return!0;n=n.parentNode}return!1}function ume(n,e,t){for(;n&&n.nodeType===n.ELEMENT_NODE;){if(n.classList.contains(e))return n;if(t){if(typeof t=="string"){if(n.classList.contains(t))return null}else if(n===t)return null}n=n.parentNode}return null}function u2(n,e,t){return!!ume(n,e,t)}function tj(n){return n&&!!n.host&&!!n.mode}function aT(n){return!!bm(n)}function bm(n){for(var e;n.parentNode;){if(n===((e=n.ownerDocument)===null||e===void 0?void 0:e.body))return null;n=n.parentNode}return tj(n)?n:null}function ia(){let n=hme().activeElement;for(;n!=null&&n.shadowRoot;)n=n.shadowRoot.activeElement;return n}function hme(){var n;return(n=[document,...sme().map(t=>t.document)].find(t=>t.hasFocus()))!==null&&n!==void 0?n:document}function kr(n=document.getElementsByTagName("head")[0],e){const t=document.createElement("style");return t.type="text/css",t.media="screen",e==null||e(t),n.appendChild(t),t}let h2=null;function ij(){return h2||(h2=kr()),h2}function fme(n){var e,t;return!((e=n==null?void 0:n.sheet)===null||e===void 0)&&e.rules?n.sheet.rules:!((t=n==null?void 0:n.sheet)===null||t===void 0)&&t.cssRules?n.sheet.cssRules:[]}function lT(n,e,t=ij()){!t||!e||t.sheet.insertRule(n+"{"+e+"}",0)}function h9(n,e=ij()){if(!e)return;const t=fme(e),i=[];for(let s=0;s=0;s--)e.sheet.deleteRule(i[s])}function Q4(n){return typeof HTMLElement=="object"?n instanceof HTMLElement:n&&typeof n=="object"&&n.nodeType===1&&typeof n.nodeName=="string"}const de={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:qh?"webkitAnimationStart":"animationstart",ANIMATION_END:qh?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:qh?"webkitAnimationIteration":"animationiteration"};function gme(n){const e=n;return!!(e&&typeof e.preventDefault=="function"&&typeof e.stopPropagation=="function")}const Ue={stop:(n,e)=>(n.preventDefault(),e&&n.stopPropagation(),n)};function pme(n){const e=[];for(let t=0;n&&n.nodeType===n.ELEMENT_NODE;t++)e[t]=n.scrollTop,n=n.parentNode;return e}function mme(n,e){for(let t=0;n&&n.nodeType===n.ELEMENT_NODE;t++)n.scrollTop!==e[t]&&(n.scrollTop=e[t]),n=n.parentNode}class RS extends Y{static hasFocusWithin(e){if(Q4(e)){const t=bm(e),i=t?t.activeElement:e.ownerDocument.activeElement;return Sn(i,e)}else return Sn(window.document.activeElement,window.document)}constructor(e){super(),this._onDidFocus=this._register(new B),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new B),this.onDidBlur=this._onDidBlur.event;let t=RS.hasFocusWithin(e),i=!1;const s=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},o=()=>{t&&(i=!0,window.setTimeout(()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{RS.hasFocusWithin(e)!==t&&(t?o():s())},this._register(K(e,de.FOCUS,s,!0)),this._register(K(e,de.BLUR,o,!0)),e instanceof HTMLElement&&(this._register(K(e,de.FOCUS_IN,()=>this._refreshStateHandler())),this._register(K(e,de.FOCUS_OUT,()=>this._refreshStateHandler())))}}function tu(n){return new RS(n)}function le(n,...e){if(n.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function nj(n,e){return n.insertBefore(e,n.firstChild),e}function ds(n,...e){n.innerText="",le(n,...e)}const _me=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var Ub;(function(n){n.HTML="http://www.w3.org/1999/xhtml",n.SVG="http://www.w3.org/2000/svg"})(Ub||(Ub={}));function sj(n,e,t,...i){const s=_me.exec(e);if(!s)throw new Error("Bad use of emmet");const o=s[1]||"div";let r;return n!==Ub.HTML?r=document.createElementNS(n,o):r=document.createElement(o),s[3]&&(r.id=s[3]),s[4]&&(r.className=s[4].replace(/\./g," ").trim()),t&&Object.entries(t).forEach(([a,l])=>{typeof l>"u"||(/^on\w+$/.test(a)?r[a]=l:a==="selected"?l&&r.setAttribute(a,"true"):r.setAttribute(a,l))}),r.append(...i),r}function ye(n,e,...t){return sj(Ub.HTML,n,e,...t)}ye.SVG=function(n,e,...t){return sj(Ub.SVG,n,e,...t)};function bme(n,...e){n?Kh(...e):ld(...e)}function Kh(...n){for(const e of n)e.style.display="",e.removeAttribute("aria-hidden")}function ld(...n){for(const e of n)e.style.display="none",e.setAttribute("aria-hidden","true")}function f9(n){const e=window.devicePixelRatio*n;return Math.max(1,Math.floor(e))/window.devicePixelRatio}function oj(n){window.open(n,"_blank","noopener")}function vme(n){const e=()=>{n(),t=qo(e)};let t=qo(e);return Ze(()=>t.dispose())}ZU.setPreferredWebSchema(/^https:/.test(window.location.href)?"https":"http");function iu(n){return n?`url('${XU.uriToBrowserUri(n).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function g9(n){return`'${n.replace(/'/g,"%27")}'`}function Yh(n,e){if(n!==void 0){const t=n.match(/^\s*var\((.+)\)$/);if(t){const i=t[1].split(",",2);return i.length===2&&(e=Yh(i[1].trim(),e)),`var(${i[0]}, ${e})`}return n}return e}function yme(n,e=!1){const t=document.createElement("a");return KU("afterSanitizeAttributes",i=>{for(const s of["href","src"])if(i.hasAttribute(s)){const o=i.getAttribute(s);if(s==="href"&&o.startsWith("#"))continue;if(t.href=o,!n.includes(t.protocol.replace(/:$/,""))){if(e&&s==="src"&&t.href.startsWith("data:"))continue;i.removeAttribute(s)}}}),Ze(()=>{YU("afterSanitizeAttributes")})}const wme=Object.freeze(["a","abbr","b","bdo","blockquote","br","caption","cite","code","col","colgroup","dd","del","details","dfn","div","dl","dt","em","figcaption","figure","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","label","li","mark","ol","p","pre","q","rp","rt","ruby","samp","small","small","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","time","tr","tt","u","ul","var","video","wbr"]);class cd extends B{constructor(){super(),this._subscriptions=new pe,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(K(window,"keydown",e=>{if(e.defaultPrevented)return;const t=new Ht(e);if(!(t.keyCode===6&&e.repeat)){if(e.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(e.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(e.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(e.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else if(t.keyCode!==6)this._keyStatus.lastKeyPressed=void 0;else return;this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=e,this.fire(this._keyStatus))}},!0)),this._subscriptions.add(K(window,"keyup",e=>{e.defaultPrevented||(!e.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!e.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!e.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!e.shiftKey&&this._keyStatus.shiftKey?this._keyStatus.lastKeyReleased="shift":this._keyStatus.lastKeyReleased=void 0,this._keyStatus.lastKeyPressed!==this._keyStatus.lastKeyReleased&&(this._keyStatus.lastKeyPressed=void 0),this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=e,this.fire(this._keyStatus)))},!0)),this._subscriptions.add(K(document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),this._subscriptions.add(K(document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),this._subscriptions.add(K(document.body,"mousemove",e=>{e.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),this._subscriptions.add(K(window,"blur",()=>{this.resetKeyStatus()}))}get keyStatus(){return this._keyStatus}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return cd.instance||(cd.instance=new cd),cd.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class Cme extends Y{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this._register(K(this.element,de.DRAG_ENTER,e=>{this.counter++,this.dragStartTime=e.timeStamp,this.callbacks.onDragEnter(e)})),this._register(K(this.element,de.DRAG_OVER,e=>{var t,i;e.preventDefault(),(i=(t=this.callbacks).onDragOver)===null||i===void 0||i.call(t,e,e.timeStamp-this.dragStartTime)})),this._register(K(this.element,de.DRAG_LEAVE,e=>{this.counter--,this.counter===0&&(this.dragStartTime=0,this.callbacks.onDragLeave(e))})),this._register(K(this.element,de.DRAG_END,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDragEnd(e)})),this._register(K(this.element,de.DROP,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDrop(e)}))}}const Sme=/(?[\w\-]+)?(?:#(?[\w\-]+))?(?(?:\.(?:[\w\-]+))*)(?:@(?(?:[\w\_])+))?/;function hn(n,...e){let t,i;Array.isArray(e[0])?(t={},i=e[0]):(t=e[0]||{},i=e[1]);const s=Sme.exec(n);if(!s||!s.groups)throw new Error("Bad use of h");const o=s.groups.tag||"div",r=document.createElement(o);s.groups.id&&(r.id=s.groups.id);const a=[];if(s.groups.class)for(const c of s.groups.class.split("."))c!==""&&a.push(c);if(t.className!==void 0)for(const c of t.className.split("."))c!==""&&a.push(c);a.length>0&&(r.className=a.join(" "));const l={};if(s.groups.name&&(l[s.groups.name]=r),i)for(const c of i)c instanceof HTMLElement?r.appendChild(c):typeof c=="string"?r.append(c):"root"in c&&(Object.assign(l,c),r.appendChild(c.root));for(const[c,d]of Object.entries(t))if(c!=="className")if(c==="style")for(const[u,h]of Object.entries(d))r.style.setProperty(p9(u),typeof h=="number"?h+"px":""+h);else c==="tabIndex"?r.tabIndex=d:r.setAttribute(p9(c),d.toString());return l.root=r,l}function p9(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class sD{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this._description=e.description}register(){if(Array.isArray(this._menuOpts)?this._menuOpts.forEach(this._registerMenuItem,this):this._menuOpts&&this._registerMenuItem(this._menuOpts),this._kbOpts){const e=Array.isArray(this._kbOpts)?this._kbOpts:[this._kbOpts];for(const t of e){let i=t.kbExpr;this.precondition&&(i?i=xe.and(i,this.precondition):i=this.precondition);const s={id:this.id,weight:t.weight,args:t.args,when:i,primary:t.primary,secondary:t.secondary,win:t.win,linux:t.linux,mac:t.mac};Ws.registerKeybindingRule(s)}}Zt.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),description:this._description})}_registerMenuItem(e){dr.appendMenuItem(e.menuId,{group:e.group,command:{id:this.id,title:e.title,icon:e.icon,precondition:this.precondition},when:e.when,order:e.order})}}class J4 extends sD{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,i,s){return this._implementations.push({priority:e,name:t,implementation:i,when:s}),this._implementations.sort((o,r)=>r.priority-o.priority),{dispose:()=>{for(let o=0;o{if(a.get(tt).contextMatchesRules(i??void 0))return s(a,r,t)})}runCommand(e,t){return Er.runEditorCommand(e,t,this.precondition,(i,s,o)=>this.runEditorCommand(i,s,o))}}class Jt extends Er{static convertOptions(e){let t;Array.isArray(e.menuOpts)?t=e.menuOpts:e.menuOpts?t=[e.menuOpts]:t=[];function i(s){return s.menuId||(s.menuId=I.EditorContext),s.title||(s.title=e.label),s.when=xe.and(e.precondition,s.when),s}return Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(i)):e.contextMenuOpts&&t.push(i(e.contextMenuOpts)),e.menuOpts=t,e}constructor(e){super(Jt.convertOptions(e)),this.label=e.label,this.alias=e.alias}runEditorCommand(e,t,i){return this.reportTelemetry(e,t),this.run(e,t,i||{})}reportTelemetry(e,t){e.get(Cc).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class aj extends Jt{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort((i,s)=>s[0]-i[0]),{dispose:()=>{for(let i=0;i{var r,a;const l=o.get(tt),c=o.get(Sc);if(!l.contextMatchesRules((r=this.desc.precondition)!==null&&r!==void 0?r:void 0)){c.debug("[EditorAction2] NOT running command because its precondition is FALSE",this.desc.id,(a=this.desc.precondition)===null||a===void 0?void 0:a.serialize());return}return this.runEditorCommand(o,s,...t)})}}function n0(n,e){Zt.registerCommand(n,function(t,...i){const s=t.get(yt),[o,r]=i;Ls(je.isUri(o)),Ls(V.isIPosition(r));const a=t.get(fs).getModel(o);if(a){const l=V.lift(r);return s.invokeFunction(e,a,l,...i.slice(2))}return t.get(xu).createModelReference(o).then(l=>new Promise((c,d)=>{try{const u=s.invokeFunction(e,l.object.textEditorModel,V.lift(r),i.slice(2));c(u)}catch(u){d(u)}}).finally(()=>{l.dispose()}))})}function Ee(n){return Po.INSTANCE.registerEditorCommand(n),n}function Xe(n){const e=new n;return Po.INSTANCE.registerEditorAction(e),e}function lj(n){return Po.INSTANCE.registerEditorAction(n),n}function Lme(n){Po.INSTANCE.registerEditorAction(n)}function Tr(n,e,t){Po.INSTANCE.registerEditorContribution(n,e,t)}var gp;(function(n){function e(r){return Po.INSTANCE.getEditorCommand(r)}n.getEditorCommand=e;function t(){return Po.INSTANCE.getEditorActions()}n.getEditorActions=t;function i(){return Po.INSTANCE.getEditorContributions()}n.getEditorContributions=i;function s(r){return Po.INSTANCE.getEditorContributions().filter(a=>r.indexOf(a.id)>=0)}n.getSomeEditorContributions=s;function o(){return Po.INSTANCE.getDiffEditorContributions()}n.getDiffEditorContributions=o})(gp||(gp={}));const Dme={EditorCommonContributions:"editor.contributions"};class Po{constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t,i){this.editorContributions.push({id:e,ctor:t,instantiation:i})}getEditorContributions(){return this.editorContributions.slice(0)}getDiffEditorContributions(){return this.diffEditorContributions.slice(0)}registerEditorAction(e){e.register(),this.editorActions.push(e)}getEditorActions(){return this.editorActions}registerEditorCommand(e){e.register(),this.editorCommands[e.id]=e}getEditorCommand(e){return this.editorCommands[e]||null}}Po.INSTANCE=new Po;_n.add(Dme.EditorCommonContributions,Po.INSTANCE);function q1(n){return n.register(),n}const cj=q1(new J4({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:I.MenubarEditMenu,group:"1_do",title:m({key:"miUndo",comment:["&& denotes a mnemonic"]},"&&Undo"),order:1},{menuId:I.CommandPalette,group:"",title:m("undo","Undo"),order:1}]}));q1(new rj(cj,{id:"default:undo",precondition:void 0}));const dj=q1(new J4({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:I.MenubarEditMenu,group:"1_do",title:m({key:"miRedo",comment:["&& denotes a mnemonic"]},"&&Redo"),order:2},{menuId:I.CommandPalette,group:"",title:m("redo","Redo"),order:1}]}));q1(new rj(dj,{id:"default:redo",precondition:void 0}));const kme=q1(new J4({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:I.MenubarSelectionMenu,group:"1_basic",title:m({key:"miSelectAll",comment:["&& denotes a mnemonic"]},"&&Select All"),order:1},{menuId:I.CommandPalette,group:"",title:m("selectAll","Select All"),order:1}]})),uj=Symbol("MicrotaskDelay");var To=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},s_=function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof __values=="function"?__values(n):n[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(o){t[o]=n[o]&&function(r){return new Promise(function(a,l){r=n[o](r),s(a,l,r.done,r.value)})}}function s(o,r,a,l){Promise.resolve(l).then(function(c){o({value:c,done:a})},r)}};function cT(n){return!!n&&typeof n.then=="function"}function xc(n){const e=new Ir,t=n(e.token),i=new Promise((s,o)=>{const r=e.token.onCancellationRequested(()=>{r.dispose(),e.dispose(),o(new e0)});Promise.resolve(t).then(a=>{r.dispose(),e.dispose(),s(a)},a=>{r.dispose(),e.dispose(),o(a)})});return new class{cancel(){e.cancel()}then(s,o){return i.then(s,o)}catch(s){return this.then(void 0,s)}finally(s){return i.finally(s)}}}function Eme(n,e,t){return new Promise((i,s)=>{const o=e.onCancellationRequested(()=>{o.dispose(),i(t)});n.then(i,s).finally(()=>o.dispose())})}class Ame{constructor(){this.isDisposed=!1,this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null}queue(e){if(this.isDisposed)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){const t=()=>{if(this.queuedPromise=null,this.isDisposed)return;const i=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,i};this.queuedPromise=new Promise(i=>{this.activePromise.then(t,t).then(i)})}return new Promise((t,i)=>{this.queuedPromise.then(t,i)})}return this.activePromise=e(),new Promise((t,i)=>{this.activePromise.then(s=>{this.activePromise=null,t(s)},s=>{this.activePromise=null,i(s)})})}dispose(){this.isDisposed=!0}}const Ime=(n,e)=>{let t=!0;const i=setTimeout(()=>{t=!1,e()},n);return{isTriggered:()=>t,dispose:()=>{clearTimeout(i),t=!1}}},Tme=n=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,n())}),{isTriggered:()=>e,dispose:()=>{e=!1}}};class Du{constructor(e){this.defaultDelay=e,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,t=this.defaultDelay){this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((s,o)=>{this.doResolve=s,this.doReject=o}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const s=this.task;return this.task=null,s()}}));const i=()=>{var s;this.deferred=null,(s=this.doResolve)===null||s===void 0||s.call(this,null)};return this.deferred=t===uj?Tme(i):Ime(t,i),this.completionPromise}isTriggered(){var e;return!!(!((e=this.deferred)===null||e===void 0)&&e.isTriggered())}cancel(){var e;this.cancelTimeout(),this.completionPromise&&((e=this.doReject)===null||e===void 0||e.call(this,new e0),this.completionPromise=null)}cancelTimeout(){var e;(e=this.deferred)===null||e===void 0||e.dispose(),this.deferred=null}dispose(){this.cancel()}}class hj{constructor(e){this.delayer=new Du(e),this.throttler=new Ame}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}}function jb(n,e){return e?new Promise((t,i)=>{const s=setTimeout(()=>{o.dispose(),t()},n),o=e.onCancellationRequested(()=>{clearTimeout(s),o.dispose(),i(new e0)})}):xc(t=>jb(n,t))}function MS(n,e=0,t){const i=setTimeout(()=>{n(),t&&s.dispose()},e),s=Ze(()=>{clearTimeout(i),t==null||t.deleteAndLeak(s)});return t==null||t.add(s),s}class Lc{constructor(e,t){this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel()}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}}class G1{constructor(){this._token=-1}dispose(){this.cancel()}cancel(){this._token!==-1&&(clearInterval(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setInterval(()=>{e()},t)}}class Di{constructor(e,t){this.timeoutToken=-1,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return this.timeoutToken!==-1}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){var e;(e=this.runner)===null||e===void 0||e.call(this)}}let dd;(function(){typeof requestIdleCallback!="function"||typeof cancelIdleCallback!="function"?dd=n=>{aU(()=>{if(e)return;const t=Date.now()+15;n(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,t-Date.now())}}))});let e=!1;return{dispose(){e||(e=!0)}}}:dd=(n,e)=>{const t=requestIdleCallback(n,typeof e=="number"?{timeout:e}:void 0);let i=!1;return{dispose(){i||(i=!0,cancelIdleCallback(t))}}}})();class Nme{constructor(e){this._didRun=!1,this._executor=()=>{try{this._value=e()}catch(t){this._error=t}finally{this._didRun=!0}},this._handle=dd(()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}}class fj{get isRejected(){var e;return((e=this.outcome)===null||e===void 0?void 0:e.outcome)===1}get isSettled(){return!!this.outcome}constructor(){this.p=new Promise((e,t)=>{this.completeCallback=e,this.errorCallback=t})}complete(e){return new Promise(t=>{this.completeCallback(e),this.outcome={outcome:0,value:e},t()})}error(e){return new Promise(t=>{this.errorCallback(e),this.outcome={outcome:1,value:e},t()})}cancel(){return this.error(new e0)}}var dT;(function(n){function e(i){return To(this,void 0,void 0,function*(){let s;const o=yield Promise.all(i.map(r=>r.then(a=>a,a=>{s||(s=a)})));if(typeof s<"u")throw s;return o})}n.settled=e;function t(i){return new Promise((s,o)=>To(this,void 0,void 0,function*(){try{yield i(s,o)}catch(r){o(r)}}))}n.withAsyncBody=t})(dT||(dT={}));class dn{static fromArray(e){return new dn(t=>{t.emitMany(e)})}static fromPromise(e){return new dn(t=>To(this,void 0,void 0,function*(){t.emitMany(yield e)}))}static fromPromises(e){return new dn(t=>To(this,void 0,void 0,function*(){yield Promise.all(e.map(i=>To(this,void 0,void 0,function*(){return t.emitOne(yield i)})))}))}static merge(e){return new dn(t=>To(this,void 0,void 0,function*(){yield Promise.all(e.map(i=>{var s,o,r;return To(this,void 0,void 0,function*(){var a,l,c,d;try{for(s=!0,o=s_(i);r=yield o.next(),a=r.done,!a;s=!0){d=r.value,s=!1;const u=d;t.emitOne(u)}}catch(u){l={error:u}}finally{try{!s&&!a&&(c=o.return)&&(yield c.call(o))}finally{if(l)throw l.error}}})}))}))}constructor(e){this._state=0,this._results=[],this._error=null,this._onStateChanged=new B,queueMicrotask(()=>To(this,void 0,void 0,function*(){const t={emitOne:i=>this.emitOne(i),emitMany:i=>this.emitMany(i),reject:i=>this.reject(i)};try{yield Promise.resolve(e(t)),this.resolve()}catch(i){this.reject(i)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}}))}[Symbol.asyncIterator](){let e=0;return{next:()=>To(this,void 0,void 0,function*(){do{if(this._state===2)throw this._error;if(eTo(this,void 0,void 0,function*(){var s,o,r,a;try{for(var l=!0,c=s_(e),d;d=yield c.next(),s=d.done,!s;l=!0){a=d.value,l=!1;const u=a;i.emitOne(t(u))}}catch(u){o={error:u}}finally{try{!l&&!s&&(r=c.return)&&(yield r.call(c))}finally{if(o)throw o.error}}}))}map(e){return dn.map(this,e)}static filter(e,t){return new dn(i=>To(this,void 0,void 0,function*(){var s,o,r,a;try{for(var l=!0,c=s_(e),d;d=yield c.next(),s=d.done,!s;l=!0){a=d.value,l=!1;const u=a;t(u)&&i.emitOne(u)}}catch(u){o={error:u}}finally{try{!l&&!s&&(r=c.return)&&(yield r.call(c))}finally{if(o)throw o.error}}}))}filter(e){return dn.filter(this,e)}static coalesce(e){return dn.filter(e,t=>!!t)}coalesce(){return dn.coalesce(this)}static toPromise(e){var t,i,s,o,r,a,l;return To(this,void 0,void 0,function*(){const c=[];try{for(t=!0,i=s_(e);s=yield i.next(),o=s.done,!o;t=!0){l=s.value,t=!1;const d=l;c.push(d)}}catch(d){r={error:d}}finally{try{!t&&!o&&(a=i.return)&&(yield a.call(i))}finally{if(r)throw r.error}}return c})}toPromise(){return dn.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}}dn.EMPTY=dn.fromArray([]);class Rme extends dn{constructor(e,t){super(t),this._source=e}cancel(){this._source.cancel()}}function Mme(n){const e=new Ir,t=n(e.token);return new Rme(e,i=>To(this,void 0,void 0,function*(){var s,o,r,a;const l=e.token.onCancellationRequested(()=>{l.dispose(),e.dispose(),i.reject(new e0)});try{try{for(var c=!0,d=s_(t),u;u=yield d.next(),s=u.done,!s;c=!0){a=u.value,c=!1;const h=a;if(e.token.isCancellationRequested)return;i.emitOne(h)}}catch(h){o={error:h}}finally{try{!c&&!s&&(r=d.return)&&(yield r.call(d))}finally{if(o)throw o.error}}l.dispose(),e.dispose()}catch(h){l.dispose(),e.dispose(),i.reject(h)}}))}const Pme="$initialize";let m9=!1;function uT(n){Qm&&(m9||(m9=!0,console.warn("Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq")),console.warn(n.message))}class Ome{constructor(e,t,i,s){this.vsWorker=e,this.req=t,this.method=i,this.args=s,this.type=0}}class _9{constructor(e,t,i,s){this.vsWorker=e,this.seq=t,this.res=i,this.err=s,this.type=1}}class Fme{constructor(e,t,i,s){this.vsWorker=e,this.req=t,this.eventName=i,this.arg=s,this.type=2}}class Bme{constructor(e,t,i){this.vsWorker=e,this.req=t,this.event=i,this.type=3}}class Wme{constructor(e,t){this.vsWorker=e,this.req=t,this.type=4}}class Vme{constructor(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null),this._pendingEmitters=new Map,this._pendingEvents=new Map}setWorkerId(e){this._workerId=e}sendMessage(e,t){const i=String(++this._lastSentReq);return new Promise((s,o)=>{this._pendingReplies[i]={resolve:s,reject:o},this._send(new Ome(this._workerId,i,e,t))})}listen(e,t){let i=null;const s=new B({onWillAddFirstListener:()=>{i=String(++this._lastSentReq),this._pendingEmitters.set(i,s),this._send(new Fme(this._workerId,i,e,t))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(i),this._send(new Wme(this._workerId,i)),i=null}});return s.event}handleMessage(e){!e||!e.vsWorker||this._workerId!==-1&&e.vsWorker!==this._workerId||this._handleMessage(e)}_handleMessage(e){switch(e.type){case 1:return this._handleReplyMessage(e);case 0:return this._handleRequestMessage(e);case 2:return this._handleSubscribeEventMessage(e);case 3:return this._handleEventMessage(e);case 4:return this._handleUnsubscribeEventMessage(e)}}_handleReplyMessage(e){if(!this._pendingReplies[e.seq]){console.warn("Got reply to unknown seq");return}const t=this._pendingReplies[e.seq];if(delete this._pendingReplies[e.seq],e.err){let i=e.err;e.err.$isError&&(i=new Error,i.name=e.err.name,i.message=e.err.message,i.stack=e.err.stack),t.reject(i);return}t.resolve(e.res)}_handleRequestMessage(e){const t=e.req;this._handler.handleMessage(e.method,e.args).then(s=>{this._send(new _9(this._workerId,t,s,void 0))},s=>{s.detail instanceof Error&&(s.detail=BF(s.detail)),this._send(new _9(this._workerId,t,void 0,BF(s)))})}_handleSubscribeEventMessage(e){const t=e.req,i=this._handler.handleEvent(e.eventName,e.arg)(s=>{this._send(new Bme(this._workerId,t,s))});this._pendingEvents.set(t,i)}_handleEventMessage(e){if(!this._pendingEmitters.has(e.req)){console.warn("Got event for unknown req");return}this._pendingEmitters.get(e.req).fire(e.event)}_handleUnsubscribeEventMessage(e){if(!this._pendingEvents.has(e.req)){console.warn("Got unsubscribe for unknown req");return}this._pendingEvents.get(e.req).dispose(),this._pendingEvents.delete(e.req)}_send(e){const t=[];if(e.type===0)for(let i=0;i{this._protocol.handleMessage(d)},d=>{s==null||s(d)})),this._protocol=new Vme({sendMessage:(d,u)=>{this._worker.postMessage(d,u)},handleMessage:(d,u)=>{if(typeof i[d]!="function")return Promise.reject(new Error("Missing method "+d+" on main thread host."));try{return Promise.resolve(i[d].apply(i,u))}catch(h){return Promise.reject(h)}},handleEvent:(d,u)=>{if(pj(d)){const h=i[d].call(i,u);if(typeof h!="function")throw new Error(`Missing dynamic event ${d} on main thread host.`);return h}if(gj(d)){const h=i[d];if(typeof h!="function")throw new Error(`Missing event ${d} on main thread host.`);return h}throw new Error(`Malformed event name ${d}`)}}),this._protocol.setWorkerId(this._worker.getId());let o=null;const r=globalThis.require;typeof r<"u"&&typeof r.getConfig=="function"?o=r.getConfig():typeof globalThis.requirejs<"u"&&(o=globalThis.requirejs.s.contexts._.config);const a=D4(i);this._onModuleLoaded=this._protocol.sendMessage(Pme,[this._worker.getId(),JSON.parse(JSON.stringify(o)),t,a]);const l=(d,u)=>this._request(d,u),c=(d,u)=>this._protocol.listen(d,u);this._lazyProxy=new Promise((d,u)=>{s=u,this._onModuleLoaded.then(h=>{d(Hme(h,l,c))},h=>{u(h),this._onError("Worker failed to load "+t,h)})})}getProxyObject(){return this._lazyProxy}_request(e,t){return new Promise((i,s)=>{this._onModuleLoaded.then(()=>{this._protocol.sendMessage(e,t).then(i,s)},s)})}_onError(e,t){console.error(e),console.info(t)}}function gj(n){return n[0]==="o"&&n[1]==="n"&&qc(n.charCodeAt(2))}function pj(n){return/^onDynamic/.test(n)&&qc(n.charCodeAt(9))}function Hme(n,e,t){const i=r=>function(){const a=Array.prototype.slice.call(arguments,0);return e(r,a)},s=r=>function(a){return t(r,a)},o={};for(const r of n){if(pj(r)){o[r]=s(r);continue}if(gj(r)){o[r]=t(r,void 0);continue}o[r]=i(r)}return o}function jf(n,e){var t;const i=globalThis.MonacoEnvironment;if(i!=null&&i.createTrustedTypesPolicy)try{return i.createTrustedTypesPolicy(n,e)}catch(s){_t(s);return}try{return(t=window.trustedTypes)===null||t===void 0?void 0:t.createPolicy(n,e)}catch(s){_t(s);return}}const b9=jf("defaultWorkerFactory",{createScriptURL:n=>n});function $me(n){const e=globalThis.MonacoEnvironment;if(e){if(typeof e.getWorker=="function")return e.getWorker("workerMain.js",n);if(typeof e.getWorkerUrl=="function"){const t=e.getWorkerUrl("workerMain.js",n);return new Worker(b9?b9.createScriptURL(t):t,{name:n})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function Ume(n){return typeof n.then=="function"}class jme{constructor(e,t,i,s,o){this.id=t,this.label=i;const r=$me(i);Ume(r)?this.worker=r:this.worker=Promise.resolve(r),this.postMessage(e,[]),this.worker.then(a=>{a.onmessage=function(l){s(l.data)},a.onmessageerror=o,typeof a.addEventListener=="function"&&a.addEventListener("error",o)})}getId(){return this.id}postMessage(e,t){var i;(i=this.worker)===null||i===void 0||i.then(s=>{try{s.postMessage(e,t)}catch(o){_t(o),_t(new Error(`FAILED to post message to '${this.label}'-worker`,{cause:o}))}})}dispose(){var e;(e=this.worker)===null||e===void 0||e.then(t=>t.terminate()),this.worker=null}}class oD{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,i){const s=++oD.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new jme(e,s,this._label||"anonymous"+s,t,o=>{uT(o),this._webWorkerFailedBeforeError=o,i(o)})}}oD.LAST_WORKER_ID=0;var os;(function(n){n[n.None=0]="None",n[n.Indent=1]="Indent",n[n.IndentOutdent=2]="IndentOutdent",n[n.Outdent=3]="Outdent"})(os||(os={}));class f2{constructor(e){if(this._neutralCharacter=null,this._neutralCharacterSearched=!1,this.open=e.open,this.close=e.close,this._inString=!0,this._inComment=!0,this._inRegEx=!0,Array.isArray(e.notIn))for(let t=0,i=e.notIn.length;t0&&n.getLanguageId(r-1)===s;)r--;return new Gme(n,s,r,o+1,n.getStartOffset(r),n.getEndOffset(o))}class Gme{constructor(e,t,i,s,o,r){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=s,this.firstCharOffset=o,this._lastCharOffset=r}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}getActualLineContentBefore(e){return this._actual.getLineContent().substring(0,this.firstCharOffset+e)}getTokenCount(){return this._lastTokenIndex-this._firstTokenIndex}findTokenIndexAtOffset(e){return this._actual.findTokenIndexAtOffset(e+this.firstCharOffset)-this._firstTokenIndex}getStandardTokenType(e){return this._actual.getStandardTokenType(e+this._firstTokenIndex)}}function ya(n){return(n&3)!==0}class vm{constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map(t=>new f2(t)):e.brackets?this._autoClosingPairs=e.brackets.map(t=>new f2({open:t[0],close:t[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new f2({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:vm.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:vm.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS,this._surroundingPairs=e.surroundingPairs||this._autoClosingPairs}getAutoClosingPairs(){return this._autoClosingPairs}getAutoCloseBeforeSet(e){return e?this._autoCloseBeforeForQuotes:this._autoCloseBeforeForBrackets}getSurroundingPairs(){return this._surroundingPairs}}vm.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=`;:.,=}])> - `;vm.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS=`'"\`;:.,=}])> - `;const v9=typeof Buffer<"u";let g2;class eP{static wrap(e){return v9&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new eP(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return v9?this.buffer.toString():(g2||(g2=new TextDecoder),g2.decode(this.buffer))}}function Kme(n,e){return n[e+0]<<0>>>0|n[e+1]<<8>>>0}function Yme(n,e,t){n[t+0]=e&255,e=e>>>8,n[t+1]=e&255}function Ur(n,e){return n[e]*Math.pow(2,24)+n[e+1]*Math.pow(2,16)+n[e+2]*Math.pow(2,8)+n[e+3]}function jr(n,e,t){n[t+3]=e,e=e>>>8,n[t+2]=e,e=e>>>8,n[t+1]=e,e=e>>>8,n[t]=e}function y9(n,e){return n[e]}function w9(n,e,t){n[t]=e}let p2;function mj(){return p2||(p2=new TextDecoder("UTF-16LE")),p2}let m2;function Zme(){return m2||(m2=new TextDecoder("UTF-16BE")),m2}let _2;function _j(){return _2||(_2=efe()?mj():Zme()),_2}function Xme(n,e,t){const i=new Uint16Array(n.buffer,e,t);return t>0&&(i[0]===65279||i[0]===65534)?Qme(n,e,t):mj().decode(i)}function Qme(n,e,t){const i=[];let s=0;for(let o=0;o=this._capacity){this._flushBuffer(),this._completedStrings[this._completedStrings.length]=e;return}for(let i=0;i[r[0].toLowerCase(),r[1].toLowerCase()]);const t=[];for(let r=0;r{const[l,c]=r,[d,u]=a;return l===d||l===u||c===d||c===u},s=(r,a)=>{const l=Math.min(r,a),c=Math.max(r,a);for(let d=0;d0&&o.push({open:a,close:l})}return o}class e0e{constructor(e,t){this._richEditBracketsBrand=void 0;const i=Jme(t);this.brackets=i.map((s,o)=>new PS(e,o,s.open,s.close,t0e(s.open,s.close,i,o),i0e(s.open,s.close,i,o))),this.forwardRegex=n0e(this.brackets),this.reversedRegex=s0e(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const s of this.brackets){for(const o of s.open)this.textIsBracket[o]=s,this.textIsOpenBracket[o]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,o.length);for(const o of s.close)this.textIsBracket[o]=s,this.textIsOpenBracket[o]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,o.length)}}}function bj(n,e,t,i){for(let s=0,o=e.length;s=0&&i.push(a);for(const a of r.close)a.indexOf(n)>=0&&i.push(a)}}function vj(n,e){return n.length-e.length}function lD(n){if(n.length<=1)return n;const e=[],t=new Set;for(const i of n)t.has(i)||(e.push(i),t.add(i));return e}function t0e(n,e,t,i){let s=[];s=s.concat(n),s=s.concat(e);for(let o=0,r=s.length;o=0;r--)s[o++]=i.charCodeAt(r);return _j().decode(s)}let e=null,t=null;return function(s){return e!==s&&(e=s,t=n(e)),t}}();class or{static _findPrevBracketInText(e,t,i,s){const o=i.match(e);if(!o)return null;const r=i.length-(o.index||0),a=o[0].length,l=s+r;return new N(t,l-a+1,t,l+1)}static findPrevBracketInRange(e,t,i,s,o){const a=tP(i).substring(i.length-o,i.length-s);return this._findPrevBracketInText(e,t,a,s)}static findNextBracketInText(e,t,i,s){const o=i.match(e);if(!o)return null;const r=o.index||0,a=o[0].length;if(a===0)return null;const l=s+r;return new N(t,l+1,t,l+1+a)}static findNextBracketInRange(e,t,i,s,o){const r=i.substring(s,o);return this.findNextBracketInText(e,t,r,s)}}class r0e{constructor(e){this._richEditBrackets=e}getElectricCharacters(){const e=[];if(this._richEditBrackets)for(const t of this._richEditBrackets.brackets)for(const i of t.close){const s=i.charAt(i.length-1);e.push(s)}return mf(e)}onElectricCharacter(e,t,i){if(!this._richEditBrackets||this._richEditBrackets.brackets.length===0)return null;const s=t.findTokenIndexAtOffset(i-1);if(ya(t.getStandardTokenType(s)))return null;const o=this._richEditBrackets.reversedRegex,r=t.getLineContent().substring(0,i-1)+e,a=or.findPrevBracketInRange(o,1,r,0,r.length);if(!a)return null;const l=r.substring(a.startColumn-1,a.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[l])return null;const d=t.getActualLineContentBefore(a.startColumn-1);return/^\s*$/.test(d)?{matchOpenBracket:l}:null}}function Yy(n){return n.global&&(n.lastIndex=0),!0}class a0e{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&Yy(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&Yy(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&Yy(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&Yy(this._indentationRules.unIndentedLinePattern)&&this._indentationRules.unIndentedLinePattern.test(e))}getIndentMetadata(e){let t=0;return this.shouldIncrease(e)&&(t+=1),this.shouldDecrease(e)&&(t+=2),this.shouldIndentNextLine(e)&&(t+=4),this.shouldIgnore(e)&&(t+=8),t}}class Wg{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(t=>{const i=Wg._createOpenBracketRegExp(t[0]),s=Wg._createCloseBracketRegExp(t[1]);i&&s&&this._brackets.push({open:t[0],openRegExp:i,close:t[1],closeRegExp:s})}),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,i,s){if(e>=3)for(let o=0,r=this._regExpRules.length;oc.reg?(c.reg.lastIndex=0,c.reg.test(c.text)):!0))return a.action}if(e>=2&&i.length>0&&s.length>0)for(let o=0,r=this._brackets.length;o=2&&i.length>0){for(let o=0,r=this._brackets.length;o"u"?t:o}function c0e(n){return n.replace(/[\[\]]/g,"")}const Ni=at("languageService");class ka{constructor(e,t=[],i=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=i}}const Cj=[];function gt(n,e,t){e instanceof ka||(e=new ka(e,[],!!t)),Cj.push([n,e])}function S9(){return Cj}const $l=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-list"}),dD={JSONContribution:"base.contributions.json"};function d0e(n){return n.length>0&&n.charAt(n.length-1)==="#"?n.substring(0,n.length-1):n}class u0e{constructor(){this._onDidChangeSchema=new B,this.schemasById={}}registerSchema(e,t){this.schemasById[d0e(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}}const h0e=new u0e;_n.add(dD.JSONContribution,h0e);const qf={Configuration:"base.contributions.configuration"},L0="vscode://schemas/settings/resourceLanguage",x9=_n.as(dD.JSONContribution);class f0e{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new B,this._onDidUpdateConfiguration=new B,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:m("defaultLanguageConfigurationOverrides.title","Default Language Configuration Overrides"),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.policyConfigurations=new Map,this.excludedConfigurationProperties={},x9.registerSchema(L0,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){this.registerConfigurations([e],t)}registerConfigurations(e,t=!0){const i=new Set;this.doRegisterConfigurations(e,t,i),x9.registerSchema(L0,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}registerDefaultConfigurations(e){const t=new Set;this.doRegisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,t){var i;const s=[];for(const{overrides:o,source:r}of e)for(const a in o)if(t.add(a),nu.test(a)){const l=this.configurationDefaultsOverrides.get(a),c=(i=l==null?void 0:l.valuesSources)!==null&&i!==void 0?i:new Map;if(r)for(const f of Object.keys(o[a]))c.set(f,r);const d=Object.assign(Object.assign({},(l==null?void 0:l.value)||{}),o[a]);this.configurationDefaultsOverrides.set(a,{source:r,value:d,valuesSources:c});const u=c0e(a),h={type:"object",default:d,description:m("defaultLanguageConfiguration.description","Configure settings to be overridden for the {0} language.",u),$ref:L0,defaultDefaultValue:d,source:Ms(r)?void 0:r,defaultValueSource:r};s.push(...OS(a)),this.configurationProperties[a]=h,this.defaultLanguageConfigurationOverridesNode.properties[a]=h}else{this.configurationDefaultsOverrides.set(a,{value:o[a],source:r});const l=this.configurationProperties[a];l&&(this.updatePropertyDefaultValue(a,l),this.updateSchema(a,l))}this.doRegisterOverrideIdentifiers(s)}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(const t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t,i){e.forEach(s=>{this.validateAndRegisterProperties(s,t,s.extensionInfo,s.restrictedProperties,void 0,i),this.configurationContributors.push(s),this.registerJSONConfiguration(s)})}validateAndRegisterProperties(e,t=!0,i,s,o=3,r){var a;o=bo(e.scope)?o:e.scope;const l=e.properties;if(l)for(const d in l){const u=l[d];if(t&&m0e(d,u)){delete l[d];continue}if(u.source=i,u.defaultDefaultValue=l[d].default,this.updatePropertyDefaultValue(d,u),nu.test(d)?u.scope=void 0:(u.scope=bo(u.scope)?o:u.scope,u.restricted=bo(u.restricted)?!!(s!=null&&s.includes(d)):u.restricted),l[d].hasOwnProperty("included")&&!l[d].included){this.excludedConfigurationProperties[d]=l[d],delete l[d];continue}else this.configurationProperties[d]=l[d],!((a=l[d].policy)===null||a===void 0)&&a.name&&this.policyConfigurations.set(l[d].policy.name,d);!l[d].deprecationMessage&&l[d].markdownDeprecationMessage&&(l[d].deprecationMessage=l[d].markdownDeprecationMessage),r.add(d)}const c=e.allOf;if(c)for(const d of c)this.validateAndRegisterProperties(d,t,i,s,o,r)}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}registerJSONConfiguration(e){const t=i=>{const s=i.properties;if(s)for(const r in s)this.updateSchema(r,s[r]);const o=i.allOf;o==null||o.forEach(t)};t(e)}updateSchema(e,t){switch(t.scope){case 1:break;case 2:break;case 6:break;case 3:break;case 4:break;case 5:this.resourceLanguageSettingsSchema.properties[e]=t;break}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,i={type:"object",description:m("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),errorMessage:m("overrideSettings.errorMessage","This setting does not support per-language configuration."),$ref:L0};this.updatePropertyDefaultValue(t,i)}}registerOverridePropertyPatternKey(){m("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),m("overrideSettings.errorMessage","This setting does not support per-language configuration."),this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){const i=this.configurationDefaultsOverrides.get(e);let s=i==null?void 0:i.value,o=i==null?void 0:i.source;Ks(s)&&(s=t.defaultDefaultValue,o=void 0),Ks(s)&&(s=p0e(t.type)),t.default=s,t.defaultValueSource=o}}const Sj="\\[([^\\]]+)\\]",L9=new RegExp(Sj,"g"),g0e=`^(${Sj})+$`,nu=new RegExp(g0e);function OS(n){const e=[];if(nu.test(n)){let t=L9.exec(n);for(;t!=null&&t.length;){const i=t[1].trim();i&&e.push(i),t=L9.exec(n)}}return mf(e)}function p0e(n){switch(Array.isArray(n)?n[0]:n){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}const pC=new f0e;_n.add(qf.Configuration,pC);function m0e(n,e){var t,i,s,o;return n.trim()?nu.test(n)?m("config.property.languageDefault","Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",n):pC.getConfigurationProperties()[n]!==void 0?m("config.property.duplicate","Cannot register '{0}'. This property is already registered.",n):!((t=e.policy)===null||t===void 0)&&t.name&&pC.getPolicyConfigurations().get((i=e.policy)===null||i===void 0?void 0:i.name)!==void 0?m("config.policy.duplicate","Cannot register '{0}'. The associated policy {1} is already registered with {2}.",n,(s=e.policy)===null||s===void 0?void 0:s.name,pC.getPolicyConfigurations().get((o=e.policy)===null||o===void 0?void 0:o.name)):null:m("config.property.empty","Cannot register an empty property")}const _0e={ModesRegistry:"editor.modesRegistry"};class b0e{constructor(){this._onDidChangeLanguages=new B,this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let t=0,i=this._languages.length;t{const l=new Set;return{info:new w0e(this,a,l),closing:l}}),o=new KF(a=>{const l=new Set,c=new Set;return{info:new C0e(this,a,l,c),opening:l,openingColorized:c}});for(const[a,l]of i){const c=s.get(a),d=o.get(l);c.closing.add(d.info),d.opening.add(c.info)}const r=t.colorizedBracketPairs?D9(t.colorizedBracketPairs):i.filter(a=>!(a[0]==="<"&&a[1]===">"));for(const[a,l]of r){const c=s.get(a),d=o.get(l);c.closing.add(d.info),d.openingColorized.add(c.info),d.opening.add(c.info)}this._openingBrackets=new Map([...s.cachedValues].map(([a,l])=>[a,l.info])),this._closingBrackets=new Map([...o.cachedValues].map(([a,l])=>[a,l.info]))}get openingBrackets(){return[...this._openingBrackets.values()]}get closingBrackets(){return[...this._closingBrackets.values()]}getOpeningBracketInfo(e){return this._openingBrackets.get(e)}getClosingBracketInfo(e){return this._closingBrackets.get(e)}getBracketInfo(e){return this.getOpeningBracketInfo(e)||this.getClosingBracketInfo(e)}}function D9(n){return n.filter(([e,t])=>e!==""&&t!=="")}class xj{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class w0e extends xj{constructor(e,t,i){super(e,t),this.openedBrackets=i,this.isOpeningBracket=!0}}class C0e extends xj{constructor(e,t,i,s){super(e,t),this.openingBrackets=i,this.openingColorizedBrackets=s,this.isOpeningBracket=!1}closes(e){return e.config!==this.config?!1:this.openingBrackets.has(e)}closesColorized(e){return e.config!==this.config?!1:this.openingColorizedBrackets.has(e)}getOpeningBrackets(){return[...this.openingBrackets]}}var S0e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},k9=function(n,e){return function(t,i){e(t,i,n)}};class b2{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}}const ao=at("languageConfigurationService");let fT=class extends Y{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new k0e),this.onDidChangeEmitter=this._register(new B),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const i=new Set(Object.values(gT));this._register(this.configurationService.onDidChangeConfiguration(s=>{const o=s.change.keys.some(a=>i.has(a)),r=s.change.overrides.filter(([a,l])=>l.some(c=>i.has(c))).map(([a])=>a);if(o)this.configurations.clear(),this.onDidChangeEmitter.fire(new b2(void 0));else for(const a of r)this.languageService.isRegisteredLanguageId(a)&&(this.configurations.delete(a),this.onDidChangeEmitter.fire(new b2(a)))})),this._register(this._registry.onDidChange(s=>{this.configurations.delete(s.languageId),this.onDidChangeEmitter.fire(new b2(s.languageId))}))}register(e,t,i){return this._registry.register(e,t,i)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=x0e(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};fT=S0e([k9(0,ni),k9(1,Ni)],fT);function x0e(n,e,t,i){let s=e.getLanguageConfiguration(n);if(!s){if(!i.isRegisteredLanguageId(n))return new mp(n,{});s=new mp(n,{})}const o=L0e(s.languageId,t),r=Dj([s.underlyingConfig,o]);return new mp(s.languageId,r)}const gT={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function L0e(n,e){const t=e.getValue(gT.brackets,{overrideIdentifier:n}),i=e.getValue(gT.colorizedBracketPairs,{overrideIdentifier:n});return{brackets:E9(t),colorizedBracketPairs:E9(i)}}function E9(n){if(Array.isArray(n))return n.map(e=>{if(!(!Array.isArray(e)||e.length!==2))return[e[0],e[1]]}).filter(e=>!!e)}function Lj(n,e,t){const i=n.getLineContent(e);let s=$s(i);return s.length>t-1&&(s=s.substring(0,t-1)),s}function pp(n,e,t){n.tokenization.forceTokenization(e);const i=n.tokenization.getLineTokens(e),s=typeof t>"u"?n.getLineMaxColumn(e)-1:t-1;return rD(i,s)}class D0e{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const i=new A9(e,t,++this._order);return this._entries.push(i),this._resolved=null,Ze(()=>{for(let s=0;se.configuration)))}}function Dj(n){let e={comments:void 0,brackets:void 0,wordPattern:void 0,indentationRules:void 0,onEnterRules:void 0,autoClosingPairs:void 0,surroundingPairs:void 0,autoCloseBefore:void 0,folding:void 0,colorizedBracketPairs:void 0,__electricCharacterSupport:void 0};for(const t of n)e={comments:t.comments||e.comments,brackets:t.brackets||e.brackets,wordPattern:t.wordPattern||e.wordPattern,indentationRules:t.indentationRules||e.indentationRules,onEnterRules:t.onEnterRules||e.onEnterRules,autoClosingPairs:t.autoClosingPairs||e.autoClosingPairs,surroundingPairs:t.surroundingPairs||e.surroundingPairs,autoCloseBefore:t.autoCloseBefore||e.autoCloseBefore,folding:t.folding||e.folding,colorizedBracketPairs:t.colorizedBracketPairs||e.colorizedBracketPairs,__electricCharacterSupport:t.__electricCharacterSupport||e.__electricCharacterSupport};return e}class A9{constructor(e,t,i){this.configuration=e,this.priority=t,this.order=i}static cmp(e,t){return e.priority===t.priority?e.order-t.order:e.priority-t.priority}}class I9{constructor(e){this.languageId=e}}class k0e extends Y{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._register(this.register($o,{brackets:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0))}register(e,t,i=0){let s=this._entries.get(e);s||(s=new D0e(e),this._entries.set(e,s));const o=s.register(t,i);return this._onDidChange.fire(new I9(e)),Ze(()=>{o.dispose(),this._onDidChange.fire(new I9(e))})}getLanguageConfiguration(e){const t=this._entries.get(e);return(t==null?void 0:t.getResolvedConfiguration())||null}}class mp{constructor(e,t){this.languageId=e,this.underlyingConfig=t,this._brackets=null,this._electricCharacter=null,this._onEnterSupport=this.underlyingConfig.brackets||this.underlyingConfig.indentationRules||this.underlyingConfig.onEnterRules?new Wg(this.underlyingConfig):null,this.comments=mp._handleComments(this.underlyingConfig),this.characterPair=new vm(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||A4,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new a0e(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new y0e(e,this.underlyingConfig)}getWordDefinition(){return dU(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new e0e(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new r0e(this.brackets)),this._electricCharacter}onEnter(e,t,i,s){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,s):null}getAutoClosingPairs(){return new qme(this.characterPair.getAutoClosingPairs())}getAutoCloseBeforeSet(e){return this.characterPair.getAutoCloseBeforeSet(e)}getSurroundingPairs(){return this.characterPair.getSurroundingPairs()}static _handleComments(e){const t=e.comments;if(!t)return null;const i={};if(t.lineComment&&(i.lineCommentToken=t.lineComment),t.blockComment){const[s,o]=t.blockComment;i.blockCommentStartToken=s,i.blockCommentEndToken=o}return i}}gt(ao,fT,1);class Vc{constructor(e,t,i,s){this.originalStart=e,this.originalLength=t,this.modifiedStart=i,this.modifiedLength=s}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}function E0e(n){return uD(n,0)}function uD(n,e){switch(typeof n){case"object":return n===null?Xl(349,e):Array.isArray(n)?I0e(n,e):T0e(n,e);case"string":return iP(n,e);case"boolean":return A0e(n,e);case"number":return Xl(n,e);case"undefined":return Xl(937,e);default:return Xl(617,e)}}function Xl(n,e){return(e<<5)-e+n|0}function A0e(n,e){return Xl(n?433:863,e)}function iP(n,e){e=Xl(149417,e);for(let t=0,i=n.length;tuD(i,t),e)}function T0e(n,e){return e=Xl(181387,e),Object.keys(n).sort().reduce((t,i)=>(t=iP(i,t),uD(n[i],t)),e)}function v2(n,e,t=32){const i=t-e,s=~((1<>>i)>>>0}function T9(n,e=0,t=n.byteLength,i=0){for(let s=0;st.toString(16).padStart(2,"0")).join(""):N0e((n>>>0).toString(16),e/4)}class hD{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const t=e.length;if(t===0)return;const i=this._buff;let s=this._buffLen,o=this._leftoverHighSurrogate,r,a;for(o!==0?(r=o,a=-1,o=0):(r=e.charCodeAt(0),a=0);;){let l=r;if(sn(r))if(a+1>>6,e[t++]=128|(i&63)>>>0):i<65536?(e[t++]=224|(i&61440)>>>12,e[t++]=128|(i&4032)>>>6,e[t++]=128|(i&63)>>>0):(e[t++]=240|(i&1835008)>>>18,e[t++]=128|(i&258048)>>>12,e[t++]=128|(i&4032)>>>6,e[t++]=128|(i&63)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),D0(this._h0)+D0(this._h1)+D0(this._h2)+D0(this._h3)+D0(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,T9(this._buff,this._buffLen),this._buffLen>56&&(this._step(),T9(this._buff));const e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){const e=hD._bigBlock32,t=this._buffDV;for(let u=0;u<64;u+=4)e.setUint32(u,t.getUint32(u,!1),!1);for(let u=64;u<320;u+=4)e.setUint32(u,v2(e.getUint32(u-12,!1)^e.getUint32(u-32,!1)^e.getUint32(u-56,!1)^e.getUint32(u-64,!1),1),!1);let i=this._h0,s=this._h1,o=this._h2,r=this._h3,a=this._h4,l,c,d;for(let u=0;u<80;u++)u<20?(l=s&o|~s&r,c=1518500249):u<40?(l=s^o^r,c=1859775393):u<60?(l=s&o|s&r|o&r,c=2400959708):(l=s^o^r,c=3395469782),d=v2(i,5)+l+a+c+e.getUint32(u*4,!1)&4294967295,a=r,r=o,o=v2(s,30),s=i,i=d;this._h0=this._h0+i&4294967295,this._h1=this._h1+s&4294967295,this._h2=this._h2+o&4294967295,this._h3=this._h3+r&4294967295,this._h4=this._h4+a&4294967295}}hD._bigBlock32=new DataView(new ArrayBuffer(320));class N9{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let i=0,s=e.length;i0||this.m_modifiedCount>0)&&this.m_changes.push(new Vc(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}AddOriginalElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++}AddModifiedElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}}class Ul{constructor(e,t,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=e,this._modifiedSequence=t;const[s,o,r]=Ul._getElements(e),[a,l,c]=Ul._getElements(t);this._hasStrings=r&&c,this._originalStringElements=s,this._originalElementsOrHash=o,this._modifiedStringElements=a,this._modifiedElementsOrHash=l,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){return e.length>0&&typeof e[0]=="string"}static _getElements(e){const t=e.getElements();if(Ul._isStringArray(t)){const i=new Int32Array(t.length);for(let s=0,o=t.length;s=e&&s>=i&&this.ElementsAreEqual(t,s);)t--,s--;if(e>t||i>s){let u;return i<=s?(hg.Assert(e===t+1,"originalStart should only be one more than originalEnd"),u=[new Vc(e,0,i,s-i+1)]):e<=t?(hg.Assert(i===s+1,"modifiedStart should only be one more than modifiedEnd"),u=[new Vc(e,t-e+1,i,0)]):(hg.Assert(e===t+1,"originalStart should only be one more than originalEnd"),hg.Assert(i===s+1,"modifiedStart should only be one more than modifiedEnd"),u=[]),u}const r=[0],a=[0],l=this.ComputeRecursionPoint(e,t,i,s,r,a,o),c=r[0],d=a[0];if(l!==null)return l;if(!o[0]){const u=this.ComputeDiffRecursive(e,c,i,d,o);let h=[];return o[0]?h=[new Vc(c+1,t-(c+1)+1,d+1,s-(d+1)+1)]:h=this.ComputeDiffRecursive(c+1,t,d+1,s,o),this.ConcatenateChanges(u,h)}return[new Vc(e,t-e+1,i,s-i+1)]}WALKTRACE(e,t,i,s,o,r,a,l,c,d,u,h,f,g,p,_,v,b){let y=null,w=null,C=new R9,L=t,x=i,D=f[0]-_[0]-s,k=-1073741824,P=this.m_forwardHistory.length-1;do{const O=D+e;O===L||O=0&&(c=this.m_forwardHistory[P],e=c[0],L=1,x=c.length-1)}while(--P>=-1);if(y=C.getReverseChanges(),b[0]){let O=f[0]+1,M=_[0]+1;if(y!==null&&y.length>0){const R=y[y.length-1];O=Math.max(O,R.getOriginalEnd()),M=Math.max(M,R.getModifiedEnd())}w=[new Vc(O,h-O+1,M,p-M+1)]}else{C=new R9,L=r,x=a,D=f[0]-_[0]-l,k=1073741824,P=v?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const O=D+o;O===L||O=d[O+1]?(u=d[O+1]-1,g=u-D-l,u>k&&C.MarkNextChange(),k=u+1,C.AddOriginalElement(u+1,g+1),D=O+1-o):(u=d[O-1],g=u-D-l,u>k&&C.MarkNextChange(),k=u,C.AddModifiedElement(u+1,g+1),D=O-1-o),P>=0&&(d=this.m_reverseHistory[P],o=d[0],L=1,x=d.length-1)}while(--P>=-1);w=C.getChanges()}return this.ConcatenateChanges(y,w)}ComputeRecursionPoint(e,t,i,s,o,r,a){let l=0,c=0,d=0,u=0,h=0,f=0;e--,i--,o[0]=0,r[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const g=t-e+(s-i),p=g+1,_=new Int32Array(p),v=new Int32Array(p),b=s-i,y=t-e,w=e-i,C=t-s,x=(y-b)%2===0;_[b]=e,v[y]=t,a[0]=!1;for(let D=1;D<=g/2+1;D++){let k=0,P=0;d=this.ClipDiagonalBound(b-D,D,b,p),u=this.ClipDiagonalBound(b+D,D,b,p);for(let M=d;M<=u;M+=2){M===d||Mk+P&&(k=l,P=c),!x&&Math.abs(M-y)<=D-1&&l>=v[M])return o[0]=l,r[0]=c,R<=v[M]&&D<=1448?this.WALKTRACE(b,d,u,w,y,h,f,C,_,v,l,t,o,c,s,r,x,a):null}const O=(k-e+(P-i)-D)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(k,O))return a[0]=!0,o[0]=k,r[0]=P,O>0&&D<=1448?this.WALKTRACE(b,d,u,w,y,h,f,C,_,v,l,t,o,c,s,r,x,a):(e++,i++,[new Vc(e,t-e+1,i,s-i+1)]);h=this.ClipDiagonalBound(y-D,D,y,p),f=this.ClipDiagonalBound(y+D,D,y,p);for(let M=h;M<=f;M+=2){M===h||M=v[M+1]?l=v[M+1]-1:l=v[M-1],c=l-(M-y)-C;const R=l;for(;l>e&&c>i&&this.ElementsAreEqual(l,c);)l--,c--;if(v[M]=l,x&&Math.abs(M-b)<=D&&l<=_[M])return o[0]=l,r[0]=c,R>=_[M]&&D<=1448?this.WALKTRACE(b,d,u,w,y,h,f,C,_,v,l,t,o,c,s,r,x,a):null}if(D<=1447){let M=new Int32Array(u-d+2);M[0]=b-d+1,fg.Copy2(_,d,M,1,u-d+1),this.m_forwardHistory.push(M),M=new Int32Array(f-h+2),M[0]=y-h+1,fg.Copy2(v,h,M,1,f-h+1),this.m_reverseHistory.push(M)}}return this.WALKTRACE(b,d,u,w,y,h,f,C,_,v,l,t,o,c,s,r,x,a)}PrettifyChanges(e){for(let t=0;t0,a=i.modifiedLength>0;for(;i.originalStart+i.originalLength=0;t--){const i=e[t];let s=0,o=0;if(t>0){const u=e[t-1];s=u.originalStart+u.originalLength,o=u.modifiedStart+u.modifiedLength}const r=i.originalLength>0,a=i.modifiedLength>0;let l=0,c=this._boundaryScore(i.originalStart,i.originalLength,i.modifiedStart,i.modifiedLength);for(let u=1;;u++){const h=i.originalStart-u,f=i.modifiedStart-u;if(hc&&(c=p,l=u)}i.originalStart-=l,i.modifiedStart-=l;const d=[null];if(t>0&&this.ChangesOverlap(e[t-1],e[t],d)){e[t-1]=d[0],e.splice(t,1),t++;continue}}if(this._hasStrings)for(let t=1,i=e.length;t0&&f>l&&(l=f,c=u,d=h)}return l>0?[c,d]:null}_contiguousSequenceScore(e,t,i){let s=0;for(let o=0;o=this._originalElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._originalStringElements[e])}_OriginalRegionIsBoundary(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._OriginalIsBoundary(i-1)||this._OriginalIsBoundary(i))return!0}return!1}_ModifiedIsBoundary(e){return e<=0||e>=this._modifiedElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[e])}_ModifiedRegionIsBoundary(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._ModifiedIsBoundary(i-1)||this._ModifiedIsBoundary(i))return!0}return!1}_boundaryScore(e,t,i,s){const o=this._OriginalRegionIsBoundary(e,t)?1:0,r=this._ModifiedRegionIsBoundary(i,s)?1:0;return o+r}ConcatenateChanges(e,t){const i=[];if(e.length===0||t.length===0)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],i)){const s=new Array(e.length+t.length-1);return fg.Copy(e,0,s,0,e.length-1),s[e.length-1]=i[0],fg.Copy(t,1,s,e.length,t.length-1),s}else{const s=new Array(e.length+t.length);return fg.Copy(e,0,s,0,e.length),fg.Copy(t,0,s,e.length,t.length),s}}ChangesOverlap(e,t,i){if(hg.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),hg.Assert(e.modifiedStart<=t.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=t.originalStart||e.modifiedStart+e.modifiedLength>=t.modifiedStart){const s=e.originalStart;let o=e.originalLength;const r=e.modifiedStart;let a=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(o=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(a=t.modifiedStart+t.modifiedLength-e.modifiedStart),i[0]=new Vc(s,o,r,a),!0}else return i[0]=null,!1}ClipDiagonalBound(e,t,i,s){if(e>=0&&e255?255:n|0}function gg(n){return n<0?0:n>4294967295?4294967295:n|0}class M0e{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=gg(e);const i=this.values,s=this.prefixSum,o=t.length;return o===0?!1:(this.values=new Uint32Array(i.length+o),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e),e+o),this.values.set(t,e),e-1=0&&this.prefixSum.set(s.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=gg(e),t=gg(t),this.values[e]===t?!1:(this.values[e]=t,e-1=i.length)return!1;const o=i.length-e;return t>=o&&(t=o),t===0?!1:(this.values=new Uint32Array(i.length-t),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1=0&&this.prefixSum.set(s.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return this.values.length===0?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=gg(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;t===0&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(let i=t;i<=e;i++)this.prefixSum[i]=this.prefixSum[i-1]+this.values[i];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let t=0,i=this.values.length-1,s=0,o=0,r=0;for(;t<=i;)if(s=t+(i-t)/2|0,o=this.prefixSum[s],r=o-this.values[s],e=o)t=s+1;else break;return new kj(s,e-r)}}class P0e{constructor(e){this._values=e,this._isValid=!1,this._validEndIndex=-1,this._prefixSum=[],this._indexBySum=[]}getTotalSum(){return this._ensureValid(),this._indexBySum.length}getPrefixSum(e){return this._ensureValid(),e===0?0:this._prefixSum[e-1]}getIndexOf(e){this._ensureValid();const t=this._indexBySum[e],i=t>0?this._prefixSum[t-1]:0;return new kj(t,e-i)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=zL(this._values,e,t),this._invalidate(e)}_invalidate(e){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,e-1)}_ensureValid(){if(!this._isValid){for(let e=this._validEndIndex+1,t=this._values.length;e0?this._prefixSum[e-1]:0;this._prefixSum[e]=s+i;for(let o=0;o=0&&e<256?this._asciiMap[e]=i:this._map.set(e,i)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}clear(){this._asciiMap.fill(this._defaultValue),this._map.clear()}}class F0e{constructor(e,t,i){const s=new Uint8Array(e*t);for(let o=0,r=e*t;ot&&(t=l),a>i&&(i=a),c>i&&(i=c)}t++,i++;const s=new F0e(i,t,0);for(let o=0,r=e.length;o=this._maxCharCode?0:this._states.get(e,t)}}let y2=null;function W0e(){return y2===null&&(y2=new B0e([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),y2}let k0=null;function V0e(){if(k0===null){k0=new K1(0);const n=` <>'"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…`;for(let t=0;ts);if(s>0){const a=t.charCodeAt(s-1),l=t.charCodeAt(r);(a===40&&l===41||a===91&&l===93||a===123&&l===125)&&r--}return{range:{startLineNumber:i,startColumn:s+1,endLineNumber:i,endColumn:r+2},url:t.substring(s,r+1)}}static computeLinks(e,t=W0e()){const i=V0e(),s=[];for(let o=1,r=e.getLineCount();o<=r;o++){const a=e.getLineContent(o),l=a.length;let c=0,d=0,u=0,h=1,f=!1,g=!1,p=!1,_=!1;for(;c=0?(s+=i?1:-1,s<0?s=e.length-1:s%=e.length,e[s]):null}}pT.INSTANCE=new pT;class H0e extends K1{constructor(e){super(0);for(let t=0,i=e.length;t(e.hasOwnProperty(t)||(e[t]=n(t)),e[t])}const wm=$0e(n=>new H0e(n));var Go;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=4]="Right",n[n.Full=7]="Full"})(Go||(Go={}));var _p;(function(n){n[n.Left=1]="Left",n[n.Right=2]="Right"})(_p||(_p={}));var Js;(function(n){n[n.Inline=1]="Inline",n[n.Gutter=2]="Gutter"})(Js||(Js={}));var Cm;(function(n){n[n.Both=0]="Both",n[n.Right=1]="Right",n[n.Left=2]="Left",n[n.None=3]="None"})(Cm||(Cm={}));class mC{get originalIndentSize(){return this._indentSizeIsTabSize?"tabSize":this.indentSize}constructor(e){this._textModelResolvedOptionsBrand=void 0,this.tabSize=Math.max(1,e.tabSize|0),e.indentSize==="tabSize"?(this.indentSize=this.tabSize,this._indentSizeIsTabSize=!0):(this.indentSize=Math.max(1,e.indentSize|0),this._indentSizeIsTabSize=!1),this.insertSpaces=!!e.insertSpaces,this.defaultEOL=e.defaultEOL|0,this.trimAutoWhitespace=!!e.trimAutoWhitespace,this.bracketPairColorizationOptions=e.bracketPairColorizationOptions}equals(e){return this.tabSize===e.tabSize&&this._indentSizeIsTabSize===e._indentSizeIsTabSize&&this.indentSize===e.indentSize&&this.insertSpaces===e.insertSpaces&&this.defaultEOL===e.defaultEOL&&this.trimAutoWhitespace===e.trimAutoWhitespace&&Lo(this.bracketPairColorizationOptions,e.bracketPairColorizationOptions)}createChangeEvent(e){return{tabSize:this.tabSize!==e.tabSize,indentSize:this.indentSize!==e.indentSize,insertSpaces:this.insertSpaces!==e.insertSpaces,trimAutoWhitespace:this.trimAutoWhitespace!==e.trimAutoWhitespace}}}class qb{constructor(e,t){this._findMatchBrand=void 0,this.range=e,this.matches=t}}function U0e(n){return n&&typeof n.read=="function"}class w2{constructor(e,t,i,s,o,r){this.identifier=e,this.range=t,this.text=i,this.forceMoveMarkers=s,this.isAutoWhitespaceEdit=o,this._isTracked=r}}class j0e{constructor(e,t,i){this.regex=e,this.wordSeparators=t,this.simpleSearch=i}}class q0e{constructor(e,t,i){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=i}}function G0e(n){return!n.isTooLargeForSyncing()&&!n.isForSimpleWidget}const K0e=999;class ih{constructor(e,t,i,s){this.searchString=e,this.isRegex=t,this.matchCase=i,this.wordSeparators=s}parseSearchRequest(){if(this.searchString==="")return null;let e;this.isRegex?e=Y0e(this.searchString):e=this.searchString.indexOf(` -`)>=0;let t=null;try{t=AU(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch{return null}if(!t)return null;let i=!this.isRegex&&!e;return i&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(i=this.matchCase),new j0e(t,this.wordSeparators?wm(this.wordSeparators):null,i?this.searchString:null)}}function Y0e(n){if(!n||n.length===0)return!1;for(let e=0,t=n.length;e=t)break;const s=n.charCodeAt(e);if(s===110||s===114||s===87)return!0}}return!1}function ah(n,e,t){if(!t)return new qb(n,null);const i=[];for(let s=0,o=e.length;s>0);t[o]>=e?s=o-1:t[o+1]>=e?(i=o,s=o):i=o+1}return i+1}}class Zy{static findMatches(e,t,i,s,o){const r=t.parseSearchRequest();return r?r.regex.multiline?this._doFindMatchesMultiline(e,i,new Vg(r.wordSeparators,r.regex),s,o):this._doFindMatchesLineByLine(e,i,r,s,o):[]}static _getMultilineMatchRange(e,t,i,s,o,r){let a,l=0;s?(l=s.findLineFeedCountBeforeOffset(o),a=t+o+l):a=t+o;let c;if(s){const f=s.findLineFeedCountBeforeOffset(o+r.length)-l;c=a+r.length+f}else c=a+r.length;const d=e.getPositionAt(a),u=e.getPositionAt(c);return new N(d.lineNumber,d.column,u.lineNumber,u.column)}static _doFindMatchesMultiline(e,t,i,s,o){const r=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,1),l=e.getEOL()===`\r -`?new M9(a):null,c=[];let d=0,u;for(i.reset(0);u=i.next(a);)if(c[d++]=ah(this._getMultilineMatchRange(e,r,a,l,u.index,u[0]),u,s),d>=o)return c;return c}static _doFindMatchesLineByLine(e,t,i,s,o){const r=[];let a=0;if(t.startLineNumber===t.endLineNumber){const c=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return a=this._findMatchesInLine(i,c,t.startLineNumber,t.startColumn-1,a,r,s,o),r}const l=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);a=this._findMatchesInLine(i,l,t.startLineNumber,t.startColumn-1,a,r,s,o);for(let c=t.startLineNumber+1;c=l))return o;return o}const d=new Vg(e.wordSeparators,e.regex);let u;d.reset(0);do if(u=d.next(t),u&&(r[o++]=ah(new N(i,u.index+1+s,i,u.index+1+u[0].length+s),u,a),o>=l))return o;while(u);return o}static findNextMatch(e,t,i,s){const o=t.parseSearchRequest();if(!o)return null;const r=new Vg(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindNextMatchMultiline(e,i,r,s):this._doFindNextMatchLineByLine(e,i,r,s)}static _doFindNextMatchMultiline(e,t,i,s){const o=new V(t.lineNumber,1),r=e.getOffsetAt(o),a=e.getLineCount(),l=e.getValueInRange(new N(o.lineNumber,o.column,a,e.getLineMaxColumn(a)),1),c=e.getEOL()===`\r -`?new M9(l):null;i.reset(t.column-1);const d=i.next(l);return d?ah(this._getMultilineMatchRange(e,r,l,c,d.index,d[0]),d,s):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new V(1,1),i,s):null}static _doFindNextMatchLineByLine(e,t,i,s){const o=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r),l=this._findFirstMatchInLine(i,a,r,t.column,s);if(l)return l;for(let c=1;c<=o;c++){const d=(r+c-1)%o,u=e.getLineContent(d+1),h=this._findFirstMatchInLine(i,u,d+1,1,s);if(h)return h}return null}static _findFirstMatchInLine(e,t,i,s,o){e.reset(s-1);const r=e.next(t);return r?ah(new N(i,r.index+1,i,r.index+1+r[0].length),r,o):null}static findPreviousMatch(e,t,i,s){const o=t.parseSearchRequest();if(!o)return null;const r=new Vg(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindPreviousMatchMultiline(e,i,r,s):this._doFindPreviousMatchLineByLine(e,i,r,s)}static _doFindPreviousMatchMultiline(e,t,i,s){const o=this._doFindMatchesMultiline(e,new N(1,1,t.lineNumber,t.column),i,s,10*K0e);if(o.length>0)return o[o.length-1];const r=e.getLineCount();return t.lineNumber!==r||t.column!==e.getLineMaxColumn(r)?this._doFindPreviousMatchMultiline(e,new V(r,e.getLineMaxColumn(r)),i,s):null}static _doFindPreviousMatchLineByLine(e,t,i,s){const o=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r).substring(0,t.column-1),l=this._findLastMatchInLine(i,a,r,s);if(l)return l;for(let c=1;c<=o;c++){const d=(o+r-c-1)%o,u=e.getLineContent(d+1),h=this._findLastMatchInLine(i,u,d+1,s);if(h)return h}return null}static _findLastMatchInLine(e,t,i,s){let o=null,r;for(e.reset(0);r=e.next(t);)o=ah(new N(i,r.index+1,i,r.index+1+r[0].length),r,s);return o}}function Z0e(n,e,t,i,s){if(i===0)return!0;const o=e.charCodeAt(i-1);if(n.get(o)!==0||o===13||o===10)return!0;if(s>0){const r=e.charCodeAt(i);if(n.get(r)!==0)return!0}return!1}function X0e(n,e,t,i,s){if(i+s===t)return!0;const o=e.charCodeAt(i+s);if(n.get(o)!==0||o===13||o===10)return!0;if(s>0){const r=e.charCodeAt(i+s-1);if(n.get(r)!==0)return!0}return!1}function nP(n,e,t,i,s){return Z0e(n,e,t,i,s)&&X0e(n,e,t,i,s)}class Vg{constructor(e,t){this._wordSeparators=e,this._searchRegex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(e){const t=e.length;let i;do{if(this._prevMatchStartIndex+this._prevMatchLength===t||(i=this._searchRegex.exec(e),!i))return null;const s=i.index,o=i[0].length;if(s===this._prevMatchStartIndex&&o===this._prevMatchLength){if(o===0){AS(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=s,this._prevMatchLength=o,!this._wordSeparators||nP(this._wordSeparators,e,t,s,o))return i}while(i);return null}}class Q0e{static computeUnicodeHighlights(e,t,i){const s=i?i.startLineNumber:1,o=i?i.endLineNumber:e.getLineCount(),r=new P9(t),a=r.getCandidateCodePoints();let l;a==="allNonBasicAscii"?l=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):l=new RegExp(`${J0e(Array.from(a))}`,"g");const c=new Vg(null,l),d=[];let u=!1,h,f=0,g=0,p=0;e:for(let _=s,v=o;_<=v;_++){const b=e.getLineContent(_),y=b.length;c.reset(0);do if(h=c.next(b),h){let w=h.index,C=h.index+h[0].length;if(w>0){const k=b.charCodeAt(w-1);sn(k)&&w--}if(C+1=1e3){u=!0;break e}d.push(new N(_,w+1,_,C+1))}}while(h)}return{ranges:d,hasMore:u,ambiguousCharacterCount:f,invisibleCharacterCount:g,nonBasicAsciiCharacterCount:p}}static computeUnicodeHighlightReason(e,t){const i=new P9(t);switch(i.shouldHighlightNonBasicASCII(e,null)){case 0:return null;case 2:return{kind:1};case 3:{const o=e.codePointAt(0),r=i.ambiguousCharacters.getPrimaryConfusable(o),a=_f.getLocales().filter(l=>!_f.getInstance(new Set([...t.allowedLocales,l])).isAmbiguous(o));return{kind:0,confusableWith:String.fromCodePoint(r),notAmbiguousInLocales:a}}case 1:return{kind:2}}}}function J0e(n,e){return`[${xr(n.map(i=>String.fromCodePoint(i)).join(""))}]`}class P9{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=_f.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of Ed.codePoints)O9(String.fromCodePoint(t))||e.add(t);if(this.options.ambiguousCharacters)for(const t of this.ambiguousCharacters.getConfusableCodePoints())e.add(t);for(const t of this.allowedCodePoints)e.delete(t);return e}shouldHighlightNonBasicASCII(e,t){const i=e.codePointAt(0);if(this.allowedCodePoints.has(i))return 0;if(this.options.nonBasicASCII)return 1;let s=!1,o=!1;if(t)for(const r of t){const a=r.codePointAt(0),l=H4(r);s=s||l,!l&&!this.ambiguousCharacters.isAmbiguous(a)&&!Ed.isInvisibleCharacter(a)&&(o=!0)}return!s&&o?0:this.options.invisibleCharacters&&!O9(e)&&Ed.isInvisibleCharacter(i)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(i)?3:0}}function O9(n){return n===" "||n===` -`||n===" "}class _C{constructor(e,t,i){this.changes=e,this.moves=t,this.hitTimeout=i}}class Ej{constructor(e,t){this.lineRangeMapping=e,this.changes=t}}class Ye{static addRange(e,t){let i=0;for(;it))return new Ye(e,t)}static ofLength(e){return new Ye(0,e)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new Gi(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new Ye(this.start+e,this.endExclusive+e)}deltaStart(e){return new Ye(this.start+e,this.endExclusive)}deltaEnd(e){return new Ye(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}containsRange(e){return this.start<=e.start&&e.endExclusive<=this.endExclusive}contains(e){return this.start<=e&&e=this.endExclusive?this.start+(e-this.start)%this.length:e}forEach(e){for(let t=this.start;te.toString()).join(", ")}intersectsStrict(e){let t=0;for(;te+t.length,0)}}function mT(n,e,t){const i=e_e(n,e);if(i!==-1)return n[i]}function e_e(n,e,t=n.length-1){for(let i=t;i>=0;i--){const s=n[i];if(e(s))return i}return-1}function Gb(n,e){const t=Kb(n,e);return t===-1?void 0:n[t]}function Kb(n,e,t=0,i=n.length){let s=t,o=i;for(;s0&&(t=s)}return t}function n_e(n,e){if(n.length===0)return;let t=n[0];for(let i=1;i=0&&(t=s)}return t}function s_e(n,e){return i_e(n,(t,i)=>-e(t,i))}function o_e(n,e){if(n.length===0)return-1;let t=0;for(let i=1;i0&&(t=i)}return t}let Qe=class zc{static fromRange(e){return new zc(e.startLineNumber,e.endLineNumber)}static joinMany(e){if(e.length===0)return[];let t=new Ta(e[0].slice());for(let i=1;it)throw new Gi(`startLineNumber ${e} cannot be after endLineNumberExclusive ${t}`);this.startLineNumber=e,this.endLineNumberExclusive=t}contains(e){return this.startLineNumber<=e&&es.endLineNumberExclusive>=e.startLineNumber),i=Kb(this._normalizedRanges,s=>s.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)this._normalizedRanges.splice(t,0,e);else if(t===i-1){const s=this._normalizedRanges[t];this._normalizedRanges[t]=s.join(e)}else{const s=this._normalizedRanges[t].join(this._normalizedRanges[i-1]).join(e);this._normalizedRanges.splice(t,i-t,s)}}contains(e){const t=Gb(this._normalizedRanges,i=>i.startLineNumber<=e);return!!t&&t.endLineNumberExclusive>e}getUnion(e){if(this._normalizedRanges.length===0)return e;if(e._normalizedRanges.length===0)return this;const t=[];let i=0,s=0,o=null;for(;i=r.startLineNumber?o=new Qe(o.startLineNumber,Math.max(o.endLineNumberExclusive,r.endLineNumberExclusive)):(t.push(o),o=r)}return o!==null&&t.push(o),new Ta(t)}subtractFrom(e){const t=Yb(this._normalizedRanges,r=>r.endLineNumberExclusive>=e.startLineNumber),i=Kb(this._normalizedRanges,r=>r.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)return new Ta([e]);const s=[];let o=e.startLineNumber;for(let r=t;ro&&s.push(new Qe(o,a.startLineNumber)),o=a.endLineNumberExclusive}return oe.toString()).join(", ")}getIntersection(e){const t=[];let i=0,s=0;for(;it.delta(e)))}}class nl{static inverse(e,t,i){const s=[];let o=1,r=1;for(const l of e){const c=new Ko(new Qe(o,l.original.startLineNumber),new Qe(r,l.modified.startLineNumber),void 0);c.modified.isEmpty||s.push(c),o=l.original.endLineNumberExclusive,r=l.modified.endLineNumberExclusive}const a=new Ko(new Qe(o,t+1),new Qe(r,i+1),void 0);return a.modified.isEmpty||s.push(a),s}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new nl(this.modified,this.original)}join(e){return new nl(this.original.join(e.original),this.modified.join(e.modified))}}class Ko extends nl{constructor(e,t,i){super(e,t),this.innerChanges=i}flip(){var e;return new Ko(this.modified,this.original,(e=this.innerChanges)===null||e===void 0?void 0:e.map(t=>t.flip()))}}class su{constructor(e,t){this.originalRange=e,this.modifiedRange=t}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}flip(){return new su(this.modifiedRange,this.originalRange)}}const r_e=3;class a_e{computeDiff(e,t,i){var s;const r=new d_e(e,t,{maxComputationTime:i.maxComputationTimeMs,shouldIgnoreTrimWhitespace:i.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),a=[];let l=null;for(const c of r.changes){let d;c.originalEndLineNumber===0?d=new Qe(c.originalStartLineNumber+1,c.originalStartLineNumber+1):d=new Qe(c.originalStartLineNumber,c.originalEndLineNumber+1);let u;c.modifiedEndLineNumber===0?u=new Qe(c.modifiedStartLineNumber+1,c.modifiedStartLineNumber+1):u=new Qe(c.modifiedStartLineNumber,c.modifiedEndLineNumber+1);let h=new Ko(d,u,(s=c.charChanges)===null||s===void 0?void 0:s.map(f=>new su(new N(f.originalStartLineNumber,f.originalStartColumn,f.originalEndLineNumber,f.originalEndColumn),new N(f.modifiedStartLineNumber,f.modifiedStartColumn,f.modifiedEndLineNumber,f.modifiedEndColumn))));l&&(l.modified.endLineNumberExclusive===h.modified.startLineNumber||l.original.endLineNumberExclusive===h.original.startLineNumber)&&(h=new Ko(l.original.join(h.original),l.modified.join(h.modified),l.innerChanges&&h.innerChanges?l.innerChanges.concat(h.innerChanges):void 0),a.pop()),a.push(h),l=h}return Hb(()=>VU(a,(c,d)=>d.original.startLineNumber-c.original.endLineNumberExclusive===d.modified.startLineNumber-c.modified.endLineNumberExclusive&&c.original.endLineNumberExclusive(e===10?"\\n":String.fromCharCode(e))+`-(${this._lineNumbers[t]},${this._columns[t]})`).join(", ")+"]"}_assertIndex(e,t){if(e<0||e>=t.length)throw new Error("Illegal index")}getElements(){return this._charCodes}getStartLineNumber(e){return e>0&&e===this._lineNumbers.length?this.getEndLineNumber(e-1):(this._assertIndex(e,this._lineNumbers),this._lineNumbers[e])}getEndLineNumber(e){return e===-1?this.getStartLineNumber(e+1):(this._assertIndex(e,this._lineNumbers),this._charCodes[e]===10?this._lineNumbers[e]+1:this._lineNumbers[e])}getStartColumn(e){return e>0&&e===this._columns.length?this.getEndColumn(e-1):(this._assertIndex(e,this._columns),this._columns[e])}getEndColumn(e){return e===-1?this.getStartColumn(e+1):(this._assertIndex(e,this._columns),this._charCodes[e]===10?1:this._columns[e]+1)}}class bp{constructor(e,t,i,s,o,r,a,l){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=i,this.originalEndColumn=s,this.modifiedStartLineNumber=o,this.modifiedStartColumn=r,this.modifiedEndLineNumber=a,this.modifiedEndColumn=l}static createFromDiffChange(e,t,i){const s=t.getStartLineNumber(e.originalStart),o=t.getStartColumn(e.originalStart),r=t.getEndLineNumber(e.originalStart+e.originalLength-1),a=t.getEndColumn(e.originalStart+e.originalLength-1),l=i.getStartLineNumber(e.modifiedStart),c=i.getStartColumn(e.modifiedStart),d=i.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),u=i.getEndColumn(e.modifiedStart+e.modifiedLength-1);return new bp(s,o,r,a,l,c,d,u)}}function c_e(n){if(n.length<=1)return n;const e=[n[0]];let t=e[0];for(let i=1,s=n.length;i0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&o()){const f=i.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),g=s.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);if(f.getElements().length>0&&g.getElements().length>0){let p=Aj(f,g,o,!0).changes;a&&(p=c_e(p)),h=[];for(let _=0,v=p.length;_1&&p>1;){const _=h.charCodeAt(g-2),v=f.charCodeAt(p-2);if(_!==v)break;g--,p--}(g>1||p>1)&&this._pushTrimWhitespaceCharChange(s,o+1,1,g,r+1,1,p)}{let g=bT(h,1),p=bT(f,1);const _=h.length+1,v=f.length+1;for(;g<_&&p!0;const e=Date.now();return()=>Date.now()-e{i.push(fn.fromOffsetPairs(s?s.getEndExclusives():Wa.zero,o?o.getStarts():new Wa(t,(s?s.seq2Range.endExclusive-s.seq1Range.endExclusive:0)+t)))}),i}static fromOffsetPairs(e,t){return new fn(new Ye(e.offset1,t.offset1),new Ye(e.offset2,t.offset2))}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new fn(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new fn(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new fn(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new fn(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new fn(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersect(e){const t=this.seq1Range.intersect(e.seq1Range),i=this.seq2Range.intersect(e.seq2Range);if(!(!t||!i))return new fn(t,i)}getStarts(){return new Wa(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new Wa(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}class Wa{constructor(e,t){this.offset1=e,this.offset2=t}toString(){return`${this.offset1} <-> ${this.offset2}`}}Wa.zero=new Wa(0,0);Wa.max=new Wa(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);class Zb{isValid(){return!0}}Zb.instance=new Zb;class u_e{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new Gi("timeout must be positive")}isValid(){if(!(Date.now()-this.startTime0&&p>0&&r.get(g-1,p-1)===3&&(b+=a.get(g-1,p-1)),b+=s?s(g,p):1):b=-1;const y=Math.max(_,v,b);if(y===b){const w=g>0&&p>0?a.get(g-1,p-1):0;a.set(g,p,w+1),r.set(g,p,3)}else y===_?(a.set(g,p,0),r.set(g,p,1)):y===v&&(a.set(g,p,0),r.set(g,p,2));o.set(g,p,y)}const l=[];let c=e.length,d=t.length;function u(g,p){(g+1!==c||p+1!==d)&&l.push(new fn(new Ye(g+1,c),new Ye(p+1,d))),c=g,d=p}let h=e.length-1,f=t.length-1;for(;h>=0&&f>=0;)r.get(h,f)===3?(u(h,f),h--,f--):r.get(h,f)===1?h--:f--;return u(-1,-1),l.reverse(),new rc(l,!1)}}class Ij{compute(e,t,i=Zb.instance){if(e.length===0||t.length===0)return rc.trivial(e,t);const s=e,o=t;function r(p,_){for(;ps.length||w>o.length)continue;const C=r(y,w);l.set(d,C);const L=y===v?c.get(d+1):c.get(d-1);if(c.set(d,C!==y?new W9(L,y,w,C-y):L),l.get(d)===s.length&&l.get(d)-d===o.length)break e}}let u=c.get(d);const h=[];let f=s.length,g=o.length;for(;;){const p=u?u.x+u.length:0,_=u?u.y+u.length:0;if((p!==f||_!==g)&&h.push(new fn(new Ye(p,f),new Ye(_,g))),!u)break;f=u.x,g=u.y,u=u.prev}return h.reverse(),new rc(h,!1)}}class W9{constructor(e,t,i,s){this.prev=e,this.x=t,this.y=i,this.length=s}}class f_e{constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){if(e<0){if(e=-e-1,e>=this.negativeArr.length){const i=this.negativeArr;this.negativeArr=new Int32Array(i.length*2),this.negativeArr.set(i)}this.negativeArr[e]=t}else{if(e>=this.positiveArr.length){const i=this.positiveArr;this.positiveArr=new Int32Array(i.length*2),this.positiveArr.set(i)}this.positiveArr[e]=t}}}class g_e{constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){e<0?(e=-e-1,this.negativeArr[e]=t):this.positiveArr[e]=t}}var V9,z9;class p_e{constructor(e,t){this.uri=e,this.value=t}}function m_e(n){return Array.isArray(n)}class Tn{constructor(e,t){if(this[V9]="ResourceMap",e instanceof Tn)this.map=new Map(e.map),this.toKey=t??Tn.defaultToKey;else if(m_e(e)){this.map=new Map,this.toKey=t??Tn.defaultToKey;for(const[i,s]of e)this.set(i,s)}else this.map=new Map,this.toKey=e??Tn.defaultToKey}set(e,t){return this.map.set(this.toKey(e),new p_e(e,t)),this}get(e){var t;return(t=this.map.get(this.toKey(e)))===null||t===void 0?void 0:t.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,t){typeof t<"u"&&(e=e.bind(t));for(const[i,s]of this.map)e(s.value,s.uri,this)}*values(){for(const e of this.map.values())yield e.value}*keys(){for(const e of this.map.values())yield e.uri}*entries(){for(const e of this.map.values())yield[e.uri,e.value]}*[(V9=Symbol.toStringTag,Symbol.iterator)](){for(const[,e]of this.map)yield[e.uri,e.value]}}Tn.defaultToKey=n=>n.toString();class __e{constructor(){this[z9]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var e;return(e=this._head)===null||e===void 0?void 0:e.value}get last(){var e;return(e=this._tail)===null||e===void 0?void 0:e.value}has(e){return this._map.has(e)}get(e,t=0){const i=this._map.get(e);if(i)return t!==0&&this.touch(i,t),i.value}set(e,t,i=0){let s=this._map.get(e);if(s)s.value=t,i!==0&&this.touch(s,i);else{switch(s={key:e,value:t,next:void 0,previous:void 0},i){case 0:this.addItemLast(s);break;case 1:this.addItemFirst(s);break;case 2:this.addItemLast(s);break;default:this.addItemLast(s);break}this._map.set(e,s),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){const i=this._state;let s=this._head;for(;s;){if(t?e.bind(t)(s.value,s.key,this):e(s.value,s.key,this),this._state!==i)throw new Error("LinkedMap got modified during iteration.");s=s.next}}keys(){const e=this,t=this._state;let i=this._head;const s={[Symbol.iterator](){return s},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const o={value:i.key,done:!1};return i=i.next,o}else return{value:void 0,done:!0}}};return s}values(){const e=this,t=this._state;let i=this._head;const s={[Symbol.iterator](){return s},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const o={value:i.value,done:!1};return i=i.next,o}else return{value:void 0,done:!0}}};return s}entries(){const e=this,t=this._state;let i=this._head;const s={[Symbol.iterator](){return s},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const o={value:[i.key,i.value],done:!1};return i=i.next,o}else return{value:void 0,done:!0}}};return s}[(z9=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.next,i--;this._head=t,this._size=i,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const t=e.next,i=e.previous;if(!t||!i)throw new Error("Invalid list");t.previous=i,i.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(t!==1&&t!==2)){if(t===1){if(e===this._head)return;const i=e.next,s=e.previous;e===this._tail?(s.next=void 0,this._tail=s):(i.previous=s,s.next=i),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===2){if(e===this._tail)return;const i=e.next,s=e.previous;e===this._head?(i.previous=void 0,this._head=i):(i.previous=s,s.next=i),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){const e=[];return this.forEach((t,i)=>{e.push([i,t])}),e}fromJSON(e){this.clear();for(const[t,i]of e)this.set(t,i)}}class oP extends __e{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get(e,t=2){return super.get(e,t)}peek(e){return super.get(e,0)}set(e,t){return super.set(e,t,2),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}class b_e{constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(const[t,i]of e)this.set(t,i)}clear(){this._m1.clear(),this._m2.clear()}set(e,t){this._m1.set(e,t),this._m2.set(t,e)}get(e){return this._m1.get(e)}getKey(e){return this._m2.get(e)}delete(e){const t=this._m1.get(e);return t===void 0?!1:(this._m1.delete(e),this._m2.delete(t),!0)}keys(){return this._m1.keys()}values(){return this._m1.values()}}class Tj{constructor(){this.map=new Map}add(e,t){let i=this.map.get(e);i||(i=new Set,this.map.set(e,i)),i.add(t)}delete(e,t){const i=this.map.get(e);i&&(i.delete(t),i.size===0&&this.map.delete(e))}forEach(e,t){const i=this.map.get(e);i&&i.forEach(t)}get(e){const t=this.map.get(e);return t||new Set}}class WS{constructor(e,t,i){this.lines=e,this.considerWhitespaceChanges=i,this.elements=[],this.firstCharOffsetByLine=[],this.additionalOffsetByLine=[];let s=!1;t.start>0&&t.endExclusive>=e.length&&(t=new Ye(t.start-1,t.endExclusive),s=!0),this.lineRange=t,this.firstCharOffsetByLine[0]=0;for(let o=this.lineRange.start;oString.fromCharCode(t)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const t=$9(e>0?this.elements[e-1]:-1),i=$9(ei<=e);return new V(this.lineRange.start+t+1,e-this.firstCharOffsetByLine[t]+this.additionalOffsetByLine[t]+1)}translateRange(e){return N.fromPositions(this.translateOffset(e.start),this.translateOffset(e.endExclusive))}findWordContaining(e){if(e<0||e>=this.elements.length||!S2(this.elements[e]))return;let t=e;for(;t>0&&S2(this.elements[t-1]);)t--;let i=e;for(;ir<=e.start))!==null&&t!==void 0?t:0,o=(i=t_e(this.firstCharOffsetByLine,r=>e.endExclusive<=r))!==null&&i!==void 0?i:this.elements.length;return new Ye(s,o)}}function S2(n){return n>=97&&n<=122||n>=65&&n<=90||n>=48&&n<=57}const v_e={0:0,1:0,2:0,3:10,4:2,5:3,6:10,7:10};function H9(n){return v_e[n]}function $9(n){return n===10?7:n===13?6:vT(n)?5:n>=97&&n<=122?0:n>=65&&n<=90?1:n>=48&&n<=57?2:n===-1?3:4}function y_e(n,e,t,i,s,o){let{moves:r,excludedChanges:a}=w_e(n,e,t,o);if(!o.isValid())return[];const l=n.filter(d=>!a.has(d)),c=C_e(l,i,s,e,t,o);return tI(r,c),r=S_e(r),r=r.filter(d=>d.original.toOffsetRange().slice(e).map(h=>h.trim()).join(` -`).length>=10),r=x_e(n,r),r}function w_e(n,e,t,i){const s=[],o=n.filter(l=>l.modified.isEmpty&&l.original.length>=3).map(l=>new Sm(l.original,e,l)),r=new Set(n.filter(l=>l.original.isEmpty&&l.modified.length>=3).map(l=>new Sm(l.modified,t,l))),a=new Set;for(const l of o){let c=-1,d;for(const u of r){const h=l.computeSimilarity(u);h>c&&(c=h,d=u)}if(c>.9&&d&&(r.delete(d),s.push(new nl(l.range,d.range)),a.add(l.source),a.add(d.source)),!i.isValid())return{moves:s,excludedChanges:a}}return{moves:s,excludedChanges:a}}function C_e(n,e,t,i,s,o){const r=[],a=new Tj;for(const h of n)for(let f=h.original.startLineNumber;fh.modified.startLineNumber,Ld));for(const h of n){let f=[];for(let g=h.modified.startLineNumber;g{for(const w of f)if(w.originalLineRange.endLineNumberExclusive+1===b.endLineNumberExclusive&&w.modifiedLineRange.endLineNumberExclusive+1===_.endLineNumberExclusive){w.originalLineRange=new Qe(w.originalLineRange.startLineNumber,b.endLineNumberExclusive),w.modifiedLineRange=new Qe(w.modifiedLineRange.startLineNumber,_.endLineNumberExclusive),v.push(w);return}const y={modifiedLineRange:_,originalLineRange:b};l.push(y),v.push(y)}),f=v}if(!o.isValid())return[]}l.sort(tU(mr(h=>h.modifiedLineRange.length,Ld)));const c=new Ta,d=new Ta;for(const h of l){const f=h.modifiedLineRange.startLineNumber-h.originalLineRange.startLineNumber,g=c.subtractFrom(h.modifiedLineRange),p=d.subtractFrom(h.originalLineRange).getWithDelta(f),_=g.getIntersection(p);for(const v of _.ranges){if(v.length<3)continue;const b=v,y=v.delta(-f);r.push(new nl(y,b)),c.addRange(b),d.addRange(y)}}r.sort(mr(h=>h.original.startLineNumber,Ld));const u=new Y1(n);for(let h=0;hL.original.startLineNumber<=f.original.startLineNumber),p=Gb(n,L=>L.modified.startLineNumber<=f.modified.startLineNumber),_=Math.max(f.original.startLineNumber-g.original.startLineNumber,f.modified.startLineNumber-p.modified.startLineNumber),v=u.findLastMonotonous(L=>L.original.startLineNumberL.modified.startLineNumberi.length||x>s.length||c.contains(x)||d.contains(L)||!U9(i[L-1],s[x-1],o))break}w>0&&(d.addRange(new Qe(f.original.startLineNumber-w,f.original.startLineNumber)),c.addRange(new Qe(f.modified.startLineNumber-w,f.modified.startLineNumber)));let C;for(C=0;Ci.length||x>s.length||c.contains(x)||d.contains(L)||!U9(i[L-1],s[x-1],o))break}C>0&&(d.addRange(new Qe(f.original.endLineNumberExclusive,f.original.endLineNumberExclusive+C)),c.addRange(new Qe(f.modified.endLineNumberExclusive,f.modified.endLineNumberExclusive+C))),(w>0||C>0)&&(r[h]=new nl(new Qe(f.original.startLineNumber-w,f.original.endLineNumberExclusive+C),new Qe(f.modified.startLineNumber-w,f.modified.endLineNumberExclusive+C)))}return r}function U9(n,e,t){if(n.trim()===e.trim())return!0;if(n.length>300&&e.length>300)return!1;const s=new Ij().compute(new WS([n],new Ye(0,1),!1),new WS([e],new Ye(0,1),!1),t);let o=0;const r=fn.invert(s.diffs,n.length);for(const d of r)d.seq1Range.forEach(u=>{vT(n.charCodeAt(u))||o++});function a(d){let u=0;for(let h=0;he.length?n:e);return o/l>.6&&l>10}function S_e(n){if(n.length===0)return n;n.sort(mr(t=>t.original.startLineNumber,Ld));const e=[n[0]];for(let t=1;t=0&&r>=0&&o+r<=2){e[e.length-1]=i.join(s);continue}e.push(s)}return e}function x_e(n,e){const t=new Y1(n);return e=e.filter(i=>{const s=t.findLastMonotonous(a=>a.original.endLineNumberExclusivea.modified.endLineNumberExclusive0&&(a=a.delta(c))}s.push(a)}return i.length>0&&s.push(i[i.length-1]),s}function D_e(n,e,t){if(!n.getBoundaryScore||!e.getBoundaryScore)return t;for(let i=0;i0?t[i-1]:void 0,o=t[i],r=i+1=i.start&&n.seq2Range.start-r>=s.start&&t.isStronglyEqual(n.seq2Range.start-r,n.seq2Range.endExclusive-r)&&r<100;)r++;r--;let a=0;for(;n.seq1Range.start+ac&&(c=g,l=d)}return n.delta(l)}function k_e(n,e,t){const i=[];for(const s of t){const o=i[i.length-1];if(!o){i.push(s);continue}s.seq1Range.start-o.seq1Range.endExclusive<=2||s.seq2Range.start-o.seq2Range.endExclusive<=2?i[i.length-1]=new fn(o.seq1Range.join(s.seq1Range),o.seq2Range.join(s.seq2Range)):i.push(s)}return i}function E_e(n,e,t){const i=[];let s;function o(){if(!s)return;const a=s.s1Range.length-s.deleted;s.s2Range.length-s.added,Math.max(s.deleted,s.added)+(s.count-1)>a&&i.push(new fn(s.s1Range,s.s2Range)),s=void 0}for(const a of t){let l=function(f,g){var p,_,v,b;if(!s||!s.s1Range.containsRange(f)||!s.s2Range.containsRange(g))if(s&&!(s.s1Range.endExclusive0||e.length>0;){const i=n[0],s=e[0];let o;i&&(!s||i.seq1Range.start0&&t[t.length-1].seq1Range.endExclusive>=o.seq1Range.start?t[t.length-1]=t[t.length-1].join(o):t.push(o)}return t}function I_e(n,e,t){let i=t;if(i.length===0)return i;let s=0,o;do{o=!1;const r=[i[0]];for(let a=1;a5||f.seq1Range.length+f.seq2Range.length>5)};const l=i[a],c=r[r.length-1];d(c,l)?(o=!0,r[r.length-1]=r[r.length-1].join(l)):r.push(l)}i=r}while(s++<10&&o);return i}function T_e(n,e,t){let i=t;if(i.length===0)return i;let s=0,o;do{o=!1;const a=[i[0]];for(let l=1;l5||p.length>500)return!1;const v=n.getText(p).trim();if(v.length>20||v.split(/\r\n|\r|\n/).length>1)return!1;const b=n.countLinesIn(f.seq1Range),y=f.seq1Range.length,w=e.countLinesIn(f.seq2Range),C=f.seq2Range.length,L=n.countLinesIn(g.seq1Range),x=g.seq1Range.length,D=e.countLinesIn(g.seq2Range),k=g.seq2Range.length,P=2*40+50;function O(M){return Math.min(M,P)}return Math.pow(Math.pow(O(b*40+y),1.5)+Math.pow(O(w*40+C),1.5),1.5)+Math.pow(Math.pow(O(L*40+x),1.5)+Math.pow(O(D*40+k),1.5),1.5)>Math.pow(Math.pow(P,1.5),1.5)*1.3};const c=i[l],d=a[a.length-1];u(d,c)?(o=!0,a[a.length-1]=a[a.length-1].join(c)):a.push(c)}i=a}while(s++<10&&o);const r=[];return Phe(i,(a,l,c)=>{let d=l;function u(v){return v.length>0&&v.trim().length<=3&&l.seq1Range.length+l.seq2Range.length>100}const h=n.extendToFullLines(l.seq1Range),f=n.getText(new Ye(h.start,l.seq1Range.start));u(f)&&(d=d.deltaStart(-f.length));const g=n.getText(new Ye(l.seq1Range.endExclusive,h.endExclusive));u(g)&&(d=d.deltaEnd(g.length));const p=fn.fromOffsetPairs(a?a.getEndExclusives():Wa.zero,c?c.getStarts():Wa.max),_=d.intersect(p);r.push(_)}),r}class q9{constructor(e,t){this.trimmedHash=e,this.lines=t}getElement(e){return this.trimmedHash[e]}get length(){return this.trimmedHash.length}getBoundaryScore(e){const t=e===0?0:G9(this.lines[e-1]),i=e===this.lines.length?0:G9(this.lines[e]);return 1e3-(t+i)}getText(e){return this.lines.slice(e.start,e.endExclusive).join(` -`)}isStronglyEqual(e,t){return this.lines[e]===this.lines[t]}}function G9(n){let e=0;for(;eC===L))return new _C([],[],!1);if(e.length===1&&e[0].length===0||t.length===1&&t[0].length===0)return new _C([new Ko(new Qe(1,e.length+1),new Qe(1,t.length+1),[new su(new N(1,1,e.length,e[0].length+1),new N(1,1,t.length,t[0].length+1))])],[],!1);const s=i.maxComputationTimeMs===0?Zb.instance:new u_e(i.maxComputationTimeMs),o=!i.ignoreTrimWhitespace,r=new Map;function a(C){let L=r.get(C);return L===void 0&&(L=r.size,r.set(C,L)),L}const l=e.map(C=>a(C.trim())),c=t.map(C=>a(C.trim())),d=new q9(l,e),u=new q9(c,t),h=d.length+u.length<1700?this.dynamicProgrammingDiffing.compute(d,u,s,(C,L)=>e[C]===t[L]?t[L].length===0?.1:1+Math.log(1+t[L].length):.99):this.myersDiffingAlgorithm.compute(d,u);let f=h.diffs,g=h.hitTimeout;f=yT(d,u,f),f=I_e(d,u,f);const p=[],_=C=>{if(o)for(let L=0;LC.seq1Range.start-v===C.seq2Range.start-b);const L=C.seq1Range.start-v;_(L),v=C.seq1Range.endExclusive,b=C.seq2Range.endExclusive;const x=this.refineDiff(e,t,C,s,o);x.hitTimeout&&(g=!0);for(const D of x.mappings)p.push(D)}_(e.length-v);const y=K9(p,e,t);let w=[];return i.computeMoves&&(w=this.computeMoves(y,e,t,l,c,s,o)),Hb(()=>{function C(x,D){if(x.lineNumber<1||x.lineNumber>D.length)return!1;const k=D[x.lineNumber-1];return!(x.column<1||x.column>k.length+1)}function L(x,D){return!(x.startLineNumber<1||x.startLineNumber>D.length+1||x.endLineNumberExclusive<1||x.endLineNumberExclusive>D.length+1)}for(const x of y){if(!x.innerChanges)return!1;for(const D of x.innerChanges)if(!(C(D.modifiedRange.getStartPosition(),t)&&C(D.modifiedRange.getEndPosition(),t)&&C(D.originalRange.getStartPosition(),e)&&C(D.originalRange.getEndPosition(),e)))return!1;if(!L(x.modified,t)||!L(x.original,e))return!1}return!0}),new _C(y,w,g)}computeMoves(e,t,i,s,o,r,a){return y_e(e,t,i,s,o,r).map(d=>{const u=this.refineDiff(t,i,new fn(d.original.toOffsetRange(),d.modified.toOffsetRange()),r,a),h=K9(u.mappings,t,i,!0);return new Ej(d,h)})}refineDiff(e,t,i,s,o){const r=new WS(e,i.seq1Range,o),a=new WS(t,i.seq2Range,o),l=r.length+a.length<500?this.dynamicProgrammingDiffing.compute(r,a,s):this.myersDiffingAlgorithm.compute(r,a,s);let c=l.diffs;return c=yT(r,a,c),c=E_e(r,a,c),c=k_e(r,a,c),c=T_e(r,a,c),{mappings:c.map(u=>new su(r.translateRange(u.seq1Range),a.translateRange(u.seq2Range))),hitTimeout:l.hitTimeout}}}function K9(n,e,t,i=!1){const s=[];for(const o of Z$(n.map(r=>N_e(r,e,t)),(r,a)=>r.original.overlapOrTouch(a.original)||r.modified.overlapOrTouch(a.modified))){const r=o[0],a=o[o.length-1];s.push(new Ko(r.original.join(a.original),r.modified.join(a.modified),o.map(l=>l.innerChanges[0])))}return Hb(()=>!i&&s.length>0&&s[0].original.startLineNumber!==s[0].modified.startLineNumber?!1:VU(s,(o,r)=>r.original.startLineNumber-o.original.endLineNumberExclusive===r.modified.startLineNumber-o.modified.endLineNumberExclusive&&o.original.endLineNumberExclusive=t[n.modifiedRange.startLineNumber-1].length&&n.originalRange.startColumn-1>=e[n.originalRange.startLineNumber-1].length&&n.originalRange.startLineNumber<=n.originalRange.endLineNumber+s&&n.modifiedRange.startLineNumber<=n.modifiedRange.endLineNumber+s&&(i=1);const o=new Qe(n.originalRange.startLineNumber+i,n.originalRange.endLineNumber+1+s),r=new Qe(n.modifiedRange.startLineNumber+i,n.modifiedRange.endLineNumber+1+s);return new Ko(o,r,[n])}const Y9={getLegacy:()=>new a_e,getDefault:()=>new Nj};function Ad(n,e){const t=Math.pow(10,e);return Math.round(n*t)/t}class ft{constructor(e,t,i,s=1){this._rgbaBrand=void 0,this.r=Math.min(255,Math.max(0,e))|0,this.g=Math.min(255,Math.max(0,t))|0,this.b=Math.min(255,Math.max(0,i))|0,this.a=Ad(Math.max(Math.min(1,s),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}}class ar{constructor(e,t,i,s){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=Ad(Math.max(Math.min(1,t),0),3),this.l=Ad(Math.max(Math.min(1,i),0),3),this.a=Ad(Math.max(Math.min(1,s),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.l===t.l&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,s=e.b/255,o=e.a,r=Math.max(t,i,s),a=Math.min(t,i,s);let l=0,c=0;const d=(a+r)/2,u=r-a;if(u>0){switch(c=Math.min(d<=.5?u/(2*d):u/(2-2*d),1),r){case t:l=(i-s)/u+(i1&&(i-=1),i<1/6?e+(t-e)*6*i:i<1/2?t:i<2/3?e+(t-e)*(2/3-i)*6:e}static toRGBA(e){const t=e.h/360,{s:i,l:s,a:o}=e;let r,a,l;if(i===0)r=a=l=s;else{const c=s<.5?s*(1+i):s+i-s*i,d=2*s-c;r=ar._hue2rgb(d,c,t+1/3),a=ar._hue2rgb(d,c,t),l=ar._hue2rgb(d,c,t-1/3)}return new ft(Math.round(r*255),Math.round(a*255),Math.round(l*255),o)}}class zg{constructor(e,t,i,s){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=Ad(Math.max(Math.min(1,t),0),3),this.v=Ad(Math.max(Math.min(1,i),0),3),this.a=Ad(Math.max(Math.min(1,s),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.v===t.v&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,s=e.b/255,o=Math.max(t,i,s),r=Math.min(t,i,s),a=o-r,l=o===0?0:a/o;let c;return a===0?c=0:o===t?c=((i-s)/a%6+6)%6:o===i?c=(s-t)/a+2:c=(t-i)/a+4,new zg(Math.round(c*60),l,o,e.a)}static toRGBA(e){const{h:t,s:i,v:s,a:o}=e,r=s*i,a=r*(1-Math.abs(t/60%2-1)),l=s-r;let[c,d,u]=[0,0,0];return t<60?(c=r,d=a):t<120?(c=a,d=r):t<180?(d=r,u=a):t<240?(d=a,u=r):t<300?(c=a,u=r):t<=360&&(c=r,u=a),c=Math.round((c+l)*255),d=Math.round((d+l)*255),u=Math.round((u+l)*255),new ft(c,d,u,o)}}class H{static fromHex(e){return H.Format.CSS.parseHex(e)||H.red}static equals(e,t){return!e&&!t?!0:!e||!t?!1:e.equals(t)}get hsla(){return this._hsla?this._hsla:ar.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:zg.fromRGBA(this.rgba)}constructor(e){if(e)if(e instanceof ft)this.rgba=e;else if(e instanceof ar)this._hsla=e,this.rgba=ar.toRGBA(e);else if(e instanceof zg)this._hsva=e,this.rgba=zg.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(e){return!!e&&ft.equals(this.rgba,e.rgba)&&ar.equals(this.hsla,e.hsla)&&zg.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=H._relativeLuminanceForComponent(this.rgba.r),t=H._relativeLuminanceForComponent(this.rgba.g),i=H._relativeLuminanceForComponent(this.rgba.b),s=.2126*e+.7152*t+.0722*i;return Ad(s,4)}static _relativeLuminanceForComponent(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}isLighter(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3>=128}isLighterThan(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t>i}isDarkerThan(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t0)for(const s of i){const o=s.filter(c=>c!==void 0),r=o[1],a=o[2];if(!a)continue;let l;if(r==="rgb"){const c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm;l=Z9(E0(n,s),A0(a,c),!1)}else if(r==="rgba"){const c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;l=Z9(E0(n,s),A0(a,c),!0)}else if(r==="hsl"){const c=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm;l=X9(E0(n,s),A0(a,c),!1)}else if(r==="hsla"){const c=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;l=X9(E0(n,s),A0(a,c),!0)}else r==="#"&&(l=R_e(E0(n,s),r+a));l&&e.push(l)}return e}function P_e(n){return!n||typeof n.getValue!="function"||typeof n.positionAt!="function"?[]:M_e(n)}var Pc=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,[])).next())})};class O_e extends O0e{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}findMatches(e){const t=[];for(let i=0;ithis._lines.length)t=this._lines.length,i=this._lines[t-1].length+1,s=!0;else{const o=this._lines[t-1].length+1;i<1?(i=1,s=!0):i>o&&(i=o,s=!0)}return s?{lineNumber:t,column:i}:e}}class Id{constructor(e,t){this._host=e,this._models=Object.create(null),this._foreignModuleFactory=t,this._foreignModule=null}dispose(){this._models=Object.create(null)}_getModel(e){return this._models[e]}_getModels(){const e=[];return Object.keys(this._models).forEach(t=>e.push(this._models[t])),e}acceptNewModel(e){this._models[e.url]=new O_e(je.parse(e.url),e.lines,e.EOL,e.versionId)}acceptModelChanged(e,t){if(!this._models[e])return;this._models[e].onEvents(t)}acceptRemovedModel(e){this._models[e]&&delete this._models[e]}computeUnicodeHighlights(e,t,i){return Pc(this,void 0,void 0,function*(){const s=this._getModel(e);return s?Q0e.computeUnicodeHighlights(s,t,i):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}})}computeDiff(e,t,i,s){return Pc(this,void 0,void 0,function*(){const o=this._getModel(e),r=this._getModel(t);return!o||!r?null:Id.computeDiff(o,r,i,s)})}static computeDiff(e,t,i,s){const o=s==="advanced"?Y9.getDefault():Y9.getLegacy(),r=e.getLinesContent(),a=t.getLinesContent(),l=o.computeDiff(r,a,i),c=l.changes.length>0?!1:this._modelsAreIdentical(e,t);function d(u){return u.map(h=>{var f;return[h.original.startLineNumber,h.original.endLineNumberExclusive,h.modified.startLineNumber,h.modified.endLineNumberExclusive,(f=h.innerChanges)===null||f===void 0?void 0:f.map(g=>[g.originalRange.startLineNumber,g.originalRange.startColumn,g.originalRange.endLineNumber,g.originalRange.endColumn,g.modifiedRange.startLineNumber,g.modifiedRange.startColumn,g.modifiedRange.endLineNumber,g.modifiedRange.endColumn])]})}return{identical:c,quitEarly:l.hitTimeout,changes:d(l.changes),moves:l.moves.map(u=>[u.lineRangeMapping.original.startLineNumber,u.lineRangeMapping.original.endLineNumberExclusive,u.lineRangeMapping.modified.startLineNumber,u.lineRangeMapping.modified.endLineNumberExclusive,d(u.changes)])}}static _modelsAreIdentical(e,t){const i=e.getLineCount(),s=t.getLineCount();if(i!==s)return!1;for(let o=1;o<=i;o++){const r=e.getLineContent(o),a=t.getLineContent(o);if(r!==a)return!1}return!0}computeMoreMinimalEdits(e,t,i){return Pc(this,void 0,void 0,function*(){const s=this._getModel(e);if(!s)return t;const o=[];let r;t=t.slice(0).sort((l,c)=>{if(l.range&&c.range)return N.compareRangesUsingStarts(l.range,c.range);const d=l.range?0:1,u=c.range?0:1;return d-u});let a=0;for(let l=1;lId._diffLimit){o.push({range:l,text:c});continue}const h=R0e(u,c,i),f=s.offsetAt(N.lift(l).getStartPosition());for(const g of h){const p=s.positionAt(f+g.originalStart),_=s.positionAt(f+g.originalStart+g.originalLength),v={text:c.substr(g.modifiedStart,g.modifiedLength),range:{startLineNumber:p.lineNumber,startColumn:p.column,endLineNumber:_.lineNumber,endColumn:_.column}};s.getValueInRange(v.range)!==v.text&&o.push(v)}}return typeof r=="number"&&o.push({eol:r,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),o})}computeLinks(e){return Pc(this,void 0,void 0,function*(){const t=this._getModel(e);return t?z0e(t):null})}computeDefaultDocumentColors(e){return Pc(this,void 0,void 0,function*(){const t=this._getModel(e);return t?P_e(t):null})}textualSuggest(e,t,i,s){return Pc(this,void 0,void 0,function*(){const o=new Cu,r=new RegExp(i,s),a=new Set;e:for(const l of e){const c=this._getModel(l);if(c){for(const d of c.words(r))if(!(d===t||!isNaN(Number(d)))&&(a.add(d),a.size>Id._suggestionsLimit))break e}}return{words:Array.from(a),duration:o.elapsed()}})}computeWordRanges(e,t,i,s){return Pc(this,void 0,void 0,function*(){const o=this._getModel(e);if(!o)return Object.create(null);const r=new RegExp(i,s),a=Object.create(null);for(let l=t.startLineNumber;lthis._host.fhr(a,l)),getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(r,t),Promise.resolve(D4(this._foreignModule))):Promise.reject(new Error("Unexpected usage"))}fmr(e,t){if(!this._foreignModule||typeof this._foreignModule[e]!="function")return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._foreignModule[e].apply(this._foreignModule,t))}catch(i){return Promise.reject(i)}}}Id._diffLimit=1e5;Id._suggestionsLimit=1e4;typeof importScripts=="function"&&(globalThis.monaco=EU());const Mj=at("textResourceConfigurationService"),Pj=at("textResourcePropertiesService"),nt=at("ILanguageFeaturesService");var F_e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},I0=function(n,e){return function(t,i){e(t,i,n)}},VS=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const Q9=60*1e3,J9=5*60*1e3;function lh(n,e){const t=n.getModel(e);return!(!t||t.isTooLargeForSyncing())}let wT=class extends Y{constructor(e,t,i,s,o){super(),this._modelService=e,this._workerManager=this._register(new W_e(this._modelService,s)),this._logService=i,this._register(o.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(r,a)=>lh(this._modelService,r.uri)?this._workerManager.withWorker().then(l=>l.computeLinks(r.uri)).then(l=>l&&{links:l}):Promise.resolve({links:[]})})),this._register(o.completionProvider.register("*",new B_e(this._workerManager,t,this._modelService,s)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return lh(this._modelService,e)}computedUnicodeHighlights(e,t,i){return this._workerManager.withWorker().then(s=>s.computedUnicodeHighlights(e,t,i))}computeDiff(e,t,i,s){return VS(this,void 0,void 0,function*(){const o=yield this._workerManager.withWorker().then(l=>l.computeDiff(e,t,i,s));if(!o)return null;return{identical:o.identical,quitEarly:o.quitEarly,changes:a(o.changes),moves:o.moves.map(l=>new Ej(new nl(new Qe(l[0],l[1]),new Qe(l[2],l[3])),a(l[4])))};function a(l){return l.map(c=>{var d;return new Ko(new Qe(c[0],c[1]),new Qe(c[2],c[3]),(d=c[4])===null||d===void 0?void 0:d.map(u=>new su(new N(u[0],u[1],u[2],u[3]),new N(u[4],u[5],u[6],u[7]))))})}})}computeMoreMinimalEdits(e,t,i=!1){if(sc(t)){if(!lh(this._modelService,e))return Promise.resolve(t);const s=Cu.create(),o=this._workerManager.withWorker().then(r=>r.computeMoreMinimalEdits(e,t,i));return o.finally(()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),s.elapsed())),Promise.race([o,jb(1e3).then(()=>t)])}else return Promise.resolve(void 0)}canNavigateValueSet(e){return lh(this._modelService,e)}navigateValueSet(e,t,i){return this._workerManager.withWorker().then(s=>s.navigateValueSet(e,t,i))}canComputeWordRanges(e){return lh(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then(i=>i.computeWordRanges(e,t))}};wT=F_e([I0(0,fs),I0(1,Mj),I0(2,Sc),I0(3,ao),I0(4,nt)],wT);class B_e{constructor(e,t,i,s){this.languageConfigurationService=s,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=i}provideCompletionItems(e,t){return VS(this,void 0,void 0,function*(){const i=this._configurationService.getValue(e.uri,t,"editor");if(!i.wordBasedSuggestions)return;const s=[];if(i.wordBasedSuggestionsMode==="currentDocument")lh(this._modelService,e.uri)&&s.push(e.uri);else for(const u of this._modelService.getModels())lh(this._modelService,u.uri)&&(u===e?s.unshift(u.uri):(i.wordBasedSuggestionsMode==="allDocuments"||u.getLanguageId()===e.getLanguageId())&&s.push(u.uri));if(s.length===0)return;const o=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),r=e.getWordAtPosition(t),a=r?new N(t.lineNumber,r.startColumn,t.lineNumber,r.endColumn):N.fromPositions(t),l=a.setEndPosition(t.lineNumber,t.column),d=yield(yield this._workerManager.withWorker()).textualSuggest(s,r==null?void 0:r.word,o);if(d)return{duration:d.duration,suggestions:d.words.map(u=>({kind:18,label:u,insertText:u,range:{insert:l,replace:a}}))}})}}class W_e extends Y{constructor(e,t){super(),this.languageConfigurationService=t,this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=new Date().getTime(),this._register(new G1).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(J9/2)),this._register(this._modelService.onModelRemoved(s=>this._checkStopEmptyWorker()))}dispose(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),super.dispose()}_checkStopEmptyWorker(){if(!this._editorWorkerClient)return;this._modelService.getModels().length===0&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}_checkStopIdleWorker(){if(!this._editorWorkerClient)return;new Date().getTime()-this._lastWorkerUsedTime>J9&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=new Date().getTime(),this._editorWorkerClient||(this._editorWorkerClient=new Oj(this._modelService,!1,"editorWorkerService",this.languageConfigurationService)),Promise.resolve(this._editorWorkerClient)}}class V_e extends Y{constructor(e,t,i){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!i){const s=new G1;s.cancelAndSet(()=>this._checkStopModelSync(),Math.round(Q9/2)),this._register(s)}}dispose(){for(const e in this._syncedModels)Bt(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t){for(const i of e){const s=i.toString();this._syncedModels[s]||this._beginModelSync(i,t),this._syncedModels[s]&&(this._syncedModelsLastUsedTime[s]=new Date().getTime())}}_checkStopModelSync(){const e=new Date().getTime(),t=[];for(const i in this._syncedModelsLastUsedTime)e-this._syncedModelsLastUsedTime[i]>Q9&&t.push(i);for(const i of t)this._stopModelSync(i)}_beginModelSync(e,t){const i=this._modelService.getModel(e);if(!i||!t&&i.isTooLargeForSyncing())return;const s=e.toString();this._proxy.acceptNewModel({url:i.uri.toString(),lines:i.getLinesContent(),EOL:i.getEOL(),versionId:i.getVersionId()});const o=new pe;o.add(i.onDidChangeContent(r=>{this._proxy.acceptModelChanged(s.toString(),r)})),o.add(i.onWillDispose(()=>{this._stopModelSync(s)})),o.add(Ze(()=>{this._proxy.acceptRemovedModel(s)})),this._syncedModels[s]=o}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],Bt(t)}}class e7{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class x2{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class Oj extends Y{constructor(e,t,i,s){super(),this.languageConfigurationService=s,this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new oD(i),this._worker=null,this._modelManager=null}fhr(e,t){throw new Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{this._worker=this._register(new zme(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new x2(this)))}catch(e){uT(e),this._worker=new e7(new Id(new x2(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,e=>(uT(e),this._worker=new e7(new Id(new x2(this),null)),this._getOrCreateWorker().getProxyObject()))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new V_e(e,this._modelService,this._keepIdleModels))),this._modelManager}_withSyncedResources(e,t=!1){return VS(this,void 0,void 0,function*(){return this._disposed?Promise.reject(Yfe()):this._getProxy().then(i=>(this._getOrCreateModelManager(i).ensureSyncedResources(e,t),i))})}computedUnicodeHighlights(e,t,i){return this._withSyncedResources([e]).then(s=>s.computeUnicodeHighlights(e.toString(),t,i))}computeDiff(e,t,i,s){return this._withSyncedResources([e,t],!0).then(o=>o.computeDiff(e.toString(),t.toString(),i,s))}computeMoreMinimalEdits(e,t,i){return this._withSyncedResources([e]).then(s=>s.computeMoreMinimalEdits(e.toString(),t,i))}computeLinks(e){return this._withSyncedResources([e]).then(t=>t.computeLinks(e.toString()))}computeDefaultDocumentColors(e){return this._withSyncedResources([e]).then(t=>t.computeDefaultDocumentColors(e.toString()))}textualSuggest(e,t,i){return VS(this,void 0,void 0,function*(){const s=yield this._withSyncedResources(e),o=i.source,r=i.flags;return s.textualSuggest(e.map(a=>a.toString()),t,o,r)})}computeWordRanges(e,t){return this._withSyncedResources([e]).then(i=>{const s=this._modelService.getModel(e);if(!s)return Promise.resolve(null);const o=this.languageConfigurationService.getLanguageConfiguration(s.getLanguageId()).getWordDefinition(),r=o.source,a=o.flags;return i.computeWordRanges(e.toString(),t,r,a)})}navigateValueSet(e,t,i){return this._withSyncedResources([e]).then(s=>{const o=this._modelService.getModel(e);if(!o)return null;const r=this.languageConfigurationService.getLanguageConfiguration(o.getLanguageId()).getWordDefinition(),a=r.source,l=r.flags;return s.navigateValueSet(e.toString(),t,i,a,l)})}dispose(){super.dispose(),this._disposed=!0}}function z_e(n,e,t){return new H_e(n,e,t)}class H_e extends Oj{constructor(e,t,i){super(e,i.keepIdleModels||!1,i.label,t),this._foreignModuleId=i.moduleId,this._foreignModuleCreateData=i.createData||null,this._foreignModuleHost=i.host||null,this._foreignProxy=null}fhr(e,t){if(!this._foreignModuleHost||typeof this._foreignModuleHost[e]!="function")return Promise.reject(new Error("Missing method "+e+" or missing main thread foreign host."));try{return Promise.resolve(this._foreignModuleHost[e].apply(this._foreignModuleHost,t))}catch(i){return Promise.reject(i)}}_getForeignProxy(){return this._foreignProxy||(this._foreignProxy=this._getProxy().then(e=>{const t=this._foreignModuleHost?D4(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then(i=>{this._foreignModuleCreateData=null;const s=(a,l)=>e.fmr(a,l),o=(a,l)=>function(){const c=Array.prototype.slice.call(arguments,0);return l(a,c)},r={};for(const a of i)r[a]=o(a,s);return r})})),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then(t=>this.getProxy())}}const fD={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"},Xb=new class{clone(){return this}equals(n){return this===n}};function Fj(n,e){return new O4([new Fb(0,"",n)],e)}function aP(n,e){const t=new Uint32Array(2);return t[0]=0,t[1]=(n<<0|0|0|32768|2<<24)>>>0,new UL(t,e===null?Xb:e)}class qs{static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static getClassNameFromMetadata(e){let i="mtk"+this.getForeground(e);const s=this.getFontStyle(e);return s&1&&(i+=" mtki"),s&2&&(i+=" mtkb"),s&4&&(i+=" mtku"),s&8&&(i+=" mtks"),i}static getInlineStyleFromMetadata(e,t){const i=this.getForeground(e),s=this.getFontStyle(e);let o=`color: ${t[i]};`;s&1&&(o+="font-style: italic;"),s&2&&(o+="font-weight: bold;");let r="";return s&4&&(r+=" underline"),s&8&&(r+=" line-through"),r&&(o+=`text-decoration:${r};`),o}static getPresentationFromMetadata(e){const t=this.getForeground(e),i=this.getFontStyle(e);return{foreground:t,italic:!!(i&1),bold:!!(i&2),underline:!!(i&4),strikethrough:!!(i&8)}}}class an{static createEmpty(e,t){const i=an.defaultTokenMetadata,s=new Uint32Array(2);return s[0]=e.length,s[1]=i,new an(s,e,t)}constructor(e,t,i){this._lineTokensBrand=void 0,this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this._languageIdCodec=i}equals(e){return e instanceof an?this.slicedEquals(e,0,this._tokensCount):!1}slicedEquals(e,t,i){if(this._text!==e._text||this._tokensCount!==e._tokensCount)return!1;const s=t<<1,o=s+(i<<1);for(let r=s;r0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[(e<<1)+1]}getLanguageId(e){const t=this._tokens[(e<<1)+1],i=qs.getLanguageId(t);return this._languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[(e<<1)+1];return qs.getTokenType(t)}getForeground(e){const t=this._tokens[(e<<1)+1];return qs.getForeground(t)}getClassName(e){const t=this._tokens[(e<<1)+1];return qs.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[(e<<1)+1];return qs.getInlineStyleFromMetadata(i,t)}getPresentation(e){const t=this._tokens[(e<<1)+1];return qs.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return an.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new lP(this,e,t,i)}static convertToEndOffset(e,t){const s=(e.length>>>1)-1;for(let o=0;o>>1)-1;for(;it&&(s=o)}return i}withInserted(e){if(e.length===0)return this;let t=0,i=0,s="";const o=new Array;let r=0;for(;;){const a=tr){s+=this._text.substring(r,l.offset);const c=this._tokens[(t<<1)+1];o.push(s.length,c),r=l.offset}s+=l.text,o.push(s.length,l.tokenMetadata),i++}else break}return new an(new Uint32Array(o),s,this._languageIdCodec)}}an.defaultTokenMetadata=(32768|2<<24)>>>0;class lP{constructor(e,t,i,s){this._source=e,this._startOffset=t,this._endOffset=i,this._deltaOffset=s,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this._tokensCount=0;for(let o=this._firstTokenIndex,r=e.getCount();o=i);o++)this._tokensCount++}getMetadata(e){return this._source.getMetadata(this._firstTokenIndex+e)}getLanguageId(e){return this._source.getLanguageId(this._firstTokenIndex+e)}getLineContent(){return this._source.getLineContent().substring(this._startOffset,this._endOffset)}equals(e){return e instanceof lP?this._startOffset===e._startOffset&&this._endOffset===e._endOffset&&this._deltaOffset===e._deltaOffset&&this._source.slicedEquals(e._source,this._firstTokenIndex,this._tokensCount):!1}getCount(){return this._tokensCount}getForeground(e){return this._source.getForeground(this._firstTokenIndex+e)}getEndOffset(e){const t=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,t)-this._startOffset+this._deltaOffset}getClassName(e){return this._source.getClassName(this._firstTokenIndex+e)}getInlineStyle(e,t){return this._source.getInlineStyle(this._firstTokenIndex+e,t)}getPresentation(e){return this._source.getPresentation(this._firstTokenIndex+e)}findTokenIndexAtOffset(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex}}class hr{constructor(e,t,i,s){this.startColumn=e,this.endColumn=t,this.className=i,this.type=s,this._lineDecorationBrand=void 0}static _equals(e,t){return e.startColumn===t.startColumn&&e.endColumn===t.endColumn&&e.className===t.className&&e.type===t.type}static equalsArr(e,t){const i=e.length,s=t.length;if(i!==s)return!1;for(let o=0;o=o||(a[l++]=new hr(Math.max(1,c.startColumn-s+1),Math.min(r+1,c.endColumn-s+1),c.className,c.type));return a}static filter(e,t,i,s){if(e.length===0)return[];const o=[];let r=0;for(let a=0,l=e.length;at||d.isEmpty()&&(c.type===0||c.type===3))continue;const u=d.startLineNumber===t?d.startColumn:i,h=d.endLineNumber===t?d.endColumn:s;o[r++]=new hr(u,h,c.inlineClassName,c.type)}return o}static _typeCompare(e,t){const i=[2,0,1,3];return i[e]-i[t]}static compare(e,t){if(e.startColumn!==t.startColumn)return e.startColumn-t.startColumn;if(e.endColumn!==t.endColumn)return e.endColumn-t.endColumn;const i=hr._typeCompare(e.type,t.type);return i!==0?i:e.className!==t.className?e.className0&&this.stopOffsets[0]0&&t=e){this.stopOffsets.splice(s,0,e),this.classNames.splice(s,0,t),this.metadata.splice(s,0,i);break}this.count++}}class $_e{static normalize(e,t){if(t.length===0)return[];const i=[],s=new zS;let o=0;for(let r=0,a=t.length;r1){const p=e.charCodeAt(c-2);sn(p)&&c--}if(d>1){const p=e.charCodeAt(d-2);sn(p)&&d--}const f=c-1,g=d-2;o=s.consumeLowerThan(f,o,i),s.count===0&&(o=f),s.insert(g,u,h)}return s.consumeLowerThan(1073741824,o,i),i}}class on{constructor(e,t,i,s){this.endIndex=e,this.type=t,this.metadata=i,this.containsRTL=s,this._linePartBrand=void 0}isWhitespace(){return!!(this.metadata&1)}isPseudoAfter(){return!!(this.metadata&4)}}class Bj{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}}class s0{constructor(e,t,i,s,o,r,a,l,c,d,u,h,f,g,p,_,v,b,y){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=s,this.isBasicASCII=o,this.containsRTL=r,this.fauxIndentLength=a,this.lineTokens=l,this.lineDecorations=c.sort(hr.compare),this.tabSize=d,this.startVisibleColumn=u,this.spaceWidth=h,this.stopRenderingLineAfter=p,this.renderWhitespace=_==="all"?4:_==="boundary"?1:_==="selection"?2:_==="trailing"?3:0,this.renderControlCharacters=v,this.fontLigatures=b,this.selectionsOnLine=y&&y.sort((L,x)=>L.startOffset>>16}static getCharIndex(e){return(e&65535)>>>0}constructor(e,t){this.length=e,this._data=new Uint32Array(this.length),this._horizontalOffset=new Uint32Array(this.length)}setColumnInfo(e,t,i,s){const o=(t<<16|i<<0)>>>0;this._data[e-1]=o,this._horizontalOffset[e-1]=s}getHorizontalOffset(e){return this._horizontalOffset.length===0?0:this._horizontalOffset[e-1]}charOffsetToPartData(e){return this.length===0?0:e<0?this._data[0]:e>=this.length?this._data[this.length-1]:this._data[e]}getDomPosition(e){const t=this.charOffsetToPartData(e-1),i=Ea.getPartIndex(t),s=Ea.getCharIndex(t);return new Wj(i,s)}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,i){if(this.length===0)return 0;const s=(e<<16|i<<0)>>>0;let o=0,r=this.length-1;for(;o+1>>1,_=this._data[p];if(_===s)return p;_>s?r=p:o=p}if(o===r)return o;const a=this._data[o],l=this._data[r];if(a===s)return o;if(l===s)return r;const c=Ea.getPartIndex(a),d=Ea.getCharIndex(a),u=Ea.getPartIndex(l);let h;c!==u?h=t:h=Ea.getCharIndex(l);const f=i-d,g=h-i;return f<=g?o:r}}class CT{constructor(e,t,i){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=i}}function cP(n,e){if(n.lineContent.length===0){if(n.lineDecorations.length>0){e.appendString("");let t=0,i=0,s=0;for(const r of n.lineDecorations)(r.type===1||r.type===2)&&(e.appendString(''),r.type===1&&(s|=1,t++),r.type===2&&(s|=2,i++));e.appendString("");const o=new Ea(1,t+i);return o.setColumnInfo(1,t,0,0),new CT(o,!1,s)}return e.appendString(""),new CT(new Ea(0,0),!1,0)}return Q_e(q_e(n),e)}class U_e{constructor(e,t,i,s){this.characterMapping=e,this.html=t,this.containsRTL=i,this.containsForeignElements=s}}function gD(n){const e=new aD(1e4),t=cP(n,e);return new U_e(t.characterMapping,e.build(),t.containsRTL,t.containsForeignElements)}class j_e{constructor(e,t,i,s,o,r,a,l,c,d,u,h,f,g,p,_){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.len=s,this.isOverflowing=o,this.overflowingCharCount=r,this.parts=a,this.containsForeignElements=l,this.fauxIndentLength=c,this.tabSize=d,this.startVisibleColumn=u,this.containsRTL=h,this.spaceWidth=f,this.renderSpaceCharCode=g,this.renderWhitespace=p,this.renderControlCharacters=_}}function q_e(n){const e=n.lineContent;let t,i,s;n.stopRenderingLineAfter!==-1&&n.stopRenderingLineAfter0){for(let a=0,l=n.lineDecorations.length;a0&&(o[r++]=new on(i,"",0,!1));let a=i;for(let l=0,c=t.getCount();l=s){const f=e?Vb(n.substring(a,s)):!1;o[r++]=new on(s,u,0,f);break}const h=e?Vb(n.substring(a,d)):!1;o[r++]=new on(d,u,0,h),a=d}return o}function K_e(n,e,t){let i=0;const s=[];let o=0;if(t)for(let r=0,a=e.length;r=50&&(s[o++]=new on(f+1,d,u,h),g=f+1,f=-1);g!==c&&(s[o++]=new on(c,d,u,h))}else s[o++]=l;i=c}else for(let r=0,a=e.length;r50){const u=l.type,h=l.metadata,f=l.containsRTL,g=Math.ceil(d/50);for(let p=1;p=8234&&n<=8238||n>=8294&&n<=8297||n>=8206&&n<=8207||n===1564}function Y_e(n,e){const t=[];let i=new on(0,"",0,!1),s=0;for(const o of e){const r=o.endIndex;for(;si.endIndex&&(i=new on(s,o.type,o.metadata,o.containsRTL),t.push(i)),i=new on(s+1,"mtkcontrol",o.metadata,!1),t.push(i))}s>i.endIndex&&(i=new on(r,o.type,o.metadata,o.containsRTL),t.push(i))}return t}function Z_e(n,e,t,i){const s=n.continuesWithWrappedLine,o=n.fauxIndentLength,r=n.tabSize,a=n.startVisibleColumn,l=n.useMonospaceOptimizations,c=n.selectionsOnLine,d=n.renderWhitespace===1,u=n.renderWhitespace===3,h=n.renderSpaceWidth!==n.spaceWidth,f=[];let g=0,p=0,_=i[p].type,v=i[p].containsRTL,b=i[p].endIndex;const y=i.length;let w=!1,C=Qs(e),L;C===-1?(w=!0,C=t,L=t):L=zf(e);let x=!1,D=0,k=c&&c[D],P=a%r;for(let M=o;M=k.endOffset&&(D++,k=c&&c[D]);let z;if(ML)z=!0;else if(R===9)z=!0;else if(R===32)if(d)if(x)z=!0;else{const G=M+1M),z&&u&&(z=w||M>L),z&&v&&M>=C&&M<=L&&(z=!1),x){if(!z||!l&&P>=r){if(h){const G=g>0?f[g-1].endIndex:o;for(let te=G+1;te<=M;te++)f[g++]=new on(te,"mtkw",1,!1)}else f[g++]=new on(M,"mtkw",1,!1);P=P%r}}else(M===b||z&&M>o)&&(f[g++]=new on(M,_,0,v),P=P%r);for(R===9?P=r:eu(R)?P+=2:P++,x=z;M===b&&(p++,p0?e.charCodeAt(t-1):0,R=t>1?e.charCodeAt(t-2):0;M===32&&R!==32&&R!==9||(O=!0)}else O=!0;if(O)if(h){const M=g>0?f[g-1].endIndex:o;for(let R=M+1;R<=t;R++)f[g++]=new on(R,"mtkw",1,!1)}else f[g++]=new on(t,"mtkw",1,!1);else f[g++]=new on(t,_,0,v);return f}function X_e(n,e,t,i){i.sort(hr.compare);const s=$_e.normalize(n,i),o=s.length;let r=0;const a=[];let l=0,c=0;for(let u=0,h=t.length;uc&&(c=b.startOffset,a[l++]=new on(c,p,_,v)),b.endOffset+1<=g)c=b.endOffset+1,a[l++]=new on(c,p+" "+b.className,_|b.metadata,v),r++;else{c=g,a[l++]=new on(c,p+" "+b.className,_|b.metadata,v);break}}g>c&&(c=g,a[l++]=new on(c,p,_,v))}const d=t[t.length-1].endIndex;if(r'):e.appendString("");for(let k=0,P=c.length;k=d&&(Se+=me)}}for(te&&(e.appendString(' style="width:'),e.appendString(String(g*fe)),e.appendString('px"')),e.appendASCIICharCode(62);w1?e.appendCharCode(8594):e.appendCharCode(65515);for(let me=2;me<=Ie;me++)e.appendCharCode(160)}else Se=2,Ie=1,e.appendCharCode(p),e.appendCharCode(8204);L+=Se,x+=Ie,w>=d&&(C+=Ie)}}else for(e.appendASCIICharCode(62);w=d&&(C+=Se)}ae?D++:D=0,w>=r&&!y&&O.isPseudoAfter()&&(y=!0,b.setColumnInfo(w+1,k,L,x)),e.appendString("")}return y||b.setColumnInfo(r+1,c.length-1,L,x),a&&(e.appendString(''),e.appendString(m("showMore","Show more ({0})",ebe(l))),e.appendString("")),e.appendString(""),new CT(b,f,s)}function J_e(n){return n.toString(16).toUpperCase().padStart(4,"0")}function ebe(n){return n<1024?m("overflow.chars","{0} chars",n):n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/1024/1024).toFixed(1)} MB`}class i7{constructor(e,t,i,s){this._viewportBrand=void 0,this.top=e|0,this.left=t|0,this.width=i|0,this.height=s|0}}class tbe{constructor(e,t){this.tabSize=e,this.data=t}}class dP{constructor(e,t,i,s,o,r,a){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=i,this.maxColumn=s,this.startVisibleColumn=o,this.tokens=r,this.inlineDecorations=a}}class Eo{constructor(e,t,i,s,o,r,a,l,c,d){this.minColumn=e,this.maxColumn=t,this.content=i,this.continuesWithWrappedLine=s,this.isBasicASCII=Eo.isBasicASCII(i,r),this.containsRTL=Eo.containsRTL(i,this.isBasicASCII,o),this.tokens=a,this.inlineDecorations=l,this.tabSize=c,this.startVisibleColumn=d}static isBasicASCII(e,t){return t?H4(e):!0}static containsRTL(e,t,i){return!t&&i?Vb(e):!1}}class M_{constructor(e,t,i){this.range=e,this.inlineClassName=t,this.type=i}}class ibe{constructor(e,t,i,s){this.startOffset=e,this.endOffset=t,this.inlineClassName=i,this.inlineClassNameAffectsLetterSpacing=s}toInlineDecoration(e){return new M_(new N(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}class zj{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}}class Qb{constructor(e,t,i){this.color=e,this.zIndex=t,this.data=i}static compareByRenderingProps(e,t){return e.zIndex===t.zIndex?e.colort.color?1:0:e.zIndex-t.zIndex}static equals(e,t){return e.color===t.color&&e.zIndex===t.zIndex&&Zi(e.data,t.data)}static equalsArr(e,t){return Zi(e,t,Qb.equals)}}function nbe(n){return Array.isArray(n)}function sbe(n){return!nbe(n)}function Hj(n){return typeof n=="string"}function n7(n){return!Hj(n)}function kg(n){return!n}function Td(n,e){return n.ignoreCase&&e?e.toLowerCase():e}function s7(n){return n.replace(/[&<>'"_]/g,"-")}function obe(n,e){console.log(`${n.languageId}: ${e}`)}function zt(n,e){return new Error(`${n.languageId}: ${e}`)}function Qc(n,e,t,i,s){const o=/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g;let r=null;return e.replace(o,function(a,l,c,d,u,h,f,g,p){return kg(c)?kg(d)?!kg(u)&&u0;){const i=n.tokenizer[t];if(i)return i;const s=t.lastIndexOf(".");s<0?t=null:t=t.substr(0,s)}return null}function rbe(n,e){let t=e;for(;t&&t.length>0;){if(n.stateNames[t])return!0;const s=t.lastIndexOf(".");s<0?t=null:t=t.substr(0,s)}return!1}var abe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},lbe=function(n,e){return function(t,i){e(t,i,n)}},ST;const $j=5;class Jb{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(e!==null&&e.depth>=this._maxCacheDepth)return new vp(e,t);let i=vp.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let s=this._entries[i];return s||(s=new vp(e,t),this._entries[i]=s,s)}}Jb._INSTANCE=new Jb($j);class vp{constructor(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(e){let t="";for(;e!==null;)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t}static _equals(e,t){for(;e!==null&&t!==null;){if(e===t)return!0;if(e.state!==t.state)return!1;e=e.parent,t=t.parent}return e===null&&t===null}equals(e){return vp._equals(this,e)}push(e){return Jb.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return Jb.create(this.parent,e)}}class Hg{constructor(e,t){this.languageId=e,this.state=t}equals(e){return this.languageId===e.languageId&&this.state.equals(e.state)}clone(){return this.state.clone()===this.state?this:new Hg(this.languageId,this.state)}}class Jc{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(t!==null)return new P_(e,t);if(e!==null&&e.depth>=this._maxCacheDepth)return new P_(e,t);const i=vp.getStackElementId(e);let s=this._entries[i];return s||(s=new P_(e,null),this._entries[i]=s,s)}}Jc._INSTANCE=new Jc($j);class P_{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:Jc.create(this.stack,this.embeddedLanguageData)}equals(e){return!(e instanceof P_)||!this.stack.equals(e.stack)?!1:this.embeddedLanguageData===null&&e.embeddedLanguageData===null?!0:this.embeddedLanguageData===null||e.embeddedLanguageData===null?!1:this.embeddedLanguageData.equals(e.embeddedLanguageData)}}class cbe{constructor(){this._tokens=[],this._languageId=null,this._lastTokenType=null,this._lastTokenLanguage=null}enterLanguage(e){this._languageId=e}emit(e,t){this._lastTokenType===t&&this._lastTokenLanguage===this._languageId||(this._lastTokenType=t,this._lastTokenLanguage=this._languageId,this._tokens.push(new Fb(e,t,this._languageId)))}nestedLanguageTokenize(e,t,i,s){const o=i.languageId,r=i.state,a=xi.get(o);if(!a)return this.enterLanguage(o),this.emit(s,""),r;const l=a.tokenize(e,t,r);if(s!==0)for(const c of l.tokens)this._tokens.push(new Fb(c.offset+s,c.type,c.language));else this._tokens=this._tokens.concat(l.tokens);return this._lastTokenType=null,this._lastTokenLanguage=null,this._languageId=null,l.endState}finalize(e){return new O4(this._tokens,e)}}class HS{constructor(e,t){this._languageService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0}enterLanguage(e){this._currentLanguageId=this._languageService.languageIdCodec.encodeLanguageId(e)}emit(e,t){const i=this._theme.match(this._currentLanguageId,t)|1024;this._lastTokenMetadata!==i&&(this._lastTokenMetadata=i,this._tokens.push(e),this._tokens.push(i))}static _merge(e,t,i){const s=e!==null?e.length:0,o=t.length,r=i!==null?i.length:0;if(s===0&&o===0&&r===0)return new Uint32Array(0);if(s===0&&o===0)return i;if(o===0&&r===0)return e;const a=new Uint32Array(s+o+r);e!==null&&a.set(e);for(let l=0;l{if(r)return;let l=!1;for(let c=0,d=a.changedLanguages.length;c{a.affectsConfiguration("editor.maxTokenizationLineLength")&&(this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}))}))}getLoadStatus(){const e=[];for(const t in this._embeddedLanguages){const i=xi.get(t);if(i){if(i instanceof ST){const s=i.getLoadStatus();s.loaded===!1&&e.push(s.promise)}continue}xi.isResolved(t)||e.push(xi.getOrCreate(t))}return e.length===0?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(t=>{})}}getInitialState(){const e=Jb.create(null,this._lexer.start);return Jc.create(e,null)}tokenize(e,t,i){if(e.length>=this._maxTokenizationLineLength)return Fj(this._languageId,i);const s=new cbe,o=this._tokenize(e,t,i,s);return s.finalize(o)}tokenizeEncoded(e,t,i){if(e.length>=this._maxTokenizationLineLength)return aP(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),i);const s=new HS(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),o=this._tokenize(e,t,i,s);return s.finalize(o)}_tokenize(e,t,i,s){return i.embeddedLanguageData?this._nestedTokenize(e,t,i,0,s):this._myTokenize(e,t,i,0,s)}_findLeavingNestedLanguageOffset(e,t){let i=this._lexer.tokenizer[t.stack.state];if(!i&&(i=Xy(this._lexer,t.stack.state),!i))throw zt(this._lexer,"tokenizer state is not defined: "+t.stack.state);let s=-1,o=!1;for(const r of i){if(!n7(r.action)||r.action.nextEmbedded!=="@pop")continue;o=!0;let a=r.regex;const l=r.regex.source;if(l.substr(0,4)==="^(?:"&&l.substr(l.length-1,1)===")"){const d=(a.ignoreCase?"i":"")+(a.unicode?"u":"");a=new RegExp(l.substr(4,l.length-5),d)}const c=e.search(a);c===-1||c!==0&&r.matchOnlyAtLineStart||(s===-1||c0&&o.nestedLanguageTokenize(a,!1,i.embeddedLanguageData,s);const l=e.substring(r);return this._myTokenize(l,t,i,s+r,o)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,i,s,o){o.enterLanguage(this._languageId);const r=e.length,a=t&&this._lexer.includeLF?e+` -`:e,l=a.length;let c=i.embeddedLanguageData,d=i.stack,u=0,h=null,f=!0;for(;f||u=l)break;f=!1;let k=this._lexer.tokenizer[v];if(!k&&(k=Xy(this._lexer,v),!k))throw zt(this._lexer,"tokenizer state is not defined: "+v);const P=a.substr(u);for(const O of k)if((u===0||!O.matchOnlyAtLineStart)&&(b=P.match(O.regex),b)){y=b[0],w=O.action;break}}if(b||(b=[""],y=""),w||(u=this._lexer.maxStack)throw zt(this._lexer,"maximum tokenizer stack size reached: ["+d.state+","+d.parent.state+",...]");d=d.push(v)}else if(w.next==="@pop"){if(d.depth<=1)throw zt(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(C));d=d.pop()}else if(w.next==="@popall")d=d.popall();else{let k=Qc(this._lexer,w.next,y,b,v);if(k[0]==="@"&&(k=k.substr(1)),Xy(this._lexer,k))d=d.push(k);else throw zt(this._lexer,"trying to set a next state '"+k+"' that is undefined in rule: "+this._safeRuleName(C))}}w.log&&typeof w.log=="string"&&obe(this._lexer,this._lexer.languageId+": "+Qc(this._lexer,w.log,y,b,v))}if(x===null)throw zt(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(C));const D=k=>{const P=this._languageService.getLanguageIdByLanguageName(k)||this._languageService.getLanguageIdByMimeType(k)||k,O=this._getNestedEmbeddedLanguageData(P);if(u0)throw zt(this._lexer,"groups cannot be nested: "+this._safeRuleName(C));if(b.length!==x.length+1)throw zt(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(C));let k=0;for(let P=1;Pn});class uP{static colorizeElement(e,t,i,s){s=s||{};const o=s.theme||"vs",r=s.mimeType||i.getAttribute("lang")||i.getAttribute("data-lang");if(!r)return console.error("Mode not detected"),Promise.resolve();const a=t.getLanguageIdByMimeType(r)||r;e.setTheme(o);const l=i.firstChild?i.firstChild.nodeValue:"";i.className+=" "+o;const c=d=>{var u;const h=(u=L2==null?void 0:L2.createHTML(d))!==null&&u!==void 0?u:d;i.innerHTML=h};return this.colorize(t,l||"",a,s).then(c,d=>console.error(d))}static colorize(e,t,i,s){return ube(this,void 0,void 0,function*(){const o=e.languageIdCodec;let r=4;s&&typeof s.tabSize=="number"&&(r=s.tabSize),U4(t)&&(t=t.substr(1));const a=Vf(t);if(!e.isRegisteredLanguageId(i))return o7(a,r,o);const l=yield xi.getOrCreate(i);return l?hbe(a,r,l,o):o7(a,r,o)})}static colorizeLine(e,t,i,s,o=4){const r=Eo.isBasicASCII(e,t),a=Eo.containsRTL(e,r,i);return gD(new s0(!1,!0,e,!1,r,a,0,s,[],o,0,0,0,0,-1,"none",!1,!1,null)).html}static colorizeModelLine(e,t,i=4){const s=e.getLineContent(t);e.tokenization.forceTokenization(t);const r=e.tokenization.getLineTokens(t).inflate();return this.colorizeLine(s,e.mightContainNonBasicASCII(),e.mightContainRTL(),r,i)}}function hbe(n,e,t,i){return new Promise((s,o)=>{const r=()=>{const a=fbe(n,e,t,i);if(t instanceof ev){const l=t.getLoadStatus();if(l.loaded===!1){l.promise.then(r,o);return}}s(a)};r()})}function o7(n,e,t){let i=[];const o=new Uint32Array(2);o[0]=0,o[1]=33587200;for(let r=0,a=n.length;r")}return i.join("")}function fbe(n,e,t,i){let s=[],o=t.getInitialState();for(let r=0,a=n.length;r"),o=c.endState}return s.join("")}const r7=2e4;let ch,bC,xT,vC,LT;function gbe(n){ch=document.createElement("div"),ch.className="monaco-aria-container";const e=()=>{const i=document.createElement("div");return i.className="monaco-alert",i.setAttribute("role","alert"),i.setAttribute("aria-atomic","true"),ch.appendChild(i),i};bC=e(),xT=e();const t=()=>{const i=document.createElement("div");return i.className="monaco-status",i.setAttribute("aria-live","polite"),i.setAttribute("aria-atomic","true"),ch.appendChild(i),i};vC=t(),LT=t(),n.appendChild(ch)}function Z1(n){ch&&(bC.textContent!==n?(ko(xT),$S(bC,n)):(ko(bC),$S(xT,n)))}function tv(n){ch&&(vC.textContent!==n?(ko(LT),$S(vC,n)):(ko(vC),$S(LT,n)))}function $S(n,e){ko(n),e.length>r7&&(e=e.substr(0,r7)),n.textContent=e,n.style.visibility="hidden",n.style.visibility="visible"}const hP=at("markerDecorationsService");var pbe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},mbe=function(n,e){return function(t,i){e(t,i,n)}};let iv=class{constructor(e,t){}dispose(){}};iv.ID="editor.contrib.markerDecorations";iv=pbe([mbe(1,hP)],iv);Tr(iv.ID,iv,0);class Uj extends Y{constructor(e,t){super(),this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._referenceDomElement=e,this._width=-1,this._height=-1,this._resizeObserver=null,this.measureReferenceDomElement(!1,t)}dispose(){this.stopObserving(),super.dispose()}getWidth(){return this._width}getHeight(){return this._height}startObserving(){if(!this._resizeObserver&&this._referenceDomElement){let e=null;const t=()=>{e?this.observe({width:e.width,height:e.height}):this.observe()};let i=!1,s=!1;const o=()=>{if(i&&!s)try{i=!1,s=!0,t()}finally{requestAnimationFrame(()=>{s=!1,o()})}};this._resizeObserver=new ResizeObserver(r=>{e=r&&r[0]&&r[0].contentRect?r[0].contentRect:null,i=!0,o()}),this._resizeObserver.observe(this._referenceDomElement)}}stopObserving(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let i=0,s=0;t?(i=t.width,s=t.height):this._referenceDomElement&&(i=this._referenceDomElement.clientWidth,s=this._referenceDomElement.clientHeight),i=Math.max(5,i),s=Math.max(5,s),(this._width!==i||this._height!==s)&&(this._width=i,this._height=s,e&&this._onDidChange.fire())}}class Nd{constructor(e,t){this.key=e,this.migrate=t}apply(e){const t=Nd._read(e,this.key),i=o=>Nd._read(e,o),s=(o,r)=>Nd._write(e,o,r);this.migrate(t,i,s)}static _read(e,t){if(typeof e>"u")return;const i=t.indexOf(".");if(i>=0){const s=t.substring(0,i);return this._read(e[s],t.substring(i+1))}return e[t]}static _write(e,t,i){const s=t.indexOf(".");if(s>=0){const o=t.substring(0,s);e[o]=e[o]||{},this._write(e[o],t.substring(s+1),i);return}e[t]=i}}Nd.items=[];function ku(n,e){Nd.items.push(new Nd(n,e))}function Xo(n,e){ku(n,(t,i,s)=>{if(typeof t<"u"){for(const[o,r]of e)if(t===o){s(n,r);return}}})}function _be(n){Nd.items.forEach(e=>e.apply(n))}Xo("wordWrap",[[!0,"on"],[!1,"off"]]);Xo("lineNumbers",[[!0,"on"],[!1,"off"]]);Xo("cursorBlinking",[["visible","solid"]]);Xo("renderWhitespace",[[!0,"boundary"],[!1,"none"]]);Xo("renderLineHighlight",[[!0,"line"],[!1,"none"]]);Xo("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]);Xo("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]);Xo("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);Xo("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);Xo("autoIndent",[[!1,"advanced"],[!0,"full"]]);Xo("matchBrackets",[[!0,"always"],[!1,"never"]]);Xo("renderFinalNewline",[[!0,"on"],[!1,"off"]]);Xo("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]);ku("autoClosingBrackets",(n,e,t)=>{n===!1&&(t("autoClosingBrackets","never"),typeof e("autoClosingQuotes")>"u"&&t("autoClosingQuotes","never"),typeof e("autoSurround")>"u"&&t("autoSurround","never"))});ku("renderIndentGuides",(n,e,t)=>{typeof n<"u"&&(t("renderIndentGuides",void 0),typeof e("guides.indentation")>"u"&&t("guides.indentation",!!n))});ku("highlightActiveIndentGuide",(n,e,t)=>{typeof n<"u"&&(t("highlightActiveIndentGuide",void 0),typeof e("guides.highlightActiveIndentation")>"u"&&t("guides.highlightActiveIndentation",!!n))});const bbe={method:"showMethods",function:"showFunctions",constructor:"showConstructors",deprecated:"showDeprecated",field:"showFields",variable:"showVariables",class:"showClasses",struct:"showStructs",interface:"showInterfaces",module:"showModules",property:"showProperties",event:"showEvents",operator:"showOperators",unit:"showUnits",value:"showValues",constant:"showConstants",enum:"showEnums",enumMember:"showEnumMembers",keyword:"showKeywords",text:"showWords",color:"showColors",file:"showFiles",reference:"showReferences",folder:"showFolders",typeParameter:"showTypeParameters",snippet:"showSnippets"};ku("suggest.filteredTypes",(n,e,t)=>{if(n&&typeof n=="object"){for(const i of Object.entries(bbe))n[i[0]]===!1&&typeof e(`suggest.${i[1]}`)>"u"&&t(`suggest.${i[1]}`,!1);t("suggest.filteredTypes",void 0)}});ku("quickSuggestions",(n,e,t)=>{if(typeof n=="boolean"){const i=n?"on":"off";t("quickSuggestions",{comments:i,strings:i,other:i})}});ku("experimental.stickyScroll.enabled",(n,e,t)=>{typeof n=="boolean"&&(t("experimental.stickyScroll.enabled",void 0),typeof e("stickyScroll.enabled")>"u"&&t("stickyScroll.enabled",n))});ku("experimental.stickyScroll.maxLineCount",(n,e,t)=>{typeof n=="number"&&(t("experimental.stickyScroll.maxLineCount",void 0),typeof e("stickyScroll.maxLineCount")>"u"&&t("stickyScroll.maxLineCount",n))});class vbe{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new B,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus)}}const US=new vbe,Eu=at("accessibilityService"),ybe=new _e("accessibilityModeEnabled",!1);var wbe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Cbe=function(n,e){return function(t,i){e(t,i,n)}};let DT=class extends Y{constructor(e,t,i,s){super(),this._accessibilityService=s,this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new B),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._glyphMarginDecorationLaneCount=1,this._computeOptionsMemory=new fU,this.isSimpleWidget=e,this._containerObserver=this._register(new Uj(i,t.dimension)),this._rawOptions=a7(t),this._validatedOptions=ed.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(13)&&this._containerObserver.startObserving(),this._register(Xc.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(US.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register(tT.onDidChange(()=>this._recomputeOptions())),this._register(TS.onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions()))}_recomputeOptions(){const e=this._computeOptions(),t=ed.checkEquals(this.options,e);t!==null&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=Gh.createFromValidatedSettings(this._validatedOptions,e.pixelRatio,this.isSimpleWidget),i=this._readFontInfo(t),s={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight-this._reservedHeight,fontInfo:i,extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:US.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount};return ed.computeOptions(this._validatedOptions,s)}_readEnvConfiguration(){return{extraEditorClassName:xbe(),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:qh||Lr,pixelRatio:TS.value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?2:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return tT.readFontInfo(e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=a7(e);ed.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=ed.validateOptions(this._rawOptions),this._recomputeOptions())}observeContainer(e){this._containerObserver.observe(e)}setIsDominatedByLongLines(e){this._isDominatedByLongLines!==e&&(this._isDominatedByLongLines=e,this._recomputeOptions())}setModelLineCount(e){const t=Sbe(e);this._lineNumbersDigitCount!==t&&(this._lineNumbersDigitCount=t,this._recomputeOptions())}setViewLineCount(e){this._viewLineCount!==e&&(this._viewLineCount=e,this._recomputeOptions())}setReservedHeight(e){this._reservedHeight!==e&&(this._reservedHeight=e,this._recomputeOptions())}setGlyphMarginDecorationLaneCount(e){this._glyphMarginDecorationLaneCount!==e&&(this._glyphMarginDecorationLaneCount=e,this._recomputeOptions())}};DT=wbe([Cbe(3,Eu)],DT);function Sbe(n){let e=0;for(;n;)n=Math.floor(n/10),e++;return e||1}function xbe(){let n="";return!bc&&!PU&&(n+="no-user-select "),bc&&(n+="no-minimap-shadow ",n+="enable-user-select "),mt&&(n+="mac "),n}class Lbe{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class Dbe{constructor(){this._values=[]}_read(e){if(e>=this._values.length)throw new Error("Cannot read uninitialized value");return this._values[e]}get(e){return this._read(e)}_write(e,t){this._values[e]=t}}class ed{static validateOptions(e){const t=new Lbe;for(const i of Og){const s=i.name==="_never_"?void 0:e[i.name];t._write(i.id,i.validate(s))}return t}static computeOptions(e,t){const i=new Dbe;for(const s of Og)i._write(s.id,s.compute(t,i,e._read(s.id)));return i}static _deepEquals(e,t){if(typeof e!="object"||typeof t!="object"||!e||!t)return e===t;if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)?Zi(e,t):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(!ed._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){const i=[];let s=!1;for(const o of Og){const r=!ed._deepEquals(e._read(o.id),t._read(o.id));i[o.id]=r,r&&(s=!0)}return s?new hU(i):null}static applyUpdate(e,t){let i=!1;for(const s of Og)if(t.hasOwnProperty(s.name)){const o=s.applyUpdate(e[s.name],t[s.name]);e[s.name]=o.newValue,i=i||o.didChange}return i}}function a7(n){const e=Nl(n);return _be(e),e}function ki(n,e,t){let i=null,s=null;if(typeof t.value=="function"?(i="value",s=t.value,s.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof t.get=="function"&&(i="get",s=t.get),!s)throw new Error("not supported");const o=`$memoize$${e}`;t[i]=function(...r){return this.hasOwnProperty(o)||Object.defineProperty(this,o,{configurable:!1,enumerable:!1,writable:!1,value:s.apply(this,r)}),this[o]}}var kbe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Ot;(function(n){n.Tap="-monaco-gesturetap",n.Change="-monaco-gesturechange",n.Start="-monaco-gesturestart",n.End="-monaco-gesturesend",n.Contextmenu="-monaco-gesturecontextmenu"})(Ot||(Ot={}));class Mt extends Y{constructor(){super(),this.dispatched=!1,this.targets=new ks,this.ignoreTargets=new ks,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(K(document,"touchstart",e=>this.onTouchStart(e),{passive:!1})),this._register(K(document,"touchend",e=>this.onTouchEnd(e))),this._register(K(document,"touchmove",e=>this.onTouchMove(e),{passive:!1}))}static addTarget(e){if(!Mt.isTouchDevice())return Y.None;Mt.INSTANCE||(Mt.INSTANCE=new Mt);const t=Mt.INSTANCE.targets.push(e);return Ze(t)}static ignoreTarget(e){if(!Mt.isTouchDevice())return Y.None;Mt.INSTANCE||(Mt.INSTANCE=new Mt);const t=Mt.INSTANCE.ignoreTargets.push(e);return Ze(t)}static isTouchDevice(){return"ontouchstart"in window||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){const t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,s=e.targetTouches.length;i=Mt.HOLD_DELAY&&Math.abs(a.initialPageX-Ao(a.rollingPageX))<30&&Math.abs(a.initialPageY-Ao(a.rollingPageY))<30){const c=this.newGestureEvent(Ot.Contextmenu,a.initialTarget);c.pageX=Ao(a.rollingPageX),c.pageY=Ao(a.rollingPageY),this.dispatchEvent(c)}else if(i===1){const c=Ao(a.rollingPageX),d=Ao(a.rollingPageY),u=Ao(a.rollingTimestamps)-a.rollingTimestamps[0],h=c-a.rollingPageX[0],f=d-a.rollingPageY[0],g=[...this.targets].filter(p=>a.initialTarget instanceof Node&&p.contains(a.initialTarget));this.inertia(g,t,Math.abs(h)/u,h>0?1:-1,c,Math.abs(f)/u,f>0?1:-1,d)}this.dispatchEvent(this.newGestureEvent(Ot.End,a.initialTarget)),delete this.activeTouches[r.identifier]}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){const i=document.createEvent("CustomEvent");return i.initEvent(e,!1,!0),i.initialTarget=t,i.tapCount=0,i}dispatchEvent(e){if(e.type===Ot.Tap){const t=new Date().getTime();let i=0;t-this._lastSetTapCountTime>Mt.CLEAR_TAP_COUNT_TIME?i=1:i=2,this._lastSetTapCountTime=t,e.tapCount=i}else(e.type===Ot.Change||e.type===Ot.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(const t of this.ignoreTargets)if(t.contains(e.initialTarget))return;for(const t of this.targets)t.contains(e.initialTarget)&&(t.dispatchEvent(e),this.dispatched=!0)}}inertia(e,t,i,s,o,r,a,l){this.handle=qo(()=>{const c=Date.now(),d=c-t;let u=0,h=0,f=!0;i+=Mt.SCROLL_FRICTION*d,r+=Mt.SCROLL_FRICTION*d,i>0&&(f=!1,u=s*i*d),r>0&&(f=!1,h=a*r*d);const g=this.newGestureEvent(Ot.Change);g.translationX=u,g.translationY=h,e.forEach(p=>p.dispatchEvent(g)),f||this.inertia(e,c,i,s,o+u,r,a,l+h)})}onTouchMove(e){const t=Date.now();for(let i=0,s=e.changedTouches.length;i3&&(r.rollingPageX.shift(),r.rollingPageY.shift(),r.rollingTimestamps.shift()),r.rollingPageX.push(o.pageX),r.rollingPageY.push(o.pageY),r.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}}Mt.SCROLL_FRICTION=-.005;Mt.HOLD_DELAY=700;Mt.CLEAR_TAP_COUNT_TIME=400;kbe([ki],Mt,"isTouchDevice",null);class pD{constructor(){this._hooks=new pe,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;const i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,i,s,o){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=s,this._onStopCallback=o;let r=e;try{e.setPointerCapture(t),this._hooks.add(Ze(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{r=window}this._hooks.add(K(r,de.POINTER_MOVE,a=>{if(a.buttons!==i){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(K(r,de.POINTER_UP,a=>this.stopMonitoring(!0)))}}function fP(n){return`--vscode-${n.replace(/\./g,"-")}`}function re(n){return`var(${fP(n)})`}function Ebe(n,e){return`var(${fP(n)}, ${e})`}const jj={ColorContribution:"base.contributions.colors"};class Abe{constructor(){this._onDidChangeSchema=new B,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,i,s=!1,o){const r={id:e,description:i,defaults:t,needsTransparency:s,deprecationMessage:o};this.colorsById[e]=r;const a={type:"string",description:i,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return o&&(a.deprecationMessage=o),this.colorSchema.properties[e]=a,this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(i),this._onDidChangeSchema.fire(),e}getColors(){return Object.keys(this.colorsById).map(e=>this.colorsById[e])}resolveDefaultColor(e,t){const i=this.colorsById[e];if(i&&i.defaults){const s=i.defaults[t.type];return Vr(s,t)}}getColorSchema(){return this.colorSchema}toString(){const e=(t,i)=>{const s=t.indexOf(".")===-1?0:1,o=i.indexOf(".")===-1?0:1;return s!==o?s-o:t.localeCompare(i)};return Object.keys(this.colorsById).sort(e).map(t=>`- \`${t}\`: ${this.colorsById[t].description}`).join(` -`)}}const mD=new Abe;_n.add(jj.ColorContribution,mD);function E(n,e,t,i,s){return mD.registerColor(n,e,t,i,s)}const ee=E("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},m("foreground","Overall foreground color. This color is only used if not overridden by a component."));E("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},m("disabledForeground","Overall foreground for disabled elements. This color is only used if not overridden by a component."));const Ibe=E("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},m("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component."));E("descriptionForeground",{light:"#717171",dark:we(ee,.7),hcDark:we(ee,.7),hcLight:we(ee,.7)},m("descriptionForeground","Foreground color for description text providing additional information, for example for a label."));const ud=E("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},m("iconForeground","The default color for icons in the workbench.")),Co=E("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},m("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component.")),Je=E("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},m("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),Gt=E("contrastActiveBorder",{light:null,dark:null,hcDark:Co,hcLight:Co},m("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast."));E("selection.background",{light:null,dark:null,hcDark:null,hcLight:null},m("selectionBackground","The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor."));E("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:H.black,hcLight:"#292929"},m("textSeparatorForeground","Color for text separators."));const Tbe=E("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},m("textLinkForeground","Foreground color for links in text."));E("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},m("textLinkActiveForeground","Foreground color for links in text when clicked on and on mouse hover."));E("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#D7BA7D",hcLight:"#292929"},m("textPreformatForeground","Foreground color for preformatted text segments."));E("textBlockQuote.background",{light:"#7f7f7f1a",dark:"#7f7f7f1a",hcDark:null,hcLight:"#F2F2F2"},m("textBlockQuoteBackground","Background color for block quotes in text."));E("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:H.white,hcLight:"#292929"},m("textBlockQuoteBorder","Border color for block quotes in text."));E("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:H.black,hcLight:"#F2F2F2"},m("textCodeBlockBackground","Background color for code blocks in text."));const Ql=E("widget.shadow",{dark:we(H.black,.36),light:we(H.black,.16),hcDark:null,hcLight:null},m("widgetShadow","Shadow color of widgets such as find/replace inside the editor.")),qj=E("widget.border",{dark:null,light:null,hcDark:Je,hcLight:Je},m("widgetBorder","Border color of widgets such as find/replace inside the editor.")),Nbe=E("input.background",{dark:"#3C3C3C",light:H.white,hcDark:H.black,hcLight:H.white},m("inputBoxBackground","Input box background.")),Rbe=E("input.foreground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("inputBoxForeground","Input box foreground.")),Mbe=E("input.border",{dark:null,light:null,hcDark:Je,hcLight:Je},m("inputBoxBorder","Input box border.")),gP=E("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:Je,hcLight:Je},m("inputBoxActiveOptionBorder","Border color of activated options in input fields."));E("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},m("inputOption.hoverBackground","Background color of activated options in input fields."));const kh=E("inputOption.activeBackground",{dark:we(Co,.4),light:we(Co,.2),hcDark:H.transparent,hcLight:H.transparent},m("inputOption.activeBackground","Background hover color of options in input fields.")),pP=E("inputOption.activeForeground",{dark:H.white,light:H.black,hcDark:ee,hcLight:ee},m("inputOption.activeForeground","Foreground color of activated options in input fields."));E("input.placeholderForeground",{light:we(ee,.5),dark:we(ee,.5),hcDark:we(ee,.7),hcLight:we(ee,.7)},m("inputPlaceholderForeground","Input box foreground color for placeholder text."));const Pbe=E("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:H.black,hcLight:H.white},m("inputValidationInfoBackground","Input validation background color for information severity.")),Obe=E("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:ee},m("inputValidationInfoForeground","Input validation foreground color for information severity.")),Fbe=E("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:Je,hcLight:Je},m("inputValidationInfoBorder","Input validation border color for information severity.")),Bbe=E("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:H.black,hcLight:H.white},m("inputValidationWarningBackground","Input validation background color for warning severity.")),Wbe=E("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:ee},m("inputValidationWarningForeground","Input validation foreground color for warning severity.")),Vbe=E("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:Je,hcLight:Je},m("inputValidationWarningBorder","Input validation border color for warning severity.")),zbe=E("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:H.black,hcLight:H.white},m("inputValidationErrorBackground","Input validation background color for error severity.")),Hbe=E("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:ee},m("inputValidationErrorForeground","Input validation foreground color for error severity.")),$be=E("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:Je,hcLight:Je},m("inputValidationErrorBorder","Input validation border color for error severity.")),Va=E("dropdown.background",{dark:"#3C3C3C",light:H.white,hcDark:H.black,hcLight:H.white},m("dropdownBackground","Dropdown background.")),Ube=E("dropdown.listBackground",{dark:null,light:null,hcDark:H.black,hcLight:H.white},m("dropdownListBackground","Dropdown list background.")),Jl=E("dropdown.foreground",{dark:"#F0F0F0",light:ee,hcDark:H.white,hcLight:ee},m("dropdownForeground","Dropdown foreground.")),$g=E("dropdown.border",{dark:Va,light:"#CECECE",hcDark:Je,hcLight:Je},m("dropdownBorder","Dropdown border.")),o_=E("button.foreground",{dark:H.white,light:H.white,hcDark:H.white,hcLight:H.white},m("buttonForeground","Button foreground color.")),jbe=E("button.separator",{dark:we(o_,.4),light:we(o_,.4),hcDark:we(o_,.4),hcLight:we(o_,.4)},m("buttonSeparator","Button separator color.")),r_=E("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},m("buttonBackground","Button background color.")),qbe=E("button.hoverBackground",{dark:na(r_,.2),light:Gf(r_,.2),hcDark:r_,hcLight:r_},m("buttonHoverBackground","Button background color when hovering.")),Gbe=E("button.border",{dark:Je,light:Je,hcDark:Je,hcLight:Je},m("buttonBorder","Button border color.")),Kbe=E("button.secondaryForeground",{dark:H.white,light:H.white,hcDark:H.white,hcLight:ee},m("buttonSecondaryForeground","Secondary button foreground color.")),kT=E("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:H.white},m("buttonSecondaryBackground","Secondary button background color.")),Ybe=E("button.secondaryHoverBackground",{dark:na(kT,.2),light:Gf(kT,.2),hcDark:null,hcLight:null},m("buttonSecondaryHoverBackground","Secondary button background color when hovering.")),yC=E("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:H.black,hcLight:"#0F4A85"},m("badgeBackground","Badge background color. Badges are small information labels, e.g. for search results count.")),Zbe=E("badge.foreground",{dark:H.white,light:"#333",hcDark:H.white,hcLight:H.white},m("badgeForeground","Badge foreground color. Badges are small information labels, e.g. for search results count.")),Xbe=E("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},m("scrollbarShadow","Scrollbar shadow to indicate that the view is scrolled.")),a_=E("scrollbarSlider.background",{dark:H.fromHex("#797979").transparent(.4),light:H.fromHex("#646464").transparent(.4),hcDark:we(Je,.6),hcLight:we(Je,.4)},m("scrollbarSliderBackground","Scrollbar slider background color.")),l_=E("scrollbarSlider.hoverBackground",{dark:H.fromHex("#646464").transparent(.7),light:H.fromHex("#646464").transparent(.7),hcDark:we(Je,.8),hcLight:we(Je,.8)},m("scrollbarSliderHoverBackground","Scrollbar slider background color when hovering.")),c_=E("scrollbarSlider.activeBackground",{dark:H.fromHex("#BFBFBF").transparent(.4),light:H.fromHex("#000000").transparent(.6),hcDark:Je,hcLight:Je},m("scrollbarSliderActiveBackground","Scrollbar slider background color when clicked on.")),Qbe=E("progressBar.background",{dark:H.fromHex("#0E70C0"),light:H.fromHex("#0E70C0"),hcDark:Je,hcLight:Je},m("progressBarBackground","Background color of the progress bar that can show for long running operations."));E("editorError.background",{dark:null,light:null,hcDark:null,hcLight:null},m("editorError.background","Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const za=E("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},m("editorError.foreground","Foreground color of error squigglies in the editor.")),Jbe=E("editorError.border",{dark:null,light:null,hcDark:H.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},m("errorBorder","If set, color of double underlines for errors in the editor."));E("editorWarning.background",{dark:null,light:null,hcDark:null,hcLight:null},m("editorWarning.background","Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const So=E("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},m("editorWarning.foreground","Foreground color of warning squigglies in the editor.")),nv=E("editorWarning.border",{dark:null,light:null,hcDark:H.fromHex("#FFCC00").transparent(.8),hcLight:H.fromHex("#FFCC00").transparent(.8)},m("warningBorder","If set, color of double underlines for warnings in the editor."));E("editorInfo.background",{dark:null,light:null,hcDark:null,hcLight:null},m("editorInfo.background","Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const Es=E("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},m("editorInfo.foreground","Foreground color of info squigglies in the editor.")),sv=E("editorInfo.border",{dark:null,light:null,hcDark:H.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},m("infoBorder","If set, color of double underlines for infos in the editor.")),eve=E("editorHint.foreground",{dark:H.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},m("editorHint.foreground","Foreground color of hint squigglies in the editor."));E("editorHint.border",{dark:null,light:null,hcDark:H.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},m("hintBorder","If set, color of double underlines for hints in the editor."));E("sash.hoverBorder",{dark:Co,light:Co,hcDark:Co,hcLight:Co},m("sashActiveBorder","Border color of active sashes."));const Yi=E("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:H.black,hcLight:H.white},m("editorBackground","Editor background color.")),Au=E("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:H.white,hcLight:ee},m("editorForeground","Editor default foreground color."));E("editorStickyScroll.background",{light:Yi,dark:Yi,hcDark:Yi,hcLight:Yi},m("editorStickyScrollBackground","Sticky scroll background color for the editor"));E("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:H.fromHex("#0F4A85").transparent(.1)},m("editorStickyScrollHoverBackground","Sticky scroll on hover background color for the editor"));const Ui=E("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:H.white},m("editorWidgetBackground","Background color of editor widgets, such as find/replace.")),Ha=E("editorWidget.foreground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("editorWidgetForeground","Foreground color of editor widgets, such as find/replace.")),Ug=E("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:Je,hcLight:Je},m("editorWidgetBorder","Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget.")),tve=E("editorWidget.resizeBorder",{light:null,dark:null,hcDark:null,hcLight:null},m("editorWidgetResizeBorder","Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget.")),l7=E("quickInput.background",{dark:Ui,light:Ui,hcDark:Ui,hcLight:Ui},m("pickerBackground","Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),ive=E("quickInput.foreground",{dark:Ha,light:Ha,hcDark:Ha,hcLight:Ha},m("pickerForeground","Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),nve=E("quickInputTitle.background",{dark:new H(new ft(255,255,255,.105)),light:new H(new ft(0,0,0,.06)),hcDark:"#000000",hcLight:H.white},m("pickerTitleBackground","Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),Gj=E("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:H.white,hcLight:"#0F4A85"},m("pickerGroupForeground","Quick picker color for grouping labels.")),sve=E("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:H.white,hcLight:"#0F4A85"},m("pickerGroupBorder","Quick picker color for grouping borders.")),ove=E("keybindingLabel.background",{dark:new H(new ft(128,128,128,.17)),light:new H(new ft(221,221,221,.4)),hcDark:H.transparent,hcLight:H.transparent},m("keybindingLabelBackground","Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),rve=E("keybindingLabel.foreground",{dark:H.fromHex("#CCCCCC"),light:H.fromHex("#555555"),hcDark:H.white,hcLight:ee},m("keybindingLabelForeground","Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),ave=E("keybindingLabel.border",{dark:new H(new ft(51,51,51,.6)),light:new H(new ft(204,204,204,.4)),hcDark:new H(new ft(111,195,223)),hcLight:Je},m("keybindingLabelBorder","Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),lve=E("keybindingLabel.bottomBorder",{dark:new H(new ft(68,68,68,.6)),light:new H(new ft(187,187,187,.4)),hcDark:new H(new ft(111,195,223)),hcLight:ee},m("keybindingLabelBottomBorder","Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),hd=E("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},m("editorSelectionBackground","Color of the editor selection.")),cve=E("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:H.white},m("editorSelectionForeground","Color of the selected text for high contrast.")),Kj=E("editor.inactiveSelectionBackground",{light:we(hd,.5),dark:we(hd,.5),hcDark:we(hd,.7),hcLight:we(hd,.5)},m("editorInactiveSelection","Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),mP=E("editor.selectionHighlightBackground",{light:m7(hd,Yi,.3,.6),dark:m7(hd,Yi,.3,.6),hcDark:null,hcLight:null},m("editorSelectionHighlight","Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0);E("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:Gt,hcLight:Gt},m("editorSelectionHighlightBorder","Border color for regions with the same content as the selection."));const dve=E("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},m("editorFindMatch","Color of the current search match.")),$a=E("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},m("findMatchHighlight","Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0),uve=E("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},m("findRangeHighlight","Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),hve=E("editor.findMatchBorder",{light:null,dark:null,hcDark:Gt,hcLight:Gt},m("editorFindMatchBorder","Border color of the current search match.")),fd=E("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:Gt,hcLight:Gt},m("findMatchHighlightBorder","Border color of the other search matches.")),fve=E("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:we(Gt,.4),hcLight:we(Gt,.4)},m("findRangeHighlightBorder","Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);E("searchEditor.findMatchBackground",{light:we($a,.66),dark:we($a,.66),hcDark:$a,hcLight:$a},m("searchEditor.queryMatch","Color of the Search Editor query matches."));E("searchEditor.findMatchBorder",{light:we(fd,.66),dark:we(fd,.66),hcDark:fd,hcLight:fd},m("searchEditor.editorFindMatchBorder","Border color of the Search Editor query matches."));E("search.resultsInfoForeground",{light:ee,dark:we(ee,.65),hcDark:ee,hcLight:ee},m("search.resultsInfoForeground","Color of the text in the search viewlet's completion message."));E("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},m("hoverHighlight","Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."),!0);const c7=E("editorHoverWidget.background",{light:Ui,dark:Ui,hcDark:Ui,hcLight:Ui},m("hoverBackground","Background color of the editor hover."));E("editorHoverWidget.foreground",{light:Ha,dark:Ha,hcDark:Ha,hcLight:Ha},m("hoverForeground","Foreground color of the editor hover."));const gve=E("editorHoverWidget.border",{light:Ug,dark:Ug,hcDark:Ug,hcLight:Ug},m("hoverBorder","Border color of the editor hover."));E("editorHoverWidget.statusBarBackground",{dark:na(c7,.2),light:Gf(c7,.05),hcDark:Ui,hcLight:Ui},m("statusBarBackground","Background color of the editor hover status bar."));E("editorLink.activeForeground",{dark:"#4E94CE",light:H.blue,hcDark:H.cyan,hcLight:"#292929"},m("activeLinkForeground","Color of active links."));const gd=E("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:H.white,hcLight:H.black},m("editorInlayHintForeground","Foreground color of inline hints")),pd=E("editorInlayHint.background",{dark:we(yC,.1),light:we(yC,.1),hcDark:we(H.white,.1),hcLight:we(yC,.1)},m("editorInlayHintBackground","Background color of inline hints"));E("editorInlayHint.typeForeground",{dark:gd,light:gd,hcDark:gd,hcLight:gd},m("editorInlayHintForegroundTypes","Foreground color of inline hints for types"));E("editorInlayHint.typeBackground",{dark:pd,light:pd,hcDark:pd,hcLight:pd},m("editorInlayHintBackgroundTypes","Background color of inline hints for types"));E("editorInlayHint.parameterForeground",{dark:gd,light:gd,hcDark:gd,hcLight:gd},m("editorInlayHintForegroundParameter","Foreground color of inline hints for parameters"));E("editorInlayHint.parameterBackground",{dark:pd,light:pd,hcDark:pd,hcLight:pd},m("editorInlayHintBackgroundParameter","Background color of inline hints for parameters"));E("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},m("editorLightBulbForeground","The color used for the lightbulb actions icon."));E("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},m("editorLightBulbAutoFixForeground","The color used for the lightbulb auto fix actions icon."));const ET=new H(new ft(155,185,85,.2)),AT=new H(new ft(255,0,0,.2)),pve=E("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},m("diffEditorInserted","Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),mve=E("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},m("diffEditorRemoved","Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);E("diffEditor.insertedLineBackground",{dark:ET,light:ET,hcDark:null,hcLight:null},m("diffEditorInsertedLines","Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0);E("diffEditor.removedLineBackground",{dark:AT,light:AT,hcDark:null,hcLight:null},m("diffEditorRemovedLines","Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);E("diffEditorGutter.insertedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},m("diffEditorInsertedLineGutter","Background color for the margin where lines got inserted."));E("diffEditorGutter.removedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},m("diffEditorRemovedLineGutter","Background color for the margin where lines got removed."));const _ve=E("diffEditorOverview.insertedForeground",{dark:null,light:null,hcDark:null,hcLight:null},m("diffEditorOverviewInserted","Diff overview ruler foreground for inserted content.")),bve=E("diffEditorOverview.removedForeground",{dark:null,light:null,hcDark:null,hcLight:null},m("diffEditorOverviewRemoved","Diff overview ruler foreground for removed content."));E("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},m("diffEditorInsertedOutline","Outline color for the text that got inserted."));E("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},m("diffEditorRemovedOutline","Outline color for text that got removed."));E("diffEditor.border",{dark:null,light:null,hcDark:Je,hcLight:Je},m("diffEditorBorder","Border color between the two text editors."));E("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},m("diffDiagonalFill","Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views."));E("diffEditor.unchangedRegionBackground",{dark:"#3e3e3e",light:"#e4e4e4",hcDark:null,hcLight:null},m("diffEditor.unchangedRegionBackground","The background color of unchanged blocks in the diff editor."));E("diffEditor.unchangedRegionForeground",{dark:"#a3a2a2",light:"#4d4c4c",hcDark:null,hcLight:null},m("diffEditor.unchangedRegionForeground","The foreground color of unchanged blocks in the diff editor."));E("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},m("diffEditor.unchangedCodeBackground","The background color of unchanged code in the diff editor."));const vve=E("list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},m("listFocusBackground","List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),yve=E("list.focusForeground",{dark:null,light:null,hcDark:null,hcLight:null},m("listFocusForeground","List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),wve=E("list.focusOutline",{dark:Co,light:Co,hcDark:Gt,hcLight:Gt},m("listFocusOutline","List/Tree outline color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),Cve=E("list.focusAndSelectionOutline",{dark:null,light:null,hcDark:null,hcLight:null},m("listFocusAndSelectionOutline","List/Tree outline color for the focused item when the list/tree is active and selected. An active list/tree has keyboard focus, an inactive does not.")),ec=E("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:H.fromHex("#0F4A85").transparent(.1)},m("listActiveSelectionBackground","List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),Ua=E("list.activeSelectionForeground",{dark:H.white,light:H.white,hcDark:null,hcLight:null},m("listActiveSelectionForeground","List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),d_=E("list.activeSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},m("listActiveSelectionIconForeground","List/Tree icon foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),Sve=E("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:H.fromHex("#0F4A85").transparent(.1)},m("listInactiveSelectionBackground","List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),xve=E("list.inactiveSelectionForeground",{dark:null,light:null,hcDark:null,hcLight:null},m("listInactiveSelectionForeground","List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),Lve=E("list.inactiveSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},m("listInactiveSelectionIconForeground","List/Tree icon foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),Dve=E("list.inactiveFocusBackground",{dark:null,light:null,hcDark:null,hcLight:null},m("listInactiveFocusBackground","List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),kve=E("list.inactiveFocusOutline",{dark:null,light:null,hcDark:null,hcLight:null},m("listInactiveFocusOutline","List/Tree outline color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),Yj=E("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:H.white.transparent(.1),hcLight:H.fromHex("#0F4A85").transparent(.1)},m("listHoverBackground","List/Tree background when hovering over items using the mouse.")),Zj=E("list.hoverForeground",{dark:null,light:null,hcDark:null,hcLight:null},m("listHoverForeground","List/Tree foreground when hovering over items using the mouse.")),Eve=E("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},m("listDropBackground","List/Tree drag and drop background when moving items around using the mouse.")),Qy=E("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:Co,hcLight:Co},m("highlight","List/Tree foreground color of the match highlights when searching inside the list/tree."));E("list.focusHighlightForeground",{dark:Qy,light:s1e(ec,Qy,"#BBE7FF"),hcDark:Qy,hcLight:Qy},m("listFocusHighlightForeground","List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree."));E("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},m("invalidItemForeground","List/Tree foreground color for invalid items, for example an unresolved root in explorer."));E("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},m("listErrorForeground","Foreground color of list items containing errors."));E("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},m("listWarningForeground","Foreground color of list items containing warnings."));const Ave=E("listFilterWidget.background",{light:Gf(Ui,0),dark:na(Ui,0),hcDark:Ui,hcLight:Ui},m("listFilterWidgetBackground","Background color of the type filter widget in lists and trees.")),Ive=E("listFilterWidget.outline",{dark:H.transparent,light:H.transparent,hcDark:"#f38518",hcLight:"#007ACC"},m("listFilterWidgetOutline","Outline color of the type filter widget in lists and trees.")),Tve=E("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:Je,hcLight:Je},m("listFilterWidgetNoMatchesOutline","Outline color of the type filter widget in lists and trees, when there are no matches.")),Nve=E("listFilterWidget.shadow",{dark:Ql,light:Ql,hcDark:Ql,hcLight:Ql},m("listFilterWidgetShadow","Shadow color of the type filter widget in lists and trees."));E("list.filterMatchBackground",{dark:$a,light:$a,hcDark:null,hcLight:null},m("listFilterMatchHighlight","Background color of the filtered match."));E("list.filterMatchBorder",{dark:fd,light:fd,hcDark:Je,hcLight:Gt},m("listFilterMatchHighlightBorder","Border color of the filtered match."));const u_=E("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},m("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),Rve=E("tree.inactiveIndentGuidesStroke",{dark:we(u_,.4),light:we(u_,.4),hcDark:we(u_,.4),hcLight:we(u_,.4)},m("treeInactiveIndentGuidesStroke","Tree stroke color for the indentation guides that are not active.")),Mve=E("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},m("tableColumnsBorder","Table border color between columns.")),Pve=E("tree.tableOddRowsBackground",{dark:we(ee,.04),light:we(ee,.04),hcDark:null,hcLight:null},m("tableOddRowsBackgroundColor","Background color for odd table rows."));E("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},m("listDeemphasizedForeground","List/Tree foreground color for items that are deemphasized. "));const Ove=E("checkbox.background",{dark:Va,light:Va,hcDark:Va,hcLight:Va},m("checkbox.background","Background color of checkbox widget."));E("checkbox.selectBackground",{dark:Ui,light:Ui,hcDark:Ui,hcLight:Ui},m("checkbox.select.background","Background color of checkbox widget when the element it's in is selected."));const Fve=E("checkbox.foreground",{dark:Jl,light:Jl,hcDark:Jl,hcLight:Jl},m("checkbox.foreground","Foreground color of checkbox widget.")),Bve=E("checkbox.border",{dark:$g,light:$g,hcDark:$g,hcLight:$g},m("checkbox.border","Border color of checkbox widget."));E("checkbox.selectBorder",{dark:ud,light:ud,hcDark:ud,hcLight:ud},m("checkbox.select.border","Border color of checkbox widget when the element it's in is selected."));const d7=E("quickInput.list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},"",void 0,m("quickInput.list.focusBackground deprecation","Please use quickInputList.focusBackground instead")),IT=E("quickInputList.focusForeground",{dark:Ua,light:Ua,hcDark:Ua,hcLight:Ua},m("quickInput.listFocusForeground","Quick picker foreground color for the focused item.")),Xj=E("quickInputList.focusIconForeground",{dark:d_,light:d_,hcDark:d_,hcLight:d_},m("quickInput.listFocusIconForeground","Quick picker icon foreground color for the focused item.")),TT=E("quickInputList.focusBackground",{dark:ov(d7,ec),light:ov(d7,ec),hcDark:null,hcLight:null},m("quickInput.listFocusBackground","Quick picker background color for the focused item.")),Wve=E("menu.border",{dark:null,light:null,hcDark:Je,hcLight:Je},m("menuBorder","Border color of menus.")),Vve=E("menu.foreground",{dark:Jl,light:Jl,hcDark:Jl,hcLight:Jl},m("menuForeground","Foreground color of menu items.")),zve=E("menu.background",{dark:Va,light:Va,hcDark:Va,hcLight:Va},m("menuBackground","Background color of menu items.")),Hve=E("menu.selectionForeground",{dark:Ua,light:Ua,hcDark:Ua,hcLight:Ua},m("menuSelectionForeground","Foreground color of the selected menu item in menus.")),$ve=E("menu.selectionBackground",{dark:ec,light:ec,hcDark:ec,hcLight:ec},m("menuSelectionBackground","Background color of the selected menu item in menus.")),Uve=E("menu.selectionBorder",{dark:null,light:null,hcDark:Gt,hcLight:Gt},m("menuSelectionBorder","Border color of the selected menu item in menus.")),jve=E("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:Je,hcLight:Je},m("menuSeparatorBackground","Color of a separator menu item in menus.")),NT=E("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},m("toolbarHoverBackground","Toolbar background when hovering over actions using the mouse"));E("toolbar.hoverOutline",{dark:null,light:null,hcDark:Gt,hcLight:Gt},m("toolbarHoverOutline","Toolbar outline when hovering over actions using the mouse"));E("toolbar.activeBackground",{dark:na(NT,.1),light:Gf(NT,.1),hcDark:null,hcLight:null},m("toolbarActiveBackground","Toolbar background when holding the mouse over actions"));E("editor.snippetTabstopHighlightBackground",{dark:new H(new ft(124,124,124,.3)),light:new H(new ft(10,50,100,.2)),hcDark:new H(new ft(124,124,124,.3)),hcLight:new H(new ft(10,50,100,.2))},m("snippetTabstopHighlightBackground","Highlight background color of a snippet tabstop."));E("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hcDark:null,hcLight:null},m("snippetTabstopHighlightBorder","Highlight border color of a snippet tabstop."));E("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},m("snippetFinalTabstopHighlightBackground","Highlight background color of the final tabstop of a snippet."));E("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new H(new ft(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},m("snippetFinalTabstopHighlightBorder","Highlight border color of the final tabstop of a snippet."));const qve=E("breadcrumb.foreground",{light:we(ee,.8),dark:we(ee,.8),hcDark:we(ee,.8),hcLight:we(ee,.8)},m("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),Gve=E("breadcrumb.background",{light:Yi,dark:Yi,hcDark:Yi,hcLight:Yi},m("breadcrumbsBackground","Background color of breadcrumb items.")),u7=E("breadcrumb.focusForeground",{light:Gf(ee,.2),dark:na(ee,.1),hcDark:na(ee,.1),hcLight:na(ee,.1)},m("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),Kve=E("breadcrumb.activeSelectionForeground",{light:Gf(ee,.2),dark:na(ee,.1),hcDark:na(ee,.1),hcLight:na(ee,.1)},m("breadcrumbsSelectedForeground","Color of selected breadcrumb items."));E("breadcrumbPicker.background",{light:Ui,dark:Ui,hcDark:Ui,hcLight:Ui},m("breadcrumbsSelectedBackground","Background color of breadcrumb item picker."));const Qj=.5,h7=H.fromHex("#40C8AE").transparent(Qj),f7=H.fromHex("#40A6FF").transparent(Qj),g7=H.fromHex("#606060").transparent(.4),fr=.4,xm=1,jg=E("merge.currentHeaderBackground",{dark:h7,light:h7,hcDark:null,hcLight:null},m("mergeCurrentHeaderBackground","Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);E("merge.currentContentBackground",{dark:we(jg,fr),light:we(jg,fr),hcDark:we(jg,fr),hcLight:we(jg,fr)},m("mergeCurrentContentBackground","Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const qg=E("merge.incomingHeaderBackground",{dark:f7,light:f7,hcDark:null,hcLight:null},m("mergeIncomingHeaderBackground","Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);E("merge.incomingContentBackground",{dark:we(qg,fr),light:we(qg,fr),hcDark:we(qg,fr),hcLight:we(qg,fr)},m("mergeIncomingContentBackground","Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const Gg=E("merge.commonHeaderBackground",{dark:g7,light:g7,hcDark:null,hcLight:null},m("mergeCommonHeaderBackground","Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);E("merge.commonContentBackground",{dark:we(Gg,fr),light:we(Gg,fr),hcDark:we(Gg,fr),hcLight:we(Gg,fr)},m("mergeCommonContentBackground","Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const Lm=E("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},m("mergeBorder","Border color on headers and the splitter in inline merge-conflicts."));E("editorOverviewRuler.currentContentForeground",{dark:we(jg,xm),light:we(jg,xm),hcDark:Lm,hcLight:Lm},m("overviewRulerCurrentContentForeground","Current overview ruler foreground for inline merge-conflicts."));E("editorOverviewRuler.incomingContentForeground",{dark:we(qg,xm),light:we(qg,xm),hcDark:Lm,hcLight:Lm},m("overviewRulerIncomingContentForeground","Incoming overview ruler foreground for inline merge-conflicts."));E("editorOverviewRuler.commonContentForeground",{dark:we(Gg,xm),light:we(Gg,xm),hcDark:Lm,hcLight:Lm},m("overviewRulerCommonContentForeground","Common ancestor overview ruler foreground for inline merge-conflicts."));const _P=E("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:""},m("overviewRulerFindMatchForeground","Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),h_=E("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},m("overviewRulerSelectionHighlightForeground","Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),Kg=E("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},m("minimapFindMatchHighlight","Minimap marker color for find matches."),!0),_D=E("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},m("minimapSelectionOccurrenceHighlight","Minimap marker color for repeating editor selections."),!0),p7=E("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},m("minimapSelectionHighlight","Minimap marker color for the editor selection."),!0),Yve=E("minimap.infoHighlight",{dark:Es,light:Es,hcDark:sv,hcLight:sv},m("minimapInfo","Minimap marker color for infos.")),Zve=E("minimap.warningHighlight",{dark:So,light:So,hcDark:nv,hcLight:nv},m("overviewRuleWarning","Minimap marker color for warnings.")),Xve=E("minimap.errorHighlight",{dark:new H(new ft(255,18,18,.7)),light:new H(new ft(255,18,18,.7)),hcDark:new H(new ft(255,50,50,1)),hcLight:"#B5200D"},m("minimapError","Minimap marker color for errors.")),Qve=E("minimap.background",{dark:null,light:null,hcDark:null,hcLight:null},m("minimapBackground","Minimap background color.")),Jve=E("minimap.foregroundOpacity",{dark:H.fromHex("#000f"),light:H.fromHex("#000f"),hcDark:H.fromHex("#000f"),hcLight:H.fromHex("#000f")},m("minimapForegroundOpacity",'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.'));E("minimapSlider.background",{light:we(a_,.5),dark:we(a_,.5),hcDark:we(a_,.5),hcLight:we(a_,.5)},m("minimapSliderBackground","Minimap slider background color."));E("minimapSlider.hoverBackground",{light:we(l_,.5),dark:we(l_,.5),hcDark:we(l_,.5),hcLight:we(l_,.5)},m("minimapSliderHoverBackground","Minimap slider background color when hovering."));E("minimapSlider.activeBackground",{light:we(c_,.5),dark:we(c_,.5),hcDark:we(c_,.5),hcLight:we(c_,.5)},m("minimapSliderActiveBackground","Minimap slider background color when clicked on."));const e1e=E("problemsErrorIcon.foreground",{dark:za,light:za,hcDark:za,hcLight:za},m("problemsErrorIconForeground","The color used for the problems error icon.")),t1e=E("problemsWarningIcon.foreground",{dark:So,light:So,hcDark:So,hcLight:So},m("problemsWarningIconForeground","The color used for the problems warning icon.")),i1e=E("problemsInfoIcon.foreground",{dark:Es,light:Es,hcDark:Es,hcLight:Es},m("problemsInfoIconForeground","The color used for the problems info icon."));E("charts.foreground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("chartsForeground","The foreground color used in charts."));E("charts.lines",{dark:we(ee,.5),light:we(ee,.5),hcDark:we(ee,.5),hcLight:we(ee,.5)},m("chartsLines","The color used for horizontal lines in charts."));E("charts.red",{dark:za,light:za,hcDark:za,hcLight:za},m("chartsRed","The red color used in chart visualizations."));E("charts.blue",{dark:Es,light:Es,hcDark:Es,hcLight:Es},m("chartsBlue","The blue color used in chart visualizations."));E("charts.yellow",{dark:So,light:So,hcDark:So,hcLight:So},m("chartsYellow","The yellow color used in chart visualizations."));E("charts.orange",{dark:Kg,light:Kg,hcDark:Kg,hcLight:Kg},m("chartsOrange","The orange color used in chart visualizations."));E("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},m("chartsGreen","The green color used in chart visualizations."));E("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},m("chartsPurple","The purple color used in chart visualizations."));function n1e(n,e){var t,i,s,o;switch(n.op){case 0:return(t=Vr(n.value,e))===null||t===void 0?void 0:t.darken(n.factor);case 1:return(i=Vr(n.value,e))===null||i===void 0?void 0:i.lighten(n.factor);case 2:return(s=Vr(n.value,e))===null||s===void 0?void 0:s.transparent(n.factor);case 3:{const r=Vr(n.background,e);return r?(o=Vr(n.value,e))===null||o===void 0?void 0:o.makeOpaque(r):Vr(n.value,e)}case 4:for(const r of n.values){const a=Vr(r,e);if(a)return a}return;case 6:return Vr(e.defines(n.if)?n.then:n.else,e);case 5:{const r=Vr(n.value,e);if(!r)return;const a=Vr(n.background,e);return a?r.isDarkerThan(a)?H.getLighterColor(r,a,n.factor).transparent(n.transparency):H.getDarkerColor(r,a,n.factor).transparent(n.transparency):r.transparent(n.factor*n.transparency)}default:throw K4()}}function Gf(n,e){return{op:0,value:n,factor:e}}function na(n,e){return{op:1,value:n,factor:e}}function we(n,e){return{op:2,value:n,factor:e}}function ov(...n){return{op:4,values:n}}function s1e(n,e,t){return{op:6,if:n,then:e,else:t}}function m7(n,e,t,i){return{op:5,value:n,background:e,factor:t,transparency:i}}function Vr(n,e){if(n!==null){if(typeof n=="string")return n[0]==="#"?H.fromHex(n):e.getColor(n);if(n instanceof H)return n;if(typeof n=="object")return n1e(n,e)}}const Jj="vscode://schemas/workbench-colors",eq=_n.as(dD.JSONContribution);eq.registerSchema(Jj,mD.getColorSchema());const _7=new Di(()=>eq.notifySchemaChanged(Jj),200);mD.onDidChangeSchema(()=>{_7.isScheduled()||_7.schedule()});class bD{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(){return new tq(this.x-window.scrollX,this.y-window.scrollY)}}class tq{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(){return new bD(this.clientX+window.scrollX,this.clientY+window.scrollY)}}class o1e{constructor(e,t,i,s){this.x=e,this.y=t,this.width=i,this.height=s,this._editorPagePositionBrand=void 0}}class r1e{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function bP(n){const e=Rn(n);return new o1e(e.left,e.top,e.width,e.height)}function vP(n,e,t){const i=e.width/n.offsetWidth,s=e.height/n.offsetHeight,o=(t.x-e.x)/i,r=(t.y-e.y)/s;return new r1e(o,r)}class ou extends ur{constructor(e,t,i){super(e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new bD(this.posx,this.posy),this.editorPos=bP(i),this.relativePos=vP(i,this.editorPos,this.pos)}}class a1e{constructor(e){this._editorViewDomNode=e}_create(e){return new ou(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return K(e,"contextmenu",i=>{t(this._create(i))})}onMouseUp(e,t){return K(e,"mouseup",i=>{t(this._create(i))})}onMouseDown(e,t){return K(e,de.MOUSE_DOWN,i=>{t(this._create(i))})}onPointerDown(e,t){return K(e,de.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onMouseLeave(e,t){return K(e,de.MOUSE_LEAVE,i=>{t(this._create(i))})}onMouseMove(e,t){return K(e,"mousemove",i=>t(this._create(i)))}}class l1e{constructor(e){this._editorViewDomNode=e}_create(e){return new ou(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return K(e,"pointerup",i=>{t(this._create(i))})}onPointerDown(e,t){return K(e,de.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onPointerLeave(e,t){return K(e,de.POINTER_LEAVE,i=>{t(this._create(i))})}onPointerMove(e,t){return K(e,"pointermove",i=>t(this._create(i)))}}class c1e extends Y{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new pD),this._keydownListener=null}startMonitoring(e,t,i,s,o){this._keydownListener=ji(e.ownerDocument,"keydown",r=>{r.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,r.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,t,i,r=>{s(new ou(r,!0,this._editorViewDomNode))},r=>{this._keydownListener.dispose(),o(r)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}class X1 extends Y{constructor(){super(),this._shouldRender=!0}shouldRender(){return this._shouldRender}forceShouldRender(){this._shouldRender=!0}setShouldRender(){this._shouldRender=!0}onDidRender(){this._shouldRender=!1}onCompositionStart(e){return!1}onCompositionEnd(e){return!1}onConfigurationChanged(e){return!1}onCursorStateChanged(e){return!1}onDecorationsChanged(e){return!1}onFlushed(e){return!1}onFocusChanged(e){return!1}onLanguageConfigurationChanged(e){return!1}onLineMappingChanged(e){return!1}onLinesChanged(e){return!1}onLinesDeleted(e){return!1}onLinesInserted(e){return!1}onRevealRangeRequest(e){return!1}onScrollChanged(e){return!1}onThemeChanged(e){return!1}onTokensChanged(e){return!1}onTokensColorsChanged(e){return!1}onZonesChanged(e){return!1}handleEvents(e){let t=!1;for(let i=0,s=e.length;i=a.left?s.width=Math.max(s.width,a.left+a.width-s.left):(t[i++]=s,s=a)}return t[i++]=s,t}static _createHorizontalRangesFromClientRects(e,t,i){if(!e||e.length===0)return null;const s=[];for(let o=0,r=e.length;ol)return null;if(t=Math.min(l,Math.max(0,t)),s=Math.min(l,Math.max(0,s)),t===s&&i===o&&i===0&&!e.children[t].firstChild){const h=e.children[t].getClientRects();return r.markDidDomLayout(),this._createHorizontalRangesFromClientRects(h,r.clientRectDeltaLeft,r.clientRectScale)}t!==s&&s>0&&o===0&&(s--,o=1073741824);let c=e.children[t].firstChild,d=e.children[s].firstChild;if((!c||!d)&&(!c&&i===0&&t>0&&(c=e.children[t-1].firstChild,i=1073741824),!d&&o===0&&s>0&&(d=e.children[s-1].firstChild,o=1073741824)),!c||!d)return null;i=Math.min(c.textContent.length,Math.max(0,i)),o=Math.min(d.textContent.length,Math.max(0,o));const u=this._readClientRects(c,i,d,o,r.endNode);return r.markDidDomLayout(),this._createHorizontalRangesFromClientRects(u,r.clientRectDeltaLeft,r.clientRectScale)}}var Wo;(function(n){n.DARK="dark",n.LIGHT="light",n.HIGH_CONTRAST_DARK="hcDark",n.HIGH_CONTRAST_LIGHT="hcLight"})(Wo||(Wo={}));function ac(n){return n===Wo.HIGH_CONTRAST_DARK||n===Wo.HIGH_CONTRAST_LIGHT}function yD(n){return n===Wo.DARK||n===Wo.HIGH_CONTRAST_DARK}const g1e=function(){return dp?!0:!(Jn||Lr||bc)}();let yp=!0;class v7{constructor(e,t){this.themeType=t;const i=e.options,s=i.get(50);i.get(38)==="off"?this.renderWhitespace=i.get(98):this.renderWhitespace="none",this.renderControlCharacters=i.get(93),this.spaceWidth=s.spaceWidth,this.middotWidth=s.middotWidth,this.wsmiddotWidth=s.wsmiddotWidth,this.useMonospaceOptimizations=s.isMonospace&&!i.get(33),this.canUseHalfwidthRightwardsArrow=s.canUseHalfwidthRightwardsArrow,this.lineHeight=i.get(66),this.stopRenderingLineAfter=i.get(116),this.fontLigatures=i.get(51)}equals(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.fontLigatures===e.fontLigatures}}class Na{constructor(e){this._options=e,this._isMaybeInvalid=!0,this._renderedViewLine=null}getDomNode(){return this._renderedViewLine&&this._renderedViewLine.domNode?this._renderedViewLine.domNode.domNode:null}setDomNode(e){if(this._renderedViewLine)this._renderedViewLine.domNode=vt(e);else throw new Error("I have no rendered view line to set the dom node to...")}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return ac(this._options.themeType)||this._options.renderWhitespace==="selection"?(this._isMaybeInvalid=!0,!0):!1}renderLine(e,t,i,s){if(this._isMaybeInvalid===!1)return!1;this._isMaybeInvalid=!1;const o=i.getViewLineRenderingData(e),r=this._options,a=hr.filter(o.inlineDecorations,e,o.minColumn,o.maxColumn);let l=null;if(ac(r.themeType)||this._options.renderWhitespace==="selection"){const h=i.selections;for(const f of h){if(f.endLineNumbere)continue;const g=f.startLineNumber===e?f.startColumn:o.minColumn,p=f.endLineNumber===e?f.endColumn:o.maxColumn;g');const d=cP(c,s);s.appendString("");let u=null;return yp&&g1e&&o.isBasicASCII&&r.useMonospaceOptimizations&&d.containsForeignElements===0&&(u=new Jy(this._renderedViewLine?this._renderedViewLine.domNode:null,c,d.characterMapping)),u||(u=nq(this._renderedViewLine?this._renderedViewLine.domNode:null,c,d.characterMapping,d.containsRTL,d.containsForeignElements)),this._renderedViewLine=u,!0}layoutLine(e,t){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(this._options.lineHeight))}getWidth(e){return this._renderedViewLine?this._renderedViewLine.getWidth(e):0}getWidthIsFast(){return this._renderedViewLine?this._renderedViewLine.getWidthIsFast():!0}needsMonospaceFontCheck(){return this._renderedViewLine?this._renderedViewLine instanceof Jy:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof Jy?this._renderedViewLine.monospaceAssumptionsAreValid():yp}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof Jy&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,i,s){if(!this._renderedViewLine)return null;t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t)),i=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,i));const o=this._renderedViewLine.input.stopRenderingLineAfter;if(o!==-1&&t>o+1&&i>o+1)return new b7(!0,[new Zh(this.getWidth(s),0)]);o!==-1&&t>o+1&&(t=o+1),o!==-1&&i>o+1&&(i=o+1);const r=this._renderedViewLine.getVisibleRangesForRange(e,t,i,s);return r&&r.length>0?new b7(!1,r):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}}Na.CLASS_NAME="view-line";class Jy{constructor(e,t,i){this._cachedWidth=-1,this.domNode=e,this.input=t;const s=Math.floor(t.lineContent.length/300);if(s>0){this._keyColumnPixelOffsetCache=new Float32Array(s);for(let o=0;o=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),yp=!1)}return yp}toSlowRenderedLine(){return nq(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,t,i,s){const o=this._getColumnPixelOffset(e,t,s),r=this._getColumnPixelOffset(e,i,s);return[new Zh(o,r-o)]}_getColumnPixelOffset(e,t,i){if(t<=300){const c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}const s=Math.floor((t-1)/300)-1,o=(s+1)*300+1;let r=-1;if(this._keyColumnPixelOffsetCache&&(r=this._keyColumnPixelOffsetCache[s],r===-1&&(r=this._actualReadPixelOffset(e,o,i),this._keyColumnPixelOffsetCache[s]=r)),r===-1){const c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}const a=this._characterMapping.getHorizontalOffset(o),l=this._characterMapping.getHorizontalOffset(t);return r+this._charWidth*(l-a)}_getReadingTarget(e){return e.domNode.firstChild}_actualReadPixelOffset(e,t,i){if(!this.domNode)return-1;const s=this._characterMapping.getDomPosition(t),o=wC.readHorizontalRanges(this._getReadingTarget(this.domNode),s.partIndex,s.charIndex,s.partIndex,s.charIndex,i);return!o||o.length===0?-1:o[0].left}getColumnOfNodeOffset(e,t){return sq(this._characterMapping,e,t)}}class iq{constructor(e,t,i,s,o){if(this.domNode=e,this.input=t,this._characterMapping=i,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=o,this._cachedWidth=-1,this._pixelOffsetCache=null,!s||this._characterMapping.length===0){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let r=0,a=this._characterMapping.length;r<=a;r++)this._pixelOffsetCache[r]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(e){return this.domNode?(this._cachedWidth===-1&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e==null||e.markDidDomLayout()),this._cachedWidth):0}getWidthIsFast(){return this._cachedWidth!==-1}getVisibleRangesForRange(e,t,i,s){if(!this.domNode)return null;if(this._pixelOffsetCache!==null){const o=this._readPixelOffset(this.domNode,e,t,s);if(o===-1)return null;const r=this._readPixelOffset(this.domNode,e,i,s);return r===-1?null:[new Zh(o,r-o)]}return this._readVisibleRangesForRange(this.domNode,e,t,i,s)}_readVisibleRangesForRange(e,t,i,s,o){if(i===s){const r=this._readPixelOffset(e,t,i,o);return r===-1?null:[new Zh(r,0)]}else return this._readRawVisibleRangesForRange(e,i,s,o)}_readPixelOffset(e,t,i,s){if(this._characterMapping.length===0){if(this._containsForeignElements===0||this._containsForeignElements===2)return 0;if(this._containsForeignElements===1)return this.getWidth(s);const o=this._getReadingTarget(e);return o.firstChild?(s.markDidDomLayout(),o.firstChild.offsetWidth):0}if(this._pixelOffsetCache!==null){const o=this._pixelOffsetCache[i];if(o!==-1)return o;const r=this._actualReadPixelOffset(e,t,i,s);return this._pixelOffsetCache[i]=r,r}return this._actualReadPixelOffset(e,t,i,s)}_actualReadPixelOffset(e,t,i,s){if(this._characterMapping.length===0){const l=wC.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,s);return!l||l.length===0?-1:l[0].left}if(i===this._characterMapping.length&&this._isWhitespaceOnly&&this._containsForeignElements===0)return this.getWidth(s);const o=this._characterMapping.getDomPosition(i),r=wC.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,o.partIndex,o.charIndex,s);if(!r||r.length===0)return-1;const a=r[0].left;if(this.input.isBasicASCII){const l=this._characterMapping.getHorizontalOffset(i),c=Math.round(this.input.spaceWidth*l);if(Math.abs(c-a)<=1)return c}return a}_readRawVisibleRangesForRange(e,t,i,s){if(t===1&&i===this._characterMapping.length)return[new Zh(0,this.getWidth(s))];const o=this._characterMapping.getDomPosition(t),r=this._characterMapping.getDomPosition(i);return wC.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,r.partIndex,r.charIndex,s)}getColumnOfNodeOffset(e,t){return sq(this._characterMapping,e,t)}}class p1e extends iq{_readVisibleRangesForRange(e,t,i,s,o){const r=super._readVisibleRangesForRange(e,t,i,s,o);if(!r||r.length===0||i===s||i===1&&s===this._characterMapping.length)return r;if(!this.input.containsRTL){const a=this._readPixelOffset(e,t,s,o);if(a!==-1){const l=r[r.length-1];l.left=t){const u=t-r;return c-t=4&&e[0]===3&&e[3]===7}static isStrictChildOfViewLines(e){return e.length>4&&e[0]===3&&e[3]===7}static isChildOfScrollableElement(e){return e.length>=2&&e[0]===3&&e[1]===5}static isChildOfMinimap(e){return e.length>=2&&e[0]===3&&e[1]===8}static isChildOfContentWidgets(e){return e.length>=4&&e[0]===3&&e[3]===1}static isChildOfOverflowGuard(e){return e.length>=1&&e[0]===3}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&e[0]===2}static isChildOfOverlayWidgets(e){return e.length>=2&&e[0]===3&&e[1]===4}}class Dm{constructor(e,t,i){this.viewModel=e.viewModel;const s=e.configuration.options;this.layoutInfo=s.get(143),this.viewDomNode=t.viewDomNode,this.lineHeight=s.get(66),this.stickyTabStops=s.get(115),this.typicalHalfwidthCharacterWidth=s.get(50).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return Dm.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){const s=i.verticalOffset+i.height/2,o=e.viewModel.getLineCount();let r=null,a,l=null;return i.afterLineNumber!==o&&(l=new V(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(r=new V(i.afterLineNumber,e.viewModel.getLineMaxColumn(i.afterLineNumber))),l===null?a=r:r===null?a=l:t=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,yn._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class yP extends v1e{constructor(e,t,i,s,o){super(e,t,i,s),this._ctx=e,o?(this.target=o,this.targetPath=sl.collect(o,e.viewDomNode)):(this.target=null,this.targetPath=new Uint8Array(0))}toString(){return`pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), relativePos(${this.relativePos.x},${this.relativePos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset} - target: ${this.target?this.target.outerHTML:null}`}_getMouseColumn(e=null){return e&&e.columnr.contentLeft+r.width)continue;const a=e.getVerticalOffsetForLineNumber(r.position.lineNumber);if(a<=o&&o<=a+r.height)return t.fulfillContentText(r.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){const s=t.isInContentArea?8:5;return t.fulfillViewZone(s,i.position,i)}return null}static _hitTestTextArea(e,t){return uo.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfillContentText(e.lastRenderData.lastTextareaPosition,null,{mightBeForeignElement:!1,injectedText:null}):t.fulfillTextarea():null}static _hitTestMargin(e,t){if(t.isInMarginArea){const i=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),s=i.range.getStartPosition();let o=Math.abs(t.relativePos.x);const r={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:o};return o-=e.layoutInfo.glyphMarginLeft,o<=e.layoutInfo.glyphMarginWidth?t.fulfillMargin(2,s,i.range,r):(o-=e.layoutInfo.glyphMarginWidth,o<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(3,s,i.range,r):(o-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(4,s,i.range,r)))}return null}static _hitTestViewLines(e,t,i){if(!uo.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new V(1,1),y7);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const o=e.viewModel.getLineCount(),r=e.viewModel.getLineMaxColumn(o);return t.fulfillContentEmpty(new V(o,r),y7)}if(i){if(uo.isStrictChildOfViewLines(t.targetPath)){const o=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(e.viewModel.getLineLength(o)===0){const a=e.getLineWidth(o),l=D2(t.mouseContentHorizontalOffset-a);return t.fulfillContentEmpty(new V(o,1),l)}const r=e.getLineWidth(o);if(t.mouseContentHorizontalOffset>=r){const a=D2(t.mouseContentHorizontalOffset-r),l=new V(o,e.viewModel.getLineMaxColumn(o));return t.fulfillContentEmpty(l,a)}}return t.fulfillUnknown()}const s=yn._doHitTest(e,t);return s.type===1?yn.createMouseTargetFromHitTestPosition(e,t,s.spanNode,s.position,s.injectedText):this._createMouseTarget(e,t.withTarget(s.hitTarget),!0)}static _hitTestMinimap(e,t){if(uo.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),s=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new V(i,s))}return null}static _hitTestScrollbarSlider(e,t){if(uo.isChildOfScrollableElement(t.targetPath)&&t.target&&t.target.nodeType===1){const i=t.target.className;if(i&&/\b(slider|scrollbar)\b/.test(i)){const s=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),o=e.viewModel.getLineMaxColumn(s);return t.fulfillScrollbar(new V(s,o))}}return null}static _hitTestScrollbar(e,t){if(uo.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),s=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new V(i,s))}return null}getMouseColumn(e){const t=this._context.configuration.options,i=t.get(143),s=this._context.viewLayout.getCurrentScrollLeft()+e.x-i.contentLeft;return yn._getMouseColumn(s,t.get(50).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,i,s,o){const r=s.lineNumber,a=s.column,l=e.getLineWidth(r);if(t.mouseContentHorizontalOffset>l){const v=D2(t.mouseContentHorizontalOffset-l);return t.fulfillContentEmpty(s,v)}const c=e.visibleRangeForPosition(r,a);if(!c)return t.fulfillUnknown(s);const d=c.left;if(Math.abs(t.mouseContentHorizontalOffset-d)<1)return t.fulfillContentText(s,null,{mightBeForeignElement:!!o,injectedText:o});const u=[];if(u.push({offset:c.left,column:a}),a>1){const v=e.visibleRangeForPosition(r,a-1);v&&u.push({offset:v.left,column:a-1})}const h=e.viewModel.getLineMaxColumn(r);if(av.offset-b.offset);const f=t.pos.toClientCoordinates(),g=i.getBoundingClientRect(),p=g.left<=f.clientX&&f.clientX<=g.right;let _=null;for(let v=1;vo)){const a=Math.floor((s+o)/2);let l=t.pos.y+(a-t.mouseVerticalOffset);l<=t.editorPos.y&&(l=t.editorPos.y+1),l>=t.editorPos.y+t.editorPos.height&&(l=t.editorPos.y+t.editorPos.height-1);const c=new bD(t.pos.x,l),d=this._actualDoHitTestWithCaretRangeFromPoint(e,c.toClientCoordinates());if(d.type===1)return d}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates())}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const i=bm(e.viewDomNode);let s;if(i?typeof i.caretRangeFromPoint>"u"?s=y1e(i,t.clientX,t.clientY):s=i.caretRangeFromPoint(t.clientX,t.clientY):s=e.viewDomNode.ownerDocument.caretRangeFromPoint(t.clientX,t.clientY),!s||!s.startContainer)return new Hc;const o=s.startContainer;if(o.nodeType===o.TEXT_NODE){const r=o.parentNode,a=r?r.parentNode:null,l=a?a.parentNode:null;return(l&&l.nodeType===l.ELEMENT_NODE?l.className:null)===Na.CLASS_NAME?dh.createFromDOMInfo(e,r,s.startOffset):new Hc(o.parentNode)}else if(o.nodeType===o.ELEMENT_NODE){const r=o.parentNode,a=r?r.parentNode:null;return(a&&a.nodeType===a.ELEMENT_NODE?a.className:null)===Na.CLASS_NAME?dh.createFromDOMInfo(e,o,o.textContent.length):new Hc(o)}return new Hc}static _doHitTestWithCaretPositionFromPoint(e,t){const i=e.viewDomNode.ownerDocument.caretPositionFromPoint(t.clientX,t.clientY);if(i.offsetNode.nodeType===i.offsetNode.TEXT_NODE){const s=i.offsetNode.parentNode,o=s?s.parentNode:null,r=o?o.parentNode:null;return(r&&r.nodeType===r.ELEMENT_NODE?r.className:null)===Na.CLASS_NAME?dh.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new Hc(i.offsetNode.parentNode)}if(i.offsetNode.nodeType===i.offsetNode.ELEMENT_NODE){const s=i.offsetNode.parentNode,o=s&&s.nodeType===s.ELEMENT_NODE?s.className:null,r=s?s.parentNode:null,a=r&&r.nodeType===r.ELEMENT_NODE?r.className:null;if(o===Na.CLASS_NAME){const l=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(l)return dh.createFromDOMInfo(e,l,0)}else if(a===Na.CLASS_NAME)return dh.createFromDOMInfo(e,i.offsetNode,0)}return new Hc(i.offsetNode)}static _snapToSoftTabBoundary(e,t){const i=t.getLineContent(e.lineNumber),{tabSize:s}=t.model.getOptions(),o=rv.atomicPosition(i,e.column-1,s,2);return o!==-1?new V(e.lineNumber,o+1):e}static _doHitTest(e,t){let i=new Hc;if(typeof e.viewDomNode.ownerDocument.caretRangeFromPoint=="function"?i=this._doHitTestWithCaretRangeFromPoint(e,t):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(i=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates())),i.type===1){const s=e.viewModel.getInjectedTextAt(i.position),o=e.viewModel.normalizePosition(i.position,2);(s||!o.equals(i.position))&&(i=new oq(o,i.spanNode,s))}return i}}function y1e(n,e,t){const i=document.createRange();let s=n.elementFromPoint(e,t);if(s!==null){for(;s&&s.firstChild&&s.firstChild.nodeType!==s.firstChild.TEXT_NODE&&s.lastChild&&s.lastChild.firstChild;)s=s.lastChild;const o=s.getBoundingClientRect(),r=window.getComputedStyle(s,null).getPropertyValue("font-style"),a=window.getComputedStyle(s,null).getPropertyValue("font-variant"),l=window.getComputedStyle(s,null).getPropertyValue("font-weight"),c=window.getComputedStyle(s,null).getPropertyValue("font-size"),d=window.getComputedStyle(s,null).getPropertyValue("line-height"),u=window.getComputedStyle(s,null).getPropertyValue("font-family"),h=`${r} ${a} ${l} ${c}/${d} ${u}`,f=s.innerText;let g=o.left,p=0,_;if(e>o.left+o.width)p=f.length;else{const v=Eh.getInstance();for(let b=0;bt(new ur(i))))}onmousedown(e,t){this._register(K(e,de.MOUSE_DOWN,i=>t(new ur(i))))}onmouseover(e,t){this._register(K(e,de.MOUSE_OVER,i=>t(new ur(i))))}onmouseleave(e,t){this._register(K(e,de.MOUSE_LEAVE,i=>t(new ur(i))))}onkeydown(e,t){this._register(K(e,de.KEY_DOWN,i=>t(new Ht(i))))}onkeyup(e,t){this._register(K(e,de.KEY_UP,i=>t(new Ht(i))))}oninput(e,t){this._register(K(e,de.INPUT,t))}onblur(e,t){this._register(K(e,de.BLUR,t))}onfocus(e,t){this._register(K(e,de.FOCUS,t))}ignoreGesture(e){return Mt.ignoreTarget(e)}};const km=11;class w1e extends fa{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.classList.add(...Te.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width=km+"px",this.domNode.style.height=km+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new pD),this._register(ji(this.bgDomNode,de.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(ji(this.domNode,de.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new G1),this._pointerdownScheduleRepeatTimer=this._register(new Lc)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24)};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,i=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}}class C1e extends Y{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new Lc)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){const e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{var e;(e=this._domNode)===null||e===void 0||e.setClassName(this._visibleClassName)},0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)===null||t===void 0||t.setClassName(this._invisibleClassName+(e?" fade":"")))}}const S1e=140;class rq extends fa{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new C1e(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new pD),this._shouldRender=!0,this.domNode=vt(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(K(this.domNode.domNode,de.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){const t=this._register(new w1e(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,s){this.slider=vt(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof i=="number"&&this.slider.setWidth(i),typeof s=="number"&&this.slider.setHeight(s),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(K(this.slider.domNode,de.POINTER_DOWN,o=>{o.button===0&&(o.preventDefault(),this._sliderPointerDown(o))})),this.onclick(this.slider.domNode,o=>{o.leftButton&&o.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){const t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),s=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderPointerPosition(e);i<=o&&o<=s?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,i=e.offsetY;else{const o=Rn(this.domNode.domNode);t=e.pageX-o.left,i=e.pageY-o.top}const s=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(s):this._scrollbarState.getDesiredScrollPositionFromOffset(s)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._sliderPointerPosition(e),i=this._sliderOrthogonalPointerPosition(e),s=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>{const r=this._sliderOrthogonalPointerPosition(o),a=Math.abs(r-i);if(Fs&&a>S1e){this._setDesiredScrollPositionNow(s.getScrollPosition());return}const c=this._sliderPointerPosition(o)-t;this._setDesiredScrollPositionNow(s.getDesiredScrollPositionFromDelta(c))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){const t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}}const x1e=20;class Em{constructor(e,t,i,s,o,r){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=s,this._scrollSize=o,this._scrollPosition=r,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new Em(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){const t=Math.round(e);return this._visibleSize!==t?(this._visibleSize=t,this._refreshComputedValues(),!0):!1}setScrollSize(e){const t=Math.round(e);return this._scrollSize!==t?(this._scrollSize=t,this._refreshComputedValues(),!0):!1}setScrollPosition(e){const t=Math.round(e);return this._scrollPosition!==t?(this._scrollPosition=t,this._refreshComputedValues(),!0):!1}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,i,s,o){const r=Math.max(0,i-e),a=Math.max(0,r-2*t),l=s>0&&s>i;if(!l)return{computedAvailableSize:Math.round(r),computedIsNeeded:l,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};const c=Math.round(Math.max(x1e,Math.floor(i*a/s))),d=(a-c)/(s-i),u=o*d;return{computedAvailableSize:Math.round(r),computedIsNeeded:l,computedSliderSize:Math.round(c),computedSliderRatio:d,computedSliderPosition:Math.round(u)}}_refreshComputedValues(){const e=Em._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize;let i=this._scrollPosition;return tthis._host.onMouseWheel(new vf(null,1,0))}),this._createArrow({className:"scra",icon:se.scrollbarButtonRight,top:a,left:void 0,bottom:void 0,right:r,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new vf(null,-1,0))})}this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}}class D1e extends rq{constructor(e,t,i){const s=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new Em(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,s.height,s.scrollHeight,o.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const r=(t.arrowSize-km)/2,a=(t.verticalScrollbarSize-km)/2;this._createArrow({className:"scra",icon:se.scrollbarButtonUp,top:r,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new vf(null,0,1))}),this._createArrow({className:"scra",icon:se.scrollbarButtonDown,top:void 0,left:a,bottom:r,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new vf(null,0,-1))})}this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}}class jS{constructor(e,t,i,s,o,r,a){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t=t|0,i=i|0,s=s|0,o=o|0,r=r|0,a=a|0),this.rawScrollLeft=s,this.rawScrollTop=a,t<0&&(t=0),s+t>i&&(s=i-t),s<0&&(s=0),o<0&&(o=0),a+o>r&&(a=r-o),a<0&&(a=0),this.width=t,this.scrollWidth=i,this.scrollLeft=s,this.height=o,this.scrollHeight=r,this.scrollTop=a}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,t){return new jS(this._forceIntegerValues,typeof e.width<"u"?e.width:this.width,typeof e.scrollWidth<"u"?e.scrollWidth:this.scrollWidth,t?this.rawScrollLeft:this.scrollLeft,typeof e.height<"u"?e.height:this.height,typeof e.scrollHeight<"u"?e.scrollHeight:this.scrollHeight,t?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new jS(this._forceIntegerValues,this.width,this.scrollWidth,typeof e.scrollLeft<"u"?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof e.scrollTop<"u"?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){const i=this.width!==e.width,s=this.scrollWidth!==e.scrollWidth,o=this.scrollLeft!==e.scrollLeft,r=this.height!==e.height,a=this.scrollHeight!==e.scrollHeight,l=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:i,scrollWidthChanged:s,scrollLeftChanged:o,heightChanged:r,scrollHeightChanged:a,scrollTopChanged:l}}}class Q1 extends Y{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new B),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new jS(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){var i;const s=this._state.withScrollDimensions(e,t);this._setState(s,!!this._smoothScrolling),(i=this._smoothScrolling)===null||i===void 0||i.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){const t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};const i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let s;t?s=new av(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):s=this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=s}else{const i=this._state.withScrollPosition(e);this._smoothScrolling=av.start(this._state,i,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;const e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){const i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}}class w7{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}}function k2(n,e){const t=e-n;return function(i){return n+t*A1e(i)}}function k1e(n,e,t){return function(i){return i2.5*i){let o,r;return e0&&Math.abs(e.deltaY)>0)return 1;let t=.5;return this._front===-1&&this._rear===-1||this._memory[this._rear],(!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(t+=.25),Math.min(Math.max(t,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}}qS.INSTANCE=new qS;class wP extends fa{get options(){return this._options}constructor(e,t,i){super(),this._onScroll=this._register(new B),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new B),e.style.overflow="hidden",this._options=N1e(t),this._scrollable=i,this._register(this._scrollable.onScroll(o=>{this._onWillScroll.fire(o),this._onDidScroll(o),this._onScroll.fire(o)}));const s={onMouseWheel:o=>this._onMouseWheel(o),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new D1e(this._scrollable,this._options,s)),this._horizontalScrollbar=this._register(new L1e(this._scrollable,this._options,s)),this._domNode=document.createElement("div"),this._domNode.className="monaco-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.style.overflow="hidden",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=vt(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=vt(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=vt(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,o=>this._onMouseOver(o)),this.onmouseleave(this._listenOnDomNode,o=>this._onMouseLeave(o)),this._hideTimeout=this._register(new Lc),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=Bt(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,mt&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new vf(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Bt(this._mouseWheelToDispose),e)){const i=s=>{this._onMouseWheel(new vf(s))};this._mouseWheelToDispose.push(K(this._listenOnDomNode,de.MOUSE_WHEEL,i,{passive:!1}))}}_onMouseWheel(e){var t;if(!((t=e.browserEvent)===null||t===void 0)&&t.defaultPrevented)return;const i=qS.INSTANCE;i.acceptStandardWheelEvent(e);let s=!1;if(e.deltaY||e.deltaX){let r=e.deltaY*this._options.mouseWheelScrollSensitivity,a=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&a+r===0?a=r=0:Math.abs(r)>=Math.abs(a)?a=0:r=0),this._options.flipAxes&&([r,a]=[a,r]);const l=!mt&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||l)&&!a&&(a=r,r=0),e.browserEvent&&e.browserEvent.altKey&&(a=a*this._options.fastScrollSensitivity,r=r*this._options.fastScrollSensitivity);const c=this._scrollable.getFutureScrollPosition();let d={};if(r){const u=C7*r,h=c.scrollTop-(u<0?Math.floor(u):Math.ceil(u));this._verticalScrollbar.writeScrollPosition(d,h)}if(a){const u=C7*a,h=c.scrollLeft-(u<0?Math.floor(u):Math.ceil(u));this._horizontalScrollbar.writeScrollPosition(d,h)}d=this._scrollable.validateScrollPosition(d),(c.scrollLeft!==d.scrollLeft||c.scrollTop!==d.scrollTop)&&(this._options.mouseWheelSmoothScroll&&i.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(d):this._scrollable.setScrollPositionNow(d),s=!0)}let o=s;!o&&this._options.alwaysConsumeMouseWheel&&(o=!0),!o&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(o=!0),o&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){const e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,s=i?" left":"",o=t?" top":"",r=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${s}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${r}${o}${s}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),I1e)}}class aq extends wP{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new Q1({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:s=>qo(s)});super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class CP extends wP{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class SP extends wP{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new Q1({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:s=>qo(s)});super(e,t,i),this._register(i),this._element=e,this._register(this.onScroll(s=>{s.scrollTopChanged&&(this._element.scrollTop=s.scrollTop),s.scrollLeftChanged&&(this._element.scrollLeft=s.scrollLeft)})),this.scanDomNode()}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}scanDomNode(){this.setScrollDimensions({width:this._element.clientWidth,scrollWidth:this._element.scrollWidth,height:this._element.clientHeight,scrollHeight:this._element.scrollHeight}),this.setScrollPosition({scrollLeft:this._element.scrollLeft,scrollTop:this._element.scrollTop})}}function N1e(n){const e={lazyRender:typeof n.lazyRender<"u"?n.lazyRender:!1,className:typeof n.className<"u"?n.className:"",useShadows:typeof n.useShadows<"u"?n.useShadows:!0,handleMouseWheel:typeof n.handleMouseWheel<"u"?n.handleMouseWheel:!0,flipAxes:typeof n.flipAxes<"u"?n.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof n.consumeMouseWheelIfScrollbarIsNeeded<"u"?n.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof n.alwaysConsumeMouseWheel<"u"?n.alwaysConsumeMouseWheel:!1,scrollYToX:typeof n.scrollYToX<"u"?n.scrollYToX:!1,mouseWheelScrollSensitivity:typeof n.mouseWheelScrollSensitivity<"u"?n.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof n.fastScrollSensitivity<"u"?n.fastScrollSensitivity:5,scrollPredominantAxis:typeof n.scrollPredominantAxis<"u"?n.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof n.mouseWheelSmoothScroll<"u"?n.mouseWheelSmoothScroll:!0,arrowSize:typeof n.arrowSize<"u"?n.arrowSize:11,listenOnDomNode:typeof n.listenOnDomNode<"u"?n.listenOnDomNode:null,horizontal:typeof n.horizontal<"u"?n.horizontal:1,horizontalScrollbarSize:typeof n.horizontalScrollbarSize<"u"?n.horizontalScrollbarSize:10,horizontalSliderSize:typeof n.horizontalSliderSize<"u"?n.horizontalSliderSize:0,horizontalHasArrows:typeof n.horizontalHasArrows<"u"?n.horizontalHasArrows:!1,vertical:typeof n.vertical<"u"?n.vertical:1,verticalScrollbarSize:typeof n.verticalScrollbarSize<"u"?n.verticalScrollbarSize:10,verticalHasArrows:typeof n.verticalHasArrows<"u"?n.verticalHasArrows:!1,verticalSliderSize:typeof n.verticalSliderSize<"u"?n.verticalSliderSize:0,scrollByPage:typeof n.scrollByPage<"u"?n.scrollByPage:!1};return e.horizontalSliderSize=typeof n.horizontalSliderSize<"u"?n.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof n.verticalSliderSize<"u"?n.verticalSliderSize:e.verticalScrollbarSize,mt&&(e.className+=" mac"),e}class xP extends X1{constructor(e,t,i){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=t,this.viewHelper=i,this.mouseTargetFactory=new yn(this._context,i),this._mouseDownOperation=this._register(new R1e(this._context,this.viewController,this.viewHelper,this.mouseTargetFactory,(r,a)=>this._createMouseTarget(r,a),r=>this._getMouseColumn(r))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(143).height;const s=new a1e(this.viewHelper.viewDomNode);this._register(s.onContextMenu(this.viewHelper.viewDomNode,r=>this._onContextMenu(r,!0))),this._register(s.onMouseMove(this.viewHelper.viewDomNode,r=>{this._onMouseMove(r),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=K(this.viewHelper.viewDomNode.ownerDocument,"mousemove",a=>{this.viewHelper.viewDomNode.contains(a.target)||this._onMouseLeave(new ou(a,!1,this.viewHelper.viewDomNode))}))})),this._register(s.onMouseUp(this.viewHelper.viewDomNode,r=>this._onMouseUp(r))),this._register(s.onMouseLeave(this.viewHelper.viewDomNode,r=>this._onMouseLeave(r)));let o=0;this._register(s.onPointerDown(this.viewHelper.viewDomNode,(r,a)=>{o=a})),this._register(K(this.viewHelper.viewDomNode,de.POINTER_UP,r=>{this._mouseDownOperation.onPointerUp()})),this._register(s.onMouseDown(this.viewHelper.viewDomNode,r=>this._onMouseDown(r,o))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){const e=qS.INSTANCE;let t=0,i=Xc.getZoomLevel(),s=!1,o=0;const r=l=>{if(this.viewController.emitMouseWheel(l),!this._context.configuration.options.get(75))return;const c=new vf(l);if(e.acceptStandardWheelEvent(c),e.isPhysicalMouseWheel()){if(a(l)){const d=Xc.getZoomLevel(),u=c.deltaY>0?1:-1;Xc.setZoomLevel(d+u),c.preventDefault(),c.stopPropagation()}}else Date.now()-t>50&&(i=Xc.getZoomLevel(),s=a(l),o=0),t=Date.now(),o+=c.deltaY,s&&(Xc.setZoomLevel(i+o/5),c.preventDefault(),c.stopPropagation())};this._register(K(this.viewHelper.viewDomNode,de.MOUSE_WHEEL,r,{capture:!0,passive:!1}));function a(l){return mt?(l.metaKey||l.ctrlKey)&&!l.shiftKey&&!l.altKey:l.ctrlKey&&!l.metaKey&&!l.shiftKey&&!l.altKey}}dispose(){this._context.removeEventHandler(this),this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(143)){const t=this._context.configuration.options.get(143).height;this._height!==t&&(this._height=t,this._mouseDownOperation.onHeightChanged())}return!1}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}getTargetAtClientPoint(e,t){const s=new tq(e,t).toPageCoordinates(),o=bP(this.viewHelper.viewDomNode);if(s.yo.y+o.height||s.xo.x+o.width)return null;const r=vP(this.viewHelper.viewDomNode,o,s);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),o,s,r,null)}_createMouseTarget(e,t){let i=e.target;if(!this.viewHelper.viewDomNode.contains(i)){const s=bm(this.viewHelper.viewDomNode);s&&(i=s.elementsFromPoint(e.posx,e.posy).find(o=>this.viewHelper.viewDomNode.contains(o)))}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?i:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.relativePos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){this.mouseTargetFactory.mouseTargetIsWidget(e)||e.preventDefault(),!(this._mouseDownOperation.isActive()||e.timestamp{e.preventDefault(),this.viewHelper.focusTextArea()};if(d&&(s||r&&a))u(),this._mouseDownOperation.start(i.type,e,t);else if(o)e.preventDefault();else if(l){const h=i.detail;d&&this.viewHelper.shouldSuppressMouseDownOnViewZone(h.viewZoneId)&&(u(),this._mouseDownOperation.start(i.type,e,t),e.preventDefault())}else c&&this.viewHelper.shouldSuppressMouseDownOnWidget(i.detail)&&(u(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:i})}}class R1e extends Y{constructor(e,t,i,s,o,r){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._mouseTargetFactory=s,this._createMouseTarget=o,this._getMouseColumn=r,this._mouseMoveMonitor=this._register(new c1e(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new M1e(this._context,this._viewHelper,this._mouseTargetFactory,(a,l,c)=>this._dispatchMouse(a,l,c))),this._mouseState=new wD,this._currentSelection=new ct(1,1,1,1),this._isActive=!1,this._lastMouseEvent=null}dispose(){super.dispose()}isActive(){return this._isActive}_onMouseDownThenMove(e){this._lastMouseEvent=e,this._mouseState.setModifiers(e);const t=this._findMousePosition(e,!1);t&&(this._mouseState.isDragAndDrop?this._viewController.emitMouseDrag({event:e,target:t}):t.type===13&&(t.outsidePosition==="above"||t.outsidePosition==="below")?this._topBottomDragScrolling.start(t,e):(this._topBottomDragScrolling.stop(),this._dispatchMouse(t,!0,1)))}start(e,t,i){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(e===3),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const s=this._findMousePosition(t,!0);if(!s||!s.position)return;this._mouseState.trySetCount(t.detail,s.position),t.detail=this._mouseState.count;const o=this._context.configuration.options;if(!o.get(90)&&o.get(35)&&!o.get(22)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&s.type===6&&s.position&&this._currentSelection.containsPosition(s.position)){this._mouseState.isDragAndDrop=!0,this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,r=>this._onMouseDownThenMove(r),r=>{const a=this._findMousePosition(this._lastMouseEvent,!1);r&&r instanceof KeyboardEvent?this._viewController.emitMouseDropCanceled():this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:a?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()});return}this._mouseState.isDragAndDrop=!1,this._dispatchMouse(s,t.shiftKey,1),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,r=>this._onMouseDownThenMove(r),()=>this._stop()))}_stop(){this._isActive=!1,this._topBottomDragScrolling.stop()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onPointerUp(){this._mouseMoveMonitor.stopMonitoring()}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){const t=e.editorPos,i=this._context.viewModel,s=this._context.viewLayout,o=this._getMouseColumn(e);if(e.posyt.y+t.height){const a=e.posy-t.y-t.height,l=s.getCurrentScrollTop()+e.relativePos.y,c=Dm.getZoneAtCoord(this._context,l);if(c){const u=this._helpPositionJumpOverViewZone(c);if(u)return Yn.createOutsideEditor(o,u,"below",a)}const d=s.getLineNumberAtVerticalOffset(l);return Yn.createOutsideEditor(o,new V(d,i.getLineMaxColumn(d)),"below",a)}const r=s.getLineNumberAtVerticalOffset(s.getCurrentScrollTop()+e.relativePos.y);if(e.posxt.x+t.width){const a=e.posx-t.x-t.width;return Yn.createOutsideEditor(o,new V(r,i.getLineMaxColumn(r)),"right",a)}return null}_findMousePosition(e,t){const i=this._getPositionOutsideEditor(e);if(i)return i;const s=this._createMouseTarget(e,t);if(!s.position)return null;if(s.type===8||s.type===5){const r=this._helpPositionJumpOverViewZone(s.detail);if(r)return Yn.createViewZone(s.type,s.element,s.mouseColumn,r,s.detail)}return s}_helpPositionJumpOverViewZone(e){const t=new V(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),i=e.positionBefore,s=e.positionAfter;return i&&s?i.isBefore(t)?i:s:null}_dispatchMouse(e,t,i){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,revealType:i,inSelectionMode:t,mouseDownCount:this._mouseState.count,altKey:this._mouseState.altKey,ctrlKey:this._mouseState.ctrlKey,metaKey:this._mouseState.metaKey,shiftKey:this._mouseState.shiftKey,leftButton:this._mouseState.leftButton,middleButton:this._mouseState.middleButton,onInjectedText:e.type===6&&e.detail.injectedText!==null})}}class M1e extends Y{constructor(e,t,i,s){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=s,this._operation=null}dispose(){super.dispose(),this.stop()}start(e,t){this._operation?this._operation.setPosition(e,t):this._operation=new P1e(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class P1e extends Y{constructor(e,t,i,s,o,r){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=s,this._position=o,this._mouseEvent=r,this._lastTime=Date.now(),this._animationFrameDisposable=qo(()=>this._execute())}dispose(){this._animationFrameDisposable.dispose()}setPosition(e,t){this._position=e,this._mouseEvent=t}_tick(){const e=Date.now(),t=e-this._lastTime;return this._lastTime=e,t}_getScrollSpeed(){const e=this._context.configuration.options.get(66),t=this._context.configuration.options.get(143).height/e,i=this._position.outsideDistance/e;return i<=1.5?Math.max(30,t*(1+i)):i<=3?Math.max(60,t*(2+i)):Math.max(200,t*(7+i))}_execute(){const e=this._context.configuration.options.get(66),t=this._getScrollSpeed(),i=this._tick(),s=t*(i/1e3)*e,o=this._position.outsidePosition==="above"?-s:s;this._context.viewModel.viewLayout.deltaScrollNow(0,o),this._viewHelper.renderNow();const r=this._context.viewLayout.getLinesViewportData(),a=this._position.outsidePosition==="above"?r.startLineNumber:r.endLineNumber;let l;{const c=bP(this._viewHelper.viewDomNode),d=this._context.configuration.options.get(143).horizontalScrollbarHeight,u=new bD(this._mouseEvent.pos.x,c.y+c.height-d-.1),h=vP(this._viewHelper.viewDomNode,c,u);l=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),c,u,h,null)}(!l.position||l.position.lineNumber!==a)&&(this._position.outsidePosition==="above"?l=Yn.createOutsideEditor(this._position.mouseColumn,new V(a,1),"above",this._position.outsideDistance):l=Yn.createOutsideEditor(this._position.mouseColumn,new V(a,this._context.viewModel.getLineMaxColumn(a)),"below",this._position.outsideDistance)),this._dispatchMouse(l,!0,2),this._animationFrameDisposable=qo(()=>this._execute())}}class wD{get altKey(){return this._altKey}get ctrlKey(){return this._ctrlKey}get metaKey(){return this._metaKey}get shiftKey(){return this._shiftKey}get leftButton(){return this._leftButton}get middleButton(){return this._middleButton}get startedOnLineNumbers(){return this._startedOnLineNumbers}constructor(){this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._leftButton=!1,this._middleButton=!1,this._startedOnLineNumbers=!1,this._lastMouseDownPosition=null,this._lastMouseDownPositionEqualCount=0,this._lastMouseDownCount=0,this._lastSetMouseDownCountTime=0,this.isDragAndDrop=!1}get count(){return this._lastMouseDownCount}setModifiers(e){this._altKey=e.altKey,this._ctrlKey=e.ctrlKey,this._metaKey=e.metaKey,this._shiftKey=e.shiftKey}setStartButtons(e){this._leftButton=e.leftButton,this._middleButton=e.middleButton}setStartedOnLineNumbers(e){this._startedOnLineNumbers=e}trySetCount(e,t){const i=new Date().getTime();i-this._lastSetMouseDownCountTime>wD.CLEAR_MOUSE_DOWN_COUNT_TIME&&(e=1),this._lastSetMouseDownCountTime=i,e>this._lastMouseDownCount+1&&(e=this._lastMouseDownCount+1),this._lastMouseDownPosition&&this._lastMouseDownPosition.equals(t)?this._lastMouseDownPositionEqualCount++:this._lastMouseDownPositionEqualCount=1,this._lastMouseDownPosition=t,this._lastMouseDownCount=Math.min(e,this._lastMouseDownPositionEqualCount)}}wD.CLEAR_MOUSE_DOWN_COUNT_TIME=400;class rt{get event(){return this.emitter.event}constructor(e,t,i){const s=o=>this.emitter.fire(o);this.emitter=new B({onWillAddFirstListener:()=>e.addEventListener(t,s,i),onDidRemoveLastListener:()=>e.removeEventListener(t,s,i)})}dispose(){this.emitter.dispose()}}var md;(function(n){const e={total:0,min:Number.MAX_VALUE,max:0},t=Object.assign({},e),i=Object.assign({},e),s=Object.assign({},e);let o=0;const r={keydown:0,input:0,render:0};function a(){v(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),r.keydown=1,queueMicrotask(l)}n.onKeyDown=a;function l(){r.keydown===1&&(performance.mark("keydown/end"),r.keydown=2)}function c(){performance.mark("input/start"),r.input=1,_()}n.onBeforeInput=c;function d(){r.input===0&&c(),queueMicrotask(u)}n.onInput=d;function u(){r.input===1&&(performance.mark("input/end"),r.input=2)}function h(){v()}n.onKeyUp=h;function f(){v()}n.onSelectionChange=f;function g(){r.keydown===2&&r.input===2&&r.render===0&&(performance.mark("render/start"),r.render=1,queueMicrotask(p),_())}n.onRenderStart=g;function p(){r.render===1&&(performance.mark("render/end"),r.render=2)}function _(){setTimeout(v)}function v(){r.keydown===2&&r.input===2&&r.render===2&&(performance.mark("inputlatency/end"),performance.measure("keydown","keydown/start","keydown/end"),performance.measure("input","input/start","input/end"),performance.measure("render","render/start","render/end"),performance.measure("inputlatency","inputlatency/start","inputlatency/end"),b("keydown",e),b("input",t),b("render",i),b("inputlatency",s),o++,y())}function b(x,D){const k=performance.getEntriesByName(x)[0].duration;D.total+=k,D.min=Math.min(D.min,k),D.max=Math.max(D.max,k)}function y(){performance.clearMarks("keydown/start"),performance.clearMarks("keydown/end"),performance.clearMarks("input/start"),performance.clearMarks("input/end"),performance.clearMarks("render/start"),performance.clearMarks("render/end"),performance.clearMarks("inputlatency/start"),performance.clearMarks("inputlatency/end"),performance.clearMeasures("keydown"),performance.clearMeasures("input"),performance.clearMeasures("render"),performance.clearMeasures("inputlatency"),r.keydown=0,r.input=0,r.render=0}function w(){if(o===0)return;const x={keydown:C(e),input:C(t),render:C(i),total:C(s),sampleCount:o};return L(e),L(t),L(i),L(s),o=0,x}n.getAndClearMeasurements=w;function C(x){return{average:x.total/o,max:x.max,min:x.min}}function L(x){x.total=0,x.min=Number.MAX_VALUE,x.max=0}})(md||(md={}));class un{constructor(e,t,i,s,o){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selection=s,this.newlineCountBeforeSelection=o}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){const i=e.getValue(),s=e.getSelectionStart(),o=e.getSelectionEnd();let r;if(t){const a=i.substring(0,s),l=t.value.substring(0,t.selectionStart);a===l&&(r=t.newlineCountBeforeSelection)}return new un(i,s,o,null,r)}collapseSelection(){return this.selectionStart===this.value.length?this:new un(this.value,this.value.length,this.value.length,null,void 0)}writeToTextArea(e,t,i){t.setValue(e,this.value),i&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){var t,i,s,o,r,a,l,c;if(e<=this.selectionStart){const h=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition((i=(t=this.selection)===null||t===void 0?void 0:t.getStartPosition())!==null&&i!==void 0?i:null,h,-1)}if(e>=this.selectionEnd){const h=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition((o=(s=this.selection)===null||s===void 0?void 0:s.getEndPosition())!==null&&o!==void 0?o:null,h,1)}const d=this.value.substring(this.selectionStart,e);if(d.indexOf("…")===-1)return this._finishDeduceEditorPosition((a=(r=this.selection)===null||r===void 0?void 0:r.getStartPosition())!==null&&a!==void 0?a:null,d,1);const u=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition((c=(l=this.selection)===null||l===void 0?void 0:l.getEndPosition())!==null&&c!==void 0?c:null,u,-1)}_finishDeduceEditorPosition(e,t,i){let s=0,o=-1;for(;(o=t.indexOf(` -`,o+1))!==-1;)s++;return[e,i*t.length,s]}static deduceInput(e,t,i){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const s=Math.min(ES(e.value,t.value),e.selectionStart,t.selectionStart),o=Math.min(QI(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(s,e.value.length-o);const r=t.value.substring(s,t.value.length-o),a=e.selectionStart-s,l=e.selectionEnd-s,c=t.selectionStart-s,d=t.selectionEnd-s;if(c===d){const h=e.selectionStart-s;return{text:r,replacePrevCharCnt:h,replaceNextCharCnt:0,positionDelta:0}}const u=l-a;return{text:r,replacePrevCharCnt:u,replaceNextCharCnt:0,positionDelta:0}}static deduceAndroidCompositionInput(e,t){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};if(e.value===t.value)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:t.selectionEnd-e.selectionEnd};const i=Math.min(ES(e.value,t.value),e.selectionEnd),s=Math.min(QI(e.value,t.value),e.value.length-e.selectionEnd),o=e.value.substring(i,e.value.length-s),r=t.value.substring(i,t.value.length-s);e.selectionStart-i;const a=e.selectionEnd-i;t.selectionStart-i;const l=t.selectionEnd-i;return{text:r,replacePrevCharCnt:a,replaceNextCharCnt:o.length-a,positionDelta:l-r.length}}}un.EMPTY=new un("",0,0,null,void 0);class Yg{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const i=e*t,s=i+1,o=i+t;return new N(s,1,o+1,1)}static fromEditorSelection(e,t,i,s){const r=Yg._getPageOfLine(t.startLineNumber,i),a=Yg._getRangeForPage(r,i),l=Yg._getPageOfLine(t.endLineNumber,i),c=Yg._getRangeForPage(l,i);let d=a.intersectRanges(new N(1,1,t.startLineNumber,t.startColumn));if(s&&e.getValueLengthInRange(d,1)>500){const v=e.modifyPosition(d.getEndPosition(),-500);d=N.fromPositions(v,d.getEndPosition())}const u=e.getValueInRange(d,1),h=e.getLineCount(),f=e.getLineMaxColumn(h);let g=c.intersectRanges(new N(t.endLineNumber,t.endColumn,h,f));if(s&&e.getValueLengthInRange(g,1)>500){const v=e.modifyPosition(g.getStartPosition(),500);g=N.fromPositions(g.getStartPosition(),v)}const p=e.getValueInRange(g,1);let _;if(r===l||r+1===l)_=e.getValueInRange(t,1);else{const v=a.intersectRanges(t),b=c.intersectRanges(t);_=e.getValueInRange(v,1)+"…"+e.getValueInRange(b,1)}return s&&_.length>2*500&&(_=_.substring(0,500)+"…"+_.substring(_.length-500,_.length)),new un(u+_+p,u.length,u.length+_.length,t,d.endLineNumber-d.startLineNumber)}}var GS;(function(n){n.Tap="-monaco-textarea-synthetic-tap"})(GS||(GS={}));class KS{constructor(){this._lastState=null}set(e,t){this._lastState={lastCopiedValue:e,data:t}}get(e){return this._lastState&&this._lastState.lastCopiedValue===e?this._lastState.data:(this._lastState=null,null)}}KS.INSTANCE=new KS;class O1e{constructor(){this._lastTypeTextLength=0}handleCompositionUpdate(e){e=e||"";const t={text:e,replacePrevCharCnt:this._lastTypeTextLength,replaceNextCharCnt:0,positionDelta:0};return this._lastTypeTextLength=e.length,t}}class F1e extends Y{get textAreaState(){return this._textAreaState}constructor(e,t,i,s){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=s,this._onFocus=this._register(new B),this.onFocus=this._onFocus.event,this._onBlur=this._register(new B),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new B),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new B),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new B),this.onCut=this._onCut.event,this._onPaste=this._register(new B),this.onPaste=this._onPaste.event,this._onType=this._register(new B),this.onType=this._onType.event,this._onCompositionStart=this._register(new B),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new B),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new B),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new B),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncTriggerCut=this._register(new Di(()=>this._onCut.fire(),0)),this._asyncFocusGainWriteScreenReaderContent=this._register(new Di(()=>this.writeScreenReaderContent("asyncFocusGain"),0)),this._textAreaState=un.EMPTY,this._selectionChangeListener=null,this.writeScreenReaderContent("ctor"),this._hasFocus=!1,this._currentComposition=null;let o=null;this._register(this._textArea.onKeyDown(r=>{const a=new Ht(r);(a.keyCode===114||this._currentComposition&&a.keyCode===1)&&a.stopPropagation(),a.equals(9)&&a.preventDefault(),o=a,this._onKeyDown.fire(a)})),this._register(this._textArea.onKeyUp(r=>{const a=new Ht(r);this._onKeyUp.fire(a)})),this._register(this._textArea.onCompositionStart(r=>{const a=new O1e;if(this._currentComposition){this._currentComposition=a;return}if(this._currentComposition=a,this._OS===2&&o&&o.equals(114)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===r.data&&(o.code==="ArrowRight"||o.code==="ArrowLeft")){a.handleCompositionUpdate("x"),this._onCompositionStart.fire({data:r.data});return}if(this._browser.isAndroid){this._onCompositionStart.fire({data:r.data});return}this._onCompositionStart.fire({data:r.data})})),this._register(this._textArea.onCompositionUpdate(r=>{const a=this._currentComposition;if(!a)return;if(this._browser.isAndroid){const c=un.readFromTextArea(this._textArea,this._textAreaState),d=un.deduceAndroidCompositionInput(this._textAreaState,c);this._textAreaState=c,this._onType.fire(d),this._onCompositionUpdate.fire(r);return}const l=a.handleCompositionUpdate(r.data);this._textAreaState=un.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(l),this._onCompositionUpdate.fire(r)})),this._register(this._textArea.onCompositionEnd(r=>{const a=this._currentComposition;if(!a)return;if(this._currentComposition=null,this._browser.isAndroid){const c=un.readFromTextArea(this._textArea,this._textAreaState),d=un.deduceAndroidCompositionInput(this._textAreaState,c);this._textAreaState=c,this._onType.fire(d),this._onCompositionEnd.fire();return}const l=a.handleCompositionUpdate(r.data);this._textAreaState=un.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(l),this._onCompositionEnd.fire()})),this._register(this._textArea.onInput(r=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._currentComposition)return;const a=un.readFromTextArea(this._textArea,this._textAreaState),l=un.deduceInput(this._textAreaState,a,this._OS===2);l.replacePrevCharCnt===0&&l.text.length===1&&(sn(l.text.charCodeAt(0))||l.text.charCodeAt(0)===127)||(this._textAreaState=a,(l.text!==""||l.replacePrevCharCnt!==0||l.replaceNextCharCnt!==0||l.positionDelta!==0)&&this._onType.fire(l))})),this._register(this._textArea.onCut(r=>{this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(r),this._asyncTriggerCut.schedule()})),this._register(this._textArea.onCopy(r=>{this._ensureClipboardGetsEditorSelection(r)})),this._register(this._textArea.onPaste(r=>{if(this._textArea.setIgnoreSelectionChangeTime("received paste event"),r.preventDefault(),!r.clipboardData)return;let[a,l]=S7.getTextData(r.clipboardData);a&&(l=l||KS.INSTANCE.get(a),this._onPaste.fire({text:a,metadata:l}))})),this._register(this._textArea.onFocus(()=>{const r=this._hasFocus;this._setHasFocus(!0),this._browser.isSafari&&!r&&this._hasFocus&&this._asyncFocusGainWriteScreenReaderContent.schedule()})),this._register(this._textArea.onBlur(()=>{this._currentComposition&&(this._currentComposition=null,this.writeScreenReaderContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)})),this._register(this._textArea.onSyntheticTap(()=>{this._browser.isAndroid&&this._currentComposition&&(this._currentComposition=null,this.writeScreenReaderContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())}))}_installSelectionChangeListener(){let e=0;return K(this._textArea.ownerDocument,"selectionchange",t=>{if(md.onSelectionChange(),!this._hasFocus||this._currentComposition||!this._browser.isChrome)return;const i=Date.now(),s=i-e;if(e=i,s<5)return;const o=i-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),o<100||!this._textAreaState.selection)return;const r=this._textArea.getValue();if(this._textAreaState.value!==r)return;const a=this._textArea.getSelectionStart(),l=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===a&&this._textAreaState.selectionEnd===l)return;const c=this._textAreaState.deduceEditorPosition(a),d=this._host.deduceModelPosition(c[0],c[1],c[2]),u=this._textAreaState.deduceEditorPosition(l),h=this._host.deduceModelPosition(u[0],u[1],u[2]),f=new ct(d.lineNumber,d.column,h.lineNumber,h.column);this._onSelectionChangeRequest.fire(f)})}dispose(){super.dispose(),this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null)}focusTextArea(){this._setHasFocus(!0),this.refreshFocusState()}isFocused(){return this._hasFocus}refreshFocusState(){this._setHasFocus(this._textArea.hasFocus())}_setHasFocus(e){this._hasFocus!==e&&(this._hasFocus=e,this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null),this._hasFocus&&(this._selectionChangeListener=this._installSelectionChangeListener()),this._hasFocus&&this.writeScreenReaderContent("focusgain"),this._hasFocus?this._onFocus.fire():this._onBlur.fire())}_setAndWriteTextAreaState(e,t){this._hasFocus||(t=t.collapseSelection()),t.writeToTextArea(e,this._textArea,this._hasFocus),this._textAreaState=t}writeScreenReaderContent(e){this._currentComposition||this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent())}_ensureClipboardGetsEditorSelection(e){const t=this._host.getDataToCopy(),i={version:1,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};KS.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,` -`):t.text,i),e.preventDefault(),e.clipboardData&&S7.setTextData(e.clipboardData,t.text,t.html,i)}}const S7={getTextData(n){const e=n.getData($l.text);let t=null;const i=n.getData("vscode-editor-data");if(typeof i=="string")try{t=JSON.parse(i),t.version!==1&&(t=null)}catch{}return e.length===0&&t===null&&n.files.length>0?[Array.prototype.slice.call(n.files,0).map(o=>o.name).join(` -`),null]:[e,t]},setTextData(n,e,t,i){n.setData($l.text,e),typeof t=="string"&&n.setData("text/html",t),n.setData("vscode-editor-data",JSON.stringify(i))}};class B1e extends Y{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new rt(this._actual,"keydown")).event,this.onKeyUp=this._register(new rt(this._actual,"keyup")).event,this.onCompositionStart=this._register(new rt(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new rt(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new rt(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new rt(this._actual,"beforeinput")).event,this.onInput=this._register(new rt(this._actual,"input")).event,this.onCut=this._register(new rt(this._actual,"cut")).event,this.onCopy=this._register(new rt(this._actual,"copy")).event,this.onPaste=this._register(new rt(this._actual,"paste")).event,this.onFocus=this._register(new rt(this._actual,"focus")).event,this.onBlur=this._register(new rt(this._actual,"blur")).event,this._onSyntheticTap=this._register(new B),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown(()=>md.onKeyDown())),this._register(this.onBeforeInput(()=>md.onBeforeInput())),this._register(this.onInput(()=>md.onInput())),this._register(this.onKeyUp(()=>md.onKeyUp())),this._register(K(this._actual,GS.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=bm(this._actual);return e?e.activeElement===this._actual:X4(this._actual)?this._actual.ownerDocument.activeElement===this._actual:!1}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,t){const i=this._actual;i.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),i.value=t)}getSelectionStart(){return this._actual.selectionDirection==="backward"?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return this._actual.selectionDirection==="backward"?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,t,i){const s=this._actual;let o=null;const r=bm(s);r?o=r.activeElement:o=s.ownerDocument.activeElement;const a=o===s,l=s.selectionStart,c=s.selectionEnd;if(a&&l===t&&c===i){Lr&&window.parent!==window&&s.focus();return}if(a){this.setIgnoreSelectionChangeTime("setSelectionRange"),s.setSelectionRange(t,i),Lr&&window.parent!==window&&s.focus();return}try{const d=pme(s);this.setIgnoreSelectionChangeTime("setSelectionRange"),s.focus(),s.setSelectionRange(t,i),mme(s,d)}catch{}}}class W1e extends xP{constructor(e,t,i){super(e,t,i),this._register(Mt.addTarget(this.viewHelper.linesContentDomNode)),this._register(K(this.viewHelper.linesContentDomNode,Ot.Tap,o=>this.onTap(o))),this._register(K(this.viewHelper.linesContentDomNode,Ot.Change,o=>this.onChange(o))),this._register(K(this.viewHelper.linesContentDomNode,Ot.Contextmenu,o=>this._onContextMenu(new ou(o,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(K(this.viewHelper.linesContentDomNode,"pointerdown",o=>{const r=o.pointerType;if(r==="mouse"){this._lastPointerType="mouse";return}else r==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const s=new l1e(this.viewHelper.viewDomNode);this._register(s.onPointerMove(this.viewHelper.viewDomNode,o=>this._onMouseMove(o))),this._register(s.onPointerUp(this.viewHelper.viewDomNode,o=>this._onMouseUp(o))),this._register(s.onPointerLeave(this.viewHelper.viewDomNode,o=>this._onMouseLeave(o))),this._register(s.onPointerDown(this.viewHelper.viewDomNode,(o,r)=>this._onMouseDown(o,r)))}onTap(e){if(!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget))return;e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new ou(e,!1,this.viewHelper.viewDomNode),!1);t.position&&this.viewController.dispatchMouse({position:t.position,mouseColumn:t.position.column,startedOnLineNumbers:!1,revealType:1,mouseDownCount:e.tapCount,inSelectionMode:!1,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:t.type===6&&t.detail.injectedText!==null})}onChange(e){this._lastPointerType==="touch"&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}_onMouseDown(e,t){e.browserEvent.pointerType!=="touch"&&super._onMouseDown(e,t)}}class V1e extends xP{constructor(e,t,i){super(e,t,i),this._register(Mt.addTarget(this.viewHelper.linesContentDomNode)),this._register(K(this.viewHelper.linesContentDomNode,Ot.Tap,s=>this.onTap(s))),this._register(K(this.viewHelper.linesContentDomNode,Ot.Change,s=>this.onChange(s))),this._register(K(this.viewHelper.linesContentDomNode,Ot.Contextmenu,s=>this._onContextMenu(new ou(s,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new ou(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const i=document.createEvent("CustomEvent");i.initEvent(GS.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(i),this.viewController.moveTo(t.position,1)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class z1e extends Y{constructor(e,t,i){super(),Jd&&Z4.pointerEvents?this.handler=this._register(new W1e(e,t,i)):window.TouchEvent?this.handler=this._register(new V1e(e,t,i)):this.handler=this._register(new xP(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}class Kf extends X1{}const co=at("themeService");function rn(n){return{id:n}}function RT(n){switch(n){case Wo.DARK:return"vs-dark";case Wo.HIGH_CONTRAST_DARK:return"hc-black";case Wo.HIGH_CONTRAST_LIGHT:return"hc-light";default:return"vs"}}const lq={ThemingContribution:"base.contributions.theming"};class H1e{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new B}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),Ze(()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}}const cq=new H1e;_n.add(lq.ThemingContribution,cq);function Nr(n){return cq.onColorThemeChange(n)}class $1e extends Y{constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(t=>this.onThemeChange(t)))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}}const dq=E("editor.lineHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},m("lineHighlight","Background color for the highlight of line at the cursor position.")),x7=E("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:Je},m("lineHighlightBorderBox","Background color for the border around the line at the cursor position."));E("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},m("rangeHighlight","Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations."),!0);E("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:Gt,hcLight:Gt},m("rangeHighlightBorder","Background color of the border around highlighted ranges."),!0);E("editor.symbolHighlightBackground",{dark:$a,light:$a,hcDark:null,hcLight:null},m("symbolHighlight","Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations."),!0);E("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:Gt,hcLight:Gt},m("symbolHighlightBorder","Background color of the border around highlighted symbols."),!0);const uq=E("editorCursor.foreground",{dark:"#AEAFAD",light:H.black,hcDark:H.white,hcLight:"#0F4A85"},m("caret","Color of the editor cursor.")),U1e=E("editorCursor.background",null,m("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),tc=E("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},m("editorWhitespaces","Color of whitespace characters in the editor.")),j1e=E("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:H.white,hcLight:"#292929"},m("editorLineNumbers","Color of editor line numbers.")),ew=E("editorIndentGuide.background",{dark:tc,light:tc,hcDark:tc,hcLight:tc},m("editorIndentGuides","Color of the editor indentation guides."),!1,m("deprecatedEditorIndentGuides","'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),tw=E("editorIndentGuide.activeBackground",{dark:tc,light:tc,hcDark:tc,hcLight:tc},m("editorActiveIndentGuide","Color of the active editor indentation guides."),!1,m("deprecatedEditorActiveIndentGuide","'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),J1=E("editorIndentGuide.background1",{dark:ew,light:ew,hcDark:ew,hcLight:ew},m("editorIndentGuides1","Color of the editor indentation guides (1).")),q1e=E("editorIndentGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorIndentGuides2","Color of the editor indentation guides (2).")),G1e=E("editorIndentGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorIndentGuides3","Color of the editor indentation guides (3).")),K1e=E("editorIndentGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorIndentGuides4","Color of the editor indentation guides (4).")),Y1e=E("editorIndentGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorIndentGuides5","Color of the editor indentation guides (5).")),Z1e=E("editorIndentGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorIndentGuides6","Color of the editor indentation guides (6).")),ey=E("editorIndentGuide.activeBackground1",{dark:tw,light:tw,hcDark:tw,hcLight:tw},m("editorActiveIndentGuide1","Color of the active editor indentation guides (1).")),X1e=E("editorIndentGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorActiveIndentGuide2","Color of the active editor indentation guides (2).")),Q1e=E("editorIndentGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorActiveIndentGuide3","Color of the active editor indentation guides (3).")),J1e=E("editorIndentGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorActiveIndentGuide4","Color of the active editor indentation guides (4).")),eye=E("editorIndentGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorActiveIndentGuide5","Color of the active editor indentation guides (5).")),tye=E("editorIndentGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorActiveIndentGuide6","Color of the active editor indentation guides (6).")),iw=E("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:Gt,hcLight:Gt},m("editorActiveLineNumber","Color of editor active line number"),!1,m("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));E("editorLineNumber.activeForeground",{dark:iw,light:iw,hcDark:iw,hcLight:iw},m("editorActiveLineNumber","Color of editor active line number"));const iye=E("editorLineNumber.dimmedForeground",{dark:null,light:null,hcDark:null,hcLight:null},m("editorDimmedLineNumber","Color of the final editor line when editor.renderFinalNewline is set to dimmed."));E("editorRuler.foreground",{dark:"#5A5A5A",light:H.lightgrey,hcDark:H.white,hcLight:"#292929"},m("editorRuler","Color of the editor rulers."));E("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},m("editorCodeLensForeground","Foreground color of editor CodeLens"));E("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},m("editorBracketMatchBackground","Background color behind matching brackets"));E("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:Je,hcLight:Je},m("editorBracketMatchBorder","Color for matching brackets boxes"));const nye=E("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},m("editorOverviewRulerBorder","Color of the overview ruler border.")),sye=E("editorOverviewRuler.background",null,m("editorOverviewRulerBackground","Background color of the editor overview ruler."));E("editorGutter.background",{dark:Yi,light:Yi,hcDark:Yi,hcLight:Yi},m("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers."));E("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:H.fromHex("#fff").transparent(.8),hcLight:Je},m("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor."));const oye=E("editorUnnecessaryCode.opacity",{dark:H.fromHex("#000a"),light:H.fromHex("#0007"),hcDark:null,hcLight:null},m("unnecessaryCodeOpacity",`Opacity of unnecessary (unused) source code in the editor. For example, "#000000c0" will render the code with 75% opacity. For high contrast themes, use the 'editorUnnecessaryCode.border' theme color to underline unnecessary code instead of fading it out.`));E("editorGhostText.border",{dark:null,light:null,hcDark:H.fromHex("#fff").transparent(.8),hcLight:H.fromHex("#292929").transparent(.8)},m("editorGhostTextBorder","Border color of ghost text in the editor."));E("editorGhostText.foreground",{dark:H.fromHex("#ffffff56"),light:H.fromHex("#0007"),hcDark:null,hcLight:null},m("editorGhostTextForeground","Foreground color of the ghost text in the editor."));E("editorGhostText.background",{dark:null,light:null,hcDark:null,hcLight:null},m("editorGhostTextBackground","Background color of the ghost text in the editor."));const nw=new H(new ft(0,122,204,.6)),rye=E("editorOverviewRuler.rangeHighlightForeground",{dark:nw,light:nw,hcDark:nw,hcLight:nw},m("overviewRulerRangeHighlight","Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),aye=E("editorOverviewRuler.errorForeground",{dark:new H(new ft(255,18,18,.7)),light:new H(new ft(255,18,18,.7)),hcDark:new H(new ft(255,50,50,1)),hcLight:"#B5200D"},m("overviewRuleError","Overview ruler marker color for errors.")),lye=E("editorOverviewRuler.warningForeground",{dark:So,light:So,hcDark:nv,hcLight:nv},m("overviewRuleWarning","Overview ruler marker color for warnings.")),cye=E("editorOverviewRuler.infoForeground",{dark:Es,light:Es,hcDark:sv,hcLight:sv},m("overviewRuleInfo","Overview ruler marker color for infos.")),hq=E("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},m("editorBracketHighlightForeground1","Foreground color of brackets (1). Requires enabling bracket pair colorization.")),fq=E("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},m("editorBracketHighlightForeground2","Foreground color of brackets (2). Requires enabling bracket pair colorization.")),gq=E("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},m("editorBracketHighlightForeground3","Foreground color of brackets (3). Requires enabling bracket pair colorization.")),pq=E("editorBracketHighlight.foreground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketHighlightForeground4","Foreground color of brackets (4). Requires enabling bracket pair colorization.")),mq=E("editorBracketHighlight.foreground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketHighlightForeground5","Foreground color of brackets (5). Requires enabling bracket pair colorization.")),_q=E("editorBracketHighlight.foreground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketHighlightForeground6","Foreground color of brackets (6). Requires enabling bracket pair colorization.")),dye=E("editorBracketHighlight.unexpectedBracket.foreground",{dark:new H(new ft(255,18,18,.8)),light:new H(new ft(255,18,18,.8)),hcDark:new H(new ft(255,50,50,1)),hcLight:""},m("editorBracketHighlightUnexpectedBracketForeground","Foreground color of unexpected brackets.")),uye=E("editorBracketPairGuide.background1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.background1","Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),hye=E("editorBracketPairGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.background2","Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),fye=E("editorBracketPairGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.background3","Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),gye=E("editorBracketPairGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.background4","Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),pye=E("editorBracketPairGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.background5","Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),mye=E("editorBracketPairGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.background6","Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),_ye=E("editorBracketPairGuide.activeBackground1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.activeBackground1","Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),bye=E("editorBracketPairGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.activeBackground2","Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),vye=E("editorBracketPairGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.activeBackground3","Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),yye=E("editorBracketPairGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.activeBackground4","Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),wye=E("editorBracketPairGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.activeBackground5","Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),Cye=E("editorBracketPairGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.activeBackground6","Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));E("editorUnicodeHighlight.border",{dark:"#BD9B03",light:"#CEA33D",hcDark:"#ff0000",hcLight:"#CEA33D"},m("editorUnicodeHighlight.border","Border color used to highlight unicode characters."));E("editorUnicodeHighlight.background",{dark:"#bd9b0326",light:"#cea33d14",hcDark:"#00000000",hcLight:"#cea33d14"},m("editorUnicodeHighlight.background","Background color used to highlight unicode characters."));Nr((n,e)=>{const t=n.getColor(Yi),i=n.getColor(dq),s=i&&!i.isTransparent()?i:t;s&&e.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${s}; }`)});class ty extends Kf{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new V(1,1),this._renderResult=null,this._activeLineNumber=1,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(66);const t=e.get(67);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(94);const i=e.get(143);this._lineNumbersLeft=i.lineNumbersLeft,this._lineNumbersWidth=i.lineNumbersWidth}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return this._readConfig(),!0}onCursorStateChanged(e){const t=e.selections[0].getPosition();this._lastCursorModelPosition=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(t);let i=!1;return this._activeLineNumber!==t.lineNumber&&(this._activeLineNumber=t.lineNumber,i=!0),(this._renderLineNumbers===2||this._renderLineNumbers===3)&&(i=!0),i}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getLineRenderLineNumber(e){const t=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new V(e,1));if(t.column!==1)return"";const i=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(i);if(this._renderLineNumbers===2){const s=Math.abs(this._lastCursorModelPosition.lineNumber-i);return s===0?''+i+"":String(s)}return this._renderLineNumbers===3?this._lastCursorModelPosition.lineNumber===i||i%10===0?String(i):"":String(i)}prepareRender(e){if(this._renderLineNumbers===0){this._renderResult=null;return}const t=Jn?this._lineHeight%2===0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,o=this._context.viewModel.getLineCount(),r=[];for(let a=i;a<=s;a++){const l=a-i,c=this._getLineRenderLineNumber(a);if(!c){r[l]="";continue}let d="";if(a===o&&this._context.viewModel.getLineLength(a)===0){if(this._renderFinalNewline==="off"){r[l]="";continue}this._renderFinalNewline==="dimmed"&&(d=" dimmed-line-number")}a===this._activeLineNumber&&(d=" active-line-number"),r[l]=`
${c}
`}this._renderResult=r}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}ty.CLASS_NAME="line-numbers";Nr((n,e)=>{const t=n.getColor(j1e),i=n.getColor(iye);i?e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${i}; }`):t&&e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${t.transparent(.4)}; }`)});class yf extends lo{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(143);this._canUseLayerHinting=!t.get(32),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._domNode=vt(document.createElement("div")),this._domNode.setClassName(yf.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=vt(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(yf.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(143);return this._canUseLayerHinting=!t.get(32),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollTopChanged}prepareRender(e){}render(e){this._domNode.setLayerHinting(this._canUseLayerHinting),this._domNode.setContain("strict");const t=e.scrollTop-e.bigNumbersDelta;this._domNode.setTop(-t);const i=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(i),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(i)}}yf.CLASS_NAME="glyph-margin";yf.OUTER_CLASS_NAME="margin";const wp="monaco-mouse-cursor-text";class Sye{constructor(){this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._enabled=!0}get enabled(){return this._enabled}enable(){this._enabled=!0,this._onDidChange.fire()}disable(){this._enabled=!1,this._onDidChange.fire()}}const O_=new Sye,vi=at("keybindingService");var xye=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Lye=function(n,e){return function(t,i){e(t,i,n)}};class Dye{constructor(e,t,i,s,o){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=i,this.widthOfHiddenLineTextBefore=s,this.distanceToModelLineEnd=o,this._visibleTextAreaBrand=void 0,this.startPosition=null,this.endPosition=null,this.visibleTextareaStart=null,this.visibleTextareaEnd=null,this._previousPresentation=null}prepareRender(e){const t=new V(this.modelLineNumber,this.distanceToModelLineStart+1),i=new V(this.modelLineNumber,this._context.viewModel.model.getLineMaxColumn(this.modelLineNumber)-this.distanceToModelLineEnd);this.startPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t),this.endPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i),this.startPosition.lineNumber===this.endPosition.lineNumber?(this.visibleTextareaStart=e.visibleRangeForPosition(this.startPosition),this.visibleTextareaEnd=e.visibleRangeForPosition(this.endPosition)):(this.visibleTextareaStart=null,this.visibleTextareaEnd=null)}definePresentation(e){return this._previousPresentation||(e?this._previousPresentation=e:this._previousPresentation={foreground:1,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}}const E2=Lr;let MT=class extends lo{constructor(e,t,i,s){super(e),this._keybindingService=s,this._primaryCursorPosition=new V(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._visibleRangeProvider=i,this._scrollLeft=0,this._scrollTop=0;const o=this._context.configuration.options,r=o.get(143);this._setAccessibilityOptions(o),this._contentLeft=r.contentLeft,this._contentWidth=r.contentWidth,this._contentHeight=r.height,this._fontInfo=o.get(50),this._lineHeight=o.get(66),this._emptySelectionClipboard=o.get(37),this._copyWithSyntaxHighlighting=o.get(25),this._visibleTextArea=null,this._selections=[new ct(1,1,1,1)],this._modelSelections=[new ct(1,1,1,1)],this._lastRenderPosition=null,this.textArea=vt(document.createElement("textarea")),sl.write(this.textArea,6),this.textArea.setClassName(`inputarea ${wp}`),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:a}=this._context.viewModel.model.getOptions();this.textArea.domNode.style.tabSize=`${a*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("autocorrect","off"),this.textArea.setAttribute("autocapitalize","off"),this.textArea.setAttribute("autocomplete","off"),this.textArea.setAttribute("spellcheck","false"),this.textArea.setAttribute("aria-label",this._getAriaLabel(o)),this.textArea.setAttribute("aria-required",o.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(o.get(123))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",m("editor","editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-autocomplete",o.get(90)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=vt(document.createElement("div")),this.textAreaCover.setPosition("absolute");const l={getLineCount:()=>this._context.viewModel.getLineCount(),getLineMaxColumn:u=>this._context.viewModel.getLineMaxColumn(u),getValueInRange:(u,h)=>this._context.viewModel.getValueInRange(u,h),getValueLengthInRange:(u,h)=>this._context.viewModel.getValueLengthInRange(u,h),modifyPosition:(u,h)=>this._context.viewModel.modifyPosition(u,h)},c={getDataToCopy:()=>{const u=this._context.viewModel.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,Fs),h=this._context.viewModel.model.getEOL(),f=this._emptySelectionClipboard&&this._modelSelections.length===1&&this._modelSelections[0].isEmpty(),g=Array.isArray(u)?u:null,p=Array.isArray(u)?u.join(h):u;let _,v=null;if(this._copyWithSyntaxHighlighting&&p.length<65536){const b=this._context.viewModel.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);b&&(_=b.html,v=b.mode)}return{isFromEmptySelection:f,multicursorText:g,text:p,html:_,mode:v}},getScreenReaderContent:()=>{if(this._accessibilitySupport===1){const u=this._selections[0];if(mt&&u.isEmpty()){const f=u.getStartPosition();let g=this._getWordBeforePosition(f);if(g.length===0&&(g=this._getCharacterBeforePosition(f)),g.length>0)return new un(g,g.length,g.length,N.fromPositions(f),0)}if(mt&&!u.isEmpty()&&l.getValueLengthInRange(u,0)<500){const f=l.getValueInRange(u,0);return new un(f,0,f.length,u,0)}if(bc&&!u.isEmpty()){const f="vscode-placeholder";return new un(f,0,f.length,null,void 0)}return un.EMPTY}if(XF){const u=this._selections[0];if(u.isEmpty()){const h=u.getStartPosition(),[f,g]=this._getAndroidWordAtPosition(h);if(f.length>0)return new un(f,g,g,N.fromPositions(h),0)}return un.EMPTY}return Yg.fromEditorSelection(l,this._selections[0],this._accessibilityPageSize,this._accessibilitySupport===0)},deduceModelPosition:(u,h,f)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(u,h,f)},d=this._register(new B1e(this.textArea.domNode));this._textAreaInput=this._register(new F1e(c,d,wo,{isAndroid:XF,isChrome:j4,isFirefox:Lr,isSafari:bc})),this._register(this._textAreaInput.onKeyDown(u=>{this._viewController.emitKeyDown(u)})),this._register(this._textAreaInput.onKeyUp(u=>{this._viewController.emitKeyUp(u)})),this._register(this._textAreaInput.onPaste(u=>{let h=!1,f=null,g=null;u.metadata&&(h=this._emptySelectionClipboard&&!!u.metadata.isFromEmptySelection,f=typeof u.metadata.multicursorText<"u"?u.metadata.multicursorText:null,g=u.metadata.mode),this._viewController.paste(u.text,h,f,g)})),this._register(this._textAreaInput.onCut(()=>{this._viewController.cut()})),this._register(this._textAreaInput.onType(u=>{u.replacePrevCharCnt||u.replaceNextCharCnt||u.positionDelta?this._viewController.compositionType(u.text,u.replacePrevCharCnt,u.replaceNextCharCnt,u.positionDelta):this._viewController.type(u.text)})),this._register(this._textAreaInput.onSelectionChangeRequest(u=>{this._viewController.setSelection(u)})),this._register(this._textAreaInput.onCompositionStart(u=>{const h=this.textArea.domNode,f=this._modelSelections[0],{distanceToModelLineStart:g,widthOfHiddenTextBefore:p}=(()=>{const v=h.value.substring(0,Math.min(h.selectionStart,h.selectionEnd)),b=v.lastIndexOf(` -`),y=v.substring(b+1),w=y.lastIndexOf(" "),C=y.length-w-1,L=f.getStartPosition(),x=Math.min(L.column-1,C),D=L.column-1-x,k=y.substring(0,y.length-x),{tabSize:P}=this._context.viewModel.model.getOptions(),O=kye(this.textArea.domNode.ownerDocument,k,this._fontInfo,P);return{distanceToModelLineStart:D,widthOfHiddenTextBefore:O}})(),{distanceToModelLineEnd:_}=(()=>{const v=h.value.substring(Math.max(h.selectionStart,h.selectionEnd)),b=v.indexOf(` -`),y=b===-1?v:v.substring(0,b),w=y.indexOf(" "),C=w===-1?y.length:y.length-w-1,L=f.getEndPosition(),x=Math.min(this._context.viewModel.model.getLineMaxColumn(L.lineNumber)-L.column,C);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(L.lineNumber)-L.column-x}})();this._context.viewModel.revealRange("keyboard",!0,N.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new Dye(this._context,f.startLineNumber,g,p,_),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${wp} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(u=>{this._visibleTextArea&&(this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render())})),this._register(this._textAreaInput.onCompositionEnd(()=>{this._visibleTextArea=null,this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._render(),this.textArea.setClassName(`inputarea ${wp}`),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()})),this._register(this._textAreaInput.onFocus(()=>{this._context.viewModel.setHasFocus(!0)})),this._register(this._textAreaInput.onBlur(()=>{this._context.viewModel.setHasFocus(!1)})),this._register(O_.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}writeScreenReaderContent(e){this._textAreaInput.writeScreenReaderContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',i=this._context.viewModel.getLineContent(e.lineNumber),s=wm(t);let o=!0,r=e.column,a=!0,l=e.column,c=0;for(;c<50&&(o||a);){if(o&&r<=1&&(o=!1),o){const d=i.charCodeAt(r-2);s.get(d)!==0?o=!1:r--}if(a&&l>i.length&&(a=!1),a){const d=i.charCodeAt(l-1);s.get(d)!==0?a=!1:l++}c++}return[i.substring(r-1,l-1),e.column-r]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=wm(this._context.configuration.options.get(129));let s=e.column,o=0;for(;s>1;){const r=t.charCodeAt(s-2);if(i.get(r)!==0||o>50)return t.substring(s-1,e.column-1);o++,s--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const i=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!sn(i.charCodeAt(0)))return i}return""}_getAriaLabel(e){var t,i,s;if(e.get(2)===1){const r=(t=this._keybindingService.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode"))===null||t===void 0?void 0:t.getAriaLabel(),a=(i=this._keybindingService.lookupKeybinding("workbench.action.showCommands"))===null||i===void 0?void 0:i.getAriaLabel(),l=(s=this._keybindingService.lookupKeybinding("workbench.action.openGlobalKeybindings"))===null||s===void 0?void 0:s.getAriaLabel(),c=m("accessibilityModeOff","The editor is not accessible at this time.");return r?m("accessibilityOffAriaLabel","{0} To enable screen reader optimized mode, use {1}",c,r):a?m("accessibilityOffAriaLabelNoKb","{0} To enable screen reader optimized mode, open the quick pick with {1} and run the command Toggle Screen Reader Accessibility Mode, which is currently not triggerable via keyboard.",c,a):l?m("accessibilityOffAriaLabelNoKbs","{0} Please assign a keybinding for the command Toggle Screen Reader Accessibility Mode by accessing the keybindings editor with {1} and run it.",c,l):c}return e.get(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);this._accessibilitySupport===2&&t===Ff.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const s=e.get(143).wrappingColumn;if(s!==-1&&this._accessibilitySupport!==1){const o=e.get(50);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(s*o.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=E2?0:1}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(143);this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(50),this._lineHeight=t.get(66),this._emptySelectionClipboard=t.get(37),this._copyWithSyntaxHighlighting=t.get(25),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:s}=this._context.viewModel.model.getOptions();return this.textArea.domNode.style.tabSize=`${s*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("aria-label",this._getAriaLabel(t)),this.textArea.setAttribute("aria-required",t.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(t.get(123))),(e.hasChanged(34)||e.hasChanged(90))&&this._ensureReadOnlyAttribute(),e.hasChanged(2)&&this._textAreaInput.writeScreenReaderContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeScreenReaderContent("selection changed"),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}isFocused(){return this._textAreaInput.isFocused()}focusTextArea(){this._textAreaInput.focusTextArea()}getLastRenderData(){return this._lastRenderPosition}setAriaOptions(e){e.activeDescendant?(this.textArea.setAttribute("aria-haspopup","true"),this.textArea.setAttribute("aria-autocomplete","list"),this.textArea.setAttribute("aria-activedescendant",e.activeDescendant)):(this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),this.textArea.removeAttribute("aria-activedescendant")),e.role&&this.textArea.setAttribute("role",e.role)}_ensureReadOnlyAttribute(){const e=this._context.configuration.options;!O_.enabled||e.get(34)&&e.get(90)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")}prepareRender(e){var t;this._primaryCursorPosition=new V(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition),(t=this._visibleTextArea)===null||t===void 0||t.prepareRender(e)}render(e){this._textAreaInput.writeScreenReaderContent("render"),this._render()}_render(){var e;if(this._visibleTextArea){const s=this._visibleTextArea.visibleTextareaStart,o=this._visibleTextArea.visibleTextareaEnd,r=this._visibleTextArea.startPosition,a=this._visibleTextArea.endPosition;if(r&&a&&s&&o&&o.left>=this._scrollLeft&&s.left<=this._scrollLeft+this._contentWidth){const l=this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber)-this._scrollTop,c=this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));let d=this._visibleTextArea.widthOfHiddenLineTextBefore,u=this._contentLeft+s.left-this._scrollLeft,h=o.left-s.left+1;if(uthis._contentWidth&&(h=this._contentWidth);const f=this._context.viewModel.getViewLineData(r.lineNumber),g=f.tokens.findTokenIndexAtOffset(r.column-1),p=f.tokens.findTokenIndexAtOffset(a.column-1),_=g===p,v=this._visibleTextArea.definePresentation(_?f.tokens.getPresentation(g):null);this.textArea.domNode.scrollTop=c*this._lineHeight,this.textArea.domNode.scrollLeft=d,this._doRender({lastRenderPosition:null,top:l,left:u,width:h,height:this._lineHeight,useCover:!1,color:(xi.getColorMap()||[])[v.foreground],italic:v.italic,bold:v.bold,underline:v.underline,strikethrough:v.strikethrough})}return}if(!this._primaryCursorVisibleRange){this._renderAtTopLeft();return}const t=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(tthis._contentLeft+this._contentWidth){this._renderAtTopLeft();return}const i=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(i<0||i>this._contentHeight){this._renderAtTopLeft();return}if(mt){this._doRender({lastRenderPosition:this._primaryCursorPosition,top:i,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:this._lineHeight,useCover:!1}),this.textArea.domNode.scrollLeft=this._primaryCursorVisibleRange.left;const s=(e=this._textAreaInput.textAreaState.newlineCountBeforeSelection)!==null&&e!==void 0?e:this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));this.textArea.domNode.scrollTop=s*this._lineHeight;return}this._doRender({lastRenderPosition:this._primaryCursorPosition,top:i,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:E2?0:1,useCover:!1})}_newlinecount(e){let t=0,i=-1;do{if(i=e.indexOf(` -`,i+1),i===-1)break;t++}while(!0);return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:E2?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;Mn(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?H.Format.CSS.formatHex(e.color):""),t.setFontStyle(e.italic?"italic":""),e.bold&&t.setFontWeight("bold"),t.setTextDecoration(`${e.underline?" underline":""}${e.strikethrough?" line-through":""}`),i.setTop(e.useCover?e.top:0),i.setLeft(e.useCover?e.left:0),i.setWidth(e.useCover?e.width:0),i.setHeight(e.useCover?e.height:0);const s=this._context.configuration.options;s.get(57)?i.setClassName("monaco-editor-background textAreaCover "+yf.OUTER_CLASS_NAME):s.get(67).renderType!==0?i.setClassName("monaco-editor-background textAreaCover "+ty.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}};MT=xye([Lye(3,vi)],MT);function kye(n,e,t,i){if(e.length===0)return 0;const s=n.createElement("div");s.style.position="absolute",s.style.top="-50000px",s.style.width="50000px";const o=n.createElement("span");Mn(o,t),o.style.whiteSpace="pre",o.style.tabSize=`${i*t.spaceWidth}px`,o.append(e),s.appendChild(o),n.body.appendChild(s);const r=o.offsetWidth;return n.body.removeChild(s),r}function Eye(n,e,t){let i=0;for(let o=0;o!0,Iye=()=>!1,Tye=n=>n===" "||n===" ";class pg{static shouldRecreate(e){return e.hasChanged(143)||e.hasChanged(129)||e.hasChanged(37)||e.hasChanged(76)||e.hasChanged(78)||e.hasChanged(79)||e.hasChanged(6)||e.hasChanged(7)||e.hasChanged(11)||e.hasChanged(9)||e.hasChanged(10)||e.hasChanged(14)||e.hasChanged(127)||e.hasChanged(50)||e.hasChanged(90)}constructor(e,t,i,s){var o;this.languageConfigurationService=s,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const r=i.options,a=r.get(143),l=r.get(50);this.readOnly=r.get(90),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=r.get(115),this.lineHeight=l.lineHeight,this.typicalHalfwidthCharacterWidth=l.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(a.height/this.lineHeight)-2),this.useTabStops=r.get(127),this.wordSeparators=r.get(129),this.emptySelectionClipboard=r.get(37),this.copyWithSyntaxHighlighting=r.get(25),this.multiCursorMergeOverlapping=r.get(76),this.multiCursorPaste=r.get(78),this.multiCursorLimit=r.get(79),this.autoClosingBrackets=r.get(6),this.autoClosingComments=r.get(7),this.autoClosingQuotes=r.get(11),this.autoClosingDelete=r.get(9),this.autoClosingOvertype=r.get(10),this.autoSurround=r.get(14),this.autoIndent=r.get(12),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:this._getShouldAutoClose(e,this.autoClosingQuotes,!0),comment:this._getShouldAutoClose(e,this.autoClosingComments,!1),bracket:this._getShouldAutoClose(e,this.autoClosingBrackets,!1)},this.autoClosingPairs=this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();const c=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(c)for(const u of c)this.surroundingPairs[u.open]=u.close;const d=this.languageConfigurationService.getLanguageConfiguration(e).comments;this.blockCommentStartToken=(o=d==null?void 0:d.blockCommentStartToken)!==null&&o!==void 0?o:null}get electricChars(){var e;if(!this._electricChars){this._electricChars={};const t=(e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter)===null||e===void 0?void 0:e.getElectricCharacters();if(t)for(const i of t)this._electricChars[i]=!0}return this._electricChars}onElectricCharacter(e,t,i){const s=rD(t,i-1),o=this.languageConfigurationService.getLanguageConfiguration(s.languageId).electricCharacter;return o?o.onElectricCharacter(e,s,i-s.firstCharOffset):null}normalizeIndentation(e){return bq(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,i){switch(t){case"beforeWhitespace":return Tye;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,i);case"always":return Aye;case"never":return Iye}}_getLanguageDefinedShouldAutoClose(e,t){const i=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return s=>i.indexOf(s)!==-1}visibleColumnFromColumn(e,t){return Ki.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,i){const s=Ki.columnFromVisibleColumn(e.getLineContent(t),i,this.tabSize),o=e.getLineMinColumn(t);if(sr?r:s}}class ot{static fromModelState(e){return new Nye(e)}static fromViewState(e){return new Rye(e)}static fromModelSelection(e){const t=ct.liftSelection(e),i=new gn(N.fromPositions(t.getSelectionStart()),0,0,t.getPosition(),0);return ot.fromModelState(i)}static fromModelSelections(e){const t=[];for(let i=0,s=e.length;io,c=s>r,d=sr||vs||_0&&s--,uh.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,s)}static columnSelectRight(e,t,i){let s=0;const o=Math.min(i.fromViewLineNumber,i.toViewLineNumber),r=Math.max(i.fromViewLineNumber,i.toViewLineNumber);for(let l=o;l<=r;l++){const c=t.getLineMaxColumn(l),d=e.visibleColumnFromColumn(t,new V(l,c));s=Math.max(s,d)}let a=i.toViewVisualColumn;return ae.getLineMinColumn(t.lineNumber))return t.delta(void 0,-IU(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const i=t.lineNumber-1;return new V(i,e.getLineMaxColumn(i))}else return t}static leftPositionAtomicSoftTabs(e,t,i){if(t.column<=e.getLineIndentColumn(t.lineNumber)){const s=e.getLineMinColumn(t.lineNumber),o=e.getLineContent(t.lineNumber),r=rv.atomicPosition(o,t.column-1,i,0);if(r!==-1&&r+1>=s)return new V(t.lineNumber,r+1)}return this.leftPosition(e,t)}static left(e,t,i){const s=e.stickyTabStops?Lt.leftPositionAtomicSoftTabs(t,i,e.tabSize):Lt.leftPosition(t,i);return new A2(s.lineNumber,s.column,0)}static moveLeft(e,t,i,s,o){let r,a;if(i.hasSelection()&&!s)r=i.selection.startLineNumber,a=i.selection.startColumn;else{const l=i.position.delta(void 0,-(o-1)),c=t.normalizePosition(Lt.clipPositionColumn(l,t),0),d=Lt.left(e,t,c);r=d.lineNumber,a=d.column}return i.move(s,r,a,0)}static clipPositionColumn(e,t){return new V(e.lineNumber,Lt.clipRange(e.column,t.getLineMinColumn(e.lineNumber),t.getLineMaxColumn(e.lineNumber)))}static clipRange(e,t,i){return ei?i:e}static rightPosition(e,t,i){return id?(i=d,a?s=t.getLineMaxColumn(i):s=Math.min(t.getLineMaxColumn(i),s)):s=e.columnFromVisibleColumn(t,i,c),f?o=0:o=c-Ki.visibleColumnFromColumn(t.getLineContent(i),s,e.tabSize),l!==void 0){const g=new V(i,s),p=t.normalizePosition(g,l);o=o+(s-p.column),i=p.lineNumber,s=p.column}return new A2(i,s,o)}static down(e,t,i,s,o,r,a){return this.vertical(e,t,i,s,o,i+r,a,4)}static moveDown(e,t,i,s,o){let r,a;i.hasSelection()&&!s?(r=i.selection.endLineNumber,a=i.selection.endColumn):(r=i.position.lineNumber,a=i.position.column);let l=0,c;do if(c=Lt.down(e,t,r+l,a,i.leftoverVisibleColumns,o,!0),t.normalizePosition(new V(c.lineNumber,c.column),2).lineNumber>r)break;while(l++<10&&r+l1&&this._isBlankLine(t,o);)o--;for(;o>1&&!this._isBlankLine(t,o);)o--;return i.move(s,o,t.getLineMinColumn(o),0)}static moveToNextBlankLine(e,t,i,s){const o=t.getLineCount();let r=i.position.lineNumber;for(;r=h.length+1)return!1;const f=h.charAt(u.column-2),g=s.get(f);if(!g)return!1;if($c(f)){if(i==="never")return!1}else if(t==="never")return!1;const p=h.charAt(u.column-1);let _=!1;for(const v of g)v.open===f&&v.close===p&&(_=!0);if(!_)return!1;if(e==="auto"){let v=!1;for(let b=0,y=a.length;b1){const o=t.getLineContent(s.lineNumber),r=Qs(o),a=r===-1?o.length+1:r+1;if(s.column<=a){const l=i.visibleColumnFromColumn(t,s),c=Ki.prevIndentTabStop(l,i.indentSize),d=i.columnFromVisibleColumn(t,s.lineNumber,c);return new N(s.lineNumber,d,s.lineNumber,s.column)}}return N.fromPositions(wf.getPositionAfterDeleteLeft(s,t),s)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=qge(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,i+1)}else if(e.lineNumber>1){const i=e.lineNumber-1;return new V(i,t.getLineMaxColumn(i))}else return e}static cut(e,t,i){const s=[];let o=null;i.sort((r,a)=>V.compare(r.getStartPosition(),a.getEndPosition()));for(let r=0,a=i.length;r1&&(o==null?void 0:o.endLineNumber)!==c.lineNumber?(d=c.lineNumber-1,u=t.getLineMaxColumn(c.lineNumber-1),h=c.lineNumber,f=t.getLineMaxColumn(c.lineNumber)):(d=c.lineNumber,u=1,h=c.lineNumber,f=t.getLineMaxColumn(c.lineNumber));const g=new N(d,u,h,f);o=g,g.isEmpty()?s[r]=null:s[r]=new ys(g,"")}else s[r]=null;else s[r]=new ys(l,"")}return new bs(0,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class Ci{static _createWord(e,t,i,s,o){return{start:s,end:o,wordType:t,nextCharClass:i}}static _findPreviousWordOnLine(e,t,i){const s=t.getLineContent(i.lineNumber);return this._doFindPreviousWordOnLine(s,e,i)}static _doFindPreviousWordOnLine(e,t,i){let s=0;for(let o=i.column-2;o>=0;o--){const r=e.charCodeAt(o),a=t.get(r);if(a===0){if(s===2)return this._createWord(e,s,a,o+1,this._findEndOfWord(e,t,s,o+1));s=1}else if(a===2){if(s===1)return this._createWord(e,s,a,o+1,this._findEndOfWord(e,t,s,o+1));s=2}else if(a===1&&s!==0)return this._createWord(e,s,a,o+1,this._findEndOfWord(e,t,s,o+1))}return s!==0?this._createWord(e,s,1,0,this._findEndOfWord(e,t,s,0)):null}static _findEndOfWord(e,t,i,s){const o=e.length;for(let r=s;r=0;o--){const r=e.charCodeAt(o),a=t.get(r);if(a===1||i===1&&a===2||i===2&&a===0)return o+1}return 0}static moveWordLeft(e,t,i,s){let o=i.lineNumber,r=i.column;r===1&&o>1&&(o=o-1,r=t.getLineMaxColumn(o));let a=Ci._findPreviousWordOnLine(e,t,new V(o,r));if(s===0)return new V(o,a?a.start+1:1);if(s===1)return a&&a.wordType===2&&a.end-a.start===1&&a.nextCharClass===0&&(a=Ci._findPreviousWordOnLine(e,t,new V(o,a.start+1))),new V(o,a?a.start+1:1);if(s===3){for(;a&&a.wordType===2;)a=Ci._findPreviousWordOnLine(e,t,new V(o,a.start+1));return new V(o,a?a.start+1:1)}return a&&r<=a.end+1&&(a=Ci._findPreviousWordOnLine(e,t,new V(o,a.start+1))),new V(o,a?a.end+1:1)}static _moveWordPartLeft(e,t){const i=t.lineNumber,s=e.getLineMaxColumn(i);if(t.column===1)return i>1?new V(i-1,e.getLineMaxColumn(i-1)):t;const o=e.getLineContent(i);for(let r=t.column-1;r>1;r--){const a=o.charCodeAt(r-2),l=o.charCodeAt(r-1);if(a===95&&l!==95)return new V(i,r);if(a===45&&l!==45)return new V(i,r);if((Fg(a)||jy(a))&&qc(l))return new V(i,r);if(qc(a)&&qc(l)&&r+1=l.start+1&&(l=Ci._findNextWordOnLine(e,t,new V(o,l.end+1))),l?r=l.start+1:r=t.getLineMaxColumn(o);return new V(o,r)}static _moveWordPartRight(e,t){const i=t.lineNumber,s=e.getLineMaxColumn(i);if(t.column===s)return i1?c=1:(l--,c=s.getLineMaxColumn(l)):(d&&c<=d.end+1&&(d=Ci._findPreviousWordOnLine(i,s,new V(l,d.start+1))),d?c=d.end+1:c>1?c=1:(l--,c=s.getLineMaxColumn(l))),new N(l,c,a.lineNumber,a.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const s=new V(i.positionLineNumber,i.positionColumn),o=this._deleteInsideWordWhitespace(t,s);return o||this._deleteInsideWordDetermineDeleteRange(e,t,s)}static _charAtIsWhitespace(e,t){const i=e.charCodeAt(t);return i===32||i===9}static _deleteInsideWordWhitespace(e,t){const i=e.getLineContent(t.lineNumber),s=i.length;if(s===0)return null;let o=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(i,o))return null;let r=Math.min(t.column-1,s-1);if(!this._charAtIsWhitespace(i,r))return null;for(;o>0&&this._charAtIsWhitespace(i,o-1);)o--;for(;r+11?new N(i.lineNumber-1,t.getLineMaxColumn(i.lineNumber-1),i.lineNumber,1):i.lineNumberu.start+1<=i.column&&i.column<=u.end+1,a=(u,h)=>(u=Math.min(u,i.column),h=Math.max(h,i.column),new N(i.lineNumber,u,i.lineNumber,h)),l=u=>{let h=u.start+1,f=u.end+1,g=!1;for(;f-11&&this._charAtIsWhitespace(s,h-2);)h--;return a(h,f)},c=Ci._findPreviousWordOnLine(e,t,i);if(c&&r(c))return l(c);const d=Ci._findNextWordOnLine(e,t,i);return d&&r(d)?l(d):c&&d?a(c.end+1,d.start+1):c?a(c.start+1,c.end+1):d?a(d.start+1,d.end+1):a(1,o+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),s=Ci._moveWordPartLeft(e,i);return new N(i.lineNumber,i.column,s.lineNumber,s.column)}static _findFirstNonWhitespaceChar(e,t){const i=e.length;for(let s=t;s=h.start+1&&(h=Ci._findNextWordOnLine(i,s,new V(l,h.end+1))),h?c=h.start+1:cc&&(d=c,u=e.model.getLineMaxColumn(d)),ot.fromModelState(new gn(new N(r.lineNumber,1,d,u),2,0,new V(d,u),0))}const l=t.modelState.selectionStart.getStartPosition().lineNumber;if(r.lineNumberl){const c=e.getLineCount();let d=a.lineNumber+1,u=1;return d>c&&(d=c,u=e.getLineMaxColumn(d)),ot.fromViewState(t.viewState.move(!0,d,u,0))}else{const c=t.modelState.selectionStart.getEndPosition();return ot.fromModelState(t.modelState.move(!0,c.lineNumber,c.column,0))}}static word(e,t,i,s){const o=e.model.validatePosition(s);return ot.fromModelState(Ci.word(e.cursorConfig,e.model,t.modelState,i,o))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new ot(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,s=t.viewState.position.column;return ot.fromViewState(new gn(new N(i,s,i,s),0,0,new V(i,s),0))}static moveTo(e,t,i,s,o){if(i){if(t.modelState.selectionStartKind===1)return this.word(e,t,i,s);if(t.modelState.selectionStartKind===2)return this.line(e,t,i,s,o)}const r=e.model.validatePosition(s),a=o?e.coordinatesConverter.validateViewPosition(new V(o.lineNumber,o.column),r):e.coordinatesConverter.convertModelPositionToViewPosition(r);return ot.fromViewState(t.viewState.move(i,a.lineNumber,a.column,0))}static simpleMove(e,t,i,s,o,r){switch(i){case 0:return r===4?this._moveHalfLineLeft(e,t,s):this._moveLeft(e,t,s,o);case 1:return r===4?this._moveHalfLineRight(e,t,s):this._moveRight(e,t,s,o);case 2:return r===2?this._moveUpByViewLines(e,t,s,o):this._moveUpByModelLines(e,t,s,o);case 3:return r===2?this._moveDownByViewLines(e,t,s,o):this._moveDownByModelLines(e,t,s,o);case 4:return r===2?t.map(a=>ot.fromViewState(Lt.moveToPrevBlankLine(e.cursorConfig,e,a.viewState,s))):t.map(a=>ot.fromModelState(Lt.moveToPrevBlankLine(e.cursorConfig,e.model,a.modelState,s)));case 5:return r===2?t.map(a=>ot.fromViewState(Lt.moveToNextBlankLine(e.cursorConfig,e,a.viewState,s))):t.map(a=>ot.fromModelState(Lt.moveToNextBlankLine(e.cursorConfig,e.model,a.modelState,s)));case 6:return this._moveToViewMinColumn(e,t,s);case 7:return this._moveToViewFirstNonWhitespaceColumn(e,t,s);case 8:return this._moveToViewCenterColumn(e,t,s);case 9:return this._moveToViewMaxColumn(e,t,s);case 10:return this._moveToViewLastNonWhitespaceColumn(e,t,s);default:return null}}static viewportMove(e,t,i,s,o){const r=e.getCompletelyVisibleViewRange(),a=e.coordinatesConverter.convertViewRangeToModelRange(r);switch(i){case 11:{const l=this._firstLineNumberInRange(e.model,a,o),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],s,l,c)]}case 13:{const l=this._lastLineNumberInRange(e.model,a,o),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],s,l,c)]}case 12:{const l=Math.round((a.startLineNumber+a.endLineNumber)/2),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],s,l,c)]}case 14:{const l=[];for(let c=0,d=t.length;ci.endLineNumber-1?r=i.endLineNumber-1:oot.fromViewState(Lt.moveLeft(e.cursorConfig,e,o.viewState,i,s)))}static _moveHalfLineLeft(e,t,i){const s=[];for(let o=0,r=t.length;oot.fromViewState(Lt.moveRight(e.cursorConfig,e,o.viewState,i,s)))}static _moveHalfLineRight(e,t,i){const s=[];for(let o=0,r=t.length;onew jL(e,s,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=12}cmp(e){return e.type!==this.type?this.type-e.type:Gf(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=KL.create(this.key,this.value,this)),this.negated}}class qL{static create(e,t,i=null){return UL(t,s=>new qL(e,s,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=13}cmp(e){return e.type!==this.type?this.type-e.type:Gf(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=GL.create(this.key,this.value,this)),this.negated}}class GL{static create(e,t,i=null){return UL(t,s=>new GL(e,s,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=14}cmp(e){return e.type!==this.type?this.type-e.type:Gf(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))new KL(e,s,i))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=15}cmp(e){return e.type!==this.type?this.type-e.type:Gf(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value=="string"?!1:parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=jL.create(this.key,this.value,this)),this.negated}}class $b{static create(e,t){return new $b(e,t)}constructor(e,t){this.key=e,this.regexp=t,this.type=7,this.negated=null}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.keye.key)return 1;const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return ti?1:0}equals(e){if(e.type===this.type){const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return this.key===e.key&&t===i}return!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.key);return this.regexp?this.regexp.test(t):!1}serialize(){const e=this.regexp?`/${this.regexp.source}/${this.regexp.flags}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=j4.create(this)),this.negated}}class j4{static create(e){return new j4(e)}constructor(e){this._actual=e,this.type=8}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type?this._actual.equals(e._actual):!1}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){return`!(${this._actual.serialize()})`}keys(){return this._actual.keys()}negate(){return this._actual}}function FU(n){let e=null;for(let t=0,i=n.length;te.expr.length)return 1;for(let t=0,i=this.expr.length;t1;){const r=s[s.length-1];if(r.type!==9)break;s.pop();const a=s.pop(),l=s.length===0,c=Hl.create(r.expr.map(d=>Lh.create([d,a],null,i)),null,l);c&&(s.push(c),s.sort(F_))}if(s.length===1)return s[0];if(i){for(let r=0;re.serialize()).join(" && ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());this.negated=Hl.create(e,this,!0)}return this.negated}}class Hl{static create(e,t,i){return Hl._normalizeArr(e,t,i)}constructor(e,t){this.expr=e,this.negated=t,this.type=9}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.lengthe.expr.length)return 1;for(let t=0,i=this.expr.length;te.serialize()).join(" || ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());for(;e.length>1;){const t=e.shift(),i=e.shift(),s=[];for(const o of XF(t))for(const r of XF(i))s.push(Lh.create([o,r],null,!1));e.unshift(Hl.create(s,null,!1))}this.negated=Hl.create(e,this,!0)}return this.negated}}class _e extends jf{static all(){return _e._info.values()}constructor(e,t,i){super(e,null),this._defaultValue=t,typeof i=="object"?_e._info.push(Object.assign(Object.assign({},i),{key:e})):i!==!0&&_e._info.push({key:e,description:i,type:t!=null?typeof t:void 0})}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return G1.create(this.key,e)}}_e._info=[];const et=rt("contextKeyService");function BU(n,e){return ne?1:0}function Gf(n,e,t,i){return nt?1:ei?1:0}function tT(n,e){if(n.type===0||e.type===1)return!0;if(n.type===9)return e.type===9?ZF(n.expr,e.expr):!1;if(e.type===9){for(const t of e.expr)if(tT(n,t))return!0;return!1}if(n.type===6){if(e.type===6)return ZF(e.expr,n.expr);for(const t of n.expr)if(tT(t,e))return!0;return!1}return n.equals(e)}function ZF(n,e){let t=0,i=0;for(;t>>0,i=(n&4294901760)>>>16;return i!==0?new Xk([Vy(t,e),Vy(i,e)]):new Xk([Vy(t,e)])}else{const t=[];for(let i=0;i{a(),this._cachedMergedKeybindings=null})}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(Hpe)),this._cachedMergedKeybindings.slice(0)}}const Fs=new G4,zpe={EditorModes:"platform.keybindingsRegistry"};pn.add(zpe.EditorModes,Fs);function Hpe(n,e){if(n.weight1!==e.weight1)return n.weight1-e.weight1;if(n.command&&e.command){if(n.commande.command)return 1}return n.weight2-e.weight2}var $pe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},QF=function(n,e){return function(t,i){e(t,i,n)}},Upe=function(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(n);st===e}}$l._all=new Map;const cr=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new xge({merge:$l.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(n){return this._commands.set(n.id,n),this._onDidChangeMenu.fire($l.for(I.CommandPalette)),Ye(()=>{this._commands.delete(n.id)&&this._onDidChangeMenu.fire($l.for(I.CommandPalette))})}getCommand(n){return this._commands.get(n)}getCommands(){const n=new Map;return this._commands.forEach((e,t)=>n.set(t,e)),n}appendMenuItem(n,e){let t=this._menuItems.get(n);t||(t=new Ds,this._menuItems.set(n,t));const i=t.push(e);return this._onDidChangeMenu.fire($l.for(n)),Ye(()=>{i(),this._onDidChangeMenu.fire($l.for(n))})}appendMenuItems(n){const e=new pe;for(const{id:t,item:i}of n)e.add(this.appendMenuItem(t,i));return e}getMenuItems(n){let e;return this._menuItems.has(n)?e=[...this._menuItems.get(n)]:e=[],n===I.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(n){const e=new Set;for(const t of n)l_(t)&&(e.add(t.command.id),t.alt&&e.add(t.alt.id));this._commands.forEach((t,i)=>{e.has(i)||n.push({command:t})})}};class LS extends WL{constructor(e,t,i){super(`submenuitem.${e.submenu.id}`,typeof e.title=="string"?e.title:e.title.value,i,"submenu"),this.item=e,this.hideActions=t}}let il=aC=class{static label(e,t){return t!=null&&t.renderShortTitle&&e.shortTitle?typeof e.shortTitle=="string"?e.shortTitle:e.shortTitle.value:typeof e.title=="string"?e.title:e.title.value}constructor(e,t,i,s,o,r){var a,l;this.hideActions=s,this._commandService=r,this.id=e.id,this.label=aC.label(e,i),this.tooltip=(l=typeof e.tooltip=="string"?e.tooltip:(a=e.tooltip)===null||a===void 0?void 0:a.value)!==null&&l!==void 0?l:"",this.enabled=!e.precondition||o.contextMatchesRules(e.precondition),this.checked=void 0;let c;if(e.toggled){const d=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=o.contextMatchesRules(d.condition),this.checked&&d.tooltip&&(this.tooltip=typeof d.tooltip=="string"?d.tooltip:d.tooltip.value),this.checked&&Te.isThemeIcon(d.icon)&&(c=d.icon),this.checked&&d.title&&(this.label=typeof d.title=="string"?d.title:d.title.value)}c||(c=Te.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new aC(t,void 0,i,s,o,r):void 0,this._options=i,this.class=c&&Te.asClassName(c)}run(...e){var t,i;let s=[];return!((t=this._options)===null||t===void 0)&&t.arg&&(s=[...s,this._options.arg]),!((i=this._options)===null||i===void 0)&&i.shouldForwardArgs&&(s=[...s,...e]),this._commandService.executeCommand(this.id,...s)}};il=aC=$pe([QF(4,et),QF(5,fs)],il);class r0{constructor(e){this.desc=e}}function Bs(n){const e=new pe,t=new n,i=t.desc,{f1:s,menu:o,keybinding:r,description:a}=i,l=Upe(i,["f1","menu","keybinding","description"]);if(e.add(Yt.registerCommand({id:l.id,handler:(c,...d)=>t.run(c,...d),description:a})),Array.isArray(o))for(const c of o)e.add(cr.appendMenuItem(c.id,Object.assign({command:Object.assign(Object.assign({},l),{precondition:c.precondition===null?void 0:l.precondition})},c)));else o&&e.add(cr.appendMenuItem(o.id,Object.assign({command:Object.assign(Object.assign({},l),{precondition:o.precondition===null?void 0:l.precondition})},o)));if(s&&(e.add(cr.appendMenuItem(I.CommandPalette,{command:l,when:l.precondition})),e.add(cr.addCommand(l))),Array.isArray(r))for(const c of r)e.add(Fs.registerKeybindingRule(Object.assign(Object.assign({},c),{id:l.id,when:l.precondition?Le.and(l.precondition,c.when):c.when})));else r&&e.add(Fs.registerKeybindingRule(Object.assign(Object.assign({},r),{id:l.id,when:l.precondition?Le.and(l.precondition,r.when):r.when})));return e}const Cc=rt("telemetryService"),Sc=rt("logService");var yn;(function(n){n[n.Off=0]="Off",n[n.Trace=1]="Trace",n[n.Debug=2]="Debug",n[n.Info=3]="Info",n[n.Warning=4]="Warning",n[n.Error=5]="Error"})(yn||(yn={}));const VU=yn.Info;class zU extends Y{constructor(){super(...arguments),this.level=VU,this._onDidChangeLogLevel=this._register(new B),this.onDidChangeLogLevel=this._onDidChangeLogLevel.event}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}checkLogLevel(e){return this.level!==yn.Off&&this.level<=e}}class qpe extends zU{constructor(e=VU,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.checkLogLevel(yn.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...t):console.log(e,...t))}debug(e,...t){this.checkLogLevel(yn.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...t):console.log(e,...t))}info(e,...t){this.checkLogLevel(yn.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...t):console.log(e,...t))}warn(e,...t){this.checkLogLevel(yn.Warning)&&(this.useColors?console.log("%c WARN","color: #993",e,...t):console.log(e,...t))}error(e,...t){this.checkLogLevel(yn.Error)&&(this.useColors?console.log("%c ERR","color: #f33",e,...t):console.error(e,...t))}dispose(){}}class Gpe extends zU{constructor(e){super(),this.loggers=e,e.length&&this.setLevel(e[0].getLevel())}setLevel(e){for(const t of this.loggers)t.setLevel(e);super.setLevel(e)}trace(e,...t){for(const i of this.loggers)i.trace(e,...t)}debug(e,...t){for(const i of this.loggers)i.debug(e,...t)}info(e,...t){for(const i of this.loggers)i.info(e,...t)}warn(e,...t){for(const i of this.loggers)i.warn(e,...t)}error(e,...t){for(const i of this.loggers)i.error(e,...t)}dispose(){for(const e of this.loggers)e.dispose()}}function Kpe(n){switch(n){case yn.Trace:return"trace";case yn.Debug:return"debug";case yn.Info:return"info";case yn.Warning:return"warn";case yn.Error:return"error";case yn.Off:return"off"}}new _e("logLevel",Kpe(yn.Info));const K4={clipboard:{writeText:hp||document.queryCommandSupported&&document.queryCommandSupported("copy")||!!(navigator&&navigator.clipboard&&navigator.clipboard.writeText),readText:hp||!!(navigator&&navigator.clipboard&&navigator.clipboard.readText)},keyboard:hp||vpe()?0:navigator.keyboard||bc?1:2,touch:"ontouchstart"in window||navigator.maxTouchPoints>0,pointerEvents:window.PointerEvent&&("ontouchstart"in window||window.navigator.maxTouchPoints>0||navigator.maxTouchPoints>0)};function Ype(n){if(n.charCode){const t=String.fromCharCode(n.charCode).toUpperCase();return zl.fromString(t)}const e=n.keyCode;if(e===3)return 7;if(xr)switch(e){case 59:return 85;case 60:if(Xn)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(pt)return 57;break}else if(Yh){if(pt&&e===93)return 57;if(!pt&&e===92)return 57}return _U[e]||0}const Zpe=pt?256:2048,Xpe=512,Qpe=1024,Jpe=pt?2048:256;class zt{constructor(e){this._standardKeyboardEventBrand=!0;const t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=t.getModifierState("AltGraph"),this.keyCode=Ype(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=Zpe),this.altKey&&(t|=Xpe),this.shiftKey&&(t|=Qpe),this.metaKey&&(t|=Jpe),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new wf(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}}let JF=!1,L0=null;function eme(n){if(!n.parent||n.parent===n)return null;try{const e=n.location,t=n.parent.location;if(e.origin!=="null"&&t.origin!=="null"&&e.origin!==t.origin)return JF=!0,null}catch{return JF=!0,null}return n.parent}class tme{static getSameOriginWindowChain(){if(!L0){L0=[];let e=window,t;do t=eme(e),t?L0.push({window:e,iframeElement:e.frameElement||null}):L0.push({window:e,iframeElement:null}),e=t;while(e)}return L0.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let i=0,s=0;const o=this.getSameOriginWindowChain();for(const r of o){if(i+=r.window.scrollY,s+=r.window.scrollX,r.window===t||!r.iframeElement)break;const a=r.iframeElement.getBoundingClientRect();i+=a.top,s+=a.left}return{top:i,left:s}}}class dr{constructor(e){this.timestamp=Date.now(),this.browserEvent=e,this.leftButton=e.button===0,this.middleButton=e.button===1,this.rightButton=e.button===2,this.buttons=e.buttons,this.target=e.target,this.detail=e.detail||1,e.type==="dblclick"&&(this.detail=2),this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey,typeof e.pageX=="number"?(this.posx=e.pageX,this.posy=e.pageY):(this.posx=e.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=e.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);const t=tme.getPositionOfChildWindowRelativeToAncestorWindow(window,e.view);this.posx-=t.left,this.posy-=t.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}class Cf{constructor(e,t=0,i=0){if(this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=i,this.deltaX=t,e){const s=e,o=e;if(typeof s.wheelDeltaY<"u")this.deltaY=s.wheelDeltaY/120;else if(typeof o.VERTICAL_AXIS<"u"&&o.axis===o.VERTICAL_AXIS)this.deltaY=-o.detail/3;else if(e.type==="wheel"){const r=e;r.deltaMode===r.DOM_DELTA_LINE?xr&&!pt?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof s.wheelDeltaX<"u")bc&&Ps?this.deltaX=-(s.wheelDeltaX/120):this.deltaX=s.wheelDeltaX/120;else if(typeof o.HORIZONTAL_AXIS<"u"&&o.axis===o.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){const r=e;r.deltaMode===r.DOM_DELTA_LINE?xr&&!pt?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)===null||e===void 0||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)===null||e===void 0||e.stopPropagation()}}/*! @license DOMPurify 3.0.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.5/LICENSE */const{entries:HU,setPrototypeOf:e9,isFrozen:ime,getPrototypeOf:nme,getOwnPropertyDescriptor:sme}=Object;let{freeze:Js,seal:oa,create:ome}=Object,{apply:nT,construct:sT}=typeof Reflect<"u"&&Reflect;nT||(nT=function(e,t,i){return e.apply(t,i)});Js||(Js=function(e){return e});oa||(oa=function(e){return e});sT||(sT=function(e,t){return new e(...t)});const rme=Lr(Array.prototype.forEach),t9=Lr(Array.prototype.pop),D0=Lr(Array.prototype.push),lC=Lr(String.prototype.toLowerCase),Jk=Lr(String.prototype.toString),ame=Lr(String.prototype.match),Fr=Lr(String.prototype.replace),lme=Lr(String.prototype.indexOf),cme=Lr(String.prototype.trim),ko=Lr(RegExp.prototype.test),k0=dme(TypeError);function Lr(n){return function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s/gm),pme=oa(/\${[\w\W]*}/gm),mme=oa(/^data-[\-\w.\u00B7-\uFFFF]/),_me=oa(/^aria-[\-\w]+$/),$U=oa(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),bme=oa(/^(?:\w+script|data):/i),vme=oa(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),UU=oa(/^html$/i);var r9=Object.freeze({__proto__:null,MUSTACHE_EXPR:fme,ERB_EXPR:gme,TMPLIT_EXPR:pme,DATA_ATTR:mme,ARIA_ATTR:_me,IS_ALLOWED_URI:$U,IS_SCRIPT_OR_DATA:bme,ATTR_WHITESPACE:vme,DOCTYPE_NAME:UU});const yme=()=>typeof window>"u"?null:window,wme=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let i=null;const s="data-tt-policy-suffix";t&&t.hasAttribute(s)&&(i=t.getAttribute(s));const o="dompurify"+(i?"#"+i:"");try{return e.createPolicy(o,{createHTML(r){return r},createScriptURL(r){return r}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}};function jU(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:yme();const e=Ge=>jU(Ge);if(e.version="3.0.5",e.removed=[],!n||!n.document||n.document.nodeType!==9)return e.isSupported=!1,e;const t=n.document,i=t.currentScript;let{document:s}=n;const{DocumentFragment:o,HTMLTemplateElement:r,Node:a,Element:l,NodeFilter:c,NamedNodeMap:d=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:u,DOMParser:h,trustedTypes:f}=n,g=l.prototype,p=zy(g,"cloneNode"),_=zy(g,"nextSibling"),v=zy(g,"childNodes"),b=zy(g,"parentNode");if(typeof r=="function"){const Ge=s.createElement("template");Ge.content&&Ge.content.ownerDocument&&(s=Ge.content.ownerDocument)}let y,w="";const{implementation:S,createNodeIterator:L,createDocumentFragment:x,getElementsByTagName:D}=s,{importNode:k}=t;let P={};e.isSupported=typeof HU=="function"&&typeof b=="function"&&S&&S.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:O,ERB_EXPR:M,TMPLIT_EXPR:R,DATA_ATTR:z,ARIA_ATTR:G,IS_SCRIPT_OR_DATA:te,ATTR_WHITESPACE:ae}=r9;let{IS_ALLOWED_URI:fe}=r9,oe=null;const Se=St({},[...i9,...e2,...t2,...i2,...n9]);let Ie=null;const me=St({},[...s9,...n2,...o9,...Hy]);let ie=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Zt=null,Dt=null,Tt=!0,qe=!0,ni=!1,ke=!0,Ve=!1,ge=!1,he=!1,ki=!1,kt=!1,It=!1,vi=!1,Jo=!0,Pu=!1;const ik="user-content-";let J=!0,q=!1,U={},A=null;const T=St({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let W=null;const F=St({},["audio","video","img","source","image","track"]);let Z=null;const ce=St({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ce="http://www.w3.org/1998/Math/MathML",De="http://www.w3.org/2000/svg",ze="http://www.w3.org/1999/xhtml";let Oe=ze,Nt=!1,Et=null;const Re=St({},[Ce,De,ze],Jk);let ui;const hi=["application/xhtml+xml","text/html"],er="text/html";let wt,Wi=null;const Ou=s.createElement("form"),Fu=function(j){return j instanceof RegExp||j instanceof Function},Rr=function(j){if(!(Wi&&Wi===j)){if((!j||typeof j!="object")&&(j={}),j=gg(j),ui=hi.indexOf(j.PARSER_MEDIA_TYPE)===-1?ui=er:ui=j.PARSER_MEDIA_TYPE,wt=ui==="application/xhtml+xml"?Jk:lC,oe="ALLOWED_TAGS"in j?St({},j.ALLOWED_TAGS,wt):Se,Ie="ALLOWED_ATTR"in j?St({},j.ALLOWED_ATTR,wt):me,Et="ALLOWED_NAMESPACES"in j?St({},j.ALLOWED_NAMESPACES,Jk):Re,Z="ADD_URI_SAFE_ATTR"in j?St(gg(ce),j.ADD_URI_SAFE_ATTR,wt):ce,W="ADD_DATA_URI_TAGS"in j?St(gg(F),j.ADD_DATA_URI_TAGS,wt):F,A="FORBID_CONTENTS"in j?St({},j.FORBID_CONTENTS,wt):T,Zt="FORBID_TAGS"in j?St({},j.FORBID_TAGS,wt):{},Dt="FORBID_ATTR"in j?St({},j.FORBID_ATTR,wt):{},U="USE_PROFILES"in j?j.USE_PROFILES:!1,Tt=j.ALLOW_ARIA_ATTR!==!1,qe=j.ALLOW_DATA_ATTR!==!1,ni=j.ALLOW_UNKNOWN_PROTOCOLS||!1,ke=j.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ve=j.SAFE_FOR_TEMPLATES||!1,ge=j.WHOLE_DOCUMENT||!1,kt=j.RETURN_DOM||!1,It=j.RETURN_DOM_FRAGMENT||!1,vi=j.RETURN_TRUSTED_TYPE||!1,ki=j.FORCE_BODY||!1,Jo=j.SANITIZE_DOM!==!1,Pu=j.SANITIZE_NAMED_PROPS||!1,J=j.KEEP_CONTENT!==!1,q=j.IN_PLACE||!1,fe=j.ALLOWED_URI_REGEXP||$U,Oe=j.NAMESPACE||ze,ie=j.CUSTOM_ELEMENT_HANDLING||{},j.CUSTOM_ELEMENT_HANDLING&&Fu(j.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ie.tagNameCheck=j.CUSTOM_ELEMENT_HANDLING.tagNameCheck),j.CUSTOM_ELEMENT_HANDLING&&Fu(j.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ie.attributeNameCheck=j.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),j.CUSTOM_ELEMENT_HANDLING&&typeof j.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ie.allowCustomizedBuiltInElements=j.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ve&&(qe=!1),It&&(kt=!0),U&&(oe=St({},[...n9]),Ie=[],U.html===!0&&(St(oe,i9),St(Ie,s9)),U.svg===!0&&(St(oe,e2),St(Ie,n2),St(Ie,Hy)),U.svgFilters===!0&&(St(oe,t2),St(Ie,n2),St(Ie,Hy)),U.mathMl===!0&&(St(oe,i2),St(Ie,o9),St(Ie,Hy))),j.ADD_TAGS&&(oe===Se&&(oe=gg(oe)),St(oe,j.ADD_TAGS,wt)),j.ADD_ATTR&&(Ie===me&&(Ie=gg(Ie)),St(Ie,j.ADD_ATTR,wt)),j.ADD_URI_SAFE_ATTR&&St(Z,j.ADD_URI_SAFE_ATTR,wt),j.FORBID_CONTENTS&&(A===T&&(A=gg(A)),St(A,j.FORBID_CONTENTS,wt)),J&&(oe["#text"]=!0),ge&&St(oe,["html","head","body"]),oe.table&&(St(oe,["tbody"]),delete Zt.tbody),j.TRUSTED_TYPES_POLICY){if(typeof j.TRUSTED_TYPES_POLICY.createHTML!="function")throw k0('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof j.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw k0('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');y=j.TRUSTED_TYPES_POLICY,w=y.createHTML("")}else y===void 0&&(y=wme(f,i)),y!==null&&typeof w=="string"&&(w=y.createHTML(""));Js&&Js(j),Wi=j}},Ic=St({},["mi","mo","mn","ms","mtext"]),Bu=St({},["foreignobject","desc","title","annotation-xml"]),Wu=St({},["title","style","font","a","script"]),cg=St({},e2);St(cg,t2),St(cg,ume);const Vu=St({},i2);St(Vu,hme);const nk=function(j){let be=b(j);(!be||!be.tagName)&&(be={namespaceURI:Oe,tagName:"template"});const Ne=lC(j.tagName),fi=lC(be.tagName);return Et[j.namespaceURI]?j.namespaceURI===De?be.namespaceURI===ze?Ne==="svg":be.namespaceURI===Ce?Ne==="svg"&&(fi==="annotation-xml"||Ic[fi]):!!cg[Ne]:j.namespaceURI===Ce?be.namespaceURI===ze?Ne==="math":be.namespaceURI===De?Ne==="math"&&Bu[fi]:!!Vu[Ne]:j.namespaceURI===ze?be.namespaceURI===De&&!Bu[fi]||be.namespaceURI===Ce&&!Ic[fi]?!1:!Vu[Ne]&&(Wu[Ne]||!cg[Ne]):!!(ui==="application/xhtml+xml"&&Et[j.namespaceURI]):!1},ga=function(j){D0(e.removed,{element:j});try{j.parentNode.removeChild(j)}catch{j.remove()}},m0=function(j,be){try{D0(e.removed,{attribute:be.getAttributeNode(j),from:be})}catch{D0(e.removed,{attribute:null,from:be})}if(be.removeAttribute(j),j==="is"&&!Ie[j])if(kt||It)try{ga(be)}catch{}else try{be.setAttribute(j,"")}catch{}},_0=function(j){let be,Ne;if(ki)j=""+j;else{const tr=ame(j,/^[\r\n\t ]+/);Ne=tr&&tr[0]}ui==="application/xhtml+xml"&&Oe===ze&&(j=''+j+"");const fi=y?y.createHTML(j):j;if(Oe===ze)try{be=new h().parseFromString(fi,ui)}catch{}if(!be||!be.documentElement){be=S.createDocument(Oe,"template",null);try{be.documentElement.innerHTML=Nt?w:fi}catch{}}const zn=be.body||be.documentElement;return j&&Ne&&zn.insertBefore(s.createTextNode(Ne),zn.childNodes[0]||null),Oe===ze?D.call(be,ge?"html":"body")[0]:ge?be.documentElement:zn},wy=function(j){return L.call(j.ownerDocument||j,j,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},ZY=function(j){return j instanceof u&&(typeof j.nodeName!="string"||typeof j.textContent!="string"||typeof j.removeChild!="function"||!(j.attributes instanceof d)||typeof j.removeAttribute!="function"||typeof j.setAttribute!="function"||typeof j.namespaceURI!="string"||typeof j.insertBefore!="function"||typeof j.hasChildNodes!="function")},Cy=function(j){return typeof a=="object"?j instanceof a:j&&typeof j=="object"&&typeof j.nodeType=="number"&&typeof j.nodeName=="string"},_l=function(j,be,Ne){P[j]&&rme(P[j],fi=>{fi.call(e,be,Ne,Wi)})},QP=function(j){let be;if(_l("beforeSanitizeElements",j,null),ZY(j))return ga(j),!0;const Ne=wt(j.nodeName);if(_l("uponSanitizeElement",j,{tagName:Ne,allowedTags:oe}),j.hasChildNodes()&&!Cy(j.firstElementChild)&&(!Cy(j.content)||!Cy(j.content.firstElementChild))&&ko(/<[/\w]/g,j.innerHTML)&&ko(/<[/\w]/g,j.textContent))return ga(j),!0;if(!oe[Ne]||Zt[Ne]){if(!Zt[Ne]&&e5(Ne)&&(ie.tagNameCheck instanceof RegExp&&ko(ie.tagNameCheck,Ne)||ie.tagNameCheck instanceof Function&&ie.tagNameCheck(Ne)))return!1;if(J&&!A[Ne]){const fi=b(j)||j.parentNode,zn=v(j)||j.childNodes;if(zn&&fi){const tr=zn.length;for(let ji=tr-1;ji>=0;--ji)fi.insertBefore(p(zn[ji],!0),_(j))}}return ga(j),!0}return j instanceof l&&!nk(j)||(Ne==="noscript"||Ne==="noembed"||Ne==="noframes")&&ko(/<\/no(script|embed|frames)/i,j.innerHTML)?(ga(j),!0):(Ve&&j.nodeType===3&&(be=j.textContent,be=Fr(be,O," "),be=Fr(be,M," "),be=Fr(be,R," "),j.textContent!==be&&(D0(e.removed,{element:j.cloneNode()}),j.textContent=be)),_l("afterSanitizeElements",j,null),!1)},JP=function(j,be,Ne){if(Jo&&(be==="id"||be==="name")&&(Ne in s||Ne in Ou))return!1;if(!(qe&&!Dt[be]&&ko(z,be))){if(!(Tt&&ko(G,be))){if(!Ie[be]||Dt[be]){if(!(e5(j)&&(ie.tagNameCheck instanceof RegExp&&ko(ie.tagNameCheck,j)||ie.tagNameCheck instanceof Function&&ie.tagNameCheck(j))&&(ie.attributeNameCheck instanceof RegExp&&ko(ie.attributeNameCheck,be)||ie.attributeNameCheck instanceof Function&&ie.attributeNameCheck(be))||be==="is"&&ie.allowCustomizedBuiltInElements&&(ie.tagNameCheck instanceof RegExp&&ko(ie.tagNameCheck,Ne)||ie.tagNameCheck instanceof Function&&ie.tagNameCheck(Ne))))return!1}else if(!Z[be]){if(!ko(fe,Fr(Ne,ae,""))){if(!((be==="src"||be==="xlink:href"||be==="href")&&j!=="script"&&lme(Ne,"data:")===0&&W[j])){if(!(ni&&!ko(te,Fr(Ne,ae,"")))){if(Ne)return!1}}}}}}return!0},e5=function(j){return j.indexOf("-")>0},t5=function(j){let be,Ne,fi,zn;_l("beforeSanitizeAttributes",j,null);const{attributes:tr}=j;if(!tr)return;const ji={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ie};for(zn=tr.length;zn--;){be=tr[zn];const{name:pa,namespaceURI:sk}=be;if(Ne=pa==="value"?be.value:cme(be.value),fi=wt(pa),ji.attrName=fi,ji.attrValue=Ne,ji.keepAttr=!0,ji.forceKeepAttr=void 0,_l("uponSanitizeAttribute",j,ji),Ne=ji.attrValue,ji.forceKeepAttr||(m0(pa,j),!ji.keepAttr))continue;if(!ke&&ko(/\/>/i,Ne)){m0(pa,j);continue}Ve&&(Ne=Fr(Ne,O," "),Ne=Fr(Ne,M," "),Ne=Fr(Ne,R," "));const i5=wt(j.nodeName);if(JP(i5,fi,Ne)){if(Pu&&(fi==="id"||fi==="name")&&(m0(pa,j),Ne=ik+Ne),y&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!sk)switch(f.getAttributeType(i5,fi)){case"TrustedHTML":{Ne=y.createHTML(Ne);break}case"TrustedScriptURL":{Ne=y.createScriptURL(Ne);break}}try{sk?j.setAttributeNS(sk,pa,Ne):j.setAttribute(pa,Ne),t9(e.removed)}catch{}}}_l("afterSanitizeAttributes",j,null)},XY=function Ge(j){let be;const Ne=wy(j);for(_l("beforeSanitizeShadowDOM",j,null);be=Ne.nextNode();)_l("uponSanitizeShadowNode",be,null),!QP(be)&&(be.content instanceof o&&Ge(be.content),t5(be));_l("afterSanitizeShadowDOM",j,null)};return e.sanitize=function(Ge){let j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},be,Ne,fi,zn;if(Nt=!Ge,Nt&&(Ge=""),typeof Ge!="string"&&!Cy(Ge))if(typeof Ge.toString=="function"){if(Ge=Ge.toString(),typeof Ge!="string")throw k0("dirty is not a string, aborting")}else throw k0("toString is not a function");if(!e.isSupported)return Ge;if(he||Rr(j),e.removed=[],typeof Ge=="string"&&(q=!1),q){if(Ge.nodeName){const pa=wt(Ge.nodeName);if(!oe[pa]||Zt[pa])throw k0("root node is forbidden and cannot be sanitized in-place")}}else if(Ge instanceof a)be=_0(""),Ne=be.ownerDocument.importNode(Ge,!0),Ne.nodeType===1&&Ne.nodeName==="BODY"||Ne.nodeName==="HTML"?be=Ne:be.appendChild(Ne);else{if(!kt&&!Ve&&!ge&&Ge.indexOf("<")===-1)return y&&vi?y.createHTML(Ge):Ge;if(be=_0(Ge),!be)return kt?null:vi?w:""}be&&ki&&ga(be.firstChild);const tr=wy(q?Ge:be);for(;fi=tr.nextNode();)QP(fi)||(fi.content instanceof o&&XY(fi.content),t5(fi));if(q)return Ge;if(kt){if(It)for(zn=x.call(be.ownerDocument);be.firstChild;)zn.appendChild(be.firstChild);else zn=be;return(Ie.shadowroot||Ie.shadowrootmode)&&(zn=k.call(t,zn,!0)),zn}let ji=ge?be.outerHTML:be.innerHTML;return ge&&oe["!doctype"]&&be.ownerDocument&&be.ownerDocument.doctype&&be.ownerDocument.doctype.name&&ko(UU,be.ownerDocument.doctype.name)&&(ji=" +`+ji),Ve&&(ji=Fr(ji,O," "),ji=Fr(ji,M," "),ji=Fr(ji,R," ")),y&&vi?y.createHTML(ji):ji},e.setConfig=function(Ge){Rr(Ge),he=!0},e.clearConfig=function(){Wi=null,he=!1},e.isValidAttribute=function(Ge,j,be){Wi||Rr({});const Ne=wt(Ge),fi=wt(j);return JP(Ne,fi,be)},e.addHook=function(Ge,j){typeof j=="function"&&(P[Ge]=P[Ge]||[],D0(P[Ge],j))},e.removeHook=function(Ge){if(P[Ge])return t9(P[Ge])},e.removeHooks=function(Ge){P[Ge]&&(P[Ge]=[])},e.removeAllHooks=function(){P={}},e}var pl=jU();pl.version;pl.isSupported;const qU=pl.sanitize;pl.setConfig;pl.clearConfig;pl.isValidAttribute;const GU=pl.addHook,KU=pl.removeHook;pl.removeHooks;pl.removeAllHooks;var tt;(function(n){n.inMemory="inmemory",n.vscode="vscode",n.internal="private",n.walkThrough="walkThrough",n.walkThroughSnippet="walkThroughSnippet",n.http="http",n.https="https",n.file="file",n.mailto="mailto",n.untitled="untitled",n.data="data",n.command="command",n.vscodeRemote="vscode-remote",n.vscodeRemoteResource="vscode-remote-resource",n.vscodeManagedRemoteResource="vscode-managed-remote-resource",n.vscodeUserData="vscode-userdata",n.vscodeCustomEditor="vscode-custom-editor",n.vscodeNotebookCell="vscode-notebook-cell",n.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",n.vscodeNotebookCellOutput="vscode-notebook-cell-output",n.vscodeInteractiveInput="vscode-interactive-input",n.vscodeSettings="vscode-settings",n.vscodeWorkspaceTrust="vscode-workspace-trust",n.vscodeTerminal="vscode-terminal",n.vscodeChatSesssion="vscode-chat-editor",n.webviewPanel="webview-panel",n.vscodeWebview="vscode-webview",n.extension="extension",n.vscodeFileResource="vscode-file",n.tmp="tmp",n.vsls="vsls",n.vscodeSourceControl="vscode-scm"})(tt||(tt={}));const Cme="tkn";class Sme{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._remoteResourcesPath=`/${tt.vscodeRemoteResource}`}setPreferredWebSchema(e){this._preferredWebSchema=e}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return mt(a),e}const t=e.authority;let i=this._hosts[t];i&&i.indexOf(":")!==-1&&i.indexOf("[")===-1&&(i=`[${i}]`);const s=this._ports[t],o=this._connectionTokens[t];let r=`path=${encodeURIComponent(e.path)}`;return typeof o=="string"&&(r+=`&${Cme}=${encodeURIComponent(o)}`),Ue.from({scheme:i0?this._preferredWebSchema:tt.vscodeRemoteResource,authority:`${i}:${s}`,path:this._remoteResourcesPath,query:r})}}const YU=new Sme;class jb{uriToBrowserUri(e){return e.scheme===tt.vscodeRemote?YU.rewrite(e):e.scheme===tt.file&&(hp||_fe&&mr.origin===`${tt.vscodeFileResource}://${jb.FALLBACK_AUTHORITY}`)?e.with({scheme:tt.vscodeFileResource,authority:e.authority||jb.FALLBACK_AUTHORITY,query:null,fragment:null}):e}}jb.FALLBACK_AUTHORITY="vscode-app";const ZU=new jb;var a9;(function(n){const e=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);n.CoopAndCoep=Object.freeze(e.get("3"));const t="vscode-coi";function i(o){let r;typeof o=="string"?r=new URL(o).searchParams:o instanceof URL?r=o.searchParams:Ue.isUri(o)&&(r=new URL(o.toString(!0)).searchParams);const a=r==null?void 0:r.get(t);if(a)return e.get(a)}n.getHeadersFromQuery=i;function s(o,r,a){if(!globalThis.crossOriginIsolated)return;const l=r&&a?"3":a?"2":"1";o instanceof URLSearchParams?o.set(t,l):o[t]=l}n.addSearchParam=s})(a9||(a9={}));const{registerWindow:FPe,getWindows:xme,onDidCreateWindow:BPe}=function(){const n=[],e=new B;return{onDidCreateWindow:e.event,registerWindow(t){n.push(t);const i=new pe;return i.add(Ye(()=>{const s=n.indexOf(t);s!==-1&&n.splice(s,1)})),e.fire({window:t,disposableStore:i}),i},getWindows(){return n}}}();function xo(n){for(;n.firstChild;)n.firstChild.remove()}function Y4(n){var e;return(e=n==null?void 0:n.isConnected)!==null&&e!==void 0?e:!1}class Lme{constructor(e,t,i,s){this._node=e,this._type=t,this._handler=i,this._options=s||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}}function K(n,e,t,i){return new Lme(n,e,t,i)}function XU(n){return function(e){return n(new dr(e))}}function Dme(n){return function(e){return n(new zt(e))}}const Ui=function(e,t,i,s){let o=i;return t==="click"||t==="mousedown"?o=XU(i):(t==="keydown"||t==="keypress"||t==="keyup")&&(o=Dme(i)),K(e,t,o,s)},kme=function(e,t,i){const s=XU(t);return Eme(e,s,i)};function Eme(n,e,t){return K(n,eu&&K4.pointerEvents?de.POINTER_DOWN:de.MOUSE_DOWN,e,t)}let QU,jo;class s2{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){mt(e)}}static sort(e,t){return t.priority-e.priority}}(function(){let n=[],e=null,t=!1,i=!1;const s=()=>{for(t=!1,e=n,n=[],i=!0;e.length>0;)e.sort(s2.sort),e.shift().execute();i=!1};jo=(o,r=0)=>{const a=new s2(o,r);return n.push(a),t||(t=!0,requestAnimationFrame(s)),a},QU=(o,r)=>{if(i){const a=new s2(o,r);return e.push(a),a}else return jo(o,r)}})();function YL(n){return n.ownerDocument.defaultView.getComputedStyle(n,null)}function ZL(n){var e;const t=n.ownerDocument,i=(e=t.defaultView)===null||e===void 0?void 0:e.window;if(n!==t.body)return new Jt(n.clientWidth,n.clientHeight);if(eu&&(i!=null&&i.visualViewport))return new Jt(i.visualViewport.width,i.visualViewport.height);if(i!=null&&i.innerWidth&&i.innerHeight)return new Jt(i.innerWidth,i.innerHeight);if(t.body&&t.body.clientWidth&&t.body.clientHeight)return new Jt(t.body.clientWidth,t.body.clientHeight);if(t.documentElement&&t.documentElement.clientWidth&&t.documentElement.clientHeight)return new Jt(t.documentElement.clientWidth,t.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}class mi{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){const s=YL(e),o=s?s.getPropertyValue(t):"0";return mi.convertToPixels(e,o)}static getBorderLeftWidth(e){return mi.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return mi.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return mi.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return mi.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return mi.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return mi.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return mi.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return mi.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return mi.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return mi.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return mi.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return mi.getDimension(e,"margin-bottom","marginBottom")}}class Jt{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new Jt(e,t):this}static is(e){return typeof e=="object"&&typeof e.height=="number"&&typeof e.width=="number"}static lift(e){return e instanceof Jt?e:new Jt(e.width,e.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}}Jt.None=new Jt(0,0);function JU(n){let e=n.offsetParent,t=n.offsetTop,i=n.offsetLeft;for(;(n=n.parentNode)!==null&&n!==n.ownerDocument.body&&n!==n.ownerDocument.documentElement;){t-=n.scrollTop;const s=ej(n)?null:YL(n);s&&(i-=s.direction!=="rtl"?n.scrollLeft:-n.scrollLeft),n===e&&(i+=mi.getBorderLeftWidth(n),t+=mi.getBorderTopWidth(n),t+=n.offsetTop,i+=n.offsetLeft,e=n.offsetParent)}return{left:i,top:t}}function Tn(n){var e,t,i,s;const o=n.getBoundingClientRect();return{left:o.left+((t=(e=n.ownerDocument.defaultView)===null||e===void 0?void 0:e.scrollX)!==null&&t!==void 0?t:0),top:o.top+((s=(i=n.ownerDocument.defaultView)===null||i===void 0?void 0:i.scrollY)!==null&&s!==void 0?s:0),width:o.width,height:o.height}}function Ame(n){let e=n,t=1;do{const i=YL(e).zoom;i!=null&&i!=="1"&&(t*=i),e=e.parentElement}while(e!==null&&e!==e.ownerDocument.documentElement);return t}function ys(n){const e=mi.getMarginLeft(n)+mi.getMarginRight(n);return n.offsetWidth+e}function o2(n){const e=mi.getBorderLeftWidth(n)+mi.getBorderRightWidth(n),t=mi.getPaddingLeft(n)+mi.getPaddingRight(n);return n.offsetWidth-e-t}function Ime(n){const e=mi.getBorderTopWidth(n)+mi.getBorderBottomWidth(n),t=mi.getPaddingTop(n)+mi.getPaddingBottom(n);return n.offsetHeight-e-t}function Dh(n){const e=mi.getMarginTop(n)+mi.getMarginBottom(n);return n.offsetHeight+e}function wn(n,e){for(;n;){if(n===e)return!0;n=n.parentNode}return!1}function Tme(n,e,t){for(;n&&n.nodeType===n.ELEMENT_NODE;){if(n.classList.contains(e))return n;if(t){if(typeof t=="string"){if(n.classList.contains(t))return null}else if(n===t)return null}n=n.parentNode}return null}function r2(n,e,t){return!!Tme(n,e,t)}function ej(n){return n&&!!n.host&&!!n.mode}function oT(n){return!!wm(n)}function wm(n){for(var e;n.parentNode;){if(n===((e=n.ownerDocument)===null||e===void 0?void 0:e.body))return null;n=n.parentNode}return ej(n)?n:null}function ea(){let n=Nme().activeElement;for(;n!=null&&n.shadowRoot;)n=n.shadowRoot.activeElement;return n}function Nme(){var n;return(n=[document,...xme().map(t=>t.document)].find(t=>t.hasFocus()))!==null&&n!==void 0?n:document}function Dr(n=document.getElementsByTagName("head")[0],e){const t=document.createElement("style");return t.type="text/css",t.media="screen",e==null||e(t),n.appendChild(t),t}let a2=null;function tj(){return a2||(a2=Dr()),a2}function Rme(n){var e,t;return!((e=n==null?void 0:n.sheet)===null||e===void 0)&&e.rules?n.sheet.rules:!((t=n==null?void 0:n.sheet)===null||t===void 0)&&t.cssRules?n.sheet.cssRules:[]}function rT(n,e,t=tj()){!t||!e||t.sheet.insertRule(n+"{"+e+"}",0)}function l9(n,e=tj()){if(!e)return;const t=Rme(e),i=[];for(let s=0;s=0;s--)e.sheet.deleteRule(i[s])}function Z4(n){return typeof HTMLElement=="object"?n instanceof HTMLElement:n&&typeof n=="object"&&n.nodeType===1&&typeof n.nodeName=="string"}const de={CLICK:"click",AUXCLICK:"auxclick",DBLCLICK:"dblclick",MOUSE_UP:"mouseup",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_MOVE:"mousemove",MOUSE_OUT:"mouseout",MOUSE_ENTER:"mouseenter",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",POINTER_LEAVE:"pointerleave",CONTEXT_MENU:"contextmenu",WHEEL:"wheel",KEY_DOWN:"keydown",KEY_PRESS:"keypress",KEY_UP:"keyup",LOAD:"load",BEFORE_UNLOAD:"beforeunload",UNLOAD:"unload",PAGE_SHOW:"pageshow",PAGE_HIDE:"pagehide",ABORT:"abort",ERROR:"error",RESIZE:"resize",SCROLL:"scroll",FULLSCREEN_CHANGE:"fullscreenchange",WK_FULLSCREEN_CHANGE:"webkitfullscreenchange",SELECT:"select",CHANGE:"change",SUBMIT:"submit",RESET:"reset",FOCUS:"focus",FOCUS_IN:"focusin",FOCUS_OUT:"focusout",BLUR:"blur",INPUT:"input",STORAGE:"storage",DRAG_START:"dragstart",DRAG:"drag",DRAG_ENTER:"dragenter",DRAG_LEAVE:"dragleave",DRAG_OVER:"dragover",DROP:"drop",DRAG_END:"dragend",ANIMATION_START:Yh?"webkitAnimationStart":"animationstart",ANIMATION_END:Yh?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:Yh?"webkitAnimationIteration":"animationiteration"};function Mme(n){const e=n;return!!(e&&typeof e.preventDefault=="function"&&typeof e.stopPropagation=="function")}const $e={stop:(n,e)=>(n.preventDefault(),e&&n.stopPropagation(),n)};function Pme(n){const e=[];for(let t=0;n&&n.nodeType===n.ELEMENT_NODE;t++)e[t]=n.scrollTop,n=n.parentNode;return e}function Ome(n,e){for(let t=0;n&&n.nodeType===n.ELEMENT_NODE;t++)n.scrollTop!==e[t]&&(n.scrollTop=e[t]),n=n.parentNode}class DS extends Y{static hasFocusWithin(e){if(Z4(e)){const t=wm(e),i=t?t.activeElement:e.ownerDocument.activeElement;return wn(i,e)}else return wn(window.document.activeElement,window.document)}constructor(e){super(),this._onDidFocus=this._register(new B),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new B),this.onDidBlur=this._onDidBlur.event;let t=DS.hasFocusWithin(e),i=!1;const s=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},o=()=>{t&&(i=!0,window.setTimeout(()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())},0))};this._refreshStateHandler=()=>{DS.hasFocusWithin(e)!==t&&(t?o():s())},this._register(K(e,de.FOCUS,s,!0)),this._register(K(e,de.BLUR,o,!0)),e instanceof HTMLElement&&(this._register(K(e,de.FOCUS_IN,()=>this._refreshStateHandler())),this._register(K(e,de.FOCUS_OUT,()=>this._refreshStateHandler())))}}function iu(n){return new DS(n)}function le(n,...e){if(n.append(...e),e.length===1&&typeof e[0]!="string")return e[0]}function ij(n,e){return n.insertBefore(e,n.firstChild),e}function ls(n,...e){n.innerText="",le(n,...e)}const Fme=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var qb;(function(n){n.HTML="http://www.w3.org/1999/xhtml",n.SVG="http://www.w3.org/2000/svg"})(qb||(qb={}));function nj(n,e,t,...i){const s=Fme.exec(e);if(!s)throw new Error("Bad use of emmet");const o=s[1]||"div";let r;return n!==qb.HTML?r=document.createElementNS(n,o):r=document.createElement(o),s[3]&&(r.id=s[3]),s[4]&&(r.className=s[4].replace(/\./g," ").trim()),t&&Object.entries(t).forEach(([a,l])=>{typeof l>"u"||(/^on\w+$/.test(a)?r[a]=l:a==="selected"?l&&r.setAttribute(a,"true"):r.setAttribute(a,l))}),r.append(...i),r}function ye(n,e,...t){return nj(qb.HTML,n,e,...t)}ye.SVG=function(n,e,...t){return nj(qb.SVG,n,e,...t)};function Bme(n,...e){n?Xh(...e):cd(...e)}function Xh(...n){for(const e of n)e.style.display="",e.removeAttribute("aria-hidden")}function cd(...n){for(const e of n)e.style.display="none",e.setAttribute("aria-hidden","true")}function c9(n){const e=window.devicePixelRatio*n;return Math.max(1,Math.floor(e))/window.devicePixelRatio}function sj(n){window.open(n,"_blank","noopener")}function Wme(n){const e=()=>{n(),t=jo(e)};let t=jo(e);return Ye(()=>t.dispose())}YU.setPreferredWebSchema(/^https:/.test(window.location.href)?"https":"http");function nu(n){return n?`url('${ZU.uriToBrowserUri(n).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function d9(n){return`'${n.replace(/'/g,"%27")}'`}function Qh(n,e){if(n!==void 0){const t=n.match(/^\s*var\((.+)\)$/);if(t){const i=t[1].split(",",2);return i.length===2&&(e=Qh(i[1].trim(),e)),`var(${i[0]}, ${e})`}return n}return e}function Vme(n,e=!1){const t=document.createElement("a");return GU("afterSanitizeAttributes",i=>{for(const s of["href","src"])if(i.hasAttribute(s)){const o=i.getAttribute(s);if(s==="href"&&o.startsWith("#"))continue;if(t.href=o,!n.includes(t.protocol.replace(/:$/,""))){if(e&&s==="src"&&t.href.startsWith("data:"))continue;i.removeAttribute(s)}}}),Ye(()=>{KU("afterSanitizeAttributes")})}const zme=Object.freeze(["a","abbr","b","bdo","blockquote","br","caption","cite","code","col","colgroup","dd","del","details","dfn","div","dl","dt","em","figcaption","figure","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","label","li","mark","ol","p","pre","q","rp","rt","ruby","samp","small","small","source","span","strike","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","time","tr","tt","u","ul","var","video","wbr"]);class dd extends B{constructor(){super(),this._subscriptions=new pe,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(K(window,"keydown",e=>{if(e.defaultPrevented)return;const t=new zt(e);if(!(t.keyCode===6&&e.repeat)){if(e.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(e.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(e.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(e.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else if(t.keyCode!==6)this._keyStatus.lastKeyPressed=void 0;else return;this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=e,this.fire(this._keyStatus))}},!0)),this._subscriptions.add(K(window,"keyup",e=>{e.defaultPrevented||(!e.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!e.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!e.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!e.shiftKey&&this._keyStatus.shiftKey?this._keyStatus.lastKeyReleased="shift":this._keyStatus.lastKeyReleased=void 0,this._keyStatus.lastKeyPressed!==this._keyStatus.lastKeyReleased&&(this._keyStatus.lastKeyPressed=void 0),this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=e,this.fire(this._keyStatus)))},!0)),this._subscriptions.add(K(document.body,"mousedown",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),this._subscriptions.add(K(document.body,"mouseup",()=>{this._keyStatus.lastKeyPressed=void 0},!0)),this._subscriptions.add(K(document.body,"mousemove",e=>{e.buttons&&(this._keyStatus.lastKeyPressed=void 0)},!0)),this._subscriptions.add(K(window,"blur",()=>{this.resetKeyStatus()}))}get keyStatus(){return this._keyStatus}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return dd.instance||(dd.instance=new dd),dd.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class Hme extends Y{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this._register(K(this.element,de.DRAG_ENTER,e=>{this.counter++,this.dragStartTime=e.timeStamp,this.callbacks.onDragEnter(e)})),this._register(K(this.element,de.DRAG_OVER,e=>{var t,i;e.preventDefault(),(i=(t=this.callbacks).onDragOver)===null||i===void 0||i.call(t,e,e.timeStamp-this.dragStartTime)})),this._register(K(this.element,de.DRAG_LEAVE,e=>{this.counter--,this.counter===0&&(this.dragStartTime=0,this.callbacks.onDragLeave(e))})),this._register(K(this.element,de.DRAG_END,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDragEnd(e)})),this._register(K(this.element,de.DROP,e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDrop(e)}))}}const $me=/(?[\w\-]+)?(?:#(?[\w\-]+))?(?(?:\.(?:[\w\-]+))*)(?:@(?(?:[\w\_])+))?/;function dn(n,...e){let t,i;Array.isArray(e[0])?(t={},i=e[0]):(t=e[0]||{},i=e[1]);const s=$me.exec(n);if(!s||!s.groups)throw new Error("Bad use of h");const o=s.groups.tag||"div",r=document.createElement(o);s.groups.id&&(r.id=s.groups.id);const a=[];if(s.groups.class)for(const c of s.groups.class.split("."))c!==""&&a.push(c);if(t.className!==void 0)for(const c of t.className.split("."))c!==""&&a.push(c);a.length>0&&(r.className=a.join(" "));const l={};if(s.groups.name&&(l[s.groups.name]=r),i)for(const c of i)c instanceof HTMLElement?r.appendChild(c):typeof c=="string"?r.append(c):"root"in c&&(Object.assign(l,c),r.appendChild(c.root));for(const[c,d]of Object.entries(t))if(c!=="className")if(c==="style")for(const[u,h]of Object.entries(d))r.style.setProperty(u9(u),typeof h=="number"?h+"px":""+h);else c==="tabIndex"?r.tabIndex=d:r.setAttribute(u9(c),d.toString());return l.root=r,l}function u9(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}class XL{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this._description=e.description}register(){if(Array.isArray(this._menuOpts)?this._menuOpts.forEach(this._registerMenuItem,this):this._menuOpts&&this._registerMenuItem(this._menuOpts),this._kbOpts){const e=Array.isArray(this._kbOpts)?this._kbOpts:[this._kbOpts];for(const t of e){let i=t.kbExpr;this.precondition&&(i?i=Le.and(i,this.precondition):i=this.precondition);const s={id:this.id,weight:t.weight,args:t.args,when:i,primary:t.primary,secondary:t.secondary,win:t.win,linux:t.linux,mac:t.mac};Fs.registerKeybindingRule(s)}}Yt.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),description:this._description})}_registerMenuItem(e){cr.appendMenuItem(e.menuId,{group:e.group,command:{id:this.id,title:e.title,icon:e.icon,precondition:this.precondition},when:e.when,order:e.order})}}class X4 extends XL{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t,i,s){return this._implementations.push({priority:e,name:t,implementation:i,when:s}),this._implementations.sort((o,r)=>r.priority-o.priority),{dispose:()=>{for(let o=0;o{if(a.get(et).contextMatchesRules(i??void 0))return s(a,r,t)})}runCommand(e,t){return kr.runEditorCommand(e,t,this.precondition,(i,s,o)=>this.runEditorCommand(i,s,o))}}class Qt extends kr{static convertOptions(e){let t;Array.isArray(e.menuOpts)?t=e.menuOpts:e.menuOpts?t=[e.menuOpts]:t=[];function i(s){return s.menuId||(s.menuId=I.EditorContext),s.title||(s.title=e.label),s.when=Le.and(e.precondition,s.when),s}return Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(i)):e.contextMenuOpts&&t.push(i(e.contextMenuOpts)),e.menuOpts=t,e}constructor(e){super(Qt.convertOptions(e)),this.label=e.label,this.alias=e.alias}runEditorCommand(e,t,i){return this.reportTelemetry(e,t),this.run(e,t,i||{})}reportTelemetry(e,t){e.get(Cc).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class rj extends Qt{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort((i,s)=>s[0]-i[0]),{dispose:()=>{for(let i=0;i{var r,a;const l=o.get(et),c=o.get(Sc);if(!l.contextMatchesRules((r=this.desc.precondition)!==null&&r!==void 0?r:void 0)){c.debug("[EditorAction2] NOT running command because its precondition is FALSE",this.desc.id,(a=this.desc.precondition)===null||a===void 0?void 0:a.serialize());return}return this.runEditorCommand(o,s,...t)})}}function a0(n,e){Yt.registerCommand(n,function(t,...i){const s=t.get(vt),[o,r]=i;xs(Ue.isUri(o)),xs(V.isIPosition(r));const a=t.get(hs).getModel(o);if(a){const l=V.lift(r);return s.invokeFunction(e,a,l,...i.slice(2))}return t.get(Lu).createModelReference(o).then(l=>new Promise((c,d)=>{try{const u=s.invokeFunction(e,l.object.textEditorModel,V.lift(r),i.slice(2));c(u)}catch(u){d(u)}}).finally(()=>{l.dispose()}))})}function Ee(n){return No.INSTANCE.registerEditorCommand(n),n}function Ze(n){const e=new n;return No.INSTANCE.registerEditorAction(e),e}function aj(n){return No.INSTANCE.registerEditorAction(n),n}function jme(n){No.INSTANCE.registerEditorAction(n)}function Ir(n,e,t){No.INSTANCE.registerEditorContribution(n,e,t)}var mp;(function(n){function e(r){return No.INSTANCE.getEditorCommand(r)}n.getEditorCommand=e;function t(){return No.INSTANCE.getEditorActions()}n.getEditorActions=t;function i(){return No.INSTANCE.getEditorContributions()}n.getEditorContributions=i;function s(r){return No.INSTANCE.getEditorContributions().filter(a=>r.indexOf(a.id)>=0)}n.getSomeEditorContributions=s;function o(){return No.INSTANCE.getDiffEditorContributions()}n.getDiffEditorContributions=o})(mp||(mp={}));const qme={EditorCommonContributions:"editor.contributions"};class No{constructor(){this.editorContributions=[],this.diffEditorContributions=[],this.editorActions=[],this.editorCommands=Object.create(null)}registerEditorContribution(e,t,i){this.editorContributions.push({id:e,ctor:t,instantiation:i})}getEditorContributions(){return this.editorContributions.slice(0)}getDiffEditorContributions(){return this.diffEditorContributions.slice(0)}registerEditorAction(e){e.register(),this.editorActions.push(e)}getEditorActions(){return this.editorActions}registerEditorCommand(e){e.register(),this.editorCommands[e.id]=e}getEditorCommand(e){return this.editorCommands[e]||null}}No.INSTANCE=new No;pn.add(qme.EditorCommonContributions,No.INSTANCE);function K1(n){return n.register(),n}const lj=K1(new X4({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:I.MenubarEditMenu,group:"1_do",title:m({key:"miUndo",comment:["&& denotes a mnemonic"]},"&&Undo"),order:1},{menuId:I.CommandPalette,group:"",title:m("undo","Undo"),order:1}]}));K1(new oj(lj,{id:"default:undo",precondition:void 0}));const cj=K1(new X4({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:I.MenubarEditMenu,group:"1_do",title:m({key:"miRedo",comment:["&& denotes a mnemonic"]},"&&Redo"),order:2},{menuId:I.CommandPalette,group:"",title:m("redo","Redo"),order:1}]}));K1(new oj(cj,{id:"default:redo",precondition:void 0}));const Gme=K1(new X4({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:I.MenubarSelectionMenu,group:"1_basic",title:m({key:"miSelectAll",comment:["&& denotes a mnemonic"]},"&&Select All"),order:1},{menuId:I.CommandPalette,group:"",title:m("selectAll","Select All"),order:1}]})),dj=Symbol("MicrotaskDelay");var Eo=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},c_=function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof __values=="function"?__values(n):n[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(o){t[o]=n[o]&&function(r){return new Promise(function(a,l){r=n[o](r),s(a,l,r.done,r.value)})}}function s(o,r,a,l){Promise.resolve(l).then(function(c){o({value:c,done:a})},r)}};function aT(n){return!!n&&typeof n.then=="function"}function xc(n){const e=new Ar,t=n(e.token),i=new Promise((s,o)=>{const r=e.token.onCancellationRequested(()=>{r.dispose(),e.dispose(),o(new s0)});Promise.resolve(t).then(a=>{r.dispose(),e.dispose(),s(a)},a=>{r.dispose(),e.dispose(),o(a)})});return new class{cancel(){e.cancel()}then(s,o){return i.then(s,o)}catch(s){return this.then(void 0,s)}finally(s){return i.finally(s)}}}function Kme(n,e,t){return new Promise((i,s)=>{const o=e.onCancellationRequested(()=>{o.dispose(),i(t)});n.then(i,s).finally(()=>o.dispose())})}class Yme{constructor(){this.isDisposed=!1,this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null}queue(e){if(this.isDisposed)return Promise.reject(new Error("Throttler is disposed"));if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){const t=()=>{if(this.queuedPromise=null,this.isDisposed)return;const i=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,i};this.queuedPromise=new Promise(i=>{this.activePromise.then(t,t).then(i)})}return new Promise((t,i)=>{this.queuedPromise.then(t,i)})}return this.activePromise=e(),new Promise((t,i)=>{this.activePromise.then(s=>{this.activePromise=null,t(s)},s=>{this.activePromise=null,i(s)})})}dispose(){this.isDisposed=!0}}const Zme=(n,e)=>{let t=!0;const i=setTimeout(()=>{t=!1,e()},n);return{isTriggered:()=>t,dispose:()=>{clearTimeout(i),t=!1}}},Xme=n=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,n())}),{isTriggered:()=>e,dispose:()=>{e=!1}}};class ku{constructor(e){this.defaultDelay=e,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,t=this.defaultDelay){this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((s,o)=>{this.doResolve=s,this.doReject=o}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const s=this.task;return this.task=null,s()}}));const i=()=>{var s;this.deferred=null,(s=this.doResolve)===null||s===void 0||s.call(this,null)};return this.deferred=t===dj?Xme(i):Zme(t,i),this.completionPromise}isTriggered(){var e;return!!(!((e=this.deferred)===null||e===void 0)&&e.isTriggered())}cancel(){var e;this.cancelTimeout(),this.completionPromise&&((e=this.doReject)===null||e===void 0||e.call(this,new s0),this.completionPromise=null)}cancelTimeout(){var e;(e=this.deferred)===null||e===void 0||e.dispose(),this.deferred=null}dispose(){this.cancel()}}class uj{constructor(e){this.delayer=new ku(e),this.throttler=new Yme}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}}function Gb(n,e){return e?new Promise((t,i)=>{const s=setTimeout(()=>{o.dispose(),t()},n),o=e.onCancellationRequested(()=>{clearTimeout(s),o.dispose(),i(new s0)})}):xc(t=>Gb(n,t))}function kS(n,e=0,t){const i=setTimeout(()=>{n(),t&&s.dispose()},e),s=Ye(()=>{clearTimeout(i),t==null||t.deleteAndLeak(s)});return t==null||t.add(s),s}class Lc{constructor(e,t){this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel()}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}}class Y1{constructor(){this._token=-1}dispose(){this.cancel()}cancel(){this._token!==-1&&(clearInterval(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setInterval(()=>{e()},t)}}class Li{constructor(e,t){this.timeoutToken=-1,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=-1)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return this.timeoutToken!==-1}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){var e;(e=this.runner)===null||e===void 0||e.call(this)}}let ud;(function(){typeof requestIdleCallback!="function"||typeof cancelIdleCallback!="function"?ud=n=>{rU(()=>{if(e)return;const t=Date.now()+15;n(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,t-Date.now())}}))});let e=!1;return{dispose(){e||(e=!0)}}}:ud=(n,e)=>{const t=requestIdleCallback(n,typeof e=="number"?{timeout:e}:void 0);let i=!1;return{dispose(){i||(i=!0,cancelIdleCallback(t))}}}})();class Qme{constructor(e){this._didRun=!1,this._executor=()=>{try{this._value=e()}catch(t){this._error=t}finally{this._didRun=!0}},this._handle=ud(()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}}class hj{get isRejected(){var e;return((e=this.outcome)===null||e===void 0?void 0:e.outcome)===1}get isSettled(){return!!this.outcome}constructor(){this.p=new Promise((e,t)=>{this.completeCallback=e,this.errorCallback=t})}complete(e){return new Promise(t=>{this.completeCallback(e),this.outcome={outcome:0,value:e},t()})}error(e){return new Promise(t=>{this.errorCallback(e),this.outcome={outcome:1,value:e},t()})}cancel(){return this.error(new s0)}}var lT;(function(n){function e(i){return Eo(this,void 0,void 0,function*(){let s;const o=yield Promise.all(i.map(r=>r.then(a=>a,a=>{s||(s=a)})));if(typeof s<"u")throw s;return o})}n.settled=e;function t(i){return new Promise((s,o)=>Eo(this,void 0,void 0,function*(){try{yield i(s,o)}catch(r){o(r)}}))}n.withAsyncBody=t})(lT||(lT={}));class ln{static fromArray(e){return new ln(t=>{t.emitMany(e)})}static fromPromise(e){return new ln(t=>Eo(this,void 0,void 0,function*(){t.emitMany(yield e)}))}static fromPromises(e){return new ln(t=>Eo(this,void 0,void 0,function*(){yield Promise.all(e.map(i=>Eo(this,void 0,void 0,function*(){return t.emitOne(yield i)})))}))}static merge(e){return new ln(t=>Eo(this,void 0,void 0,function*(){yield Promise.all(e.map(i=>{var s,o,r;return Eo(this,void 0,void 0,function*(){var a,l,c,d;try{for(s=!0,o=c_(i);r=yield o.next(),a=r.done,!a;s=!0){d=r.value,s=!1;const u=d;t.emitOne(u)}}catch(u){l={error:u}}finally{try{!s&&!a&&(c=o.return)&&(yield c.call(o))}finally{if(l)throw l.error}}})}))}))}constructor(e){this._state=0,this._results=[],this._error=null,this._onStateChanged=new B,queueMicrotask(()=>Eo(this,void 0,void 0,function*(){const t={emitOne:i=>this.emitOne(i),emitMany:i=>this.emitMany(i),reject:i=>this.reject(i)};try{yield Promise.resolve(e(t)),this.resolve()}catch(i){this.reject(i)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}}))}[Symbol.asyncIterator](){let e=0;return{next:()=>Eo(this,void 0,void 0,function*(){do{if(this._state===2)throw this._error;if(eEo(this,void 0,void 0,function*(){var s,o,r,a;try{for(var l=!0,c=c_(e),d;d=yield c.next(),s=d.done,!s;l=!0){a=d.value,l=!1;const u=a;i.emitOne(t(u))}}catch(u){o={error:u}}finally{try{!l&&!s&&(r=c.return)&&(yield r.call(c))}finally{if(o)throw o.error}}}))}map(e){return ln.map(this,e)}static filter(e,t){return new ln(i=>Eo(this,void 0,void 0,function*(){var s,o,r,a;try{for(var l=!0,c=c_(e),d;d=yield c.next(),s=d.done,!s;l=!0){a=d.value,l=!1;const u=a;t(u)&&i.emitOne(u)}}catch(u){o={error:u}}finally{try{!l&&!s&&(r=c.return)&&(yield r.call(c))}finally{if(o)throw o.error}}}))}filter(e){return ln.filter(this,e)}static coalesce(e){return ln.filter(e,t=>!!t)}coalesce(){return ln.coalesce(this)}static toPromise(e){var t,i,s,o,r,a,l;return Eo(this,void 0,void 0,function*(){const c=[];try{for(t=!0,i=c_(e);s=yield i.next(),o=s.done,!o;t=!0){l=s.value,t=!1;const d=l;c.push(d)}}catch(d){r={error:d}}finally{try{!t&&!o&&(a=i.return)&&(yield a.call(i))}finally{if(r)throw r.error}}return c})}toPromise(){return ln.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}}ln.EMPTY=ln.fromArray([]);class Jme extends ln{constructor(e,t){super(t),this._source=e}cancel(){this._source.cancel()}}function e0e(n){const e=new Ar,t=n(e.token);return new Jme(e,i=>Eo(this,void 0,void 0,function*(){var s,o,r,a;const l=e.token.onCancellationRequested(()=>{l.dispose(),e.dispose(),i.reject(new s0)});try{try{for(var c=!0,d=c_(t),u;u=yield d.next(),s=u.done,!s;c=!0){a=u.value,c=!1;const h=a;if(e.token.isCancellationRequested)return;i.emitOne(h)}}catch(h){o={error:h}}finally{try{!c&&!s&&(r=d.return)&&(yield r.call(d))}finally{if(o)throw o.error}}l.dispose(),e.dispose()}catch(h){l.dispose(),e.dispose(),i.reject(h)}}))}const t0e="$initialize";let h9=!1;function cT(n){i0&&(h9||(h9=!0,console.warn("Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq")),console.warn(n.message))}class i0e{constructor(e,t,i,s){this.vsWorker=e,this.req=t,this.method=i,this.args=s,this.type=0}}class f9{constructor(e,t,i,s){this.vsWorker=e,this.seq=t,this.res=i,this.err=s,this.type=1}}class n0e{constructor(e,t,i,s){this.vsWorker=e,this.req=t,this.eventName=i,this.arg=s,this.type=2}}class s0e{constructor(e,t,i){this.vsWorker=e,this.req=t,this.event=i,this.type=3}}class o0e{constructor(e,t){this.vsWorker=e,this.req=t,this.type=4}}class r0e{constructor(e){this._workerId=-1,this._handler=e,this._lastSentReq=0,this._pendingReplies=Object.create(null),this._pendingEmitters=new Map,this._pendingEvents=new Map}setWorkerId(e){this._workerId=e}sendMessage(e,t){const i=String(++this._lastSentReq);return new Promise((s,o)=>{this._pendingReplies[i]={resolve:s,reject:o},this._send(new i0e(this._workerId,i,e,t))})}listen(e,t){let i=null;const s=new B({onWillAddFirstListener:()=>{i=String(++this._lastSentReq),this._pendingEmitters.set(i,s),this._send(new n0e(this._workerId,i,e,t))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(i),this._send(new o0e(this._workerId,i)),i=null}});return s.event}handleMessage(e){!e||!e.vsWorker||this._workerId!==-1&&e.vsWorker!==this._workerId||this._handleMessage(e)}_handleMessage(e){switch(e.type){case 1:return this._handleReplyMessage(e);case 0:return this._handleRequestMessage(e);case 2:return this._handleSubscribeEventMessage(e);case 3:return this._handleEventMessage(e);case 4:return this._handleUnsubscribeEventMessage(e)}}_handleReplyMessage(e){if(!this._pendingReplies[e.seq]){console.warn("Got reply to unknown seq");return}const t=this._pendingReplies[e.seq];if(delete this._pendingReplies[e.seq],e.err){let i=e.err;e.err.$isError&&(i=new Error,i.name=e.err.name,i.message=e.err.message,i.stack=e.err.stack),t.reject(i);return}t.resolve(e.res)}_handleRequestMessage(e){const t=e.req;this._handler.handleMessage(e.method,e.args).then(s=>{this._send(new f9(this._workerId,t,s,void 0))},s=>{s.detail instanceof Error&&(s.detail=MF(s.detail)),this._send(new f9(this._workerId,t,void 0,MF(s)))})}_handleSubscribeEventMessage(e){const t=e.req,i=this._handler.handleEvent(e.eventName,e.arg)(s=>{this._send(new s0e(this._workerId,t,s))});this._pendingEvents.set(t,i)}_handleEventMessage(e){if(!this._pendingEmitters.has(e.req)){console.warn("Got event for unknown req");return}this._pendingEmitters.get(e.req).fire(e.event)}_handleUnsubscribeEventMessage(e){if(!this._pendingEvents.has(e.req)){console.warn("Got unsubscribe for unknown req");return}this._pendingEvents.get(e.req).dispose(),this._pendingEvents.delete(e.req)}_send(e){const t=[];if(e.type===0)for(let i=0;i{this._protocol.handleMessage(d)},d=>{s==null||s(d)})),this._protocol=new r0e({sendMessage:(d,u)=>{this._worker.postMessage(d,u)},handleMessage:(d,u)=>{if(typeof i[d]!="function")return Promise.reject(new Error("Missing method "+d+" on main thread host."));try{return Promise.resolve(i[d].apply(i,u))}catch(h){return Promise.reject(h)}},handleEvent:(d,u)=>{if(gj(d)){const h=i[d].call(i,u);if(typeof h!="function")throw new Error(`Missing dynamic event ${d} on main thread host.`);return h}if(fj(d)){const h=i[d];if(typeof h!="function")throw new Error(`Missing event ${d} on main thread host.`);return h}throw new Error(`Malformed event name ${d}`)}}),this._protocol.setWorkerId(this._worker.getId());let o=null;const r=globalThis.require;typeof r<"u"&&typeof r.getConfig=="function"?o=r.getConfig():typeof globalThis.requirejs<"u"&&(o=globalThis.requirejs.s.contexts._.config);const a=x4(i);this._onModuleLoaded=this._protocol.sendMessage(t0e,[this._worker.getId(),JSON.parse(JSON.stringify(o)),t,a]);const l=(d,u)=>this._request(d,u),c=(d,u)=>this._protocol.listen(d,u);this._lazyProxy=new Promise((d,u)=>{s=u,this._onModuleLoaded.then(h=>{d(l0e(h,l,c))},h=>{u(h),this._onError("Worker failed to load "+t,h)})})}getProxyObject(){return this._lazyProxy}_request(e,t){return new Promise((i,s)=>{this._onModuleLoaded.then(()=>{this._protocol.sendMessage(e,t).then(i,s)},s)})}_onError(e,t){console.error(e),console.info(t)}}function fj(n){return n[0]==="o"&&n[1]==="n"&&qc(n.charCodeAt(2))}function gj(n){return/^onDynamic/.test(n)&&qc(n.charCodeAt(9))}function l0e(n,e,t){const i=r=>function(){const a=Array.prototype.slice.call(arguments,0);return e(r,a)},s=r=>function(a){return t(r,a)},o={};for(const r of n){if(gj(r)){o[r]=s(r);continue}if(fj(r)){o[r]=t(r,void 0);continue}o[r]=i(r)}return o}function Kf(n,e){var t;const i=globalThis.MonacoEnvironment;if(i!=null&&i.createTrustedTypesPolicy)try{return i.createTrustedTypesPolicy(n,e)}catch(s){mt(s);return}try{return(t=window.trustedTypes)===null||t===void 0?void 0:t.createPolicy(n,e)}catch(s){mt(s);return}}const g9=Kf("defaultWorkerFactory",{createScriptURL:n=>n});function c0e(n){const e=globalThis.MonacoEnvironment;if(e){if(typeof e.getWorker=="function")return e.getWorker("workerMain.js",n);if(typeof e.getWorkerUrl=="function"){const t=e.getWorkerUrl("workerMain.js",n);return new Worker(g9?g9.createScriptURL(t):t,{name:n})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}function d0e(n){return typeof n.then=="function"}class u0e{constructor(e,t,i,s,o){this.id=t,this.label=i;const r=c0e(i);d0e(r)?this.worker=r:this.worker=Promise.resolve(r),this.postMessage(e,[]),this.worker.then(a=>{a.onmessage=function(l){s(l.data)},a.onmessageerror=o,typeof a.addEventListener=="function"&&a.addEventListener("error",o)})}getId(){return this.id}postMessage(e,t){var i;(i=this.worker)===null||i===void 0||i.then(s=>{try{s.postMessage(e,t)}catch(o){mt(o),mt(new Error(`FAILED to post message to '${this.label}'-worker`,{cause:o}))}})}dispose(){var e;(e=this.worker)===null||e===void 0||e.then(t=>t.terminate()),this.worker=null}}class QL{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,i){const s=++QL.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new u0e(e,s,this._label||"anonymous"+s,t,o=>{cT(o),this._webWorkerFailedBeforeError=o,i(o)})}}QL.LAST_WORKER_ID=0;var ns;(function(n){n[n.None=0]="None",n[n.Indent=1]="Indent",n[n.IndentOutdent=2]="IndentOutdent",n[n.Outdent=3]="Outdent"})(ns||(ns={}));class l2{constructor(e){if(this._neutralCharacter=null,this._neutralCharacterSearched=!1,this.open=e.open,this.close=e.close,this._inString=!0,this._inComment=!0,this._inRegEx=!0,Array.isArray(e.notIn))for(let t=0,i=e.notIn.length;t0&&n.getLanguageId(r-1)===s;)r--;return new f0e(n,s,r,o+1,n.getStartOffset(r),n.getEndOffset(o))}class f0e{constructor(e,t,i,s,o,r){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=s,this.firstCharOffset=o,this._lastCharOffset=r}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}getActualLineContentBefore(e){return this._actual.getLineContent().substring(0,this.firstCharOffset+e)}getTokenCount(){return this._lastTokenIndex-this._firstTokenIndex}findTokenIndexAtOffset(e){return this._actual.findTokenIndexAtOffset(e+this.firstCharOffset)-this._firstTokenIndex}getStandardTokenType(e){return this._actual.getStandardTokenType(e+this._firstTokenIndex)}}function ba(n){return(n&3)!==0}class Cm{constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map(t=>new l2(t)):e.brackets?this._autoClosingPairs=e.brackets.map(t=>new l2({open:t[0],close:t[1]})):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new l2({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:Cm.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets=typeof e.autoCloseBefore=="string"?e.autoCloseBefore:Cm.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS,this._surroundingPairs=e.surroundingPairs||this._autoClosingPairs}getAutoClosingPairs(){return this._autoClosingPairs}getAutoCloseBeforeSet(e){return e?this._autoCloseBeforeForQuotes:this._autoCloseBeforeForBrackets}getSurroundingPairs(){return this._surroundingPairs}}Cm.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=`;:.,=}])> + `;Cm.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS=`'"\`;:.,=}])> + `;const p9=typeof Buffer<"u";let c2;class Q4{static wrap(e){return p9&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new Q4(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return p9?this.buffer.toString():(c2||(c2=new TextDecoder),c2.decode(this.buffer))}}function g0e(n,e){return n[e+0]<<0>>>0|n[e+1]<<8>>>0}function p0e(n,e,t){n[t+0]=e&255,e=e>>>8,n[t+1]=e&255}function $r(n,e){return n[e]*Math.pow(2,24)+n[e+1]*Math.pow(2,16)+n[e+2]*Math.pow(2,8)+n[e+3]}function Ur(n,e,t){n[t+3]=e,e=e>>>8,n[t+2]=e,e=e>>>8,n[t+1]=e,e=e>>>8,n[t]=e}function m9(n,e){return n[e]}function _9(n,e,t){n[t]=e}let d2;function pj(){return d2||(d2=new TextDecoder("UTF-16LE")),d2}let u2;function m0e(){return u2||(u2=new TextDecoder("UTF-16BE")),u2}let h2;function mj(){return h2||(h2=yfe()?pj():m0e()),h2}function _0e(n,e,t){const i=new Uint16Array(n.buffer,e,t);return t>0&&(i[0]===65279||i[0]===65534)?b0e(n,e,t):pj().decode(i)}function b0e(n,e,t){const i=[];let s=0;for(let o=0;o=this._capacity){this._flushBuffer(),this._completedStrings[this._completedStrings.length]=e;return}for(let i=0;i[r[0].toLowerCase(),r[1].toLowerCase()]);const t=[];for(let r=0;r{const[l,c]=r,[d,u]=a;return l===d||l===u||c===d||c===u},s=(r,a)=>{const l=Math.min(r,a),c=Math.max(r,a);for(let d=0;d0&&o.push({open:a,close:l})}return o}class y0e{constructor(e,t){this._richEditBracketsBrand=void 0;const i=v0e(t);this.brackets=i.map((s,o)=>new ES(e,o,s.open,s.close,w0e(s.open,s.close,i,o),C0e(s.open,s.close,i,o))),this.forwardRegex=S0e(this.brackets),this.reversedRegex=x0e(this.brackets),this.textIsBracket={},this.textIsOpenBracket={},this.maxBracketLength=0;for(const s of this.brackets){for(const o of s.open)this.textIsBracket[o]=s,this.textIsOpenBracket[o]=!0,this.maxBracketLength=Math.max(this.maxBracketLength,o.length);for(const o of s.close)this.textIsBracket[o]=s,this.textIsOpenBracket[o]=!1,this.maxBracketLength=Math.max(this.maxBracketLength,o.length)}}}function _j(n,e,t,i){for(let s=0,o=e.length;s=0&&i.push(a);for(const a of r.close)a.indexOf(n)>=0&&i.push(a)}}function bj(n,e){return n.length-e.length}function tD(n){if(n.length<=1)return n;const e=[],t=new Set;for(const i of n)t.has(i)||(e.push(i),t.add(i));return e}function w0e(n,e,t,i){let s=[];s=s.concat(n),s=s.concat(e);for(let o=0,r=s.length;o=0;r--)s[o++]=i.charCodeAt(r);return mj().decode(s)}let e=null,t=null;return function(s){return e!==s&&(e=s,t=n(e)),t}}();class sr{static _findPrevBracketInText(e,t,i,s){const o=i.match(e);if(!o)return null;const r=i.length-(o.index||0),a=o[0].length,l=s+r;return new N(t,l-a+1,t,l+1)}static findPrevBracketInRange(e,t,i,s,o){const a=J4(i).substring(i.length-o,i.length-s);return this._findPrevBracketInText(e,t,a,s)}static findNextBracketInText(e,t,i,s){const o=i.match(e);if(!o)return null;const r=o.index||0,a=o[0].length;if(a===0)return null;const l=s+r;return new N(t,l+1,t,l+1+a)}static findNextBracketInRange(e,t,i,s,o){const r=i.substring(s,o);return this.findNextBracketInText(e,t,r,s)}}class D0e{constructor(e){this._richEditBrackets=e}getElectricCharacters(){const e=[];if(this._richEditBrackets)for(const t of this._richEditBrackets.brackets)for(const i of t.close){const s=i.charAt(i.length-1);e.push(s)}return vf(e)}onElectricCharacter(e,t,i){if(!this._richEditBrackets||this._richEditBrackets.brackets.length===0)return null;const s=t.findTokenIndexAtOffset(i-1);if(ba(t.getStandardTokenType(s)))return null;const o=this._richEditBrackets.reversedRegex,r=t.getLineContent().substring(0,i-1)+e,a=sr.findPrevBracketInRange(o,1,r,0,r.length);if(!a)return null;const l=r.substring(a.startColumn-1,a.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[l])return null;const d=t.getActualLineContentBefore(a.startColumn-1);return/^\s*$/.test(d)?{matchOpenBracket:l}:null}}function $y(n){return n.global&&(n.lastIndex=0),!0}class k0e{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&$y(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&$y(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&$y(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&$y(this._indentationRules.unIndentedLinePattern)&&this._indentationRules.unIndentedLinePattern.test(e))}getIndentMetadata(e){let t=0;return this.shouldIncrease(e)&&(t+=1),this.shouldDecrease(e)&&(t+=2),this.shouldIndentNextLine(e)&&(t+=4),this.shouldIgnore(e)&&(t+=8),t}}class zg{constructor(e){e=e||{},e.brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach(t=>{const i=zg._createOpenBracketRegExp(t[0]),s=zg._createCloseBracketRegExp(t[1]);i&&s&&this._brackets.push({open:t[0],openRegExp:i,close:t[1],closeRegExp:s})}),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,i,s){if(e>=3)for(let o=0,r=this._regExpRules.length;oc.reg?(c.reg.lastIndex=0,c.reg.test(c.text)):!0))return a.action}if(e>=2&&i.length>0&&s.length>0)for(let o=0,r=this._brackets.length;o=2&&i.length>0){for(let o=0,r=this._brackets.length;o"u"?t:o}function A0e(n){return n.replace(/[\[\]]/g,"")}const Ni=rt("languageService");class La{constructor(e,t=[],i=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=i}}const wj=[];function ft(n,e,t){e instanceof La||(e=new La(e,[],!!t)),wj.push([n,e])}function v9(){return wj}const Ul=Object.freeze({text:"text/plain",binary:"application/octet-stream",unknown:"application/unknown",markdown:"text/markdown",latex:"text/latex",uriList:"text/uri-list"}),nD={JSONContribution:"base.contributions.json"};function I0e(n){return n.length>0&&n.charAt(n.length-1)==="#"?n.substring(0,n.length-1):n}class T0e{constructor(){this._onDidChangeSchema=new B,this.schemasById={}}registerSchema(e,t){this.schemasById[I0e(e)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}}const N0e=new T0e;pn.add(nD.JSONContribution,N0e);const Yf={Configuration:"base.contributions.configuration"},A0="vscode://schemas/settings/resourceLanguage",y9=pn.as(nD.JSONContribution);class R0e{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new B,this._onDidUpdateConfiguration=new B,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:m("defaultLanguageConfigurationOverrides.title","Default Language Configuration Overrides"),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.policyConfigurations=new Map,this.excludedConfigurationProperties={},y9.registerSchema(A0,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){this.registerConfigurations([e],t)}registerConfigurations(e,t=!0){const i=new Set;this.doRegisterConfigurations(e,t,i),y9.registerSchema(A0,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}registerDefaultConfigurations(e){const t=new Set;this.doRegisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,t){var i;const s=[];for(const{overrides:o,source:r}of e)for(const a in o)if(t.add(a),su.test(a)){const l=this.configurationDefaultsOverrides.get(a),c=(i=l==null?void 0:l.valuesSources)!==null&&i!==void 0?i:new Map;if(r)for(const f of Object.keys(o[a]))c.set(f,r);const d=Object.assign(Object.assign({},(l==null?void 0:l.value)||{}),o[a]);this.configurationDefaultsOverrides.set(a,{source:r,value:d,valuesSources:c});const u=A0e(a),h={type:"object",default:d,description:m("defaultLanguageConfiguration.description","Configure settings to be overridden for the {0} language.",u),$ref:A0,defaultDefaultValue:d,source:Rs(r)?void 0:r,defaultValueSource:r};s.push(...AS(a)),this.configurationProperties[a]=h,this.defaultLanguageConfigurationOverridesNode.properties[a]=h}else{this.configurationDefaultsOverrides.set(a,{value:o[a],source:r});const l=this.configurationProperties[a];l&&(this.updatePropertyDefaultValue(a,l),this.updateSchema(a,l))}this.doRegisterOverrideIdentifiers(s)}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(const t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t,i){e.forEach(s=>{this.validateAndRegisterProperties(s,t,s.extensionInfo,s.restrictedProperties,void 0,i),this.configurationContributors.push(s),this.registerJSONConfiguration(s)})}validateAndRegisterProperties(e,t=!0,i,s,o=3,r){var a;o=po(e.scope)?o:e.scope;const l=e.properties;if(l)for(const d in l){const u=l[d];if(t&&O0e(d,u)){delete l[d];continue}if(u.source=i,u.defaultDefaultValue=l[d].default,this.updatePropertyDefaultValue(d,u),su.test(d)?u.scope=void 0:(u.scope=po(u.scope)?o:u.scope,u.restricted=po(u.restricted)?!!(s!=null&&s.includes(d)):u.restricted),l[d].hasOwnProperty("included")&&!l[d].included){this.excludedConfigurationProperties[d]=l[d],delete l[d];continue}else this.configurationProperties[d]=l[d],!((a=l[d].policy)===null||a===void 0)&&a.name&&this.policyConfigurations.set(l[d].policy.name,d);!l[d].deprecationMessage&&l[d].markdownDeprecationMessage&&(l[d].deprecationMessage=l[d].markdownDeprecationMessage),r.add(d)}const c=e.allOf;if(c)for(const d of c)this.validateAndRegisterProperties(d,t,i,s,o,r)}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}registerJSONConfiguration(e){const t=i=>{const s=i.properties;if(s)for(const r in s)this.updateSchema(r,s[r]);const o=i.allOf;o==null||o.forEach(t)};t(e)}updateSchema(e,t){switch(t.scope){case 1:break;case 2:break;case 6:break;case 3:break;case 4:break;case 5:this.resourceLanguageSettingsSchema.properties[e]=t;break}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,i={type:"object",description:m("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),errorMessage:m("overrideSettings.errorMessage","This setting does not support per-language configuration."),$ref:A0};this.updatePropertyDefaultValue(t,i)}}registerOverridePropertyPatternKey(){m("overrideSettings.defaultDescription","Configure editor settings to be overridden for a language."),m("overrideSettings.errorMessage","This setting does not support per-language configuration."),this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){const i=this.configurationDefaultsOverrides.get(e);let s=i==null?void 0:i.value,o=i==null?void 0:i.source;qs(s)&&(s=t.defaultDefaultValue,o=void 0),qs(s)&&(s=P0e(t.type)),t.default=s,t.defaultValueSource=o}}const Cj="\\[([^\\]]+)\\]",w9=new RegExp(Cj,"g"),M0e=`^(${Cj})+$`,su=new RegExp(M0e);function AS(n){const e=[];if(su.test(n)){let t=w9.exec(n);for(;t!=null&&t.length;){const i=t[1].trim();i&&e.push(i),t=w9.exec(n)}}return vf(e)}function P0e(n){switch(Array.isArray(n)?n[0]:n){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}const cC=new R0e;pn.add(Yf.Configuration,cC);function O0e(n,e){var t,i,s,o;return n.trim()?su.test(n)?m("config.property.languageDefault","Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",n):cC.getConfigurationProperties()[n]!==void 0?m("config.property.duplicate","Cannot register '{0}'. This property is already registered.",n):!((t=e.policy)===null||t===void 0)&&t.name&&cC.getPolicyConfigurations().get((i=e.policy)===null||i===void 0?void 0:i.name)!==void 0?m("config.policy.duplicate","Cannot register '{0}'. The associated policy {1} is already registered with {2}.",n,(s=e.policy)===null||s===void 0?void 0:s.name,cC.getPolicyConfigurations().get((o=e.policy)===null||o===void 0?void 0:o.name)):null:m("config.property.empty","Cannot register an empty property")}const F0e={ModesRegistry:"editor.modesRegistry"};class B0e{constructor(){this._onDidChangeLanguages=new B,this.onDidChangeLanguages=this._onDidChangeLanguages.event,this._languages=[]}registerLanguage(e){return this._languages.push(e),this._onDidChangeLanguages.fire(void 0),{dispose:()=>{for(let t=0,i=this._languages.length;t{const l=new Set;return{info:new z0e(this,a,l),closing:l}}),o=new UF(a=>{const l=new Set,c=new Set;return{info:new H0e(this,a,l,c),opening:l,openingColorized:c}});for(const[a,l]of i){const c=s.get(a),d=o.get(l);c.closing.add(d.info),d.opening.add(c.info)}const r=t.colorizedBracketPairs?C9(t.colorizedBracketPairs):i.filter(a=>!(a[0]==="<"&&a[1]===">"));for(const[a,l]of r){const c=s.get(a),d=o.get(l);c.closing.add(d.info),d.openingColorized.add(c.info),d.opening.add(c.info)}this._openingBrackets=new Map([...s.cachedValues].map(([a,l])=>[a,l.info])),this._closingBrackets=new Map([...o.cachedValues].map(([a,l])=>[a,l.info]))}get openingBrackets(){return[...this._openingBrackets.values()]}get closingBrackets(){return[...this._closingBrackets.values()]}getOpeningBracketInfo(e){return this._openingBrackets.get(e)}getClosingBracketInfo(e){return this._closingBrackets.get(e)}getBracketInfo(e){return this.getOpeningBracketInfo(e)||this.getClosingBracketInfo(e)}}function C9(n){return n.filter(([e,t])=>e!==""&&t!=="")}class Sj{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class z0e extends Sj{constructor(e,t,i){super(e,t),this.openedBrackets=i,this.isOpeningBracket=!0}}class H0e extends Sj{constructor(e,t,i,s){super(e,t),this.openingBrackets=i,this.openingColorizedBrackets=s,this.isOpeningBracket=!1}closes(e){return e.config!==this.config?!1:this.openingBrackets.has(e)}closesColorized(e){return e.config!==this.config?!1:this.openingColorizedBrackets.has(e)}getOpeningBrackets(){return[...this.openingBrackets]}}var $0e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},S9=function(n,e){return function(t,i){e(t,i,n)}};class f2{constructor(e){this.languageId=e}affects(e){return this.languageId?this.languageId===e:!0}}const so=rt("languageConfigurationService");let uT=class extends Y{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new G0e),this.onDidChangeEmitter=this._register(new B),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const i=new Set(Object.values(hT));this._register(this.configurationService.onDidChangeConfiguration(s=>{const o=s.change.keys.some(a=>i.has(a)),r=s.change.overrides.filter(([a,l])=>l.some(c=>i.has(c))).map(([a])=>a);if(o)this.configurations.clear(),this.onDidChangeEmitter.fire(new f2(void 0));else for(const a of r)this.languageService.isRegisteredLanguageId(a)&&(this.configurations.delete(a),this.onDidChangeEmitter.fire(new f2(a)))})),this._register(this._registry.onDidChange(s=>{this.configurations.delete(s.languageId),this.onDidChangeEmitter.fire(new f2(s.languageId))}))}register(e,t,i){return this._registry.register(e,t,i)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=U0e(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};uT=$0e([S9(0,ii),S9(1,Ni)],uT);function U0e(n,e,t,i){let s=e.getLanguageConfiguration(n);if(!s){if(!i.isRegisteredLanguageId(n))return new bp(n,{});s=new bp(n,{})}const o=j0e(s.languageId,t),r=Lj([s.underlyingConfig,o]);return new bp(s.languageId,r)}const hT={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function j0e(n,e){const t=e.getValue(hT.brackets,{overrideIdentifier:n}),i=e.getValue(hT.colorizedBracketPairs,{overrideIdentifier:n});return{brackets:x9(t),colorizedBracketPairs:x9(i)}}function x9(n){if(Array.isArray(n))return n.map(e=>{if(!(!Array.isArray(e)||e.length!==2))return[e[0],e[1]]}).filter(e=>!!e)}function xj(n,e,t){const i=n.getLineContent(e);let s=zs(i);return s.length>t-1&&(s=s.substring(0,t-1)),s}function _p(n,e,t){n.tokenization.forceTokenization(e);const i=n.tokenization.getLineTokens(e),s=typeof t>"u"?n.getLineMaxColumn(e)-1:t-1;return JL(i,s)}class q0e{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const i=new L9(e,t,++this._order);return this._entries.push(i),this._resolved=null,Ye(()=>{for(let s=0;se.configuration)))}}function Lj(n){let e={comments:void 0,brackets:void 0,wordPattern:void 0,indentationRules:void 0,onEnterRules:void 0,autoClosingPairs:void 0,surroundingPairs:void 0,autoCloseBefore:void 0,folding:void 0,colorizedBracketPairs:void 0,__electricCharacterSupport:void 0};for(const t of n)e={comments:t.comments||e.comments,brackets:t.brackets||e.brackets,wordPattern:t.wordPattern||e.wordPattern,indentationRules:t.indentationRules||e.indentationRules,onEnterRules:t.onEnterRules||e.onEnterRules,autoClosingPairs:t.autoClosingPairs||e.autoClosingPairs,surroundingPairs:t.surroundingPairs||e.surroundingPairs,autoCloseBefore:t.autoCloseBefore||e.autoCloseBefore,folding:t.folding||e.folding,colorizedBracketPairs:t.colorizedBracketPairs||e.colorizedBracketPairs,__electricCharacterSupport:t.__electricCharacterSupport||e.__electricCharacterSupport};return e}class L9{constructor(e,t,i){this.configuration=e,this.priority=t,this.order=i}static cmp(e,t){return e.priority===t.priority?e.order-t.order:e.priority-t.priority}}class D9{constructor(e){this.languageId=e}}class G0e extends Y{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._register(this.register(Ho,{brackets:[["(",")"],["[","]"],["{","}"]],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:"<",close:">"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"`",close:"`"}],colorizedBracketPairs:[],folding:{offSide:!0}},0))}register(e,t,i=0){let s=this._entries.get(e);s||(s=new q0e(e),this._entries.set(e,s));const o=s.register(t,i);return this._onDidChange.fire(new D9(e)),Ye(()=>{o.dispose(),this._onDidChange.fire(new D9(e))})}getLanguageConfiguration(e){const t=this._entries.get(e);return(t==null?void 0:t.getResolvedConfiguration())||null}}class bp{constructor(e,t){this.languageId=e,this.underlyingConfig=t,this._brackets=null,this._electricCharacter=null,this._onEnterSupport=this.underlyingConfig.brackets||this.underlyingConfig.indentationRules||this.underlyingConfig.onEnterRules?new zg(this.underlyingConfig):null,this.comments=bp._handleComments(this.underlyingConfig),this.characterPair=new Cm(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||k4,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new k0e(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new V0e(e,this.underlyingConfig)}getWordDefinition(){return cU(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new y0e(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new D0e(this.brackets)),this._electricCharacter}onEnter(e,t,i,s){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,s):null}getAutoClosingPairs(){return new h0e(this.characterPair.getAutoClosingPairs())}getAutoCloseBeforeSet(e){return this.characterPair.getAutoCloseBeforeSet(e)}getSurroundingPairs(){return this.characterPair.getSurroundingPairs()}static _handleComments(e){const t=e.comments;if(!t)return null;const i={};if(t.lineComment&&(i.lineCommentToken=t.lineComment),t.blockComment){const[s,o]=t.blockComment;i.blockCommentStartToken=s,i.blockCommentEndToken=o}return i}}ft(so,uT,1);class Vc{constructor(e,t,i,s){this.originalStart=e,this.originalLength=t,this.modifiedStart=i,this.modifiedLength=s}getOriginalEnd(){return this.originalStart+this.originalLength}getModifiedEnd(){return this.modifiedStart+this.modifiedLength}}function K0e(n){return sD(n,0)}function sD(n,e){switch(typeof n){case"object":return n===null?Ql(349,e):Array.isArray(n)?Z0e(n,e):X0e(n,e);case"string":return e3(n,e);case"boolean":return Y0e(n,e);case"number":return Ql(n,e);case"undefined":return Ql(937,e);default:return Ql(617,e)}}function Ql(n,e){return(e<<5)-e+n|0}function Y0e(n,e){return Ql(n?433:863,e)}function e3(n,e){e=Ql(149417,e);for(let t=0,i=n.length;tsD(i,t),e)}function X0e(n,e){return e=Ql(181387,e),Object.keys(n).sort().reduce((t,i)=>(t=e3(i,t),sD(n[i],t)),e)}function g2(n,e,t=32){const i=t-e,s=~((1<>>i)>>>0}function k9(n,e=0,t=n.byteLength,i=0){for(let s=0;st.toString(16).padStart(2,"0")).join(""):Q0e((n>>>0).toString(16),e/4)}class oD{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const t=e.length;if(t===0)return;const i=this._buff;let s=this._buffLen,o=this._leftoverHighSurrogate,r,a;for(o!==0?(r=o,a=-1,o=0):(r=e.charCodeAt(0),a=0);;){let l=r;if(tn(r))if(a+1>>6,e[t++]=128|(i&63)>>>0):i<65536?(e[t++]=224|(i&61440)>>>12,e[t++]=128|(i&4032)>>>6,e[t++]=128|(i&63)>>>0):(e[t++]=240|(i&1835008)>>>18,e[t++]=128|(i&258048)>>>12,e[t++]=128|(i&4032)>>>6,e[t++]=128|(i&63)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),I0(this._h0)+I0(this._h1)+I0(this._h2)+I0(this._h3)+I0(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,k9(this._buff,this._buffLen),this._buffLen>56&&(this._step(),k9(this._buff));const e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){const e=oD._bigBlock32,t=this._buffDV;for(let u=0;u<64;u+=4)e.setUint32(u,t.getUint32(u,!1),!1);for(let u=64;u<320;u+=4)e.setUint32(u,g2(e.getUint32(u-12,!1)^e.getUint32(u-32,!1)^e.getUint32(u-56,!1)^e.getUint32(u-64,!1),1),!1);let i=this._h0,s=this._h1,o=this._h2,r=this._h3,a=this._h4,l,c,d;for(let u=0;u<80;u++)u<20?(l=s&o|~s&r,c=1518500249):u<40?(l=s^o^r,c=1859775393):u<60?(l=s&o|s&r|o&r,c=2400959708):(l=s^o^r,c=3395469782),d=g2(i,5)+l+a+c+e.getUint32(u*4,!1)&4294967295,a=r,r=o,o=g2(s,30),s=i,i=d;this._h0=this._h0+i&4294967295,this._h1=this._h1+s&4294967295,this._h2=this._h2+o&4294967295,this._h3=this._h3+r&4294967295,this._h4=this._h4+a&4294967295}}oD._bigBlock32=new DataView(new ArrayBuffer(320));class E9{constructor(e){this.source=e}getElements(){const e=this.source,t=new Int32Array(e.length);for(let i=0,s=e.length;i0||this.m_modifiedCount>0)&&this.m_changes.push(new Vc(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}AddOriginalElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_originalCount++}AddModifiedElement(e,t){this.m_originalStart=Math.min(this.m_originalStart,e),this.m_modifiedStart=Math.min(this.m_modifiedStart,t),this.m_modifiedCount++}getChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes}getReverseChanges(){return(this.m_originalCount>0||this.m_modifiedCount>0)&&this.MarkNextChange(),this.m_changes.reverse(),this.m_changes}}class jl{constructor(e,t,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=e,this._modifiedSequence=t;const[s,o,r]=jl._getElements(e),[a,l,c]=jl._getElements(t);this._hasStrings=r&&c,this._originalStringElements=s,this._originalElementsOrHash=o,this._modifiedStringElements=a,this._modifiedElementsOrHash=l,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){return e.length>0&&typeof e[0]=="string"}static _getElements(e){const t=e.getElements();if(jl._isStringArray(t)){const i=new Int32Array(t.length);for(let s=0,o=t.length;s=e&&s>=i&&this.ElementsAreEqual(t,s);)t--,s--;if(e>t||i>s){let u;return i<=s?(pg.Assert(e===t+1,"originalStart should only be one more than originalEnd"),u=[new Vc(e,0,i,s-i+1)]):e<=t?(pg.Assert(i===s+1,"modifiedStart should only be one more than modifiedEnd"),u=[new Vc(e,t-e+1,i,0)]):(pg.Assert(e===t+1,"originalStart should only be one more than originalEnd"),pg.Assert(i===s+1,"modifiedStart should only be one more than modifiedEnd"),u=[]),u}const r=[0],a=[0],l=this.ComputeRecursionPoint(e,t,i,s,r,a,o),c=r[0],d=a[0];if(l!==null)return l;if(!o[0]){const u=this.ComputeDiffRecursive(e,c,i,d,o);let h=[];return o[0]?h=[new Vc(c+1,t-(c+1)+1,d+1,s-(d+1)+1)]:h=this.ComputeDiffRecursive(c+1,t,d+1,s,o),this.ConcatenateChanges(u,h)}return[new Vc(e,t-e+1,i,s-i+1)]}WALKTRACE(e,t,i,s,o,r,a,l,c,d,u,h,f,g,p,_,v,b){let y=null,w=null,S=new A9,L=t,x=i,D=f[0]-_[0]-s,k=-1073741824,P=this.m_forwardHistory.length-1;do{const O=D+e;O===L||O=0&&(c=this.m_forwardHistory[P],e=c[0],L=1,x=c.length-1)}while(--P>=-1);if(y=S.getReverseChanges(),b[0]){let O=f[0]+1,M=_[0]+1;if(y!==null&&y.length>0){const R=y[y.length-1];O=Math.max(O,R.getOriginalEnd()),M=Math.max(M,R.getModifiedEnd())}w=[new Vc(O,h-O+1,M,p-M+1)]}else{S=new A9,L=r,x=a,D=f[0]-_[0]-l,k=1073741824,P=v?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const O=D+o;O===L||O=d[O+1]?(u=d[O+1]-1,g=u-D-l,u>k&&S.MarkNextChange(),k=u+1,S.AddOriginalElement(u+1,g+1),D=O+1-o):(u=d[O-1],g=u-D-l,u>k&&S.MarkNextChange(),k=u,S.AddModifiedElement(u+1,g+1),D=O-1-o),P>=0&&(d=this.m_reverseHistory[P],o=d[0],L=1,x=d.length-1)}while(--P>=-1);w=S.getChanges()}return this.ConcatenateChanges(y,w)}ComputeRecursionPoint(e,t,i,s,o,r,a){let l=0,c=0,d=0,u=0,h=0,f=0;e--,i--,o[0]=0,r[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const g=t-e+(s-i),p=g+1,_=new Int32Array(p),v=new Int32Array(p),b=s-i,y=t-e,w=e-i,S=t-s,x=(y-b)%2===0;_[b]=e,v[y]=t,a[0]=!1;for(let D=1;D<=g/2+1;D++){let k=0,P=0;d=this.ClipDiagonalBound(b-D,D,b,p),u=this.ClipDiagonalBound(b+D,D,b,p);for(let M=d;M<=u;M+=2){M===d||Mk+P&&(k=l,P=c),!x&&Math.abs(M-y)<=D-1&&l>=v[M])return o[0]=l,r[0]=c,R<=v[M]&&D<=1448?this.WALKTRACE(b,d,u,w,y,h,f,S,_,v,l,t,o,c,s,r,x,a):null}const O=(k-e+(P-i)-D)/2;if(this.ContinueProcessingPredicate!==null&&!this.ContinueProcessingPredicate(k,O))return a[0]=!0,o[0]=k,r[0]=P,O>0&&D<=1448?this.WALKTRACE(b,d,u,w,y,h,f,S,_,v,l,t,o,c,s,r,x,a):(e++,i++,[new Vc(e,t-e+1,i,s-i+1)]);h=this.ClipDiagonalBound(y-D,D,y,p),f=this.ClipDiagonalBound(y+D,D,y,p);for(let M=h;M<=f;M+=2){M===h||M=v[M+1]?l=v[M+1]-1:l=v[M-1],c=l-(M-y)-S;const R=l;for(;l>e&&c>i&&this.ElementsAreEqual(l,c);)l--,c--;if(v[M]=l,x&&Math.abs(M-b)<=D&&l<=_[M])return o[0]=l,r[0]=c,R>=_[M]&&D<=1448?this.WALKTRACE(b,d,u,w,y,h,f,S,_,v,l,t,o,c,s,r,x,a):null}if(D<=1447){let M=new Int32Array(u-d+2);M[0]=b-d+1,mg.Copy2(_,d,M,1,u-d+1),this.m_forwardHistory.push(M),M=new Int32Array(f-h+2),M[0]=y-h+1,mg.Copy2(v,h,M,1,f-h+1),this.m_reverseHistory.push(M)}}return this.WALKTRACE(b,d,u,w,y,h,f,S,_,v,l,t,o,c,s,r,x,a)}PrettifyChanges(e){for(let t=0;t0,a=i.modifiedLength>0;for(;i.originalStart+i.originalLength=0;t--){const i=e[t];let s=0,o=0;if(t>0){const u=e[t-1];s=u.originalStart+u.originalLength,o=u.modifiedStart+u.modifiedLength}const r=i.originalLength>0,a=i.modifiedLength>0;let l=0,c=this._boundaryScore(i.originalStart,i.originalLength,i.modifiedStart,i.modifiedLength);for(let u=1;;u++){const h=i.originalStart-u,f=i.modifiedStart-u;if(hc&&(c=p,l=u)}i.originalStart-=l,i.modifiedStart-=l;const d=[null];if(t>0&&this.ChangesOverlap(e[t-1],e[t],d)){e[t-1]=d[0],e.splice(t,1),t++;continue}}if(this._hasStrings)for(let t=1,i=e.length;t0&&f>l&&(l=f,c=u,d=h)}return l>0?[c,d]:null}_contiguousSequenceScore(e,t,i){let s=0;for(let o=0;o=this._originalElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._originalStringElements[e])}_OriginalRegionIsBoundary(e,t){if(this._OriginalIsBoundary(e)||this._OriginalIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._OriginalIsBoundary(i-1)||this._OriginalIsBoundary(i))return!0}return!1}_ModifiedIsBoundary(e){return e<=0||e>=this._modifiedElementsOrHash.length-1?!0:this._hasStrings&&/^\s*$/.test(this._modifiedStringElements[e])}_ModifiedRegionIsBoundary(e,t){if(this._ModifiedIsBoundary(e)||this._ModifiedIsBoundary(e-1))return!0;if(t>0){const i=e+t;if(this._ModifiedIsBoundary(i-1)||this._ModifiedIsBoundary(i))return!0}return!1}_boundaryScore(e,t,i,s){const o=this._OriginalRegionIsBoundary(e,t)?1:0,r=this._ModifiedRegionIsBoundary(i,s)?1:0;return o+r}ConcatenateChanges(e,t){const i=[];if(e.length===0||t.length===0)return t.length>0?t:e;if(this.ChangesOverlap(e[e.length-1],t[0],i)){const s=new Array(e.length+t.length-1);return mg.Copy(e,0,s,0,e.length-1),s[e.length-1]=i[0],mg.Copy(t,1,s,e.length,t.length-1),s}else{const s=new Array(e.length+t.length);return mg.Copy(e,0,s,0,e.length),mg.Copy(t,0,s,e.length,t.length),s}}ChangesOverlap(e,t,i){if(pg.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),pg.Assert(e.modifiedStart<=t.modifiedStart,"Left change is not less than or equal to right change"),e.originalStart+e.originalLength>=t.originalStart||e.modifiedStart+e.modifiedLength>=t.modifiedStart){const s=e.originalStart;let o=e.originalLength;const r=e.modifiedStart;let a=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(o=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(a=t.modifiedStart+t.modifiedLength-e.modifiedStart),i[0]=new Vc(s,o,r,a),!0}else return i[0]=null,!1}ClipDiagonalBound(e,t,i,s){if(e>=0&&e255?255:n|0}function _g(n){return n<0?0:n>4294967295?4294967295:n|0}class e_e{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}insertValues(e,t){e=_g(e);const i=this.values,s=this.prefixSum,o=t.length;return o===0?!1:(this.values=new Uint32Array(i.length+o),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e),e+o),this.values.set(t,e),e-1=0&&this.prefixSum.set(s.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=_g(e),t=_g(t),this.values[e]===t?!1:(this.values[e]=t,e-1=i.length)return!1;const o=i.length-e;return t>=o&&(t=o),t===0?!1:(this.values=new Uint32Array(i.length-t),this.values.set(i.subarray(0,e),0),this.values.set(i.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1=0&&this.prefixSum.set(s.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return this.values.length===0?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=_g(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;t===0&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(let i=t;i<=e;i++)this.prefixSum[i]=this.prefixSum[i-1]+this.values[i];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let t=0,i=this.values.length-1,s=0,o=0,r=0;for(;t<=i;)if(s=t+(i-t)/2|0,o=this.prefixSum[s],r=o-this.values[s],e=o)t=s+1;else break;return new Dj(s,e-r)}}class t_e{constructor(e){this._values=e,this._isValid=!1,this._validEndIndex=-1,this._prefixSum=[],this._indexBySum=[]}getTotalSum(){return this._ensureValid(),this._indexBySum.length}getPrefixSum(e){return this._ensureValid(),e===0?0:this._prefixSum[e-1]}getIndexOf(e){this._ensureValid();const t=this._indexBySum[e],i=t>0?this._prefixSum[t-1]:0;return new Dj(t,e-i)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=ML(this._values,e,t),this._invalidate(e)}_invalidate(e){this._isValid=!1,this._validEndIndex=Math.min(this._validEndIndex,e-1)}_ensureValid(){if(!this._isValid){for(let e=this._validEndIndex+1,t=this._values.length;e0?this._prefixSum[e-1]:0;this._prefixSum[e]=s+i;for(let o=0;o=0&&e<256?this._asciiMap[e]=i:this._map.set(e,i)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}clear(){this._asciiMap.fill(this._defaultValue),this._map.clear()}}class n_e{constructor(e,t,i){const s=new Uint8Array(e*t);for(let o=0,r=e*t;ot&&(t=l),a>i&&(i=a),c>i&&(i=c)}t++,i++;const s=new n_e(i,t,0);for(let o=0,r=e.length;o=this._maxCharCode?0:this._states.get(e,t)}}let p2=null;function o_e(){return p2===null&&(p2=new s_e([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),p2}let T0=null;function r_e(){if(T0===null){T0=new Z1(0);const n=` <>'"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…`;for(let t=0;ts);if(s>0){const a=t.charCodeAt(s-1),l=t.charCodeAt(r);(a===40&&l===41||a===91&&l===93||a===123&&l===125)&&r--}return{range:{startLineNumber:i,startColumn:s+1,endLineNumber:i,endColumn:r+2},url:t.substring(s,r+1)}}static computeLinks(e,t=o_e()){const i=r_e(),s=[];for(let o=1,r=e.getLineCount();o<=r;o++){const a=e.getLineContent(o),l=a.length;let c=0,d=0,u=0,h=1,f=!1,g=!1,p=!1,_=!1;for(;c=0?(s+=i?1:-1,s<0?s=e.length-1:s%=e.length,e[s]):null}}fT.INSTANCE=new fT;class l_e extends Z1{constructor(e){super(0);for(let t=0,i=e.length;t(e.hasOwnProperty(t)||(e[t]=n(t)),e[t])}const xm=c_e(n=>new l_e(n));var qo;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=4]="Right",n[n.Full=7]="Full"})(qo||(qo={}));var vp;(function(n){n[n.Left=1]="Left",n[n.Right=2]="Right"})(vp||(vp={}));var Zs;(function(n){n[n.Inline=1]="Inline",n[n.Gutter=2]="Gutter"})(Zs||(Zs={}));var Lm;(function(n){n[n.Both=0]="Both",n[n.Right=1]="Right",n[n.Left=2]="Left",n[n.None=3]="None"})(Lm||(Lm={}));class dC{get originalIndentSize(){return this._indentSizeIsTabSize?"tabSize":this.indentSize}constructor(e){this._textModelResolvedOptionsBrand=void 0,this.tabSize=Math.max(1,e.tabSize|0),e.indentSize==="tabSize"?(this.indentSize=this.tabSize,this._indentSizeIsTabSize=!0):(this.indentSize=Math.max(1,e.indentSize|0),this._indentSizeIsTabSize=!1),this.insertSpaces=!!e.insertSpaces,this.defaultEOL=e.defaultEOL|0,this.trimAutoWhitespace=!!e.trimAutoWhitespace,this.bracketPairColorizationOptions=e.bracketPairColorizationOptions}equals(e){return this.tabSize===e.tabSize&&this._indentSizeIsTabSize===e._indentSizeIsTabSize&&this.indentSize===e.indentSize&&this.insertSpaces===e.insertSpaces&&this.defaultEOL===e.defaultEOL&&this.trimAutoWhitespace===e.trimAutoWhitespace&&Co(this.bracketPairColorizationOptions,e.bracketPairColorizationOptions)}createChangeEvent(e){return{tabSize:this.tabSize!==e.tabSize,indentSize:this.indentSize!==e.indentSize,insertSpaces:this.insertSpaces!==e.insertSpaces,trimAutoWhitespace:this.trimAutoWhitespace!==e.trimAutoWhitespace}}}class Kb{constructor(e,t){this._findMatchBrand=void 0,this.range=e,this.matches=t}}function d_e(n){return n&&typeof n.read=="function"}class m2{constructor(e,t,i,s,o,r){this.identifier=e,this.range=t,this.text=i,this.forceMoveMarkers=s,this.isAutoWhitespaceEdit=o,this._isTracked=r}}class u_e{constructor(e,t,i){this.regex=e,this.wordSeparators=t,this.simpleSearch=i}}class h_e{constructor(e,t,i){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=i}}function f_e(n){return!n.isTooLargeForSyncing()&&!n.isForSimpleWidget}const g_e=999;class nh{constructor(e,t,i,s){this.searchString=e,this.isRegex=t,this.matchCase=i,this.wordSeparators=s}parseSearchRequest(){if(this.searchString==="")return null;let e;this.isRegex?e=p_e(this.searchString):e=this.searchString.indexOf(` +`)>=0;let t=null;try{t=EU(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch{return null}if(!t)return null;let i=!this.isRegex&&!e;return i&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(i=this.matchCase),new u_e(t,this.wordSeparators?xm(this.wordSeparators):null,i?this.searchString:null)}}function p_e(n){if(!n||n.length===0)return!1;for(let e=0,t=n.length;e=t)break;const s=n.charCodeAt(e);if(s===110||s===114||s===87)return!0}}return!1}function ch(n,e,t){if(!t)return new Kb(n,null);const i=[];for(let s=0,o=e.length;s>0);t[o]>=e?s=o-1:t[o+1]>=e?(i=o,s=o):i=o+1}return i+1}}class Uy{static findMatches(e,t,i,s,o){const r=t.parseSearchRequest();return r?r.regex.multiline?this._doFindMatchesMultiline(e,i,new Hg(r.wordSeparators,r.regex),s,o):this._doFindMatchesLineByLine(e,i,r,s,o):[]}static _getMultilineMatchRange(e,t,i,s,o,r){let a,l=0;s?(l=s.findLineFeedCountBeforeOffset(o),a=t+o+l):a=t+o;let c;if(s){const f=s.findLineFeedCountBeforeOffset(o+r.length)-l;c=a+r.length+f}else c=a+r.length;const d=e.getPositionAt(a),u=e.getPositionAt(c);return new N(d.lineNumber,d.column,u.lineNumber,u.column)}static _doFindMatchesMultiline(e,t,i,s,o){const r=e.getOffsetAt(t.getStartPosition()),a=e.getValueInRange(t,1),l=e.getEOL()===`\r +`?new I9(a):null,c=[];let d=0,u;for(i.reset(0);u=i.next(a);)if(c[d++]=ch(this._getMultilineMatchRange(e,r,a,l,u.index,u[0]),u,s),d>=o)return c;return c}static _doFindMatchesLineByLine(e,t,i,s,o){const r=[];let a=0;if(t.startLineNumber===t.endLineNumber){const c=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return a=this._findMatchesInLine(i,c,t.startLineNumber,t.startColumn-1,a,r,s,o),r}const l=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);a=this._findMatchesInLine(i,l,t.startLineNumber,t.startColumn-1,a,r,s,o);for(let c=t.startLineNumber+1;c=l))return o;return o}const d=new Hg(e.wordSeparators,e.regex);let u;d.reset(0);do if(u=d.next(t),u&&(r[o++]=ch(new N(i,u.index+1+s,i,u.index+1+u[0].length+s),u,a),o>=l))return o;while(u);return o}static findNextMatch(e,t,i,s){const o=t.parseSearchRequest();if(!o)return null;const r=new Hg(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindNextMatchMultiline(e,i,r,s):this._doFindNextMatchLineByLine(e,i,r,s)}static _doFindNextMatchMultiline(e,t,i,s){const o=new V(t.lineNumber,1),r=e.getOffsetAt(o),a=e.getLineCount(),l=e.getValueInRange(new N(o.lineNumber,o.column,a,e.getLineMaxColumn(a)),1),c=e.getEOL()===`\r +`?new I9(l):null;i.reset(t.column-1);const d=i.next(l);return d?ch(this._getMultilineMatchRange(e,r,l,c,d.index,d[0]),d,s):t.lineNumber!==1||t.column!==1?this._doFindNextMatchMultiline(e,new V(1,1),i,s):null}static _doFindNextMatchLineByLine(e,t,i,s){const o=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r),l=this._findFirstMatchInLine(i,a,r,t.column,s);if(l)return l;for(let c=1;c<=o;c++){const d=(r+c-1)%o,u=e.getLineContent(d+1),h=this._findFirstMatchInLine(i,u,d+1,1,s);if(h)return h}return null}static _findFirstMatchInLine(e,t,i,s,o){e.reset(s-1);const r=e.next(t);return r?ch(new N(i,r.index+1,i,r.index+1+r[0].length),r,o):null}static findPreviousMatch(e,t,i,s){const o=t.parseSearchRequest();if(!o)return null;const r=new Hg(o.wordSeparators,o.regex);return o.regex.multiline?this._doFindPreviousMatchMultiline(e,i,r,s):this._doFindPreviousMatchLineByLine(e,i,r,s)}static _doFindPreviousMatchMultiline(e,t,i,s){const o=this._doFindMatchesMultiline(e,new N(1,1,t.lineNumber,t.column),i,s,10*g_e);if(o.length>0)return o[o.length-1];const r=e.getLineCount();return t.lineNumber!==r||t.column!==e.getLineMaxColumn(r)?this._doFindPreviousMatchMultiline(e,new V(r,e.getLineMaxColumn(r)),i,s):null}static _doFindPreviousMatchLineByLine(e,t,i,s){const o=e.getLineCount(),r=t.lineNumber,a=e.getLineContent(r).substring(0,t.column-1),l=this._findLastMatchInLine(i,a,r,s);if(l)return l;for(let c=1;c<=o;c++){const d=(o+r-c-1)%o,u=e.getLineContent(d+1),h=this._findLastMatchInLine(i,u,d+1,s);if(h)return h}return null}static _findLastMatchInLine(e,t,i,s){let o=null,r;for(e.reset(0);r=e.next(t);)o=ch(new N(i,r.index+1,i,r.index+1+r[0].length),r,s);return o}}function m_e(n,e,t,i,s){if(i===0)return!0;const o=e.charCodeAt(i-1);if(n.get(o)!==0||o===13||o===10)return!0;if(s>0){const r=e.charCodeAt(i);if(n.get(r)!==0)return!0}return!1}function __e(n,e,t,i,s){if(i+s===t)return!0;const o=e.charCodeAt(i+s);if(n.get(o)!==0||o===13||o===10)return!0;if(s>0){const r=e.charCodeAt(i+s-1);if(n.get(r)!==0)return!0}return!1}function t3(n,e,t,i,s){return m_e(n,e,t,i,s)&&__e(n,e,t,i,s)}class Hg{constructor(e,t){this._wordSeparators=e,this._searchRegex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(e){const t=e.length;let i;do{if(this._prevMatchStartIndex+this._prevMatchLength===t||(i=this._searchRegex.exec(e),!i))return null;const s=i.index,o=i[0].length;if(s===this._prevMatchStartIndex&&o===this._prevMatchLength){if(o===0){CS(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=s,this._prevMatchLength=o,!this._wordSeparators||t3(this._wordSeparators,e,t,s,o))return i}while(i);return null}}class b_e{static computeUnicodeHighlights(e,t,i){const s=i?i.startLineNumber:1,o=i?i.endLineNumber:e.getLineCount(),r=new T9(t),a=r.getCandidateCodePoints();let l;a==="allNonBasicAscii"?l=new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):l=new RegExp(`${v_e(Array.from(a))}`,"g");const c=new Hg(null,l),d=[];let u=!1,h,f=0,g=0,p=0;e:for(let _=s,v=o;_<=v;_++){const b=e.getLineContent(_),y=b.length;c.reset(0);do if(h=c.next(b),h){let w=h.index,S=h.index+h[0].length;if(w>0){const k=b.charCodeAt(w-1);tn(k)&&w--}if(S+1=1e3){u=!0;break e}d.push(new N(_,w+1,_,S+1))}}while(h)}return{ranges:d,hasMore:u,ambiguousCharacterCount:f,invisibleCharacterCount:g,nonBasicAsciiCharacterCount:p}}static computeUnicodeHighlightReason(e,t){const i=new T9(t);switch(i.shouldHighlightNonBasicASCII(e,null)){case 0:return null;case 2:return{kind:1};case 3:{const o=e.codePointAt(0),r=i.ambiguousCharacters.getPrimaryConfusable(o),a=yf.getLocales().filter(l=>!yf.getInstance(new Set([...t.allowedLocales,l])).isAmbiguous(o));return{kind:0,confusableWith:String.fromCodePoint(r),notAmbiguousInLocales:a}}case 1:return{kind:2}}}}function v_e(n,e){return`[${Sr(n.map(i=>String.fromCodePoint(i)).join(""))}]`}class T9{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=yf.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of Ad.codePoints)N9(String.fromCodePoint(t))||e.add(t);if(this.options.ambiguousCharacters)for(const t of this.ambiguousCharacters.getConfusableCodePoints())e.add(t);for(const t of this.allowedCodePoints)e.delete(t);return e}shouldHighlightNonBasicASCII(e,t){const i=e.codePointAt(0);if(this.allowedCodePoints.has(i))return 0;if(this.options.nonBasicASCII)return 1;let s=!1,o=!1;if(t)for(const r of t){const a=r.codePointAt(0),l=V4(r);s=s||l,!l&&!this.ambiguousCharacters.isAmbiguous(a)&&!Ad.isInvisibleCharacter(a)&&(o=!0)}return!s&&o?0:this.options.invisibleCharacters&&!N9(e)&&Ad.isInvisibleCharacter(i)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(i)?3:0}}function N9(n){return n===" "||n===` +`||n===" "}class uC{constructor(e,t,i){this.changes=e,this.moves=t,this.hitTimeout=i}}class kj{constructor(e,t){this.lineRangeMapping=e,this.changes=t}}class Ke{static addRange(e,t){let i=0;for(;it))return new Ke(e,t)}static ofLength(e){return new Ke(0,e)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new qi(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new Ke(this.start+e,this.endExclusive+e)}deltaStart(e){return new Ke(this.start+e,this.endExclusive)}deltaEnd(e){return new Ke(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}containsRange(e){return this.start<=e.start&&e.endExclusive<=this.endExclusive}contains(e){return this.start<=e&&e=this.endExclusive?this.start+(e-this.start)%this.length:e}forEach(e){for(let t=this.start;te.toString()).join(", ")}intersectsStrict(e){let t=0;for(;te+t.length,0)}}function gT(n,e,t){const i=y_e(n,e);if(i!==-1)return n[i]}function y_e(n,e,t=n.length-1){for(let i=t;i>=0;i--){const s=n[i];if(e(s))return i}return-1}function Yb(n,e){const t=Zb(n,e);return t===-1?void 0:n[t]}function Zb(n,e,t=0,i=n.length){let s=t,o=i;for(;s0&&(t=s)}return t}function S_e(n,e){if(n.length===0)return;let t=n[0];for(let i=1;i=0&&(t=s)}return t}function x_e(n,e){return C_e(n,(t,i)=>-e(t,i))}function L_e(n,e){if(n.length===0)return-1;let t=0;for(let i=1;i0&&(t=i)}return t}let Xe=class zc{static fromRange(e){return new zc(e.startLineNumber,e.endLineNumber)}static joinMany(e){if(e.length===0)return[];let t=new Aa(e[0].slice());for(let i=1;it)throw new qi(`startLineNumber ${e} cannot be after endLineNumberExclusive ${t}`);this.startLineNumber=e,this.endLineNumberExclusive=t}contains(e){return this.startLineNumber<=e&&es.endLineNumberExclusive>=e.startLineNumber),i=Zb(this._normalizedRanges,s=>s.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)this._normalizedRanges.splice(t,0,e);else if(t===i-1){const s=this._normalizedRanges[t];this._normalizedRanges[t]=s.join(e)}else{const s=this._normalizedRanges[t].join(this._normalizedRanges[i-1]).join(e);this._normalizedRanges.splice(t,i-t,s)}}contains(e){const t=Yb(this._normalizedRanges,i=>i.startLineNumber<=e);return!!t&&t.endLineNumberExclusive>e}getUnion(e){if(this._normalizedRanges.length===0)return e;if(e._normalizedRanges.length===0)return this;const t=[];let i=0,s=0,o=null;for(;i=r.startLineNumber?o=new Xe(o.startLineNumber,Math.max(o.endLineNumberExclusive,r.endLineNumberExclusive)):(t.push(o),o=r)}return o!==null&&t.push(o),new Aa(t)}subtractFrom(e){const t=Xb(this._normalizedRanges,r=>r.endLineNumberExclusive>=e.startLineNumber),i=Zb(this._normalizedRanges,r=>r.startLineNumber<=e.endLineNumberExclusive)+1;if(t===i)return new Aa([e]);const s=[];let o=e.startLineNumber;for(let r=t;ro&&s.push(new Xe(o,a.startLineNumber)),o=a.endLineNumberExclusive}return oe.toString()).join(", ")}getIntersection(e){const t=[];let i=0,s=0;for(;it.delta(e)))}}class nl{static inverse(e,t,i){const s=[];let o=1,r=1;for(const l of e){const c=new Go(new Xe(o,l.original.startLineNumber),new Xe(r,l.modified.startLineNumber),void 0);c.modified.isEmpty||s.push(c),o=l.original.endLineNumberExclusive,r=l.modified.endLineNumberExclusive}const a=new Go(new Xe(o,t+1),new Xe(r,i+1),void 0);return a.modified.isEmpty||s.push(a),s}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new nl(this.modified,this.original)}join(e){return new nl(this.original.join(e.original),this.modified.join(e.modified))}}class Go extends nl{constructor(e,t,i){super(e,t),this.innerChanges=i}flip(){var e;return new Go(this.modified,this.original,(e=this.innerChanges)===null||e===void 0?void 0:e.map(t=>t.flip()))}}class ou{constructor(e,t){this.originalRange=e,this.modifiedRange=t}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}flip(){return new ou(this.modifiedRange,this.originalRange)}}const D_e=3;class k_e{computeDiff(e,t,i){var s;const r=new I_e(e,t,{maxComputationTime:i.maxComputationTimeMs,shouldIgnoreTrimWhitespace:i.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),a=[];let l=null;for(const c of r.changes){let d;c.originalEndLineNumber===0?d=new Xe(c.originalStartLineNumber+1,c.originalStartLineNumber+1):d=new Xe(c.originalStartLineNumber,c.originalEndLineNumber+1);let u;c.modifiedEndLineNumber===0?u=new Xe(c.modifiedStartLineNumber+1,c.modifiedStartLineNumber+1):u=new Xe(c.modifiedStartLineNumber,c.modifiedEndLineNumber+1);let h=new Go(d,u,(s=c.charChanges)===null||s===void 0?void 0:s.map(f=>new ou(new N(f.originalStartLineNumber,f.originalStartColumn,f.originalEndLineNumber,f.originalEndColumn),new N(f.modifiedStartLineNumber,f.modifiedStartColumn,f.modifiedEndLineNumber,f.modifiedEndColumn))));l&&(l.modified.endLineNumberExclusive===h.modified.startLineNumber||l.original.endLineNumberExclusive===h.original.startLineNumber)&&(h=new Go(l.original.join(h.original),l.modified.join(h.modified),l.innerChanges&&h.innerChanges?l.innerChanges.concat(h.innerChanges):void 0),a.pop()),a.push(h),l=h}return Ub(()=>WU(a,(c,d)=>d.original.startLineNumber-c.original.endLineNumberExclusive===d.modified.startLineNumber-c.modified.endLineNumberExclusive&&c.original.endLineNumberExclusive(e===10?"\\n":String.fromCharCode(e))+`-(${this._lineNumbers[t]},${this._columns[t]})`).join(", ")+"]"}_assertIndex(e,t){if(e<0||e>=t.length)throw new Error("Illegal index")}getElements(){return this._charCodes}getStartLineNumber(e){return e>0&&e===this._lineNumbers.length?this.getEndLineNumber(e-1):(this._assertIndex(e,this._lineNumbers),this._lineNumbers[e])}getEndLineNumber(e){return e===-1?this.getStartLineNumber(e+1):(this._assertIndex(e,this._lineNumbers),this._charCodes[e]===10?this._lineNumbers[e]+1:this._lineNumbers[e])}getStartColumn(e){return e>0&&e===this._columns.length?this.getEndColumn(e-1):(this._assertIndex(e,this._columns),this._columns[e])}getEndColumn(e){return e===-1?this.getStartColumn(e+1):(this._assertIndex(e,this._columns),this._charCodes[e]===10?1:this._columns[e]+1)}}class yp{constructor(e,t,i,s,o,r,a,l){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=i,this.originalEndColumn=s,this.modifiedStartLineNumber=o,this.modifiedStartColumn=r,this.modifiedEndLineNumber=a,this.modifiedEndColumn=l}static createFromDiffChange(e,t,i){const s=t.getStartLineNumber(e.originalStart),o=t.getStartColumn(e.originalStart),r=t.getEndLineNumber(e.originalStart+e.originalLength-1),a=t.getEndColumn(e.originalStart+e.originalLength-1),l=i.getStartLineNumber(e.modifiedStart),c=i.getStartColumn(e.modifiedStart),d=i.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),u=i.getEndColumn(e.modifiedStart+e.modifiedLength-1);return new yp(s,o,r,a,l,c,d,u)}}function A_e(n){if(n.length<=1)return n;const e=[n[0]];let t=e[0];for(let i=1,s=n.length;i0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&o()){const f=i.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),g=s.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);if(f.getElements().length>0&&g.getElements().length>0){let p=Ej(f,g,o,!0).changes;a&&(p=A_e(p)),h=[];for(let _=0,v=p.length;_1&&p>1;){const _=h.charCodeAt(g-2),v=f.charCodeAt(p-2);if(_!==v)break;g--,p--}(g>1||p>1)&&this._pushTrimWhitespaceCharChange(s,o+1,1,g,r+1,1,p)}{let g=mT(h,1),p=mT(f,1);const _=h.length+1,v=f.length+1;for(;g<_&&p!0;const e=Date.now();return()=>Date.now()-e{i.push(un.fromOffsetPairs(s?s.getEndExclusives():Ba.zero,o?o.getStarts():new Ba(t,(s?s.seq2Range.endExclusive-s.seq1Range.endExclusive:0)+t)))}),i}static fromOffsetPairs(e,t){return new un(new Ke(e.offset1,t.offset1),new Ke(e.offset2,t.offset2))}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new un(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new un(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return e===0?this:new un(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return e===0?this:new un(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return e===0?this:new un(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersect(e){const t=this.seq1Range.intersect(e.seq1Range),i=this.seq2Range.intersect(e.seq2Range);if(!(!t||!i))return new un(t,i)}getStarts(){return new Ba(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new Ba(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}class Ba{constructor(e,t){this.offset1=e,this.offset2=t}toString(){return`${this.offset1} <-> ${this.offset2}`}}Ba.zero=new Ba(0,0);Ba.max=new Ba(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);class Qb{isValid(){return!0}}Qb.instance=new Qb;class T_e{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new qi("timeout must be positive")}isValid(){if(!(Date.now()-this.startTime0&&p>0&&r.get(g-1,p-1)===3&&(b+=a.get(g-1,p-1)),b+=s?s(g,p):1):b=-1;const y=Math.max(_,v,b);if(y===b){const w=g>0&&p>0?a.get(g-1,p-1):0;a.set(g,p,w+1),r.set(g,p,3)}else y===_?(a.set(g,p,0),r.set(g,p,1)):y===v&&(a.set(g,p,0),r.set(g,p,2));o.set(g,p,y)}const l=[];let c=e.length,d=t.length;function u(g,p){(g+1!==c||p+1!==d)&&l.push(new un(new Ke(g+1,c),new Ke(p+1,d))),c=g,d=p}let h=e.length-1,f=t.length-1;for(;h>=0&&f>=0;)r.get(h,f)===3?(u(h,f),h--,f--):r.get(h,f)===1?h--:f--;return u(-1,-1),l.reverse(),new ac(l,!1)}}class Aj{compute(e,t,i=Qb.instance){if(e.length===0||t.length===0)return ac.trivial(e,t);const s=e,o=t;function r(p,_){for(;ps.length||w>o.length)continue;const S=r(y,w);l.set(d,S);const L=y===v?c.get(d+1):c.get(d-1);if(c.set(d,S!==y?new P9(L,y,w,S-y):L),l.get(d)===s.length&&l.get(d)-d===o.length)break e}}let u=c.get(d);const h=[];let f=s.length,g=o.length;for(;;){const p=u?u.x+u.length:0,_=u?u.y+u.length:0;if((p!==f||_!==g)&&h.push(new un(new Ke(p,f),new Ke(_,g))),!u)break;f=u.x,g=u.y,u=u.prev}return h.reverse(),new ac(h,!1)}}class P9{constructor(e,t,i,s){this.prev=e,this.x=t,this.y=i,this.length=s}}class R_e{constructor(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){if(e<0){if(e=-e-1,e>=this.negativeArr.length){const i=this.negativeArr;this.negativeArr=new Int32Array(i.length*2),this.negativeArr.set(i)}this.negativeArr[e]=t}else{if(e>=this.positiveArr.length){const i=this.positiveArr;this.positiveArr=new Int32Array(i.length*2),this.positiveArr.set(i)}this.positiveArr[e]=t}}}class M_e{constructor(){this.positiveArr=[],this.negativeArr=[]}get(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]}set(e,t){e<0?(e=-e-1,this.negativeArr[e]=t):this.positiveArr[e]=t}}var O9,F9;class P_e{constructor(e,t){this.uri=e,this.value=t}}function O_e(n){return Array.isArray(n)}class An{constructor(e,t){if(this[O9]="ResourceMap",e instanceof An)this.map=new Map(e.map),this.toKey=t??An.defaultToKey;else if(O_e(e)){this.map=new Map,this.toKey=t??An.defaultToKey;for(const[i,s]of e)this.set(i,s)}else this.map=new Map,this.toKey=e??An.defaultToKey}set(e,t){return this.map.set(this.toKey(e),new P_e(e,t)),this}get(e){var t;return(t=this.map.get(this.toKey(e)))===null||t===void 0?void 0:t.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,t){typeof t<"u"&&(e=e.bind(t));for(const[i,s]of this.map)e(s.value,s.uri,this)}*values(){for(const e of this.map.values())yield e.value}*keys(){for(const e of this.map.values())yield e.uri}*entries(){for(const e of this.map.values())yield[e.uri,e.value]}*[(O9=Symbol.toStringTag,Symbol.iterator)](){for(const[,e]of this.map)yield[e.uri,e.value]}}An.defaultToKey=n=>n.toString();class F_e{constructor(){this[F9]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var e;return(e=this._head)===null||e===void 0?void 0:e.value}get last(){var e;return(e=this._tail)===null||e===void 0?void 0:e.value}has(e){return this._map.has(e)}get(e,t=0){const i=this._map.get(e);if(i)return t!==0&&this.touch(i,t),i.value}set(e,t,i=0){let s=this._map.get(e);if(s)s.value=t,i!==0&&this.touch(s,i);else{switch(s={key:e,value:t,next:void 0,previous:void 0},i){case 0:this.addItemLast(s);break;case 1:this.addItemFirst(s);break;case 2:this.addItemLast(s);break;default:this.addItemLast(s);break}this._map.set(e,s),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){const i=this._state;let s=this._head;for(;s;){if(t?e.bind(t)(s.value,s.key,this):e(s.value,s.key,this),this._state!==i)throw new Error("LinkedMap got modified during iteration.");s=s.next}}keys(){const e=this,t=this._state;let i=this._head;const s={[Symbol.iterator](){return s},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const o={value:i.key,done:!1};return i=i.next,o}else return{value:void 0,done:!0}}};return s}values(){const e=this,t=this._state;let i=this._head;const s={[Symbol.iterator](){return s},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const o={value:i.value,done:!1};return i=i.next,o}else return{value:void 0,done:!0}}};return s}entries(){const e=this,t=this._state;let i=this._head;const s={[Symbol.iterator](){return s},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const o={value:[i.key,i.value],done:!1};return i=i.next,o}else return{value:void 0,done:!0}}};return s}[(F9=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,i=this.size;for(;t&&i>e;)this._map.delete(t.key),t=t.next,i--;this._head=t,this._size=i,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const t=e.next,i=e.previous;if(!t||!i)throw new Error("Invalid list");t.previous=i,i.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(t!==1&&t!==2)){if(t===1){if(e===this._head)return;const i=e.next,s=e.previous;e===this._tail?(s.next=void 0,this._tail=s):(i.previous=s,s.next=i),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===2){if(e===this._tail)return;const i=e.next,s=e.previous;e===this._head?(i.previous=void 0,this._head=i):(i.previous=s,s.next=i),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){const e=[];return this.forEach((t,i)=>{e.push([i,t])}),e}fromJSON(e){this.clear();for(const[t,i]of e)this.set(t,i)}}class n3 extends F_e{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get(e,t=2){return super.get(e,t)}peek(e){return super.get(e,0)}set(e,t){return super.set(e,t,2),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}class B_e{constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(const[t,i]of e)this.set(t,i)}clear(){this._m1.clear(),this._m2.clear()}set(e,t){this._m1.set(e,t),this._m2.set(t,e)}get(e){return this._m1.get(e)}getKey(e){return this._m2.get(e)}delete(e){const t=this._m1.get(e);return t===void 0?!1:(this._m1.delete(e),this._m2.delete(t),!0)}keys(){return this._m1.keys()}values(){return this._m1.values()}}class Ij{constructor(){this.map=new Map}add(e,t){let i=this.map.get(e);i||(i=new Set,this.map.set(e,i)),i.add(t)}delete(e,t){const i=this.map.get(e);i&&(i.delete(t),i.size===0&&this.map.delete(e))}forEach(e,t){const i=this.map.get(e);i&&i.forEach(t)}get(e){const t=this.map.get(e);return t||new Set}}class NS{constructor(e,t,i){this.lines=e,this.considerWhitespaceChanges=i,this.elements=[],this.firstCharOffsetByLine=[],this.additionalOffsetByLine=[];let s=!1;t.start>0&&t.endExclusive>=e.length&&(t=new Ke(t.start-1,t.endExclusive),s=!0),this.lineRange=t,this.firstCharOffsetByLine[0]=0;for(let o=this.lineRange.start;oString.fromCharCode(t)).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const t=W9(e>0?this.elements[e-1]:-1),i=W9(ei<=e);return new V(this.lineRange.start+t+1,e-this.firstCharOffsetByLine[t]+this.additionalOffsetByLine[t]+1)}translateRange(e){return N.fromPositions(this.translateOffset(e.start),this.translateOffset(e.endExclusive))}findWordContaining(e){if(e<0||e>=this.elements.length||!b2(this.elements[e]))return;let t=e;for(;t>0&&b2(this.elements[t-1]);)t--;let i=e;for(;ir<=e.start))!==null&&t!==void 0?t:0,o=(i=w_e(this.firstCharOffsetByLine,r=>e.endExclusive<=r))!==null&&i!==void 0?i:this.elements.length;return new Ke(s,o)}}function b2(n){return n>=97&&n<=122||n>=65&&n<=90||n>=48&&n<=57}const W_e={0:0,1:0,2:0,3:10,4:2,5:3,6:10,7:10};function B9(n){return W_e[n]}function W9(n){return n===10?7:n===13?6:_T(n)?5:n>=97&&n<=122?0:n>=65&&n<=90?1:n>=48&&n<=57?2:n===-1?3:4}function V_e(n,e,t,i,s,o){let{moves:r,excludedChanges:a}=z_e(n,e,t,o);if(!o.isValid())return[];const l=n.filter(d=>!a.has(d)),c=H_e(l,i,s,e,t,o);return JA(r,c),r=$_e(r),r=r.filter(d=>d.original.toOffsetRange().slice(e).map(h=>h.trim()).join(` +`).length>=10),r=U_e(n,r),r}function z_e(n,e,t,i){const s=[],o=n.filter(l=>l.modified.isEmpty&&l.original.length>=3).map(l=>new Dm(l.original,e,l)),r=new Set(n.filter(l=>l.original.isEmpty&&l.modified.length>=3).map(l=>new Dm(l.modified,t,l))),a=new Set;for(const l of o){let c=-1,d;for(const u of r){const h=l.computeSimilarity(u);h>c&&(c=h,d=u)}if(c>.9&&d&&(r.delete(d),s.push(new nl(l.range,d.range)),a.add(l.source),a.add(d.source)),!i.isValid())return{moves:s,excludedChanges:a}}return{moves:s,excludedChanges:a}}function H_e(n,e,t,i,s,o){const r=[],a=new Ij;for(const h of n)for(let f=h.original.startLineNumber;fh.modified.startLineNumber,Dd));for(const h of n){let f=[];for(let g=h.modified.startLineNumber;g{for(const w of f)if(w.originalLineRange.endLineNumberExclusive+1===b.endLineNumberExclusive&&w.modifiedLineRange.endLineNumberExclusive+1===_.endLineNumberExclusive){w.originalLineRange=new Xe(w.originalLineRange.startLineNumber,b.endLineNumberExclusive),w.modifiedLineRange=new Xe(w.modifiedLineRange.startLineNumber,_.endLineNumberExclusive),v.push(w);return}const y={modifiedLineRange:_,originalLineRange:b};l.push(y),v.push(y)}),f=v}if(!o.isValid())return[]}l.sort(eU(pr(h=>h.modifiedLineRange.length,Dd)));const c=new Aa,d=new Aa;for(const h of l){const f=h.modifiedLineRange.startLineNumber-h.originalLineRange.startLineNumber,g=c.subtractFrom(h.modifiedLineRange),p=d.subtractFrom(h.originalLineRange).getWithDelta(f),_=g.getIntersection(p);for(const v of _.ranges){if(v.length<3)continue;const b=v,y=v.delta(-f);r.push(new nl(y,b)),c.addRange(b),d.addRange(y)}}r.sort(pr(h=>h.original.startLineNumber,Dd));const u=new X1(n);for(let h=0;hL.original.startLineNumber<=f.original.startLineNumber),p=Yb(n,L=>L.modified.startLineNumber<=f.modified.startLineNumber),_=Math.max(f.original.startLineNumber-g.original.startLineNumber,f.modified.startLineNumber-p.modified.startLineNumber),v=u.findLastMonotonous(L=>L.original.startLineNumberL.modified.startLineNumberi.length||x>s.length||c.contains(x)||d.contains(L)||!V9(i[L-1],s[x-1],o))break}w>0&&(d.addRange(new Xe(f.original.startLineNumber-w,f.original.startLineNumber)),c.addRange(new Xe(f.modified.startLineNumber-w,f.modified.startLineNumber)));let S;for(S=0;Si.length||x>s.length||c.contains(x)||d.contains(L)||!V9(i[L-1],s[x-1],o))break}S>0&&(d.addRange(new Xe(f.original.endLineNumberExclusive,f.original.endLineNumberExclusive+S)),c.addRange(new Xe(f.modified.endLineNumberExclusive,f.modified.endLineNumberExclusive+S))),(w>0||S>0)&&(r[h]=new nl(new Xe(f.original.startLineNumber-w,f.original.endLineNumberExclusive+S),new Xe(f.modified.startLineNumber-w,f.modified.endLineNumberExclusive+S)))}return r}function V9(n,e,t){if(n.trim()===e.trim())return!0;if(n.length>300&&e.length>300)return!1;const s=new Aj().compute(new NS([n],new Ke(0,1),!1),new NS([e],new Ke(0,1),!1),t);let o=0;const r=un.invert(s.diffs,n.length);for(const d of r)d.seq1Range.forEach(u=>{_T(n.charCodeAt(u))||o++});function a(d){let u=0;for(let h=0;he.length?n:e);return o/l>.6&&l>10}function $_e(n){if(n.length===0)return n;n.sort(pr(t=>t.original.startLineNumber,Dd));const e=[n[0]];for(let t=1;t=0&&r>=0&&o+r<=2){e[e.length-1]=i.join(s);continue}e.push(s)}return e}function U_e(n,e){const t=new X1(n);return e=e.filter(i=>{const s=t.findLastMonotonous(a=>a.original.endLineNumberExclusivea.modified.endLineNumberExclusive0&&(a=a.delta(c))}s.push(a)}return i.length>0&&s.push(i[i.length-1]),s}function q_e(n,e,t){if(!n.getBoundaryScore||!e.getBoundaryScore)return t;for(let i=0;i0?t[i-1]:void 0,o=t[i],r=i+1=i.start&&n.seq2Range.start-r>=s.start&&t.isStronglyEqual(n.seq2Range.start-r,n.seq2Range.endExclusive-r)&&r<100;)r++;r--;let a=0;for(;n.seq1Range.start+ac&&(c=g,l=d)}return n.delta(l)}function G_e(n,e,t){const i=[];for(const s of t){const o=i[i.length-1];if(!o){i.push(s);continue}s.seq1Range.start-o.seq1Range.endExclusive<=2||s.seq2Range.start-o.seq2Range.endExclusive<=2?i[i.length-1]=new un(o.seq1Range.join(s.seq1Range),o.seq2Range.join(s.seq2Range)):i.push(s)}return i}function K_e(n,e,t){const i=[];let s;function o(){if(!s)return;const a=s.s1Range.length-s.deleted;s.s2Range.length-s.added,Math.max(s.deleted,s.added)+(s.count-1)>a&&i.push(new un(s.s1Range,s.s2Range)),s=void 0}for(const a of t){let l=function(f,g){var p,_,v,b;if(!s||!s.s1Range.containsRange(f)||!s.s2Range.containsRange(g))if(s&&!(s.s1Range.endExclusive0||e.length>0;){const i=n[0],s=e[0];let o;i&&(!s||i.seq1Range.start0&&t[t.length-1].seq1Range.endExclusive>=o.seq1Range.start?t[t.length-1]=t[t.length-1].join(o):t.push(o)}return t}function Z_e(n,e,t){let i=t;if(i.length===0)return i;let s=0,o;do{o=!1;const r=[i[0]];for(let a=1;a5||f.seq1Range.length+f.seq2Range.length>5)};const l=i[a],c=r[r.length-1];d(c,l)?(o=!0,r[r.length-1]=r[r.length-1].join(l)):r.push(l)}i=r}while(s++<10&&o);return i}function X_e(n,e,t){let i=t;if(i.length===0)return i;let s=0,o;do{o=!1;const a=[i[0]];for(let l=1;l5||p.length>500)return!1;const v=n.getText(p).trim();if(v.length>20||v.split(/\r\n|\r|\n/).length>1)return!1;const b=n.countLinesIn(f.seq1Range),y=f.seq1Range.length,w=e.countLinesIn(f.seq2Range),S=f.seq2Range.length,L=n.countLinesIn(g.seq1Range),x=g.seq1Range.length,D=e.countLinesIn(g.seq2Range),k=g.seq2Range.length,P=2*40+50;function O(M){return Math.min(M,P)}return Math.pow(Math.pow(O(b*40+y),1.5)+Math.pow(O(w*40+S),1.5),1.5)+Math.pow(Math.pow(O(L*40+x),1.5)+Math.pow(O(D*40+k),1.5),1.5)>Math.pow(Math.pow(P,1.5),1.5)*1.3};const c=i[l],d=a[a.length-1];u(d,c)?(o=!0,a[a.length-1]=a[a.length-1].join(c)):a.push(c)}i=a}while(s++<10&&o);const r=[];return tfe(i,(a,l,c)=>{let d=l;function u(v){return v.length>0&&v.trim().length<=3&&l.seq1Range.length+l.seq2Range.length>100}const h=n.extendToFullLines(l.seq1Range),f=n.getText(new Ke(h.start,l.seq1Range.start));u(f)&&(d=d.deltaStart(-f.length));const g=n.getText(new Ke(l.seq1Range.endExclusive,h.endExclusive));u(g)&&(d=d.deltaEnd(g.length));const p=un.fromOffsetPairs(a?a.getEndExclusives():Ba.zero,c?c.getStarts():Ba.max),_=d.intersect(p);r.push(_)}),r}class H9{constructor(e,t){this.trimmedHash=e,this.lines=t}getElement(e){return this.trimmedHash[e]}get length(){return this.trimmedHash.length}getBoundaryScore(e){const t=e===0?0:$9(this.lines[e-1]),i=e===this.lines.length?0:$9(this.lines[e]);return 1e3-(t+i)}getText(e){return this.lines.slice(e.start,e.endExclusive).join(` +`)}isStronglyEqual(e,t){return this.lines[e]===this.lines[t]}}function $9(n){let e=0;for(;eS===L))return new uC([],[],!1);if(e.length===1&&e[0].length===0||t.length===1&&t[0].length===0)return new uC([new Go(new Xe(1,e.length+1),new Xe(1,t.length+1),[new ou(new N(1,1,e.length,e[0].length+1),new N(1,1,t.length,t[0].length+1))])],[],!1);const s=i.maxComputationTimeMs===0?Qb.instance:new T_e(i.maxComputationTimeMs),o=!i.ignoreTrimWhitespace,r=new Map;function a(S){let L=r.get(S);return L===void 0&&(L=r.size,r.set(S,L)),L}const l=e.map(S=>a(S.trim())),c=t.map(S=>a(S.trim())),d=new H9(l,e),u=new H9(c,t),h=d.length+u.length<1700?this.dynamicProgrammingDiffing.compute(d,u,s,(S,L)=>e[S]===t[L]?t[L].length===0?.1:1+Math.log(1+t[L].length):.99):this.myersDiffingAlgorithm.compute(d,u);let f=h.diffs,g=h.hitTimeout;f=bT(d,u,f),f=Z_e(d,u,f);const p=[],_=S=>{if(o)for(let L=0;LS.seq1Range.start-v===S.seq2Range.start-b);const L=S.seq1Range.start-v;_(L),v=S.seq1Range.endExclusive,b=S.seq2Range.endExclusive;const x=this.refineDiff(e,t,S,s,o);x.hitTimeout&&(g=!0);for(const D of x.mappings)p.push(D)}_(e.length-v);const y=U9(p,e,t);let w=[];return i.computeMoves&&(w=this.computeMoves(y,e,t,l,c,s,o)),Ub(()=>{function S(x,D){if(x.lineNumber<1||x.lineNumber>D.length)return!1;const k=D[x.lineNumber-1];return!(x.column<1||x.column>k.length+1)}function L(x,D){return!(x.startLineNumber<1||x.startLineNumber>D.length+1||x.endLineNumberExclusive<1||x.endLineNumberExclusive>D.length+1)}for(const x of y){if(!x.innerChanges)return!1;for(const D of x.innerChanges)if(!(S(D.modifiedRange.getStartPosition(),t)&&S(D.modifiedRange.getEndPosition(),t)&&S(D.originalRange.getStartPosition(),e)&&S(D.originalRange.getEndPosition(),e)))return!1;if(!L(x.modified,t)||!L(x.original,e))return!1}return!0}),new uC(y,w,g)}computeMoves(e,t,i,s,o,r,a){return V_e(e,t,i,s,o,r).map(d=>{const u=this.refineDiff(t,i,new un(d.original.toOffsetRange(),d.modified.toOffsetRange()),r,a),h=U9(u.mappings,t,i,!0);return new kj(d,h)})}refineDiff(e,t,i,s,o){const r=new NS(e,i.seq1Range,o),a=new NS(t,i.seq2Range,o),l=r.length+a.length<500?this.dynamicProgrammingDiffing.compute(r,a,s):this.myersDiffingAlgorithm.compute(r,a,s);let c=l.diffs;return c=bT(r,a,c),c=K_e(r,a,c),c=G_e(r,a,c),c=X_e(r,a,c),{mappings:c.map(u=>new ou(r.translateRange(u.seq1Range),a.translateRange(u.seq2Range))),hitTimeout:l.hitTimeout}}}function U9(n,e,t,i=!1){const s=[];for(const o of Y$(n.map(r=>Q_e(r,e,t)),(r,a)=>r.original.overlapOrTouch(a.original)||r.modified.overlapOrTouch(a.modified))){const r=o[0],a=o[o.length-1];s.push(new Go(r.original.join(a.original),r.modified.join(a.modified),o.map(l=>l.innerChanges[0])))}return Ub(()=>!i&&s.length>0&&s[0].original.startLineNumber!==s[0].modified.startLineNumber?!1:WU(s,(o,r)=>r.original.startLineNumber-o.original.endLineNumberExclusive===r.modified.startLineNumber-o.modified.endLineNumberExclusive&&o.original.endLineNumberExclusive=t[n.modifiedRange.startLineNumber-1].length&&n.originalRange.startColumn-1>=e[n.originalRange.startLineNumber-1].length&&n.originalRange.startLineNumber<=n.originalRange.endLineNumber+s&&n.modifiedRange.startLineNumber<=n.modifiedRange.endLineNumber+s&&(i=1);const o=new Xe(n.originalRange.startLineNumber+i,n.originalRange.endLineNumber+1+s),r=new Xe(n.modifiedRange.startLineNumber+i,n.modifiedRange.endLineNumber+1+s);return new Go(o,r,[n])}const j9={getLegacy:()=>new k_e,getDefault:()=>new Tj};function Id(n,e){const t=Math.pow(10,e);return Math.round(n*t)/t}class ht{constructor(e,t,i,s=1){this._rgbaBrand=void 0,this.r=Math.min(255,Math.max(0,e))|0,this.g=Math.min(255,Math.max(0,t))|0,this.b=Math.min(255,Math.max(0,i))|0,this.a=Id(Math.max(Math.min(1,s),0),3)}static equals(e,t){return e.r===t.r&&e.g===t.g&&e.b===t.b&&e.a===t.a}}class rr{constructor(e,t,i,s){this._hslaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=Id(Math.max(Math.min(1,t),0),3),this.l=Id(Math.max(Math.min(1,i),0),3),this.a=Id(Math.max(Math.min(1,s),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.l===t.l&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,s=e.b/255,o=e.a,r=Math.max(t,i,s),a=Math.min(t,i,s);let l=0,c=0;const d=(a+r)/2,u=r-a;if(u>0){switch(c=Math.min(d<=.5?u/(2*d):u/(2-2*d),1),r){case t:l=(i-s)/u+(i1&&(i-=1),i<1/6?e+(t-e)*6*i:i<1/2?t:i<2/3?e+(t-e)*(2/3-i)*6:e}static toRGBA(e){const t=e.h/360,{s:i,l:s,a:o}=e;let r,a,l;if(i===0)r=a=l=s;else{const c=s<.5?s*(1+i):s+i-s*i,d=2*s-c;r=rr._hue2rgb(d,c,t+1/3),a=rr._hue2rgb(d,c,t),l=rr._hue2rgb(d,c,t-1/3)}return new ht(Math.round(r*255),Math.round(a*255),Math.round(l*255),o)}}class $g{constructor(e,t,i,s){this._hsvaBrand=void 0,this.h=Math.max(Math.min(360,e),0)|0,this.s=Id(Math.max(Math.min(1,t),0),3),this.v=Id(Math.max(Math.min(1,i),0),3),this.a=Id(Math.max(Math.min(1,s),0),3)}static equals(e,t){return e.h===t.h&&e.s===t.s&&e.v===t.v&&e.a===t.a}static fromRGBA(e){const t=e.r/255,i=e.g/255,s=e.b/255,o=Math.max(t,i,s),r=Math.min(t,i,s),a=o-r,l=o===0?0:a/o;let c;return a===0?c=0:o===t?c=((i-s)/a%6+6)%6:o===i?c=(s-t)/a+2:c=(t-i)/a+4,new $g(Math.round(c*60),l,o,e.a)}static toRGBA(e){const{h:t,s:i,v:s,a:o}=e,r=s*i,a=r*(1-Math.abs(t/60%2-1)),l=s-r;let[c,d,u]=[0,0,0];return t<60?(c=r,d=a):t<120?(c=a,d=r):t<180?(d=r,u=a):t<240?(d=a,u=r):t<300?(c=a,u=r):t<=360&&(c=r,u=a),c=Math.round((c+l)*255),d=Math.round((d+l)*255),u=Math.round((u+l)*255),new ht(c,d,u,o)}}class H{static fromHex(e){return H.Format.CSS.parseHex(e)||H.red}static equals(e,t){return!e&&!t?!0:!e||!t?!1:e.equals(t)}get hsla(){return this._hsla?this._hsla:rr.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:$g.fromRGBA(this.rgba)}constructor(e){if(e)if(e instanceof ht)this.rgba=e;else if(e instanceof rr)this._hsla=e,this.rgba=rr.toRGBA(e);else if(e instanceof $g)this._hsva=e,this.rgba=$g.toRGBA(e);else throw new Error("Invalid color ctor argument");else throw new Error("Color needs a value")}equals(e){return!!e&&ht.equals(this.rgba,e.rgba)&&rr.equals(this.hsla,e.hsla)&&$g.equals(this.hsva,e.hsva)}getRelativeLuminance(){const e=H._relativeLuminanceForComponent(this.rgba.r),t=H._relativeLuminanceForComponent(this.rgba.g),i=H._relativeLuminanceForComponent(this.rgba.b),s=.2126*e+.7152*t+.0722*i;return Id(s,4)}static _relativeLuminanceForComponent(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}isLighter(){return(this.rgba.r*299+this.rgba.g*587+this.rgba.b*114)/1e3>=128}isLighterThan(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t>i}isDarkerThan(e){const t=this.getRelativeLuminance(),i=e.getRelativeLuminance();return t0)for(const s of i){const o=s.filter(c=>c!==void 0),r=o[1],a=o[2];if(!a)continue;let l;if(r==="rgb"){const c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*\)$/gm;l=q9(N0(n,s),R0(a,c),!1)}else if(r==="rgba"){const c=/^\(\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;l=q9(N0(n,s),R0(a,c),!0)}else if(r==="hsl"){const c=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*\)$/gm;l=G9(N0(n,s),R0(a,c),!1)}else if(r==="hsla"){const c=/^\(\s*(36[0]|3[0-5][0-9]|[12][0-9][0-9]|[1-9]?[0-9])\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(100|\d{1,2}[.]\d*|\d{1,2})%\s*,\s*(0[.][0-9]+|[.][0-9]+|[01][.]|[01])\s*\)$/gm;l=G9(N0(n,s),R0(a,c),!0)}else r==="#"&&(l=J_e(N0(n,s),r+a));l&&e.push(l)}return e}function tbe(n){return!n||typeof n.getValue!="function"||typeof n.positionAt!="function"?[]:ebe(n)}var Pc=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,[])).next())})};class ibe extends i_e{get uri(){return this._uri}get eol(){return this._eol}getValue(){return this.getText()}findMatches(e){const t=[];for(let i=0;ithis._lines.length)t=this._lines.length,i=this._lines[t-1].length+1,s=!0;else{const o=this._lines[t-1].length+1;i<1?(i=1,s=!0):i>o&&(i=o,s=!0)}return s?{lineNumber:t,column:i}:e}}class Td{constructor(e,t){this._host=e,this._models=Object.create(null),this._foreignModuleFactory=t,this._foreignModule=null}dispose(){this._models=Object.create(null)}_getModel(e){return this._models[e]}_getModels(){const e=[];return Object.keys(this._models).forEach(t=>e.push(this._models[t])),e}acceptNewModel(e){this._models[e.url]=new ibe(Ue.parse(e.url),e.lines,e.EOL,e.versionId)}acceptModelChanged(e,t){if(!this._models[e])return;this._models[e].onEvents(t)}acceptRemovedModel(e){this._models[e]&&delete this._models[e]}computeUnicodeHighlights(e,t,i){return Pc(this,void 0,void 0,function*(){const s=this._getModel(e);return s?b_e.computeUnicodeHighlights(s,t,i):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}})}computeDiff(e,t,i,s){return Pc(this,void 0,void 0,function*(){const o=this._getModel(e),r=this._getModel(t);return!o||!r?null:Td.computeDiff(o,r,i,s)})}static computeDiff(e,t,i,s){const o=s==="advanced"?j9.getDefault():j9.getLegacy(),r=e.getLinesContent(),a=t.getLinesContent(),l=o.computeDiff(r,a,i),c=l.changes.length>0?!1:this._modelsAreIdentical(e,t);function d(u){return u.map(h=>{var f;return[h.original.startLineNumber,h.original.endLineNumberExclusive,h.modified.startLineNumber,h.modified.endLineNumberExclusive,(f=h.innerChanges)===null||f===void 0?void 0:f.map(g=>[g.originalRange.startLineNumber,g.originalRange.startColumn,g.originalRange.endLineNumber,g.originalRange.endColumn,g.modifiedRange.startLineNumber,g.modifiedRange.startColumn,g.modifiedRange.endLineNumber,g.modifiedRange.endColumn])]})}return{identical:c,quitEarly:l.hitTimeout,changes:d(l.changes),moves:l.moves.map(u=>[u.lineRangeMapping.original.startLineNumber,u.lineRangeMapping.original.endLineNumberExclusive,u.lineRangeMapping.modified.startLineNumber,u.lineRangeMapping.modified.endLineNumberExclusive,d(u.changes)])}}static _modelsAreIdentical(e,t){const i=e.getLineCount(),s=t.getLineCount();if(i!==s)return!1;for(let o=1;o<=i;o++){const r=e.getLineContent(o),a=t.getLineContent(o);if(r!==a)return!1}return!0}computeMoreMinimalEdits(e,t,i){return Pc(this,void 0,void 0,function*(){const s=this._getModel(e);if(!s)return t;const o=[];let r;t=t.slice(0).sort((l,c)=>{if(l.range&&c.range)return N.compareRangesUsingStarts(l.range,c.range);const d=l.range?0:1,u=c.range?0:1;return d-u});let a=0;for(let l=1;lTd._diffLimit){o.push({range:l,text:c});continue}const h=J0e(u,c,i),f=s.offsetAt(N.lift(l).getStartPosition());for(const g of h){const p=s.positionAt(f+g.originalStart),_=s.positionAt(f+g.originalStart+g.originalLength),v={text:c.substr(g.modifiedStart,g.modifiedLength),range:{startLineNumber:p.lineNumber,startColumn:p.column,endLineNumber:_.lineNumber,endColumn:_.column}};s.getValueInRange(v.range)!==v.text&&o.push(v)}}return typeof r=="number"&&o.push({eol:r,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),o})}computeLinks(e){return Pc(this,void 0,void 0,function*(){const t=this._getModel(e);return t?a_e(t):null})}computeDefaultDocumentColors(e){return Pc(this,void 0,void 0,function*(){const t=this._getModel(e);return t?tbe(t):null})}textualSuggest(e,t,i,s){return Pc(this,void 0,void 0,function*(){const o=new Su,r=new RegExp(i,s),a=new Set;e:for(const l of e){const c=this._getModel(l);if(c){for(const d of c.words(r))if(!(d===t||!isNaN(Number(d)))&&(a.add(d),a.size>Td._suggestionsLimit))break e}}return{words:Array.from(a),duration:o.elapsed()}})}computeWordRanges(e,t,i,s){return Pc(this,void 0,void 0,function*(){const o=this._getModel(e);if(!o)return Object.create(null);const r=new RegExp(i,s),a=Object.create(null);for(let l=t.startLineNumber;lthis._host.fhr(a,l)),getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(r,t),Promise.resolve(x4(this._foreignModule))):Promise.reject(new Error("Unexpected usage"))}fmr(e,t){if(!this._foreignModule||typeof this._foreignModule[e]!="function")return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._foreignModule[e].apply(this._foreignModule,t))}catch(i){return Promise.reject(i)}}}Td._diffLimit=1e5;Td._suggestionsLimit=1e4;typeof importScripts=="function"&&(globalThis.monaco=kU());const Rj=rt("textResourceConfigurationService"),Mj=rt("textResourcePropertiesService"),it=rt("ILanguageFeaturesService");var nbe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},M0=function(n,e){return function(t,i){e(t,i,n)}},RS=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const K9=60*1e3,Y9=5*60*1e3;function dh(n,e){const t=n.getModel(e);return!(!t||t.isTooLargeForSyncing())}let vT=class extends Y{constructor(e,t,i,s,o){super(),this._modelService=e,this._workerManager=this._register(new obe(this._modelService,s)),this._logService=i,this._register(o.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(r,a)=>dh(this._modelService,r.uri)?this._workerManager.withWorker().then(l=>l.computeLinks(r.uri)).then(l=>l&&{links:l}):Promise.resolve({links:[]})})),this._register(o.completionProvider.register("*",new sbe(this._workerManager,t,this._modelService,s)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return dh(this._modelService,e)}computedUnicodeHighlights(e,t,i){return this._workerManager.withWorker().then(s=>s.computedUnicodeHighlights(e,t,i))}computeDiff(e,t,i,s){return RS(this,void 0,void 0,function*(){const o=yield this._workerManager.withWorker().then(l=>l.computeDiff(e,t,i,s));if(!o)return null;return{identical:o.identical,quitEarly:o.quitEarly,changes:a(o.changes),moves:o.moves.map(l=>new kj(new nl(new Xe(l[0],l[1]),new Xe(l[2],l[3])),a(l[4])))};function a(l){return l.map(c=>{var d;return new Go(new Xe(c[0],c[1]),new Xe(c[2],c[3]),(d=c[4])===null||d===void 0?void 0:d.map(u=>new ou(new N(u[0],u[1],u[2],u[3]),new N(u[4],u[5],u[6],u[7]))))})}})}computeMoreMinimalEdits(e,t,i=!1){if(oc(t)){if(!dh(this._modelService,e))return Promise.resolve(t);const s=Su.create(),o=this._workerManager.withWorker().then(r=>r.computeMoreMinimalEdits(e,t,i));return o.finally(()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),s.elapsed())),Promise.race([o,Gb(1e3).then(()=>t)])}else return Promise.resolve(void 0)}canNavigateValueSet(e){return dh(this._modelService,e)}navigateValueSet(e,t,i){return this._workerManager.withWorker().then(s=>s.navigateValueSet(e,t,i))}canComputeWordRanges(e){return dh(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then(i=>i.computeWordRanges(e,t))}};vT=nbe([M0(0,hs),M0(1,Rj),M0(2,Sc),M0(3,so),M0(4,it)],vT);class sbe{constructor(e,t,i,s){this.languageConfigurationService=s,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=i}provideCompletionItems(e,t){return RS(this,void 0,void 0,function*(){const i=this._configurationService.getValue(e.uri,t,"editor");if(!i.wordBasedSuggestions)return;const s=[];if(i.wordBasedSuggestionsMode==="currentDocument")dh(this._modelService,e.uri)&&s.push(e.uri);else for(const u of this._modelService.getModels())dh(this._modelService,u.uri)&&(u===e?s.unshift(u.uri):(i.wordBasedSuggestionsMode==="allDocuments"||u.getLanguageId()===e.getLanguageId())&&s.push(u.uri));if(s.length===0)return;const o=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),r=e.getWordAtPosition(t),a=r?new N(t.lineNumber,r.startColumn,t.lineNumber,r.endColumn):N.fromPositions(t),l=a.setEndPosition(t.lineNumber,t.column),d=yield(yield this._workerManager.withWorker()).textualSuggest(s,r==null?void 0:r.word,o);if(d)return{duration:d.duration,suggestions:d.words.map(u=>({kind:18,label:u,insertText:u,range:{insert:l,replace:a}}))}})}}class obe extends Y{constructor(e,t){super(),this.languageConfigurationService=t,this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=new Date().getTime(),this._register(new Y1).cancelAndSet(()=>this._checkStopIdleWorker(),Math.round(Y9/2)),this._register(this._modelService.onModelRemoved(s=>this._checkStopEmptyWorker()))}dispose(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),super.dispose()}_checkStopEmptyWorker(){if(!this._editorWorkerClient)return;this._modelService.getModels().length===0&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}_checkStopIdleWorker(){if(!this._editorWorkerClient)return;new Date().getTime()-this._lastWorkerUsedTime>Y9&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=new Date().getTime(),this._editorWorkerClient||(this._editorWorkerClient=new Pj(this._modelService,!1,"editorWorkerService",this.languageConfigurationService)),Promise.resolve(this._editorWorkerClient)}}class rbe extends Y{constructor(e,t,i){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!i){const s=new Y1;s.cancelAndSet(()=>this._checkStopModelSync(),Math.round(K9/2)),this._register(s)}}dispose(){for(const e in this._syncedModels)Ft(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t){for(const i of e){const s=i.toString();this._syncedModels[s]||this._beginModelSync(i,t),this._syncedModels[s]&&(this._syncedModelsLastUsedTime[s]=new Date().getTime())}}_checkStopModelSync(){const e=new Date().getTime(),t=[];for(const i in this._syncedModelsLastUsedTime)e-this._syncedModelsLastUsedTime[i]>K9&&t.push(i);for(const i of t)this._stopModelSync(i)}_beginModelSync(e,t){const i=this._modelService.getModel(e);if(!i||!t&&i.isTooLargeForSyncing())return;const s=e.toString();this._proxy.acceptNewModel({url:i.uri.toString(),lines:i.getLinesContent(),EOL:i.getEOL(),versionId:i.getVersionId()});const o=new pe;o.add(i.onDidChangeContent(r=>{this._proxy.acceptModelChanged(s.toString(),r)})),o.add(i.onWillDispose(()=>{this._stopModelSync(s)})),o.add(Ye(()=>{this._proxy.acceptRemovedModel(s)})),this._syncedModels[s]=o}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],Ft(t)}}class Z9{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class v2{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class Pj extends Y{constructor(e,t,i,s){super(),this.languageConfigurationService=s,this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new QL(i),this._worker=null,this._modelManager=null}fhr(e,t){throw new Error("Not implemented!")}_getOrCreateWorker(){if(!this._worker)try{this._worker=this._register(new a0e(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new v2(this)))}catch(e){cT(e),this._worker=new Z9(new Td(new v2(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,e=>(cT(e),this._worker=new Z9(new Td(new v2(this),null)),this._getOrCreateWorker().getProxyObject()))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new rbe(e,this._modelService,this._keepIdleModels))),this._modelManager}_withSyncedResources(e,t=!1){return RS(this,void 0,void 0,function*(){return this._disposed?Promise.reject(pge()):this._getProxy().then(i=>(this._getOrCreateModelManager(i).ensureSyncedResources(e,t),i))})}computedUnicodeHighlights(e,t,i){return this._withSyncedResources([e]).then(s=>s.computeUnicodeHighlights(e.toString(),t,i))}computeDiff(e,t,i,s){return this._withSyncedResources([e,t],!0).then(o=>o.computeDiff(e.toString(),t.toString(),i,s))}computeMoreMinimalEdits(e,t,i){return this._withSyncedResources([e]).then(s=>s.computeMoreMinimalEdits(e.toString(),t,i))}computeLinks(e){return this._withSyncedResources([e]).then(t=>t.computeLinks(e.toString()))}computeDefaultDocumentColors(e){return this._withSyncedResources([e]).then(t=>t.computeDefaultDocumentColors(e.toString()))}textualSuggest(e,t,i){return RS(this,void 0,void 0,function*(){const s=yield this._withSyncedResources(e),o=i.source,r=i.flags;return s.textualSuggest(e.map(a=>a.toString()),t,o,r)})}computeWordRanges(e,t){return this._withSyncedResources([e]).then(i=>{const s=this._modelService.getModel(e);if(!s)return Promise.resolve(null);const o=this.languageConfigurationService.getLanguageConfiguration(s.getLanguageId()).getWordDefinition(),r=o.source,a=o.flags;return i.computeWordRanges(e.toString(),t,r,a)})}navigateValueSet(e,t,i){return this._withSyncedResources([e]).then(s=>{const o=this._modelService.getModel(e);if(!o)return null;const r=this.languageConfigurationService.getLanguageConfiguration(o.getLanguageId()).getWordDefinition(),a=r.source,l=r.flags;return s.navigateValueSet(e.toString(),t,i,a,l)})}dispose(){super.dispose(),this._disposed=!0}}function abe(n,e,t){return new lbe(n,e,t)}class lbe extends Pj{constructor(e,t,i){super(e,i.keepIdleModels||!1,i.label,t),this._foreignModuleId=i.moduleId,this._foreignModuleCreateData=i.createData||null,this._foreignModuleHost=i.host||null,this._foreignProxy=null}fhr(e,t){if(!this._foreignModuleHost||typeof this._foreignModuleHost[e]!="function")return Promise.reject(new Error("Missing method "+e+" or missing main thread foreign host."));try{return Promise.resolve(this._foreignModuleHost[e].apply(this._foreignModuleHost,t))}catch(i){return Promise.reject(i)}}_getForeignProxy(){return this._foreignProxy||(this._foreignProxy=this._getProxy().then(e=>{const t=this._foreignModuleHost?x4(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then(i=>{this._foreignModuleCreateData=null;const s=(a,l)=>e.fmr(a,l),o=(a,l)=>function(){const c=Array.prototype.slice.call(arguments,0);return l(a,c)},r={};for(const a of i)r[a]=o(a,s);return r})})),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then(t=>this.getProxy())}}const rD={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"},Jb=new class{clone(){return this}equals(n){return this===n}};function Oj(n,e){return new M4([new Wb(0,"",n)],e)}function o3(n,e){const t=new Uint32Array(2);return t[0]=0,t[1]=(n<<0|0|0|32768|2<<24)>>>0,new FL(t,e===null?Jb:e)}class Us{static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static getClassNameFromMetadata(e){let i="mtk"+this.getForeground(e);const s=this.getFontStyle(e);return s&1&&(i+=" mtki"),s&2&&(i+=" mtkb"),s&4&&(i+=" mtku"),s&8&&(i+=" mtks"),i}static getInlineStyleFromMetadata(e,t){const i=this.getForeground(e),s=this.getFontStyle(e);let o=`color: ${t[i]};`;s&1&&(o+="font-style: italic;"),s&2&&(o+="font-weight: bold;");let r="";return s&4&&(r+=" underline"),s&8&&(r+=" line-through"),r&&(o+=`text-decoration:${r};`),o}static getPresentationFromMetadata(e){const t=this.getForeground(e),i=this.getFontStyle(e);return{foreground:t,italic:!!(i&1),bold:!!(i&2),underline:!!(i&4),strikethrough:!!(i&8)}}}class on{static createEmpty(e,t){const i=on.defaultTokenMetadata,s=new Uint32Array(2);return s[0]=e.length,s[1]=i,new on(s,e,t)}constructor(e,t,i){this._lineTokensBrand=void 0,this._tokens=e,this._tokensCount=this._tokens.length>>>1,this._text=t,this._languageIdCodec=i}equals(e){return e instanceof on?this.slicedEquals(e,0,this._tokensCount):!1}slicedEquals(e,t,i){if(this._text!==e._text||this._tokensCount!==e._tokensCount)return!1;const s=t<<1,o=s+(i<<1);for(let r=s;r0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[(e<<1)+1]}getLanguageId(e){const t=this._tokens[(e<<1)+1],i=Us.getLanguageId(t);return this._languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[(e<<1)+1];return Us.getTokenType(t)}getForeground(e){const t=this._tokens[(e<<1)+1];return Us.getForeground(t)}getClassName(e){const t=this._tokens[(e<<1)+1];return Us.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[(e<<1)+1];return Us.getInlineStyleFromMetadata(i,t)}getPresentation(e){const t=this._tokens[(e<<1)+1];return Us.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return on.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new r3(this,e,t,i)}static convertToEndOffset(e,t){const s=(e.length>>>1)-1;for(let o=0;o>>1)-1;for(;it&&(s=o)}return i}withInserted(e){if(e.length===0)return this;let t=0,i=0,s="";const o=new Array;let r=0;for(;;){const a=tr){s+=this._text.substring(r,l.offset);const c=this._tokens[(t<<1)+1];o.push(s.length,c),r=l.offset}s+=l.text,o.push(s.length,l.tokenMetadata),i++}else break}return new on(new Uint32Array(o),s,this._languageIdCodec)}}on.defaultTokenMetadata=(32768|2<<24)>>>0;class r3{constructor(e,t,i,s){this._source=e,this._startOffset=t,this._endOffset=i,this._deltaOffset=s,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this._tokensCount=0;for(let o=this._firstTokenIndex,r=e.getCount();o=i);o++)this._tokensCount++}getMetadata(e){return this._source.getMetadata(this._firstTokenIndex+e)}getLanguageId(e){return this._source.getLanguageId(this._firstTokenIndex+e)}getLineContent(){return this._source.getLineContent().substring(this._startOffset,this._endOffset)}equals(e){return e instanceof r3?this._startOffset===e._startOffset&&this._endOffset===e._endOffset&&this._deltaOffset===e._deltaOffset&&this._source.slicedEquals(e._source,this._firstTokenIndex,this._tokensCount):!1}getCount(){return this._tokensCount}getForeground(e){return this._source.getForeground(this._firstTokenIndex+e)}getEndOffset(e){const t=this._source.getEndOffset(this._firstTokenIndex+e);return Math.min(this._endOffset,t)-this._startOffset+this._deltaOffset}getClassName(e){return this._source.getClassName(this._firstTokenIndex+e)}getInlineStyle(e,t){return this._source.getInlineStyle(this._firstTokenIndex+e,t)}getPresentation(e){return this._source.getPresentation(this._firstTokenIndex+e)}findTokenIndexAtOffset(e){return this._source.findTokenIndexAtOffset(e+this._startOffset-this._deltaOffset)-this._firstTokenIndex}}class ur{constructor(e,t,i,s){this.startColumn=e,this.endColumn=t,this.className=i,this.type=s,this._lineDecorationBrand=void 0}static _equals(e,t){return e.startColumn===t.startColumn&&e.endColumn===t.endColumn&&e.className===t.className&&e.type===t.type}static equalsArr(e,t){const i=e.length,s=t.length;if(i!==s)return!1;for(let o=0;o=o||(a[l++]=new ur(Math.max(1,c.startColumn-s+1),Math.min(r+1,c.endColumn-s+1),c.className,c.type));return a}static filter(e,t,i,s){if(e.length===0)return[];const o=[];let r=0;for(let a=0,l=e.length;at||d.isEmpty()&&(c.type===0||c.type===3))continue;const u=d.startLineNumber===t?d.startColumn:i,h=d.endLineNumber===t?d.endColumn:s;o[r++]=new ur(u,h,c.inlineClassName,c.type)}return o}static _typeCompare(e,t){const i=[2,0,1,3];return i[e]-i[t]}static compare(e,t){if(e.startColumn!==t.startColumn)return e.startColumn-t.startColumn;if(e.endColumn!==t.endColumn)return e.endColumn-t.endColumn;const i=ur._typeCompare(e.type,t.type);return i!==0?i:e.className!==t.className?e.className0&&this.stopOffsets[0]0&&t=e){this.stopOffsets.splice(s,0,e),this.classNames.splice(s,0,t),this.metadata.splice(s,0,i);break}this.count++}}class cbe{static normalize(e,t){if(t.length===0)return[];const i=[],s=new MS;let o=0;for(let r=0,a=t.length;r1){const p=e.charCodeAt(c-2);tn(p)&&c--}if(d>1){const p=e.charCodeAt(d-2);tn(p)&&d--}const f=c-1,g=d-2;o=s.consumeLowerThan(f,o,i),s.count===0&&(o=f),s.insert(g,u,h)}return s.consumeLowerThan(1073741824,o,i),i}}class nn{constructor(e,t,i,s){this.endIndex=e,this.type=t,this.metadata=i,this.containsRTL=s,this._linePartBrand=void 0}isWhitespace(){return!!(this.metadata&1)}isPseudoAfter(){return!!(this.metadata&4)}}class Fj{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}}class l0{constructor(e,t,i,s,o,r,a,l,c,d,u,h,f,g,p,_,v,b,y){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=s,this.isBasicASCII=o,this.containsRTL=r,this.fauxIndentLength=a,this.lineTokens=l,this.lineDecorations=c.sort(ur.compare),this.tabSize=d,this.startVisibleColumn=u,this.spaceWidth=h,this.stopRenderingLineAfter=p,this.renderWhitespace=_==="all"?4:_==="boundary"?1:_==="selection"?2:_==="trailing"?3:0,this.renderControlCharacters=v,this.fontLigatures=b,this.selectionsOnLine=y&&y.sort((L,x)=>L.startOffset>>16}static getCharIndex(e){return(e&65535)>>>0}constructor(e,t){this.length=e,this._data=new Uint32Array(this.length),this._horizontalOffset=new Uint32Array(this.length)}setColumnInfo(e,t,i,s){const o=(t<<16|i<<0)>>>0;this._data[e-1]=o,this._horizontalOffset[e-1]=s}getHorizontalOffset(e){return this._horizontalOffset.length===0?0:this._horizontalOffset[e-1]}charOffsetToPartData(e){return this.length===0?0:e<0?this._data[0]:e>=this.length?this._data[this.length-1]:this._data[e]}getDomPosition(e){const t=this.charOffsetToPartData(e-1),i=Da.getPartIndex(t),s=Da.getCharIndex(t);return new Bj(i,s)}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,i){if(this.length===0)return 0;const s=(e<<16|i<<0)>>>0;let o=0,r=this.length-1;for(;o+1>>1,_=this._data[p];if(_===s)return p;_>s?r=p:o=p}if(o===r)return o;const a=this._data[o],l=this._data[r];if(a===s)return o;if(l===s)return r;const c=Da.getPartIndex(a),d=Da.getCharIndex(a),u=Da.getPartIndex(l);let h;c!==u?h=t:h=Da.getCharIndex(l);const f=i-d,g=h-i;return f<=g?o:r}}class yT{constructor(e,t,i){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=i}}function a3(n,e){if(n.lineContent.length===0){if(n.lineDecorations.length>0){e.appendString("");let t=0,i=0,s=0;for(const r of n.lineDecorations)(r.type===1||r.type===2)&&(e.appendString(''),r.type===1&&(s|=1,t++),r.type===2&&(s|=2,i++));e.appendString("");const o=new Da(1,t+i);return o.setColumnInfo(1,t,0,0),new yT(o,!1,s)}return e.appendString(""),new yT(new Da(0,0),!1,0)}return bbe(hbe(n),e)}class dbe{constructor(e,t,i,s){this.characterMapping=e,this.html=t,this.containsRTL=i,this.containsForeignElements=s}}function aD(n){const e=new eD(1e4),t=a3(n,e);return new dbe(t.characterMapping,e.build(),t.containsRTL,t.containsForeignElements)}class ube{constructor(e,t,i,s,o,r,a,l,c,d,u,h,f,g,p,_){this.fontIsMonospace=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.len=s,this.isOverflowing=o,this.overflowingCharCount=r,this.parts=a,this.containsForeignElements=l,this.fauxIndentLength=c,this.tabSize=d,this.startVisibleColumn=u,this.containsRTL=h,this.spaceWidth=f,this.renderSpaceCharCode=g,this.renderWhitespace=p,this.renderControlCharacters=_}}function hbe(n){const e=n.lineContent;let t,i,s;n.stopRenderingLineAfter!==-1&&n.stopRenderingLineAfter0){for(let a=0,l=n.lineDecorations.length;a0&&(o[r++]=new nn(i,"",0,!1));let a=i;for(let l=0,c=t.getCount();l=s){const f=e?Hb(n.substring(a,s)):!1;o[r++]=new nn(s,u,0,f);break}const h=e?Hb(n.substring(a,d)):!1;o[r++]=new nn(d,u,0,h),a=d}return o}function gbe(n,e,t){let i=0;const s=[];let o=0;if(t)for(let r=0,a=e.length;r=50&&(s[o++]=new nn(f+1,d,u,h),g=f+1,f=-1);g!==c&&(s[o++]=new nn(c,d,u,h))}else s[o++]=l;i=c}else for(let r=0,a=e.length;r50){const u=l.type,h=l.metadata,f=l.containsRTL,g=Math.ceil(d/50);for(let p=1;p=8234&&n<=8238||n>=8294&&n<=8297||n>=8206&&n<=8207||n===1564}function pbe(n,e){const t=[];let i=new nn(0,"",0,!1),s=0;for(const o of e){const r=o.endIndex;for(;si.endIndex&&(i=new nn(s,o.type,o.metadata,o.containsRTL),t.push(i)),i=new nn(s+1,"mtkcontrol",o.metadata,!1),t.push(i))}s>i.endIndex&&(i=new nn(r,o.type,o.metadata,o.containsRTL),t.push(i))}return t}function mbe(n,e,t,i){const s=n.continuesWithWrappedLine,o=n.fauxIndentLength,r=n.tabSize,a=n.startVisibleColumn,l=n.useMonospaceOptimizations,c=n.selectionsOnLine,d=n.renderWhitespace===1,u=n.renderWhitespace===3,h=n.renderSpaceWidth!==n.spaceWidth,f=[];let g=0,p=0,_=i[p].type,v=i[p].containsRTL,b=i[p].endIndex;const y=i.length;let w=!1,S=Ys(e),L;S===-1?(w=!0,S=t,L=t):L=Uf(e);let x=!1,D=0,k=c&&c[D],P=a%r;for(let M=o;M=k.endOffset&&(D++,k=c&&c[D]);let z;if(ML)z=!0;else if(R===9)z=!0;else if(R===32)if(d)if(x)z=!0;else{const G=M+1M),z&&u&&(z=w||M>L),z&&v&&M>=S&&M<=L&&(z=!1),x){if(!z||!l&&P>=r){if(h){const G=g>0?f[g-1].endIndex:o;for(let te=G+1;te<=M;te++)f[g++]=new nn(te,"mtkw",1,!1)}else f[g++]=new nn(M,"mtkw",1,!1);P=P%r}}else(M===b||z&&M>o)&&(f[g++]=new nn(M,_,0,v),P=P%r);for(R===9?P=r:tu(R)?P+=2:P++,x=z;M===b&&(p++,p0?e.charCodeAt(t-1):0,R=t>1?e.charCodeAt(t-2):0;M===32&&R!==32&&R!==9||(O=!0)}else O=!0;if(O)if(h){const M=g>0?f[g-1].endIndex:o;for(let R=M+1;R<=t;R++)f[g++]=new nn(R,"mtkw",1,!1)}else f[g++]=new nn(t,"mtkw",1,!1);else f[g++]=new nn(t,_,0,v);return f}function _be(n,e,t,i){i.sort(ur.compare);const s=cbe.normalize(n,i),o=s.length;let r=0;const a=[];let l=0,c=0;for(let u=0,h=t.length;uc&&(c=b.startOffset,a[l++]=new nn(c,p,_,v)),b.endOffset+1<=g)c=b.endOffset+1,a[l++]=new nn(c,p+" "+b.className,_|b.metadata,v),r++;else{c=g,a[l++]=new nn(c,p+" "+b.className,_|b.metadata,v);break}}g>c&&(c=g,a[l++]=new nn(c,p,_,v))}const d=t[t.length-1].endIndex;if(r'):e.appendString("");for(let k=0,P=c.length;k=d&&(Se+=me)}}for(te&&(e.appendString(' style="width:'),e.appendString(String(g*fe)),e.appendString('px"')),e.appendASCIICharCode(62);w1?e.appendCharCode(8594):e.appendCharCode(65515);for(let me=2;me<=Ie;me++)e.appendCharCode(160)}else Se=2,Ie=1,e.appendCharCode(p),e.appendCharCode(8204);L+=Se,x+=Ie,w>=d&&(S+=Ie)}}else for(e.appendASCIICharCode(62);w=d&&(S+=Se)}ae?D++:D=0,w>=r&&!y&&O.isPseudoAfter()&&(y=!0,b.setColumnInfo(w+1,k,L,x)),e.appendString("")}return y||b.setColumnInfo(r+1,c.length-1,L,x),a&&(e.appendString(''),e.appendString(m("showMore","Show more ({0})",ybe(l))),e.appendString("")),e.appendString(""),new yT(b,f,s)}function vbe(n){return n.toString(16).toUpperCase().padStart(4,"0")}function ybe(n){return n<1024?m("overflow.chars","{0} chars",n):n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/1024/1024).toFixed(1)} MB`}class Q9{constructor(e,t,i,s){this._viewportBrand=void 0,this.top=e|0,this.left=t|0,this.width=i|0,this.height=s|0}}class wbe{constructor(e,t){this.tabSize=e,this.data=t}}class l3{constructor(e,t,i,s,o,r,a){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=i,this.maxColumn=s,this.startVisibleColumn=o,this.tokens=r,this.inlineDecorations=a}}class Lo{constructor(e,t,i,s,o,r,a,l,c,d){this.minColumn=e,this.maxColumn=t,this.content=i,this.continuesWithWrappedLine=s,this.isBasicASCII=Lo.isBasicASCII(i,r),this.containsRTL=Lo.containsRTL(i,this.isBasicASCII,o),this.tokens=a,this.inlineDecorations=l,this.tabSize=c,this.startVisibleColumn=d}static isBasicASCII(e,t){return t?V4(e):!0}static containsRTL(e,t,i){return!t&&i?Hb(e):!1}}class W_{constructor(e,t,i){this.range=e,this.inlineClassName=t,this.type=i}}class Cbe{constructor(e,t,i,s){this.startOffset=e,this.endOffset=t,this.inlineClassName=i,this.inlineClassNameAffectsLetterSpacing=s}toInlineDecoration(e){return new W_(new N(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}class Vj{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}}class ev{constructor(e,t,i){this.color=e,this.zIndex=t,this.data=i}static compareByRenderingProps(e,t){return e.zIndex===t.zIndex?e.colort.color?1:0:e.zIndex-t.zIndex}static equals(e,t){return e.color===t.color&&e.zIndex===t.zIndex&&Yi(e.data,t.data)}static equalsArr(e,t){return Yi(e,t,ev.equals)}}function Sbe(n){return Array.isArray(n)}function xbe(n){return!Sbe(n)}function zj(n){return typeof n=="string"}function J9(n){return!zj(n)}function Ig(n){return!n}function Nd(n,e){return n.ignoreCase&&e?e.toLowerCase():e}function e7(n){return n.replace(/[&<>'"_]/g,"-")}function Lbe(n,e){console.log(`${n.languageId}: ${e}`)}function Vt(n,e){return new Error(`${n.languageId}: ${e}`)}function Qc(n,e,t,i,s){const o=/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g;let r=null;return e.replace(o,function(a,l,c,d,u,h,f,g,p){return Ig(c)?Ig(d)?!Ig(u)&&u0;){const i=n.tokenizer[t];if(i)return i;const s=t.lastIndexOf(".");s<0?t=null:t=t.substr(0,s)}return null}function Dbe(n,e){let t=e;for(;t&&t.length>0;){if(n.stateNames[t])return!0;const s=t.lastIndexOf(".");s<0?t=null:t=t.substr(0,s)}return!1}var kbe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Ebe=function(n,e){return function(t,i){e(t,i,n)}},wT;const Hj=5;class tv{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(e!==null&&e.depth>=this._maxCacheDepth)return new wp(e,t);let i=wp.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let s=this._entries[i];return s||(s=new wp(e,t),this._entries[i]=s,s)}}tv._INSTANCE=new tv(Hj);class wp{constructor(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(e){let t="";for(;e!==null;)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t}static _equals(e,t){for(;e!==null&&t!==null;){if(e===t)return!0;if(e.state!==t.state)return!1;e=e.parent,t=t.parent}return e===null&&t===null}equals(e){return wp._equals(this,e)}push(e){return tv.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return tv.create(this.parent,e)}}class Ug{constructor(e,t){this.languageId=e,this.state=t}equals(e){return this.languageId===e.languageId&&this.state.equals(e.state)}clone(){return this.state.clone()===this.state?this:new Ug(this.languageId,this.state)}}class Jc{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(t!==null)return new V_(e,t);if(e!==null&&e.depth>=this._maxCacheDepth)return new V_(e,t);const i=wp.getStackElementId(e);let s=this._entries[i];return s||(s=new V_(e,null),this._entries[i]=s,s)}}Jc._INSTANCE=new Jc(Hj);class V_{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:Jc.create(this.stack,this.embeddedLanguageData)}equals(e){return!(e instanceof V_)||!this.stack.equals(e.stack)?!1:this.embeddedLanguageData===null&&e.embeddedLanguageData===null?!0:this.embeddedLanguageData===null||e.embeddedLanguageData===null?!1:this.embeddedLanguageData.equals(e.embeddedLanguageData)}}class Abe{constructor(){this._tokens=[],this._languageId=null,this._lastTokenType=null,this._lastTokenLanguage=null}enterLanguage(e){this._languageId=e}emit(e,t){this._lastTokenType===t&&this._lastTokenLanguage===this._languageId||(this._lastTokenType=t,this._lastTokenLanguage=this._languageId,this._tokens.push(new Wb(e,t,this._languageId)))}nestedLanguageTokenize(e,t,i,s){const o=i.languageId,r=i.state,a=Si.get(o);if(!a)return this.enterLanguage(o),this.emit(s,""),r;const l=a.tokenize(e,t,r);if(s!==0)for(const c of l.tokens)this._tokens.push(new Wb(c.offset+s,c.type,c.language));else this._tokens=this._tokens.concat(l.tokens);return this._lastTokenType=null,this._lastTokenLanguage=null,this._languageId=null,l.endState}finalize(e){return new M4(this._tokens,e)}}class PS{constructor(e,t){this._languageService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0}enterLanguage(e){this._currentLanguageId=this._languageService.languageIdCodec.encodeLanguageId(e)}emit(e,t){const i=this._theme.match(this._currentLanguageId,t)|1024;this._lastTokenMetadata!==i&&(this._lastTokenMetadata=i,this._tokens.push(e),this._tokens.push(i))}static _merge(e,t,i){const s=e!==null?e.length:0,o=t.length,r=i!==null?i.length:0;if(s===0&&o===0&&r===0)return new Uint32Array(0);if(s===0&&o===0)return i;if(o===0&&r===0)return e;const a=new Uint32Array(s+o+r);e!==null&&a.set(e);for(let l=0;l{if(r)return;let l=!1;for(let c=0,d=a.changedLanguages.length;c{a.affectsConfiguration("editor.maxTokenizationLineLength")&&(this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}))}))}getLoadStatus(){const e=[];for(const t in this._embeddedLanguages){const i=Si.get(t);if(i){if(i instanceof wT){const s=i.getLoadStatus();s.loaded===!1&&e.push(s.promise)}continue}Si.isResolved(t)||e.push(Si.getOrCreate(t))}return e.length===0?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then(t=>{})}}getInitialState(){const e=tv.create(null,this._lexer.start);return Jc.create(e,null)}tokenize(e,t,i){if(e.length>=this._maxTokenizationLineLength)return Oj(this._languageId,i);const s=new Abe,o=this._tokenize(e,t,i,s);return s.finalize(o)}tokenizeEncoded(e,t,i){if(e.length>=this._maxTokenizationLineLength)return o3(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),i);const s=new PS(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),o=this._tokenize(e,t,i,s);return s.finalize(o)}_tokenize(e,t,i,s){return i.embeddedLanguageData?this._nestedTokenize(e,t,i,0,s):this._myTokenize(e,t,i,0,s)}_findLeavingNestedLanguageOffset(e,t){let i=this._lexer.tokenizer[t.stack.state];if(!i&&(i=jy(this._lexer,t.stack.state),!i))throw Vt(this._lexer,"tokenizer state is not defined: "+t.stack.state);let s=-1,o=!1;for(const r of i){if(!J9(r.action)||r.action.nextEmbedded!=="@pop")continue;o=!0;let a=r.regex;const l=r.regex.source;if(l.substr(0,4)==="^(?:"&&l.substr(l.length-1,1)===")"){const d=(a.ignoreCase?"i":"")+(a.unicode?"u":"");a=new RegExp(l.substr(4,l.length-5),d)}const c=e.search(a);c===-1||c!==0&&r.matchOnlyAtLineStart||(s===-1||c0&&o.nestedLanguageTokenize(a,!1,i.embeddedLanguageData,s);const l=e.substring(r);return this._myTokenize(l,t,i,s+r,o)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,i,s,o){o.enterLanguage(this._languageId);const r=e.length,a=t&&this._lexer.includeLF?e+` +`:e,l=a.length;let c=i.embeddedLanguageData,d=i.stack,u=0,h=null,f=!0;for(;f||u=l)break;f=!1;let k=this._lexer.tokenizer[v];if(!k&&(k=jy(this._lexer,v),!k))throw Vt(this._lexer,"tokenizer state is not defined: "+v);const P=a.substr(u);for(const O of k)if((u===0||!O.matchOnlyAtLineStart)&&(b=P.match(O.regex),b)){y=b[0],w=O.action;break}}if(b||(b=[""],y=""),w||(u=this._lexer.maxStack)throw Vt(this._lexer,"maximum tokenizer stack size reached: ["+d.state+","+d.parent.state+",...]");d=d.push(v)}else if(w.next==="@pop"){if(d.depth<=1)throw Vt(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(S));d=d.pop()}else if(w.next==="@popall")d=d.popall();else{let k=Qc(this._lexer,w.next,y,b,v);if(k[0]==="@"&&(k=k.substr(1)),jy(this._lexer,k))d=d.push(k);else throw Vt(this._lexer,"trying to set a next state '"+k+"' that is undefined in rule: "+this._safeRuleName(S))}}w.log&&typeof w.log=="string"&&Lbe(this._lexer,this._lexer.languageId+": "+Qc(this._lexer,w.log,y,b,v))}if(x===null)throw Vt(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(S));const D=k=>{const P=this._languageService.getLanguageIdByLanguageName(k)||this._languageService.getLanguageIdByMimeType(k)||k,O=this._getNestedEmbeddedLanguageData(P);if(u0)throw Vt(this._lexer,"groups cannot be nested: "+this._safeRuleName(S));if(b.length!==x.length+1)throw Vt(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(S));let k=0;for(let P=1;Pn});class c3{static colorizeElement(e,t,i,s){s=s||{};const o=s.theme||"vs",r=s.mimeType||i.getAttribute("lang")||i.getAttribute("data-lang");if(!r)return console.error("Mode not detected"),Promise.resolve();const a=t.getLanguageIdByMimeType(r)||r;e.setTheme(o);const l=i.firstChild?i.firstChild.nodeValue:"";i.className+=" "+o;const c=d=>{var u;const h=(u=y2==null?void 0:y2.createHTML(d))!==null&&u!==void 0?u:d;i.innerHTML=h};return this.colorize(t,l||"",a,s).then(c,d=>console.error(d))}static colorize(e,t,i,s){return Tbe(this,void 0,void 0,function*(){const o=e.languageIdCodec;let r=4;s&&typeof s.tabSize=="number"&&(r=s.tabSize),H4(t)&&(t=t.substr(1));const a=$f(t);if(!e.isRegisteredLanguageId(i))return t7(a,r,o);const l=yield Si.getOrCreate(i);return l?Nbe(a,r,l,o):t7(a,r,o)})}static colorizeLine(e,t,i,s,o=4){const r=Lo.isBasicASCII(e,t),a=Lo.containsRTL(e,r,i);return aD(new l0(!1,!0,e,!1,r,a,0,s,[],o,0,0,0,0,-1,"none",!1,!1,null)).html}static colorizeModelLine(e,t,i=4){const s=e.getLineContent(t);e.tokenization.forceTokenization(t);const r=e.tokenization.getLineTokens(t).inflate();return this.colorizeLine(s,e.mightContainNonBasicASCII(),e.mightContainRTL(),r,i)}}function Nbe(n,e,t,i){return new Promise((s,o)=>{const r=()=>{const a=Rbe(n,e,t,i);if(t instanceof iv){const l=t.getLoadStatus();if(l.loaded===!1){l.promise.then(r,o);return}}s(a)};r()})}function t7(n,e,t){let i=[];const o=new Uint32Array(2);o[0]=0,o[1]=33587200;for(let r=0,a=n.length;r")}return i.join("")}function Rbe(n,e,t,i){let s=[],o=t.getInitialState();for(let r=0,a=n.length;r"),o=c.endState}return s.join("")}const i7=2e4;let uh,hC,CT,fC,ST;function Mbe(n){uh=document.createElement("div"),uh.className="monaco-aria-container";const e=()=>{const i=document.createElement("div");return i.className="monaco-alert",i.setAttribute("role","alert"),i.setAttribute("aria-atomic","true"),uh.appendChild(i),i};hC=e(),CT=e();const t=()=>{const i=document.createElement("div");return i.className="monaco-status",i.setAttribute("aria-live","polite"),i.setAttribute("aria-atomic","true"),uh.appendChild(i),i};fC=t(),ST=t(),n.appendChild(uh)}function Q1(n){uh&&(hC.textContent!==n?(xo(CT),OS(hC,n)):(xo(hC),OS(CT,n)))}function nv(n){uh&&(fC.textContent!==n?(xo(ST),OS(fC,n)):(xo(fC),OS(ST,n)))}function OS(n,e){xo(n),e.length>i7&&(e=e.substr(0,i7)),n.textContent=e,n.style.visibility="hidden",n.style.visibility="visible"}const d3=rt("markerDecorationsService");var Pbe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Obe=function(n,e){return function(t,i){e(t,i,n)}};let sv=class{constructor(e,t){}dispose(){}};sv.ID="editor.contrib.markerDecorations";sv=Pbe([Obe(1,d3)],sv);Ir(sv.ID,sv,0);class $j extends Y{constructor(e,t){super(),this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._referenceDomElement=e,this._width=-1,this._height=-1,this._resizeObserver=null,this.measureReferenceDomElement(!1,t)}dispose(){this.stopObserving(),super.dispose()}getWidth(){return this._width}getHeight(){return this._height}startObserving(){if(!this._resizeObserver&&this._referenceDomElement){let e=null;const t=()=>{e?this.observe({width:e.width,height:e.height}):this.observe()};let i=!1,s=!1;const o=()=>{if(i&&!s)try{i=!1,s=!0,t()}finally{requestAnimationFrame(()=>{s=!1,o()})}};this._resizeObserver=new ResizeObserver(r=>{e=r&&r[0]&&r[0].contentRect?r[0].contentRect:null,i=!0,o()}),this._resizeObserver.observe(this._referenceDomElement)}}stopObserving(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}observe(e){this.measureReferenceDomElement(!0,e)}measureReferenceDomElement(e,t){let i=0,s=0;t?(i=t.width,s=t.height):this._referenceDomElement&&(i=this._referenceDomElement.clientWidth,s=this._referenceDomElement.clientHeight),i=Math.max(5,i),s=Math.max(5,s),(this._width!==i||this._height!==s)&&(this._width=i,this._height=s,e&&this._onDidChange.fire())}}class Rd{constructor(e,t){this.key=e,this.migrate=t}apply(e){const t=Rd._read(e,this.key),i=o=>Rd._read(e,o),s=(o,r)=>Rd._write(e,o,r);this.migrate(t,i,s)}static _read(e,t){if(typeof e>"u")return;const i=t.indexOf(".");if(i>=0){const s=t.substring(0,i);return this._read(e[s],t.substring(i+1))}return e[t]}static _write(e,t,i){const s=t.indexOf(".");if(s>=0){const o=t.substring(0,s);e[o]=e[o]||{},this._write(e[o],t.substring(s+1),i);return}e[t]=i}}Rd.items=[];function Eu(n,e){Rd.items.push(new Rd(n,e))}function Zo(n,e){Eu(n,(t,i,s)=>{if(typeof t<"u"){for(const[o,r]of e)if(t===o){s(n,r);return}}})}function Fbe(n){Rd.items.forEach(e=>e.apply(n))}Zo("wordWrap",[[!0,"on"],[!1,"off"]]);Zo("lineNumbers",[[!0,"on"],[!1,"off"]]);Zo("cursorBlinking",[["visible","solid"]]);Zo("renderWhitespace",[[!0,"boundary"],[!1,"none"]]);Zo("renderLineHighlight",[[!0,"line"],[!1,"none"]]);Zo("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]);Zo("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]);Zo("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);Zo("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]);Zo("autoIndent",[[!1,"advanced"],[!0,"full"]]);Zo("matchBrackets",[[!0,"always"],[!1,"never"]]);Zo("renderFinalNewline",[[!0,"on"],[!1,"off"]]);Zo("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]);Eu("autoClosingBrackets",(n,e,t)=>{n===!1&&(t("autoClosingBrackets","never"),typeof e("autoClosingQuotes")>"u"&&t("autoClosingQuotes","never"),typeof e("autoSurround")>"u"&&t("autoSurround","never"))});Eu("renderIndentGuides",(n,e,t)=>{typeof n<"u"&&(t("renderIndentGuides",void 0),typeof e("guides.indentation")>"u"&&t("guides.indentation",!!n))});Eu("highlightActiveIndentGuide",(n,e,t)=>{typeof n<"u"&&(t("highlightActiveIndentGuide",void 0),typeof e("guides.highlightActiveIndentation")>"u"&&t("guides.highlightActiveIndentation",!!n))});const Bbe={method:"showMethods",function:"showFunctions",constructor:"showConstructors",deprecated:"showDeprecated",field:"showFields",variable:"showVariables",class:"showClasses",struct:"showStructs",interface:"showInterfaces",module:"showModules",property:"showProperties",event:"showEvents",operator:"showOperators",unit:"showUnits",value:"showValues",constant:"showConstants",enum:"showEnums",enumMember:"showEnumMembers",keyword:"showKeywords",text:"showWords",color:"showColors",file:"showFiles",reference:"showReferences",folder:"showFolders",typeParameter:"showTypeParameters",snippet:"showSnippets"};Eu("suggest.filteredTypes",(n,e,t)=>{if(n&&typeof n=="object"){for(const i of Object.entries(Bbe))n[i[0]]===!1&&typeof e(`suggest.${i[1]}`)>"u"&&t(`suggest.${i[1]}`,!1);t("suggest.filteredTypes",void 0)}});Eu("quickSuggestions",(n,e,t)=>{if(typeof n=="boolean"){const i=n?"on":"off";t("quickSuggestions",{comments:i,strings:i,other:i})}});Eu("experimental.stickyScroll.enabled",(n,e,t)=>{typeof n=="boolean"&&(t("experimental.stickyScroll.enabled",void 0),typeof e("stickyScroll.enabled")>"u"&&t("stickyScroll.enabled",n))});Eu("experimental.stickyScroll.maxLineCount",(n,e,t)=>{typeof n=="number"&&(t("experimental.stickyScroll.maxLineCount",void 0),typeof e("stickyScroll.maxLineCount")>"u"&&t("stickyScroll.maxLineCount",n))});class Wbe{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new B,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus)}}const FS=new Wbe,Au=rt("accessibilityService"),Vbe=new _e("accessibilityModeEnabled",!1);var zbe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Hbe=function(n,e){return function(t,i){e(t,i,n)}};let xT=class extends Y{constructor(e,t,i,s){super(),this._accessibilityService=s,this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new B),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._glyphMarginDecorationLaneCount=1,this._computeOptionsMemory=new hU,this.isSimpleWidget=e,this._containerObserver=this._register(new $j(i,t.dimension)),this._rawOptions=n7(t),this._validatedOptions=ed.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(13)&&this._containerObserver.startObserving(),this._register(Xc.onDidChangeZoomLevel(()=>this._recomputeOptions())),this._register(FS.onDidChangeTabFocus(()=>this._recomputeOptions())),this._register(this._containerObserver.onDidChange(()=>this._recomputeOptions())),this._register(JI.onDidChange(()=>this._recomputeOptions())),this._register(xS.onDidChange(()=>this._recomputeOptions())),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized(()=>this._recomputeOptions()))}_recomputeOptions(){const e=this._computeOptions(),t=ed.checkEquals(this.options,e);t!==null&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=Zh.createFromValidatedSettings(this._validatedOptions,e.pixelRatio,this.isSimpleWidget),i=this._readFontInfo(t),s={memory:this._computeOptionsMemory,outerWidth:e.outerWidth,outerHeight:e.outerHeight-this._reservedHeight,fontInfo:i,extraEditorClassName:e.extraEditorClassName,isDominatedByLongLines:this._isDominatedByLongLines,viewLineCount:this._viewLineCount,lineNumbersDigitCount:this._lineNumbersDigitCount,emptySelectionClipboard:e.emptySelectionClipboard,pixelRatio:e.pixelRatio,tabFocusMode:FS.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount};return ed.computeOptions(this._validatedOptions,s)}_readEnvConfiguration(){return{extraEditorClassName:Ube(),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:Yh||xr,pixelRatio:xS.value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?2:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return JI.readFontInfo(e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=n7(e);ed.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=ed.validateOptions(this._rawOptions),this._recomputeOptions())}observeContainer(e){this._containerObserver.observe(e)}setIsDominatedByLongLines(e){this._isDominatedByLongLines!==e&&(this._isDominatedByLongLines=e,this._recomputeOptions())}setModelLineCount(e){const t=$be(e);this._lineNumbersDigitCount!==t&&(this._lineNumbersDigitCount=t,this._recomputeOptions())}setViewLineCount(e){this._viewLineCount!==e&&(this._viewLineCount=e,this._recomputeOptions())}setReservedHeight(e){this._reservedHeight!==e&&(this._reservedHeight=e,this._recomputeOptions())}setGlyphMarginDecorationLaneCount(e){this._glyphMarginDecorationLaneCount!==e&&(this._glyphMarginDecorationLaneCount=e,this._recomputeOptions())}};xT=zbe([Hbe(3,Au)],xT);function $be(n){let e=0;for(;n;)n=Math.floor(n/10),e++;return e||1}function Ube(){let n="";return!bc&&!MU&&(n+="no-user-select "),bc&&(n+="no-minimap-shadow ",n+="enable-user-select "),pt&&(n+="mac "),n}class jbe{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class qbe{constructor(){this._values=[]}_read(e){if(e>=this._values.length)throw new Error("Cannot read uninitialized value");return this._values[e]}get(e){return this._read(e)}_write(e,t){this._values[e]=t}}class ed{static validateOptions(e){const t=new jbe;for(const i of Bg){const s=i.name==="_never_"?void 0:e[i.name];t._write(i.id,i.validate(s))}return t}static computeOptions(e,t){const i=new qbe;for(const s of Bg)i._write(s.id,s.compute(t,i,e._read(s.id)));return i}static _deepEquals(e,t){if(typeof e!="object"||typeof t!="object"||!e||!t)return e===t;if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)?Yi(e,t):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(!ed._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){const i=[];let s=!1;for(const o of Bg){const r=!ed._deepEquals(e._read(o.id),t._read(o.id));i[o.id]=r,r&&(s=!0)}return s?new uU(i):null}static applyUpdate(e,t){let i=!1;for(const s of Bg)if(t.hasOwnProperty(s.name)){const o=s.applyUpdate(e[s.name],t[s.name]);e[s.name]=o.newValue,i=i||o.didChange}return i}}function n7(n){const e=Rl(n);return Fbe(e),e}function Di(n,e,t){let i=null,s=null;if(typeof t.value=="function"?(i="value",s=t.value,s.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof t.get=="function"&&(i="get",s=t.get),!s)throw new Error("not supported");const o=`$memoize$${e}`;t[i]=function(...r){return this.hasOwnProperty(o)||Object.defineProperty(this,o,{configurable:!1,enumerable:!1,writable:!1,value:s.apply(this,r)}),this[o]}}var Gbe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Pt;(function(n){n.Tap="-monaco-gesturetap",n.Change="-monaco-gesturechange",n.Start="-monaco-gesturestart",n.End="-monaco-gesturesend",n.Contextmenu="-monaco-gesturecontextmenu"})(Pt||(Pt={}));class Rt extends Y{constructor(){super(),this.dispatched=!1,this.targets=new Ds,this.ignoreTargets=new Ds,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(K(document,"touchstart",e=>this.onTouchStart(e),{passive:!1})),this._register(K(document,"touchend",e=>this.onTouchEnd(e))),this._register(K(document,"touchmove",e=>this.onTouchMove(e),{passive:!1}))}static addTarget(e){if(!Rt.isTouchDevice())return Y.None;Rt.INSTANCE||(Rt.INSTANCE=new Rt);const t=Rt.INSTANCE.targets.push(e);return Ye(t)}static ignoreTarget(e){if(!Rt.isTouchDevice())return Y.None;Rt.INSTANCE||(Rt.INSTANCE=new Rt);const t=Rt.INSTANCE.ignoreTargets.push(e);return Ye(t)}static isTouchDevice(){return"ontouchstart"in window||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){const t=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let i=0,s=e.targetTouches.length;i=Rt.HOLD_DELAY&&Math.abs(a.initialPageX-Do(a.rollingPageX))<30&&Math.abs(a.initialPageY-Do(a.rollingPageY))<30){const c=this.newGestureEvent(Pt.Contextmenu,a.initialTarget);c.pageX=Do(a.rollingPageX),c.pageY=Do(a.rollingPageY),this.dispatchEvent(c)}else if(i===1){const c=Do(a.rollingPageX),d=Do(a.rollingPageY),u=Do(a.rollingTimestamps)-a.rollingTimestamps[0],h=c-a.rollingPageX[0],f=d-a.rollingPageY[0],g=[...this.targets].filter(p=>a.initialTarget instanceof Node&&p.contains(a.initialTarget));this.inertia(g,t,Math.abs(h)/u,h>0?1:-1,c,Math.abs(f)/u,f>0?1:-1,d)}this.dispatchEvent(this.newGestureEvent(Pt.End,a.initialTarget)),delete this.activeTouches[r.identifier]}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,t){const i=document.createEvent("CustomEvent");return i.initEvent(e,!1,!0),i.initialTarget=t,i.tapCount=0,i}dispatchEvent(e){if(e.type===Pt.Tap){const t=new Date().getTime();let i=0;t-this._lastSetTapCountTime>Rt.CLEAR_TAP_COUNT_TIME?i=1:i=2,this._lastSetTapCountTime=t,e.tapCount=i}else(e.type===Pt.Change||e.type===Pt.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(const t of this.ignoreTargets)if(t.contains(e.initialTarget))return;for(const t of this.targets)t.contains(e.initialTarget)&&(t.dispatchEvent(e),this.dispatched=!0)}}inertia(e,t,i,s,o,r,a,l){this.handle=jo(()=>{const c=Date.now(),d=c-t;let u=0,h=0,f=!0;i+=Rt.SCROLL_FRICTION*d,r+=Rt.SCROLL_FRICTION*d,i>0&&(f=!1,u=s*i*d),r>0&&(f=!1,h=a*r*d);const g=this.newGestureEvent(Pt.Change);g.translationX=u,g.translationY=h,e.forEach(p=>p.dispatchEvent(g)),f||this.inertia(e,c,i,s,o+u,r,a,l+h)})}onTouchMove(e){const t=Date.now();for(let i=0,s=e.changedTouches.length;i3&&(r.rollingPageX.shift(),r.rollingPageY.shift(),r.rollingTimestamps.shift()),r.rollingPageX.push(o.pageX),r.rollingPageY.push(o.pageY),r.rollingTimestamps.push(t)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}}Rt.SCROLL_FRICTION=-.005;Rt.HOLD_DELAY=700;Rt.CLEAR_TAP_COUNT_TIME=400;Gbe([Di],Rt,"isTouchDevice",null);class lD{constructor(){this._hooks=new pe,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;const i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,i,s,o){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=s,this._onStopCallback=o;let r=e;try{e.setPointerCapture(t),this._hooks.add(Ye(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{r=window}this._hooks.add(K(r,de.POINTER_MOVE,a=>{if(a.buttons!==i){this.stopMonitoring(!0);return}a.preventDefault(),this._pointerMoveCallback(a)})),this._hooks.add(K(r,de.POINTER_UP,a=>this.stopMonitoring(!0)))}}function u3(n){return`--vscode-${n.replace(/\./g,"-")}`}function re(n){return`var(${u3(n)})`}function Kbe(n,e){return`var(${u3(n)}, ${e})`}const Uj={ColorContribution:"base.contributions.colors"};class Ybe{constructor(){this._onDidChangeSchema=new B,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,i,s=!1,o){const r={id:e,description:i,defaults:t,needsTransparency:s,deprecationMessage:o};this.colorsById[e]=r;const a={type:"string",description:i,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return o&&(a.deprecationMessage=o),this.colorSchema.properties[e]=a,this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(i),this._onDidChangeSchema.fire(),e}getColors(){return Object.keys(this.colorsById).map(e=>this.colorsById[e])}resolveDefaultColor(e,t){const i=this.colorsById[e];if(i&&i.defaults){const s=i.defaults[t.type];return Wr(s,t)}}getColorSchema(){return this.colorSchema}toString(){const e=(t,i)=>{const s=t.indexOf(".")===-1?0:1,o=i.indexOf(".")===-1?0:1;return s!==o?s-o:t.localeCompare(i)};return Object.keys(this.colorsById).sort(e).map(t=>`- \`${t}\`: ${this.colorsById[t].description}`).join(` +`)}}const cD=new Ybe;pn.add(Uj.ColorContribution,cD);function E(n,e,t,i,s){return cD.registerColor(n,e,t,i,s)}const ee=E("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},m("foreground","Overall foreground color. This color is only used if not overridden by a component."));E("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},m("disabledForeground","Overall foreground for disabled elements. This color is only used if not overridden by a component."));const Zbe=E("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},m("errorForeground","Overall foreground color for error messages. This color is only used if not overridden by a component."));E("descriptionForeground",{light:"#717171",dark:we(ee,.7),hcDark:we(ee,.7),hcLight:we(ee,.7)},m("descriptionForeground","Foreground color for description text providing additional information, for example for a label."));const hd=E("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},m("iconForeground","The default color for icons in the workbench.")),vo=E("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},m("focusBorder","Overall border color for focused elements. This color is only used if not overridden by a component.")),Qe=E("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},m("contrastBorder","An extra border around elements to separate them from others for greater contrast.")),qt=E("contrastActiveBorder",{light:null,dark:null,hcDark:vo,hcLight:vo},m("activeContrastBorder","An extra border around active elements to separate them from others for greater contrast."));E("selection.background",{light:null,dark:null,hcDark:null,hcLight:null},m("selectionBackground","The background color of text selections in the workbench (e.g. for input fields or text areas). Note that this does not apply to selections within the editor."));E("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:H.black,hcLight:"#292929"},m("textSeparatorForeground","Color for text separators."));const Xbe=E("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},m("textLinkForeground","Foreground color for links in text."));E("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},m("textLinkActiveForeground","Foreground color for links in text when clicked on and on mouse hover."));E("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#D7BA7D",hcLight:"#292929"},m("textPreformatForeground","Foreground color for preformatted text segments."));E("textBlockQuote.background",{light:"#7f7f7f1a",dark:"#7f7f7f1a",hcDark:null,hcLight:"#F2F2F2"},m("textBlockQuoteBackground","Background color for block quotes in text."));E("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:H.white,hcLight:"#292929"},m("textBlockQuoteBorder","Border color for block quotes in text."));E("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:H.black,hcLight:"#F2F2F2"},m("textCodeBlockBackground","Background color for code blocks in text."));const Jl=E("widget.shadow",{dark:we(H.black,.36),light:we(H.black,.16),hcDark:null,hcLight:null},m("widgetShadow","Shadow color of widgets such as find/replace inside the editor.")),jj=E("widget.border",{dark:null,light:null,hcDark:Qe,hcLight:Qe},m("widgetBorder","Border color of widgets such as find/replace inside the editor.")),Qbe=E("input.background",{dark:"#3C3C3C",light:H.white,hcDark:H.black,hcLight:H.white},m("inputBoxBackground","Input box background.")),Jbe=E("input.foreground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("inputBoxForeground","Input box foreground.")),eve=E("input.border",{dark:null,light:null,hcDark:Qe,hcLight:Qe},m("inputBoxBorder","Input box border.")),h3=E("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:Qe,hcLight:Qe},m("inputBoxActiveOptionBorder","Border color of activated options in input fields."));E("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},m("inputOption.hoverBackground","Background color of activated options in input fields."));const kh=E("inputOption.activeBackground",{dark:we(vo,.4),light:we(vo,.2),hcDark:H.transparent,hcLight:H.transparent},m("inputOption.activeBackground","Background hover color of options in input fields.")),f3=E("inputOption.activeForeground",{dark:H.white,light:H.black,hcDark:ee,hcLight:ee},m("inputOption.activeForeground","Foreground color of activated options in input fields."));E("input.placeholderForeground",{light:we(ee,.5),dark:we(ee,.5),hcDark:we(ee,.7),hcLight:we(ee,.7)},m("inputPlaceholderForeground","Input box foreground color for placeholder text."));const tve=E("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:H.black,hcLight:H.white},m("inputValidationInfoBackground","Input validation background color for information severity.")),ive=E("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:ee},m("inputValidationInfoForeground","Input validation foreground color for information severity.")),nve=E("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:Qe,hcLight:Qe},m("inputValidationInfoBorder","Input validation border color for information severity.")),sve=E("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:H.black,hcLight:H.white},m("inputValidationWarningBackground","Input validation background color for warning severity.")),ove=E("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:ee},m("inputValidationWarningForeground","Input validation foreground color for warning severity.")),rve=E("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:Qe,hcLight:Qe},m("inputValidationWarningBorder","Input validation border color for warning severity.")),ave=E("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:H.black,hcLight:H.white},m("inputValidationErrorBackground","Input validation background color for error severity.")),lve=E("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:ee},m("inputValidationErrorForeground","Input validation foreground color for error severity.")),cve=E("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:Qe,hcLight:Qe},m("inputValidationErrorBorder","Input validation border color for error severity.")),Wa=E("dropdown.background",{dark:"#3C3C3C",light:H.white,hcDark:H.black,hcLight:H.white},m("dropdownBackground","Dropdown background.")),dve=E("dropdown.listBackground",{dark:null,light:null,hcDark:H.black,hcLight:H.white},m("dropdownListBackground","Dropdown list background.")),ec=E("dropdown.foreground",{dark:"#F0F0F0",light:ee,hcDark:H.white,hcLight:ee},m("dropdownForeground","Dropdown foreground.")),jg=E("dropdown.border",{dark:Wa,light:"#CECECE",hcDark:Qe,hcLight:Qe},m("dropdownBorder","Dropdown border.")),d_=E("button.foreground",{dark:H.white,light:H.white,hcDark:H.white,hcLight:H.white},m("buttonForeground","Button foreground color.")),uve=E("button.separator",{dark:we(d_,.4),light:we(d_,.4),hcDark:we(d_,.4),hcLight:we(d_,.4)},m("buttonSeparator","Button separator color.")),u_=E("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},m("buttonBackground","Button background color.")),hve=E("button.hoverBackground",{dark:ta(u_,.2),light:Zf(u_,.2),hcDark:u_,hcLight:u_},m("buttonHoverBackground","Button background color when hovering.")),fve=E("button.border",{dark:Qe,light:Qe,hcDark:Qe,hcLight:Qe},m("buttonBorder","Button border color.")),gve=E("button.secondaryForeground",{dark:H.white,light:H.white,hcDark:H.white,hcLight:ee},m("buttonSecondaryForeground","Secondary button foreground color.")),LT=E("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:H.white},m("buttonSecondaryBackground","Secondary button background color.")),pve=E("button.secondaryHoverBackground",{dark:ta(LT,.2),light:Zf(LT,.2),hcDark:null,hcLight:null},m("buttonSecondaryHoverBackground","Secondary button background color when hovering.")),gC=E("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:H.black,hcLight:"#0F4A85"},m("badgeBackground","Badge background color. Badges are small information labels, e.g. for search results count.")),mve=E("badge.foreground",{dark:H.white,light:"#333",hcDark:H.white,hcLight:H.white},m("badgeForeground","Badge foreground color. Badges are small information labels, e.g. for search results count.")),_ve=E("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},m("scrollbarShadow","Scrollbar shadow to indicate that the view is scrolled.")),h_=E("scrollbarSlider.background",{dark:H.fromHex("#797979").transparent(.4),light:H.fromHex("#646464").transparent(.4),hcDark:we(Qe,.6),hcLight:we(Qe,.4)},m("scrollbarSliderBackground","Scrollbar slider background color.")),f_=E("scrollbarSlider.hoverBackground",{dark:H.fromHex("#646464").transparent(.7),light:H.fromHex("#646464").transparent(.7),hcDark:we(Qe,.8),hcLight:we(Qe,.8)},m("scrollbarSliderHoverBackground","Scrollbar slider background color when hovering.")),g_=E("scrollbarSlider.activeBackground",{dark:H.fromHex("#BFBFBF").transparent(.4),light:H.fromHex("#000000").transparent(.6),hcDark:Qe,hcLight:Qe},m("scrollbarSliderActiveBackground","Scrollbar slider background color when clicked on.")),bve=E("progressBar.background",{dark:H.fromHex("#0E70C0"),light:H.fromHex("#0E70C0"),hcDark:Qe,hcLight:Qe},m("progressBarBackground","Background color of the progress bar that can show for long running operations."));E("editorError.background",{dark:null,light:null,hcDark:null,hcLight:null},m("editorError.background","Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const Va=E("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},m("editorError.foreground","Foreground color of error squigglies in the editor.")),vve=E("editorError.border",{dark:null,light:null,hcDark:H.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},m("errorBorder","If set, color of double underlines for errors in the editor."));E("editorWarning.background",{dark:null,light:null,hcDark:null,hcLight:null},m("editorWarning.background","Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const yo=E("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},m("editorWarning.foreground","Foreground color of warning squigglies in the editor.")),ov=E("editorWarning.border",{dark:null,light:null,hcDark:H.fromHex("#FFCC00").transparent(.8),hcLight:H.fromHex("#FFCC00").transparent(.8)},m("warningBorder","If set, color of double underlines for warnings in the editor."));E("editorInfo.background",{dark:null,light:null,hcDark:null,hcLight:null},m("editorInfo.background","Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0);const ks=E("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},m("editorInfo.foreground","Foreground color of info squigglies in the editor.")),rv=E("editorInfo.border",{dark:null,light:null,hcDark:H.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},m("infoBorder","If set, color of double underlines for infos in the editor.")),yve=E("editorHint.foreground",{dark:H.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},m("editorHint.foreground","Foreground color of hint squigglies in the editor."));E("editorHint.border",{dark:null,light:null,hcDark:H.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},m("hintBorder","If set, color of double underlines for hints in the editor."));E("sash.hoverBorder",{dark:vo,light:vo,hcDark:vo,hcLight:vo},m("sashActiveBorder","Border color of active sashes."));const Ki=E("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:H.black,hcLight:H.white},m("editorBackground","Editor background color.")),Iu=E("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:H.white,hcLight:ee},m("editorForeground","Editor default foreground color."));E("editorStickyScroll.background",{light:Ki,dark:Ki,hcDark:Ki,hcLight:Ki},m("editorStickyScrollBackground","Sticky scroll background color for the editor"));E("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:H.fromHex("#0F4A85").transparent(.1)},m("editorStickyScrollHoverBackground","Sticky scroll on hover background color for the editor"));const Hi=E("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:H.white},m("editorWidgetBackground","Background color of editor widgets, such as find/replace.")),za=E("editorWidget.foreground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("editorWidgetForeground","Foreground color of editor widgets, such as find/replace.")),qg=E("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:Qe,hcLight:Qe},m("editorWidgetBorder","Border color of editor widgets. The color is only used if the widget chooses to have a border and if the color is not overridden by a widget.")),wve=E("editorWidget.resizeBorder",{light:null,dark:null,hcDark:null,hcLight:null},m("editorWidgetResizeBorder","Border color of the resize bar of editor widgets. The color is only used if the widget chooses to have a resize border and if the color is not overridden by a widget.")),s7=E("quickInput.background",{dark:Hi,light:Hi,hcDark:Hi,hcLight:Hi},m("pickerBackground","Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),Cve=E("quickInput.foreground",{dark:za,light:za,hcDark:za,hcLight:za},m("pickerForeground","Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),Sve=E("quickInputTitle.background",{dark:new H(new ht(255,255,255,.105)),light:new H(new ht(0,0,0,.06)),hcDark:"#000000",hcLight:H.white},m("pickerTitleBackground","Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),qj=E("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:H.white,hcLight:"#0F4A85"},m("pickerGroupForeground","Quick picker color for grouping labels.")),xve=E("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:H.white,hcLight:"#0F4A85"},m("pickerGroupBorder","Quick picker color for grouping borders.")),Lve=E("keybindingLabel.background",{dark:new H(new ht(128,128,128,.17)),light:new H(new ht(221,221,221,.4)),hcDark:H.transparent,hcLight:H.transparent},m("keybindingLabelBackground","Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),Dve=E("keybindingLabel.foreground",{dark:H.fromHex("#CCCCCC"),light:H.fromHex("#555555"),hcDark:H.white,hcLight:ee},m("keybindingLabelForeground","Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),kve=E("keybindingLabel.border",{dark:new H(new ht(51,51,51,.6)),light:new H(new ht(204,204,204,.4)),hcDark:new H(new ht(111,195,223)),hcLight:Qe},m("keybindingLabelBorder","Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),Eve=E("keybindingLabel.bottomBorder",{dark:new H(new ht(68,68,68,.6)),light:new H(new ht(187,187,187,.4)),hcDark:new H(new ht(111,195,223)),hcLight:ee},m("keybindingLabelBottomBorder","Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),fd=E("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},m("editorSelectionBackground","Color of the editor selection.")),Ave=E("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:H.white},m("editorSelectionForeground","Color of the selected text for high contrast.")),Gj=E("editor.inactiveSelectionBackground",{light:we(fd,.5),dark:we(fd,.5),hcDark:we(fd,.7),hcLight:we(fd,.5)},m("editorInactiveSelection","Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),g3=E("editor.selectionHighlightBackground",{light:h7(fd,Ki,.3,.6),dark:h7(fd,Ki,.3,.6),hcDark:null,hcLight:null},m("editorSelectionHighlight","Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0);E("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:qt,hcLight:qt},m("editorSelectionHighlightBorder","Border color for regions with the same content as the selection."));const Ive=E("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},m("editorFindMatch","Color of the current search match.")),Ha=E("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},m("findMatchHighlight","Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0),Tve=E("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},m("findRangeHighlight","Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),Nve=E("editor.findMatchBorder",{light:null,dark:null,hcDark:qt,hcLight:qt},m("editorFindMatchBorder","Border color of the current search match.")),gd=E("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:qt,hcLight:qt},m("findMatchHighlightBorder","Border color of the other search matches.")),Rve=E("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:we(qt,.4),hcLight:we(qt,.4)},m("findRangeHighlightBorder","Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0);E("searchEditor.findMatchBackground",{light:we(Ha,.66),dark:we(Ha,.66),hcDark:Ha,hcLight:Ha},m("searchEditor.queryMatch","Color of the Search Editor query matches."));E("searchEditor.findMatchBorder",{light:we(gd,.66),dark:we(gd,.66),hcDark:gd,hcLight:gd},m("searchEditor.editorFindMatchBorder","Border color of the Search Editor query matches."));E("search.resultsInfoForeground",{light:ee,dark:we(ee,.65),hcDark:ee,hcLight:ee},m("search.resultsInfoForeground","Color of the text in the search viewlet's completion message."));E("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},m("hoverHighlight","Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."),!0);const o7=E("editorHoverWidget.background",{light:Hi,dark:Hi,hcDark:Hi,hcLight:Hi},m("hoverBackground","Background color of the editor hover."));E("editorHoverWidget.foreground",{light:za,dark:za,hcDark:za,hcLight:za},m("hoverForeground","Foreground color of the editor hover."));const Mve=E("editorHoverWidget.border",{light:qg,dark:qg,hcDark:qg,hcLight:qg},m("hoverBorder","Border color of the editor hover."));E("editorHoverWidget.statusBarBackground",{dark:ta(o7,.2),light:Zf(o7,.05),hcDark:Hi,hcLight:Hi},m("statusBarBackground","Background color of the editor hover status bar."));E("editorLink.activeForeground",{dark:"#4E94CE",light:H.blue,hcDark:H.cyan,hcLight:"#292929"},m("activeLinkForeground","Color of active links."));const pd=E("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:H.white,hcLight:H.black},m("editorInlayHintForeground","Foreground color of inline hints")),md=E("editorInlayHint.background",{dark:we(gC,.1),light:we(gC,.1),hcDark:we(H.white,.1),hcLight:we(gC,.1)},m("editorInlayHintBackground","Background color of inline hints"));E("editorInlayHint.typeForeground",{dark:pd,light:pd,hcDark:pd,hcLight:pd},m("editorInlayHintForegroundTypes","Foreground color of inline hints for types"));E("editorInlayHint.typeBackground",{dark:md,light:md,hcDark:md,hcLight:md},m("editorInlayHintBackgroundTypes","Background color of inline hints for types"));E("editorInlayHint.parameterForeground",{dark:pd,light:pd,hcDark:pd,hcLight:pd},m("editorInlayHintForegroundParameter","Foreground color of inline hints for parameters"));E("editorInlayHint.parameterBackground",{dark:md,light:md,hcDark:md,hcLight:md},m("editorInlayHintBackgroundParameter","Background color of inline hints for parameters"));E("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},m("editorLightBulbForeground","The color used for the lightbulb actions icon."));E("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},m("editorLightBulbAutoFixForeground","The color used for the lightbulb auto fix actions icon."));const DT=new H(new ht(155,185,85,.2)),kT=new H(new ht(255,0,0,.2)),Pve=E("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},m("diffEditorInserted","Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),Ove=E("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},m("diffEditorRemoved","Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);E("diffEditor.insertedLineBackground",{dark:DT,light:DT,hcDark:null,hcLight:null},m("diffEditorInsertedLines","Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0);E("diffEditor.removedLineBackground",{dark:kT,light:kT,hcDark:null,hcLight:null},m("diffEditorRemovedLines","Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0);E("diffEditorGutter.insertedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},m("diffEditorInsertedLineGutter","Background color for the margin where lines got inserted."));E("diffEditorGutter.removedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},m("diffEditorRemovedLineGutter","Background color for the margin where lines got removed."));const Fve=E("diffEditorOverview.insertedForeground",{dark:null,light:null,hcDark:null,hcLight:null},m("diffEditorOverviewInserted","Diff overview ruler foreground for inserted content.")),Bve=E("diffEditorOverview.removedForeground",{dark:null,light:null,hcDark:null,hcLight:null},m("diffEditorOverviewRemoved","Diff overview ruler foreground for removed content."));E("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},m("diffEditorInsertedOutline","Outline color for the text that got inserted."));E("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},m("diffEditorRemovedOutline","Outline color for text that got removed."));E("diffEditor.border",{dark:null,light:null,hcDark:Qe,hcLight:Qe},m("diffEditorBorder","Border color between the two text editors."));E("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},m("diffDiagonalFill","Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views."));E("diffEditor.unchangedRegionBackground",{dark:"#3e3e3e",light:"#e4e4e4",hcDark:null,hcLight:null},m("diffEditor.unchangedRegionBackground","The background color of unchanged blocks in the diff editor."));E("diffEditor.unchangedRegionForeground",{dark:"#a3a2a2",light:"#4d4c4c",hcDark:null,hcLight:null},m("diffEditor.unchangedRegionForeground","The foreground color of unchanged blocks in the diff editor."));E("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},m("diffEditor.unchangedCodeBackground","The background color of unchanged code in the diff editor."));const Wve=E("list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},m("listFocusBackground","List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),Vve=E("list.focusForeground",{dark:null,light:null,hcDark:null,hcLight:null},m("listFocusForeground","List/Tree foreground color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),zve=E("list.focusOutline",{dark:vo,light:vo,hcDark:qt,hcLight:qt},m("listFocusOutline","List/Tree outline color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),Hve=E("list.focusAndSelectionOutline",{dark:null,light:null,hcDark:null,hcLight:null},m("listFocusAndSelectionOutline","List/Tree outline color for the focused item when the list/tree is active and selected. An active list/tree has keyboard focus, an inactive does not.")),tc=E("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:H.fromHex("#0F4A85").transparent(.1)},m("listActiveSelectionBackground","List/Tree background color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),$a=E("list.activeSelectionForeground",{dark:H.white,light:H.white,hcDark:null,hcLight:null},m("listActiveSelectionForeground","List/Tree foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),p_=E("list.activeSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},m("listActiveSelectionIconForeground","List/Tree icon foreground color for the selected item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not.")),$ve=E("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:H.fromHex("#0F4A85").transparent(.1)},m("listInactiveSelectionBackground","List/Tree background color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),Uve=E("list.inactiveSelectionForeground",{dark:null,light:null,hcDark:null,hcLight:null},m("listInactiveSelectionForeground","List/Tree foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),jve=E("list.inactiveSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},m("listInactiveSelectionIconForeground","List/Tree icon foreground color for the selected item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),qve=E("list.inactiveFocusBackground",{dark:null,light:null,hcDark:null,hcLight:null},m("listInactiveFocusBackground","List/Tree background color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),Gve=E("list.inactiveFocusOutline",{dark:null,light:null,hcDark:null,hcLight:null},m("listInactiveFocusOutline","List/Tree outline color for the focused item when the list/tree is inactive. An active list/tree has keyboard focus, an inactive does not.")),Kj=E("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:H.white.transparent(.1),hcLight:H.fromHex("#0F4A85").transparent(.1)},m("listHoverBackground","List/Tree background when hovering over items using the mouse.")),Yj=E("list.hoverForeground",{dark:null,light:null,hcDark:null,hcLight:null},m("listHoverForeground","List/Tree foreground when hovering over items using the mouse.")),Kve=E("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},m("listDropBackground","List/Tree drag and drop background when moving items around using the mouse.")),qy=E("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:vo,hcLight:vo},m("highlight","List/Tree foreground color of the match highlights when searching inside the list/tree."));E("list.focusHighlightForeground",{dark:qy,light:x1e(tc,qy,"#BBE7FF"),hcDark:qy,hcLight:qy},m("listFocusHighlightForeground","List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree."));E("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},m("invalidItemForeground","List/Tree foreground color for invalid items, for example an unresolved root in explorer."));E("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},m("listErrorForeground","Foreground color of list items containing errors."));E("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},m("listWarningForeground","Foreground color of list items containing warnings."));const Yve=E("listFilterWidget.background",{light:Zf(Hi,0),dark:ta(Hi,0),hcDark:Hi,hcLight:Hi},m("listFilterWidgetBackground","Background color of the type filter widget in lists and trees.")),Zve=E("listFilterWidget.outline",{dark:H.transparent,light:H.transparent,hcDark:"#f38518",hcLight:"#007ACC"},m("listFilterWidgetOutline","Outline color of the type filter widget in lists and trees.")),Xve=E("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:Qe,hcLight:Qe},m("listFilterWidgetNoMatchesOutline","Outline color of the type filter widget in lists and trees, when there are no matches.")),Qve=E("listFilterWidget.shadow",{dark:Jl,light:Jl,hcDark:Jl,hcLight:Jl},m("listFilterWidgetShadow","Shadow color of the type filter widget in lists and trees."));E("list.filterMatchBackground",{dark:Ha,light:Ha,hcDark:null,hcLight:null},m("listFilterMatchHighlight","Background color of the filtered match."));E("list.filterMatchBorder",{dark:gd,light:gd,hcDark:Qe,hcLight:qt},m("listFilterMatchHighlightBorder","Border color of the filtered match."));const m_=E("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},m("treeIndentGuidesStroke","Tree stroke color for the indentation guides.")),Jve=E("tree.inactiveIndentGuidesStroke",{dark:we(m_,.4),light:we(m_,.4),hcDark:we(m_,.4),hcLight:we(m_,.4)},m("treeInactiveIndentGuidesStroke","Tree stroke color for the indentation guides that are not active.")),e1e=E("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},m("tableColumnsBorder","Table border color between columns.")),t1e=E("tree.tableOddRowsBackground",{dark:we(ee,.04),light:we(ee,.04),hcDark:null,hcLight:null},m("tableOddRowsBackgroundColor","Background color for odd table rows."));E("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},m("listDeemphasizedForeground","List/Tree foreground color for items that are deemphasized. "));const i1e=E("checkbox.background",{dark:Wa,light:Wa,hcDark:Wa,hcLight:Wa},m("checkbox.background","Background color of checkbox widget."));E("checkbox.selectBackground",{dark:Hi,light:Hi,hcDark:Hi,hcLight:Hi},m("checkbox.select.background","Background color of checkbox widget when the element it's in is selected."));const n1e=E("checkbox.foreground",{dark:ec,light:ec,hcDark:ec,hcLight:ec},m("checkbox.foreground","Foreground color of checkbox widget.")),s1e=E("checkbox.border",{dark:jg,light:jg,hcDark:jg,hcLight:jg},m("checkbox.border","Border color of checkbox widget."));E("checkbox.selectBorder",{dark:hd,light:hd,hcDark:hd,hcLight:hd},m("checkbox.select.border","Border color of checkbox widget when the element it's in is selected."));const r7=E("quickInput.list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},"",void 0,m("quickInput.list.focusBackground deprecation","Please use quickInputList.focusBackground instead")),ET=E("quickInputList.focusForeground",{dark:$a,light:$a,hcDark:$a,hcLight:$a},m("quickInput.listFocusForeground","Quick picker foreground color for the focused item.")),Zj=E("quickInputList.focusIconForeground",{dark:p_,light:p_,hcDark:p_,hcLight:p_},m("quickInput.listFocusIconForeground","Quick picker icon foreground color for the focused item.")),AT=E("quickInputList.focusBackground",{dark:av(r7,tc),light:av(r7,tc),hcDark:null,hcLight:null},m("quickInput.listFocusBackground","Quick picker background color for the focused item.")),o1e=E("menu.border",{dark:null,light:null,hcDark:Qe,hcLight:Qe},m("menuBorder","Border color of menus.")),r1e=E("menu.foreground",{dark:ec,light:ec,hcDark:ec,hcLight:ec},m("menuForeground","Foreground color of menu items.")),a1e=E("menu.background",{dark:Wa,light:Wa,hcDark:Wa,hcLight:Wa},m("menuBackground","Background color of menu items.")),l1e=E("menu.selectionForeground",{dark:$a,light:$a,hcDark:$a,hcLight:$a},m("menuSelectionForeground","Foreground color of the selected menu item in menus.")),c1e=E("menu.selectionBackground",{dark:tc,light:tc,hcDark:tc,hcLight:tc},m("menuSelectionBackground","Background color of the selected menu item in menus.")),d1e=E("menu.selectionBorder",{dark:null,light:null,hcDark:qt,hcLight:qt},m("menuSelectionBorder","Border color of the selected menu item in menus.")),u1e=E("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:Qe,hcLight:Qe},m("menuSeparatorBackground","Color of a separator menu item in menus.")),IT=E("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},m("toolbarHoverBackground","Toolbar background when hovering over actions using the mouse"));E("toolbar.hoverOutline",{dark:null,light:null,hcDark:qt,hcLight:qt},m("toolbarHoverOutline","Toolbar outline when hovering over actions using the mouse"));E("toolbar.activeBackground",{dark:ta(IT,.1),light:Zf(IT,.1),hcDark:null,hcLight:null},m("toolbarActiveBackground","Toolbar background when holding the mouse over actions"));E("editor.snippetTabstopHighlightBackground",{dark:new H(new ht(124,124,124,.3)),light:new H(new ht(10,50,100,.2)),hcDark:new H(new ht(124,124,124,.3)),hcLight:new H(new ht(10,50,100,.2))},m("snippetTabstopHighlightBackground","Highlight background color of a snippet tabstop."));E("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hcDark:null,hcLight:null},m("snippetTabstopHighlightBorder","Highlight border color of a snippet tabstop."));E("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},m("snippetFinalTabstopHighlightBackground","Highlight background color of the final tabstop of a snippet."));E("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new H(new ht(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},m("snippetFinalTabstopHighlightBorder","Highlight border color of the final tabstop of a snippet."));const h1e=E("breadcrumb.foreground",{light:we(ee,.8),dark:we(ee,.8),hcDark:we(ee,.8),hcLight:we(ee,.8)},m("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),f1e=E("breadcrumb.background",{light:Ki,dark:Ki,hcDark:Ki,hcLight:Ki},m("breadcrumbsBackground","Background color of breadcrumb items.")),a7=E("breadcrumb.focusForeground",{light:Zf(ee,.2),dark:ta(ee,.1),hcDark:ta(ee,.1),hcLight:ta(ee,.1)},m("breadcrumbsFocusForeground","Color of focused breadcrumb items.")),g1e=E("breadcrumb.activeSelectionForeground",{light:Zf(ee,.2),dark:ta(ee,.1),hcDark:ta(ee,.1),hcLight:ta(ee,.1)},m("breadcrumbsSelectedForeground","Color of selected breadcrumb items."));E("breadcrumbPicker.background",{light:Hi,dark:Hi,hcDark:Hi,hcLight:Hi},m("breadcrumbsSelectedBackground","Background color of breadcrumb item picker."));const Xj=.5,l7=H.fromHex("#40C8AE").transparent(Xj),c7=H.fromHex("#40A6FF").transparent(Xj),d7=H.fromHex("#606060").transparent(.4),hr=.4,km=1,Gg=E("merge.currentHeaderBackground",{dark:l7,light:l7,hcDark:null,hcLight:null},m("mergeCurrentHeaderBackground","Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);E("merge.currentContentBackground",{dark:we(Gg,hr),light:we(Gg,hr),hcDark:we(Gg,hr),hcLight:we(Gg,hr)},m("mergeCurrentContentBackground","Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const Kg=E("merge.incomingHeaderBackground",{dark:c7,light:c7,hcDark:null,hcLight:null},m("mergeIncomingHeaderBackground","Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);E("merge.incomingContentBackground",{dark:we(Kg,hr),light:we(Kg,hr),hcDark:we(Kg,hr),hcLight:we(Kg,hr)},m("mergeIncomingContentBackground","Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const Yg=E("merge.commonHeaderBackground",{dark:d7,light:d7,hcDark:null,hcLight:null},m("mergeCommonHeaderBackground","Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);E("merge.commonContentBackground",{dark:we(Yg,hr),light:we(Yg,hr),hcDark:we(Yg,hr),hcLight:we(Yg,hr)},m("mergeCommonContentBackground","Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0);const Em=E("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},m("mergeBorder","Border color on headers and the splitter in inline merge-conflicts."));E("editorOverviewRuler.currentContentForeground",{dark:we(Gg,km),light:we(Gg,km),hcDark:Em,hcLight:Em},m("overviewRulerCurrentContentForeground","Current overview ruler foreground for inline merge-conflicts."));E("editorOverviewRuler.incomingContentForeground",{dark:we(Kg,km),light:we(Kg,km),hcDark:Em,hcLight:Em},m("overviewRulerIncomingContentForeground","Incoming overview ruler foreground for inline merge-conflicts."));E("editorOverviewRuler.commonContentForeground",{dark:we(Yg,km),light:we(Yg,km),hcDark:Em,hcLight:Em},m("overviewRulerCommonContentForeground","Common ancestor overview ruler foreground for inline merge-conflicts."));const p3=E("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:""},m("overviewRulerFindMatchForeground","Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0),__=E("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},m("overviewRulerSelectionHighlightForeground","Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),Zg=E("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},m("minimapFindMatchHighlight","Minimap marker color for find matches."),!0),dD=E("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},m("minimapSelectionOccurrenceHighlight","Minimap marker color for repeating editor selections."),!0),u7=E("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},m("minimapSelectionHighlight","Minimap marker color for the editor selection."),!0),p1e=E("minimap.infoHighlight",{dark:ks,light:ks,hcDark:rv,hcLight:rv},m("minimapInfo","Minimap marker color for infos.")),m1e=E("minimap.warningHighlight",{dark:yo,light:yo,hcDark:ov,hcLight:ov},m("overviewRuleWarning","Minimap marker color for warnings.")),_1e=E("minimap.errorHighlight",{dark:new H(new ht(255,18,18,.7)),light:new H(new ht(255,18,18,.7)),hcDark:new H(new ht(255,50,50,1)),hcLight:"#B5200D"},m("minimapError","Minimap marker color for errors.")),b1e=E("minimap.background",{dark:null,light:null,hcDark:null,hcLight:null},m("minimapBackground","Minimap background color.")),v1e=E("minimap.foregroundOpacity",{dark:H.fromHex("#000f"),light:H.fromHex("#000f"),hcDark:H.fromHex("#000f"),hcLight:H.fromHex("#000f")},m("minimapForegroundOpacity",'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.'));E("minimapSlider.background",{light:we(h_,.5),dark:we(h_,.5),hcDark:we(h_,.5),hcLight:we(h_,.5)},m("minimapSliderBackground","Minimap slider background color."));E("minimapSlider.hoverBackground",{light:we(f_,.5),dark:we(f_,.5),hcDark:we(f_,.5),hcLight:we(f_,.5)},m("minimapSliderHoverBackground","Minimap slider background color when hovering."));E("minimapSlider.activeBackground",{light:we(g_,.5),dark:we(g_,.5),hcDark:we(g_,.5),hcLight:we(g_,.5)},m("minimapSliderActiveBackground","Minimap slider background color when clicked on."));const y1e=E("problemsErrorIcon.foreground",{dark:Va,light:Va,hcDark:Va,hcLight:Va},m("problemsErrorIconForeground","The color used for the problems error icon.")),w1e=E("problemsWarningIcon.foreground",{dark:yo,light:yo,hcDark:yo,hcLight:yo},m("problemsWarningIconForeground","The color used for the problems warning icon.")),C1e=E("problemsInfoIcon.foreground",{dark:ks,light:ks,hcDark:ks,hcLight:ks},m("problemsInfoIconForeground","The color used for the problems info icon."));E("charts.foreground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("chartsForeground","The foreground color used in charts."));E("charts.lines",{dark:we(ee,.5),light:we(ee,.5),hcDark:we(ee,.5),hcLight:we(ee,.5)},m("chartsLines","The color used for horizontal lines in charts."));E("charts.red",{dark:Va,light:Va,hcDark:Va,hcLight:Va},m("chartsRed","The red color used in chart visualizations."));E("charts.blue",{dark:ks,light:ks,hcDark:ks,hcLight:ks},m("chartsBlue","The blue color used in chart visualizations."));E("charts.yellow",{dark:yo,light:yo,hcDark:yo,hcLight:yo},m("chartsYellow","The yellow color used in chart visualizations."));E("charts.orange",{dark:Zg,light:Zg,hcDark:Zg,hcLight:Zg},m("chartsOrange","The orange color used in chart visualizations."));E("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},m("chartsGreen","The green color used in chart visualizations."));E("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},m("chartsPurple","The purple color used in chart visualizations."));function S1e(n,e){var t,i,s,o;switch(n.op){case 0:return(t=Wr(n.value,e))===null||t===void 0?void 0:t.darken(n.factor);case 1:return(i=Wr(n.value,e))===null||i===void 0?void 0:i.lighten(n.factor);case 2:return(s=Wr(n.value,e))===null||s===void 0?void 0:s.transparent(n.factor);case 3:{const r=Wr(n.background,e);return r?(o=Wr(n.value,e))===null||o===void 0?void 0:o.makeOpaque(r):Wr(n.value,e)}case 4:for(const r of n.values){const a=Wr(r,e);if(a)return a}return;case 6:return Wr(e.defines(n.if)?n.then:n.else,e);case 5:{const r=Wr(n.value,e);if(!r)return;const a=Wr(n.background,e);return a?r.isDarkerThan(a)?H.getLighterColor(r,a,n.factor).transparent(n.transparency):H.getDarkerColor(r,a,n.factor).transparent(n.transparency):r.transparent(n.factor*n.transparency)}default:throw q4()}}function Zf(n,e){return{op:0,value:n,factor:e}}function ta(n,e){return{op:1,value:n,factor:e}}function we(n,e){return{op:2,value:n,factor:e}}function av(...n){return{op:4,values:n}}function x1e(n,e,t){return{op:6,if:n,then:e,else:t}}function h7(n,e,t,i){return{op:5,value:n,background:e,factor:t,transparency:i}}function Wr(n,e){if(n!==null){if(typeof n=="string")return n[0]==="#"?H.fromHex(n):e.getColor(n);if(n instanceof H)return n;if(typeof n=="object")return S1e(n,e)}}const Qj="vscode://schemas/workbench-colors",Jj=pn.as(nD.JSONContribution);Jj.registerSchema(Qj,cD.getColorSchema());const f7=new Li(()=>Jj.notifySchemaChanged(Qj),200);cD.onDidChangeSchema(()=>{f7.isScheduled()||f7.schedule()});class uD{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(){return new eq(this.x-window.scrollX,this.y-window.scrollY)}}class eq{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(){return new uD(this.clientX+window.scrollX,this.clientY+window.scrollY)}}class L1e{constructor(e,t,i,s){this.x=e,this.y=t,this.width=i,this.height=s,this._editorPagePositionBrand=void 0}}class D1e{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function m3(n){const e=Tn(n);return new L1e(e.left,e.top,e.width,e.height)}function _3(n,e,t){const i=e.width/n.offsetWidth,s=e.height/n.offsetHeight,o=(t.x-e.x)/i,r=(t.y-e.y)/s;return new D1e(o,r)}class ru extends dr{constructor(e,t,i){super(e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new uD(this.posx,this.posy),this.editorPos=m3(i),this.relativePos=_3(i,this.editorPos,this.pos)}}class k1e{constructor(e){this._editorViewDomNode=e}_create(e){return new ru(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return K(e,"contextmenu",i=>{t(this._create(i))})}onMouseUp(e,t){return K(e,"mouseup",i=>{t(this._create(i))})}onMouseDown(e,t){return K(e,de.MOUSE_DOWN,i=>{t(this._create(i))})}onPointerDown(e,t){return K(e,de.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onMouseLeave(e,t){return K(e,de.MOUSE_LEAVE,i=>{t(this._create(i))})}onMouseMove(e,t){return K(e,"mousemove",i=>t(this._create(i)))}}class E1e{constructor(e){this._editorViewDomNode=e}_create(e){return new ru(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return K(e,"pointerup",i=>{t(this._create(i))})}onPointerDown(e,t){return K(e,de.POINTER_DOWN,i=>{t(this._create(i),i.pointerId)})}onPointerLeave(e,t){return K(e,de.POINTER_LEAVE,i=>{t(this._create(i))})}onPointerMove(e,t){return K(e,"pointermove",i=>t(this._create(i)))}}class A1e extends Y{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new lD),this._keydownListener=null}startMonitoring(e,t,i,s,o){this._keydownListener=Ui(e.ownerDocument,"keydown",r=>{r.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,r.browserEvent)},!0),this._globalPointerMoveMonitor.startMonitoring(e,t,i,r=>{s(new ru(r,!0,this._editorViewDomNode))},r=>{this._keydownListener.dispose(),o(r)})}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}class J1 extends Y{constructor(){super(),this._shouldRender=!0}shouldRender(){return this._shouldRender}forceShouldRender(){this._shouldRender=!0}setShouldRender(){this._shouldRender=!0}onDidRender(){this._shouldRender=!1}onCompositionStart(e){return!1}onCompositionEnd(e){return!1}onConfigurationChanged(e){return!1}onCursorStateChanged(e){return!1}onDecorationsChanged(e){return!1}onFlushed(e){return!1}onFocusChanged(e){return!1}onLanguageConfigurationChanged(e){return!1}onLineMappingChanged(e){return!1}onLinesChanged(e){return!1}onLinesDeleted(e){return!1}onLinesInserted(e){return!1}onRevealRangeRequest(e){return!1}onScrollChanged(e){return!1}onThemeChanged(e){return!1}onTokensChanged(e){return!1}onTokensColorsChanged(e){return!1}onZonesChanged(e){return!1}handleEvents(e){let t=!1;for(let i=0,s=e.length;i=a.left?s.width=Math.max(s.width,a.left+a.width-s.left):(t[i++]=s,s=a)}return t[i++]=s,t}static _createHorizontalRangesFromClientRects(e,t,i){if(!e||e.length===0)return null;const s=[];for(let o=0,r=e.length;ol)return null;if(t=Math.min(l,Math.max(0,t)),s=Math.min(l,Math.max(0,s)),t===s&&i===o&&i===0&&!e.children[t].firstChild){const h=e.children[t].getClientRects();return r.markDidDomLayout(),this._createHorizontalRangesFromClientRects(h,r.clientRectDeltaLeft,r.clientRectScale)}t!==s&&s>0&&o===0&&(s--,o=1073741824);let c=e.children[t].firstChild,d=e.children[s].firstChild;if((!c||!d)&&(!c&&i===0&&t>0&&(c=e.children[t-1].firstChild,i=1073741824),!d&&o===0&&s>0&&(d=e.children[s-1].firstChild,o=1073741824)),!c||!d)return null;i=Math.min(c.textContent.length,Math.max(0,i)),o=Math.min(d.textContent.length,Math.max(0,o));const u=this._readClientRects(c,i,d,o,r.endNode);return r.markDidDomLayout(),this._createHorizontalRangesFromClientRects(u,r.clientRectDeltaLeft,r.clientRectScale)}}var Oo;(function(n){n.DARK="dark",n.LIGHT="light",n.HIGH_CONTRAST_DARK="hcDark",n.HIGH_CONTRAST_LIGHT="hcLight"})(Oo||(Oo={}));function lc(n){return n===Oo.HIGH_CONTRAST_DARK||n===Oo.HIGH_CONTRAST_LIGHT}function fD(n){return n===Oo.DARK||n===Oo.HIGH_CONTRAST_DARK}const M1e=function(){return hp?!0:!(Xn||xr||bc)}();let Cp=!0;class p7{constructor(e,t){this.themeType=t;const i=e.options,s=i.get(50);i.get(38)==="off"?this.renderWhitespace=i.get(98):this.renderWhitespace="none",this.renderControlCharacters=i.get(93),this.spaceWidth=s.spaceWidth,this.middotWidth=s.middotWidth,this.wsmiddotWidth=s.wsmiddotWidth,this.useMonospaceOptimizations=s.isMonospace&&!i.get(33),this.canUseHalfwidthRightwardsArrow=s.canUseHalfwidthRightwardsArrow,this.lineHeight=i.get(66),this.stopRenderingLineAfter=i.get(116),this.fontLigatures=i.get(51)}equals(e){return this.themeType===e.themeType&&this.renderWhitespace===e.renderWhitespace&&this.renderControlCharacters===e.renderControlCharacters&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.useMonospaceOptimizations===e.useMonospaceOptimizations&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter&&this.fontLigatures===e.fontLigatures}}class Ia{constructor(e){this._options=e,this._isMaybeInvalid=!0,this._renderedViewLine=null}getDomNode(){return this._renderedViewLine&&this._renderedViewLine.domNode?this._renderedViewLine.domNode.domNode:null}setDomNode(e){if(this._renderedViewLine)this._renderedViewLine.domNode=bt(e);else throw new Error("I have no rendered view line to set the dom node to...")}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return lc(this._options.themeType)||this._options.renderWhitespace==="selection"?(this._isMaybeInvalid=!0,!0):!1}renderLine(e,t,i,s){if(this._isMaybeInvalid===!1)return!1;this._isMaybeInvalid=!1;const o=i.getViewLineRenderingData(e),r=this._options,a=ur.filter(o.inlineDecorations,e,o.minColumn,o.maxColumn);let l=null;if(lc(r.themeType)||this._options.renderWhitespace==="selection"){const h=i.selections;for(const f of h){if(f.endLineNumbere)continue;const g=f.startLineNumber===e?f.startColumn:o.minColumn,p=f.endLineNumber===e?f.endColumn:o.maxColumn;g');const d=a3(c,s);s.appendString("");let u=null;return Cp&&M1e&&o.isBasicASCII&&r.useMonospaceOptimizations&&d.containsForeignElements===0&&(u=new Gy(this._renderedViewLine?this._renderedViewLine.domNode:null,c,d.characterMapping)),u||(u=iq(this._renderedViewLine?this._renderedViewLine.domNode:null,c,d.characterMapping,d.containsRTL,d.containsForeignElements)),this._renderedViewLine=u,!0}layoutLine(e,t){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(this._options.lineHeight))}getWidth(e){return this._renderedViewLine?this._renderedViewLine.getWidth(e):0}getWidthIsFast(){return this._renderedViewLine?this._renderedViewLine.getWidthIsFast():!0}needsMonospaceFontCheck(){return this._renderedViewLine?this._renderedViewLine instanceof Gy:!1}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof Gy?this._renderedViewLine.monospaceAssumptionsAreValid():Cp}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof Gy&&(this._renderedViewLine=this._renderedViewLine.toSlowRenderedLine())}getVisibleRangesForRange(e,t,i,s){if(!this._renderedViewLine)return null;t=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,t)),i=Math.min(this._renderedViewLine.input.lineContent.length+1,Math.max(1,i));const o=this._renderedViewLine.input.stopRenderingLineAfter;if(o!==-1&&t>o+1&&i>o+1)return new g7(!0,[new Jh(this.getWidth(s),0)]);o!==-1&&t>o+1&&(t=o+1),o!==-1&&i>o+1&&(i=o+1);const r=this._renderedViewLine.getVisibleRangesForRange(e,t,i,s);return r&&r.length>0?new g7(!1,r):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}}Ia.CLASS_NAME="view-line";class Gy{constructor(e,t,i){this._cachedWidth=-1,this.domNode=e,this.input=t;const s=Math.floor(t.lineContent.length/300);if(s>0){this._keyColumnPixelOffsetCache=new Float32Array(s);for(let o=0;o=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),Cp=!1)}return Cp}toSlowRenderedLine(){return iq(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,t,i,s){const o=this._getColumnPixelOffset(e,t,s),r=this._getColumnPixelOffset(e,i,s);return[new Jh(o,r-o)]}_getColumnPixelOffset(e,t,i){if(t<=300){const c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}const s=Math.floor((t-1)/300)-1,o=(s+1)*300+1;let r=-1;if(this._keyColumnPixelOffsetCache&&(r=this._keyColumnPixelOffsetCache[s],r===-1&&(r=this._actualReadPixelOffset(e,o,i),this._keyColumnPixelOffsetCache[s]=r)),r===-1){const c=this._characterMapping.getHorizontalOffset(t);return this._charWidth*c}const a=this._characterMapping.getHorizontalOffset(o),l=this._characterMapping.getHorizontalOffset(t);return r+this._charWidth*(l-a)}_getReadingTarget(e){return e.domNode.firstChild}_actualReadPixelOffset(e,t,i){if(!this.domNode)return-1;const s=this._characterMapping.getDomPosition(t),o=pC.readHorizontalRanges(this._getReadingTarget(this.domNode),s.partIndex,s.charIndex,s.partIndex,s.charIndex,i);return!o||o.length===0?-1:o[0].left}getColumnOfNodeOffset(e,t){return nq(this._characterMapping,e,t)}}class tq{constructor(e,t,i,s,o){if(this.domNode=e,this.input=t,this._characterMapping=i,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=o,this._cachedWidth=-1,this._pixelOffsetCache=null,!s||this._characterMapping.length===0){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let r=0,a=this._characterMapping.length;r<=a;r++)this._pixelOffsetCache[r]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(e){return this.domNode?(this._cachedWidth===-1&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,e==null||e.markDidDomLayout()),this._cachedWidth):0}getWidthIsFast(){return this._cachedWidth!==-1}getVisibleRangesForRange(e,t,i,s){if(!this.domNode)return null;if(this._pixelOffsetCache!==null){const o=this._readPixelOffset(this.domNode,e,t,s);if(o===-1)return null;const r=this._readPixelOffset(this.domNode,e,i,s);return r===-1?null:[new Jh(o,r-o)]}return this._readVisibleRangesForRange(this.domNode,e,t,i,s)}_readVisibleRangesForRange(e,t,i,s,o){if(i===s){const r=this._readPixelOffset(e,t,i,o);return r===-1?null:[new Jh(r,0)]}else return this._readRawVisibleRangesForRange(e,i,s,o)}_readPixelOffset(e,t,i,s){if(this._characterMapping.length===0){if(this._containsForeignElements===0||this._containsForeignElements===2)return 0;if(this._containsForeignElements===1)return this.getWidth(s);const o=this._getReadingTarget(e);return o.firstChild?(s.markDidDomLayout(),o.firstChild.offsetWidth):0}if(this._pixelOffsetCache!==null){const o=this._pixelOffsetCache[i];if(o!==-1)return o;const r=this._actualReadPixelOffset(e,t,i,s);return this._pixelOffsetCache[i]=r,r}return this._actualReadPixelOffset(e,t,i,s)}_actualReadPixelOffset(e,t,i,s){if(this._characterMapping.length===0){const l=pC.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,s);return!l||l.length===0?-1:l[0].left}if(i===this._characterMapping.length&&this._isWhitespaceOnly&&this._containsForeignElements===0)return this.getWidth(s);const o=this._characterMapping.getDomPosition(i),r=pC.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,o.partIndex,o.charIndex,s);if(!r||r.length===0)return-1;const a=r[0].left;if(this.input.isBasicASCII){const l=this._characterMapping.getHorizontalOffset(i),c=Math.round(this.input.spaceWidth*l);if(Math.abs(c-a)<=1)return c}return a}_readRawVisibleRangesForRange(e,t,i,s){if(t===1&&i===this._characterMapping.length)return[new Jh(0,this.getWidth(s))];const o=this._characterMapping.getDomPosition(t),r=this._characterMapping.getDomPosition(i);return pC.readHorizontalRanges(this._getReadingTarget(e),o.partIndex,o.charIndex,r.partIndex,r.charIndex,s)}getColumnOfNodeOffset(e,t){return nq(this._characterMapping,e,t)}}class P1e extends tq{_readVisibleRangesForRange(e,t,i,s,o){const r=super._readVisibleRangesForRange(e,t,i,s,o);if(!r||r.length===0||i===s||i===1&&s===this._characterMapping.length)return r;if(!this.input.containsRTL){const a=this._readPixelOffset(e,t,s,o);if(a!==-1){const l=r[r.length-1];l.left=t){const u=t-r;return c-t=4&&e[0]===3&&e[3]===7}static isStrictChildOfViewLines(e){return e.length>4&&e[0]===3&&e[3]===7}static isChildOfScrollableElement(e){return e.length>=2&&e[0]===3&&e[1]===5}static isChildOfMinimap(e){return e.length>=2&&e[0]===3&&e[1]===8}static isChildOfContentWidgets(e){return e.length>=4&&e[0]===3&&e[3]===1}static isChildOfOverflowGuard(e){return e.length>=1&&e[0]===3}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&e[0]===2}static isChildOfOverlayWidgets(e){return e.length>=2&&e[0]===3&&e[1]===4}}class Am{constructor(e,t,i){this.viewModel=e.viewModel;const s=e.configuration.options;this.layoutInfo=s.get(143),this.viewDomNode=t.viewDomNode,this.lineHeight=s.get(66),this.stickyTabStops=s.get(115),this.typicalHalfwidthCharacterWidth=s.get(50).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return Am.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){const s=i.verticalOffset+i.height/2,o=e.viewModel.getLineCount();let r=null,a,l=null;return i.afterLineNumber!==o&&(l=new V(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(r=new V(i.afterLineNumber,e.viewModel.getLineMaxColumn(i.afterLineNumber))),l===null?a=r:r===null?a=l:t=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,bn._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class b3 extends W1e{constructor(e,t,i,s,o){super(e,t,i,s),this._ctx=e,o?(this.target=o,this.targetPath=sl.collect(o,e.viewDomNode)):(this.target=null,this.targetPath=new Uint8Array(0))}toString(){return`pos(${this.pos.x},${this.pos.y}), editorPos(${this.editorPos.x},${this.editorPos.y}), relativePos(${this.relativePos.x},${this.relativePos.y}), mouseVerticalOffset: ${this.mouseVerticalOffset}, mouseContentHorizontalOffset: ${this.mouseContentHorizontalOffset} + target: ${this.target?this.target.outerHTML:null}`}_getMouseColumn(e=null){return e&&e.columnr.contentLeft+r.width)continue;const a=e.getVerticalOffsetForLineNumber(r.position.lineNumber);if(a<=o&&o<=a+r.height)return t.fulfillContentText(r.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){const s=t.isInContentArea?8:5;return t.fulfillViewZone(s,i.position,i)}return null}static _hitTestTextArea(e,t){return ao.isTextArea(t.targetPath)?e.lastRenderData.lastTextareaPosition?t.fulfillContentText(e.lastRenderData.lastTextareaPosition,null,{mightBeForeignElement:!1,injectedText:null}):t.fulfillTextarea():null}static _hitTestMargin(e,t){if(t.isInMarginArea){const i=e.getFullLineRangeAtCoord(t.mouseVerticalOffset),s=i.range.getStartPosition();let o=Math.abs(t.relativePos.x);const r={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:o};return o-=e.layoutInfo.glyphMarginLeft,o<=e.layoutInfo.glyphMarginWidth?t.fulfillMargin(2,s,i.range,r):(o-=e.layoutInfo.glyphMarginWidth,o<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(3,s,i.range,r):(o-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(4,s,i.range,r)))}return null}static _hitTestViewLines(e,t,i){if(!ao.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new V(1,1),m7);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const o=e.viewModel.getLineCount(),r=e.viewModel.getLineMaxColumn(o);return t.fulfillContentEmpty(new V(o,r),m7)}if(i){if(ao.isStrictChildOfViewLines(t.targetPath)){const o=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(e.viewModel.getLineLength(o)===0){const a=e.getLineWidth(o),l=w2(t.mouseContentHorizontalOffset-a);return t.fulfillContentEmpty(new V(o,1),l)}const r=e.getLineWidth(o);if(t.mouseContentHorizontalOffset>=r){const a=w2(t.mouseContentHorizontalOffset-r),l=new V(o,e.viewModel.getLineMaxColumn(o));return t.fulfillContentEmpty(l,a)}}return t.fulfillUnknown()}const s=bn._doHitTest(e,t);return s.type===1?bn.createMouseTargetFromHitTestPosition(e,t,s.spanNode,s.position,s.injectedText):this._createMouseTarget(e,t.withTarget(s.hitTarget),!0)}static _hitTestMinimap(e,t){if(ao.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),s=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new V(i,s))}return null}static _hitTestScrollbarSlider(e,t){if(ao.isChildOfScrollableElement(t.targetPath)&&t.target&&t.target.nodeType===1){const i=t.target.className;if(i&&/\b(slider|scrollbar)\b/.test(i)){const s=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),o=e.viewModel.getLineMaxColumn(s);return t.fulfillScrollbar(new V(s,o))}}return null}static _hitTestScrollbar(e,t){if(ao.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),s=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new V(i,s))}return null}getMouseColumn(e){const t=this._context.configuration.options,i=t.get(143),s=this._context.viewLayout.getCurrentScrollLeft()+e.x-i.contentLeft;return bn._getMouseColumn(s,t.get(50).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){return e<0?1:Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,i,s,o){const r=s.lineNumber,a=s.column,l=e.getLineWidth(r);if(t.mouseContentHorizontalOffset>l){const v=w2(t.mouseContentHorizontalOffset-l);return t.fulfillContentEmpty(s,v)}const c=e.visibleRangeForPosition(r,a);if(!c)return t.fulfillUnknown(s);const d=c.left;if(Math.abs(t.mouseContentHorizontalOffset-d)<1)return t.fulfillContentText(s,null,{mightBeForeignElement:!!o,injectedText:o});const u=[];if(u.push({offset:c.left,column:a}),a>1){const v=e.visibleRangeForPosition(r,a-1);v&&u.push({offset:v.left,column:a-1})}const h=e.viewModel.getLineMaxColumn(r);if(av.offset-b.offset);const f=t.pos.toClientCoordinates(),g=i.getBoundingClientRect(),p=g.left<=f.clientX&&f.clientX<=g.right;let _=null;for(let v=1;vo)){const a=Math.floor((s+o)/2);let l=t.pos.y+(a-t.mouseVerticalOffset);l<=t.editorPos.y&&(l=t.editorPos.y+1),l>=t.editorPos.y+t.editorPos.height&&(l=t.editorPos.y+t.editorPos.height-1);const c=new uD(t.pos.x,l),d=this._actualDoHitTestWithCaretRangeFromPoint(e,c.toClientCoordinates());if(d.type===1)return d}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates())}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const i=wm(e.viewDomNode);let s;if(i?typeof i.caretRangeFromPoint>"u"?s=V1e(i,t.clientX,t.clientY):s=i.caretRangeFromPoint(t.clientX,t.clientY):s=e.viewDomNode.ownerDocument.caretRangeFromPoint(t.clientX,t.clientY),!s||!s.startContainer)return new Hc;const o=s.startContainer;if(o.nodeType===o.TEXT_NODE){const r=o.parentNode,a=r?r.parentNode:null,l=a?a.parentNode:null;return(l&&l.nodeType===l.ELEMENT_NODE?l.className:null)===Ia.CLASS_NAME?hh.createFromDOMInfo(e,r,s.startOffset):new Hc(o.parentNode)}else if(o.nodeType===o.ELEMENT_NODE){const r=o.parentNode,a=r?r.parentNode:null;return(a&&a.nodeType===a.ELEMENT_NODE?a.className:null)===Ia.CLASS_NAME?hh.createFromDOMInfo(e,o,o.textContent.length):new Hc(o)}return new Hc}static _doHitTestWithCaretPositionFromPoint(e,t){const i=e.viewDomNode.ownerDocument.caretPositionFromPoint(t.clientX,t.clientY);if(i.offsetNode.nodeType===i.offsetNode.TEXT_NODE){const s=i.offsetNode.parentNode,o=s?s.parentNode:null,r=o?o.parentNode:null;return(r&&r.nodeType===r.ELEMENT_NODE?r.className:null)===Ia.CLASS_NAME?hh.createFromDOMInfo(e,i.offsetNode.parentNode,i.offset):new Hc(i.offsetNode.parentNode)}if(i.offsetNode.nodeType===i.offsetNode.ELEMENT_NODE){const s=i.offsetNode.parentNode,o=s&&s.nodeType===s.ELEMENT_NODE?s.className:null,r=s?s.parentNode:null,a=r&&r.nodeType===r.ELEMENT_NODE?r.className:null;if(o===Ia.CLASS_NAME){const l=i.offsetNode.childNodes[Math.min(i.offset,i.offsetNode.childNodes.length-1)];if(l)return hh.createFromDOMInfo(e,l,0)}else if(a===Ia.CLASS_NAME)return hh.createFromDOMInfo(e,i.offsetNode,0)}return new Hc(i.offsetNode)}static _snapToSoftTabBoundary(e,t){const i=t.getLineContent(e.lineNumber),{tabSize:s}=t.model.getOptions(),o=lv.atomicPosition(i,e.column-1,s,2);return o!==-1?new V(e.lineNumber,o+1):e}static _doHitTest(e,t){let i=new Hc;if(typeof e.viewDomNode.ownerDocument.caretRangeFromPoint=="function"?i=this._doHitTestWithCaretRangeFromPoint(e,t):e.viewDomNode.ownerDocument.caretPositionFromPoint&&(i=this._doHitTestWithCaretPositionFromPoint(e,t.pos.toClientCoordinates())),i.type===1){const s=e.viewModel.getInjectedTextAt(i.position),o=e.viewModel.normalizePosition(i.position,2);(s||!o.equals(i.position))&&(i=new sq(o,i.spanNode,s))}return i}}function V1e(n,e,t){const i=document.createRange();let s=n.elementFromPoint(e,t);if(s!==null){for(;s&&s.firstChild&&s.firstChild.nodeType!==s.firstChild.TEXT_NODE&&s.lastChild&&s.lastChild.firstChild;)s=s.lastChild;const o=s.getBoundingClientRect(),r=window.getComputedStyle(s,null).getPropertyValue("font-style"),a=window.getComputedStyle(s,null).getPropertyValue("font-variant"),l=window.getComputedStyle(s,null).getPropertyValue("font-weight"),c=window.getComputedStyle(s,null).getPropertyValue("font-size"),d=window.getComputedStyle(s,null).getPropertyValue("line-height"),u=window.getComputedStyle(s,null).getPropertyValue("font-family"),h=`${r} ${a} ${l} ${c}/${d} ${u}`,f=s.innerText;let g=o.left,p=0,_;if(e>o.left+o.width)p=f.length;else{const v=Eh.getInstance();for(let b=0;bt(new dr(i))))}onmousedown(e,t){this._register(K(e,de.MOUSE_DOWN,i=>t(new dr(i))))}onmouseover(e,t){this._register(K(e,de.MOUSE_OVER,i=>t(new dr(i))))}onmouseleave(e,t){this._register(K(e,de.MOUSE_LEAVE,i=>t(new dr(i))))}onkeydown(e,t){this._register(K(e,de.KEY_DOWN,i=>t(new zt(i))))}onkeyup(e,t){this._register(K(e,de.KEY_UP,i=>t(new zt(i))))}oninput(e,t){this._register(K(e,de.INPUT,t))}onblur(e,t){this._register(K(e,de.BLUR,t))}onfocus(e,t){this._register(K(e,de.FOCUS,t))}ignoreGesture(e){return Rt.ignoreTarget(e)}};const Im=11;class z1e extends ua{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.classList.add(...Te.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width=Im+"px",this.domNode.style.height=Im+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new lD),this._register(Ui(this.bgDomNode,de.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Ui(this.domNode,de.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new Y1),this._pointerdownScheduleRepeatTimer=this._register(new Lc)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24)};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,i=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}}class H1e extends Y{constructor(e,t,i){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=i,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new Lc)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){const e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{var e;(e=this._domNode)===null||e===void 0||e.setClassName(this._visibleClassName)},0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)===null||t===void 0||t.setClassName(this._invisibleClassName+(e?" fade":"")))}}const $1e=140;class oq extends ua{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new H1e(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new lD),this._shouldRender=!0,this.domNode=bt(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(K(this.domNode.domNode,de.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){const t=this._register(new z1e(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,s){this.slider=bt(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof i=="number"&&this.slider.setWidth(i),typeof s=="number"&&this.slider.setHeight(s),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(K(this.slider.domNode,de.POINTER_DOWN,o=>{o.button===0&&(o.preventDefault(),this._sliderPointerDown(o))})),this.onclick(this.slider.domNode,o=>{o.leftButton&&o.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){const t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),s=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),o=this._sliderPointerPosition(e);i<=o&&o<=s?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,i=e.offsetY;else{const o=Tn(this.domNode.domNode);t=e.pageX-o.left,i=e.pageY-o.top}const s=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(s):this._scrollbarState.getDesiredScrollPositionFromOffset(s)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;const t=this._sliderPointerPosition(e),i=this._sliderOrthogonalPointerPosition(e),s=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,o=>{const r=this._sliderOrthogonalPointerPosition(o),a=Math.abs(r-i);if(Ps&&a>$1e){this._setDesiredScrollPositionNow(s.getScrollPosition());return}const c=this._sliderPointerPosition(o)-t;this._setDesiredScrollPositionNow(s.getDesiredScrollPositionFromDelta(c))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){const t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}}const U1e=20;class Tm{constructor(e,t,i,s,o,r){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=s,this._scrollSize=o,this._scrollPosition=r,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new Tm(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){const t=Math.round(e);return this._visibleSize!==t?(this._visibleSize=t,this._refreshComputedValues(),!0):!1}setScrollSize(e){const t=Math.round(e);return this._scrollSize!==t?(this._scrollSize=t,this._refreshComputedValues(),!0):!1}setScrollPosition(e){const t=Math.round(e);return this._scrollPosition!==t?(this._scrollPosition=t,this._refreshComputedValues(),!0):!1}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,i,s,o){const r=Math.max(0,i-e),a=Math.max(0,r-2*t),l=s>0&&s>i;if(!l)return{computedAvailableSize:Math.round(r),computedIsNeeded:l,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};const c=Math.round(Math.max(U1e,Math.floor(i*a/s))),d=(a-c)/(s-i),u=o*d;return{computedAvailableSize:Math.round(r),computedIsNeeded:l,computedSliderSize:Math.round(c),computedSliderRatio:d,computedSliderPosition:Math.round(u)}}_refreshComputedValues(){const e=Tm._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;const t=e-this._arrowSize;let i=this._scrollPosition;return tthis._host.onMouseWheel(new Cf(null,1,0))}),this._createArrow({className:"scra",icon:se.scrollbarButtonRight,top:a,left:void 0,bottom:void 0,right:r,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new Cf(null,-1,0))})}this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}}class q1e extends oq{constructor(e,t,i){const s=e.getScrollDimensions(),o=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new Tm(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,s.height,s.scrollHeight,o.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const r=(t.arrowSize-Im)/2,a=(t.verticalScrollbarSize-Im)/2;this._createArrow({className:"scra",icon:se.scrollbarButtonUp,top:r,left:a,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new Cf(null,0,1))}),this._createArrow({className:"scra",icon:se.scrollbarButtonDown,top:void 0,left:a,bottom:r,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new Cf(null,0,-1))})}this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}}class BS{constructor(e,t,i,s,o,r,a){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t=t|0,i=i|0,s=s|0,o=o|0,r=r|0,a=a|0),this.rawScrollLeft=s,this.rawScrollTop=a,t<0&&(t=0),s+t>i&&(s=i-t),s<0&&(s=0),o<0&&(o=0),a+o>r&&(a=r-o),a<0&&(a=0),this.width=t,this.scrollWidth=i,this.scrollLeft=s,this.height=o,this.scrollHeight=r,this.scrollTop=a}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,t){return new BS(this._forceIntegerValues,typeof e.width<"u"?e.width:this.width,typeof e.scrollWidth<"u"?e.scrollWidth:this.scrollWidth,t?this.rawScrollLeft:this.scrollLeft,typeof e.height<"u"?e.height:this.height,typeof e.scrollHeight<"u"?e.scrollHeight:this.scrollHeight,t?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new BS(this._forceIntegerValues,this.width,this.scrollWidth,typeof e.scrollLeft<"u"?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof e.scrollTop<"u"?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){const i=this.width!==e.width,s=this.scrollWidth!==e.scrollWidth,o=this.scrollLeft!==e.scrollLeft,r=this.height!==e.height,a=this.scrollHeight!==e.scrollHeight,l=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:i,scrollWidthChanged:s,scrollLeftChanged:o,heightChanged:r,scrollHeightChanged:a,scrollTopChanged:l}}}class ey extends Y{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new B),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new BS(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){var i;const s=this._state.withScrollDimensions(e,t);this._setState(s,!!this._smoothScrolling),(i=this._smoothScrolling)===null||i===void 0||i.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){const t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};const i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let s;t?s=new cv(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):s=this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=s}else{const i=this._state.withScrollPosition(e);this._smoothScrolling=cv.start(this._state,i,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;const e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){const i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}}class _7{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}}function C2(n,e){const t=e-n;return function(i){return n+t*Y1e(i)}}function G1e(n,e,t){return function(i){return i2.5*i){let o,r;return e0&&Math.abs(e.deltaY)>0)return 1;let t=.5;return this._front===-1&&this._rear===-1||this._memory[this._rear],(!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(t+=.25),Math.min(Math.max(t,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}}WS.INSTANCE=new WS;class v3 extends ua{get options(){return this._options}constructor(e,t,i){super(),this._onScroll=this._register(new B),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new B),e.style.overflow="hidden",this._options=Q1e(t),this._scrollable=i,this._register(this._scrollable.onScroll(o=>{this._onWillScroll.fire(o),this._onDidScroll(o),this._onScroll.fire(o)}));const s={onMouseWheel:o=>this._onMouseWheel(o),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new q1e(this._scrollable,this._options,s)),this._horizontalScrollbar=this._register(new j1e(this._scrollable,this._options,s)),this._domNode=document.createElement("div"),this._domNode.className="monaco-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.style.overflow="hidden",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=bt(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=bt(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=bt(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,o=>this._onMouseOver(o)),this.onmouseleave(this._listenOnDomNode,o=>this._onMouseLeave(o)),this._hideTimeout=this._register(new Lc),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=Ft(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,pt&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new Cf(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Ft(this._mouseWheelToDispose),e)){const i=s=>{this._onMouseWheel(new Cf(s))};this._mouseWheelToDispose.push(K(this._listenOnDomNode,de.MOUSE_WHEEL,i,{passive:!1}))}}_onMouseWheel(e){var t;if(!((t=e.browserEvent)===null||t===void 0)&&t.defaultPrevented)return;const i=WS.INSTANCE;i.acceptStandardWheelEvent(e);let s=!1;if(e.deltaY||e.deltaX){let r=e.deltaY*this._options.mouseWheelScrollSensitivity,a=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&a+r===0?a=r=0:Math.abs(r)>=Math.abs(a)?a=0:r=0),this._options.flipAxes&&([r,a]=[a,r]);const l=!pt&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||l)&&!a&&(a=r,r=0),e.browserEvent&&e.browserEvent.altKey&&(a=a*this._options.fastScrollSensitivity,r=r*this._options.fastScrollSensitivity);const c=this._scrollable.getFutureScrollPosition();let d={};if(r){const u=b7*r,h=c.scrollTop-(u<0?Math.floor(u):Math.ceil(u));this._verticalScrollbar.writeScrollPosition(d,h)}if(a){const u=b7*a,h=c.scrollLeft-(u<0?Math.floor(u):Math.ceil(u));this._horizontalScrollbar.writeScrollPosition(d,h)}d=this._scrollable.validateScrollPosition(d),(c.scrollLeft!==d.scrollLeft||c.scrollTop!==d.scrollTop)&&(this._options.mouseWheelSmoothScroll&&i.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(d):this._scrollable.setScrollPositionNow(d),s=!0)}let o=s;!o&&this._options.alwaysConsumeMouseWheel&&(o=!0),!o&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(o=!0),o&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){const e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,s=i?" left":"",o=t?" top":"",r=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${s}`),this._topShadowDomNode.setClassName(`shadow${o}`),this._topLeftShadowDomNode.setClassName(`shadow${r}${o}${s}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),Z1e)}}class rq extends v3{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new ey({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:s=>jo(s)});super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class y3 extends v3{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}}class w3 extends v3{constructor(e,t){t=t||{},t.mouseWheelSmoothScroll=!1;const i=new ey({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:s=>jo(s)});super(e,t,i),this._register(i),this._element=e,this._register(this.onScroll(s=>{s.scrollTopChanged&&(this._element.scrollTop=s.scrollTop),s.scrollLeftChanged&&(this._element.scrollLeft=s.scrollLeft)})),this.scanDomNode()}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}scanDomNode(){this.setScrollDimensions({width:this._element.clientWidth,scrollWidth:this._element.scrollWidth,height:this._element.clientHeight,scrollHeight:this._element.scrollHeight}),this.setScrollPosition({scrollLeft:this._element.scrollLeft,scrollTop:this._element.scrollTop})}}function Q1e(n){const e={lazyRender:typeof n.lazyRender<"u"?n.lazyRender:!1,className:typeof n.className<"u"?n.className:"",useShadows:typeof n.useShadows<"u"?n.useShadows:!0,handleMouseWheel:typeof n.handleMouseWheel<"u"?n.handleMouseWheel:!0,flipAxes:typeof n.flipAxes<"u"?n.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof n.consumeMouseWheelIfScrollbarIsNeeded<"u"?n.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof n.alwaysConsumeMouseWheel<"u"?n.alwaysConsumeMouseWheel:!1,scrollYToX:typeof n.scrollYToX<"u"?n.scrollYToX:!1,mouseWheelScrollSensitivity:typeof n.mouseWheelScrollSensitivity<"u"?n.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof n.fastScrollSensitivity<"u"?n.fastScrollSensitivity:5,scrollPredominantAxis:typeof n.scrollPredominantAxis<"u"?n.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof n.mouseWheelSmoothScroll<"u"?n.mouseWheelSmoothScroll:!0,arrowSize:typeof n.arrowSize<"u"?n.arrowSize:11,listenOnDomNode:typeof n.listenOnDomNode<"u"?n.listenOnDomNode:null,horizontal:typeof n.horizontal<"u"?n.horizontal:1,horizontalScrollbarSize:typeof n.horizontalScrollbarSize<"u"?n.horizontalScrollbarSize:10,horizontalSliderSize:typeof n.horizontalSliderSize<"u"?n.horizontalSliderSize:0,horizontalHasArrows:typeof n.horizontalHasArrows<"u"?n.horizontalHasArrows:!1,vertical:typeof n.vertical<"u"?n.vertical:1,verticalScrollbarSize:typeof n.verticalScrollbarSize<"u"?n.verticalScrollbarSize:10,verticalHasArrows:typeof n.verticalHasArrows<"u"?n.verticalHasArrows:!1,verticalSliderSize:typeof n.verticalSliderSize<"u"?n.verticalSliderSize:0,scrollByPage:typeof n.scrollByPage<"u"?n.scrollByPage:!1};return e.horizontalSliderSize=typeof n.horizontalSliderSize<"u"?n.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof n.verticalSliderSize<"u"?n.verticalSliderSize:e.verticalScrollbarSize,pt&&(e.className+=" mac"),e}class C3 extends J1{constructor(e,t,i){super(),this._mouseLeaveMonitor=null,this._context=e,this.viewController=t,this.viewHelper=i,this.mouseTargetFactory=new bn(this._context,i),this._mouseDownOperation=this._register(new J1e(this._context,this.viewController,this.viewHelper,this.mouseTargetFactory,(r,a)=>this._createMouseTarget(r,a),r=>this._getMouseColumn(r))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(143).height;const s=new k1e(this.viewHelper.viewDomNode);this._register(s.onContextMenu(this.viewHelper.viewDomNode,r=>this._onContextMenu(r,!0))),this._register(s.onMouseMove(this.viewHelper.viewDomNode,r=>{this._onMouseMove(r),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=K(this.viewHelper.viewDomNode.ownerDocument,"mousemove",a=>{this.viewHelper.viewDomNode.contains(a.target)||this._onMouseLeave(new ru(a,!1,this.viewHelper.viewDomNode))}))})),this._register(s.onMouseUp(this.viewHelper.viewDomNode,r=>this._onMouseUp(r))),this._register(s.onMouseLeave(this.viewHelper.viewDomNode,r=>this._onMouseLeave(r)));let o=0;this._register(s.onPointerDown(this.viewHelper.viewDomNode,(r,a)=>{o=a})),this._register(K(this.viewHelper.viewDomNode,de.POINTER_UP,r=>{this._mouseDownOperation.onPointerUp()})),this._register(s.onMouseDown(this.viewHelper.viewDomNode,r=>this._onMouseDown(r,o))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){const e=WS.INSTANCE;let t=0,i=Xc.getZoomLevel(),s=!1,o=0;const r=l=>{if(this.viewController.emitMouseWheel(l),!this._context.configuration.options.get(75))return;const c=new Cf(l);if(e.acceptStandardWheelEvent(c),e.isPhysicalMouseWheel()){if(a(l)){const d=Xc.getZoomLevel(),u=c.deltaY>0?1:-1;Xc.setZoomLevel(d+u),c.preventDefault(),c.stopPropagation()}}else Date.now()-t>50&&(i=Xc.getZoomLevel(),s=a(l),o=0),t=Date.now(),o+=c.deltaY,s&&(Xc.setZoomLevel(i+o/5),c.preventDefault(),c.stopPropagation())};this._register(K(this.viewHelper.viewDomNode,de.MOUSE_WHEEL,r,{capture:!0,passive:!1}));function a(l){return pt?(l.metaKey||l.ctrlKey)&&!l.shiftKey&&!l.altKey:l.ctrlKey&&!l.metaKey&&!l.shiftKey&&!l.altKey}}dispose(){this._context.removeEventHandler(this),this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(143)){const t=this._context.configuration.options.get(143).height;this._height!==t&&(this._height=t,this._mouseDownOperation.onHeightChanged())}return!1}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}getTargetAtClientPoint(e,t){const s=new eq(e,t).toPageCoordinates(),o=m3(this.viewHelper.viewDomNode);if(s.yo.y+o.height||s.xo.x+o.width)return null;const r=_3(this.viewHelper.viewDomNode,o,s);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),o,s,r,null)}_createMouseTarget(e,t){let i=e.target;if(!this.viewHelper.viewDomNode.contains(i)){const s=wm(this.viewHelper.viewDomNode);s&&(i=s.elementsFromPoint(e.posx,e.posy).find(o=>this.viewHelper.viewDomNode.contains(o)))}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?i:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.relativePos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){this.mouseTargetFactory.mouseTargetIsWidget(e)||e.preventDefault(),!(this._mouseDownOperation.isActive()||e.timestamp{e.preventDefault(),this.viewHelper.focusTextArea()};if(d&&(s||r&&a))u(),this._mouseDownOperation.start(i.type,e,t);else if(o)e.preventDefault();else if(l){const h=i.detail;d&&this.viewHelper.shouldSuppressMouseDownOnViewZone(h.viewZoneId)&&(u(),this._mouseDownOperation.start(i.type,e,t),e.preventDefault())}else c&&this.viewHelper.shouldSuppressMouseDownOnWidget(i.detail)&&(u(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:i})}}class J1e extends Y{constructor(e,t,i,s,o,r){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._mouseTargetFactory=s,this._createMouseTarget=o,this._getMouseColumn=r,this._mouseMoveMonitor=this._register(new A1e(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new eye(this._context,this._viewHelper,this._mouseTargetFactory,(a,l,c)=>this._dispatchMouse(a,l,c))),this._mouseState=new gD,this._currentSelection=new lt(1,1,1,1),this._isActive=!1,this._lastMouseEvent=null}dispose(){super.dispose()}isActive(){return this._isActive}_onMouseDownThenMove(e){this._lastMouseEvent=e,this._mouseState.setModifiers(e);const t=this._findMousePosition(e,!1);t&&(this._mouseState.isDragAndDrop?this._viewController.emitMouseDrag({event:e,target:t}):t.type===13&&(t.outsidePosition==="above"||t.outsidePosition==="below")?this._topBottomDragScrolling.start(t,e):(this._topBottomDragScrolling.stop(),this._dispatchMouse(t,!0,1)))}start(e,t,i){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(e===3),this._mouseState.setStartButtons(t),this._mouseState.setModifiers(t);const s=this._findMousePosition(t,!0);if(!s||!s.position)return;this._mouseState.trySetCount(t.detail,s.position),t.detail=this._mouseState.count;const o=this._context.configuration.options;if(!o.get(90)&&o.get(35)&&!o.get(22)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&s.type===6&&s.position&&this._currentSelection.containsPosition(s.position)){this._mouseState.isDragAndDrop=!0,this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,r=>this._onMouseDownThenMove(r),r=>{const a=this._findMousePosition(this._lastMouseEvent,!1);r&&r instanceof KeyboardEvent?this._viewController.emitMouseDropCanceled():this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:a?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()});return}this._mouseState.isDragAndDrop=!1,this._dispatchMouse(s,t.shiftKey,1),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,r=>this._onMouseDownThenMove(r),()=>this._stop()))}_stop(){this._isActive=!1,this._topBottomDragScrolling.stop()}onHeightChanged(){this._mouseMoveMonitor.stopMonitoring()}onPointerUp(){this._mouseMoveMonitor.stopMonitoring()}onCursorStateChanged(e){this._currentSelection=e.selections[0]}_getPositionOutsideEditor(e){const t=e.editorPos,i=this._context.viewModel,s=this._context.viewLayout,o=this._getMouseColumn(e);if(e.posyt.y+t.height){const a=e.posy-t.y-t.height,l=s.getCurrentScrollTop()+e.relativePos.y,c=Am.getZoneAtCoord(this._context,l);if(c){const u=this._helpPositionJumpOverViewZone(c);if(u)return qn.createOutsideEditor(o,u,"below",a)}const d=s.getLineNumberAtVerticalOffset(l);return qn.createOutsideEditor(o,new V(d,i.getLineMaxColumn(d)),"below",a)}const r=s.getLineNumberAtVerticalOffset(s.getCurrentScrollTop()+e.relativePos.y);if(e.posxt.x+t.width){const a=e.posx-t.x-t.width;return qn.createOutsideEditor(o,new V(r,i.getLineMaxColumn(r)),"right",a)}return null}_findMousePosition(e,t){const i=this._getPositionOutsideEditor(e);if(i)return i;const s=this._createMouseTarget(e,t);if(!s.position)return null;if(s.type===8||s.type===5){const r=this._helpPositionJumpOverViewZone(s.detail);if(r)return qn.createViewZone(s.type,s.element,s.mouseColumn,r,s.detail)}return s}_helpPositionJumpOverViewZone(e){const t=new V(this._currentSelection.selectionStartLineNumber,this._currentSelection.selectionStartColumn),i=e.positionBefore,s=e.positionAfter;return i&&s?i.isBefore(t)?i:s:null}_dispatchMouse(e,t,i){e.position&&this._viewController.dispatchMouse({position:e.position,mouseColumn:e.mouseColumn,startedOnLineNumbers:this._mouseState.startedOnLineNumbers,revealType:i,inSelectionMode:t,mouseDownCount:this._mouseState.count,altKey:this._mouseState.altKey,ctrlKey:this._mouseState.ctrlKey,metaKey:this._mouseState.metaKey,shiftKey:this._mouseState.shiftKey,leftButton:this._mouseState.leftButton,middleButton:this._mouseState.middleButton,onInjectedText:e.type===6&&e.detail.injectedText!==null})}}class eye extends Y{constructor(e,t,i,s){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=s,this._operation=null}dispose(){super.dispose(),this.stop()}start(e,t){this._operation?this._operation.setPosition(e,t):this._operation=new tye(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class tye extends Y{constructor(e,t,i,s,o,r){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=s,this._position=o,this._mouseEvent=r,this._lastTime=Date.now(),this._animationFrameDisposable=jo(()=>this._execute())}dispose(){this._animationFrameDisposable.dispose()}setPosition(e,t){this._position=e,this._mouseEvent=t}_tick(){const e=Date.now(),t=e-this._lastTime;return this._lastTime=e,t}_getScrollSpeed(){const e=this._context.configuration.options.get(66),t=this._context.configuration.options.get(143).height/e,i=this._position.outsideDistance/e;return i<=1.5?Math.max(30,t*(1+i)):i<=3?Math.max(60,t*(2+i)):Math.max(200,t*(7+i))}_execute(){const e=this._context.configuration.options.get(66),t=this._getScrollSpeed(),i=this._tick(),s=t*(i/1e3)*e,o=this._position.outsidePosition==="above"?-s:s;this._context.viewModel.viewLayout.deltaScrollNow(0,o),this._viewHelper.renderNow();const r=this._context.viewLayout.getLinesViewportData(),a=this._position.outsidePosition==="above"?r.startLineNumber:r.endLineNumber;let l;{const c=m3(this._viewHelper.viewDomNode),d=this._context.configuration.options.get(143).horizontalScrollbarHeight,u=new uD(this._mouseEvent.pos.x,c.y+c.height-d-.1),h=_3(this._viewHelper.viewDomNode,c,u);l=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),c,u,h,null)}(!l.position||l.position.lineNumber!==a)&&(this._position.outsidePosition==="above"?l=qn.createOutsideEditor(this._position.mouseColumn,new V(a,1),"above",this._position.outsideDistance):l=qn.createOutsideEditor(this._position.mouseColumn,new V(a,this._context.viewModel.getLineMaxColumn(a)),"below",this._position.outsideDistance)),this._dispatchMouse(l,!0,2),this._animationFrameDisposable=jo(()=>this._execute())}}class gD{get altKey(){return this._altKey}get ctrlKey(){return this._ctrlKey}get metaKey(){return this._metaKey}get shiftKey(){return this._shiftKey}get leftButton(){return this._leftButton}get middleButton(){return this._middleButton}get startedOnLineNumbers(){return this._startedOnLineNumbers}constructor(){this._altKey=!1,this._ctrlKey=!1,this._metaKey=!1,this._shiftKey=!1,this._leftButton=!1,this._middleButton=!1,this._startedOnLineNumbers=!1,this._lastMouseDownPosition=null,this._lastMouseDownPositionEqualCount=0,this._lastMouseDownCount=0,this._lastSetMouseDownCountTime=0,this.isDragAndDrop=!1}get count(){return this._lastMouseDownCount}setModifiers(e){this._altKey=e.altKey,this._ctrlKey=e.ctrlKey,this._metaKey=e.metaKey,this._shiftKey=e.shiftKey}setStartButtons(e){this._leftButton=e.leftButton,this._middleButton=e.middleButton}setStartedOnLineNumbers(e){this._startedOnLineNumbers=e}trySetCount(e,t){const i=new Date().getTime();i-this._lastSetMouseDownCountTime>gD.CLEAR_MOUSE_DOWN_COUNT_TIME&&(e=1),this._lastSetMouseDownCountTime=i,e>this._lastMouseDownCount+1&&(e=this._lastMouseDownCount+1),this._lastMouseDownPosition&&this._lastMouseDownPosition.equals(t)?this._lastMouseDownPositionEqualCount++:this._lastMouseDownPositionEqualCount=1,this._lastMouseDownPosition=t,this._lastMouseDownCount=Math.min(e,this._lastMouseDownPositionEqualCount)}}gD.CLEAR_MOUSE_DOWN_COUNT_TIME=400;class ot{get event(){return this.emitter.event}constructor(e,t,i){const s=o=>this.emitter.fire(o);this.emitter=new B({onWillAddFirstListener:()=>e.addEventListener(t,s,i),onDidRemoveLastListener:()=>e.removeEventListener(t,s,i)})}dispose(){this.emitter.dispose()}}var _d;(function(n){const e={total:0,min:Number.MAX_VALUE,max:0},t=Object.assign({},e),i=Object.assign({},e),s=Object.assign({},e);let o=0;const r={keydown:0,input:0,render:0};function a(){v(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),r.keydown=1,queueMicrotask(l)}n.onKeyDown=a;function l(){r.keydown===1&&(performance.mark("keydown/end"),r.keydown=2)}function c(){performance.mark("input/start"),r.input=1,_()}n.onBeforeInput=c;function d(){r.input===0&&c(),queueMicrotask(u)}n.onInput=d;function u(){r.input===1&&(performance.mark("input/end"),r.input=2)}function h(){v()}n.onKeyUp=h;function f(){v()}n.onSelectionChange=f;function g(){r.keydown===2&&r.input===2&&r.render===0&&(performance.mark("render/start"),r.render=1,queueMicrotask(p),_())}n.onRenderStart=g;function p(){r.render===1&&(performance.mark("render/end"),r.render=2)}function _(){setTimeout(v)}function v(){r.keydown===2&&r.input===2&&r.render===2&&(performance.mark("inputlatency/end"),performance.measure("keydown","keydown/start","keydown/end"),performance.measure("input","input/start","input/end"),performance.measure("render","render/start","render/end"),performance.measure("inputlatency","inputlatency/start","inputlatency/end"),b("keydown",e),b("input",t),b("render",i),b("inputlatency",s),o++,y())}function b(x,D){const k=performance.getEntriesByName(x)[0].duration;D.total+=k,D.min=Math.min(D.min,k),D.max=Math.max(D.max,k)}function y(){performance.clearMarks("keydown/start"),performance.clearMarks("keydown/end"),performance.clearMarks("input/start"),performance.clearMarks("input/end"),performance.clearMarks("render/start"),performance.clearMarks("render/end"),performance.clearMarks("inputlatency/start"),performance.clearMarks("inputlatency/end"),performance.clearMeasures("keydown"),performance.clearMeasures("input"),performance.clearMeasures("render"),performance.clearMeasures("inputlatency"),r.keydown=0,r.input=0,r.render=0}function w(){if(o===0)return;const x={keydown:S(e),input:S(t),render:S(i),total:S(s),sampleCount:o};return L(e),L(t),L(i),L(s),o=0,x}n.getAndClearMeasurements=w;function S(x){return{average:x.total/o,max:x.max,min:x.min}}function L(x){x.total=0,x.min=Number.MAX_VALUE,x.max=0}})(_d||(_d={}));class cn{constructor(e,t,i,s,o){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selection=s,this.newlineCountBeforeSelection=o}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){const i=e.getValue(),s=e.getSelectionStart(),o=e.getSelectionEnd();let r;if(t){const a=i.substring(0,s),l=t.value.substring(0,t.selectionStart);a===l&&(r=t.newlineCountBeforeSelection)}return new cn(i,s,o,null,r)}collapseSelection(){return this.selectionStart===this.value.length?this:new cn(this.value,this.value.length,this.value.length,null,void 0)}writeToTextArea(e,t,i){t.setValue(e,this.value),i&&t.setSelectionRange(e,this.selectionStart,this.selectionEnd)}deduceEditorPosition(e){var t,i,s,o,r,a,l,c;if(e<=this.selectionStart){const h=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition((i=(t=this.selection)===null||t===void 0?void 0:t.getStartPosition())!==null&&i!==void 0?i:null,h,-1)}if(e>=this.selectionEnd){const h=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition((o=(s=this.selection)===null||s===void 0?void 0:s.getEndPosition())!==null&&o!==void 0?o:null,h,1)}const d=this.value.substring(this.selectionStart,e);if(d.indexOf("…")===-1)return this._finishDeduceEditorPosition((a=(r=this.selection)===null||r===void 0?void 0:r.getStartPosition())!==null&&a!==void 0?a:null,d,1);const u=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition((c=(l=this.selection)===null||l===void 0?void 0:l.getEndPosition())!==null&&c!==void 0?c:null,u,-1)}_finishDeduceEditorPosition(e,t,i){let s=0,o=-1;for(;(o=t.indexOf(` +`,o+1))!==-1;)s++;return[e,i*t.length,s]}static deduceInput(e,t,i){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};const s=Math.min(wS(e.value,t.value),e.selectionStart,t.selectionStart),o=Math.min(ZI(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd);e.value.substring(s,e.value.length-o);const r=t.value.substring(s,t.value.length-o),a=e.selectionStart-s,l=e.selectionEnd-s,c=t.selectionStart-s,d=t.selectionEnd-s;if(c===d){const h=e.selectionStart-s;return{text:r,replacePrevCharCnt:h,replaceNextCharCnt:0,positionDelta:0}}const u=l-a;return{text:r,replacePrevCharCnt:u,replaceNextCharCnt:0,positionDelta:0}}static deduceAndroidCompositionInput(e,t){if(!e)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:0};if(e.value===t.value)return{text:"",replacePrevCharCnt:0,replaceNextCharCnt:0,positionDelta:t.selectionEnd-e.selectionEnd};const i=Math.min(wS(e.value,t.value),e.selectionEnd),s=Math.min(ZI(e.value,t.value),e.value.length-e.selectionEnd),o=e.value.substring(i,e.value.length-s),r=t.value.substring(i,t.value.length-s);e.selectionStart-i;const a=e.selectionEnd-i;t.selectionStart-i;const l=t.selectionEnd-i;return{text:r,replacePrevCharCnt:a,replaceNextCharCnt:o.length-a,positionDelta:l-r.length}}}cn.EMPTY=new cn("",0,0,null,void 0);class Xg{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const i=e*t,s=i+1,o=i+t;return new N(s,1,o+1,1)}static fromEditorSelection(e,t,i,s){const r=Xg._getPageOfLine(t.startLineNumber,i),a=Xg._getRangeForPage(r,i),l=Xg._getPageOfLine(t.endLineNumber,i),c=Xg._getRangeForPage(l,i);let d=a.intersectRanges(new N(1,1,t.startLineNumber,t.startColumn));if(s&&e.getValueLengthInRange(d,1)>500){const v=e.modifyPosition(d.getEndPosition(),-500);d=N.fromPositions(v,d.getEndPosition())}const u=e.getValueInRange(d,1),h=e.getLineCount(),f=e.getLineMaxColumn(h);let g=c.intersectRanges(new N(t.endLineNumber,t.endColumn,h,f));if(s&&e.getValueLengthInRange(g,1)>500){const v=e.modifyPosition(g.getStartPosition(),500);g=N.fromPositions(g.getStartPosition(),v)}const p=e.getValueInRange(g,1);let _;if(r===l||r+1===l)_=e.getValueInRange(t,1);else{const v=a.intersectRanges(t),b=c.intersectRanges(t);_=e.getValueInRange(v,1)+"…"+e.getValueInRange(b,1)}return s&&_.length>2*500&&(_=_.substring(0,500)+"…"+_.substring(_.length-500,_.length)),new cn(u+_+p,u.length,u.length+_.length,t,d.endLineNumber-d.startLineNumber)}}var VS;(function(n){n.Tap="-monaco-textarea-synthetic-tap"})(VS||(VS={}));class zS{constructor(){this._lastState=null}set(e,t){this._lastState={lastCopiedValue:e,data:t}}get(e){return this._lastState&&this._lastState.lastCopiedValue===e?this._lastState.data:(this._lastState=null,null)}}zS.INSTANCE=new zS;class iye{constructor(){this._lastTypeTextLength=0}handleCompositionUpdate(e){e=e||"";const t={text:e,replacePrevCharCnt:this._lastTypeTextLength,replaceNextCharCnt:0,positionDelta:0};return this._lastTypeTextLength=e.length,t}}class nye extends Y{get textAreaState(){return this._textAreaState}constructor(e,t,i,s){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=s,this._onFocus=this._register(new B),this.onFocus=this._onFocus.event,this._onBlur=this._register(new B),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new B),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new B),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new B),this.onCut=this._onCut.event,this._onPaste=this._register(new B),this.onPaste=this._onPaste.event,this._onType=this._register(new B),this.onType=this._onType.event,this._onCompositionStart=this._register(new B),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new B),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new B),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new B),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncTriggerCut=this._register(new Li(()=>this._onCut.fire(),0)),this._asyncFocusGainWriteScreenReaderContent=this._register(new Li(()=>this.writeScreenReaderContent("asyncFocusGain"),0)),this._textAreaState=cn.EMPTY,this._selectionChangeListener=null,this.writeScreenReaderContent("ctor"),this._hasFocus=!1,this._currentComposition=null;let o=null;this._register(this._textArea.onKeyDown(r=>{const a=new zt(r);(a.keyCode===114||this._currentComposition&&a.keyCode===1)&&a.stopPropagation(),a.equals(9)&&a.preventDefault(),o=a,this._onKeyDown.fire(a)})),this._register(this._textArea.onKeyUp(r=>{const a=new zt(r);this._onKeyUp.fire(a)})),this._register(this._textArea.onCompositionStart(r=>{const a=new iye;if(this._currentComposition){this._currentComposition=a;return}if(this._currentComposition=a,this._OS===2&&o&&o.equals(114)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===r.data&&(o.code==="ArrowRight"||o.code==="ArrowLeft")){a.handleCompositionUpdate("x"),this._onCompositionStart.fire({data:r.data});return}if(this._browser.isAndroid){this._onCompositionStart.fire({data:r.data});return}this._onCompositionStart.fire({data:r.data})})),this._register(this._textArea.onCompositionUpdate(r=>{const a=this._currentComposition;if(!a)return;if(this._browser.isAndroid){const c=cn.readFromTextArea(this._textArea,this._textAreaState),d=cn.deduceAndroidCompositionInput(this._textAreaState,c);this._textAreaState=c,this._onType.fire(d),this._onCompositionUpdate.fire(r);return}const l=a.handleCompositionUpdate(r.data);this._textAreaState=cn.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(l),this._onCompositionUpdate.fire(r)})),this._register(this._textArea.onCompositionEnd(r=>{const a=this._currentComposition;if(!a)return;if(this._currentComposition=null,this._browser.isAndroid){const c=cn.readFromTextArea(this._textArea,this._textAreaState),d=cn.deduceAndroidCompositionInput(this._textAreaState,c);this._textAreaState=c,this._onType.fire(d),this._onCompositionEnd.fire();return}const l=a.handleCompositionUpdate(r.data);this._textAreaState=cn.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(l),this._onCompositionEnd.fire()})),this._register(this._textArea.onInput(r=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._currentComposition)return;const a=cn.readFromTextArea(this._textArea,this._textAreaState),l=cn.deduceInput(this._textAreaState,a,this._OS===2);l.replacePrevCharCnt===0&&l.text.length===1&&(tn(l.text.charCodeAt(0))||l.text.charCodeAt(0)===127)||(this._textAreaState=a,(l.text!==""||l.replacePrevCharCnt!==0||l.replaceNextCharCnt!==0||l.positionDelta!==0)&&this._onType.fire(l))})),this._register(this._textArea.onCut(r=>{this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(r),this._asyncTriggerCut.schedule()})),this._register(this._textArea.onCopy(r=>{this._ensureClipboardGetsEditorSelection(r)})),this._register(this._textArea.onPaste(r=>{if(this._textArea.setIgnoreSelectionChangeTime("received paste event"),r.preventDefault(),!r.clipboardData)return;let[a,l]=v7.getTextData(r.clipboardData);a&&(l=l||zS.INSTANCE.get(a),this._onPaste.fire({text:a,metadata:l}))})),this._register(this._textArea.onFocus(()=>{const r=this._hasFocus;this._setHasFocus(!0),this._browser.isSafari&&!r&&this._hasFocus&&this._asyncFocusGainWriteScreenReaderContent.schedule()})),this._register(this._textArea.onBlur(()=>{this._currentComposition&&(this._currentComposition=null,this.writeScreenReaderContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)})),this._register(this._textArea.onSyntheticTap(()=>{this._browser.isAndroid&&this._currentComposition&&(this._currentComposition=null,this.writeScreenReaderContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())}))}_installSelectionChangeListener(){let e=0;return K(this._textArea.ownerDocument,"selectionchange",t=>{if(_d.onSelectionChange(),!this._hasFocus||this._currentComposition||!this._browser.isChrome)return;const i=Date.now(),s=i-e;if(e=i,s<5)return;const o=i-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),o<100||!this._textAreaState.selection)return;const r=this._textArea.getValue();if(this._textAreaState.value!==r)return;const a=this._textArea.getSelectionStart(),l=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===a&&this._textAreaState.selectionEnd===l)return;const c=this._textAreaState.deduceEditorPosition(a),d=this._host.deduceModelPosition(c[0],c[1],c[2]),u=this._textAreaState.deduceEditorPosition(l),h=this._host.deduceModelPosition(u[0],u[1],u[2]),f=new lt(d.lineNumber,d.column,h.lineNumber,h.column);this._onSelectionChangeRequest.fire(f)})}dispose(){super.dispose(),this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null)}focusTextArea(){this._setHasFocus(!0),this.refreshFocusState()}isFocused(){return this._hasFocus}refreshFocusState(){this._setHasFocus(this._textArea.hasFocus())}_setHasFocus(e){this._hasFocus!==e&&(this._hasFocus=e,this._selectionChangeListener&&(this._selectionChangeListener.dispose(),this._selectionChangeListener=null),this._hasFocus&&(this._selectionChangeListener=this._installSelectionChangeListener()),this._hasFocus&&this.writeScreenReaderContent("focusgain"),this._hasFocus?this._onFocus.fire():this._onBlur.fire())}_setAndWriteTextAreaState(e,t){this._hasFocus||(t=t.collapseSelection()),t.writeToTextArea(e,this._textArea,this._hasFocus),this._textAreaState=t}writeScreenReaderContent(e){this._currentComposition||this._setAndWriteTextAreaState(e,this._host.getScreenReaderContent())}_ensureClipboardGetsEditorSelection(e){const t=this._host.getDataToCopy(),i={version:1,isFromEmptySelection:t.isFromEmptySelection,multicursorText:t.multicursorText,mode:t.mode};zS.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,` +`):t.text,i),e.preventDefault(),e.clipboardData&&v7.setTextData(e.clipboardData,t.text,t.html,i)}}const v7={getTextData(n){const e=n.getData(Ul.text);let t=null;const i=n.getData("vscode-editor-data");if(typeof i=="string")try{t=JSON.parse(i),t.version!==1&&(t=null)}catch{}return e.length===0&&t===null&&n.files.length>0?[Array.prototype.slice.call(n.files,0).map(o=>o.name).join(` +`),null]:[e,t]},setTextData(n,e,t,i){n.setData(Ul.text,e),typeof t=="string"&&n.setData("text/html",t),n.setData("vscode-editor-data",JSON.stringify(i))}};class sye extends Y{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new ot(this._actual,"keydown")).event,this.onKeyUp=this._register(new ot(this._actual,"keyup")).event,this.onCompositionStart=this._register(new ot(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new ot(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new ot(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new ot(this._actual,"beforeinput")).event,this.onInput=this._register(new ot(this._actual,"input")).event,this.onCut=this._register(new ot(this._actual,"cut")).event,this.onCopy=this._register(new ot(this._actual,"copy")).event,this.onPaste=this._register(new ot(this._actual,"paste")).event,this.onFocus=this._register(new ot(this._actual,"focus")).event,this.onBlur=this._register(new ot(this._actual,"blur")).event,this._onSyntheticTap=this._register(new B),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown(()=>_d.onKeyDown())),this._register(this.onBeforeInput(()=>_d.onBeforeInput())),this._register(this.onInput(()=>_d.onInput())),this._register(this.onKeyUp(()=>_d.onKeyUp())),this._register(K(this._actual,VS.Tap,()=>this._onSyntheticTap.fire()))}hasFocus(){const e=wm(this._actual);return e?e.activeElement===this._actual:Y4(this._actual)?this._actual.ownerDocument.activeElement===this._actual:!1}setIgnoreSelectionChangeTime(e){this._ignoreSelectionChangeTime=Date.now()}getIgnoreSelectionChangeTime(){return this._ignoreSelectionChangeTime}resetSelectionChangeTime(){this._ignoreSelectionChangeTime=0}getValue(){return this._actual.value}setValue(e,t){const i=this._actual;i.value!==t&&(this.setIgnoreSelectionChangeTime("setValue"),i.value=t)}getSelectionStart(){return this._actual.selectionDirection==="backward"?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return this._actual.selectionDirection==="backward"?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,t,i){const s=this._actual;let o=null;const r=wm(s);r?o=r.activeElement:o=s.ownerDocument.activeElement;const a=o===s,l=s.selectionStart,c=s.selectionEnd;if(a&&l===t&&c===i){xr&&window.parent!==window&&s.focus();return}if(a){this.setIgnoreSelectionChangeTime("setSelectionRange"),s.setSelectionRange(t,i),xr&&window.parent!==window&&s.focus();return}try{const d=Pme(s);this.setIgnoreSelectionChangeTime("setSelectionRange"),s.focus(),s.setSelectionRange(t,i),Ome(s,d)}catch{}}}class oye extends C3{constructor(e,t,i){super(e,t,i),this._register(Rt.addTarget(this.viewHelper.linesContentDomNode)),this._register(K(this.viewHelper.linesContentDomNode,Pt.Tap,o=>this.onTap(o))),this._register(K(this.viewHelper.linesContentDomNode,Pt.Change,o=>this.onChange(o))),this._register(K(this.viewHelper.linesContentDomNode,Pt.Contextmenu,o=>this._onContextMenu(new ru(o,!1,this.viewHelper.viewDomNode),!1))),this._lastPointerType="mouse",this._register(K(this.viewHelper.linesContentDomNode,"pointerdown",o=>{const r=o.pointerType;if(r==="mouse"){this._lastPointerType="mouse";return}else r==="touch"?this._lastPointerType="touch":this._lastPointerType="pen"}));const s=new E1e(this.viewHelper.viewDomNode);this._register(s.onPointerMove(this.viewHelper.viewDomNode,o=>this._onMouseMove(o))),this._register(s.onPointerUp(this.viewHelper.viewDomNode,o=>this._onMouseUp(o))),this._register(s.onPointerLeave(this.viewHelper.viewDomNode,o=>this._onMouseLeave(o))),this._register(s.onPointerDown(this.viewHelper.viewDomNode,(o,r)=>this._onMouseDown(o,r)))}onTap(e){if(!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget))return;e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new ru(e,!1,this.viewHelper.viewDomNode),!1);t.position&&this.viewController.dispatchMouse({position:t.position,mouseColumn:t.position.column,startedOnLineNumbers:!1,revealType:1,mouseDownCount:e.tapCount,inSelectionMode:!1,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:t.type===6&&t.detail.injectedText!==null})}onChange(e){this._lastPointerType==="touch"&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}_onMouseDown(e,t){e.browserEvent.pointerType!=="touch"&&super._onMouseDown(e,t)}}class rye extends C3{constructor(e,t,i){super(e,t,i),this._register(Rt.addTarget(this.viewHelper.linesContentDomNode)),this._register(K(this.viewHelper.linesContentDomNode,Pt.Tap,s=>this.onTap(s))),this._register(K(this.viewHelper.linesContentDomNode,Pt.Change,s=>this.onChange(s))),this._register(K(this.viewHelper.linesContentDomNode,Pt.Contextmenu,s=>this._onContextMenu(new ru(s,!1,this.viewHelper.viewDomNode),!1)))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new ru(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const i=document.createEvent("CustomEvent");i.initEvent(VS.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(i),this.viewController.moveTo(t.position,1)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class aye extends Y{constructor(e,t,i){super(),eu&&K4.pointerEvents?this.handler=this._register(new oye(e,t,i)):window.TouchEvent?this.handler=this._register(new rye(e,t,i)):this.handler=this._register(new C3(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}class Xf extends J1{}const ro=rt("themeService");function sn(n){return{id:n}}function TT(n){switch(n){case Oo.DARK:return"vs-dark";case Oo.HIGH_CONTRAST_DARK:return"hc-black";case Oo.HIGH_CONTRAST_LIGHT:return"hc-light";default:return"vs"}}const aq={ThemingContribution:"base.contributions.theming"};class lye{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new B}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),Ye(()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}}const lq=new lye;pn.add(aq.ThemingContribution,lq);function Tr(n){return lq.onColorThemeChange(n)}class cye extends Y{constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(t=>this.onThemeChange(t)))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}}const cq=E("editor.lineHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},m("lineHighlight","Background color for the highlight of line at the cursor position.")),y7=E("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:Qe},m("lineHighlightBorderBox","Background color for the border around the line at the cursor position."));E("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},m("rangeHighlight","Background color of highlighted ranges, like by quick open and find features. The color must not be opaque so as not to hide underlying decorations."),!0);E("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:qt,hcLight:qt},m("rangeHighlightBorder","Background color of the border around highlighted ranges."),!0);E("editor.symbolHighlightBackground",{dark:Ha,light:Ha,hcDark:null,hcLight:null},m("symbolHighlight","Background color of highlighted symbol, like for go to definition or go next/previous symbol. The color must not be opaque so as not to hide underlying decorations."),!0);E("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:qt,hcLight:qt},m("symbolHighlightBorder","Background color of the border around highlighted symbols."),!0);const dq=E("editorCursor.foreground",{dark:"#AEAFAD",light:H.black,hcDark:H.white,hcLight:"#0F4A85"},m("caret","Color of the editor cursor.")),dye=E("editorCursor.background",null,m("editorCursorBackground","The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),ic=E("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},m("editorWhitespaces","Color of whitespace characters in the editor.")),uye=E("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:H.white,hcLight:"#292929"},m("editorLineNumbers","Color of editor line numbers.")),Ky=E("editorIndentGuide.background",{dark:ic,light:ic,hcDark:ic,hcLight:ic},m("editorIndentGuides","Color of the editor indentation guides."),!1,m("deprecatedEditorIndentGuides","'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),Yy=E("editorIndentGuide.activeBackground",{dark:ic,light:ic,hcDark:ic,hcLight:ic},m("editorActiveIndentGuide","Color of the active editor indentation guides."),!1,m("deprecatedEditorActiveIndentGuide","'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),ty=E("editorIndentGuide.background1",{dark:Ky,light:Ky,hcDark:Ky,hcLight:Ky},m("editorIndentGuides1","Color of the editor indentation guides (1).")),hye=E("editorIndentGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorIndentGuides2","Color of the editor indentation guides (2).")),fye=E("editorIndentGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorIndentGuides3","Color of the editor indentation guides (3).")),gye=E("editorIndentGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorIndentGuides4","Color of the editor indentation guides (4).")),pye=E("editorIndentGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorIndentGuides5","Color of the editor indentation guides (5).")),mye=E("editorIndentGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorIndentGuides6","Color of the editor indentation guides (6).")),iy=E("editorIndentGuide.activeBackground1",{dark:Yy,light:Yy,hcDark:Yy,hcLight:Yy},m("editorActiveIndentGuide1","Color of the active editor indentation guides (1).")),_ye=E("editorIndentGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorActiveIndentGuide2","Color of the active editor indentation guides (2).")),bye=E("editorIndentGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorActiveIndentGuide3","Color of the active editor indentation guides (3).")),vye=E("editorIndentGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorActiveIndentGuide4","Color of the active editor indentation guides (4).")),yye=E("editorIndentGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorActiveIndentGuide5","Color of the active editor indentation guides (5).")),wye=E("editorIndentGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorActiveIndentGuide6","Color of the active editor indentation guides (6).")),Zy=E("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:qt,hcLight:qt},m("editorActiveLineNumber","Color of editor active line number"),!1,m("deprecatedEditorActiveLineNumber","Id is deprecated. Use 'editorLineNumber.activeForeground' instead."));E("editorLineNumber.activeForeground",{dark:Zy,light:Zy,hcDark:Zy,hcLight:Zy},m("editorActiveLineNumber","Color of editor active line number"));const Cye=E("editorLineNumber.dimmedForeground",{dark:null,light:null,hcDark:null,hcLight:null},m("editorDimmedLineNumber","Color of the final editor line when editor.renderFinalNewline is set to dimmed."));E("editorRuler.foreground",{dark:"#5A5A5A",light:H.lightgrey,hcDark:H.white,hcLight:"#292929"},m("editorRuler","Color of the editor rulers."));E("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},m("editorCodeLensForeground","Foreground color of editor CodeLens"));E("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},m("editorBracketMatchBackground","Background color behind matching brackets"));E("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:Qe,hcLight:Qe},m("editorBracketMatchBorder","Color for matching brackets boxes"));const Sye=E("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},m("editorOverviewRulerBorder","Color of the overview ruler border.")),xye=E("editorOverviewRuler.background",null,m("editorOverviewRulerBackground","Background color of the editor overview ruler."));E("editorGutter.background",{dark:Ki,light:Ki,hcDark:Ki,hcLight:Ki},m("editorGutter","Background color of the editor gutter. The gutter contains the glyph margins and the line numbers."));E("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:H.fromHex("#fff").transparent(.8),hcLight:Qe},m("unnecessaryCodeBorder","Border color of unnecessary (unused) source code in the editor."));const Lye=E("editorUnnecessaryCode.opacity",{dark:H.fromHex("#000a"),light:H.fromHex("#0007"),hcDark:null,hcLight:null},m("unnecessaryCodeOpacity",`Opacity of unnecessary (unused) source code in the editor. For example, "#000000c0" will render the code with 75% opacity. For high contrast themes, use the 'editorUnnecessaryCode.border' theme color to underline unnecessary code instead of fading it out.`));E("editorGhostText.border",{dark:null,light:null,hcDark:H.fromHex("#fff").transparent(.8),hcLight:H.fromHex("#292929").transparent(.8)},m("editorGhostTextBorder","Border color of ghost text in the editor."));E("editorGhostText.foreground",{dark:H.fromHex("#ffffff56"),light:H.fromHex("#0007"),hcDark:null,hcLight:null},m("editorGhostTextForeground","Foreground color of the ghost text in the editor."));E("editorGhostText.background",{dark:null,light:null,hcDark:null,hcLight:null},m("editorGhostTextBackground","Background color of the ghost text in the editor."));const Xy=new H(new ht(0,122,204,.6)),Dye=E("editorOverviewRuler.rangeHighlightForeground",{dark:Xy,light:Xy,hcDark:Xy,hcLight:Xy},m("overviewRulerRangeHighlight","Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),kye=E("editorOverviewRuler.errorForeground",{dark:new H(new ht(255,18,18,.7)),light:new H(new ht(255,18,18,.7)),hcDark:new H(new ht(255,50,50,1)),hcLight:"#B5200D"},m("overviewRuleError","Overview ruler marker color for errors.")),Eye=E("editorOverviewRuler.warningForeground",{dark:yo,light:yo,hcDark:ov,hcLight:ov},m("overviewRuleWarning","Overview ruler marker color for warnings.")),Aye=E("editorOverviewRuler.infoForeground",{dark:ks,light:ks,hcDark:rv,hcLight:rv},m("overviewRuleInfo","Overview ruler marker color for infos.")),uq=E("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},m("editorBracketHighlightForeground1","Foreground color of brackets (1). Requires enabling bracket pair colorization.")),hq=E("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},m("editorBracketHighlightForeground2","Foreground color of brackets (2). Requires enabling bracket pair colorization.")),fq=E("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},m("editorBracketHighlightForeground3","Foreground color of brackets (3). Requires enabling bracket pair colorization.")),gq=E("editorBracketHighlight.foreground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketHighlightForeground4","Foreground color of brackets (4). Requires enabling bracket pair colorization.")),pq=E("editorBracketHighlight.foreground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketHighlightForeground5","Foreground color of brackets (5). Requires enabling bracket pair colorization.")),mq=E("editorBracketHighlight.foreground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketHighlightForeground6","Foreground color of brackets (6). Requires enabling bracket pair colorization.")),Iye=E("editorBracketHighlight.unexpectedBracket.foreground",{dark:new H(new ht(255,18,18,.8)),light:new H(new ht(255,18,18,.8)),hcDark:new H(new ht(255,50,50,1)),hcLight:""},m("editorBracketHighlightUnexpectedBracketForeground","Foreground color of unexpected brackets.")),Tye=E("editorBracketPairGuide.background1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.background1","Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),Nye=E("editorBracketPairGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.background2","Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),Rye=E("editorBracketPairGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.background3","Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),Mye=E("editorBracketPairGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.background4","Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),Pye=E("editorBracketPairGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.background5","Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),Oye=E("editorBracketPairGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.background6","Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),Fye=E("editorBracketPairGuide.activeBackground1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.activeBackground1","Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),Bye=E("editorBracketPairGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.activeBackground2","Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),Wye=E("editorBracketPairGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.activeBackground3","Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),Vye=E("editorBracketPairGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.activeBackground4","Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),zye=E("editorBracketPairGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.activeBackground5","Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),Hye=E("editorBracketPairGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},m("editorBracketPairGuide.activeBackground6","Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));E("editorUnicodeHighlight.border",{dark:"#BD9B03",light:"#CEA33D",hcDark:"#ff0000",hcLight:"#CEA33D"},m("editorUnicodeHighlight.border","Border color used to highlight unicode characters."));E("editorUnicodeHighlight.background",{dark:"#bd9b0326",light:"#cea33d14",hcDark:"#00000000",hcLight:"#cea33d14"},m("editorUnicodeHighlight.background","Background color used to highlight unicode characters."));Tr((n,e)=>{const t=n.getColor(Ki),i=n.getColor(cq),s=i&&!i.isTransparent()?i:t;s&&e.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${s}; }`)});class ny extends Xf{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new V(1,1),this._renderResult=null,this._activeLineNumber=1,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(66);const t=e.get(67);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(94);const i=e.get(143);this._lineNumbersLeft=i.lineNumbersLeft,this._lineNumbersWidth=i.lineNumbersWidth}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){return this._readConfig(),!0}onCursorStateChanged(e){const t=e.selections[0].getPosition();this._lastCursorModelPosition=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(t);let i=!1;return this._activeLineNumber!==t.lineNumber&&(this._activeLineNumber=t.lineNumber,i=!0),(this._renderLineNumbers===2||this._renderLineNumbers===3)&&(i=!0),i}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getLineRenderLineNumber(e){const t=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new V(e,1));if(t.column!==1)return"";const i=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(i);if(this._renderLineNumbers===2){const s=Math.abs(this._lastCursorModelPosition.lineNumber-i);return s===0?''+i+"":String(s)}return this._renderLineNumbers===3?this._lastCursorModelPosition.lineNumber===i||i%10===0?String(i):"":String(i)}prepareRender(e){if(this._renderLineNumbers===0){this._renderResult=null;return}const t=Xn?this._lineHeight%2===0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,o=this._context.viewModel.getLineCount(),r=[];for(let a=i;a<=s;a++){const l=a-i,c=this._getLineRenderLineNumber(a);if(!c){r[l]="";continue}let d="";if(a===o&&this._context.viewModel.getLineLength(a)===0){if(this._renderFinalNewline==="off"){r[l]="";continue}this._renderFinalNewline==="dimmed"&&(d=" dimmed-line-number")}a===this._activeLineNumber&&(d=" active-line-number"),r[l]=`
${c}
`}this._renderResult=r}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}ny.CLASS_NAME="line-numbers";Tr((n,e)=>{const t=n.getColor(uye),i=n.getColor(Cye);i?e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${i}; }`):t&&e.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${t.transparent(.4)}; }`)});class Sf extends oo{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(143);this._canUseLayerHinting=!t.get(32),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._domNode=bt(document.createElement("div")),this._domNode.setClassName(Sf.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=bt(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(Sf.CLASS_NAME),this._domNode.appendChild(this._glyphMarginBackgroundDomNode)}dispose(){super.dispose()}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(143);return this._canUseLayerHinting=!t.get(32),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollTopChanged}prepareRender(e){}render(e){this._domNode.setLayerHinting(this._canUseLayerHinting),this._domNode.setContain("strict");const t=e.scrollTop-e.bigNumbersDelta;this._domNode.setTop(-t);const i=Math.min(e.scrollHeight,1e6);this._domNode.setHeight(i),this._domNode.setWidth(this._contentLeft),this._glyphMarginBackgroundDomNode.setLeft(this._glyphMarginLeft),this._glyphMarginBackgroundDomNode.setWidth(this._glyphMarginWidth),this._glyphMarginBackgroundDomNode.setHeight(i)}}Sf.CLASS_NAME="glyph-margin";Sf.OUTER_CLASS_NAME="margin";const Sp="monaco-mouse-cursor-text";class $ye{constructor(){this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._enabled=!0}get enabled(){return this._enabled}enable(){this._enabled=!0,this._onDidChange.fire()}disable(){this._enabled=!1,this._onDidChange.fire()}}const z_=new $ye,bi=rt("keybindingService");var Uye=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},jye=function(n,e){return function(t,i){e(t,i,n)}};class qye{constructor(e,t,i,s,o){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=i,this.widthOfHiddenLineTextBefore=s,this.distanceToModelLineEnd=o,this._visibleTextAreaBrand=void 0,this.startPosition=null,this.endPosition=null,this.visibleTextareaStart=null,this.visibleTextareaEnd=null,this._previousPresentation=null}prepareRender(e){const t=new V(this.modelLineNumber,this.distanceToModelLineStart+1),i=new V(this.modelLineNumber,this._context.viewModel.model.getLineMaxColumn(this.modelLineNumber)-this.distanceToModelLineEnd);this.startPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(t),this.endPosition=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i),this.startPosition.lineNumber===this.endPosition.lineNumber?(this.visibleTextareaStart=e.visibleRangeForPosition(this.startPosition),this.visibleTextareaEnd=e.visibleRangeForPosition(this.endPosition)):(this.visibleTextareaStart=null,this.visibleTextareaEnd=null)}definePresentation(e){return this._previousPresentation||(e?this._previousPresentation=e:this._previousPresentation={foreground:1,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}}const S2=xr;let NT=class extends oo{constructor(e,t,i,s){super(e),this._keybindingService=s,this._primaryCursorPosition=new V(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._visibleRangeProvider=i,this._scrollLeft=0,this._scrollTop=0;const o=this._context.configuration.options,r=o.get(143);this._setAccessibilityOptions(o),this._contentLeft=r.contentLeft,this._contentWidth=r.contentWidth,this._contentHeight=r.height,this._fontInfo=o.get(50),this._lineHeight=o.get(66),this._emptySelectionClipboard=o.get(37),this._copyWithSyntaxHighlighting=o.get(25),this._visibleTextArea=null,this._selections=[new lt(1,1,1,1)],this._modelSelections=[new lt(1,1,1,1)],this._lastRenderPosition=null,this.textArea=bt(document.createElement("textarea")),sl.write(this.textArea,6),this.textArea.setClassName(`inputarea ${Sp}`),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:a}=this._context.viewModel.model.getOptions();this.textArea.domNode.style.tabSize=`${a*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("autocorrect","off"),this.textArea.setAttribute("autocapitalize","off"),this.textArea.setAttribute("autocomplete","off"),this.textArea.setAttribute("spellcheck","false"),this.textArea.setAttribute("aria-label",this._getAriaLabel(o)),this.textArea.setAttribute("aria-required",o.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(o.get(123))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",m("editor","editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-autocomplete",o.get(90)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=bt(document.createElement("div")),this.textAreaCover.setPosition("absolute");const l={getLineCount:()=>this._context.viewModel.getLineCount(),getLineMaxColumn:u=>this._context.viewModel.getLineMaxColumn(u),getValueInRange:(u,h)=>this._context.viewModel.getValueInRange(u,h),getValueLengthInRange:(u,h)=>this._context.viewModel.getValueLengthInRange(u,h),modifyPosition:(u,h)=>this._context.viewModel.modifyPosition(u,h)},c={getDataToCopy:()=>{const u=this._context.viewModel.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,Ps),h=this._context.viewModel.model.getEOL(),f=this._emptySelectionClipboard&&this._modelSelections.length===1&&this._modelSelections[0].isEmpty(),g=Array.isArray(u)?u:null,p=Array.isArray(u)?u.join(h):u;let _,v=null;if(this._copyWithSyntaxHighlighting&&p.length<65536){const b=this._context.viewModel.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);b&&(_=b.html,v=b.mode)}return{isFromEmptySelection:f,multicursorText:g,text:p,html:_,mode:v}},getScreenReaderContent:()=>{if(this._accessibilitySupport===1){const u=this._selections[0];if(pt&&u.isEmpty()){const f=u.getStartPosition();let g=this._getWordBeforePosition(f);if(g.length===0&&(g=this._getCharacterBeforePosition(f)),g.length>0)return new cn(g,g.length,g.length,N.fromPositions(f),0)}if(pt&&!u.isEmpty()&&l.getValueLengthInRange(u,0)<500){const f=l.getValueInRange(u,0);return new cn(f,0,f.length,u,0)}if(bc&&!u.isEmpty()){const f="vscode-placeholder";return new cn(f,0,f.length,null,void 0)}return cn.EMPTY}if(GF){const u=this._selections[0];if(u.isEmpty()){const h=u.getStartPosition(),[f,g]=this._getAndroidWordAtPosition(h);if(f.length>0)return new cn(f,g,g,N.fromPositions(h),0)}return cn.EMPTY}return Xg.fromEditorSelection(l,this._selections[0],this._accessibilityPageSize,this._accessibilitySupport===0)},deduceModelPosition:(u,h,f)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(u,h,f)},d=this._register(new sye(this.textArea.domNode));this._textAreaInput=this._register(new nye(c,d,bo,{isAndroid:GF,isChrome:$4,isFirefox:xr,isSafari:bc})),this._register(this._textAreaInput.onKeyDown(u=>{this._viewController.emitKeyDown(u)})),this._register(this._textAreaInput.onKeyUp(u=>{this._viewController.emitKeyUp(u)})),this._register(this._textAreaInput.onPaste(u=>{let h=!1,f=null,g=null;u.metadata&&(h=this._emptySelectionClipboard&&!!u.metadata.isFromEmptySelection,f=typeof u.metadata.multicursorText<"u"?u.metadata.multicursorText:null,g=u.metadata.mode),this._viewController.paste(u.text,h,f,g)})),this._register(this._textAreaInput.onCut(()=>{this._viewController.cut()})),this._register(this._textAreaInput.onType(u=>{u.replacePrevCharCnt||u.replaceNextCharCnt||u.positionDelta?this._viewController.compositionType(u.text,u.replacePrevCharCnt,u.replaceNextCharCnt,u.positionDelta):this._viewController.type(u.text)})),this._register(this._textAreaInput.onSelectionChangeRequest(u=>{this._viewController.setSelection(u)})),this._register(this._textAreaInput.onCompositionStart(u=>{const h=this.textArea.domNode,f=this._modelSelections[0],{distanceToModelLineStart:g,widthOfHiddenTextBefore:p}=(()=>{const v=h.value.substring(0,Math.min(h.selectionStart,h.selectionEnd)),b=v.lastIndexOf(` +`),y=v.substring(b+1),w=y.lastIndexOf(" "),S=y.length-w-1,L=f.getStartPosition(),x=Math.min(L.column-1,S),D=L.column-1-x,k=y.substring(0,y.length-x),{tabSize:P}=this._context.viewModel.model.getOptions(),O=Gye(this.textArea.domNode.ownerDocument,k,this._fontInfo,P);return{distanceToModelLineStart:D,widthOfHiddenTextBefore:O}})(),{distanceToModelLineEnd:_}=(()=>{const v=h.value.substring(Math.max(h.selectionStart,h.selectionEnd)),b=v.indexOf(` +`),y=b===-1?v:v.substring(0,b),w=y.indexOf(" "),S=w===-1?y.length:y.length-w-1,L=f.getEndPosition(),x=Math.min(this._context.viewModel.model.getLineMaxColumn(L.lineNumber)-L.column,S);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(L.lineNumber)-L.column-x}})();this._context.viewModel.revealRange("keyboard",!0,N.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new qye(this._context,f.startLineNumber,g,p,_),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${Sp} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()})),this._register(this._textAreaInput.onCompositionUpdate(u=>{this._visibleTextArea&&(this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render())})),this._register(this._textAreaInput.onCompositionEnd(()=>{this._visibleTextArea=null,this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._render(),this.textArea.setClassName(`inputarea ${Sp}`),this._viewController.compositionEnd(),this._context.viewModel.onCompositionEnd()})),this._register(this._textAreaInput.onFocus(()=>{this._context.viewModel.setHasFocus(!0)})),this._register(this._textAreaInput.onBlur(()=>{this._context.viewModel.setHasFocus(!1)})),this._register(z_.onDidChange(()=>{this._ensureReadOnlyAttribute()}))}writeScreenReaderContent(e){this._textAreaInput.writeScreenReaderContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t='`~!@#$%^&*()-=+[{]}\\|;:",.<>/?',i=this._context.viewModel.getLineContent(e.lineNumber),s=xm(t);let o=!0,r=e.column,a=!0,l=e.column,c=0;for(;c<50&&(o||a);){if(o&&r<=1&&(o=!1),o){const d=i.charCodeAt(r-2);s.get(d)!==0?o=!1:r--}if(a&&l>i.length&&(a=!1),a){const d=i.charCodeAt(l-1);s.get(d)!==0?a=!1:l++}c++}return[i.substring(r-1,l-1),e.column-r]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=xm(this._context.configuration.options.get(129));let s=e.column,o=0;for(;s>1;){const r=t.charCodeAt(s-2);if(i.get(r)!==0||o>50)return t.substring(s-1,e.column-1);o++,s--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const i=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!tn(i.charCodeAt(0)))return i}return""}_getAriaLabel(e){var t,i,s;if(e.get(2)===1){const r=(t=this._keybindingService.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode"))===null||t===void 0?void 0:t.getAriaLabel(),a=(i=this._keybindingService.lookupKeybinding("workbench.action.showCommands"))===null||i===void 0?void 0:i.getAriaLabel(),l=(s=this._keybindingService.lookupKeybinding("workbench.action.openGlobalKeybindings"))===null||s===void 0?void 0:s.getAriaLabel(),c=m("accessibilityModeOff","The editor is not accessible at this time.");return r?m("accessibilityOffAriaLabel","{0} To enable screen reader optimized mode, use {1}",c,r):a?m("accessibilityOffAriaLabelNoKb","{0} To enable screen reader optimized mode, open the quick pick with {1} and run the command Toggle Screen Reader Accessibility Mode, which is currently not triggerable via keyboard.",c,a):l?m("accessibilityOffAriaLabelNoKbs","{0} Please assign a keybinding for the command Toggle Screen Reader Accessibility Mode by accessing the keybindings editor with {1} and run it.",c,l):c}return e.get(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);this._accessibilitySupport===2&&t===Vf.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const s=e.get(143).wrappingColumn;if(s!==-1&&this._accessibilitySupport!==1){const o=e.get(50);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(s*o.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=S2?0:1}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(143);this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(50),this._lineHeight=t.get(66),this._emptySelectionClipboard=t.get(37),this._copyWithSyntaxHighlighting=t.get(25),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:s}=this._context.viewModel.model.getOptions();return this.textArea.domNode.style.tabSize=`${s*this._fontInfo.spaceWidth}px`,this.textArea.setAttribute("aria-label",this._getAriaLabel(t)),this.textArea.setAttribute("aria-required",t.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(t.get(123))),(e.hasChanged(34)||e.hasChanged(90))&&this._ensureReadOnlyAttribute(),e.hasChanged(2)&&this._textAreaInput.writeScreenReaderContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeScreenReaderContent("selection changed"),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return this._scrollLeft=e.scrollLeft,this._scrollTop=e.scrollTop,!0}onZonesChanged(e){return!0}isFocused(){return this._textAreaInput.isFocused()}focusTextArea(){this._textAreaInput.focusTextArea()}getLastRenderData(){return this._lastRenderPosition}setAriaOptions(e){e.activeDescendant?(this.textArea.setAttribute("aria-haspopup","true"),this.textArea.setAttribute("aria-autocomplete","list"),this.textArea.setAttribute("aria-activedescendant",e.activeDescendant)):(this.textArea.setAttribute("aria-haspopup","false"),this.textArea.setAttribute("aria-autocomplete","both"),this.textArea.removeAttribute("aria-activedescendant")),e.role&&this.textArea.setAttribute("role",e.role)}_ensureReadOnlyAttribute(){const e=this._context.configuration.options;!z_.enabled||e.get(34)&&e.get(90)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")}prepareRender(e){var t;this._primaryCursorPosition=new V(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition),(t=this._visibleTextArea)===null||t===void 0||t.prepareRender(e)}render(e){this._textAreaInput.writeScreenReaderContent("render"),this._render()}_render(){var e;if(this._visibleTextArea){const s=this._visibleTextArea.visibleTextareaStart,o=this._visibleTextArea.visibleTextareaEnd,r=this._visibleTextArea.startPosition,a=this._visibleTextArea.endPosition;if(r&&a&&s&&o&&o.left>=this._scrollLeft&&s.left<=this._scrollLeft+this._contentWidth){const l=this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber)-this._scrollTop,c=this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));let d=this._visibleTextArea.widthOfHiddenLineTextBefore,u=this._contentLeft+s.left-this._scrollLeft,h=o.left-s.left+1;if(uthis._contentWidth&&(h=this._contentWidth);const f=this._context.viewModel.getViewLineData(r.lineNumber),g=f.tokens.findTokenIndexAtOffset(r.column-1),p=f.tokens.findTokenIndexAtOffset(a.column-1),_=g===p,v=this._visibleTextArea.definePresentation(_?f.tokens.getPresentation(g):null);this.textArea.domNode.scrollTop=c*this._lineHeight,this.textArea.domNode.scrollLeft=d,this._doRender({lastRenderPosition:null,top:l,left:u,width:h,height:this._lineHeight,useCover:!1,color:(Si.getColorMap()||[])[v.foreground],italic:v.italic,bold:v.bold,underline:v.underline,strikethrough:v.strikethrough})}return}if(!this._primaryCursorVisibleRange){this._renderAtTopLeft();return}const t=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(tthis._contentLeft+this._contentWidth){this._renderAtTopLeft();return}const i=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(i<0||i>this._contentHeight){this._renderAtTopLeft();return}if(pt){this._doRender({lastRenderPosition:this._primaryCursorPosition,top:i,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:this._lineHeight,useCover:!1}),this.textArea.domNode.scrollLeft=this._primaryCursorVisibleRange.left;const s=(e=this._textAreaInput.textAreaState.newlineCountBeforeSelection)!==null&&e!==void 0?e:this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));this.textArea.domNode.scrollTop=s*this._lineHeight;return}this._doRender({lastRenderPosition:this._primaryCursorPosition,top:i,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:S2?0:1,useCover:!1})}_newlinecount(e){let t=0,i=-1;do{if(i=e.indexOf(` +`,i+1),i===-1)break;t++}while(!0);return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:S2?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;Nn(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?H.Format.CSS.formatHex(e.color):""),t.setFontStyle(e.italic?"italic":""),e.bold&&t.setFontWeight("bold"),t.setTextDecoration(`${e.underline?" underline":""}${e.strikethrough?" line-through":""}`),i.setTop(e.useCover?e.top:0),i.setLeft(e.useCover?e.left:0),i.setWidth(e.useCover?e.width:0),i.setHeight(e.useCover?e.height:0);const s=this._context.configuration.options;s.get(57)?i.setClassName("monaco-editor-background textAreaCover "+Sf.OUTER_CLASS_NAME):s.get(67).renderType!==0?i.setClassName("monaco-editor-background textAreaCover "+ny.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}};NT=Uye([jye(3,bi)],NT);function Gye(n,e,t,i){if(e.length===0)return 0;const s=n.createElement("div");s.style.position="absolute",s.style.top="-50000px",s.style.width="50000px";const o=n.createElement("span");Nn(o,t),o.style.whiteSpace="pre",o.style.tabSize=`${i*t.spaceWidth}px`,o.append(e),s.appendChild(o),n.body.appendChild(s);const r=o.offsetWidth;return n.body.removeChild(s),r}function Kye(n,e,t){let i=0;for(let o=0;o!0,Zye=()=>!1,Xye=n=>n===" "||n===" ";class bg{static shouldRecreate(e){return e.hasChanged(143)||e.hasChanged(129)||e.hasChanged(37)||e.hasChanged(76)||e.hasChanged(78)||e.hasChanged(79)||e.hasChanged(6)||e.hasChanged(7)||e.hasChanged(11)||e.hasChanged(9)||e.hasChanged(10)||e.hasChanged(14)||e.hasChanged(127)||e.hasChanged(50)||e.hasChanged(90)}constructor(e,t,i,s){var o;this.languageConfigurationService=s,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const r=i.options,a=r.get(143),l=r.get(50);this.readOnly=r.get(90),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=r.get(115),this.lineHeight=l.lineHeight,this.typicalHalfwidthCharacterWidth=l.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(a.height/this.lineHeight)-2),this.useTabStops=r.get(127),this.wordSeparators=r.get(129),this.emptySelectionClipboard=r.get(37),this.copyWithSyntaxHighlighting=r.get(25),this.multiCursorMergeOverlapping=r.get(76),this.multiCursorPaste=r.get(78),this.multiCursorLimit=r.get(79),this.autoClosingBrackets=r.get(6),this.autoClosingComments=r.get(7),this.autoClosingQuotes=r.get(11),this.autoClosingDelete=r.get(9),this.autoClosingOvertype=r.get(10),this.autoSurround=r.get(14),this.autoIndent=r.get(12),this.surroundingPairs={},this._electricChars=null,this.shouldAutoCloseBefore={quote:this._getShouldAutoClose(e,this.autoClosingQuotes,!0),comment:this._getShouldAutoClose(e,this.autoClosingComments,!1),bracket:this._getShouldAutoClose(e,this.autoClosingBrackets,!1)},this.autoClosingPairs=this.languageConfigurationService.getLanguageConfiguration(e).getAutoClosingPairs();const c=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(c)for(const u of c)this.surroundingPairs[u.open]=u.close;const d=this.languageConfigurationService.getLanguageConfiguration(e).comments;this.blockCommentStartToken=(o=d==null?void 0:d.blockCommentStartToken)!==null&&o!==void 0?o:null}get electricChars(){var e;if(!this._electricChars){this._electricChars={};const t=(e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter)===null||e===void 0?void 0:e.getElectricCharacters();if(t)for(const i of t)this._electricChars[i]=!0}return this._electricChars}onElectricCharacter(e,t,i){const s=JL(t,i-1),o=this.languageConfigurationService.getLanguageConfiguration(s.languageId).electricCharacter;return o?o.onElectricCharacter(e,s,i-s.firstCharOffset):null}normalizeIndentation(e){return _q(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,i){switch(t){case"beforeWhitespace":return Xye;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,i);case"always":return Yye;case"never":return Zye}}_getLanguageDefinedShouldAutoClose(e,t){const i=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return s=>i.indexOf(s)!==-1}visibleColumnFromColumn(e,t){return Gi.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,i){const s=Gi.columnFromVisibleColumn(e.getLineContent(t),i,this.tabSize),o=e.getLineMinColumn(t);if(sr?r:s}}class st{static fromModelState(e){return new Qye(e)}static fromViewState(e){return new Jye(e)}static fromModelSelection(e){const t=lt.liftSelection(e),i=new hn(N.fromPositions(t.getSelectionStart()),0,0,t.getPosition(),0);return st.fromModelState(i)}static fromModelSelections(e){const t=[];for(let i=0,s=e.length;io,c=s>r,d=sr||vs||_0&&s--,fh.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,s)}static columnSelectRight(e,t,i){let s=0;const o=Math.min(i.fromViewLineNumber,i.toViewLineNumber),r=Math.max(i.fromViewLineNumber,i.toViewLineNumber);for(let l=o;l<=r;l++){const c=t.getLineMaxColumn(l),d=e.visibleColumnFromColumn(t,new V(l,c));s=Math.max(s,d)}let a=i.toViewVisualColumn;return ae.getLineMinColumn(t.lineNumber))return t.delta(void 0,-AU(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const i=t.lineNumber-1;return new V(i,e.getLineMaxColumn(i))}else return t}static leftPositionAtomicSoftTabs(e,t,i){if(t.column<=e.getLineIndentColumn(t.lineNumber)){const s=e.getLineMinColumn(t.lineNumber),o=e.getLineContent(t.lineNumber),r=lv.atomicPosition(o,t.column-1,i,0);if(r!==-1&&r+1>=s)return new V(t.lineNumber,r+1)}return this.leftPosition(e,t)}static left(e,t,i){const s=e.stickyTabStops?xt.leftPositionAtomicSoftTabs(t,i,e.tabSize):xt.leftPosition(t,i);return new x2(s.lineNumber,s.column,0)}static moveLeft(e,t,i,s,o){let r,a;if(i.hasSelection()&&!s)r=i.selection.startLineNumber,a=i.selection.startColumn;else{const l=i.position.delta(void 0,-(o-1)),c=t.normalizePosition(xt.clipPositionColumn(l,t),0),d=xt.left(e,t,c);r=d.lineNumber,a=d.column}return i.move(s,r,a,0)}static clipPositionColumn(e,t){return new V(e.lineNumber,xt.clipRange(e.column,t.getLineMinColumn(e.lineNumber),t.getLineMaxColumn(e.lineNumber)))}static clipRange(e,t,i){return ei?i:e}static rightPosition(e,t,i){return id?(i=d,a?s=t.getLineMaxColumn(i):s=Math.min(t.getLineMaxColumn(i),s)):s=e.columnFromVisibleColumn(t,i,c),f?o=0:o=c-Gi.visibleColumnFromColumn(t.getLineContent(i),s,e.tabSize),l!==void 0){const g=new V(i,s),p=t.normalizePosition(g,l);o=o+(s-p.column),i=p.lineNumber,s=p.column}return new x2(i,s,o)}static down(e,t,i,s,o,r,a){return this.vertical(e,t,i,s,o,i+r,a,4)}static moveDown(e,t,i,s,o){let r,a;i.hasSelection()&&!s?(r=i.selection.endLineNumber,a=i.selection.endColumn):(r=i.position.lineNumber,a=i.position.column);let l=0,c;do if(c=xt.down(e,t,r+l,a,i.leftoverVisibleColumns,o,!0),t.normalizePosition(new V(c.lineNumber,c.column),2).lineNumber>r)break;while(l++<10&&r+l1&&this._isBlankLine(t,o);)o--;for(;o>1&&!this._isBlankLine(t,o);)o--;return i.move(s,o,t.getLineMinColumn(o),0)}static moveToNextBlankLine(e,t,i,s){const o=t.getLineCount();let r=i.position.lineNumber;for(;r=h.length+1)return!1;const f=h.charAt(u.column-2),g=s.get(f);if(!g)return!1;if($c(f)){if(i==="never")return!1}else if(t==="never")return!1;const p=h.charAt(u.column-1);let _=!1;for(const v of g)v.open===f&&v.close===p&&(_=!0);if(!_)return!1;if(e==="auto"){let v=!1;for(let b=0,y=a.length;b1){const o=t.getLineContent(s.lineNumber),r=Ys(o),a=r===-1?o.length+1:r+1;if(s.column<=a){const l=i.visibleColumnFromColumn(t,s),c=Gi.prevIndentTabStop(l,i.indentSize),d=i.columnFromVisibleColumn(t,s.lineNumber,c);return new N(s.lineNumber,d,s.lineNumber,s.column)}}return N.fromPositions(xf.getPositionAfterDeleteLeft(s,t),s)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=hpe(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,i+1)}else if(e.lineNumber>1){const i=e.lineNumber-1;return new V(i,t.getLineMaxColumn(i))}else return e}static cut(e,t,i){const s=[];let o=null;i.sort((r,a)=>V.compare(r.getStartPosition(),a.getEndPosition()));for(let r=0,a=i.length;r1&&(o==null?void 0:o.endLineNumber)!==c.lineNumber?(d=c.lineNumber-1,u=t.getLineMaxColumn(c.lineNumber-1),h=c.lineNumber,f=t.getLineMaxColumn(c.lineNumber)):(d=c.lineNumber,u=1,h=c.lineNumber,f=t.getLineMaxColumn(c.lineNumber));const g=new N(d,u,h,f);o=g,g.isEmpty()?s[r]=null:s[r]=new vs(g,"")}else s[r]=null;else s[r]=new vs(l,"")}return new _s(0,s,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class wi{static _createWord(e,t,i,s,o){return{start:s,end:o,wordType:t,nextCharClass:i}}static _findPreviousWordOnLine(e,t,i){const s=t.getLineContent(i.lineNumber);return this._doFindPreviousWordOnLine(s,e,i)}static _doFindPreviousWordOnLine(e,t,i){let s=0;for(let o=i.column-2;o>=0;o--){const r=e.charCodeAt(o),a=t.get(r);if(a===0){if(s===2)return this._createWord(e,s,a,o+1,this._findEndOfWord(e,t,s,o+1));s=1}else if(a===2){if(s===1)return this._createWord(e,s,a,o+1,this._findEndOfWord(e,t,s,o+1));s=2}else if(a===1&&s!==0)return this._createWord(e,s,a,o+1,this._findEndOfWord(e,t,s,o+1))}return s!==0?this._createWord(e,s,1,0,this._findEndOfWord(e,t,s,0)):null}static _findEndOfWord(e,t,i,s){const o=e.length;for(let r=s;r=0;o--){const r=e.charCodeAt(o),a=t.get(r);if(a===1||i===1&&a===2||i===2&&a===0)return o+1}return 0}static moveWordLeft(e,t,i,s){let o=i.lineNumber,r=i.column;r===1&&o>1&&(o=o-1,r=t.getLineMaxColumn(o));let a=wi._findPreviousWordOnLine(e,t,new V(o,r));if(s===0)return new V(o,a?a.start+1:1);if(s===1)return a&&a.wordType===2&&a.end-a.start===1&&a.nextCharClass===0&&(a=wi._findPreviousWordOnLine(e,t,new V(o,a.start+1))),new V(o,a?a.start+1:1);if(s===3){for(;a&&a.wordType===2;)a=wi._findPreviousWordOnLine(e,t,new V(o,a.start+1));return new V(o,a?a.start+1:1)}return a&&r<=a.end+1&&(a=wi._findPreviousWordOnLine(e,t,new V(o,a.start+1))),new V(o,a?a.end+1:1)}static _moveWordPartLeft(e,t){const i=t.lineNumber,s=e.getLineMaxColumn(i);if(t.column===1)return i>1?new V(i-1,e.getLineMaxColumn(i-1)):t;const o=e.getLineContent(i);for(let r=t.column-1;r>1;r--){const a=o.charCodeAt(r-2),l=o.charCodeAt(r-1);if(a===95&&l!==95)return new V(i,r);if(a===45&&l!==45)return new V(i,r);if((Wg(a)||Wy(a))&&qc(l))return new V(i,r);if(qc(a)&&qc(l)&&r+1=l.start+1&&(l=wi._findNextWordOnLine(e,t,new V(o,l.end+1))),l?r=l.start+1:r=t.getLineMaxColumn(o);return new V(o,r)}static _moveWordPartRight(e,t){const i=t.lineNumber,s=e.getLineMaxColumn(i);if(t.column===s)return i1?c=1:(l--,c=s.getLineMaxColumn(l)):(d&&c<=d.end+1&&(d=wi._findPreviousWordOnLine(i,s,new V(l,d.start+1))),d?c=d.end+1:c>1?c=1:(l--,c=s.getLineMaxColumn(l))),new N(l,c,a.lineNumber,a.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const s=new V(i.positionLineNumber,i.positionColumn),o=this._deleteInsideWordWhitespace(t,s);return o||this._deleteInsideWordDetermineDeleteRange(e,t,s)}static _charAtIsWhitespace(e,t){const i=e.charCodeAt(t);return i===32||i===9}static _deleteInsideWordWhitespace(e,t){const i=e.getLineContent(t.lineNumber),s=i.length;if(s===0)return null;let o=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(i,o))return null;let r=Math.min(t.column-1,s-1);if(!this._charAtIsWhitespace(i,r))return null;for(;o>0&&this._charAtIsWhitespace(i,o-1);)o--;for(;r+11?new N(i.lineNumber-1,t.getLineMaxColumn(i.lineNumber-1),i.lineNumber,1):i.lineNumberu.start+1<=i.column&&i.column<=u.end+1,a=(u,h)=>(u=Math.min(u,i.column),h=Math.max(h,i.column),new N(i.lineNumber,u,i.lineNumber,h)),l=u=>{let h=u.start+1,f=u.end+1,g=!1;for(;f-11&&this._charAtIsWhitespace(s,h-2);)h--;return a(h,f)},c=wi._findPreviousWordOnLine(e,t,i);if(c&&r(c))return l(c);const d=wi._findNextWordOnLine(e,t,i);return d&&r(d)?l(d):c&&d?a(c.end+1,d.start+1):c?a(c.start+1,c.end+1):d?a(d.start+1,d.end+1):a(1,o+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),s=wi._moveWordPartLeft(e,i);return new N(i.lineNumber,i.column,s.lineNumber,s.column)}static _findFirstNonWhitespaceChar(e,t){const i=e.length;for(let s=t;s=h.start+1&&(h=wi._findNextWordOnLine(i,s,new V(l,h.end+1))),h?c=h.start+1:cc&&(d=c,u=e.model.getLineMaxColumn(d)),st.fromModelState(new hn(new N(r.lineNumber,1,d,u),2,0,new V(d,u),0))}const l=t.modelState.selectionStart.getStartPosition().lineNumber;if(r.lineNumberl){const c=e.getLineCount();let d=a.lineNumber+1,u=1;return d>c&&(d=c,u=e.getLineMaxColumn(d)),st.fromViewState(t.viewState.move(!0,d,u,0))}else{const c=t.modelState.selectionStart.getEndPosition();return st.fromModelState(t.modelState.move(!0,c.lineNumber,c.column,0))}}static word(e,t,i,s){const o=e.model.validatePosition(s);return st.fromModelState(wi.word(e.cursorConfig,e.model,t.modelState,i,o))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new st(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,s=t.viewState.position.column;return st.fromViewState(new hn(new N(i,s,i,s),0,0,new V(i,s),0))}static moveTo(e,t,i,s,o){if(i){if(t.modelState.selectionStartKind===1)return this.word(e,t,i,s);if(t.modelState.selectionStartKind===2)return this.line(e,t,i,s,o)}const r=e.model.validatePosition(s),a=o?e.coordinatesConverter.validateViewPosition(new V(o.lineNumber,o.column),r):e.coordinatesConverter.convertModelPositionToViewPosition(r);return st.fromViewState(t.viewState.move(i,a.lineNumber,a.column,0))}static simpleMove(e,t,i,s,o,r){switch(i){case 0:return r===4?this._moveHalfLineLeft(e,t,s):this._moveLeft(e,t,s,o);case 1:return r===4?this._moveHalfLineRight(e,t,s):this._moveRight(e,t,s,o);case 2:return r===2?this._moveUpByViewLines(e,t,s,o):this._moveUpByModelLines(e,t,s,o);case 3:return r===2?this._moveDownByViewLines(e,t,s,o):this._moveDownByModelLines(e,t,s,o);case 4:return r===2?t.map(a=>st.fromViewState(xt.moveToPrevBlankLine(e.cursorConfig,e,a.viewState,s))):t.map(a=>st.fromModelState(xt.moveToPrevBlankLine(e.cursorConfig,e.model,a.modelState,s)));case 5:return r===2?t.map(a=>st.fromViewState(xt.moveToNextBlankLine(e.cursorConfig,e,a.viewState,s))):t.map(a=>st.fromModelState(xt.moveToNextBlankLine(e.cursorConfig,e.model,a.modelState,s)));case 6:return this._moveToViewMinColumn(e,t,s);case 7:return this._moveToViewFirstNonWhitespaceColumn(e,t,s);case 8:return this._moveToViewCenterColumn(e,t,s);case 9:return this._moveToViewMaxColumn(e,t,s);case 10:return this._moveToViewLastNonWhitespaceColumn(e,t,s);default:return null}}static viewportMove(e,t,i,s,o){const r=e.getCompletelyVisibleViewRange(),a=e.coordinatesConverter.convertViewRangeToModelRange(r);switch(i){case 11:{const l=this._firstLineNumberInRange(e.model,a,o),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],s,l,c)]}case 13:{const l=this._lastLineNumberInRange(e.model,a,o),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],s,l,c)]}case 12:{const l=Math.round((a.startLineNumber+a.endLineNumber)/2),c=e.model.getLineFirstNonWhitespaceColumn(l);return[this._moveToModelPosition(e,t[0],s,l,c)]}case 14:{const l=[];for(let c=0,d=t.length;ci.endLineNumber-1?r=i.endLineNumber-1:ost.fromViewState(xt.moveLeft(e.cursorConfig,e,o.viewState,i,s)))}static _moveHalfLineLeft(e,t,i){const s=[];for(let o=0,r=t.length;ost.fromViewState(xt.moveRight(e.cursorConfig,e,o.viewState,i,s)))}static _moveHalfLineRight(e,t,i){const s=[];for(let o=0,r=t.length;o1&&s.firstCharOffset===0){const p=pp(e,t.startLineNumber-1);p.languageId===s.languageId&&(c=p.getLineContent())}const d=o.onEnter(n,c,a,l);if(!d)return null;const u=d.indentAction;let h=d.appendText;const f=d.removeText||0;h?u===os.Indent&&(h=" "+h):u===os.Indent||u===os.IndentOutdent?h=" ":h="";let g=Lj(e,t.startLineNumber,t.startColumn);return f&&(g=g.substring(0,g.length-f)),{indentAction:u,appendText:h,removeText:f,indentation:g}}var Mye=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Pye=function(n,e){return function(t,i){e(t,i,n)}},SC;const I2=Object.create(null);function Uu(n,e){if(e<=0)return"";I2[n]||(I2[n]=["",n]);const t=I2[n];for(let i=t.length;i<=e;i++)t[i]=t[i-1]+n;return t[e]}let hh=SC=class{static unshiftIndent(e,t,i,s,o){const r=Ki.visibleColumnFromColumn(e,t,i);if(o){const a=Uu(" ",s),c=Ki.prevIndentTabStop(r,s)/s;return Uu(a,c)}else{const a=" ",c=Ki.prevRenderTabStop(r,i)/i;return Uu(a,c)}}static shiftIndent(e,t,i,s,o){const r=Ki.visibleColumnFromColumn(e,t,i);if(o){const a=Uu(" ",s),c=Ki.nextIndentTabStop(r,s)/s;return Uu(a,c)}else{const a=" ",c=Ki.nextRenderTabStop(r,i)/i;return Uu(a,c)}}constructor(e,t,i){this._languageConfigurationService=i,this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}_addEditOperation(e,t,i){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,i):e.addEditOperation(t,i)}getEditOperations(e,t){const i=this._selection.startLineNumber;let s=this._selection.endLineNumber;this._selection.endColumn===1&&i!==s&&(s=s-1);const{tabSize:o,indentSize:r,insertSpaces:a}=this._opts,l=i===s;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(i))&&(this._useLastEditRangeForCursorEndPosition=!0);let c=0,d=0;for(let u=i;u<=s;u++,c=d){d=0;const h=e.getLineContent(u);let f=Qs(h);if(this._opts.isUnshift&&(h.length===0||f===0)||!l&&!this._opts.isUnshift&&h.length===0)continue;if(f===-1&&(f=h.length),u>1&&Ki.visibleColumnFromColumn(h,f+1,o)%r!==0&&e.tokenization.isCheapToTokenize(u-1)){const _=PT(this._opts.autoIndent,e,new N(u-1,e.getLineMaxColumn(u-1),u-1,e.getLineMaxColumn(u-1)),this._languageConfigurationService);if(_){if(d=c,_.appendText)for(let v=0,b=_.appendText.length;v1){let s,o=-1;for(s=e-1;s>=1;s--){if(n.tokenization.getLanguageIdAtPosition(s,0)!==i)return o;const r=n.getLineContent(s);if(t.shouldIgnore(r)||/^\s+$/.test(r)||r===""){o=s;continue}return s}}return-1}function LP(n,e,t,i=!0,s){if(n<4)return null;const o=s.getLanguageConfiguration(e.tokenization.getLanguageId()).indentRulesSupport;if(!o)return null;if(t<=1)return{indentation:"",action:null};for(let l=t-1;l>0&&e.getLineContent(l)==="";l--)if(l===1)return{indentation:"",action:null};const r=Bye(e,t,o);if(r<0)return null;if(r<1)return{indentation:"",action:null};const a=e.getLineContent(r);if(o.shouldIncrease(a)||o.shouldIndentNextLine(a))return{indentation:$s(a),action:os.Indent,line:r};if(o.shouldDecrease(a))return{indentation:$s(a),action:null,line:r};{if(r===1)return{indentation:$s(e.getLineContent(r)),action:null,line:r};const l=r-1,c=o.getIndentMetadata(e.getLineContent(l));if(!(c&3)&&c&4){let d=0;for(let u=l-1;u>0;u--)if(!o.shouldIndentNextLine(e.getLineContent(u))){d=u;break}return{indentation:$s(e.getLineContent(d+1)),action:null,line:d+1}}if(i)return{indentation:$s(e.getLineContent(r)),action:null,line:r};for(let d=r;d>0;d--){const u=e.getLineContent(d);if(o.shouldIncrease(u))return{indentation:$s(u),action:os.Indent,line:d};if(o.shouldIndentNextLine(u)){let h=0;for(let f=d-1;f>0;f--)if(!o.shouldIndentNextLine(e.getLineContent(d))){h=f;break}return{indentation:$s(e.getLineContent(h+1)),action:null,line:h+1}}else if(o.shouldDecrease(u))return{indentation:$s(u),action:null,line:d}}return{indentation:$s(e.getLineContent(1)),action:null,line:1}}}function Wye(n,e,t,i,s){if(n<4)return null;e.tokenization.forceTokenization(t.startLineNumber);const o=e.tokenization.getLineTokens(t.startLineNumber),r=rD(o,t.startColumn-1),a=r.getLineContent();let l=!1,c;r.firstCharOffset>0&&o.getLanguageId(0)!==r.languageId?(l=!0,c=a.substr(0,t.startColumn-1-r.firstCharOffset)):c=o.getLineContent().substring(0,t.startColumn-1);let d;t.isEmpty()?d=a.substr(t.startColumn-1-r.firstCharOffset):d=pp(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-r.firstCharOffset);const u=s.getLanguageConfiguration(r.languageId).indentRulesSupport;if(!u)return null;const h=c,f=$s(c),g={tokenization:{getLineTokens:b=>e.tokenization.getLineTokens(b),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(b,y)=>e.getLanguageIdAtPosition(b,y)},getLineContent:b=>b===t.startLineNumber?h:e.getLineContent(b)},p=$s(o.getLineContent()),_=LP(n,g,t.startLineNumber+1,void 0,s);if(!_){const b=l?p:f;return{beforeEnter:b,afterEnter:b}}let v=l?p:_.indentation;return _.action===os.Indent&&(v=i.shiftIndent(v)),u.shouldDecrease(d)&&(v=i.unshiftIndent(v)),{beforeEnter:l?p:f,afterEnter:v}}function Vye(n,e,t,i,s,o){if(n<4)return null;const r=pp(e,t.startLineNumber,t.startColumn);if(r.firstCharOffset)return null;const a=o.getLanguageConfiguration(r.languageId).indentRulesSupport;if(!a)return null;const l=r.getLineContent(),c=l.substr(0,t.startColumn-1-r.firstCharOffset);let d;if(t.isEmpty()?d=l.substr(t.startColumn-1-r.firstCharOffset):d=pp(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-r.firstCharOffset),!a.shouldDecrease(c+d)&&a.shouldDecrease(c+i+d)){const u=LP(n,e,t.startLineNumber,!1,o);if(!u)return null;let h=u.indentation;return u.action!==os.Indent&&(h=s.unshiftIndent(h)),h}return null}class pi{static indent(e,t,i){if(t===null||i===null)return[];const s=[];for(let o=0,r=i.length;o1){let a;for(a=i-1;a>=1;a--){const d=t.getLineContent(a);if(zf(d)>=0)break}if(a<1)return null;const l=t.getLineMaxColumn(a),c=PT(e.autoIndent,t,new N(a,l,a,l),e.languageConfigurationService);c&&(o=c.indentation+c.appendText)}return s&&(s===os.Indent&&(o=pi.shiftIndent(e,o)),s===os.Outdent&&(o=pi.unshiftIndent(e,o)),o=e.normalizeIndentation(o)),o||null}static _replaceJumpToNextIndent(e,t,i,s){let o="";const r=i.getStartPosition();if(e.insertSpaces){const a=e.visibleColumnFromColumn(t,r),l=e.indentSize,c=l-a%l;for(let d=0;dthis._compositionType(i,d,o,r,a,l));return new bs(4,c,{shouldPushStackElementBefore:ow(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,s,o,r){if(!t.isEmpty())return null;const a=t.getPosition(),l=Math.max(1,a.column-s),c=Math.min(e.getLineMaxColumn(a.lineNumber),a.column+o),d=new N(a.lineNumber,l,a.lineNumber,c);return e.getValueInRange(d)===i&&r===0?null:new CC(d,i,0,r)}static _typeCommand(e,t,i){return i?new sw(e,t,!0):new ys(e,t,!0)}static _enter(e,t,i,s){if(e.autoIndent===0)return pi._typeCommand(s,` -`,i);if(!t.tokenization.isCheapToTokenize(s.getStartPosition().lineNumber)||e.autoIndent===1){const l=t.getLineContent(s.startLineNumber),c=$s(l).substring(0,s.startColumn-1);return pi._typeCommand(s,` -`+e.normalizeIndentation(c),i)}const o=PT(e.autoIndent,t,s,e.languageConfigurationService);if(o){if(o.indentAction===os.None)return pi._typeCommand(s,` -`+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===os.Indent)return pi._typeCommand(s,` -`+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===os.IndentOutdent){const l=e.normalizeIndentation(o.indentation),c=e.normalizeIndentation(o.indentation+o.appendText),d=` + `,constraint:e,schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["left","right","up","down","prevBlankLine","nextBlankLine","wrappedLineStart","wrappedLineEnd","wrappedLineColumnCenter","wrappedLineFirstNonWhitespaceCharacter","wrappedLineLastNonWhitespaceCharacter","viewPortTop","viewPortCenter","viewPortBottom","viewPortIfOutside"]},by:{type:"string",enum:["line","wrappedLine","character","halfLine"]},value:{type:"number",default:1},select:{type:"boolean",default:!1}}}}]},n.RawDirection={Left:"left",Right:"right",Up:"up",Down:"down",PrevBlankLine:"prevBlankLine",NextBlankLine:"nextBlankLine",WrappedLineStart:"wrappedLineStart",WrappedLineFirstNonWhitespaceCharacter:"wrappedLineFirstNonWhitespaceCharacter",WrappedLineColumnCenter:"wrappedLineColumnCenter",WrappedLineEnd:"wrappedLineEnd",WrappedLineLastNonWhitespaceCharacter:"wrappedLineLastNonWhitespaceCharacter",ViewPortTop:"viewPortTop",ViewPortCenter:"viewPortCenter",ViewPortBottom:"viewPortBottom",ViewPortIfOutside:"viewPortIfOutside"},n.RawUnit={Line:"line",WrappedLine:"wrappedLine",Character:"character",HalfLine:"halfLine"};function t(i){if(!i.to)return null;let s;switch(i.to){case n.RawDirection.Left:s=0;break;case n.RawDirection.Right:s=1;break;case n.RawDirection.Up:s=2;break;case n.RawDirection.Down:s=3;break;case n.RawDirection.PrevBlankLine:s=4;break;case n.RawDirection.NextBlankLine:s=5;break;case n.RawDirection.WrappedLineStart:s=6;break;case n.RawDirection.WrappedLineFirstNonWhitespaceCharacter:s=7;break;case n.RawDirection.WrappedLineColumnCenter:s=8;break;case n.RawDirection.WrappedLineEnd:s=9;break;case n.RawDirection.WrappedLineLastNonWhitespaceCharacter:s=10;break;case n.RawDirection.ViewPortTop:s=11;break;case n.RawDirection.ViewPortBottom:s=13;break;case n.RawDirection.ViewPortCenter:s=12;break;case n.RawDirection.ViewPortIfOutside:s=14;break;default:return null}let o=0;switch(i.by){case n.RawUnit.Line:o=1;break;case n.RawUnit.WrappedLine:o=2;break;case n.RawUnit.Character:o=3;break;case n.RawUnit.HalfLine:o=4;break}return{direction:s,unit:o,select:!!i.select,value:i.value||1}}n.parse=t})(HS||(HS={}));function RT(n,e,t,i){const s=_p(e,t.startLineNumber,t.startColumn),o=i.getLanguageConfiguration(s.languageId);if(!o)return null;const r=s.getLineContent(),a=r.substr(0,t.startColumn-1-s.firstCharOffset);let l;t.isEmpty()?l=r.substr(t.startColumn-1-s.firstCharOffset):l=_p(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-s.firstCharOffset);let c="";if(t.startLineNumber>1&&s.firstCharOffset===0){const p=_p(e,t.startLineNumber-1);p.languageId===s.languageId&&(c=p.getLineContent())}const d=o.onEnter(n,c,a,l);if(!d)return null;const u=d.indentAction;let h=d.appendText;const f=d.removeText||0;h?u===ns.Indent&&(h=" "+h):u===ns.Indent||u===ns.IndentOutdent?h=" ":h="";let g=xj(e,t.startLineNumber,t.startColumn);return f&&(g=g.substring(0,g.length-f)),{indentAction:u,appendText:h,removeText:f,indentation:g}}var ewe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},twe=function(n,e){return function(t,i){e(t,i,n)}},_C;const L2=Object.create(null);function ju(n,e){if(e<=0)return"";L2[n]||(L2[n]=["",n]);const t=L2[n];for(let i=t.length;i<=e;i++)t[i]=t[i-1]+n;return t[e]}let gh=_C=class{static unshiftIndent(e,t,i,s,o){const r=Gi.visibleColumnFromColumn(e,t,i);if(o){const a=ju(" ",s),c=Gi.prevIndentTabStop(r,s)/s;return ju(a,c)}else{const a=" ",c=Gi.prevRenderTabStop(r,i)/i;return ju(a,c)}}static shiftIndent(e,t,i,s,o){const r=Gi.visibleColumnFromColumn(e,t,i);if(o){const a=ju(" ",s),c=Gi.nextIndentTabStop(r,s)/s;return ju(a,c)}else{const a=" ",c=Gi.nextRenderTabStop(r,i)/i;return ju(a,c)}}constructor(e,t,i){this._languageConfigurationService=i,this._opts=t,this._selection=e,this._selectionId=null,this._useLastEditRangeForCursorEndPosition=!1,this._selectionStartColumnStaysPut=!1}_addEditOperation(e,t,i){this._useLastEditRangeForCursorEndPosition?e.addTrackedEditOperation(t,i):e.addEditOperation(t,i)}getEditOperations(e,t){const i=this._selection.startLineNumber;let s=this._selection.endLineNumber;this._selection.endColumn===1&&i!==s&&(s=s-1);const{tabSize:o,indentSize:r,insertSpaces:a}=this._opts,l=i===s;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(i))&&(this._useLastEditRangeForCursorEndPosition=!0);let c=0,d=0;for(let u=i;u<=s;u++,c=d){d=0;const h=e.getLineContent(u);let f=Ys(h);if(this._opts.isUnshift&&(h.length===0||f===0)||!l&&!this._opts.isUnshift&&h.length===0)continue;if(f===-1&&(f=h.length),u>1&&Gi.visibleColumnFromColumn(h,f+1,o)%r!==0&&e.tokenization.isCheapToTokenize(u-1)){const _=RT(this._opts.autoIndent,e,new N(u-1,e.getLineMaxColumn(u-1),u-1,e.getLineMaxColumn(u-1)),this._languageConfigurationService);if(_){if(d=c,_.appendText)for(let v=0,b=_.appendText.length;v1){let s,o=-1;for(s=e-1;s>=1;s--){if(n.tokenization.getLanguageIdAtPosition(s,0)!==i)return o;const r=n.getLineContent(s);if(t.shouldIgnore(r)||/^\s+$/.test(r)||r===""){o=s;continue}return s}}return-1}function S3(n,e,t,i=!0,s){if(n<4)return null;const o=s.getLanguageConfiguration(e.tokenization.getLanguageId()).indentRulesSupport;if(!o)return null;if(t<=1)return{indentation:"",action:null};for(let l=t-1;l>0&&e.getLineContent(l)==="";l--)if(l===1)return{indentation:"",action:null};const r=swe(e,t,o);if(r<0)return null;if(r<1)return{indentation:"",action:null};const a=e.getLineContent(r);if(o.shouldIncrease(a)||o.shouldIndentNextLine(a))return{indentation:zs(a),action:ns.Indent,line:r};if(o.shouldDecrease(a))return{indentation:zs(a),action:null,line:r};{if(r===1)return{indentation:zs(e.getLineContent(r)),action:null,line:r};const l=r-1,c=o.getIndentMetadata(e.getLineContent(l));if(!(c&3)&&c&4){let d=0;for(let u=l-1;u>0;u--)if(!o.shouldIndentNextLine(e.getLineContent(u))){d=u;break}return{indentation:zs(e.getLineContent(d+1)),action:null,line:d+1}}if(i)return{indentation:zs(e.getLineContent(r)),action:null,line:r};for(let d=r;d>0;d--){const u=e.getLineContent(d);if(o.shouldIncrease(u))return{indentation:zs(u),action:ns.Indent,line:d};if(o.shouldIndentNextLine(u)){let h=0;for(let f=d-1;f>0;f--)if(!o.shouldIndentNextLine(e.getLineContent(d))){h=f;break}return{indentation:zs(e.getLineContent(h+1)),action:null,line:h+1}}else if(o.shouldDecrease(u))return{indentation:zs(u),action:null,line:d}}return{indentation:zs(e.getLineContent(1)),action:null,line:1}}}function owe(n,e,t,i,s){if(n<4)return null;e.tokenization.forceTokenization(t.startLineNumber);const o=e.tokenization.getLineTokens(t.startLineNumber),r=JL(o,t.startColumn-1),a=r.getLineContent();let l=!1,c;r.firstCharOffset>0&&o.getLanguageId(0)!==r.languageId?(l=!0,c=a.substr(0,t.startColumn-1-r.firstCharOffset)):c=o.getLineContent().substring(0,t.startColumn-1);let d;t.isEmpty()?d=a.substr(t.startColumn-1-r.firstCharOffset):d=_p(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-r.firstCharOffset);const u=s.getLanguageConfiguration(r.languageId).indentRulesSupport;if(!u)return null;const h=c,f=zs(c),g={tokenization:{getLineTokens:b=>e.tokenization.getLineTokens(b),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(b,y)=>e.getLanguageIdAtPosition(b,y)},getLineContent:b=>b===t.startLineNumber?h:e.getLineContent(b)},p=zs(o.getLineContent()),_=S3(n,g,t.startLineNumber+1,void 0,s);if(!_){const b=l?p:f;return{beforeEnter:b,afterEnter:b}}let v=l?p:_.indentation;return _.action===ns.Indent&&(v=i.shiftIndent(v)),u.shouldDecrease(d)&&(v=i.unshiftIndent(v)),{beforeEnter:l?p:f,afterEnter:v}}function rwe(n,e,t,i,s,o){if(n<4)return null;const r=_p(e,t.startLineNumber,t.startColumn);if(r.firstCharOffset)return null;const a=o.getLanguageConfiguration(r.languageId).indentRulesSupport;if(!a)return null;const l=r.getLineContent(),c=l.substr(0,t.startColumn-1-r.firstCharOffset);let d;if(t.isEmpty()?d=l.substr(t.startColumn-1-r.firstCharOffset):d=_p(e,t.endLineNumber,t.endColumn).getLineContent().substr(t.endColumn-1-r.firstCharOffset),!a.shouldDecrease(c+d)&&a.shouldDecrease(c+i+d)){const u=S3(n,e,t.startLineNumber,!1,o);if(!u)return null;let h=u.indentation;return u.action!==ns.Indent&&(h=s.unshiftIndent(h)),h}return null}class gi{static indent(e,t,i){if(t===null||i===null)return[];const s=[];for(let o=0,r=i.length;o1){let a;for(a=i-1;a>=1;a--){const d=t.getLineContent(a);if(Uf(d)>=0)break}if(a<1)return null;const l=t.getLineMaxColumn(a),c=RT(e.autoIndent,t,new N(a,l,a,l),e.languageConfigurationService);c&&(o=c.indentation+c.appendText)}return s&&(s===ns.Indent&&(o=gi.shiftIndent(e,o)),s===ns.Outdent&&(o=gi.unshiftIndent(e,o)),o=e.normalizeIndentation(o)),o||null}static _replaceJumpToNextIndent(e,t,i,s){let o="";const r=i.getStartPosition();if(e.insertSpaces){const a=e.visibleColumnFromColumn(t,r),l=e.indentSize,c=l-a%l;for(let d=0;dthis._compositionType(i,d,o,r,a,l));return new _s(4,c,{shouldPushStackElementBefore:Jy(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,s,o,r){if(!t.isEmpty())return null;const a=t.getPosition(),l=Math.max(1,a.column-s),c=Math.min(e.getLineMaxColumn(a.lineNumber),a.column+o),d=new N(a.lineNumber,l,a.lineNumber,c);return e.getValueInRange(d)===i&&r===0?null:new mC(d,i,0,r)}static _typeCommand(e,t,i){return i?new Qy(e,t,!0):new vs(e,t,!0)}static _enter(e,t,i,s){if(e.autoIndent===0)return gi._typeCommand(s,` +`,i);if(!t.tokenization.isCheapToTokenize(s.getStartPosition().lineNumber)||e.autoIndent===1){const l=t.getLineContent(s.startLineNumber),c=zs(l).substring(0,s.startColumn-1);return gi._typeCommand(s,` +`+e.normalizeIndentation(c),i)}const o=RT(e.autoIndent,t,s,e.languageConfigurationService);if(o){if(o.indentAction===ns.None)return gi._typeCommand(s,` +`+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===ns.Indent)return gi._typeCommand(s,` +`+e.normalizeIndentation(o.indentation+o.appendText),i);if(o.indentAction===ns.IndentOutdent){const l=e.normalizeIndentation(o.indentation),c=e.normalizeIndentation(o.indentation+o.appendText),d=` `+c+` -`+l;return i?new sw(s,d,!0):new CC(s,d,-1,c.length-l.length,!0)}else if(o.indentAction===os.Outdent){const l=pi.unshiftIndent(e,o.indentation);return pi._typeCommand(s,` -`+e.normalizeIndentation(l+o.appendText),i)}}const r=t.getLineContent(s.startLineNumber),a=$s(r).substring(0,s.startColumn-1);if(e.autoIndent>=4){const l=Wye(e.autoIndent,t,s,{unshiftIndent:c=>pi.unshiftIndent(e,c),shiftIndent:c=>pi.shiftIndent(e,c),normalizeIndentation:c=>e.normalizeIndentation(c)},e.languageConfigurationService);if(l){let c=e.visibleColumnFromColumn(t,s.getEndPosition());const d=s.endColumn,u=t.getLineContent(s.endLineNumber),h=Qs(u);if(h>=0?s=s.setEndPosition(s.endLineNumber,Math.max(s.endColumn,h+1)):s=s.setEndPosition(s.endLineNumber,t.getLineMaxColumn(s.endLineNumber)),i)return new sw(s,` -`+e.normalizeIndentation(l.afterEnter),!0);{let f=0;return d<=h+1&&(e.insertSpaces||(c=Math.ceil(c/e.indentSize)),f=Math.min(c+1-e.normalizeIndentation(l.afterEnter).length-1,0)),new CC(s,` -`+e.normalizeIndentation(l.afterEnter),0,f,!0)}}}return pi._typeCommand(s,` -`+e.normalizeIndentation(a),i)}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let s=0,o=i.length;spi.shiftIndent(e,a),unshiftIndent:a=>pi.unshiftIndent(e,a)},e.languageConfigurationService);if(r===null)return null;if(r!==e.normalizeIndentation(o)){const a=t.getLineFirstNonWhitespaceColumn(i.startLineNumber);return a===0?pi._typeCommand(new N(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(r)+s,!1):pi._typeCommand(new N(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(r)+t.getLineContent(i.startLineNumber).substring(a-1,i.startColumn-1)+s,!1)}return null}static _isAutoClosingOvertype(e,t,i,s,o){if(e.autoClosingOvertype==="never"||!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(o))return!1;for(let r=0,a=i.length;r2?d.charCodeAt(c.column-2):0)===92&&h)return!1;if(e.autoClosingOvertype==="auto"){let g=!1;for(let p=0,_=s.length;p<_;p++){const v=s[p];if(c.lineNumber===v.startLineNumber&&c.column===v.startColumn){g=!0;break}}if(!g)return!1}}return!0}static _runAutoClosingOvertype(e,t,i,s,o){const r=[];for(let a=0,l=s.length;at.startsWith(l.open)),a=o.some(l=>t.startsWith(l.close));return!r&&a}static _findAutoClosingPairOpen(e,t,i,s){const o=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(s);if(!o)return null;let r=null;for(const a of o)if(r===null||a.open.length>r.open.length){let l=!0;for(const c of i)if(t.getValueInRange(new N(c.lineNumber,c.column-a.open.length+1,c.lineNumber,c.column))+s!==a.open){l=!1;break}l&&(r=a)}return r}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;const i=t.close.charAt(t.close.length-1),s=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(i)||[];let o=null;for(const r of s)r.open!==t.open&&t.open.includes(r.open)&&t.close.endsWith(r.close)&&(!o||r.open.length>o.open.length)&&(o=r);return o}static _getAutoClosingPairClose(e,t,i,s,o){for(const g of i)if(!g.isEmpty())return null;const r=i.map(g=>{const p=g.getPosition();return o?{lineNumber:p.lineNumber,beforeColumn:p.column-s.length,afterColumn:p.column}:{lineNumber:p.lineNumber,beforeColumn:p.column,afterColumn:p.column}}),a=this._findAutoClosingPairOpen(e,t,r.map(g=>new V(g.lineNumber,g.beforeColumn)),s);if(!a)return null;let l,c;if($c(s)?(l=e.autoClosingQuotes,c=e.shouldAutoCloseBefore.quote):(e.blockCommentStartToken?a.open.includes(e.blockCommentStartToken):!1)?(l=e.autoClosingComments,c=e.shouldAutoCloseBefore.comment):(l=e.autoClosingBrackets,c=e.shouldAutoCloseBefore.bracket),l==="never")return null;const u=this._findContainedAutoClosingPair(e,a),h=u?u.close:"";let f=!0;for(const g of r){const{lineNumber:p,beforeColumn:_,afterColumn:v}=g,b=t.getLineContent(p),y=b.substring(0,_-1),w=b.substring(v-1);if(w.startsWith(h)||(f=!1),w.length>0){const D=w.charAt(0);if(!pi._isBeforeClosingBrace(e,w)&&!c(D))return null}if(a.open.length===1&&(s==="'"||s==='"')&&l!=="always"){const D=wm(e.wordSeparators);if(y.length>0){const k=y.charCodeAt(y.length-1);if(D.get(k)===0)return null}}if(!t.tokenization.isCheapToTokenize(p))return null;t.tokenization.forceTokenization(p);const C=t.tokenization.getLineTokens(p),L=rD(C,_-1);if(!a.shouldAutoClose(L,_-L.firstCharOffset))return null;const x=a.findNeutralCharacter();if(x){const D=t.tokenization.getTokenTypeIfInsertingCharacter(p,_,x);if(!a.isOK(D))return null}}return f?a.close.substring(0,a.close.length-h.length):a.close}static _runAutoClosingOpenCharType(e,t,i,s,o,r,a){const l=[];for(let c=0,d=s.length;cnew ys(new N(h.positionLineNumber,h.positionColumn,h.positionLineNumber,h.positionColumn+1),"",!1));return new bs(4,u,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const d=this._getAutoClosingPairClose(t,i,o,l,!0);return d!==null?this._runAutoClosingOpenCharType(e,t,i,o,l,!0,d):null}static typeWithInterceptors(e,t,i,s,o,r,a){if(!e&&a===` -`){const d=[];for(let u=0,h=o.length;u{const s=t.get(qt).getFocusedCodeEditor();return s&&s.hasTextFocus()?this._runEditorCommand(t,s,i):!1}),e.addImplementation(1e3,"generic-dom-input-textarea",(t,i)=>{const s=ia();return s&&["input","textarea"].indexOf(s.tagName.toLowerCase())>=0?(this.runDOMCommand(s),!0):!1}),e.addImplementation(0,"generic-dom",(t,i)=>{const s=t.get(qt).getActiveCodeEditor();return s?(s.focus(),this._runEditorCommand(t,s,i)):!1})}_runEditorCommand(e,t,i){const s=this.runEditorCommand(e,t,i);return s||!0}}var Qi;(function(n){class e extends ri{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){if(!y.position)return;b.model.pushStackElement(),b.setCursorStates(y.source,3,[bn.moveTo(b,b.getPrimaryCursorState(),this._inSelectionMode,y.position,y.viewPosition)])&&y.revealType!==2&&b.revealPrimaryCursor(y.source,!0,!0)}}n.MoveTo=Ee(new e({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),n.MoveToSelect=Ee(new e({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class t extends ri{runCoreEditorCommand(b,y){b.model.pushStackElement();const w=this._getColumnSelectResult(b,b.getPrimaryCursorState(),b.getCursorColumnSelectData(),y);w!==null&&(b.setCursorStates(y.source,3,w.viewStates.map(C=>ot.fromViewState(C))),b.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:w.fromLineNumber,fromViewVisualColumn:w.fromVisualColumn,toViewLineNumber:w.toLineNumber,toViewVisualColumn:w.toVisualColumn}),w.reversed?b.revealTopMostCursor(y.source):b.revealBottomMostCursor(y.source))}}n.ColumnSelect=Ee(new class extends t{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(v,b,y,w){if(typeof w.position>"u"||typeof w.viewPosition>"u"||typeof w.mouseColumn>"u")return null;const C=v.model.validatePosition(w.position),L=v.coordinatesConverter.validateViewPosition(new V(w.viewPosition.lineNumber,w.viewPosition.column),C),x=w.doColumnSelect?y.fromViewLineNumber:L.lineNumber,D=w.doColumnSelect?y.fromViewVisualColumn:w.mouseColumn-1;return uh.columnSelect(v.cursorConfig,v,x,D,L.lineNumber,w.mouseColumn-1)}}),n.CursorColumnSelectLeft=Ee(new class extends t{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:pt,kbExpr:$.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(v,b,y,w){return uh.columnSelectLeft(v.cursorConfig,v,y)}}),n.CursorColumnSelectRight=Ee(new class extends t{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:pt,kbExpr:$.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(v,b,y,w){return uh.columnSelectRight(v.cursorConfig,v,y)}});class i extends t{constructor(b){super(b),this._isPaged=b.isPaged}_getColumnSelectResult(b,y,w,C){return uh.columnSelectUp(b.cursorConfig,b,w,this._isPaged)}}n.CursorColumnSelectUp=Ee(new i({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:pt,kbExpr:$.textInputFocus,primary:3600,linux:{primary:0}}})),n.CursorColumnSelectPageUp=Ee(new i({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:pt,kbExpr:$.textInputFocus,primary:3595,linux:{primary:0}}}));class s extends t{constructor(b){super(b),this._isPaged=b.isPaged}_getColumnSelectResult(b,y,w,C){return uh.columnSelectDown(b.cursorConfig,b,w,this._isPaged)}}n.CursorColumnSelectDown=Ee(new s({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:pt,kbExpr:$.textInputFocus,primary:3602,linux:{primary:0}}})),n.CursorColumnSelectPageDown=Ee(new s({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:pt,kbExpr:$.textInputFocus,primary:3596,linux:{primary:0}}}));class o extends ri{constructor(){super({id:"cursorMove",precondition:void 0,description:YS.description})}runCoreEditorCommand(b,y){const w=YS.parse(y);w&&this._runCursorMove(b,y.source,w)}_runCursorMove(b,y,w){b.model.pushStackElement(),b.setCursorStates(y,3,o._move(b,b.getCursorStates(),w)),b.revealPrimaryCursor(y,!0)}static _move(b,y,w){const C=w.select,L=w.value;switch(w.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return bn.simpleMove(b,y,w.direction,C,L,w.unit);case 11:case 13:case 12:case 14:return bn.viewportMove(b,y,w.direction,C,L);default:return null}}}n.CursorMoveImpl=o,n.CursorMove=Ee(new o);class r extends ri{constructor(b){super(b),this._staticArgs=b.args}runCoreEditorCommand(b,y){let w=this._staticArgs;this._staticArgs.value===-1&&(w={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:y.pageSize||b.cursorConfig.pageSize}),b.model.pushStackElement(),b.setCursorStates(y.source,3,bn.simpleMove(b,b.getCursorStates(),w.direction,w.select,w.value,w.unit)),b.revealPrimaryCursor(y.source,!0)}}n.CursorLeft=Ee(new r({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:pt,kbExpr:$.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),n.CursorLeftSelect=Ee(new r({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:pt,kbExpr:$.textInputFocus,primary:1039}})),n.CursorRight=Ee(new r({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:pt,kbExpr:$.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),n.CursorRightSelect=Ee(new r({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:pt,kbExpr:$.textInputFocus,primary:1041}})),n.CursorUp=Ee(new r({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:pt,kbExpr:$.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),n.CursorUpSelect=Ee(new r({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:pt,kbExpr:$.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),n.CursorPageUp=Ee(new r({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:pt,kbExpr:$.textInputFocus,primary:11}})),n.CursorPageUpSelect=Ee(new r({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:pt,kbExpr:$.textInputFocus,primary:1035}})),n.CursorDown=Ee(new r({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:pt,kbExpr:$.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),n.CursorDownSelect=Ee(new r({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:pt,kbExpr:$.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),n.CursorPageDown=Ee(new r({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:pt,kbExpr:$.textInputFocus,primary:12}})),n.CursorPageDownSelect=Ee(new r({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:pt,kbExpr:$.textInputFocus,primary:1036}})),n.CreateCursor=Ee(new class extends ri{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(v,b){if(!b.position)return;let y;b.wholeLine?y=bn.line(v,v.getPrimaryCursorState(),!1,b.position,b.viewPosition):y=bn.moveTo(v,v.getPrimaryCursorState(),!1,b.position,b.viewPosition);const w=v.getCursorStates();if(w.length>1){const C=y.modelState?y.modelState.position:null,L=y.viewState?y.viewState.position:null;for(let x=0,D=w.length;xL&&(C=L);const x=new N(C,1,C,v.model.getLineMaxColumn(C));let D=0;if(y.at)switch(y.at){case Zg.RawAtArgument.Top:D=3;break;case Zg.RawAtArgument.Center:D=1;break;case Zg.RawAtArgument.Bottom:D=4;break}const k=v.coordinatesConverter.convertModelRangeToViewRange(x);v.revealRange(b.source,!1,k,D,0)}}),n.SelectAll=new class extends OT{constructor(){super(kme)}runDOMCommand(v){Lr&&(v.focus(),v.select()),v.ownerDocument.execCommand("selectAll")}runEditorCommand(v,b,y){const w=b._getViewModel();w&&this.runCoreEditorCommand(w,y)}runCoreEditorCommand(v,b){v.model.pushStackElement(),v.setCursorStates("keyboard",3,[bn.selectAll(v,v.getPrimaryCursorState())])}},n.SetSelection=Ee(new class extends ri{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(v,b){b.selection&&(v.model.pushStackElement(),v.setCursorStates(b.source,3,[ot.fromModelSelection(b.selection)]))}})})(Qi||(Qi={}));const Hye=xe.and($.textInputFocus,$.columnSelection);function o0(n,e){Ws.registerKeybindingRule({id:n,primary:e,when:Hye,weight:pt+1})}o0(Qi.CursorColumnSelectLeft.id,1039);o0(Qi.CursorColumnSelectRight.id,1041);o0(Qi.CursorColumnSelectUp.id,1040);o0(Qi.CursorColumnSelectPageUp.id,1035);o0(Qi.CursorColumnSelectDown.id,1042);o0(Qi.CursorColumnSelectPageDown.id,1036);function k7(n){return n.register(),n}var E7;(function(n){class e extends Er{runEditorCommand(i,s,o){const r=s._getViewModel();r&&this.runCoreEditingCommand(s,r,o||{})}}n.CoreEditingCommand=e,n.LineBreakInsert=Ee(new class extends e{constructor(){super({id:"lineBreakInsert",precondition:$.writable,kbOpts:{weight:pt,kbExpr:$.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(t,i,s){t.pushUndoStop(),t.executeCommands(this.id,pi.lineBreakInsert(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection)))}}),n.Outdent=Ee(new class extends e{constructor(){super({id:"outdent",precondition:$.writable,kbOpts:{weight:pt,kbExpr:xe.and($.editorTextFocus,$.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(t,i,s){t.pushUndoStop(),t.executeCommands(this.id,pi.outdent(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),n.Tab=Ee(new class extends e{constructor(){super({id:"tab",precondition:$.writable,kbOpts:{weight:pt,kbExpr:xe.and($.editorTextFocus,$.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(t,i,s){t.pushUndoStop(),t.executeCommands(this.id,pi.tab(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),n.DeleteLeft=Ee(new class extends e{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:pt,kbExpr:$.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(t,i,s){const[o,r]=wf.deleteLeft(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection),i.getCursorAutoClosedCharacters());o&&t.pushUndoStop(),t.executeCommands(this.id,r),i.setPrevEditOperationType(2)}}),n.DeleteRight=Ee(new class extends e{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:pt,kbExpr:$.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(t,i,s){const[o,r]=wf.deleteRight(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection));o&&t.pushUndoStop(),t.executeCommands(this.id,r),i.setPrevEditOperationType(3)}}),n.Undo=new class extends OT{constructor(){super(cj)}runDOMCommand(t){t.ownerDocument.execCommand("undo")}runEditorCommand(t,i,s){if(!(!i.hasModel()||i.getOption(90)===!0))return i.getModel().undo()}},n.Redo=new class extends OT{constructor(){super(dj)}runDOMCommand(t){t.ownerDocument.execCommand("redo")}runEditorCommand(t,i,s){if(!(!i.hasModel()||i.getOption(90)===!0))return i.getModel().redo()}}})(E7||(E7={}));class A7 extends sD{constructor(e,t,i){super({id:e,precondition:void 0,description:i}),this._handlerId=t}runCommand(e,t){const i=e.get(qt).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function Yf(n,e){k7(new A7("default:"+n,n)),k7(new A7(n,n,e))}Yf("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]});Yf("replacePreviousChar");Yf("compositionType");Yf("compositionStart");Yf("compositionEnd");Yf("paste");Yf("cut");class $ye{constructor(e,t,i,s){this.configuration=e,this.viewModel=t,this.userInputEvents=i,this.commandDelegate=s}paste(e,t,i,s){this.commandDelegate.paste(e,t,i,s)}type(e){this.commandDelegate.type(e)}compositionType(e,t,i,s){this.commandDelegate.compositionType(e,t,i,s)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){Qi.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column=4?this._selectAll():e.mouseDownCount===3?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position,e.revealType):this._lastCursorLineSelect(e.position,e.revealType):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):e.mouseDownCount===2?e.onInjectedText||(this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position,e.revealType):e.inSelectionMode?this._wordSelectDrag(e.position,e.revealType):this._wordSelect(e.position,e.revealType)):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!0):e.inSelectionMode?this._lastCursorMoveToSelect(e.position,e.revealType):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey?this._columnSelect(e.position,e.mouseColumn,!0):s?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position,e.revealType):this.moveTo(e.position,e.revealType)}_usualArgs(e,t){return e=this._validateViewColumn(e),{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,revealType:t}}moveTo(e,t){Qi.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){Qi.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,i){e=this._validateViewColumn(e),Qi.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),Qi.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){Qi.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){Qi.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){Qi.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){Qi.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){Qi.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){Qi.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){Qi.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){Qi.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){Qi.SelectAll.runCoreEditorCommand(this.viewModel,{source:"mouse"})}_convertViewToModelPosition(e){return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(e)}emitKeyDown(e){this.userInputEvents.emitKeyDown(e)}emitKeyUp(e){this.userInputEvents.emitKeyUp(e)}emitContextMenu(e){this.userInputEvents.emitContextMenu(e)}emitMouseMove(e){this.userInputEvents.emitMouseMove(e)}emitMouseLeave(e){this.userInputEvents.emitMouseLeave(e)}emitMouseUp(e){this.userInputEvents.emitMouseUp(e)}emitMouseDown(e){this.userInputEvents.emitMouseDown(e)}emitMouseDrag(e){this.userInputEvents.emitMouseDrag(e)}emitMouseDrop(e){this.userInputEvents.emitMouseDrop(e)}emitMouseDropCanceled(){this.userInputEvents.emitMouseDropCanceled()}emitMouseWheel(e){this.userInputEvents.emitMouseWheel(e)}}class CD{constructor(e){this.onKeyDown=null,this.onKeyUp=null,this.onContextMenu=null,this.onMouseMove=null,this.onMouseLeave=null,this.onMouseDown=null,this.onMouseUp=null,this.onMouseDrag=null,this.onMouseDrop=null,this.onMouseDropCanceled=null,this.onMouseWheel=null,this._coordinatesConverter=e}emitKeyDown(e){var t;(t=this.onKeyDown)===null||t===void 0||t.call(this,e)}emitKeyUp(e){var t;(t=this.onKeyUp)===null||t===void 0||t.call(this,e)}emitContextMenu(e){var t;(t=this.onContextMenu)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseMove(e){var t;(t=this.onMouseMove)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){var t;(t=this.onMouseLeave)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDown(e){var t;(t=this.onMouseDown)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseUp(e){var t;(t=this.onMouseUp)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){var t;(t=this.onMouseDrag)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){var t;(t=this.onMouseDrop)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){var e;(e=this.onMouseDropCanceled)===null||e===void 0||e.call(this)}emitMouseWheel(e){var t;(t=this.onMouseWheel)===null||t===void 0||t.call(this,e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return CD.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){const i=Object.assign({},e);return i.position&&(i.position=t.convertViewPositionToModelPosition(i.position)),i.range&&(i.range=t.convertViewRangeToModelRange(i.range)),(i.type===5||i.type===8)&&(i.detail=this.convertViewToModelViewZoneData(i.detail,t)),i}static convertViewToModelViewZoneData(e,t){return{viewZoneId:e.viewZoneId,positionBefore:e.positionBefore?t.convertViewPositionToModelPosition(e.positionBefore):e.positionBefore,positionAfter:e.positionAfter?t.convertViewPositionToModelPosition(e.positionAfter):e.positionAfter,position:t.convertViewPositionToModelPosition(e.position),afterLineNumber:t.convertViewPositionToModelPosition(new V(e.afterLineNumber,1)).lineNumber}}}class wq{constructor(e){this._createLine=e,this._set(1,[])}flush(){this._set(1,[])}_set(e,t){this._lines=t,this._rendLineNumberStart=e}_get(){return{rendLineNumberStart:this._rendLineNumberStart,lines:this._lines}}getStartLineNumber(){return this._rendLineNumberStart}getEndLineNumber(){return this._rendLineNumberStart+this._lines.length-1}getCount(){return this._lines.length}getLine(e){const t=e-this._rendLineNumberStart;if(t<0||t>=this._lines.length)throw new Gi("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(this.getCount()===0)return null;const i=this.getStartLineNumber(),s=this.getEndLineNumber();if(ts)return null;let o=0,r=0;for(let l=i;l<=s;l++){const c=l-this._rendLineNumberStart;e<=l&&l<=t&&(r===0?(o=c,r=1):r++)}if(e=s&&a<=o&&(this._lines[a-this._rendLineNumberStart].onContentChanged(),r=!0);return r}onLinesInserted(e,t){if(this.getCount()===0)return null;const i=t-e+1,s=this.getStartLineNumber(),o=this.getEndLineNumber();if(e<=s)return this._rendLineNumberStart+=i,null;if(e>o)return null;if(i+e>o)return this._lines.splice(e-this._rendLineNumberStart,o-e+1);const r=[];for(let u=0;ui)continue;const l=Math.max(t,a.fromLineNumber),c=Math.min(i,a.toLineNumber);for(let d=l;d<=c;d++){const u=d-this._rendLineNumberStart;this._lines[u].onTokensChanged(),s=!0}}return s}}class Cq{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new wq(()=>this._host.createVisibleLine())}_createDomNode(){const e=vt(document.createElement("div"));return e.setClassName("view-layer"),e.setPosition("absolute"),e.domNode.setAttribute("role","presentation"),e.domNode.setAttribute("aria-hidden","true"),e}onConfigurationChanged(e){return!!e.hasChanged(143)}onFlushed(e){return this._linesCollection.flush(),!0}onLinesChanged(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){const t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(let i=0,s=t.length;it){const r=t,a=Math.min(i,o.rendLineNumberStart-1);r<=a&&(this._insertLinesBefore(o,r,a,s,t),o.linesLength+=a-r+1)}else if(o.rendLineNumberStart0&&(this._removeLinesBefore(o,r),o.linesLength-=r)}if(o.rendLineNumberStart=t,o.rendLineNumberStart+o.linesLength-1i){const r=Math.max(0,i-o.rendLineNumberStart+1),l=o.linesLength-1-r+1;l>0&&(this._removeLinesAfter(o,l),o.linesLength-=l)}return this._finishRendering(o,!1,s),o}_renderUntouchedLines(e,t,i,s,o){const r=e.rendLineNumberStart,a=e.lines;for(let l=t;l<=i;l++){const c=r+l;a[l].layoutLine(c,s[c-o])}}_insertLinesBefore(e,t,i,s,o){const r=[];let a=0;for(let l=t;l<=i;l++)r[a++]=this.host.createVisibleLine();e.lines=r.concat(e.lines)}_removeLinesBefore(e,t){for(let i=0;i=0;a--){const l=e.lines[a];s[a]&&(l.setDomNode(r),r=r.previousSibling)}}_finishRenderingInvalidLines(e,t,i){const s=document.createElement("div");jl._ttPolicy&&(t=jl._ttPolicy.createHTML(t)),s.innerHTML=t;for(let o=0;on});jl._sb=new aD(1e5);class Sq extends lo{constructor(e){super(e),this._visibleLines=new Cq(this),this.domNode=this._visibleLines.domNode;const i=this._context.configuration.options.get(50);Mn(this.domNode,i),this._dynamicOverlays=[],this._isFocused=!1,this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;ei.shouldRender());for(let i=0,s=t.length;i'),s.appendString(o),s.appendString(""),!0)}layoutLine(e,t){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(this._lineHeight))}}class jye extends Sq{constructor(e){super(e);const i=this._context.configuration.options.get(143);this._contentWidth=i.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const i=this._context.configuration.options.get(143);return this._contentWidth=i.contentWidth,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollWidthChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e),this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth))}}class qye extends Sq{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(143);this._contentLeft=i.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),Mn(this.domNode,t.get(50))}onConfigurationChanged(e){const t=this._context.configuration.options;Mn(this.domNode,t.get(50));const i=t.get(143);return this._contentLeft=i.contentLeft,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollHeightChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e);const t=Math.min(e.scrollHeight,1e6);this.domNode.setHeight(t),this.domNode.setWidth(this._contentLeft)}}class Gye extends lo{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=vt(document.createElement("div")),sl.write(this.domNode,1),this.domNode.setClassName("contentWidgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=vt(document.createElement("div")),sl.write(this.overflowingContentWidgetsDomNode,2),this.overflowingContentWidgetsDomNode.setClassName("overflowingContentWidgets")}dispose(){super.dispose(),this._widgets={}}onConfigurationChanged(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onConfigurationChanged(e);return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLineMappingChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesDeleted(e){return this._updateAnchorsViewPositions(),!0}onLinesInserted(e){return this._updateAnchorsViewPositions(),!0}onScrollChanged(e){return!0}onZonesChanged(e){return!0}_updateAnchorsViewPositions(){const e=Object.keys(this._widgets);for(const t of e)this._widgets[t].updateAnchorViewPosition()}addWidget(e){const t=new Kye(this._context,this._viewDomNode,e);this._widgets[t.id]=t,t.allowEditorOverflow?this.overflowingContentWidgetsDomNode.appendChild(t.domNode):this.domNode.appendChild(t.domNode),this.setShouldRender()}setWidgetPosition(e,t,i,s,o){this._widgets[e.getId()].setPosition(t,i,s,o),this.setShouldRender()}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const i=this._widgets[t];delete this._widgets[t];const s=i.domNode.domNode;s.parentNode.removeChild(s),s.removeAttribute("monaco-visible-content-widget"),this.setShouldRender()}}shouldSuppressMouseDownOnWidget(e){return this._widgets.hasOwnProperty(e)?this._widgets[e].suppressMouseDown:!1}onBeforeRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onBeforeRender(e)}prepareRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].prepareRender(e)}render(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].render(e)}}class Kye{constructor(e,t,i){this._primaryAnchor=new T0(null,null),this._secondaryAnchor=new T0(null,null),this._context=e,this._viewDomNode=t,this._actual=i,this.domNode=vt(this._actual.getDomNode()),this.id=this._actual.getId(),this.allowEditorOverflow=this._actual.allowEditorOverflow||!1,this.suppressMouseDown=this._actual.suppressMouseDown||!1;const s=this._context.configuration.options,o=s.get(143);this._fixedOverflowWidgets=s.get(42),this._contentWidth=o.contentWidth,this._contentLeft=o.contentLeft,this._lineHeight=s.get(66),this._affinity=null,this._preference=[],this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1,this._maxWidth=this._getMaxWidth(),this._isVisible=!1,this._renderData=null,this.domNode.setPosition(this._fixedOverflowWidgets&&this.allowEditorOverflow?"fixed":"absolute"),this.domNode.setDisplay("none"),this.domNode.setVisibility("hidden"),this.domNode.setAttribute("widgetId",this.id),this.domNode.setMaxWidth(this._maxWidth)}onConfigurationChanged(e){const t=this._context.configuration.options;if(this._lineHeight=t.get(66),e.hasChanged(143)){const i=t.get(143);this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._maxWidth=this._getMaxWidth()}}updateAnchorViewPosition(){this._setPosition(this._affinity,this._primaryAnchor.modelPosition,this._secondaryAnchor.modelPosition)}_setPosition(e,t,i){this._affinity=e,this._primaryAnchor=s(t,this._context.viewModel,this._affinity),this._secondaryAnchor=s(i,this._context.viewModel,this._affinity);function s(o,r,a){if(!o)return new T0(null,null);const l=r.model.validatePosition(o);if(r.coordinatesConverter.modelPositionIsVisible(l)){const c=r.coordinatesConverter.convertModelPositionToViewPosition(l,a??void 0);return new T0(o,c)}return new T0(o,null)}}_getMaxWidth(){const e=this.domNode.domNode.ownerDocument,t=e.defaultView;return this.allowEditorOverflow?(t==null?void 0:t.innerWidth)||e.documentElement.offsetWidth||e.body.offsetWidth:this._contentWidth}setPosition(e,t,i,s){this._setPosition(s,e,t),this._preference=i,this._primaryAnchor.viewPosition&&this._preference&&this._preference.length>0?this.domNode.setDisplay("block"):this.domNode.setDisplay("none"),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,t,i,s){const o=e.top,r=o,a=e.top+e.height,l=s.viewportHeight-a,c=o-i,d=r>=i,u=a,h=l>=i;let f=e.left;return f+t>s.scrollLeft+s.viewportWidth&&(f=s.scrollLeft+s.viewportWidth-t),fc){const f=h-(c-s);h-=f,i-=f}if(h=v,w=f+i<=g.height-b;return this._fixedOverflowWidgets?{fitsAbove:y,aboveTop:Math.max(h,v),fitsBelow:w,belowTop:f,left:_}:{fitsAbove:y,aboveTop:a,fitsBelow:w,belowTop:l,left:p}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new N0(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){var t,i;const s=a(this._primaryAnchor.viewPosition,this._affinity,this._lineHeight),o=((t=this._secondaryAnchor.viewPosition)===null||t===void 0?void 0:t.lineNumber)===((i=this._primaryAnchor.viewPosition)===null||i===void 0?void 0:i.lineNumber)?this._secondaryAnchor.viewPosition:null,r=a(o,this._affinity,this._lineHeight);return{primary:s,secondary:r};function a(l,c,d){if(!l)return null;const u=e.visibleRangeForPosition(l);if(!u)return null;const h=l.column===1&&c===3?0:u.left,f=e.getVerticalOffsetForLineNumber(l.lineNumber)-e.scrollTop;return new I7(f,h,d)}}_reduceAnchorCoordinates(e,t,i){if(!t)return e;const s=this._context.configuration.options.get(50);let o=t.left;return oe.endLineNumber||this.domNode.setMaxWidth(this._maxWidth)}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){if(!this._renderData){this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this.domNode.setVisibility("hidden")),typeof this._actual.afterRender=="function"&&N2(this._actual.afterRender,this._actual,null);return}this.allowEditorOverflow?(this.domNode.setTop(this._renderData.coordinate.top),this.domNode.setLeft(this._renderData.coordinate.left)):(this.domNode.setTop(this._renderData.coordinate.top+e.scrollTop-e.bigNumbersDelta),this.domNode.setLeft(this._renderData.coordinate.left)),this._isVisible||(this.domNode.setVisibility("inherit"),this.domNode.setAttribute("monaco-visible-content-widget","true"),this._isVisible=!0),typeof this._actual.afterRender=="function"&&N2(this._actual.afterRender,this._actual,this._renderData.position)}}class T0{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class N0{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class I7{constructor(e,t,i){this.top=e,this.left=t,this.height=i,this._anchorCoordinateBrand=void 0}}function N2(n,e,...t){try{return n.call(e,...t)}catch{return null}}class xq extends Kf{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(143);this._lineHeight=t.get(66),this._renderLineHighlight=t.get(95),this._renderLineHighlightOnlyWhenFocus=t.get(96),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new ct(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1;const t=this._selections.map(s=>s.positionLineNumber);t.sort((s,o)=>s-o),Zi(this._cursorLineNumbers,t)||(this._cursorLineNumbers=t,e=!0);const i=this._selections.every(s=>s.isEmpty());return this._selectionIsEmpty!==i&&(this._selectionIsEmpty=i,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(143);return this._lineHeight=t.get(66),this._renderLineHighlight=t.get(95),this._renderLineHighlightOnlyWhenFocus=t.get(96),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,!0}onCursorStateChanged(e){return this._selections=e.selections,this._readFromSelections()}onFlushed(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollWidthChanged||e.scrollTopChanged}onZonesChanged(e){return!0}onFocusChanged(e){return this._renderLineHighlightOnlyWhenFocus?(this._focused=e.isFocused,!0):!1}prepareRender(e){if(!this._shouldRenderThis()){this._renderData=null;return}const t=this._renderOne(e),i=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,o=this._cursorLineNumbers.length;let r=0;const a=[];for(let l=i;l<=s;l++){const c=l-i;for(;r=this._renderData.length?"":this._renderData[i]}_shouldRenderInMargin(){return(this._renderLineHighlight==="gutter"||this._renderLineHighlight==="all")&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderInContent(){return(this._renderLineHighlight==="line"||this._renderLineHighlight==="all")&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}class Yye extends xq{_renderOne(e){return`
`}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class Zye extends xq{_renderOne(e){return`
`}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}Nr((n,e)=>{const t=n.getColor(dq);if(t&&(e.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${t}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${t}; border: none; }`)),!t||t.isTransparent()||n.defines(x7)){const i=n.getColor(x7);i&&(e.addRule(`.monaco-editor .view-overlays .current-line { border: 2px solid ${i}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { border: 2px solid ${i}; }`),ac(n.type)&&(e.addRule(".monaco-editor .view-overlays .current-line { border-width: 1px; }"),e.addRule(".monaco-editor .margin-view-overlays .current-line-margin { border-width: 1px; }")))}});class Xye extends Kf{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}prepareRender(e){const t=e.getDecorationsInViewport();let i=[],s=0;for(let l=0,c=t.length;l{if(l.options.zIndexc.options.zIndex)return 1;const d=l.options.className,u=c.options.className;return du?1:N.compareRangesUsingStarts(l.range,c.range)});const o=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,a=[];for(let l=o;l<=r;l++){const c=l-o;a[c]=""}this._renderWholeLineDecorations(e,i,a),this._renderNormalDecorations(e,i,a),this._renderResult=a}_renderWholeLineDecorations(e,t,i){const s=String(this._lineHeight),o=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber;for(let a=0,l=t.length;a',u=Math.max(c.range.startLineNumber,o),h=Math.min(c.range.endLineNumber,r);for(let f=u;f<=h;f++){const g=f-o;i[g]+=d}}}_renderNormalDecorations(e,t,i){var s;const o=String(this._lineHeight),r=e.visibleRange.startLineNumber;let a=null,l=!1,c=null,d=!1;for(let u=0,h=t.length;u';l[f]+=b}}}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class Qye extends lo{constructor(e,t,i,s){super(e);const o=this._context.configuration.options,r=o.get(102),a=o.get(74),l=o.get(40),c=o.get(105),d={listenOnDomNode:i.domNode,className:"editor-scrollable "+RT(e.theme.type),useShadows:!1,lazyRender:!0,vertical:r.vertical,horizontal:r.horizontal,verticalHasArrows:r.verticalHasArrows,horizontalHasArrows:r.horizontalHasArrows,verticalScrollbarSize:r.verticalScrollbarSize,verticalSliderSize:r.verticalSliderSize,horizontalScrollbarSize:r.horizontalScrollbarSize,horizontalSliderSize:r.horizontalSliderSize,handleMouseWheel:r.handleMouseWheel,alwaysConsumeMouseWheel:r.alwaysConsumeMouseWheel,arrowSize:r.arrowSize,mouseWheelScrollSensitivity:a,fastScrollSensitivity:l,scrollPredominantAxis:c,scrollByPage:r.scrollByPage};this.scrollbar=this._register(new CP(t.domNode,d,this._context.viewLayout.getScrollable())),sl.write(this.scrollbar.getDomNode(),5),this.scrollbarDomNode=vt(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const u=(h,f,g)=>{const p={};{const _=h.scrollTop;_&&(p.scrollTop=this._context.viewLayout.getCurrentScrollTop()+_,h.scrollTop=0)}if(g){const _=h.scrollLeft;_&&(p.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+_,h.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(p,1)};this._register(K(i.domNode,"scroll",h=>u(i.domNode,!0,!0))),this._register(K(t.domNode,"scroll",h=>u(t.domNode,!0,!1))),this._register(K(s.domNode,"scroll",h=>u(s.domNode,!0,!1))),this._register(K(this.scrollbarDomNode.domNode,"scroll",h=>u(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(143);this.scrollbarDomNode.setLeft(t.contentLeft),e.get(72).side==="right"?this.scrollbarDomNode.setWidth(t.contentWidth+t.minimap.minimapWidth):this.scrollbarDomNode.setWidth(t.contentWidth),this.scrollbarDomNode.setHeight(t.height)}getOverviewRulerLayoutInfo(){return this.scrollbar.getOverviewRulerLayoutInfo()}getDomNode(){return this.scrollbarDomNode}delegateVerticalScrollbarPointerDown(e){this.scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this.scrollbar.delegateScrollFromMouseWheelEvent(e)}onConfigurationChanged(e){if(e.hasChanged(102)||e.hasChanged(74)||e.hasChanged(40)){const t=this._context.configuration.options,i=t.get(102),s=t.get(74),o=t.get(40),r=t.get(105),a={vertical:i.vertical,horizontal:i.horizontal,verticalScrollbarSize:i.verticalScrollbarSize,horizontalScrollbarSize:i.horizontalScrollbarSize,scrollByPage:i.scrollByPage,handleMouseWheel:i.handleMouseWheel,mouseWheelScrollSensitivity:s,fastScrollSensitivity:o,scrollPredominantAxis:r};this.scrollbar.updateOptions(a)}return e.hasChanged(143)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+RT(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}class Lq extends Y{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function SD(n,e){let t=0,i=0;const s=n.length;for(;is)throw new Gi("Illegal value for lineNumber");const o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=!!(o&&o.offSide);let a=-2,l=-1,c=-2,d=-1;const u=x=>{if(a!==-1&&(a===-2||a>x-1)){a=-1,l=-1;for(let D=x-2;D>=0;D--){const k=this._computeIndentLevel(D);if(k>=0){a=D,l=k;break}}}if(c===-2){c=-1,d=-1;for(let D=x;D=0){c=D,d=k;break}}}};let h=-2,f=-1,g=-2,p=-1;const _=x=>{if(h===-2){h=-1,f=-1;for(let D=x-2;D>=0;D--){const k=this._computeIndentLevel(D);if(k>=0){h=D,f=k;break}}}if(g!==-1&&(g===-2||g=0){g=D,p=k;break}}}};let v=0,b=!0,y=0,w=!0,C=0,L=0;for(let x=0;b||w;x++){const D=e-x,k=e+x;x>1&&(D<1||D1&&(k>s||k>i)&&(w=!1),x>5e4&&(b=!1,w=!1);let P=-1;if(b&&D>=1){const M=this._computeIndentLevel(D-1);M>=0?(c=D-1,d=M,P=Math.ceil(M/this.textModel.getOptions().indentSize)):(u(D),P=this._getIndentLevelForWhitespaceLine(r,l,d))}let O=-1;if(w&&k<=s){const M=this._computeIndentLevel(k-1);M>=0?(h=k-1,f=M,O=Math.ceil(M/this.textModel.getOptions().indentSize)):(_(k),O=this._getIndentLevelForWhitespaceLine(r,f,p))}if(x===0){L=P;continue}if(x===1){if(k<=s&&O>=0&&L+1===O){b=!1,v=k,y=k,C=O;continue}if(D>=1&&P>=0&&P-1===L){w=!1,v=D,y=D,C=P;continue}if(v=e,y=e,C=L,C===0)return{startLineNumber:v,endLineNumber:y,indent:C}}b&&(P>=C?v=D:b=!1),w&&(O>=C?y=k:w=!1)}return{startLineNumber:v,endLineNumber:y,indent:C}}getLinesBracketGuides(e,t,i,s){var o;const r=[];for(let h=e;h<=t;h++)r.push([]);const a=!0,l=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new N(e,1,t,this.textModel.getLineMaxColumn(t))).toArray();let c;if(i&&l.length>0){const h=(e<=i.lineNumber&&i.lineNumber<=t?l:this.textModel.bracketPairs.getBracketPairsInRange(N.fromPositions(i)).toArray()).filter(f=>N.strictContainsPosition(f.range,i));c=(o=mT(h,f=>a))===null||o===void 0?void 0:o.range}const d=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,u=new Dq;for(const h of l){if(!h.closingBracketRange)continue;const f=c&&h.range.equalsRange(c);if(!f&&!s.includeInactive)continue;const g=u.getInlineClassName(h.nestingLevel,h.nestingLevelOfEqualBracketType,d)+(s.highlightActive&&f?" "+u.activeClassName:""),p=h.openingBracketRange.getStartPosition(),_=h.closingBracketRange.getStartPosition(),v=s.horizontalGuides===Xh.Enabled||s.horizontalGuides===Xh.EnabledForActive&&f;if(h.range.startLineNumber===h.range.endLineNumber){v&&r[h.range.startLineNumber-e].push(new Ah(-1,h.openingBracketRange.getEndPosition().column,g,new F_(!1,_.column),-1,-1));continue}const b=this.getVisibleColumnFromPosition(_),y=this.getVisibleColumnFromPosition(h.openingBracketRange.getStartPosition()),w=Math.min(y,b,h.minVisibleColumnIndentation+1);let C=!1;Qs(this.textModel.getLineContent(h.closingBracketRange.startLineNumber))=e&&y>w&&r[p.lineNumber-e].push(new Ah(w,-1,g,new F_(!1,p.column),-1,-1)),_.lineNumber<=t&&b>w&&r[_.lineNumber-e].push(new Ah(w,-1,g,new F_(!C,_.column),-1,-1)))}for(const h of r)h.sort((f,g)=>f.visibleColumn-g.visibleColumn);return r}getVisibleColumnFromPosition(e){return Ki.visibleColumnFromColumn(this.textModel.getLineContent(e.lineNumber),e.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(e,t){this.assertNotDisposed();const i=this.textModel.getLineCount();if(e<1||e>i)throw new Error("Illegal value for startLineNumber");if(t<1||t>i)throw new Error("Illegal value for endLineNumber");const s=this.textModel.getOptions(),o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=!!(o&&o.offSide),a=new Array(t-e+1);let l=-2,c=-1,d=-2,u=-1;for(let h=e;h<=t;h++){const f=h-e,g=this._computeIndentLevel(h-1);if(g>=0){l=h-1,c=g,a[f]=Math.ceil(g/s.indentSize);continue}if(l===-2){l=-1,c=-1;for(let p=h-2;p>=0;p--){const _=this._computeIndentLevel(p);if(_>=0){l=p,c=_;break}}}if(d!==-1&&(d===-2||d=0){d=p,u=_;break}}}a[f]=this._getIndentLevelForWhitespaceLine(r,c,u)}return a}_getIndentLevelForWhitespaceLine(e,t,i){const s=this.textModel.getOptions();return t===-1||i===-1?0:tl||this._maxIndentLeft>0&&y>this._maxIndentLeft)break;const w=b.horizontalLine?b.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",C=b.horizontalLine?((o=(s=e.visibleRangeForPosition(new V(f,b.horizontalLine.endColumn)))===null||s===void 0?void 0:s.left)!==null&&o!==void 0?o:y+this._spaceWidth)-y:this._spaceWidth;_+=`
`}h[g]=_}this._renderResult=h}getGuidesByLine(e,t,i){const s=this._bracketPairGuideOptions.bracketPairs!==!1?this._context.viewModel.getBracketGuidesInRangeByLine(e,t,i,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:this._bracketPairGuideOptions.bracketPairsHorizontal===!0?Xh.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal==="active"?Xh.EnabledForActive:Xh.Disabled,includeInactive:this._bracketPairGuideOptions.bracketPairs===!0}):null,o=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null;let r=0,a=0,l=0;if(this._bracketPairGuideOptions.highlightActiveIndentation!==!1&&i){const u=this._context.viewModel.getActiveIndentGuide(i.lineNumber,e,t);r=u.startLineNumber,a=u.endLineNumber,l=u.indent}const{indentSize:c}=this._context.viewModel.model.getOptions(),d=[];for(let u=e;u<=t;u++){const h=new Array;d.push(h);const f=s?s[u-e]:[],g=new _c(f),p=o?o[u-e]:0;for(let _=1;_<=p;_++){const v=(_-1)*c+1,b=(this._bracketPairGuideOptions.highlightActiveIndentation==="always"||f.length===0)&&r<=u&&u<=a&&_===l;h.push(...g.takeWhile(w=>w.visibleColumn!0)||[])}return d}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function mg(n){if(!(n&&n.isTransparent()))return n}Nr((n,e)=>{const t=[{bracketColor:hq,guideColor:uye,guideColorActive:_ye},{bracketColor:fq,guideColor:hye,guideColorActive:bye},{bracketColor:gq,guideColor:fye,guideColorActive:vye},{bracketColor:pq,guideColor:gye,guideColorActive:yye},{bracketColor:mq,guideColor:pye,guideColorActive:wye},{bracketColor:_q,guideColor:mye,guideColorActive:Cye}],i=new Dq,s=[{indentColor:J1,indentColorActive:ey},{indentColor:q1e,indentColorActive:X1e},{indentColor:G1e,indentColorActive:Q1e},{indentColor:K1e,indentColorActive:J1e},{indentColor:Y1e,indentColorActive:eye},{indentColor:Z1e,indentColorActive:tye}],o=t.map(a=>{var l,c;const d=n.getColor(a.bracketColor),u=n.getColor(a.guideColor),h=n.getColor(a.guideColorActive),f=mg((l=mg(u))!==null&&l!==void 0?l:d==null?void 0:d.transparent(.3)),g=mg((c=mg(h))!==null&&c!==void 0?c:d);if(!(!f||!g))return{guideColor:f,guideColorActive:g}}).filter(bS),r=s.map(a=>{const l=n.getColor(a.indentColor),c=n.getColor(a.indentColorActive),d=mg(l),u=mg(c);if(!(!d||!u))return{indentColor:d,indentColorActive:u}}).filter(bS);if(o.length>0){for(let a=0;a<30;a++){const l=o[a%o.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(a).replace(/ /g,".")} { --guide-color: ${l.guideColor}; --guide-color-active: ${l.guideColorActive}; }`)}e.addRule(".monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }"),e.addRule(".monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }"),e.addRule(".monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }"),e.addRule(`.monaco-editor .vertical.${i.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),e.addRule(`.monaco-editor .horizontal-top.${i.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),e.addRule(`.monaco-editor .horizontal-bottom.${i.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}if(r.length>0){for(let a=0;a<30;a++){const l=r[a%r.length];e.addRule(`.monaco-editor .lines-content .core-guide-indent.lvl-${a} { --indent-color: ${l.indentColor}; --indent-color-active: ${l.indentColorActive}; }`)}e.addRule(".monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 var(--indent-color) inset; }"),e.addRule(".monaco-editor .lines-content .core-guide-indent.indent-active { box-shadow: 1px 0 0 0 var(--indent-color-active) inset; }")}});class R2{get didDomLayout(){return this._didDomLayout}readClientRect(){if(!this._clientRectRead){this._clientRectRead=!0;const e=this._domNode.getBoundingClientRect();this.markDidDomLayout(),this._clientRectDeltaLeft=e.left,this._clientRectScale=e.width/this._domNode.offsetWidth}}get clientRectDeltaLeft(){return this._clientRectRead||this.readClientRect(),this._clientRectDeltaLeft}get clientRectScale(){return this._clientRectRead||this.readClientRect(),this._clientRectScale}constructor(e,t){this._domNode=e,this.endNode=t,this._didDomLayout=!1,this._clientRectDeltaLeft=0,this._clientRectScale=1,this._clientRectRead=!1}markDidDomLayout(){this._didDomLayout=!0}}class twe{constructor(){this._currentVisibleRange=new N(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class iwe{constructor(e,t,i,s,o,r,a){this.minimalReveal=e,this.lineNumber=t,this.startColumn=i,this.endColumn=s,this.startScrollTop=o,this.stopScrollTop=r,this.scrollType=a,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class nwe{constructor(e,t,i,s,o){this.minimalReveal=e,this.selections=t,this.startScrollTop=i,this.stopScrollTop=s,this.scrollType=o,this.type="selections";let r=t[0].startLineNumber,a=t[0].endLineNumber;for(let l=1,c=t.length;l{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new Di(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new twe,this._horizontalRevealRequest=null,this._stickyScrollEnabled=s.get(114).enabled,this._maxNumberStickyLines=s.get(114).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new Na(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(144)&&(this._maxLineWidth=0);const t=this._context.configuration.options,i=t.get(50),s=t.get(144);return this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=s.isViewportWrapping,this._revealHorizontalRightPadding=t.get(99),this._cursorSurroundingLines=t.get(29),this._cursorSurroundingLinesStyle=t.get(30),this._canUseLayerHinting=!t.get(32),this._stickyScrollEnabled=t.get(114).enabled,this._maxNumberStickyLines=t.get(114).maxLineCount,Mn(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(143)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new v7(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const i=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();for(let o=i;o<=s;o++)this._visibleLines.getVisibleLine(o).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let s=!1;for(let o=t;o<=i;o++)s=this._visibleLines.getVisibleLine(o).onSelectionChanged()||s;return s}onDecorationsChanged(e){{const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let s=t;s<=i;s++)this._visibleLines.getVisibleLine(s).onDecorationsChanged()}return!0}onFlushed(e){const t=this._visibleLines.onFlushed(e);return this._maxLineWidth=0,t}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onRevealRangeRequest(e){const t=this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(),e.source,e.minimalReveal,e.range,e.selections,e.verticalType);if(t===-1)return!1;let i=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?i={scrollTop:i.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new iwe(e.minimalReveal,e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new nwe(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const o=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(i,o),!0}onScrollChanged(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){const t=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),i=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTopi)&&(this._horizontalRevealRequest=null)}return this.domNode.setWidth(e.scrollWidth),this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth),this._visibleLines.onZonesChanged(e)}onThemeChanged(e){return this._onOptionsMaybeChanged()}getPositionFromDOMInfo(e,t){const i=this._getViewLineDomNode(e);if(i===null)return null;const s=this._getLineNumberFor(i);if(s===-1||s<1||s>this._context.viewModel.getLineCount())return null;if(this._context.viewModel.getLineMaxColumn(s)===1)return new V(s,1);const o=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();if(sr)return null;let a=this._visibleLines.getVisibleLine(s).getColumnOfNodeOffset(e,t);const l=this._context.viewModel.getLineMinColumn(s);return ai)return-1;const s=new R2(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getWidth(s);return this._updateLineWidthsSlowIfDomDidLayout(s),o}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const i=e.endLineNumber,s=N.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!s)return null;const o=[];let r=0;const a=new R2(this.domNode.domNode,this._textRangeRestingSpot);let l=0;t&&(l=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new V(s.startLineNumber,1)).lineNumber);const c=this._visibleLines.getStartLineNumber(),d=this._visibleLines.getEndLineNumber();for(let u=s.startLineNumber;u<=s.endLineNumber;u++){if(ud)continue;const h=u===s.startLineNumber?s.startColumn:1,f=u!==s.endLineNumber,g=f?this._context.viewModel.getLineMaxColumn(u):s.endColumn,p=this._visibleLines.getVisibleLine(u).getVisibleRangesForRange(u,h,g,a);if(p){if(t&&uthis._visibleLines.getEndLineNumber())return null;const s=new R2(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,i,s);return this._updateLineWidthsSlowIfDomDidLayout(s),o}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new f1e(t.outsideRenderedLine,t.ranges[0].left):null}_updateLineWidthsFast(){return this._updateLineWidths(!0)}_updateLineWidthsSlow(){this._updateLineWidths(!1)}_updateLineWidthsSlowIfDomDidLayout(e){e.didDomLayout&&(this._asyncUpdateLineWidths.isScheduled()||(this._asyncUpdateLineWidths.cancel(),this._updateLineWidthsSlow()))}_updateLineWidths(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let s=1,o=!0;for(let r=t;r<=i;r++){const a=this._visibleLines.getVisibleLine(r);if(e&&!a.getWidthIsFast()){o=!1;continue}s=Math.max(s,a.getWidth(null))}return o&&t===1&&i===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(s),o}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const i=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();for(let o=i;o<=s;o++){const r=this._visibleLines.getVisibleLine(o);if(r.needsMonospaceFontCheck()){const a=r.getWidth(null);a>t&&(t=a,e=o)}}if(e!==-1&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let o=i;o<=s;o++)this._visibleLines.getVisibleLine(o).onMonospaceAssumptionsInvalidated()}prepareRender(){throw new Error("Not supported")}render(){throw new Error("Not supported")}renderText(e){if(this._visibleLines.renderLines(e),this._lastRenderedData.setCurrentVisibleRange(e.visibleRange),this.domNode.setWidth(this._context.viewLayout.getScrollWidth()),this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(),1e6)),this._horizontalRevealRequest){const i=this._horizontalRevealRequest;if(e.startLineNumber<=i.minLineNumber&&i.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();const s=this._computeScrollLeftToReveal(i);s&&(this._isViewportWrapping||this._ensureMaxLineWidth(s.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:s.scrollLeft},i.scrollType))}}if(this._updateLineWidthsFast()?this._asyncUpdateLineWidths.cancel():this._asyncUpdateLineWidths.schedule(),Jn&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const i=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();for(let o=i;o<=s;o++)if(this._visibleLines.getVisibleLine(o).needsMonospaceFontCheck()){this._asyncCheckMonospaceFontAssumptions.schedule();break}}this._linesContent.setLayerHinting(this._canUseLayerHinting),this._linesContent.setContain("strict");const t=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-t),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())}_ensureMaxLineWidth(e){const t=Math.ceil(e);this._maxLineWidth0){let v=o[0].startLineNumber,b=o[0].endLineNumber;for(let y=1,w=o.length;yl){if(!d)return-1;_=u}else if(r===5||r===6)if(r===6&&a<=u&&h<=c)_=a;else{const v=Math.max(5*this._lineHeight,l*.2),b=u-v,y=h-l;_=Math.max(y,b)}else if(r===1||r===2)if(r===2&&a<=u&&h<=c)_=a;else{const v=(u+h)/2;_=Math.max(0,v-l/2)}else _=this._computeMinimumScrolling(a,c,u,h,r===3,r===4);return _}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),i=this._context.configuration.options.get(143),s=t.left,o=s+t.width-i.verticalScrollbarWidth;let r=1073741824,a=0;if(e.type==="range"){const c=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!c)return null;for(const d of c.ranges)r=Math.min(r,Math.round(d.left)),a=Math.max(a,Math.round(d.left+d.width))}else for(const c of e.selections){if(c.startLineNumber!==c.endLineNumber)return null;const d=this._visibleRangesForLineRange(c.startLineNumber,c.startColumn,c.endColumn);if(!d)return null;for(const u of d.ranges)r=Math.min(r,Math.round(u.left)),a=Math.max(a,Math.round(u.left+u.width))}return e.minimalReveal||(r=Math.max(0,r-xD.HORIZONTAL_EXTRA_PX),a+=this._revealHorizontalRightPadding),e.type==="selections"&&a-r>t.width?null:{scrollLeft:this._computeMinimumScrolling(s,o,r,a),maxHorizontalOffset:a}}_computeMinimumScrolling(e,t,i,s,o,r){e=e|0,t=t|0,i=i|0,s=s|0,o=!!o,r=!!r;const a=t-e;if(s-it)return Math.max(0,s-a)}else return i;return e}}xD.HORIZONTAL_EXTRA_PX=30;class FT{constructor(e,t,i,s){this._decorationToRenderBrand=void 0,this.startLineNumber=+e,this.endLineNumber=+t,this.className=String(i),this.zIndex=s??0}}class swe{constructor(e,t){this.className=e,this.zIndex=t}}class owe{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class kq extends Kf{_render(e,t,i){const s=[];for(let a=e;a<=t;a++){const l=a-e;s[l]=new owe}if(i.length===0)return s;i.sort((a,l)=>a.className===l.className?a.startLineNumber===l.startLineNumber?a.endLineNumber-l.endLineNumber:a.startLineNumber-l.startLineNumber:a.classNames)continue;const a=Math.max(r.startLineNumber,i),l=Math.min(o.preference.lane,this._glyphMarginDecorationLaneCount);t.push(new lwe(a,l,o.preference.zIndex,o))}}_collectSortedGlyphRenderRequests(e){const t=[];return this._collectDecorationBasedGlyphRenderRequest(e,t),this._collectWidgetBasedGlyphRenderRequest(e,t),t.sort((i,s)=>i.lineNumber===s.lineNumber?i.lane===s.lane?i.zIndex===s.zIndex?s.type===i.type?i.type===0&&s.type===0?i.className0;){const s=t.peek();if(!s)break;const o=t.takeWhile(a=>a.lineNumber===s.lineNumber&&a.lane===s.lane);if(!o||o.length===0)break;const r=o[0];if(r.type===0){const a=[];for(const l of o){if(l.zIndex!==r.zIndex||l.type!==r.type)break;(a.length===0||a[a.length-1]!==l.className)&&a.push(l.className)}i.push(r.accept(a.join(" ")))}else r.widget.renderInfo={lineNumber:r.lineNumber,lane:r.lane}}this._decorationGlyphsToRender=i}render(e){if(!this._glyphMargin){for(const i of Object.values(this._widgets))i.domNode.setDisplay("none");for(;this._managedDomNodes.length>0;){const i=this._managedDomNodes.pop();i==null||i.domNode.remove()}return}const t=Math.round(this._glyphMarginWidth/this._glyphMarginDecorationLaneCount);for(const i of Object.values(this._widgets))if(!i.renderInfo)i.domNode.setDisplay("none");else{const s=e.viewportData.relativeVerticalOffset[i.renderInfo.lineNumber-e.viewportData.startLineNumber],o=this._glyphMarginLeft+(i.renderInfo.lane-1)*this._lineHeight;i.domNode.setDisplay("block"),i.domNode.setTop(s),i.domNode.setLeft(o),i.domNode.setWidth(t),i.domNode.setHeight(this._lineHeight)}for(let i=0;ithis._decorationGlyphsToRender.length;){const i=this._managedDomNodes.pop();i==null||i.domNode.remove()}}}class awe{constructor(e,t,i,s){this.lineNumber=e,this.lane=t,this.zIndex=i,this.className=s,this.type=0}accept(e){return new cwe(this.lineNumber,this.lane,e)}}class lwe{constructor(e,t,i,s){this.lineNumber=e,this.lane=t,this.zIndex=i,this.widget=s,this.type=1}}class cwe{constructor(e,t,i){this.lineNumber=e,this.lane=t,this.combinedClassName=i}}class dwe extends kq{constructor(e){super(),this._context=e;const i=this._context.configuration.options.get(143);this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const i=this._context.configuration.options.get(143);return this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.decorationsWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport(),i=[];let s=0;for(let o=0,r=t.length;o',l=[];for(let c=t;c<=i;c++){const d=c-t,u=s[d].getDecorations();let h="";for(const f of u)h+='
';o[a]=c}this._renderResult=o}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}class Vo{constructor(e,t,i,s){this._rgba8Brand=void 0,this.r=Vo._clamp(e),this.g=Vo._clamp(t),this.b=Vo._clamp(i),this.a=Vo._clamp(s)}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}static _clamp(e){return e<0?0:e>255?255:e|0}}Vo.Empty=new Vo(0,0,0,0);class iy extends Y{static getInstance(){return this._INSTANCE||(this._INSTANCE=new iy),this._INSTANCE}constructor(){super(),this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(xi.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){const e=xi.getColorMap();if(!e){this._colors=[Vo.Empty],this._backgroundIsLight=!0;return}this._colors=[Vo.Empty];for(let i=1;i=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}}iy._INSTANCE=null;const hwe=(()=>{const n=[];for(let e=32;e<=126;e++)n.push(e);return n.push(65533),n})(),fwe=(n,e)=>(n-=32,n<0||n>96?e<=2?(n+96)%96:95:n);class lv{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=lv.soften(e,12/15),this.charDataLight=lv.soften(e,50/60)}static soften(e,t){const i=new Uint8ClampedArray(e.length);for(let s=0,o=e.length;se.width||i+g>e.height){console.warn("bad render request outside image data");return}const p=d?this.charDataLight:this.charDataNormal,_=fwe(s,c),v=e.width*4,b=a.r,y=a.g,w=a.b,C=o.r-b,L=o.g-y,x=o.b-w,D=Math.max(r,l),k=e.data;let P=_*h*f,O=i*v+t*4;for(let M=0;Me.width||i+u>e.height){console.warn("bad render request outside image data");return}const h=e.width*4,f=.5*(o/255),g=r.r,p=r.g,_=r.b,v=s.r-g,b=s.g-p,y=s.b-_,w=g+v*f,C=p+b*f,L=_+y*f,x=Math.max(o,a),D=e.data;let k=i*h+t*4;for(let P=0;P{const e=new Uint8ClampedArray(n.length/2);for(let t=0;t>1]=T7[n[t]]<<4|T7[n[t+1]]&15;return e},R7={1:hm(()=>N7("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:hm(()=>N7("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class B_{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return R7[e]?i=new lv(R7[e](),e):i=B_.createFromSampleData(B_.createSampleData(t).data,e),this.lastFontFamily=t,this.lastCreated=i,i}static createSampleData(e){const t=document.createElement("canvas"),i=t.getContext("2d");t.style.height="16px",t.height=16,t.width=96*10,t.style.width=96*10+"px",i.fillStyle="#ffffff",i.font=`bold 16px ${e}`,i.textBaseline="middle";let s=0;for(const o of hwe)i.fillText(String.fromCharCode(o),s,16/2),s+=10;return i.getImageData(0,0,96*10,16)}static createFromSampleData(e,t){if(e.length!==61440)throw new Error("Unexpected source in MinimapCharRenderer");const s=B_._downsample(e,t);return new lv(s,t)}static _downsampleChar(e,t,i,s,o){const r=1*o,a=2*o;let l=s,c=0;for(let d=0;d0){const c=255/l;for(let d=0;dB_.create(this.fontScale,l.fontFamily)),this.defaultBackgroundColor=i.getColor(2),this.backgroundColor=cv._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=cv._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const i=e.getColor(Qve);return i?new Vo(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(Jve);return t?Vo._clamp(Math.round(255*t.rgba.a)):255}equals(e){return this.renderMinimap===e.renderMinimap&&this.size===e.size&&this.minimapHeightIsEditorHeight===e.minimapHeightIsEditorHeight&&this.scrollBeyondLastLine===e.scrollBeyondLastLine&&this.paddingTop===e.paddingTop&&this.paddingBottom===e.paddingBottom&&this.showSlider===e.showSlider&&this.autohide===e.autohide&&this.pixelRatio===e.pixelRatio&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.lineHeight===e.lineHeight&&this.minimapLeft===e.minimapLeft&&this.minimapWidth===e.minimapWidth&&this.minimapHeight===e.minimapHeight&&this.canvasInnerWidth===e.canvasInnerWidth&&this.canvasInnerHeight===e.canvasInnerHeight&&this.canvasOuterWidth===e.canvasOuterWidth&&this.canvasOuterHeight===e.canvasOuterHeight&&this.isSampling===e.isSampling&&this.editorHeight===e.editorHeight&&this.fontScale===e.fontScale&&this.minimapLineHeight===e.minimapLineHeight&&this.minimapCharWidth===e.minimapCharWidth&&this.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}}class W_{constructor(e,t,i,s,o,r,a,l,c){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=s,this.sliderTop=o,this.sliderHeight=r,this.topPaddingLineCount=a,this.startLineNumber=l,this.endLineNumber=c}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}intersectWithViewport(e){const t=Math.max(this.startLineNumber,e.startLineNumber),i=Math.min(this.endLineNumber,e.endLineNumber);return t>i?null:[t,i]}getYForLineNumber(e,t){return+(e-this.startLineNumber+this.topPaddingLineCount)*t}static create(e,t,i,s,o,r,a,l,c,d,u){const h=e.pixelRatio,f=e.minimapLineHeight,g=Math.floor(e.canvasInnerHeight/f),p=e.lineHeight;if(e.minimapHeightIsEditorHeight){let L=l*e.lineHeight+e.paddingTop+e.paddingBottom;e.scrollBeyondLastLine&&(L+=Math.max(0,o-e.lineHeight-e.paddingBottom));const x=Math.max(1,Math.floor(o*o/L)),D=Math.max(0,e.minimapHeight-x),k=D/(d-o),P=c*k,O=D>0,M=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),R=Math.floor(e.paddingTop/e.lineHeight);return new W_(c,d,O,k,P,x,R,1,Math.min(a,M))}let _;if(r&&i!==a){const L=i-t+1;_=Math.floor(L*f/h)}else{const L=o/p;_=Math.floor(L*f/h)}const v=Math.floor(e.paddingTop/p);let b=Math.floor(e.paddingBottom/p);if(e.scrollBeyondLastLine){const L=o/p;b=Math.max(b,L-1)}let y;if(b>0){const L=o/p;y=(v+a+b-L-1)*f/h}else y=Math.max(0,(v+a)*f/h-_);y=Math.min(e.minimapHeight-_,y);const w=y/(d-o),C=c*w;if(g>=v+a+b){const L=y>0;return new W_(c,d,L,w,C,_,v,1,a)}else{let L;t>1?L=t+v:L=Math.max(1,c/p);let x,D=Math.max(1,Math.floor(L-C*h/f));Dc&&(D=Math.min(D,u.startLineNumber),x=Math.max(x,u.topPaddingLineCount)),u.scrollTop=e.paddingTop?O=(t-D+x+P)*f/h:O=c/e.paddingTop*(x+P)*f/h,new W_(c,d,!0,w,O,_,x,D,k)}}}class ZS{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}}ZS.INVALID=new ZS(-1);class M7{constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLines=new wq(()=>ZS.INVALID),this._renderedLines._set(e.startLineNumber,i)}linesEquals(e){if(!this.scrollEquals(e))return!1;const i=this._renderedLines._get().lines;for(let s=0,o=i.length;s1){for(let v=0,b=s-1;v0&&this.minimapLines[i-1]>=e;)i--;let s=this.modelLineToMinimapLine(t)-1;for(;s+1t)return null}return[i+1,s+1]}decorationLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e),s=this.modelLineToMinimapLine(t);return e!==t&&s===i&&(s===this.minimapLines.length?i>1&&i--:s++),[i,s]}onLinesDeleted(e){const t=e.toLineNumber-e.fromLineNumber+1;let i=this.minimapLines.length,s=0;for(let o=this.minimapLines.length-1;o>=0&&!(this.minimapLines[o]=0&&!(this.minimapLines[i]0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:i,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(s)}_recreateLineSampling(){this._minimapSelections=null;const e=!!this._samplingState,[t,i]=dv.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const s of i)switch(s.type){case"deleted":this._actual.onLinesDeleted(s.deleteFromLineNumber,s.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(s.insertFromLineNumber,s.insertToLineNumber);break;case"flush":this._actual.onFlushed();break}}getLineCount(){return this._samplingState?this._samplingState.minimapLines.length:this._context.viewModel.getLineCount()}getRealLineCount(){return this._context.viewModel.getLineCount()}getLineContent(e){return this._samplingState?this._context.viewModel.getLineContent(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineContent(e)}getLineMaxColumn(e){return this._samplingState?this._context.viewModel.getLineMaxColumn(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineMaxColumn(e)}getMinimapLinesRenderingData(e,t,i){if(this._samplingState){const s=[];for(let o=0,r=t-e+1;o{if(i.preventDefault(),this._model.options.renderMinimap===0||!this._lastRenderData)return;if(this._model.options.size!=="proportional"){if(i.button===0&&this._lastRenderData){const c=Rn(this._slider.domNode),d=c.top+c.height/2;this._startSliderDragging(i,d,this._lastRenderData.renderedLayout)}return}const o=this._model.options.minimapLineHeight,r=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*i.offsetY;let l=Math.floor(r/o)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;l=Math.min(l,this._model.getLineCount()),this._model.revealLineNumber(l)}),this._sliderPointerMoveMonitor=new pD,this._sliderPointerDownListener=ji(this._slider.domNode,de.POINTER_DOWN,i=>{i.preventDefault(),i.stopPropagation(),i.button===0&&this._lastRenderData&&this._startSliderDragging(i,i.pageY,this._lastRenderData.renderedLayout)}),this._gestureDisposable=Mt.addTarget(this._domNode.domNode),this._sliderTouchStartListener=K(this._domNode.domNode,Ot.Start,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(i))},{passive:!1}),this._sliderTouchMoveListener=K(this._domNode.domNode,Ot.Change,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(i)},{passive:!1}),this._sliderTouchEndListener=ji(this._domNode.domNode,Ot.End,i=>{i.preventDefault(),i.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)})}_startSliderDragging(e,t,i){if(!e.target||!(e.target instanceof Element))return;const s=e.pageX;this._slider.toggleClassName("active",!0);const o=(r,a)=>{const l=Rn(this._domNode.domNode),c=Math.min(Math.abs(a-s),Math.abs(a-l.left),Math.abs(a-l.left-l.width));if(Fs&&c>gwe){this._model.setScrollTop(i.scrollTop);return}const d=r-t;this._model.setScrollTop(i.getDesiredScrollTopFromDelta(d))};e.pageY!==t&&o(e.pageY,s),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>o(r.pageY,r.pageX),()=>{this._slider.toggleClassName("active",!1)})}scrollDueToTouchEvent(e){const t=this._domNode.domNode.getBoundingClientRect().top,i=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(i)}dispose(){this._pointerDownListener.dispose(),this._sliderPointerMoveMonitor.dispose(),this._sliderPointerDownListener.dispose(),this._gestureDisposable.dispose(),this._sliderTouchStartListener.dispose(),this._sliderTouchMoveListener.dispose(),this._sliderTouchEndListener.dispose(),super.dispose()}_getMinimapDomNodeClassName(){const e=["minimap"];return this._model.options.showSlider==="always"?e.push("slider-always"):e.push("slider-mouseover"),this._model.options.autohide&&e.push("autohide"),e.join(" ")}getDomNode(){return this._domNode}_applyLayout(){this._domNode.setLeft(this._model.options.minimapLeft),this._domNode.setWidth(this._model.options.minimapWidth),this._domNode.setHeight(this._model.options.minimapHeight),this._shadow.setHeight(this._model.options.minimapHeight),this._canvas.setWidth(this._model.options.canvasOuterWidth),this._canvas.setHeight(this._model.options.canvasOuterHeight),this._canvas.domNode.width=this._model.options.canvasInnerWidth,this._canvas.domNode.height=this._model.options.canvasInnerHeight,this._decorationsCanvas.setWidth(this._model.options.canvasOuterWidth),this._decorationsCanvas.setHeight(this._model.options.canvasOuterHeight),this._decorationsCanvas.domNode.width=this._model.options.canvasInnerWidth,this._decorationsCanvas.domNode.height=this._model.options.canvasInnerHeight,this._slider.setWidth(this._model.options.minimapWidth)}_getBuffer(){return this._buffers||this._model.options.canvasInnerWidth>0&&this._model.options.canvasInnerHeight>0&&(this._buffers=new DP(this._canvas.domNode.getContext("2d"),this._model.options.canvasInnerWidth,this._model.options.canvasInnerHeight,this._model.options.backgroundColor)),this._buffers?this._buffers.getBuffer():null}onDidChangeOptions(){this._lastRenderData=null,this._buffers=null,this._applyLayout(),this._domNode.setClassName(this._getMinimapDomNodeClassName())}onSelectionChanged(){return this._renderDecorations=!0,!0}onDecorationsChanged(){return this._renderDecorations=!0,!0}onFlushed(){return this._lastRenderData=null,!0}onLinesChanged(e,t){return this._lastRenderData?this._lastRenderData.onLinesChanged(e,t):!1}onLinesDeleted(e,t){var i;return(i=this._lastRenderData)===null||i===void 0||i.onLinesDeleted(e,t),!0}onLinesInserted(e,t){var i;return(i=this._lastRenderData)===null||i===void 0||i.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(p7),this._renderDecorations=!0,!0}onTokensChanged(e){return this._lastRenderData?this._lastRenderData.onTokensChanged(e):!1}onTokensColorsChanged(){return this._lastRenderData=null,this._buffers=null,!0}onZonesChanged(){return this._lastRenderData=null,!0}render(e){if(this._model.options.renderMinimap===0){this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),this._sliderHorizontal.setHeight(0);return}e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");const i=W_.create(this._model.options,e.viewportStartLineNumber,e.viewportEndLineNumber,e.viewportStartLineNumberVerticalOffset,e.viewportHeight,e.viewportContainsWhitespaceGaps,this._model.getLineCount(),this._model.getRealLineCount(),e.scrollTop,e.scrollHeight,this._lastRenderData?this._lastRenderData.renderedLayout:null);this._slider.setDisplay(i.sliderNeeded?"block":"none"),this._slider.setTop(i.sliderTop),this._slider.setHeight(i.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(i.sliderHeight),this.renderDecorations(i),this._lastRenderData=this.renderLines(i)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;const t=this._model.getSelections();t.sort(N.compareRangesUsingStarts);const i=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);i.sort((h,f)=>(h.options.zIndex||0)-(f.options.zIndex||0));const{canvasInnerWidth:s,canvasInnerHeight:o}=this._model.options,r=this._model.options.minimapLineHeight,a=this._model.options.minimapCharWidth,l=this._model.getOptions().tabSize,c=this._decorationsCanvas.domNode.getContext("2d");c.clearRect(0,0,s,o);const d=new P7(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(c,t,d,e,r),this._renderDecorationsLineHighlights(c,i,d,e,r);const u=new P7(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(c,t,u,e,r,l,a,s),this._renderDecorationsHighlights(c,i,u,e,r,l,a,s)}}_renderSelectionLineHighlights(e,t,i,s,o){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let r=0,a=0;for(const l of t){const c=s.intersectWithViewport(l);if(!c)continue;const[d,u]=c;for(let g=d;g<=u;g++)i.set(g,!0);const h=s.getYForLineNumber(d,o),f=s.getYForLineNumber(u,o);a>=h||(a>r&&e.fillRect(Wc,r,e.canvas.width,a-r),r=h),a=f}a>r&&e.fillRect(Wc,r,e.canvas.width,a-r)}_renderDecorationsLineHighlights(e,t,i,s,o){const r=new Map;for(let a=t.length-1;a>=0;a--){const l=t[a],c=l.options.minimap;if(!c||c.position!==Js.Inline)continue;const d=s.intersectWithViewport(l.range);if(!d)continue;const[u,h]=d,f=c.getColor(this._theme.value);if(!f||f.isTransparent())continue;let g=r.get(f.toString());g||(g=f.transparent(.5).toString(),r.set(f.toString(),g)),e.fillStyle=g;for(let p=u;p<=h;p++){if(i.has(p))continue;i.set(p,!0);const _=s.getYForLineNumber(u,o);e.fillRect(Wc,_,e.canvas.width,o)}}}_renderSelectionsHighlights(e,t,i,s,o,r,a,l){if(!(!this._selectionColor||this._selectionColor.isTransparent()))for(const c of t){const d=s.intersectWithViewport(c);if(!d)continue;const[u,h]=d;for(let f=u;f<=h;f++)this.renderDecorationOnLine(e,i,c,this._selectionColor,s,f,o,o,r,a,l)}}_renderDecorationsHighlights(e,t,i,s,o,r,a,l){for(const c of t){const d=c.options.minimap;if(!d)continue;const u=s.intersectWithViewport(c.range);if(!u)continue;const[h,f]=u,g=d.getColor(this._theme.value);if(!(!g||g.isTransparent()))for(let p=h;p<=f;p++)switch(d.position){case Js.Inline:this.renderDecorationOnLine(e,i,c.range,g,s,p,o,o,r,a,l);continue;case Js.Gutter:{const _=s.getYForLineNumber(p,o);this.renderDecoration(e,g,2,_,pwe,o);continue}}}}renderDecorationOnLine(e,t,i,s,o,r,a,l,c,d,u){const h=o.getYForLineNumber(r,l);if(h+a<0||h>this._model.options.canvasInnerHeight)return;const{startLineNumber:f,endLineNumber:g}=i,p=f===r?i.startColumn:1,_=g===r?i.endColumn:this._model.getLineMaxColumn(r),v=this.getXOffsetForPosition(t,r,p,c,d,u),b=this.getXOffsetForPosition(t,r,_,c,d,u);this.renderDecoration(e,s,v,h,b-v,a)}getXOffsetForPosition(e,t,i,s,o,r){if(i===1)return Wc;if((i-1)*o>=r)return r;let l=e.get(t);if(!l){const c=this._model.getLineContent(t);l=[Wc];let d=Wc;for(let u=1;u=r){l[u]=r;break}l[u]=g,d=g}e.set(t,l)}return i-1C?Math.floor((s-C)/2):0,x=h.a/255,D=new Vo(Math.round((h.r-u.r)*x+u.r),Math.round((h.g-u.g)*x+u.g),Math.round((h.b-u.b)*x+u.b),255);let k=e.topPaddingLineCount*s;const P=[];for(let G=0,te=i-t+1;G=0&&Ob)return;const M=_.charCodeAt(C);if(M===9){const R=h-(C+L)%h;L+=R-1,w+=R*r}else if(M===32)w+=r;else{const R=eu(M)?2:1;for(let z=0;zb)return}}}}}class P7{constructor(e,t,i){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=i,this._values=[];for(let s=0,o=this._endLineNumber-this._startLineNumber+1;sthis._endLineNumber||(this._values[e-this._startLineNumber]=t)}get(e){return ethis._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}}class _we extends lo{constructor(e){super(e);const i=this._context.configuration.options.get(143);this._widgets={},this._verticalScrollbarWidth=i.verticalScrollbarWidth,this._minimapWidth=i.minimap.minimapWidth,this._horizontalScrollbarHeight=i.horizontalScrollbarHeight,this._editorHeight=i.height,this._editorWidth=i.width,this._domNode=vt(document.createElement("div")),sl.write(this._domNode,4),this._domNode.setClassName("overlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const i=this._context.configuration.options.get(143);return this._verticalScrollbarWidth=i.verticalScrollbarWidth,this._minimapWidth=i.minimap.minimapWidth,this._horizontalScrollbarHeight=i.horizontalScrollbarHeight,this._editorHeight=i.height,this._editorWidth=i.width,!0}addWidget(e){const t=vt(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),this._domNode.appendChild(t),this.setShouldRender(),this._updateMaxMinWidth()}setWidgetPosition(e,t){const i=this._widgets[e.getId()];return i.preference===t?(this._updateMaxMinWidth(),!1):(i.preference=t,this.setShouldRender(),this._updateMaxMinWidth(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const s=this._widgets[t].domNode.domNode;delete this._widgets[t],s.parentNode.removeChild(s),this.setShouldRender(),this._updateMaxMinWidth()}}_updateMaxMinWidth(){var e,t;let i=0;const s=Object.keys(this._widgets);for(let o=0,r=s.length;o=3){const o=Math.floor(s/3),r=Math.floor(s/3),a=s-o-r,l=e,c=l+o,d=l+o+a;return[[0,l,c,l,d,l,c,l],[0,o,a,o+a,r,o+a+r,a+r,o+a+r]]}else if(i===2){const o=Math.floor(s/2),r=s-o,a=e,l=a+o;return[[0,a,a,a,l,a,a,a],[0,o,o,o,r,o+r,o+r,o+r]]}else{const o=e,r=s;return[[0,o,o,o,o,o,o,o],[0,r,r,r,r,r,r,r]]}}equals(e){return this.lineHeight===e.lineHeight&&this.pixelRatio===e.pixelRatio&&this.overviewRulerLanes===e.overviewRulerLanes&&this.renderBorder===e.renderBorder&&this.borderColor===e.borderColor&&this.hideCursor===e.hideCursor&&this.cursorColor===e.cursorColor&&this.themeType===e.themeType&&H.equals(this.backgroundColor,e.backgroundColor)&&this.top===e.top&&this.right===e.right&&this.domWidth===e.domWidth&&this.domHeight===e.domHeight&&this.canvasWidth===e.canvasWidth&&this.canvasHeight===e.canvasHeight}}class vwe extends lo{constructor(e){super(e),this._actualShouldRender=0,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=vt(document.createElement("canvas")),this._domNode.setClassName("decorationsOverviewRuler"),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._domNode.setAttribute("aria-hidden","true"),this._updateSettings(!1),this._tokensColorTrackerListener=xi.onDidChange(t=>{t.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new bwe(this._context.configuration,this._context.theme);return this._settings&&this._settings.equals(t)?!1:(this._settings=t,this._domNode.setTop(this._settings.top),this._domNode.setRight(this._settings.right),this._domNode.setWidth(this._settings.domWidth),this._domNode.setHeight(this._settings.domHeight),this._domNode.domNode.width=this._settings.canvasWidth,this._domNode.domNode.height=this._settings.canvasHeight,e&&this._render(),!0)}_markRenderingIsNeeded(){return this._actualShouldRender=2,!0}_markRenderingIsMaybeNeeded(){return this._actualShouldRender=1,!0}onConfigurationChanged(e){return this._updateSettings(!1)?this._markRenderingIsNeeded():!1}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,i=e.selections.length;tg.lineNumber===p.lineNumber)&&(this._actualShouldRender=2),this._actualShouldRender===1)return;this._renderedDecorations=t,this._renderedCursorPositions=this._cursorPositions,this._domNode.setDisplay("block");const i=this._settings.canvasWidth,s=this._settings.canvasHeight,o=this._settings.lineHeight,r=this._context.viewLayout,a=this._context.viewLayout.getScrollHeight(),l=s/a,c=6*this._settings.pixelRatio|0,d=c/2|0,u=this._domNode.domNode.getContext("2d");e?e.isOpaque()?(u.fillStyle=H.Format.CSS.formatHexA(e),u.fillRect(0,0,i,s)):(u.clearRect(0,0,i,s),u.fillStyle=H.Format.CSS.formatHexA(e),u.fillRect(0,0,i,s)):u.clearRect(0,0,i,s);const h=this._settings.x,f=this._settings.w;for(const g of t){const p=g.color,_=g.data;u.fillStyle=p;let v=0,b=0,y=0;for(let w=0,C=_.length/3;ws&&(M=s-d),k=M-d,P=M+d}k>y+1||L!==v?(w!==0&&u.fillRect(h[v],b,f[v],y-b),v=L,b=k,y=P):P>y&&(y=P)}u.fillRect(h[v],b,f[v],y-b)}if(!this._settings.hideCursor&&this._settings.cursorColor){const g=2*this._settings.pixelRatio|0,p=g/2|0,_=this._settings.x[7],v=this._settings.w[7];u.fillStyle=this._settings.cursorColor;let b=-100,y=-100;for(let w=0,C=this._cursorPositions.length;ws&&(x=s-p);const D=x-p,k=D+g;D>y+1?(w!==0&&u.fillRect(_,b,v,y-b),b=D,y=k):k>y&&(y=k)}u.fillRect(_,b,v,y-b)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(u.beginPath(),u.lineWidth=1,u.strokeStyle=this._settings.borderColor,u.moveTo(0,0),u.lineTo(0,s),u.stroke(),u.moveTo(0,0),u.lineTo(i,0),u.stroke())}}class O7{constructor(e,t,i){this._colorZoneBrand=void 0,this.from=e|0,this.to=t|0,this.colorId=i|0}static compare(e,t){return e.colorId===t.colorId?e.from===t.from?e.to-t.to:e.from-t.from:e.colorId-t.colorId}}class Eq{constructor(e,t,i,s){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.heightInLines=i,this.color=s,this._colorZone=null}static compare(e,t){return e.color===t.color?e.startLineNumber===t.startLineNumber?e.heightInLines===t.heightInLines?e.endLineNumber-t.endLineNumber:e.heightInLines-t.heightInLines:e.startLineNumber-t.startLineNumber:e.colori&&(p=i-_);const v=d.color;let b=this._color2Id[v];b||(b=++this._lastAssignedId,this._color2Id[v]=b,this._id2Color[b]=v);const y=new O7(p-_,p+_,b);d.setColorZone(y),a.push(y)}return this._colorZonesInvalid=!1,a.sort(O7.compare),a}}class wwe extends X1{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=vt(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new ywe(s=>this._context.viewLayout.getVerticalOffsetForLineNumber(s)),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(i.get(66)),this._zoneManager.setPixelRatio(i.get(141)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(66)&&(this._zoneManager.setLineHeight(t.get(66)),this._render()),e.hasChanged(141)&&(this._zoneManager.setPixelRatio(t.get(141)),this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render()),!0}onFlushed(e){return this._render(),!0}onScrollChanged(e){return e.scrollHeightChanged&&(this._zoneManager.setOuterHeight(e.scrollHeight),this._render()),!0}onZonesChanged(e){return this._render(),!0}getDomNode(){return this._domNode.domNode}setLayout(e){this._domNode.setTop(e.top),this._domNode.setRight(e.right);let t=!1;t=this._zoneManager.setDOMWidth(e.width)||t,t=this._zoneManager.setDOMHeight(e.height)||t,t&&(this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render())}setZones(e){this._zoneManager.setZones(e),this._render()}_render(){if(this._zoneManager.getOuterHeight()===0)return!1;const e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),i=this._zoneManager.resolveColorZones(),s=this._zoneManager.getId2Color(),o=this._domNode.domNode.getContext("2d");return o.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(o,i,s,e),!0}_renderOneLane(e,t,i,s){let o=0,r=0,a=0;for(const l of t){const c=l.colorId,d=l.from,u=l.to;c!==o?(e.fillRect(0,r,s,a-r),o=c,e.fillStyle=i[o],r=d,a=u):a>=d?a=Math.max(a,u):(e.fillRect(0,r,s,a-r),r=d,a=u)}e.fillRect(0,r,s,a-r)}}class Cwe extends lo{constructor(e){super(e),this.domNode=vt(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("view-rulers"),this._renderedRulers=[];const t=this._context.configuration.options;this._rulers=t.get(101),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(101),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,!0}onScrollChanged(e){return e.scrollHeightChanged}prepareRender(e){}_ensureRulersCount(){const e=this._renderedRulers.length,t=this._rulers.length;if(e===t)return;if(e0;){const a=vt(document.createElement("div"));a.setClassName("view-ruler"),a.setWidth(o),this.domNode.appendChild(a),this._renderedRulers.push(a),r--}return}let i=e-t;for(;i>0;){const s=this._renderedRulers.pop();this.domNode.removeChild(s),i--}}render(e){this._ensureRulersCount();for(let t=0,i=this._rulers.length;t0;return this._shouldShow!==e?(this._shouldShow=e,!0):!1}getDomNode(){return this._domNode}_updateWidth(){const t=this._context.configuration.options.get(143);t.minimap.renderMinimap===0||t.minimap.minimapWidth>0&&t.minimap.minimapLeft===0?this._width=t.width:this._width=t.width-t.verticalScrollbarWidth}onConfigurationChanged(e){const i=this._context.configuration.options.get(102);return this._useShadows=i.useShadows,this._updateWidth(),this._updateShouldShow(),!0}onScrollChanged(e){return this._scrollTop=e.scrollTop,this._updateShouldShow()}prepareRender(e){}render(e){this._domNode.setWidth(this._width),this._domNode.setClassName(this._shouldShow?"scroll-decoration":"")}}class xwe{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class Lwe{constructor(e,t){this.lineNumber=e,this.ranges=t}}function Dwe(n){return new xwe(n)}function kwe(n){return new Lwe(n.lineNumber,n.ranges.map(Dwe))}class mi extends Kf{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(66),this._roundedSelection=t.get(100),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,this._selections=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(66),this._roundedSelection=t.get(100),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_visibleRangesHaveGaps(e){for(let t=0,i=e.length;t1)return!0;return!1}_enrichVisibleRangesWithStyle(e,t,i){const s=this._typicalHalfwidthCharacterWidth/4;let o=null,r=null;if(i&&i.length>0&&t.length>0){const a=t[0].lineNumber;if(a===e.startLineNumber)for(let c=0;!o&&c=0;c--)i[c].lineNumber===l&&(r=i[c].ranges[0]);o&&!o.startStyle&&(o=null),r&&!r.startStyle&&(r=null)}for(let a=0,l=t.length;a0){const g=t[a-1].ranges[0].left,p=t[a-1].ranges[0].left+t[a-1].ranges[0].width;rw(d-g)g&&(h.top=1),rw(u-p)'}_actualRenderOneSelection(e,t,i,s){if(s.length===0)return;const o=!!s[0].ranges[0].startStyle,r=this._lineHeight.toString(),a=(this._lineHeight-1).toString(),l=s[0].lineNumber,c=s[s.length-1].lineNumber;for(let d=0,u=s.length;d1,c)}this._previousFrameVisibleRangesWithStyle=o,this._renderResult=t.map(([r,a])=>r+a)}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}mi.SELECTION_CLASS_NAME="selected-text";mi.SELECTION_TOP_LEFT="top-left-radius";mi.SELECTION_BOTTOM_LEFT="bottom-left-radius";mi.SELECTION_TOP_RIGHT="top-right-radius";mi.SELECTION_BOTTOM_RIGHT="bottom-right-radius";mi.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background";mi.ROUNDED_PIECE_WIDTH=10;Nr((n,e)=>{const t=n.getColor(cve);t&&!t.isTransparent()&&e.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${t}; }`)});function rw(n){return n<0?-n:n}class F7{constructor(e,t,i,s,o,r,a){this.top=e,this.left=t,this.paddingLeft=i,this.width=s,this.height=o,this.textContent=r,this.textContentClassName=a}}class B7{constructor(e){this._context=e;const t=this._context.configuration.options,i=t.get(50);this._cursorStyle=t.get(28),this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=vt(document.createElement("div")),this._domNode.setClassName(`cursor ${wp}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),Mn(this._domNode,i),this._domNode.setDisplay("none"),this._position=new V(1,1),this._lastRenderedContent="",this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}show(){this._isVisible||(this._domNode.setVisibility("inherit"),this._isVisible=!0)}hide(){this._isVisible&&(this._domNode.setVisibility("hidden"),this._isVisible=!1)}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(50);return this._cursorStyle=t.get(28),this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),Mn(this._domNode,i),!0}onCursorPositionChanged(e,t){return t?this._domNode.domNode.style.transitionProperty="none":this._domNode.domNode.style.transitionProperty="",this._position=e,!0}_getGraphemeAwarePosition(){const{lineNumber:e,column:t}=this._position,i=this._context.viewModel.getLineContent(e),[s,o]=Vge(i,t-1);return[new V(e,s+1),i.substring(s,o)]}_prepareRender(e){let t="",i="";const[s,o]=this._getGraphemeAwarePosition();if(this._cursorStyle===pn.Line||this._cursorStyle===pn.LineThin){const h=e.visibleRangeForPosition(s);if(!h||h.outsideRenderedLine)return null;let f;this._cursorStyle===pn.Line?(f=f9(this._lineCursorWidth>0?this._lineCursorWidth:2),f>2&&(t=o,i=this._getTokenClassName(s))):f=f9(1);let g=h.left,p=0;f>=2&&g>=1&&(p=1,g-=p);const _=e.getVerticalOffsetForLineNumber(s.lineNumber)-e.bigNumbersDelta;return new F7(_,g,p,f,this._lineHeight,t,i)}const r=e.linesVisibleRangesForRange(new N(s.lineNumber,s.column,s.lineNumber,s.column+o.length),!1);if(!r||r.length===0)return null;const a=r[0];if(a.outsideRenderedLine||a.ranges.length===0)return null;const l=a.ranges[0],c=o===" "?this._typicalHalfwidthCharacterWidth:l.width<1?this._typicalHalfwidthCharacterWidth:l.width;this._cursorStyle===pn.Block&&(t=o,i=this._getTokenClassName(s));let d=e.getVerticalOffsetForLineNumber(s.lineNumber)-e.bigNumbersDelta,u=this._lineHeight;return(this._cursorStyle===pn.Underline||this._cursorStyle===pn.UnderlineThin)&&(d+=this._lineHeight-2,u=2),new F7(d,l.left,0,c,u,t,i)}_getTokenClassName(e){const t=this._context.viewModel.getViewLineData(e.lineNumber),i=t.tokens.findTokenIndexAtOffset(e.column-1);return t.tokens.getClassName(i)}prepareRender(e){this._renderData=this._prepareRender(e)}render(e){return this._renderData?(this._lastRenderedContent!==this._renderData.textContent&&(this._lastRenderedContent=this._renderData.textContent,this._domNode.domNode.textContent=this._lastRenderedContent),this._domNode.setClassName(`cursor ${wp} ${this._renderData.textContentClassName}`),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),this._domNode.setPaddingLeft(this._renderData.paddingLeft),this._domNode.setWidth(this._renderData.width),this._domNode.setLineHeight(this._renderData.height),this._domNode.setHeight(this._renderData.height),{domNode:this._domNode.domNode,position:this._position,contentLeft:this._renderData.left,height:this._renderData.height,width:2}):(this._domNode.setDisplay("none"),null)}}class uv extends lo{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(90),this._cursorBlinking=t.get(26),this._cursorStyle=t.get(28),this._cursorSmoothCaretAnimation=t.get(27),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new B7(this._context),this._secondaryCursors=[],this._renderData=[],this._domNode=vt(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._updateDomClassName(),this._domNode.appendChild(this._primaryCursor.getDomNode()),this._startCursorBlinkAnimation=new Lc,this._cursorFlatBlinkInterval=new G1,this._blinkingEnabled=!1,this._editorHasFocus=!1,this._updateBlinking()}dispose(){super.dispose(),this._startCursorBlinkAnimation.dispose(),this._cursorFlatBlinkInterval.dispose()}getDomNode(){return this._domNode}onCompositionStart(e){return this._isComposingInput=!0,this._updateBlinking(),!0}onCompositionEnd(e){return this._isComposingInput=!1,this._updateBlinking(),!0}onConfigurationChanged(e){const t=this._context.configuration.options;this._readOnly=t.get(90),this._cursorBlinking=t.get(26),this._cursorStyle=t.get(28),this._cursorSmoothCaretAnimation=t.get(27),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let i=0,s=this._secondaryCursors.length;it.length){const o=this._secondaryCursors.length-t.length;for(let r=0;r{for(let s=0,o=e.ranges.length;s{this._isVisible?this._hide():this._show()},uv.BLINK_INTERVAL):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},uv.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case pn.Line:e+=" cursor-line-style";break;case pn.Block:e+=" cursor-block-style";break;case pn.Underline:e+=" cursor-underline-style";break;case pn.LineThin:e+=" cursor-line-thin-style";break;case pn.BlockOutline:e+=" cursor-block-outline-style";break;case pn.UnderlineThin:e+=" cursor-underline-thin-style";break;default:e+=" cursor-line-style"}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case 1:e+=" cursor-blink";break;case 2:e+=" cursor-smooth";break;case 3:e+=" cursor-phase";break;case 4:e+=" cursor-expand";break;case 5:e+=" cursor-solid";break;default:e+=" cursor-solid"}else e+=" cursor-solid";return(this._cursorSmoothCaretAnimation==="on"||this._cursorSmoothCaretAnimation==="explicit")&&(e+=" cursor-smooth-caret-animation"),e}_show(){this._primaryCursor.show();for(let e=0,t=this._secondaryCursors.length;e{const t=n.getColor(uq);if(t){let i=n.getColor(U1e);i||(i=t.opposite()),e.addRule(`.monaco-editor .cursors-layer .cursor { background-color: ${t}; border-color: ${t}; color: ${i}; }`),ac(n.type)&&e.addRule(`.monaco-editor .cursors-layer.has-selection .cursor { border-left: 1px solid ${i}; border-right: 1px solid ${i}; }`)}});const M2=()=>{throw new Error("Invalid change accessor")};class Ewe extends lo{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(143);this._lineHeight=t.get(66),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,this.domNode=vt(document.createElement("div")),this.domNode.setClassName("view-zones"),this.domNode.setPosition("absolute"),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.marginDomNode=vt(document.createElement("div")),this.marginDomNode.setClassName("margin-view-zones"),this.marginDomNode.setPosition("absolute"),this.marginDomNode.setAttribute("role","presentation"),this.marginDomNode.setAttribute("aria-hidden","true"),this._zones={}}dispose(){super.dispose(),this._zones={}}_recomputeWhitespacesProps(){const e=this._context.viewLayout.getWhitespaces(),t=new Map;for(const s of e)t.set(s.id,s);let i=!1;return this._context.viewModel.changeWhitespace(s=>{const o=Object.keys(this._zones);for(let r=0,a=o.length;r{const s={addZone:o=>(t=!0,this._addZone(i,o)),removeZone:o=>{o&&(t=this._removeZone(i,o)||t)},layoutZone:o=>{o&&(t=this._layoutZone(i,o)||t)}};Awe(e,s),s.addZone=M2,s.removeZone=M2,s.layoutZone=M2}),t}_addZone(e,t){const i=this._computeWhitespaceProps(t),o={whitespaceId:e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),delegate:t,isInHiddenArea:i.isInHiddenArea,isVisible:!1,domNode:vt(t.domNode),marginDomNode:t.marginDomNode?vt(t.marginDomNode):null};return this._safeCallOnComputedHeight(o.delegate,i.heightInPx),o.domNode.setPosition("absolute"),o.domNode.domNode.style.width="100%",o.domNode.setDisplay("none"),o.domNode.setAttribute("monaco-view-zone",o.whitespaceId),this.domNode.appendChild(o.domNode),o.marginDomNode&&(o.marginDomNode.setPosition("absolute"),o.marginDomNode.domNode.style.width="100%",o.marginDomNode.setDisplay("none"),o.marginDomNode.setAttribute("monaco-view-zone",o.whitespaceId),this.marginDomNode.appendChild(o.marginDomNode)),this._zones[o.whitespaceId]=o,this.setShouldRender(),o.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t];return delete this._zones[t],e.removeWhitespace(i.whitespaceId),i.domNode.removeAttribute("monaco-visible-view-zone"),i.domNode.removeAttribute("monaco-view-zone"),i.domNode.domNode.parentNode.removeChild(i.domNode.domNode),i.marginDomNode&&(i.marginDomNode.removeAttribute("monaco-visible-view-zone"),i.marginDomNode.removeAttribute("monaco-view-zone"),i.marginDomNode.domNode.parentNode.removeChild(i.marginDomNode.domNode)),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t],s=this._computeWhitespaceProps(i.delegate);return i.isInHiddenArea=s.isInHiddenArea,e.changeOneWhitespace(i.whitespaceId,s.afterViewLineNumber,s.heightInPx),this._safeCallOnComputedHeight(i.delegate,s.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){return this._zones.hasOwnProperty(e)?!!this._zones[e].delegate.suppressMouseDown:!1}_heightInPixels(e){return typeof e.heightInPx=="number"?e.heightInPx:typeof e.heightInLines=="number"?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){return typeof e.minWidthInPx=="number"?e.minWidthInPx:0}_safeCallOnComputedHeight(e,t){if(typeof e.onComputedHeight=="function")try{e.onComputedHeight(t)}catch(i){_t(i)}}_safeCallOnDomNodeTop(e,t){if(typeof e.onDomNodeTop=="function")try{e.onDomNodeTop(t)}catch(i){_t(i)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,i={};let s=!1;for(const r of t)this._zones[r.id].isInHiddenArea||(i[r.id]=r,s=!0);const o=Object.keys(this._zones);for(let r=0,a=o.length;ra)continue;const f=h.startLineNumber===a?h.startColumn:c.minColumn,g=h.endLineNumber===a?h.endColumn:c.maxColumn;f=P.endOffset&&(k++,P=i&&i[k]),R!==9&&R!==32||h&&!L&&M<=D)continue;if(u&&M>=x&&M<=D&&R===32){const G=M-1>=0?a.charCodeAt(M-1):0,te=M+1=0?a.charCodeAt(M-1):0;if(R===32&&G!==32&&G!==9)continue}if(i&&(!P||P.startOffset>M||P.endOffset<=M))continue;const z=e.visibleRangeForPosition(new V(t,M+1));z&&(r?(O=Math.max(O,z.left),R===9?C+=this._renderArrow(f,_,z.left):C+=``):R===9?C+=`
${w?"→":"→"}
`:C+=`
${String.fromCharCode(y)}
`)}return r?(O=Math.round(O+_),``+C+""):C}_renderArrow(e,t,i){const s=t/7,o=t,r=e/2,a=i,l={x:0,y:s/2},c={x:100/125*o,y:l.y},d={x:c.x-.2*c.x,y:c.y+.2*c.x},u={x:d.x+.1*c.x,y:d.y+.1*c.x},h={x:u.x+.35*c.x,y:u.y-.35*c.x},f={x:h.x,y:-h.y},g={x:u.x,y:-u.y},p={x:d.x,y:-d.y},_={x:c.x,y:-c.y},v={x:l.x,y:-l.y};return``}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class W7{constructor(e){const t=e.options,i=t.get(50),s=t.get(38);s==="off"?(this.renderWhitespace="none",this.renderWithSVG=!1):s==="svg"?(this.renderWhitespace=t.get(98),this.renderWithSVG=!0):(this.renderWhitespace=t.get(98),this.renderWithSVG=!1),this.spaceWidth=i.spaceWidth,this.middotWidth=i.middotWidth,this.wsmiddotWidth=i.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=i.canUseHalfwidthRightwardsArrow,this.lineHeight=t.get(66),this.stopRenderingLineAfter=t.get(116)}equals(e){return this.renderWhitespace===e.renderWhitespace&&this.renderWithSVG===e.renderWithSVG&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter}}var Pwe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Owe=function(n,e){return function(t,i){e(t,i,n)}};let BT=class extends X1{constructor(e,t,i,s,o,r,a){super(),this._instantiationService=a,this._shouldRecomputeGlyphMarginLanes=!1,this._selections=[new ct(1,1,1,1)],this._renderAnimationFrame=null;const l=new $ye(t,s,o,e);this._context=new Twe(t,i,s),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=this._instantiationService.createInstance(MT,this._context,l,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=vt(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=vt(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=vt(document.createElement("div")),sl.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new Qye(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new xD(this._context,this._linesContent),this._viewZones=new Ewe(this._context),this._viewParts.push(this._viewZones);const c=new vwe(this._context);this._viewParts.push(c);const d=new Swe(this._context);this._viewParts.push(d);const u=new jye(this._context);this._viewParts.push(u),u.addDynamicOverlay(new Yye(this._context)),u.addDynamicOverlay(new mi(this._context)),u.addDynamicOverlay(new ewe(this._context)),u.addDynamicOverlay(new Xye(this._context)),u.addDynamicOverlay(new Mwe(this._context));const h=new qye(this._context);this._viewParts.push(h),h.addDynamicOverlay(new Zye(this._context)),h.addDynamicOverlay(new uwe(this._context)),h.addDynamicOverlay(new dwe(this._context)),h.addDynamicOverlay(new ty(this._context)),this._glyphMarginWidgets=new rwe(this._context),this._viewParts.push(this._glyphMarginWidgets);const f=new yf(this._context);f.getDomNode().appendChild(this._viewZones.marginDomNode),f.getDomNode().appendChild(h.getDomNode()),f.getDomNode().appendChild(this._glyphMarginWidgets.domNode),this._viewParts.push(f),this._contentWidgets=new Gye(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new uv(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new _we(this._context),this._viewParts.push(this._overlayWidgets);const g=new Cwe(this._context);this._viewParts.push(g);const p=new Rwe(this._context);this._viewParts.push(p);const _=new mwe(this._context);if(this._viewParts.push(_),c){const v=this._scrollbar.getOverviewRulerLayoutInfo();v.parent.insertBefore(c.getDomNode(),v.insertBefore)}this._linesContent.appendChild(u.getDomNode()),this._linesContent.appendChild(g.domNode),this._linesContent.appendChild(this._viewZones.domNode),this._linesContent.appendChild(this._viewLines.getDomNode()),this._linesContent.appendChild(this._contentWidgets.domNode),this._linesContent.appendChild(this._viewCursors.getDomNode()),this._overflowGuardContainer.appendChild(f.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._overflowGuardContainer.appendChild(d.getDomNode()),this._overflowGuardContainer.appendChild(this._textAreaHandler.textArea),this._overflowGuardContainer.appendChild(this._textAreaHandler.textAreaCover),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(_.getDomNode()),this._overflowGuardContainer.appendChild(p.domNode),this.domNode.appendChild(this._overflowGuardContainer),r?r.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode):this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this._applyLayout(),this._pointerHandler=this._register(new z1e(this._context,l,this._createPointerHandlerHelper()))}_flushAccumulatedAndRenderNow(){this._shouldRecomputeGlyphMarginLanes&&(this._shouldRecomputeGlyphMarginLanes=!1,this._context.configuration.setGlyphMarginDecorationLaneCount(this._computeGlyphMarginLaneCount())),md.onRenderStart(),this._renderNow()}_computeGlyphMarginLaneCount(){const e=this._context.viewModel.model;let t=[];t=t.concat(e.getAllMarginDecorations().map(o=>{var r,a;const l=(a=(r=o.options.glyphMargin)===null||r===void 0?void 0:r.position)!==null&&a!==void 0?a:_p.Left;return{range:o.range,lane:l}})),t=t.concat(this._glyphMarginWidgets.getWidgets().map(o=>({range:e.validateRange(o.preference.range),lane:o.preference.lane}))),t.sort((o,r)=>N.compareRangesUsingStarts(o.range,r.range));let i=null,s=null;for(const o of t)if(o.lane===_p.Left&&(!i||N.compareRangesUsingEnds(i,o.range)<0)&&(i=o.range),o.lane===_p.Right&&(!s||N.compareRangesUsingEnds(s,o.range)<0)&&(s=o.range),i&&s){if(i.endLineNumber{this.focus()},dispatchTextAreaEvent:e=>{this._textAreaHandler.textArea.domNode.dispatchEvent(e)},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._textAreaHandler.getLastRenderData();return new b1e(e,t)},renderNow:()=>{this.render(!0,!1)},shouldSuppressMouseDownOnViewZone:e=>this._viewZones.shouldSuppressMouseDownOnViewZone(e),shouldSuppressMouseDownOnWidget:e=>this._contentWidgets.shouldSuppressMouseDownOnWidget(e),getPositionFromDOMInfo:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getPositionFromDOMInfo(e,t)),visibleRangeForPosition:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(new V(e,t))),getLineWidth:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getLineWidth(e))}}_createTextAreaHandlerHelper(){return{visibleRangeForPosition:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(e))}}_applyLayout(){const t=this._context.configuration.options.get(143);this.domNode.setWidth(t.width),this.domNode.setHeight(t.height),this._overflowGuardContainer.setWidth(t.width),this._overflowGuardContainer.setHeight(t.height),this._linesContent.setWidth(1e6),this._linesContent.setHeight(1e6)}_getEditorClassName(){const e=this._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(140)+" "+RT(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this.domNode.setClassName(this._getEditorClassName()),this._applyLayout(),!1}onCursorStateChanged(e){return this._selections=e.selections,!1}onDecorationsChanged(e){return e.affectsGlyphMargin&&(this._shouldRecomputeGlyphMarginLanes=!0),!1}onFocusChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}onThemeChanged(e){return this._context.theme.update(e.theme),this.domNode.setClassName(this._getEditorClassName()),!1}dispose(){this._renderAnimationFrame!==null&&(this._renderAnimationFrame.dispose(),this._renderAnimationFrame=null),this._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove(),this._context.removeEventHandler(this),this._viewLines.dispose();for(const e of this._viewParts)e.dispose();super.dispose()}_scheduleRender(){this._renderAnimationFrame===null&&(this._renderAnimationFrame=JU(this._onRenderScheduled.bind(this),100))}_onRenderScheduled(){this._renderAnimationFrame=null,this._flushAccumulatedAndRenderNow()}_renderNow(){Fwe(()=>this._actualRender())}_getViewPartsToRender(){const e=[];let t=0;for(const i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_actualRender(){if(!X4(this.domNode.domNode))return;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&e.length===0)return;const t=this._context.viewLayout.getLinesViewportData();this._context.viewModel.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);const i=new Nwe(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(i),this._viewLines.shouldRender()&&(this._viewLines.renderText(i),this._viewLines.onDidRender(),e=this._getViewPartsToRender());const s=new u1e(this._context.viewLayout,i,this._viewLines);for(const o of e)o.prepareRender(s);for(const o of e)o.render(s),o.onDidRender()}delegateVerticalScrollbarPointerDown(e){this._scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this._scrollbar.delegateScrollFromMouseWheelEvent(e)}restoreState(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft},1),this._context.viewModel.visibleLinesStabilized()}getOffsetForColumn(e,t){const i=this._context.viewModel.model.validatePosition({lineNumber:e,column:t}),s=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i);this._flushAccumulatedAndRenderNow();const o=this._viewLines.visibleRangeForPosition(new V(s.lineNumber,s.column));return o?o.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?CD.convertViewToModelMouseTarget(i,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new wwe(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(const i of this._viewParts)i.forceShouldRender()}e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}writeScreenReaderContent(e){this._textAreaHandler.writeScreenReaderContent(e)}focus(){this._textAreaHandler.focusTextArea()}isFocused(){return this._textAreaHandler.isFocused()}setAriaOptions(e){this._textAreaHandler.setAriaOptions(e)}addContentWidget(e){this._contentWidgets.addWidget(e.widget),this.layoutContentWidget(e),this._scheduleRender()}layoutContentWidget(e){var t,i,s,o,r,a,l,c;this._contentWidgets.setWidgetPosition(e.widget,(i=(t=e.position)===null||t===void 0?void 0:t.position)!==null&&i!==void 0?i:null,(o=(s=e.position)===null||s===void 0?void 0:s.secondaryPosition)!==null&&o!==void 0?o:null,(a=(r=e.position)===null||r===void 0?void 0:r.preference)!==null&&a!==void 0?a:null,(c=(l=e.position)===null||l===void 0?void 0:l.positionAffinity)!==null&&c!==void 0?c:null),this._scheduleRender()}removeContentWidget(e){this._contentWidgets.removeWidget(e.widget),this._scheduleRender()}addOverlayWidget(e){this._overlayWidgets.addWidget(e.widget),this.layoutOverlayWidget(e),this._scheduleRender()}layoutOverlayWidget(e){const t=e.position?e.position.preference:null;this._overlayWidgets.setWidgetPosition(e.widget,t)&&this._scheduleRender()}removeOverlayWidget(e){this._overlayWidgets.removeWidget(e.widget),this._scheduleRender()}addGlyphMarginWidget(e){this._glyphMarginWidgets.addWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}layoutGlyphMarginWidget(e){const t=e.position;this._glyphMarginWidgets.setWidgetPosition(e.widget,t)&&(this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender())}removeGlyphMarginWidget(e){this._glyphMarginWidgets.removeWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}};BT=Pwe([Owe(6,yt)],BT);function Fwe(n){try{return n()}catch(e){_t(e)}}class Aq{constructor(e,t,i,s,o,r){this.id=e,this.label=t,this.alias=i,this._precondition=s,this._run=o,this._contextKeyService=r}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(e){return this.isSupported()?this._run(e):Promise.resolve(void 0)}}function Cf(n){let e=0,t=0,i=0,s=0;for(let o=0,r=n.length;o=xo&&(t=t-n%xo),t}function Hwe(n,e){return n.reduce((t,i)=>Wi(t,e(i)),As)}function Iq(n,e){return n===e}function fv(n,e){const t=n,i=e;if(i-t<=0)return As;const o=Math.floor(t/xo),r=Math.floor(i/xo),a=i-r*xo;if(o===r){const l=t-o*xo;return Si(0,a-l)}else return Si(r-o,a)}function Cp(n,e){return n=e}function Xg(n){return Si(n.lineNumber-1,n.column-1)}function Qh(n,e){const t=n,i=Math.floor(t/xo),s=t-i*xo,o=e,r=Math.floor(o/xo),a=o-r*xo;return new N(i+1,s+1,r+1,a+1)}function $we(n){const e=Vf(n);return Si(e.length-1,e[e.length-1].length)}class ic{static fromModelContentChanges(e){return e.map(i=>{const s=N.lift(i.range);return new ic(Xg(s.getStartPosition()),Xg(s.getEndPosition()),$we(i.text))}).reverse()}constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}toString(){return`[${Uo(this.startOffset)}...${Uo(this.endOffset)}) -> ${Uo(this.newLength)}`}}class Uwe{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>kP.from(t))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);const t=this.edits[this.nextEditIdx],i=t?this.translateOldToCur(t.offsetObj):null;return i===null?null:fv(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?Si(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):Si(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=Uo(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?Si(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):Si(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx>5;if(s===0){const r=1<this.textBufferLineCount-1||this.lineIdx===this.textBufferLineCount-1&&this.lineCharOffset>=this.textBufferLastLineLength)return null;this.line===null&&(this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.line=this.lineTokens.getLineContent(),this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));const e=this.lineIdx,t=this.lineCharOffset;let i=0;for(;;){const o=this.lineTokens,r=o.getCount();let a=null;if(this.lineTokenOffset1e3))break;if(i>1500)break}const s=Vwe(e,t,this.lineIdx,this.lineCharOffset);return new td(s,0,-1,Mi.getEmpty(),new fh(s))}}class Qwe{constructor(e,t){this.text=e,this._offset=As,this.idx=0;const i=t.getRegExpStr(),s=i?new RegExp(i+`| -`,"gi"):null,o=[];let r,a=0,l=0,c=0,d=0;const u=[];for(let g=0;g<60;g++)u.push(new td(Si(0,g),0,-1,Mi.getEmpty(),new fh(Si(0,g))));const h=[];for(let g=0;g<60;g++)h.push(new td(Si(1,g),0,-1,Mi.getEmpty(),new fh(Si(1,g))));if(s)for(s.lastIndex=0;(r=s.exec(e))!==null;){const g=r.index,p=r[0];if(p===` -`)a++,l=g+1;else{if(c!==g){let _;if(d===a){const v=g-c;if(vJwe(t)).join("|")}}get regExpGlobal(){if(!this.hasRegExp){const e=this.getRegExpStr();this._regExpGlobal=e?new RegExp(e,"gi"):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(e){return this.map.get(e.toLowerCase())}findClosingTokenText(e){for(const[t,i]of this.map)if(i.kind===2&&i.bracketIds.intersects(e))return t}get isEmpty(){return this.map.size===0}}function Jwe(n){let e=xr(n);return/^[\w ]+/.test(n)&&(e=`\\b${e}`),/[\w ]+$/.test(n)&&(e=`${e}\\b`),e}class eCe{constructor(e,t){this.denseKeyProvider=e,this.getLanguageConfiguration=t,this.languageIdToBracketTokens=new Map}didLanguageChange(e){return this.languageIdToBracketTokens.has(e)}getSingleLanguageBracketTokens(e){let t=this.languageIdToBracketTokens.get(e);return t||(t=IP.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function tCe(n){if(n.length===0)return null;if(n.length===1)return n[0];let e=0;function t(){if(e>=n.length)return null;const r=e,a=n[r].listHeight;for(e++;e=2?Tq(r===0&&e===n.length?n:n.slice(r,e),!1):n[r]}let i=t(),s=t();if(!s)return i;for(let r=t();r;r=t())H7(i,s)<=H7(s,r)?(i=P2(i,s),s=r):s=P2(s,r);return P2(i,s)}function Tq(n,e=!1){if(n.length===0)return null;if(n.length===1)return n[0];let t=n.length;for(;t>3;){const i=t>>1;for(let s=0;s=3?n[2]:null,e)}function H7(n,e){return Math.abs(n.listHeight-e.listHeight)}function P2(n,e){return n.listHeight===e.listHeight?ol.create23(n,e,null,!1):n.listHeight>e.listHeight?iCe(n,e):nCe(e,n)}function iCe(n,e){n=n.toMutable();let t=n;const i=[];let s;for(;;){if(e.listHeight===t.listHeight){s=e;break}if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeLastElementMutable()}for(let o=i.length-1;o>=0;o--){const r=i[o];s?r.childrenLength>=3?s=ol.create23(r.unappendChild(),s,null,!1):(r.appendChildOfSameHeight(s),s=void 0):r.handleChildrenChanged()}return s?ol.create23(n,s,null,!1):n}function nCe(n,e){n=n.toMutable();let t=n;const i=[];for(;e.listHeight!==t.listHeight;){if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeFirstElementMutable()}let s=e;for(let o=i.length-1;o>=0;o--){const r=i[o];s?r.childrenLength>=3?s=ol.create23(s,r.unprependChild(),null,!1):(r.prependChildOfSameHeight(s),s=void 0):r.handleChildrenChanged()}return s?ol.create23(s,n,null,!1):n}class sCe{constructor(e){this.lastOffset=As,this.nextNodes=[e],this.offsets=[As],this.idxs=[]}readLongestNodeAt(e,t){if(Cp(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=R0(this.nextNodes);if(!i)return;const s=R0(this.offsets);if(Cp(e,s))return;if(Cp(s,e))if(Wi(s,i.length)<=e)this.nextNodeAfterCurrent();else{const o=O2(i);o!==-1?(this.nextNodes.push(i.getChild(o)),this.offsets.push(s),this.idxs.push(o)):this.nextNodeAfterCurrent()}else{if(t(i))return this.nextNodeAfterCurrent(),i;{const o=O2(i);if(o===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(i.getChild(o)),this.offsets.push(s),this.idxs.push(o)}}}}nextNodeAfterCurrent(){for(;;){const e=R0(this.offsets),t=R0(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const i=R0(this.nextNodes),s=O2(i,this.idxs[this.idxs.length-1]);if(s!==-1){this.nextNodes.push(i.getChild(s)),this.offsets.push(Wi(e,t.length)),this.idxs[this.idxs.length-1]=s;break}else this.idxs.pop()}}}function O2(n,e=-1){for(;;){if(e++,e>=n.childrenLength)return-1;if(n.getChild(e))return e}}function R0(n){return n.length>0?n[n.length-1]:void 0}function $7(n,e,t,i){return new oCe(n,e,t,i).parseDocument()}class oCe{constructor(e,t,i,s){if(this.tokenizer=e,this.createImmutableLists=s,this._itemsConstructed=0,this._itemsFromCache=0,i&&s)throw new Error("Not supported");this.oldNodeReader=i?new sCe(i):void 0,this.positionMapper=new Uwe(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(Mi.getEmpty(),0);return e||(e=ol.getEmpty()),e}parseList(e,t){const i=[];for(;;){let o=this.tryReadChildFromCache(e);if(!o){const r=this.tokenizer.peek();if(!r||r.kind===2&&r.bracketIds.intersects(e))break;o=this.parseChild(e,t+1)}o.kind===4&&o.childrenLength===0||i.push(o)}return this.oldNodeReader?tCe(i):Tq(i,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(t===null||!QS(t)){const i=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),s=>t!==null&&!Cp(s.length,t)?!1:s.canBeReused(e));if(i)return this._itemsFromCache++,this.tokenizer.skip(i.length),i}}}parseChild(e,t){this._itemsConstructed++;const i=this.tokenizer.read();switch(i.kind){case 2:return new Ywe(i.bracketIds,i.length);case 0:return i.astNode;case 1:{if(t>300)return new fh(i.length);const s=e.merge(i.bracketIds),o=this.parseList(s,t+1),r=this.tokenizer.peek();return r&&r.kind===2&&(r.bracketId===i.bracketId||r.bracketIds.intersects(i.bracketIds))?(this.tokenizer.read(),gv.create(i.astNode,o,r.astNode)):gv.create(i.astNode,o,null)}default:throw new Error("unexpected")}}}function tx(n,e){if(n.length===0)return e;if(e.length===0)return n;const t=new _c(U7(n)),i=U7(e);i.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let s=t.dequeue();function o(c){if(c===void 0){const u=t.takeWhile(h=>!0)||[];return s&&u.unshift(s),u}const d=[];for(;s&&!QS(c);){const[u,h]=s.splitAt(c);d.push(u),c=fv(u.lengthAfter,c),s=h??t.dequeue()}return QS(c)||d.push(new _d(!1,c,c)),d}const r=[];function a(c,d,u){if(r.length>0&&Iq(r[r.length-1].endOffset,c)){const h=r[r.length-1];r[r.length-1]=new ic(h.startOffset,d,Wi(h.newLength,u))}else r.push({startOffset:c,endOffset:d,newLength:u})}let l=As;for(const c of i){const d=o(c.lengthBefore);if(c.modified){const u=Hwe(d,f=>f.lengthBefore),h=Wi(l,u);a(l,h,c.lengthAfter),l=h}else for(const u of d){const h=l;l=Wi(l,u.lengthBefore),u.modified&&a(h,l,u.lengthAfter)}}return r}class _d{constructor(e,t,i){this.modified=e,this.lengthBefore=t,this.lengthAfter=i}splitAt(e){const t=fv(e,this.lengthAfter);return Iq(t,As)?[this,void 0]:this.modified?[new _d(this.modified,this.lengthBefore,e),new _d(this.modified,As,t)]:[new _d(this.modified,e,e),new _d(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${Uo(this.lengthBefore)} -> ${Uo(this.lengthAfter)}`}}function U7(n){const e=[];let t=As;for(const i of n){const s=fv(t,i.startOffset);QS(s)||e.push(new _d(!1,s,s));const o=fv(i.startOffset,i.endOffset);e.push(new _d(!0,o,i.newLength)),t=i.endOffset}return e}class rCe extends Y{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new B,this.denseKeyProvider=new jwe,this.brackets=new eCe(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],e.tokenization.hasTokens)e.tokenization.backgroundTokenizationState===2?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens);else{const i=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),s=new Qwe(this.textModel.getValue(),i);this.initialAstWithoutTokens=$7(s,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}}handleDidChangeBackgroundTokenizationState(){if(this.textModel.tokenization.backgroundTokenizationState===2){const e=this.initialAstWithoutTokens===void 0;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){const t=e.map(i=>new ic(Si(i.fromLineNumber-1,0),Si(i.toLineNumber,0),Si(i.toLineNumber-i.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=ic.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const i=tx(this.queuedTextEdits,e);this.queuedTextEdits=i,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=tx(this.queuedTextEditsForInitialAstWithoutTokens,e))}flushQueue(){this.queuedTextEdits.length>0&&(this.astWithTokens=this.parseDocumentFromTextBuffer(this.queuedTextEdits,this.astWithTokens,!1),this.queuedTextEdits=[]),this.queuedTextEditsForInitialAstWithoutTokens.length>0&&(this.initialAstWithoutTokens&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer(this.queuedTextEditsForInitialAstWithoutTokens,this.initialAstWithoutTokens,!1)),this.queuedTextEditsForInitialAstWithoutTokens=[])}parseDocumentFromTextBuffer(e,t,i){const s=t,o=new Zwe(this.textModel,this.brackets);return $7(o,e,s,i)}getBracketsInRange(e,t){this.flushQueue();const i=Si(e.startLineNumber-1,e.startColumn-1),s=Si(e.endLineNumber-1,e.endColumn-1);return new Xa(o=>{const r=this.initialAstWithoutTokens||this.astWithTokens;WT(r,As,r.length,i,s,o,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();const i=Xg(e.getStartPosition()),s=Xg(e.getEndPosition());return new Xa(o=>{const r=this.initialAstWithoutTokens||this.astWithTokens,a=new aCe(o,t,this.textModel);VT(r,As,r.length,i,s,a,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return Rq(t,As,t.length,Xg(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return Nq(t,As,t.length,Xg(e))}}function Nq(n,e,t,i){if(n.kind===4||n.kind===2){const s=[];for(const o of n.children)t=Wi(e,o.length),s.push({nodeOffsetStart:e,nodeOffsetEnd:t}),e=t;for(let o=s.length-1;o>=0;o--){const{nodeOffsetStart:r,nodeOffsetEnd:a}=s[o];if(Cp(r,i)){const l=Nq(n.children[o],r,a,i);if(l)return l}}return null}else{if(n.kind===3)return null;if(n.kind===1){const s=Qh(e,t);return{bracketInfo:n.bracketInfo,range:s}}}return null}function Rq(n,e,t,i){if(n.kind===4||n.kind===2){for(const s of n.children){if(t=Wi(e,s.length),Cp(i,t)){const o=Rq(s,e,t,i);if(o)return o}e=t}return null}else{if(n.kind===3)return null;if(n.kind===1){const s=Qh(e,t);return{bracketInfo:n.bracketInfo,range:s}}}return null}function WT(n,e,t,i,s,o,r,a,l,c,d=!1){if(r>200)return!0;e:for(;;)switch(n.kind){case 4:{const u=n.childrenLength;for(let h=0;h200)return!0;let c=!0;if(n.kind===2){let d=0;if(a){let f=a.get(n.openingBracket.text);f===void 0&&(f=0),d=f,f++,a.set(n.openingBracket.text,f)}const u=Wi(e,n.openingBracket.length);let h=-1;if(o.includeMinIndentation&&(h=n.computeMinIndentation(e,o.textModel)),c=o.push(new Wwe(Qh(e,t),Qh(e,u),n.closingBracket?Qh(Wi(u,((l=n.child)===null||l===void 0?void 0:l.length)||As),t):void 0,r,d,n,h)),e=u,c&&n.child){const f=n.child;if(t=Wi(e,f.length),Sp(e,s)&&f_(t,i)&&(c=VT(f,e,t,i,s,o,r+1,a),!c))return!1}a==null||a.set(n.openingBracket.text,d)}else{let d=e;for(const u of n.children){const h=d;if(d=Wi(d,u.length),Sp(h,s)&&Sp(i,d)&&(c=VT(u,h,d,i,s,o,r,a),!c))return!1}}return c}class lCe extends Y{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new ra),this.onDidChangeEmitter=new B,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1,this._register(this.languageConfigurationService.onDidChange(i=>{var s;(!i.languageId||!((s=this.bracketPairsTree.value)===null||s===void 0)&&s.object.didLanguageChange(i.languageId))&&(this.bracketPairsTree.clear(),this.updateBracketPairsTree())}))}handleDidChangeOptions(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeLanguage(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeContent(e){var t;(t=this.bracketPairsTree.value)===null||t===void 0||t.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){var e;(e=this.bracketPairsTree.value)===null||e===void 0||e.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){var t;(t=this.bracketPairsTree.value)===null||t===void 0||t.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.canBuildAST){if(!this.bracketPairsTree.value){const e=new pe;this.bracketPairsTree.value=cCe(e.add(new rCe(this.textModel,t=>this.languageConfigurationService.getLanguageConfiguration(t))),e),e.add(this.bracketPairsTree.value.object.onDidChange(t=>this.onDidChangeEmitter.fire(t))),this.onDidChangeEmitter.fire()}}else this.bracketPairsTree.value&&(this.bracketPairsTree.clear(),this.onDidChangeEmitter.fire())}getBracketPairsInRange(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getBracketPairsInRange(e,!1))||Xa.empty}getBracketPairsInRangeWithMinIndentation(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getBracketPairsInRange(e,!0))||Xa.empty}getBracketsInRange(e,t=!1){var i;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((i=this.bracketPairsTree.value)===null||i===void 0?void 0:i.object.getBracketsInRange(e,t))||Xa.empty}findMatchingBracketUp(e,t,i){const s=this.textModel.validatePosition(t),o=this.textModel.getLanguageIdAtPosition(s.lineNumber,s.column);if(this.canBuildAST){const r=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew.getClosingBracketInfo(e);if(!r)return null;const a=this.getBracketPairsInRange(N.fromPositions(t,t)).findLast(l=>r.closes(l.openingBracketInfo));return a?a.openingBracketRange:null}else{const r=e.toLowerCase(),a=this.languageConfigurationService.getLanguageConfiguration(o).brackets;if(!a)return null;const l=a.textIsBracket[r];return l?aw(this._findMatchingBracketUp(l,s,F2(i))):null}}matchBracket(e,t){if(this.canBuildAST){const i=this.getBracketPairsInRange(N.fromPositions(e,e)).filter(s=>s.closingBracketRange!==void 0&&(s.openingBracketRange.containsPosition(e)||s.closingBracketRange.containsPosition(e))).findLastMaxBy(mr(s=>s.openingBracketRange.containsPosition(e)?s.openingBracketRange:s.closingBracketRange,N.compareRangesUsingStarts));return i?[i.openingBracketRange,i.closingBracketRange]:null}else{const i=F2(t);return this._matchBracket(this.textModel.validatePosition(e),i)}}_establishBracketSearchOffsets(e,t,i,s){const o=t.getCount(),r=t.getLanguageId(s);let a=Math.max(0,e.column-1-i.maxBracketLength);for(let c=s-1;c>=0;c--){const d=t.getEndOffset(c);if(d<=a)break;if(ya(t.getStandardTokenType(c))||t.getLanguageId(c)!==r){a=d;break}}let l=Math.min(t.getLineContent().length,e.column-1+i.maxBracketLength);for(let c=s+1;c=l)break;if(ya(t.getStandardTokenType(c))||t.getLanguageId(c)!==r){l=d;break}}return{searchStartOffset:a,searchEndOffset:l}}_matchBracket(e,t){const i=e.lineNumber,s=this.textModel.tokenization.getLineTokens(i),o=this.textModel.getLineContent(i),r=s.findTokenIndexAtOffset(e.column-1);if(r<0)return null;const a=this.languageConfigurationService.getLanguageConfiguration(s.getLanguageId(r)).brackets;if(a&&!ya(s.getStandardTokenType(r))){let{searchStartOffset:l,searchEndOffset:c}=this._establishBracketSearchOffsets(e,s,a,r),d=null;for(;;){const u=or.findNextBracketInRange(a.forwardRegex,i,o,l,c);if(!u)break;if(u.startColumn<=e.column&&e.column<=u.endColumn){const h=o.substring(u.startColumn-1,u.endColumn-1).toLowerCase(),f=this._matchFoundBracket(u,a.textIsBracket[h],a.textIsOpenBracket[h],t);if(f){if(f instanceof Rl)return null;d=f}}l=u.endColumn-1}if(d)return d}if(r>0&&s.getStartOffset(r)===e.column-1){const l=r-1,c=this.languageConfigurationService.getLanguageConfiguration(s.getLanguageId(l)).brackets;if(c&&!ya(s.getStandardTokenType(l))){const{searchStartOffset:d,searchEndOffset:u}=this._establishBracketSearchOffsets(e,s,c,l),h=or.findPrevBracketInRange(c.reversedRegex,i,o,d,u);if(h&&h.startColumn<=e.column&&e.column<=h.endColumn){const f=o.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),g=this._matchFoundBracket(h,c.textIsBracket[f],c.textIsOpenBracket[f],t);if(g)return g instanceof Rl?null:g}}}return null}_matchFoundBracket(e,t,i,s){if(!t)return null;const o=i?this._findMatchingBracketDown(t,e.getEndPosition(),s):this._findMatchingBracketUp(t,e.getStartPosition(),s);return o?o instanceof Rl?o:[e,o]:null}_findMatchingBracketUp(e,t,i){const s=e.languageId,o=e.reversedRegex;let r=-1,a=0;const l=(c,d,u,h)=>{for(;;){if(i&&++a%100===0&&!i())return Rl.INSTANCE;const f=or.findPrevBracketInRange(o,c,d,u,h);if(!f)break;const g=d.substring(f.startColumn-1,f.endColumn-1).toLowerCase();if(e.isOpen(g)?r++:e.isClose(g)&&r--,r===0)return f;h=f.startColumn-1}return null};for(let c=t.lineNumber;c>=1;c--){const d=this.textModel.tokenization.getLineTokens(c),u=d.getCount(),h=this.textModel.getLineContent(c);let f=u-1,g=h.length,p=h.length;c===t.lineNumber&&(f=d.findTokenIndexAtOffset(t.column-1),g=t.column-1,p=t.column-1);let _=!0;for(;f>=0;f--){const v=d.getLanguageId(f)===s&&!ya(d.getStandardTokenType(f));if(v)_?g=d.getStartOffset(f):(g=d.getStartOffset(f),p=d.getEndOffset(f));else if(_&&g!==p){const b=l(c,h,g,p);if(b)return b}_=v}if(_&&g!==p){const v=l(c,h,g,p);if(v)return v}}return null}_findMatchingBracketDown(e,t,i){const s=e.languageId,o=e.forwardRegex;let r=1,a=0;const l=(d,u,h,f)=>{for(;;){if(i&&++a%100===0&&!i())return Rl.INSTANCE;const g=or.findNextBracketInRange(o,d,u,h,f);if(!g)break;const p=u.substring(g.startColumn-1,g.endColumn-1).toLowerCase();if(e.isOpen(p)?r++:e.isClose(p)&&r--,r===0)return g;h=g.endColumn-1}return null},c=this.textModel.getLineCount();for(let d=t.lineNumber;d<=c;d++){const u=this.textModel.tokenization.getLineTokens(d),h=u.getCount(),f=this.textModel.getLineContent(d);let g=0,p=0,_=0;d===t.lineNumber&&(g=u.findTokenIndexAtOffset(t.column-1),p=t.column-1,_=t.column-1);let v=!0;for(;g=1;a--){const l=this.textModel.tokenization.getLineTokens(a),c=l.getCount(),d=this.textModel.getLineContent(a);let u=c-1,h=d.length,f=d.length;if(a===i.lineNumber){u=l.findTokenIndexAtOffset(i.column-1),h=i.column-1,f=i.column-1;const p=l.getLanguageId(u);s!==p&&(s=p,o=this.languageConfigurationService.getLanguageConfiguration(s).brackets,r=this.languageConfigurationService.getLanguageConfiguration(s).bracketsNew)}let g=!0;for(;u>=0;u--){const p=l.getLanguageId(u);if(s!==p){if(o&&r&&g&&h!==f){const v=or.findPrevBracketInRange(o.reversedRegex,a,d,h,f);if(v)return this._toFoundBracket(r,v);g=!1}s=p,o=this.languageConfigurationService.getLanguageConfiguration(s).brackets,r=this.languageConfigurationService.getLanguageConfiguration(s).bracketsNew}const _=!!o&&!ya(l.getStandardTokenType(u));if(_)g?h=l.getStartOffset(u):(h=l.getStartOffset(u),f=l.getEndOffset(u));else if(r&&o&&g&&h!==f){const v=or.findPrevBracketInRange(o.reversedRegex,a,d,h,f);if(v)return this._toFoundBracket(r,v)}g=_}if(r&&o&&g&&h!==f){const p=or.findPrevBracketInRange(o.reversedRegex,a,d,h,f);if(p)return this._toFoundBracket(r,p)}}return null}findNextBracket(e){var t;const i=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getFirstBracketAfter(i))||null;const s=this.textModel.getLineCount();let o=null,r=null,a=null;for(let l=i.lineNumber;l<=s;l++){const c=this.textModel.tokenization.getLineTokens(l),d=c.getCount(),u=this.textModel.getLineContent(l);let h=0,f=0,g=0;if(l===i.lineNumber){h=c.findTokenIndexAtOffset(i.column-1),f=i.column-1,g=i.column-1;const _=c.getLanguageId(h);o!==_&&(o=_,r=this.languageConfigurationService.getLanguageConfiguration(o).brackets,a=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew)}let p=!0;for(;hp.closingBracketRange!==void 0&&p.range.strictContainsRange(f));return g?[g.openingBracketRange,g.closingBracketRange]:null}const s=F2(t),o=this.textModel.getLineCount(),r=new Map;let a=[];const l=(f,g)=>{if(!r.has(f)){const p=[];for(let _=0,v=g?g.brackets.length:0;_{for(;;){if(s&&++c%100===0&&!s())return Rl.INSTANCE;const b=or.findNextBracketInRange(f.forwardRegex,g,p,_,v);if(!b)break;const y=p.substring(b.startColumn-1,b.endColumn-1).toLowerCase(),w=f.textIsBracket[y];if(w&&(w.isOpen(y)?a[w.index]++:w.isClose(y)&&a[w.index]--,a[w.index]===-1))return this._matchFoundBracket(b,w,!1,s);_=b.endColumn-1}return null};let u=null,h=null;for(let f=i.lineNumber;f<=o;f++){const g=this.textModel.tokenization.getLineTokens(f),p=g.getCount(),_=this.textModel.getLineContent(f);let v=0,b=0,y=0;if(f===i.lineNumber){v=g.findTokenIndexAtOffset(i.column-1),b=i.column-1,y=i.column-1;const C=g.getLanguageId(v);u!==C&&(u=C,h=this.languageConfigurationService.getLanguageConfiguration(u).brackets,l(u,h))}let w=!0;for(;ve==null?void 0:e.dispose()}}function F2(n){if(typeof n>"u")return()=>!0;{const e=Date.now();return()=>Date.now()-e<=n}}class Rl{constructor(){this._searchCanceledBrand=void 0}}Rl.INSTANCE=new Rl;function aw(n){return n instanceof Rl?null:n}class dCe extends Y{constructor(e){super(),this.textModel=e,this.colorProvider=new Mq,this.onDidChangeEmitter=new B,this.onDidChange=this.onDidChangeEmitter.event,this.colorizationOptions=e.getOptions().bracketPairColorizationOptions,this._register(e.bracketPairs.onDidChange(t=>{this.onDidChangeEmitter.fire()}))}handleDidChangeOptions(e){this.colorizationOptions=this.textModel.getOptions().bracketPairColorizationOptions}getDecorationsInRange(e,t,i,s){return s?[]:t===void 0?[]:this.colorizationOptions.enabled?this.textModel.bracketPairs.getBracketsInRange(e,!0).map(r=>({id:`bracket${r.range.toString()}-${r.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(r,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:r.range})).toArray():[]}getAllDecorations(e,t){return e===void 0?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new N(1,1,this.textModel.getLineCount(),1),e,t):[]}}class Mq{constructor(){this.unexpectedClosingBracketClassName="unexpected-closing-bracket"}getInlineClassName(e,t){return e.isInvalid?this.unexpectedClosingBracketClassName:this.getInlineClassNameOfLevel(t?e.nestingLevelOfEqualBracketType:e.nestingLevel)}getInlineClassNameOfLevel(e){return`bracket-highlighting-${e%30}`}}Nr((n,e)=>{const t=[hq,fq,gq,pq,mq,_q],i=new Mq;e.addRule(`.monaco-editor .${i.unexpectedClosingBracketClassName} { color: ${n.getColor(dye)}; }`);const s=t.map(o=>n.getColor(o)).filter(o=>!!o).filter(o=>!o.isTransparent());for(let o=0;o<30;o++){const r=s[o%s.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(o)} { color: ${r}; }`)}});function lw(n){return n.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class wn{get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}constructor(e,t,i,s){this.oldPosition=e,this.oldText=t,this.newPosition=i,this.newText=s}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${lw(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${lw(this.oldText)}")`:`(replace@${this.oldPosition} "${lw(this.oldText)}" with "${lw(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const s=t.length;jr(e,s,i),i+=4;for(let o=0;on.length)return!1;if(t){if(!B4(n,e))return!1;if(e.length===n.length)return!0;let o=e.length;return e.charAt(e.length-1)===i&&o--,n.charAt(o)===i}return e.charAt(e.length-1)!==i&&(e+=i),n.indexOf(e)===0}function fCe(n){return n>=65&&n<=90||n>=97&&n<=122}function bl(n){return DS(n,!0)}class gCe{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:Wb(this.getComparisonKey(e,i),this.getComparisonKey(t,i))}isEqual(e,t,i=!1){return e===t?!0:!e||!t?!1:this.getComparisonKey(e,i)===this.getComparisonKey(t,i)}getComparisonKey(e,t=!1){return e.with({path:this._ignorePathCasing(e)?e.path.toLowerCase():void 0,fragment:t?null:void 0}).toString()}isEqualOrParent(e,t,i=!1){if(e.scheme===t.scheme){if(e.scheme===it.file)return zT(bl(e),bl(t),this._ignorePathCasing(e))&&e.query===t.query&&(i||e.fragment===t.fragment);if(G7(e.authority,t.authority))return zT(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(i||e.fragment===t.fragment)}return!1}joinPath(e,...t){return je.joinPath(e,...t)}basenameOrAuthority(e){return la(e)||e.authority}basename(e){return Fi.basename(e.path)}extname(e){return Fi.extname(e.path)}dirname(e){if(e.path.length===0)return e;let t;return e.scheme===it.file?t=je.file(bge(bl(e))).path:(t=Fi.dirname(e.path),e.authority&&t.length&&t.charCodeAt(0)!==47&&(console.error(`dirname("${e.toString})) resulted in a relative path`),t="/")),e.with({path:t})}normalizePath(e){if(!e.path.length)return e;let t;return e.scheme===it.file?t=je.file(CU(bl(e))).path:t=Fi.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!G7(e.authority,t.authority))return;if(e.scheme===it.file){const o=_ge(bl(e),bl(t));return Fs?Pq(o):o}let i=e.path||"/";const s=t.path||"/";if(this._ignorePathCasing(e)){let o=0;for(const r=Math.min(i.length,s.length);oj7(i).length&&i[i.length-1]===t}else{const i=e.path;return i.length>1&&i.charCodeAt(i.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=kd){return K7(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=kd){let i=!1;if(e.scheme===it.file){const s=bl(e);i=s!==void 0&&s.length===j7(s).length&&s[s.length-1]===t}else{t="/";const s=e.path;i=s.length===1&&s.charCodeAt(s.length-1)===47}return!i&&!K7(e,t)?e.with({path:e.path+"/"}):e}}const $t=new gCe(()=>!1),TP=$t.isEqual.bind($t);$t.isEqualOrParent.bind($t);$t.getComparisonKey.bind($t);const pCe=$t.basenameOrAuthority.bind($t),la=$t.basename.bind($t);$t.extname.bind($t);const NP=$t.dirname.bind($t);$t.joinPath.bind($t);const mCe=$t.normalizePath.bind($t);$t.relativePath.bind($t);const q7=$t.resolvePath.bind($t);$t.isAbsolutePath.bind($t);const G7=$t.isEqualAuthority.bind($t),K7=$t.hasTrailingPathSeparator.bind($t);$t.removeTrailingPathSeparator.bind($t);$t.addTrailingPathSeparator.bind($t);var ix;(function(n){n.META_DATA_LABEL="label",n.META_DATA_DESCRIPTION="description",n.META_DATA_SIZE="size",n.META_DATA_MIME="mime";function e(t){const i=new Map;t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";")).split(";").forEach(r=>{const[a,l]=r.split(":");a&&l&&i.set(a,l)});const o=t.path.substring(0,t.path.indexOf(";"));return o&&i.set(n.META_DATA_MIME,o),i}n.parseMetaData=e})(ix||(ix={}));function _g(n){return n.toString()}class Ji{static create(e,t){const i=e.getAlternativeVersionId(),s=HT(e);return new Ji(i,i,s,s,t,t,[])}constructor(e,t,i,s,o,r,a){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=i,this.afterEOL=s,this.beforeCursorState=o,this.afterCursorState=r,this.changes=a}append(e,t,i,s,o){t.length>0&&(this.changes=uCe(this.changes,t)),this.afterEOL=i,this.afterVersionId=s,this.afterCursorState=o}static _writeSelectionsSize(e){return 4+4*4*(e?e.length:0)}static _writeSelections(e,t,i){if(jr(e,t?t.length:0,i),i+=4,t)for(const s of t)jr(e,s.selectionStartLineNumber,i),i+=4,jr(e,s.selectionStartColumn,i),i+=4,jr(e,s.positionLineNumber,i),i+=4,jr(e,s.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const s=Ur(e,t);t+=4;for(let o=0;ot.toString()).join(", ")}matchesResource(e){return(je.isUri(this.model)?this.model:this.model.uri).toString()===e.toString()}setModel(e){this.model=e}canAppend(e){return this.model===e&&this._data instanceof Ji}append(e,t,i,s,o){this._data instanceof Ji&&this._data.append(e,t,i,s,o)}close(){this._data instanceof Ji&&(this._data=this._data.serialize())}open(){this._data instanceof Ji||(this._data=Ji.deserialize(this._data))}undo(){if(je.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Ji&&(this._data=this._data.serialize());const e=Ji.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(je.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Ji&&(this._data=this._data.serialize());const e=Ji.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof Ji&&(this._data=this._data.serialize()),this._data.byteLength+168}}class _Ce{get resources(){return this._editStackElementsArr.map(e=>e.resource)}constructor(e,t,i){this.label=e,this.code=t,this.type=1,this._isOpen=!0,this._editStackElementsArr=i.slice(0),this._editStackElementsMap=new Map;for(const s of this._editStackElementsArr){const o=_g(s.resource);this._editStackElementsMap.set(o,s)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=_g(e);return this._editStackElementsMap.has(t)}setModel(e){const t=_g(je.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=_g(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,i,s,o){const r=_g(e.uri);this._editStackElementsMap.get(r).append(e,t,i,s,o)}close(){this._isOpen=!1}open(){}undo(){this._isOpen=!1;for(const e of this._editStackElementsArr)e.undo()}redo(){for(const e of this._editStackElementsArr)e.redo()}heapSize(e){const t=_g(e);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).heapSize():0}split(){return this._editStackElementsArr}toString(){const e=[];for(const t of this._editStackElementsArr)e.push(`${la(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function HT(n){return n.getEOL()===` -`?0:1}function Ml(n){return n?n instanceof Oq||n instanceof _Ce:!1}class RP{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Ml(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Ml(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const i=this._undoRedoService.getLastElement(this._model.uri);if(Ml(i)&&i.canAppend(this._model))return i;const s=new Oq(m("edit","Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(s,t),s}pushEOL(e){const t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],HT(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,s){const o=this._getOrCreateEditStackElement(e,s),r=this._model.applyEdits(t,!0),a=RP._computeCursorState(i,r),l=r.map((c,d)=>({index:d,textChange:c.textChange}));return l.sort((c,d)=>c.textChange.oldPosition===d.textChange.oldPosition?c.index-d.index:c.textChange.oldPosition-d.textChange.oldPosition),o.append(this._model,l.map(c=>c.textChange),HT(this._model),this._model.getAlternativeVersionId(),a),a}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return _t(i),null}}}class bCe{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function vCe(n,e,t,i,s){s.spacesDiff=0,s.looksLikeAlignment=!1;let o;for(o=0;o0&&a>0||l>0&&c>0)return;const d=Math.abs(a-c),u=Math.abs(r-l);if(d===0){s.spacesDiff=u,u>0&&0<=l-1&&l-10?s++:w>1&&o++,vCe(r,a,_,y,u),u.looksLikeAlignment&&!(t&&e===u.spacesDiff)))continue;const L=u.spacesDiff;L<=c&&d[L]++,r=_,a=y}let h=t;s!==o&&(h=s{const _=d[p];_>g&&(g=_,f=p)}),f===4&&d[4]>0&&d[2]>0&&d[2]>=d[4]/2&&(f=2)}return{insertSpaces:h,tabSize:f}}function vs(n){return(n.metadata&1)>>>0}function Vt(n,e){n.metadata=n.metadata&254|e<<0}function xn(n){return(n.metadata&2)>>>1===1}function Ft(n,e){n.metadata=n.metadata&253|(e?1:0)<<1}function Fq(n){return(n.metadata&4)>>>2===1}function Z7(n,e){n.metadata=n.metadata&251|(e?1:0)<<2}function Bq(n){return(n.metadata&64)>>>6===1}function X7(n,e){n.metadata=n.metadata&191|(e?1:0)<<6}function yCe(n){return(n.metadata&24)>>>3}function Q7(n,e){n.metadata=n.metadata&231|e<<3}function wCe(n){return(n.metadata&32)>>>5===1}function J7(n,e){n.metadata=n.metadata&223|(e?1:0)<<5}class Wq{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,Vt(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,Z7(this,!1),X7(this,!1),Q7(this,1),J7(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,Ft(this,!1)}reset(e,t,i,s){this.start=t,this.end=i,this.maxEnd=i,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=s}setOptions(e){this.options=e;const t=this.options.className;Z7(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),X7(this,this.options.glyphMarginClassName!==null),Q7(this,this.options.stickiness),J7(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(e,t,i){this.cachedVersionId!==i&&(this.range=null),this.cachedVersionId=i,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}detach(){this.parent=null,this.left=null,this.right=null}}const qe=new Wq(null,0,0);qe.parent=qe;qe.left=qe;qe.right=qe;Vt(qe,0);class B2{constructor(){this.root=qe,this.requestNormalizeDelta=!1}intervalSearch(e,t,i,s,o,r){return this.root===qe?[]:ACe(this,e,t,i,s,o,r)}search(e,t,i,s){return this.root===qe?[]:ECe(this,e,t,i,s)}collectNodesFromOwner(e){return DCe(this,e)}collectNodesPostOrder(){return kCe(this)}insert(e){e6(this,e),this._normalizeDeltaIfNecessary()}delete(e){t6(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){const i=e;let s=0;for(;e!==this.root;)e===e.parent.right&&(s+=e.parent.delta),e=e.parent;const o=i.start+s,r=i.end+s;i.setCachedOffsets(o,r,t)}acceptReplace(e,t,i,s){const o=xCe(this,e,e+t);for(let r=0,a=o.length;rt||i===1?!1:i===2?!0:e}function SCe(n,e,t,i,s){const o=yCe(n),r=o===0||o===2,a=o===1||o===2,l=t-e,c=i,d=Math.min(l,c),u=n.start;let h=!1;const f=n.end;let g=!1;e<=u&&f<=t&&wCe(n)&&(n.start=e,h=!0,n.end=e,g=!0);{const _=s?1:l>0?2:0;!h&&bg(u,r,e,_)&&(h=!0),!g&&bg(f,a,e,_)&&(g=!0)}if(d>0&&!s){const _=l>c?2:0;!h&&bg(u,r,e+d,_)&&(h=!0),!g&&bg(f,a,e+d,_)&&(g=!0)}{const _=s?1:0;!h&&bg(u,r,t,_)&&(n.start=e+c,h=!0),!g&&bg(f,a,t,_)&&(n.end=e+c,g=!0)}const p=c-l;h||(n.start=Math.max(0,u+p)),g||(n.end=Math.max(0,f+p)),n.start>n.end&&(n.end=n.start)}function xCe(n,e,t){let i=n.root,s=0,o=0,r=0,a=0;const l=[];let c=0;for(;i!==qe;){if(xn(i)){Ft(i.left,!1),Ft(i.right,!1),i===i.parent.right&&(s-=i.parent.delta),i=i.parent;continue}if(!xn(i.left)){if(o=s+i.maxEnd,ot){Ft(i,!0);continue}if(a=s+i.end,a>=e&&(i.setCachedOffsets(r,a,0),l[c++]=i),Ft(i,!0),i.right!==qe&&!xn(i.right)){s+=i.delta,i=i.right;continue}}return Ft(n.root,!1),l}function LCe(n,e,t,i){let s=n.root,o=0,r=0,a=0;const l=i-(t-e);for(;s!==qe;){if(xn(s)){Ft(s.left,!1),Ft(s.right,!1),s===s.parent.right&&(o-=s.parent.delta),ru(s),s=s.parent;continue}if(!xn(s.left)){if(r=o+s.maxEnd,rt){s.start+=l,s.end+=l,s.delta+=l,(s.delta<-1073741824||s.delta>1073741824)&&(n.requestNormalizeDelta=!0),Ft(s,!0);continue}if(Ft(s,!0),s.right!==qe&&!xn(s.right)){o+=s.delta,s=s.right;continue}}Ft(n.root,!1)}function DCe(n,e){let t=n.root;const i=[];let s=0;for(;t!==qe;){if(xn(t)){Ft(t.left,!1),Ft(t.right,!1),t=t.parent;continue}if(t.left!==qe&&!xn(t.left)){t=t.left;continue}if(t.ownerId===e&&(i[s++]=t),Ft(t,!0),t.right!==qe&&!xn(t.right)){t=t.right;continue}}return Ft(n.root,!1),i}function kCe(n){let e=n.root;const t=[];let i=0;for(;e!==qe;){if(xn(e)){Ft(e.left,!1),Ft(e.right,!1),e=e.parent;continue}if(e.left!==qe&&!xn(e.left)){e=e.left;continue}if(e.right!==qe&&!xn(e.right)){e=e.right;continue}t[i++]=e,Ft(e,!0)}return Ft(n.root,!1),t}function ECe(n,e,t,i,s){let o=n.root,r=0,a=0,l=0;const c=[];let d=0;for(;o!==qe;){if(xn(o)){Ft(o.left,!1),Ft(o.right,!1),o===o.parent.right&&(r-=o.parent.delta),o=o.parent;continue}if(o.left!==qe&&!xn(o.left)){o=o.left;continue}a=r+o.start,l=r+o.end,o.setCachedOffsets(a,l,i);let u=!0;if(e&&o.ownerId&&o.ownerId!==e&&(u=!1),t&&Fq(o)&&(u=!1),s&&!Bq(o)&&(u=!1),u&&(c[d++]=o),Ft(o,!0),o.right!==qe&&!xn(o.right)){r+=o.delta,o=o.right;continue}}return Ft(n.root,!1),c}function ACe(n,e,t,i,s,o,r){let a=n.root,l=0,c=0,d=0,u=0;const h=[];let f=0;for(;a!==qe;){if(xn(a)){Ft(a.left,!1),Ft(a.right,!1),a===a.parent.right&&(l-=a.parent.delta),a=a.parent;continue}if(!xn(a.left)){if(c=l+a.maxEnd,ct){Ft(a,!0);continue}if(u=l+a.end,u>=e){a.setCachedOffsets(d,u,o);let g=!0;i&&a.ownerId&&a.ownerId!==i&&(g=!1),s&&Fq(a)&&(g=!1),r&&!Bq(a)&&(g=!1),g&&(h[f++]=a)}if(Ft(a,!0),a.right!==qe&&!xn(a.right)){l+=a.delta,a=a.right;continue}}return Ft(n.root,!1),h}function e6(n,e){if(n.root===qe)return e.parent=qe,e.left=qe,e.right=qe,Vt(e,0),n.root=e,n.root;ICe(n,e),Uc(e.parent);let t=e;for(;t!==n.root&&vs(t.parent)===1;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;vs(i)===1?(Vt(t.parent,0),Vt(i,0),Vt(t.parent.parent,1),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,V_(n,t)),Vt(t.parent,0),Vt(t.parent.parent,1),z_(n,t.parent.parent))}else{const i=t.parent.parent.left;vs(i)===1?(Vt(t.parent,0),Vt(i,0),Vt(t.parent.parent,1),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,z_(n,t)),Vt(t.parent,0),Vt(t.parent.parent,1),V_(n,t.parent.parent))}return Vt(n.root,0),e}function ICe(n,e){let t=0,i=n.root;const s=e.start,o=e.end;for(;;)if(NCe(s,o,i.start+t,i.end+t)<0)if(i.left===qe){e.start-=t,e.end-=t,e.maxEnd-=t,i.left=e;break}else i=i.left;else if(i.right===qe){e.start-=t+i.delta,e.end-=t+i.delta,e.maxEnd-=t+i.delta,i.right=e;break}else t+=i.delta,i=i.right;e.parent=i,e.left=qe,e.right=qe,Vt(e,1)}function t6(n,e){let t,i;if(e.left===qe?(t=e.right,i=e,t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(n.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta):e.right===qe?(t=e.left,i=e):(i=TCe(e.right),t=i.right,t.start+=i.delta,t.end+=i.delta,t.delta+=i.delta,(t.delta<-1073741824||t.delta>1073741824)&&(n.requestNormalizeDelta=!0),i.start+=e.delta,i.end+=e.delta,i.delta=e.delta,(i.delta<-1073741824||i.delta>1073741824)&&(n.requestNormalizeDelta=!0)),i===n.root){n.root=t,Vt(t,0),e.detach(),W2(),ru(t),n.root.parent=qe;return}const s=vs(i)===1;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?t.parent=i.parent:(i.parent===e?t.parent=i:t.parent=i.parent,i.left=e.left,i.right=e.right,i.parent=e.parent,Vt(i,vs(e)),e===n.root?n.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==qe&&(i.left.parent=i),i.right!==qe&&(i.right.parent=i)),e.detach(),s){Uc(t.parent),i!==e&&(Uc(i),Uc(i.parent)),W2();return}Uc(t),Uc(t.parent),i!==e&&(Uc(i),Uc(i.parent));let o;for(;t!==n.root&&vs(t)===0;)t===t.parent.left?(o=t.parent.right,vs(o)===1&&(Vt(o,0),Vt(t.parent,1),V_(n,t.parent),o=t.parent.right),vs(o.left)===0&&vs(o.right)===0?(Vt(o,1),t=t.parent):(vs(o.right)===0&&(Vt(o.left,0),Vt(o,1),z_(n,o),o=t.parent.right),Vt(o,vs(t.parent)),Vt(t.parent,0),Vt(o.right,0),V_(n,t.parent),t=n.root)):(o=t.parent.left,vs(o)===1&&(Vt(o,0),Vt(t.parent,1),z_(n,t.parent),o=t.parent.left),vs(o.left)===0&&vs(o.right)===0?(Vt(o,1),t=t.parent):(vs(o.left)===0&&(Vt(o.right,0),Vt(o,1),V_(n,o),o=t.parent.left),Vt(o,vs(t.parent)),Vt(t.parent,0),Vt(o.left,0),z_(n,t.parent),t=n.root));Vt(t,0),W2()}function TCe(n){for(;n.left!==qe;)n=n.left;return n}function W2(){qe.parent=qe,qe.delta=0,qe.start=0,qe.end=0}function V_(n,e){const t=e.right;t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(n.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta,e.right=t.left,t.left!==qe&&(t.left.parent=e),t.parent=e.parent,e.parent===qe?n.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,ru(e),ru(t)}function z_(n,e){const t=e.left;e.delta-=t.delta,(e.delta<-1073741824||e.delta>1073741824)&&(n.requestNormalizeDelta=!0),e.start-=t.delta,e.end-=t.delta,e.left=t.right,t.right!==qe&&(t.right.parent=e),t.parent=e.parent,e.parent===qe?n.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,ru(e),ru(t)}function Vq(n){let e=n.end;if(n.left!==qe){const t=n.left.maxEnd;t>e&&(e=t)}if(n.right!==qe){const t=n.right.maxEnd+n.delta;t>e&&(e=t)}return e}function ru(n){n.maxEnd=Vq(n)}function Uc(n){for(;n!==qe;){const e=Vq(n);if(n.maxEnd===e)return;n.maxEnd=e,n=n.parent}}function NCe(n,e,t,i){return n===t?e-i:n-t}class $T{constructor(e,t){this.piece=e,this.color=t,this.size_left=0,this.lf_left=0,this.parent=this,this.left=this,this.right=this}next(){if(this.right!==Pe)return MP(this.right);let e=this;for(;e.parent!==Pe&&e.parent.left!==e;)e=e.parent;return e.parent===Pe?Pe:e.parent}prev(){if(this.left!==Pe)return zq(this.left);let e=this;for(;e.parent!==Pe&&e.parent.right!==e;)e=e.parent;return e.parent===Pe?Pe:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const Pe=new $T(null,0);Pe.parent=Pe;Pe.left=Pe;Pe.right=Pe;Pe.color=0;function MP(n){for(;n.left!==Pe;)n=n.left;return n}function zq(n){for(;n.right!==Pe;)n=n.right;return n}function PP(n){return n===Pe?0:n.size_left+n.piece.length+PP(n.right)}function OP(n){return n===Pe?0:n.lf_left+n.piece.lineFeedCnt+OP(n.right)}function V2(){Pe.parent=Pe}function H_(n,e){const t=e.right;t.size_left+=e.size_left+(e.piece?e.piece.length:0),t.lf_left+=e.lf_left+(e.piece?e.piece.lineFeedCnt:0),e.right=t.left,t.left!==Pe&&(t.left.parent=e),t.parent=e.parent,e.parent===Pe?n.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}function $_(n,e){const t=e.left;e.left=t.right,t.right!==Pe&&(t.right.parent=e),t.parent=e.parent,e.size_left-=t.size_left+(t.piece?t.piece.length:0),e.lf_left-=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),e.parent===Pe?n.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}function cw(n,e){let t,i;if(e.left===Pe?(i=e,t=i.right):e.right===Pe?(i=e,t=i.left):(i=MP(e.right),t=i.right),i===n.root){n.root=t,t.color=0,e.detach(),V2(),n.root.parent=Pe;return}const s=i.color===1;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?(t.parent=i.parent,g_(n,t)):(i.parent===e?t.parent=i:t.parent=i.parent,g_(n,t),i.left=e.left,i.right=e.right,i.parent=e.parent,i.color=e.color,e===n.root?n.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==Pe&&(i.left.parent=i),i.right!==Pe&&(i.right.parent=i),i.size_left=e.size_left,i.lf_left=e.lf_left,g_(n,i)),e.detach(),t.parent.left===t){const r=PP(t),a=OP(t);if(r!==t.parent.size_left||a!==t.parent.lf_left){const l=r-t.parent.size_left,c=a-t.parent.lf_left;t.parent.size_left=r,t.parent.lf_left=a,kl(n,t.parent,l,c)}}if(g_(n,t.parent),s){V2();return}let o;for(;t!==n.root&&t.color===0;)t===t.parent.left?(o=t.parent.right,o.color===1&&(o.color=0,t.parent.color=1,H_(n,t.parent),o=t.parent.right),o.left.color===0&&o.right.color===0?(o.color=1,t=t.parent):(o.right.color===0&&(o.left.color=0,o.color=1,$_(n,o),o=t.parent.right),o.color=t.parent.color,t.parent.color=0,o.right.color=0,H_(n,t.parent),t=n.root)):(o=t.parent.left,o.color===1&&(o.color=0,t.parent.color=1,$_(n,t.parent),o=t.parent.left),o.left.color===0&&o.right.color===0?(o.color=1,t=t.parent):(o.left.color===0&&(o.right.color=0,o.color=1,H_(n,o),o=t.parent.left),o.color=t.parent.color,t.parent.color=0,o.left.color=0,$_(n,t.parent),t=n.root));t.color=0,V2()}function i6(n,e){for(g_(n,e);e!==n.root&&e.parent.color===1;)if(e.parent===e.parent.parent.left){const t=e.parent.parent.right;t.color===1?(e.parent.color=0,t.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.right&&(e=e.parent,H_(n,e)),e.parent.color=0,e.parent.parent.color=1,$_(n,e.parent.parent))}else{const t=e.parent.parent.left;t.color===1?(e.parent.color=0,t.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.left&&(e=e.parent,$_(n,e)),e.parent.color=0,e.parent.parent.color=1,H_(n,e.parent.parent))}n.root.color=0}function kl(n,e,t,i){for(;e!==n.root&&e!==Pe;)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}function g_(n,e){let t=0,i=0;if(e!==n.root){for(;e!==n.root&&e===e.parent.right;)e=e.parent;if(e!==n.root)for(e=e.parent,t=PP(e.left)-e.size_left,i=OP(e.left)-e.lf_left,e.size_left+=t,e.lf_left+=i;e!==n.root&&(t!==0||i!==0);)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}}const vl=65535;function Hq(n){let e;return n[n.length-1]<65536?e=new Uint16Array(n.length):e=new Uint32Array(n.length),e.set(n,0),e}class RCe{constructor(e,t,i,s,o){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=s,this.isBasicASCII=o}}function El(n,e=!0){const t=[0];let i=1;for(let s=0,o=n.length;s126)&&(r=!1)}const a=new RCe(Hq(n),i,s,o,r);return n.length=0,a}class zs{constructor(e,t,i,s,o){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=s,this.length=o}}class gh{constructor(e,t){this.buffer=e,this.lineStarts=t}}class PCe{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==Pe&&e.iterate(e.root,i=>(i!==Pe&&this._pieces.push(i.piece),!0))}read(){return this._pieces.length===0?this._index===0?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:this._index===0?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}}class OCe{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartOffset<=e&&i.nodeStartOffset+i.node.piece.length>=e)return i}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartLineNumber&&i.nodeStartLineNumber=e)return i}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1;const i=this._cache;for(let s=0;s=e){i[s]=null,t=!0;continue}}if(t){const s=[];for(const o of i)o!==null&&s.push(o);this._cache=s}}}class FCe{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new gh("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=Pe,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let s=null;for(let o=0,r=e.length;o0){e[o].lineStarts||(e[o].lineStarts=El(e[o].buffer));const a=new zs(o+1,{line:0,column:0},{line:e[o].lineStarts.length-1,column:e[o].buffer.length-e[o].lineStarts[e[o].lineStarts.length-1]},e[o].lineStarts.length-1,e[o].buffer.length);this._buffers.push(e[o]),s=this.rbInsertRight(s,a)}this._searchCache=new OCe(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=vl,i=t-Math.floor(t/3),s=i*2;let o="",r=0;const a=[];if(this.iterate(this.root,l=>{const c=this.getNodeContent(l),d=c.length;if(r<=i||r+d0){const l=o.replace(/\r\n|\r|\n/g,e);a.push(new gh(l,El(l)))}this.create(a,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new PCe(this,e)}getOffsetAt(e,t){let i=0,s=this.root;for(;s!==Pe;)if(s.left!==Pe&&s.lf_left+1>=e)s=s.left;else if(s.lf_left+s.piece.lineFeedCnt+1>=e){i+=s.size_left;const o=this.getAccumulatedValue(s,e-s.lf_left-2);return i+=o+t-1}else e-=s.lf_left+s.piece.lineFeedCnt,i+=s.size_left+s.piece.length,s=s.right;return i}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,i=0;const s=e;for(;t!==Pe;)if(t.size_left!==0&&t.size_left>=e)t=t.left;else if(t.size_left+t.piece.length>=e){const o=this.getIndexOf(t,e-t.size_left);if(i+=t.lf_left+o.index,o.index===0){const r=this.getOffsetAt(i+1,1),a=s-r;return new V(i+1,a+1)}return new V(i+1,o.remainder+1)}else if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===Pe){const o=this.getOffsetAt(i+1,1),r=s-e-o;return new V(i+1,r+1)}else t=t.right;return new V(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";const i=this.nodeAt2(e.startLineNumber,e.startColumn),s=this.nodeAt2(e.endLineNumber,e.endColumn),o=this.getValueInRange2(i,s);return t?t!==this._EOL||!this._EOLNormalized?o.replace(/\r\n|\r|\n/g,t):t===this.getEOL()&&this._EOLNormalized?o:o.replace(/\r\n|\r|\n/g,t):o}getValueInRange2(e,t){if(e.node===t.node){const a=e.node,l=this._buffers[a.piece.bufferIndex].buffer,c=this.offsetInBuffer(a.piece.bufferIndex,a.piece.start);return l.substring(c+e.remainder,c+t.remainder)}let i=e.node;const s=this._buffers[i.piece.bufferIndex].buffer,o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);let r=s.substring(o+e.remainder,o+i.piece.length);for(i=i.next();i!==Pe;){const a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(i===t.node){r+=a.substring(l,l+t.remainder);break}else r+=a.substr(l,i.piece.length);i=i.next()}return r}getLinesContent(){const e=[];let t=0,i="",s=!1;return this.iterate(this.root,o=>{if(o===Pe)return!0;const r=o.piece;let a=r.length;if(a===0)return!0;const l=this._buffers[r.bufferIndex].buffer,c=this._buffers[r.bufferIndex].lineStarts,d=r.start.line,u=r.end.line;let h=c[d]+r.start.column;if(s&&(l.charCodeAt(h)===10&&(h++,a--),e[t++]=i,i="",s=!1,a===0))return!0;if(d===u)return!this._EOLNormalized&&l.charCodeAt(h+a-1)===13?(s=!0,i+=l.substr(h,a-1)):i+=l.substr(h,a),!0;i+=this._EOLNormalized?l.substring(h,Math.max(h,c[d+1]-this._EOLLength)):l.substring(h,c[d+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;for(let f=d+1;fw+g,t.reset(0)):(b=h.buffer,y=w=>w,t.reset(g));do if(_=t.next(b),_){if(y(_.index)>=p)return d;this.positionInBuffer(e,y(_.index)-f,v);const w=this.getLineFeedCnt(e.piece.bufferIndex,o,v),C=v.line===o.line?v.column-o.column+s:v.column+1,L=C+_[0].length;if(u[d++]=ah(new N(i+w,C,i+w,L),_,l),y(_.index)+_[0].length>=p||d>=c)return d}while(_);return d}findMatchesLineByLine(e,t,i,s){const o=[];let r=0;const a=new Vg(t.wordSeparators,t.regex);let l=this.nodeAt2(e.startLineNumber,e.startColumn);if(l===null)return[];const c=this.nodeAt2(e.endLineNumber,e.endColumn);if(c===null)return[];let d=this.positionInBuffer(l.node,l.remainder);const u=this.positionInBuffer(c.node,c.remainder);if(l.node===c.node)return this.findMatchesInNode(l.node,a,e.startLineNumber,e.startColumn,d,u,t,i,s,r,o),o;let h=e.startLineNumber,f=l.node;for(;f!==c.node;){const p=this.getLineFeedCnt(f.piece.bufferIndex,d,f.piece.end);if(p>=1){const v=this._buffers[f.piece.bufferIndex].lineStarts,b=this.offsetInBuffer(f.piece.bufferIndex,f.piece.start),y=v[d.line+p],w=h===e.startLineNumber?e.startColumn:1;if(r=this.findMatchesInNode(f,a,h,w,d,this.positionInBuffer(f,y-b),t,i,s,r,o),r>=s)return o;h+=p}const _=h===e.startLineNumber?e.startColumn-1:0;if(h===e.endLineNumber){const v=this.getLineContent(h).substring(_,e.endColumn-1);return r=this._findMatchesInLine(t,a,v,e.endLineNumber,_,r,o,i,s),o}if(r=this._findMatchesInLine(t,a,this.getLineContent(h).substr(_),h,_,r,o,i,s),r>=s)return o;h++,l=this.nodeAt2(h,1),f=l.node,d=this.positionInBuffer(l.node,l.remainder)}if(h===e.endLineNumber){const p=h===e.startLineNumber?e.startColumn-1:0,_=this.getLineContent(h).substring(p,e.endColumn-1);return r=this._findMatchesInLine(t,a,_,e.endLineNumber,p,r,o,i,s),o}const g=h===e.startLineNumber?e.startColumn:1;return r=this.findMatchesInNode(c.node,a,h,g,d,u,t,i,s,r,o),o}_findMatchesInLine(e,t,i,s,o,r,a,l,c){const d=e.wordSeparators;if(!l&&e.simpleSearch){const h=e.simpleSearch,f=h.length,g=i.length;let p=-f;for(;(p=i.indexOf(h,p+f))!==-1;)if((!d||nP(d,i,g,p,f))&&(a[r++]=new qb(new N(s,p+1+o,s,p+1+f+o),null),r>=c))return r;return r}let u;t.reset(0);do if(u=t.next(i),u&&(a[r++]=ah(new N(s,u.index+1+o,s,u.index+1+u[0].length+o),u,l),r>=c))return r;while(u);return r}insert(e,t,i=!1){if(this._EOLNormalized=this._EOLNormalized&&i,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==Pe){const{node:s,remainder:o,nodeStartOffset:r}=this.nodeAt(e),a=s.piece,l=a.bufferIndex,c=this.positionInBuffer(s,o);if(s.piece.bufferIndex===0&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&r+a.length===e&&t.lengthe){const d=[];let u=new zs(a.bufferIndex,c,a.end,this.getLineFeedCnt(a.bufferIndex,c,a.end),this.offsetInBuffer(l,a.end)-this.offsetInBuffer(l,c));if(this.shouldCheckCRLF()&&this.endWithCR(t)&&this.nodeCharCodeAt(s,o)===10){const p={line:u.start.line+1,column:0};u=new zs(u.bufferIndex,p,u.end,this.getLineFeedCnt(u.bufferIndex,p,u.end),u.length-1),t+=` -`}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(this.nodeCharCodeAt(s,o-1)===13){const p=this.positionInBuffer(s,o-1);this.deleteNodeTail(s,p),t="\r"+t,s.piece.length===0&&d.push(s)}else this.deleteNodeTail(s,c);else this.deleteNodeTail(s,c);const h=this.createNewPieces(t);u.length>0&&this.rbInsertRight(s,u);let f=s;for(let g=0;g=0;r--)o=this.rbInsertLeft(o,s[r]);this.validateCRLFWithPrevNode(o),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=` -`);const i=this.createNewPieces(e),s=this.rbInsertRight(t,i[0]);let o=s;for(let r=1;r=h)c=u+1;else break;return i?(i.line=u,i.column=l-f,null):{line:u,column:l-f}}getLineFeedCnt(e,t,i){if(i.column===0)return i.line-t.line;const s=this._buffers[e].lineStarts;if(i.line===s.length-1)return i.line-t.line;const o=s[i.line+1],r=s[i.line]+i.column;if(o>r+1)return i.line-t.line;const a=r-1;return this._buffers[e].buffer.charCodeAt(a)===13?i.line-t.line+1:i.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;tvl){const d=[];for(;e.length>vl;){const h=e.charCodeAt(vl-1);let f;h===13||h>=55296&&h<=56319?(f=e.substring(0,vl-1),e=e.substring(vl-1)):(f=e.substring(0,vl),e=e.substring(vl));const g=El(f);d.push(new zs(this._buffers.length,{line:0,column:0},{line:g.length-1,column:f.length-g[g.length-1]},g.length-1,f.length)),this._buffers.push(new gh(f,g))}const u=El(e);return d.push(new zs(this._buffers.length,{line:0,column:0},{line:u.length-1,column:e.length-u[u.length-1]},u.length-1,e.length)),this._buffers.push(new gh(e,u)),d}let t=this._buffers[0].buffer.length;const i=El(e,!1);let s=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&t!==0&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},s=this._lastChangeBufferPos;for(let d=0;d=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const l=this.getAccumulatedValue(i,e-i.lf_left-2),c=this.getAccumulatedValue(i,e-i.lf_left-1),d=this._buffers[i.piece.bufferIndex].buffer,u=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return r+=i.size_left,this._searchCache.set({node:i,nodeStartOffset:r,nodeStartLineNumber:a-(e-1-i.lf_left)}),d.substring(u+l,u+c-t)}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const l=this.getAccumulatedValue(i,e-i.lf_left-2),c=this._buffers[i.piece.bufferIndex].buffer,d=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);s=c.substring(d+l,d+i.piece.length);break}else e-=i.lf_left+i.piece.lineFeedCnt,r+=i.size_left+i.piece.length,i=i.right}for(i=i.next();i!==Pe;){const r=this._buffers[i.piece.bufferIndex].buffer;if(i.piece.lineFeedCnt>0){const a=this.getAccumulatedValue(i,0),l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return s+=r.substring(l,l+a-t),s}else{const a=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);s+=r.substr(a,i.piece.length)}i=i.next()}return s}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==Pe;)t+=e.lf_left+e.piece.lineFeedCnt,i+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=i,this._searchCache.validate(this._length)}getIndexOf(e,t){const i=e.piece,s=this.positionInBuffer(e,t),o=s.line-i.start.line;if(this.offsetInBuffer(i.bufferIndex,i.end)-this.offsetInBuffer(i.bufferIndex,i.start)===t){const r=this.getLineFeedCnt(e.piece.bufferIndex,i.start,s);if(r!==o)return{index:r,remainder:0}}return{index:o,remainder:s.column}}getAccumulatedValue(e,t){if(t<0)return 0;const i=e.piece,s=this._buffers[i.bufferIndex].lineStarts,o=i.start.line+t+1;return o>i.end.line?s[i.end.line]+i.end.column-s[i.start.line]-i.start.column:s[o]-s[i.start.line]-i.start.column}deleteNodeTail(e,t){const i=e.piece,s=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.end),r=t,a=this.offsetInBuffer(i.bufferIndex,r),l=this.getLineFeedCnt(i.bufferIndex,i.start,r),c=l-s,d=a-o,u=i.length+d;e.piece=new zs(i.bufferIndex,i.start,r,l,u),kl(this,e,d,c)}deleteNodeHead(e,t){const i=e.piece,s=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.start),r=t,a=this.getLineFeedCnt(i.bufferIndex,r,i.end),l=this.offsetInBuffer(i.bufferIndex,r),c=a-s,d=o-l,u=i.length+d;e.piece=new zs(i.bufferIndex,r,i.end,a,u),kl(this,e,d,c)}shrinkNode(e,t,i){const s=e.piece,o=s.start,r=s.end,a=s.length,l=s.lineFeedCnt,c=t,d=this.getLineFeedCnt(s.bufferIndex,s.start,c),u=this.offsetInBuffer(s.bufferIndex,t)-this.offsetInBuffer(s.bufferIndex,o);e.piece=new zs(s.bufferIndex,s.start,c,d,u),kl(this,e,u-a,d-l);const h=new zs(s.bufferIndex,i,r,this.getLineFeedCnt(s.bufferIndex,i,r),this.offsetInBuffer(s.bufferIndex,r)-this.offsetInBuffer(s.bufferIndex,i)),f=this.rbInsertRight(e,h);this.validateCRLFWithPrevNode(f)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+=` -`);const i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),s=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const o=El(t,!1);for(let f=0;fe)t=t.left;else if(t.size_left+t.piece.length>=e){s+=t.size_left;const o={node:t,remainder:e-t.size_left,nodeStartOffset:s};return this._searchCache.set(o),o}else e-=t.size_left+t.piece.length,s+=t.size_left+t.piece.length,t=t.right;return null}nodeAt2(e,t){let i=this.root,s=0;for(;i!==Pe;)if(i.left!==Pe&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const o=this.getAccumulatedValue(i,e-i.lf_left-2),r=this.getAccumulatedValue(i,e-i.lf_left-1);return s+=i.size_left,{node:i,remainder:Math.min(o+t-1,r),nodeStartOffset:s}}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const o=this.getAccumulatedValue(i,e-i.lf_left-2);if(o+t-1<=i.piece.length)return{node:i,remainder:o+t-1,nodeStartOffset:s};t-=i.piece.length-o;break}else e-=i.lf_left+i.piece.lineFeedCnt,s+=i.size_left+i.piece.length,i=i.right;for(i=i.next();i!==Pe;){if(i.piece.lineFeedCnt>0){const o=this.getAccumulatedValue(i,0),r=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,o),nodeStartOffset:r}}else if(i.piece.length>=t-1){const o=this.offsetOfNode(i);return{node:i,remainder:t-1,nodeStartOffset:o}}else t-=i.piece.length;i=i.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;const i=this._buffers[e.piece.bufferIndex],s=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return i.buffer.charCodeAt(s)}offsetOfNode(e){if(!e)return 0;let t=e.size_left;for(;e!==this.root;)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t}shouldCheckCRLF(){return!(this._EOLNormalized&&this._EOL===` -`)}startWithLF(e){if(typeof e=="string")return e.charCodeAt(0)===10;if(e===Pe||e.piece.lineFeedCnt===0)return!1;const t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,s=t.start.line,o=i[s]+t.start.column;return s===i.length-1||i[s+1]>o+1?!1:this._buffers[t.bufferIndex].buffer.charCodeAt(o)===10}endWithCR(e){return typeof e=="string"?e.charCodeAt(e.length-1)===13:e===Pe||e.piece.lineFeedCnt===0?!1:this.nodeCharCodeAt(e,e.piece.length-1)===13}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){const t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){const i=[],s=this._buffers[e.piece.bufferIndex].lineStarts;let o;e.piece.end.column===0?o={line:e.piece.end.line-1,column:s[e.piece.end.line]-s[e.piece.end.line-1]-1}:o={line:e.piece.end.line,column:e.piece.end.column-1};const r=e.piece.length-1,a=e.piece.lineFeedCnt-1;e.piece=new zs(e.piece.bufferIndex,e.piece.start,o,a,r),kl(this,e,-1,-1),e.piece.length===0&&i.push(e);const l={line:t.piece.start.line+1,column:0},c=t.piece.length-1,d=this.getLineFeedCnt(t.piece.bufferIndex,l,t.piece.end);t.piece=new zs(t.piece.bufferIndex,l,t.piece.end,d,c),kl(this,t,-1,-1),t.piece.length===0&&i.push(t);const u=this.createNewPieces(`\r -`);this.rbInsertRight(e,u[0]);for(let h=0;h=4){const l=owe(e.autoIndent,t,s,{unshiftIndent:c=>gi.unshiftIndent(e,c),shiftIndent:c=>gi.shiftIndent(e,c),normalizeIndentation:c=>e.normalizeIndentation(c)},e.languageConfigurationService);if(l){let c=e.visibleColumnFromColumn(t,s.getEndPosition());const d=s.endColumn,u=t.getLineContent(s.endLineNumber),h=Ys(u);if(h>=0?s=s.setEndPosition(s.endLineNumber,Math.max(s.endColumn,h+1)):s=s.setEndPosition(s.endLineNumber,t.getLineMaxColumn(s.endLineNumber)),i)return new Qy(s,` +`+e.normalizeIndentation(l.afterEnter),!0);{let f=0;return d<=h+1&&(e.insertSpaces||(c=Math.ceil(c/e.indentSize)),f=Math.min(c+1-e.normalizeIndentation(l.afterEnter).length-1,0)),new mC(s,` +`+e.normalizeIndentation(l.afterEnter),0,f,!0)}}}return gi._typeCommand(s,` +`+e.normalizeIndentation(a),i)}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let s=0,o=i.length;sgi.shiftIndent(e,a),unshiftIndent:a=>gi.unshiftIndent(e,a)},e.languageConfigurationService);if(r===null)return null;if(r!==e.normalizeIndentation(o)){const a=t.getLineFirstNonWhitespaceColumn(i.startLineNumber);return a===0?gi._typeCommand(new N(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(r)+s,!1):gi._typeCommand(new N(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(r)+t.getLineContent(i.startLineNumber).substring(a-1,i.startColumn-1)+s,!1)}return null}static _isAutoClosingOvertype(e,t,i,s,o){if(e.autoClosingOvertype==="never"||!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(o))return!1;for(let r=0,a=i.length;r2?d.charCodeAt(c.column-2):0)===92&&h)return!1;if(e.autoClosingOvertype==="auto"){let g=!1;for(let p=0,_=s.length;p<_;p++){const v=s[p];if(c.lineNumber===v.startLineNumber&&c.column===v.startColumn){g=!0;break}}if(!g)return!1}}return!0}static _runAutoClosingOvertype(e,t,i,s,o){const r=[];for(let a=0,l=s.length;at.startsWith(l.open)),a=o.some(l=>t.startsWith(l.close));return!r&&a}static _findAutoClosingPairOpen(e,t,i,s){const o=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(s);if(!o)return null;let r=null;for(const a of o)if(r===null||a.open.length>r.open.length){let l=!0;for(const c of i)if(t.getValueInRange(new N(c.lineNumber,c.column-a.open.length+1,c.lineNumber,c.column))+s!==a.open){l=!1;break}l&&(r=a)}return r}static _findContainedAutoClosingPair(e,t){if(t.open.length<=1)return null;const i=t.close.charAt(t.close.length-1),s=e.autoClosingPairs.autoClosingPairsCloseByEnd.get(i)||[];let o=null;for(const r of s)r.open!==t.open&&t.open.includes(r.open)&&t.close.endsWith(r.close)&&(!o||r.open.length>o.open.length)&&(o=r);return o}static _getAutoClosingPairClose(e,t,i,s,o){for(const g of i)if(!g.isEmpty())return null;const r=i.map(g=>{const p=g.getPosition();return o?{lineNumber:p.lineNumber,beforeColumn:p.column-s.length,afterColumn:p.column}:{lineNumber:p.lineNumber,beforeColumn:p.column,afterColumn:p.column}}),a=this._findAutoClosingPairOpen(e,t,r.map(g=>new V(g.lineNumber,g.beforeColumn)),s);if(!a)return null;let l,c;if($c(s)?(l=e.autoClosingQuotes,c=e.shouldAutoCloseBefore.quote):(e.blockCommentStartToken?a.open.includes(e.blockCommentStartToken):!1)?(l=e.autoClosingComments,c=e.shouldAutoCloseBefore.comment):(l=e.autoClosingBrackets,c=e.shouldAutoCloseBefore.bracket),l==="never")return null;const u=this._findContainedAutoClosingPair(e,a),h=u?u.close:"";let f=!0;for(const g of r){const{lineNumber:p,beforeColumn:_,afterColumn:v}=g,b=t.getLineContent(p),y=b.substring(0,_-1),w=b.substring(v-1);if(w.startsWith(h)||(f=!1),w.length>0){const D=w.charAt(0);if(!gi._isBeforeClosingBrace(e,w)&&!c(D))return null}if(a.open.length===1&&(s==="'"||s==='"')&&l!=="always"){const D=xm(e.wordSeparators);if(y.length>0){const k=y.charCodeAt(y.length-1);if(D.get(k)===0)return null}}if(!t.tokenization.isCheapToTokenize(p))return null;t.tokenization.forceTokenization(p);const S=t.tokenization.getLineTokens(p),L=JL(S,_-1);if(!a.shouldAutoClose(L,_-L.firstCharOffset))return null;const x=a.findNeutralCharacter();if(x){const D=t.tokenization.getTokenTypeIfInsertingCharacter(p,_,x);if(!a.isOK(D))return null}}return f?a.close.substring(0,a.close.length-h.length):a.close}static _runAutoClosingOpenCharType(e,t,i,s,o,r,a){const l=[];for(let c=0,d=s.length;cnew vs(new N(h.positionLineNumber,h.positionColumn,h.positionLineNumber,h.positionColumn+1),"",!1));return new _s(4,u,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const d=this._getAutoClosingPairClose(t,i,o,l,!0);return d!==null?this._runAutoClosingOpenCharType(e,t,i,o,l,!0,d):null}static typeWithInterceptors(e,t,i,s,o,r,a){if(!e&&a===` +`){const d=[];for(let u=0,h=o.length;u{const s=t.get(jt).getFocusedCodeEditor();return s&&s.hasTextFocus()?this._runEditorCommand(t,s,i):!1}),e.addImplementation(1e3,"generic-dom-input-textarea",(t,i)=>{const s=ea();return s&&["input","textarea"].indexOf(s.tagName.toLowerCase())>=0?(this.runDOMCommand(s),!0):!1}),e.addImplementation(0,"generic-dom",(t,i)=>{const s=t.get(jt).getActiveCodeEditor();return s?(s.focus(),this._runEditorCommand(t,s,i)):!1})}_runEditorCommand(e,t,i){const s=this.runEditorCommand(e,t,i);return s||!0}}var Xi;(function(n){class e extends oi{constructor(b){super(b),this._inSelectionMode=b.inSelectionMode}runCoreEditorCommand(b,y){if(!y.position)return;b.model.pushStackElement(),b.setCursorStates(y.source,3,[mn.moveTo(b,b.getPrimaryCursorState(),this._inSelectionMode,y.position,y.viewPosition)])&&y.revealType!==2&&b.revealPrimaryCursor(y.source,!0,!0)}}n.MoveTo=Ee(new e({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),n.MoveToSelect=Ee(new e({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class t extends oi{runCoreEditorCommand(b,y){b.model.pushStackElement();const w=this._getColumnSelectResult(b,b.getPrimaryCursorState(),b.getCursorColumnSelectData(),y);w!==null&&(b.setCursorStates(y.source,3,w.viewStates.map(S=>st.fromViewState(S))),b.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:w.fromLineNumber,fromViewVisualColumn:w.fromVisualColumn,toViewLineNumber:w.toLineNumber,toViewVisualColumn:w.toVisualColumn}),w.reversed?b.revealTopMostCursor(y.source):b.revealBottomMostCursor(y.source))}}n.ColumnSelect=Ee(new class extends t{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(v,b,y,w){if(typeof w.position>"u"||typeof w.viewPosition>"u"||typeof w.mouseColumn>"u")return null;const S=v.model.validatePosition(w.position),L=v.coordinatesConverter.validateViewPosition(new V(w.viewPosition.lineNumber,w.viewPosition.column),S),x=w.doColumnSelect?y.fromViewLineNumber:L.lineNumber,D=w.doColumnSelect?y.fromViewVisualColumn:w.mouseColumn-1;return fh.columnSelect(v.cursorConfig,v,x,D,L.lineNumber,w.mouseColumn-1)}}),n.CursorColumnSelectLeft=Ee(new class extends t{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:gt,kbExpr:$.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(v,b,y,w){return fh.columnSelectLeft(v.cursorConfig,v,y)}}),n.CursorColumnSelectRight=Ee(new class extends t{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:gt,kbExpr:$.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(v,b,y,w){return fh.columnSelectRight(v.cursorConfig,v,y)}});class i extends t{constructor(b){super(b),this._isPaged=b.isPaged}_getColumnSelectResult(b,y,w,S){return fh.columnSelectUp(b.cursorConfig,b,w,this._isPaged)}}n.CursorColumnSelectUp=Ee(new i({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:gt,kbExpr:$.textInputFocus,primary:3600,linux:{primary:0}}})),n.CursorColumnSelectPageUp=Ee(new i({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:gt,kbExpr:$.textInputFocus,primary:3595,linux:{primary:0}}}));class s extends t{constructor(b){super(b),this._isPaged=b.isPaged}_getColumnSelectResult(b,y,w,S){return fh.columnSelectDown(b.cursorConfig,b,w,this._isPaged)}}n.CursorColumnSelectDown=Ee(new s({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:gt,kbExpr:$.textInputFocus,primary:3602,linux:{primary:0}}})),n.CursorColumnSelectPageDown=Ee(new s({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:gt,kbExpr:$.textInputFocus,primary:3596,linux:{primary:0}}}));class o extends oi{constructor(){super({id:"cursorMove",precondition:void 0,description:HS.description})}runCoreEditorCommand(b,y){const w=HS.parse(y);w&&this._runCursorMove(b,y.source,w)}_runCursorMove(b,y,w){b.model.pushStackElement(),b.setCursorStates(y,3,o._move(b,b.getCursorStates(),w)),b.revealPrimaryCursor(y,!0)}static _move(b,y,w){const S=w.select,L=w.value;switch(w.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return mn.simpleMove(b,y,w.direction,S,L,w.unit);case 11:case 13:case 12:case 14:return mn.viewportMove(b,y,w.direction,S,L);default:return null}}}n.CursorMoveImpl=o,n.CursorMove=Ee(new o);class r extends oi{constructor(b){super(b),this._staticArgs=b.args}runCoreEditorCommand(b,y){let w=this._staticArgs;this._staticArgs.value===-1&&(w={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:y.pageSize||b.cursorConfig.pageSize}),b.model.pushStackElement(),b.setCursorStates(y.source,3,mn.simpleMove(b,b.getCursorStates(),w.direction,w.select,w.value,w.unit)),b.revealPrimaryCursor(y.source,!0)}}n.CursorLeft=Ee(new r({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:gt,kbExpr:$.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),n.CursorLeftSelect=Ee(new r({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:gt,kbExpr:$.textInputFocus,primary:1039}})),n.CursorRight=Ee(new r({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:gt,kbExpr:$.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),n.CursorRightSelect=Ee(new r({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:gt,kbExpr:$.textInputFocus,primary:1041}})),n.CursorUp=Ee(new r({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:gt,kbExpr:$.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),n.CursorUpSelect=Ee(new r({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:gt,kbExpr:$.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),n.CursorPageUp=Ee(new r({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:gt,kbExpr:$.textInputFocus,primary:11}})),n.CursorPageUpSelect=Ee(new r({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:gt,kbExpr:$.textInputFocus,primary:1035}})),n.CursorDown=Ee(new r({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:gt,kbExpr:$.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),n.CursorDownSelect=Ee(new r({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:gt,kbExpr:$.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),n.CursorPageDown=Ee(new r({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:gt,kbExpr:$.textInputFocus,primary:12}})),n.CursorPageDownSelect=Ee(new r({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:gt,kbExpr:$.textInputFocus,primary:1036}})),n.CreateCursor=Ee(new class extends oi{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(v,b){if(!b.position)return;let y;b.wholeLine?y=mn.line(v,v.getPrimaryCursorState(),!1,b.position,b.viewPosition):y=mn.moveTo(v,v.getPrimaryCursorState(),!1,b.position,b.viewPosition);const w=v.getCursorStates();if(w.length>1){const S=y.modelState?y.modelState.position:null,L=y.viewState?y.viewState.position:null;for(let x=0,D=w.length;xL&&(S=L);const x=new N(S,1,S,v.model.getLineMaxColumn(S));let D=0;if(y.at)switch(y.at){case Qg.RawAtArgument.Top:D=3;break;case Qg.RawAtArgument.Center:D=1;break;case Qg.RawAtArgument.Bottom:D=4;break}const k=v.coordinatesConverter.convertModelRangeToViewRange(x);v.revealRange(b.source,!1,k,D,0)}}),n.SelectAll=new class extends MT{constructor(){super(Gme)}runDOMCommand(v){xr&&(v.focus(),v.select()),v.ownerDocument.execCommand("selectAll")}runEditorCommand(v,b,y){const w=b._getViewModel();w&&this.runCoreEditorCommand(w,y)}runCoreEditorCommand(v,b){v.model.pushStackElement(),v.setCursorStates("keyboard",3,[mn.selectAll(v,v.getPrimaryCursorState())])}},n.SetSelection=Ee(new class extends oi{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(v,b){b.selection&&(v.model.pushStackElement(),v.setCursorStates(b.source,3,[st.fromModelSelection(b.selection)]))}})})(Xi||(Xi={}));const lwe=Le.and($.textInputFocus,$.columnSelection);function c0(n,e){Fs.registerKeybindingRule({id:n,primary:e,when:lwe,weight:gt+1})}c0(Xi.CursorColumnSelectLeft.id,1039);c0(Xi.CursorColumnSelectRight.id,1041);c0(Xi.CursorColumnSelectUp.id,1040);c0(Xi.CursorColumnSelectPageUp.id,1035);c0(Xi.CursorColumnSelectDown.id,1042);c0(Xi.CursorColumnSelectPageDown.id,1036);function S7(n){return n.register(),n}var x7;(function(n){class e extends kr{runEditorCommand(i,s,o){const r=s._getViewModel();r&&this.runCoreEditingCommand(s,r,o||{})}}n.CoreEditingCommand=e,n.LineBreakInsert=Ee(new class extends e{constructor(){super({id:"lineBreakInsert",precondition:$.writable,kbOpts:{weight:gt,kbExpr:$.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(t,i,s){t.pushUndoStop(),t.executeCommands(this.id,gi.lineBreakInsert(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection)))}}),n.Outdent=Ee(new class extends e{constructor(){super({id:"outdent",precondition:$.writable,kbOpts:{weight:gt,kbExpr:Le.and($.editorTextFocus,$.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(t,i,s){t.pushUndoStop(),t.executeCommands(this.id,gi.outdent(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),n.Tab=Ee(new class extends e{constructor(){super({id:"tab",precondition:$.writable,kbOpts:{weight:gt,kbExpr:Le.and($.editorTextFocus,$.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(t,i,s){t.pushUndoStop(),t.executeCommands(this.id,gi.tab(i.cursorConfig,i.model,i.getCursorStates().map(o=>o.modelState.selection))),t.pushUndoStop()}}),n.DeleteLeft=Ee(new class extends e{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:gt,kbExpr:$.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(t,i,s){const[o,r]=xf.deleteLeft(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection),i.getCursorAutoClosedCharacters());o&&t.pushUndoStop(),t.executeCommands(this.id,r),i.setPrevEditOperationType(2)}}),n.DeleteRight=Ee(new class extends e{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:gt,kbExpr:$.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(t,i,s){const[o,r]=xf.deleteRight(i.getPrevEditOperationType(),i.cursorConfig,i.model,i.getCursorStates().map(a=>a.modelState.selection));o&&t.pushUndoStop(),t.executeCommands(this.id,r),i.setPrevEditOperationType(3)}}),n.Undo=new class extends MT{constructor(){super(lj)}runDOMCommand(t){t.ownerDocument.execCommand("undo")}runEditorCommand(t,i,s){if(!(!i.hasModel()||i.getOption(90)===!0))return i.getModel().undo()}},n.Redo=new class extends MT{constructor(){super(cj)}runDOMCommand(t){t.ownerDocument.execCommand("redo")}runEditorCommand(t,i,s){if(!(!i.hasModel()||i.getOption(90)===!0))return i.getModel().redo()}}})(x7||(x7={}));class L7 extends XL{constructor(e,t,i){super({id:e,precondition:void 0,description:i}),this._handlerId=t}runCommand(e,t){const i=e.get(jt).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function Qf(n,e){S7(new L7("default:"+n,n)),S7(new L7(n,n,e))}Qf("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]});Qf("replacePreviousChar");Qf("compositionType");Qf("compositionStart");Qf("compositionEnd");Qf("paste");Qf("cut");class cwe{constructor(e,t,i,s){this.configuration=e,this.viewModel=t,this.userInputEvents=i,this.commandDelegate=s}paste(e,t,i,s){this.commandDelegate.paste(e,t,i,s)}type(e){this.commandDelegate.type(e)}compositionType(e,t,i,s){this.commandDelegate.compositionType(e,t,i,s)}compositionStart(){this.commandDelegate.startComposition()}compositionEnd(){this.commandDelegate.endComposition()}cut(){this.commandDelegate.cut()}setSelection(e){Xi.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column=4?this._selectAll():e.mouseDownCount===3?this._hasMulticursorModifier(e)?e.inSelectionMode?this._lastCursorLineSelectDrag(e.position,e.revealType):this._lastCursorLineSelect(e.position,e.revealType):e.inSelectionMode?this._lineSelectDrag(e.position,e.revealType):this._lineSelect(e.position,e.revealType):e.mouseDownCount===2?e.onInjectedText||(this._hasMulticursorModifier(e)?this._lastCursorWordSelect(e.position,e.revealType):e.inSelectionMode?this._wordSelectDrag(e.position,e.revealType):this._wordSelect(e.position,e.revealType)):this._hasMulticursorModifier(e)?this._hasNonMulticursorModifier(e)||(e.shiftKey?this._columnSelect(e.position,e.mouseColumn,!0):e.inSelectionMode?this._lastCursorMoveToSelect(e.position,e.revealType):this._createCursor(e.position,!1)):e.inSelectionMode?e.altKey?this._columnSelect(e.position,e.mouseColumn,!0):s?this._columnSelect(e.position,e.mouseColumn,!0):this._moveToSelect(e.position,e.revealType):this.moveTo(e.position,e.revealType)}_usualArgs(e,t){return e=this._validateViewColumn(e),{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,revealType:t}}moveTo(e,t){Xi.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){Xi.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,i){e=this._validateViewColumn(e),Xi.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),Xi.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){Xi.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){Xi.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){Xi.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){Xi.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){Xi.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){Xi.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){Xi.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){Xi.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){Xi.SelectAll.runCoreEditorCommand(this.viewModel,{source:"mouse"})}_convertViewToModelPosition(e){return this.viewModel.coordinatesConverter.convertViewPositionToModelPosition(e)}emitKeyDown(e){this.userInputEvents.emitKeyDown(e)}emitKeyUp(e){this.userInputEvents.emitKeyUp(e)}emitContextMenu(e){this.userInputEvents.emitContextMenu(e)}emitMouseMove(e){this.userInputEvents.emitMouseMove(e)}emitMouseLeave(e){this.userInputEvents.emitMouseLeave(e)}emitMouseUp(e){this.userInputEvents.emitMouseUp(e)}emitMouseDown(e){this.userInputEvents.emitMouseDown(e)}emitMouseDrag(e){this.userInputEvents.emitMouseDrag(e)}emitMouseDrop(e){this.userInputEvents.emitMouseDrop(e)}emitMouseDropCanceled(){this.userInputEvents.emitMouseDropCanceled()}emitMouseWheel(e){this.userInputEvents.emitMouseWheel(e)}}class pD{constructor(e){this.onKeyDown=null,this.onKeyUp=null,this.onContextMenu=null,this.onMouseMove=null,this.onMouseLeave=null,this.onMouseDown=null,this.onMouseUp=null,this.onMouseDrag=null,this.onMouseDrop=null,this.onMouseDropCanceled=null,this.onMouseWheel=null,this._coordinatesConverter=e}emitKeyDown(e){var t;(t=this.onKeyDown)===null||t===void 0||t.call(this,e)}emitKeyUp(e){var t;(t=this.onKeyUp)===null||t===void 0||t.call(this,e)}emitContextMenu(e){var t;(t=this.onContextMenu)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseMove(e){var t;(t=this.onMouseMove)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){var t;(t=this.onMouseLeave)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDown(e){var t;(t=this.onMouseDown)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseUp(e){var t;(t=this.onMouseUp)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){var t;(t=this.onMouseDrag)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){var t;(t=this.onMouseDrop)===null||t===void 0||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){var e;(e=this.onMouseDropCanceled)===null||e===void 0||e.call(this)}emitMouseWheel(e){var t;(t=this.onMouseWheel)===null||t===void 0||t.call(this,e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return pD.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){const i=Object.assign({},e);return i.position&&(i.position=t.convertViewPositionToModelPosition(i.position)),i.range&&(i.range=t.convertViewRangeToModelRange(i.range)),(i.type===5||i.type===8)&&(i.detail=this.convertViewToModelViewZoneData(i.detail,t)),i}static convertViewToModelViewZoneData(e,t){return{viewZoneId:e.viewZoneId,positionBefore:e.positionBefore?t.convertViewPositionToModelPosition(e.positionBefore):e.positionBefore,positionAfter:e.positionAfter?t.convertViewPositionToModelPosition(e.positionAfter):e.positionAfter,position:t.convertViewPositionToModelPosition(e.position),afterLineNumber:t.convertViewPositionToModelPosition(new V(e.afterLineNumber,1)).lineNumber}}}class yq{constructor(e){this._createLine=e,this._set(1,[])}flush(){this._set(1,[])}_set(e,t){this._lines=t,this._rendLineNumberStart=e}_get(){return{rendLineNumberStart:this._rendLineNumberStart,lines:this._lines}}getStartLineNumber(){return this._rendLineNumberStart}getEndLineNumber(){return this._rendLineNumberStart+this._lines.length-1}getCount(){return this._lines.length}getLine(e){const t=e-this._rendLineNumberStart;if(t<0||t>=this._lines.length)throw new qi("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(this.getCount()===0)return null;const i=this.getStartLineNumber(),s=this.getEndLineNumber();if(ts)return null;let o=0,r=0;for(let l=i;l<=s;l++){const c=l-this._rendLineNumberStart;e<=l&&l<=t&&(r===0?(o=c,r=1):r++)}if(e=s&&a<=o&&(this._lines[a-this._rendLineNumberStart].onContentChanged(),r=!0);return r}onLinesInserted(e,t){if(this.getCount()===0)return null;const i=t-e+1,s=this.getStartLineNumber(),o=this.getEndLineNumber();if(e<=s)return this._rendLineNumberStart+=i,null;if(e>o)return null;if(i+e>o)return this._lines.splice(e-this._rendLineNumberStart,o-e+1);const r=[];for(let u=0;ui)continue;const l=Math.max(t,a.fromLineNumber),c=Math.min(i,a.toLineNumber);for(let d=l;d<=c;d++){const u=d-this._rendLineNumberStart;this._lines[u].onTokensChanged(),s=!0}}return s}}class wq{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new yq(()=>this._host.createVisibleLine())}_createDomNode(){const e=bt(document.createElement("div"));return e.setClassName("view-layer"),e.setPosition("absolute"),e.domNode.setAttribute("role","presentation"),e.domNode.setAttribute("aria-hidden","true"),e}onConfigurationChanged(e){return!!e.hasChanged(143)}onFlushed(e){return this._linesCollection.flush(),!0}onLinesChanged(e){return this._linesCollection.onLinesChanged(e.fromLineNumber,e.count)}onLinesDeleted(e){const t=this._linesCollection.onLinesDeleted(e.fromLineNumber,e.toLineNumber);if(t)for(let i=0,s=t.length;it){const r=t,a=Math.min(i,o.rendLineNumberStart-1);r<=a&&(this._insertLinesBefore(o,r,a,s,t),o.linesLength+=a-r+1)}else if(o.rendLineNumberStart0&&(this._removeLinesBefore(o,r),o.linesLength-=r)}if(o.rendLineNumberStart=t,o.rendLineNumberStart+o.linesLength-1i){const r=Math.max(0,i-o.rendLineNumberStart+1),l=o.linesLength-1-r+1;l>0&&(this._removeLinesAfter(o,l),o.linesLength-=l)}return this._finishRendering(o,!1,s),o}_renderUntouchedLines(e,t,i,s,o){const r=e.rendLineNumberStart,a=e.lines;for(let l=t;l<=i;l++){const c=r+l;a[l].layoutLine(c,s[c-o])}}_insertLinesBefore(e,t,i,s,o){const r=[];let a=0;for(let l=t;l<=i;l++)r[a++]=this.host.createVisibleLine();e.lines=r.concat(e.lines)}_removeLinesBefore(e,t){for(let i=0;i=0;a--){const l=e.lines[a];s[a]&&(l.setDomNode(r),r=r.previousSibling)}}_finishRenderingInvalidLines(e,t,i){const s=document.createElement("div");ql._ttPolicy&&(t=ql._ttPolicy.createHTML(t)),s.innerHTML=t;for(let o=0;on});ql._sb=new eD(1e5);class Cq extends oo{constructor(e){super(e),this._visibleLines=new wq(this),this.domNode=this._visibleLines.domNode;const i=this._context.configuration.options.get(50);Nn(this.domNode,i),this._dynamicOverlays=[],this._isFocused=!1,this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;ei.shouldRender());for(let i=0,s=t.length;i'),s.appendString(o),s.appendString(""),!0)}layoutLine(e,t){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(this._lineHeight))}}class uwe extends Cq{constructor(e){super(e);const i=this._context.configuration.options.get(143);this._contentWidth=i.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const i=this._context.configuration.options.get(143);return this._contentWidth=i.contentWidth,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollWidthChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e),this.domNode.setWidth(Math.max(e.scrollWidth,this._contentWidth))}}class hwe extends Cq{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(143);this._contentLeft=i.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),Nn(this.domNode,t.get(50))}onConfigurationChanged(e){const t=this._context.configuration.options;Nn(this.domNode,t.get(50));const i=t.get(143);return this._contentLeft=i.contentLeft,super.onConfigurationChanged(e)||!0}onScrollChanged(e){return super.onScrollChanged(e)||e.scrollHeightChanged}_viewOverlaysRender(e){super._viewOverlaysRender(e);const t=Math.min(e.scrollHeight,1e6);this.domNode.setHeight(t),this.domNode.setWidth(this._contentLeft)}}class fwe extends oo{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=bt(document.createElement("div")),sl.write(this.domNode,1),this.domNode.setClassName("contentWidgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=bt(document.createElement("div")),sl.write(this.overflowingContentWidgetsDomNode,2),this.overflowingContentWidgetsDomNode.setClassName("overflowingContentWidgets")}dispose(){super.dispose(),this._widgets={}}onConfigurationChanged(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onConfigurationChanged(e);return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLineMappingChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesDeleted(e){return this._updateAnchorsViewPositions(),!0}onLinesInserted(e){return this._updateAnchorsViewPositions(),!0}onScrollChanged(e){return!0}onZonesChanged(e){return!0}_updateAnchorsViewPositions(){const e=Object.keys(this._widgets);for(const t of e)this._widgets[t].updateAnchorViewPosition()}addWidget(e){const t=new gwe(this._context,this._viewDomNode,e);this._widgets[t.id]=t,t.allowEditorOverflow?this.overflowingContentWidgetsDomNode.appendChild(t.domNode):this.domNode.appendChild(t.domNode),this.setShouldRender()}setWidgetPosition(e,t,i,s,o){this._widgets[e.getId()].setPosition(t,i,s,o),this.setShouldRender()}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const i=this._widgets[t];delete this._widgets[t];const s=i.domNode.domNode;s.parentNode.removeChild(s),s.removeAttribute("monaco-visible-content-widget"),this.setShouldRender()}}shouldSuppressMouseDownOnWidget(e){return this._widgets.hasOwnProperty(e)?this._widgets[e].suppressMouseDown:!1}onBeforeRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onBeforeRender(e)}prepareRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].prepareRender(e)}render(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].render(e)}}class gwe{constructor(e,t,i){this._primaryAnchor=new P0(null,null),this._secondaryAnchor=new P0(null,null),this._context=e,this._viewDomNode=t,this._actual=i,this.domNode=bt(this._actual.getDomNode()),this.id=this._actual.getId(),this.allowEditorOverflow=this._actual.allowEditorOverflow||!1,this.suppressMouseDown=this._actual.suppressMouseDown||!1;const s=this._context.configuration.options,o=s.get(143);this._fixedOverflowWidgets=s.get(42),this._contentWidth=o.contentWidth,this._contentLeft=o.contentLeft,this._lineHeight=s.get(66),this._affinity=null,this._preference=[],this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1,this._maxWidth=this._getMaxWidth(),this._isVisible=!1,this._renderData=null,this.domNode.setPosition(this._fixedOverflowWidgets&&this.allowEditorOverflow?"fixed":"absolute"),this.domNode.setDisplay("none"),this.domNode.setVisibility("hidden"),this.domNode.setAttribute("widgetId",this.id),this.domNode.setMaxWidth(this._maxWidth)}onConfigurationChanged(e){const t=this._context.configuration.options;if(this._lineHeight=t.get(66),e.hasChanged(143)){const i=t.get(143);this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._maxWidth=this._getMaxWidth()}}updateAnchorViewPosition(){this._setPosition(this._affinity,this._primaryAnchor.modelPosition,this._secondaryAnchor.modelPosition)}_setPosition(e,t,i){this._affinity=e,this._primaryAnchor=s(t,this._context.viewModel,this._affinity),this._secondaryAnchor=s(i,this._context.viewModel,this._affinity);function s(o,r,a){if(!o)return new P0(null,null);const l=r.model.validatePosition(o);if(r.coordinatesConverter.modelPositionIsVisible(l)){const c=r.coordinatesConverter.convertModelPositionToViewPosition(l,a??void 0);return new P0(o,c)}return new P0(o,null)}}_getMaxWidth(){const e=this.domNode.domNode.ownerDocument,t=e.defaultView;return this.allowEditorOverflow?(t==null?void 0:t.innerWidth)||e.documentElement.offsetWidth||e.body.offsetWidth:this._contentWidth}setPosition(e,t,i,s){this._setPosition(s,e,t),this._preference=i,this._primaryAnchor.viewPosition&&this._preference&&this._preference.length>0?this.domNode.setDisplay("block"):this.domNode.setDisplay("none"),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,t,i,s){const o=e.top,r=o,a=e.top+e.height,l=s.viewportHeight-a,c=o-i,d=r>=i,u=a,h=l>=i;let f=e.left;return f+t>s.scrollLeft+s.viewportWidth&&(f=s.scrollLeft+s.viewportWidth-t),fc){const f=h-(c-s);h-=f,i-=f}if(h=v,w=f+i<=g.height-b;return this._fixedOverflowWidgets?{fitsAbove:y,aboveTop:Math.max(h,v),fitsBelow:w,belowTop:f,left:_}:{fitsAbove:y,aboveTop:a,fitsBelow:w,belowTop:l,left:p}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new O0(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){var t,i;const s=a(this._primaryAnchor.viewPosition,this._affinity,this._lineHeight),o=((t=this._secondaryAnchor.viewPosition)===null||t===void 0?void 0:t.lineNumber)===((i=this._primaryAnchor.viewPosition)===null||i===void 0?void 0:i.lineNumber)?this._secondaryAnchor.viewPosition:null,r=a(o,this._affinity,this._lineHeight);return{primary:s,secondary:r};function a(l,c,d){if(!l)return null;const u=e.visibleRangeForPosition(l);if(!u)return null;const h=l.column===1&&c===3?0:u.left,f=e.getVerticalOffsetForLineNumber(l.lineNumber)-e.scrollTop;return new D7(f,h,d)}}_reduceAnchorCoordinates(e,t,i){if(!t)return e;const s=this._context.configuration.options.get(50);let o=t.left;return oe.endLineNumber||this.domNode.setMaxWidth(this._maxWidth)}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){if(!this._renderData){this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this.domNode.setVisibility("hidden")),typeof this._actual.afterRender=="function"&&k2(this._actual.afterRender,this._actual,null);return}this.allowEditorOverflow?(this.domNode.setTop(this._renderData.coordinate.top),this.domNode.setLeft(this._renderData.coordinate.left)):(this.domNode.setTop(this._renderData.coordinate.top+e.scrollTop-e.bigNumbersDelta),this.domNode.setLeft(this._renderData.coordinate.left)),this._isVisible||(this.domNode.setVisibility("inherit"),this.domNode.setAttribute("monaco-visible-content-widget","true"),this._isVisible=!0),typeof this._actual.afterRender=="function"&&k2(this._actual.afterRender,this._actual,this._renderData.position)}}class P0{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class O0{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class D7{constructor(e,t,i){this.top=e,this.left=t,this.height=i,this._anchorCoordinateBrand=void 0}}function k2(n,e,...t){try{return n.call(e,...t)}catch{return null}}class Sq extends Xf{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(143);this._lineHeight=t.get(66),this._renderLineHighlight=t.get(95),this._renderLineHighlightOnlyWhenFocus=t.get(96),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new lt(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1;const t=this._selections.map(s=>s.positionLineNumber);t.sort((s,o)=>s-o),Yi(this._cursorLineNumbers,t)||(this._cursorLineNumbers=t,e=!0);const i=this._selections.every(s=>s.isEmpty());return this._selectionIsEmpty!==i&&(this._selectionIsEmpty=i,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(143);return this._lineHeight=t.get(66),this._renderLineHighlight=t.get(95),this._renderLineHighlightOnlyWhenFocus=t.get(96),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,!0}onCursorStateChanged(e){return this._selections=e.selections,this._readFromSelections()}onFlushed(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollWidthChanged||e.scrollTopChanged}onZonesChanged(e){return!0}onFocusChanged(e){return this._renderLineHighlightOnlyWhenFocus?(this._focused=e.isFocused,!0):!1}prepareRender(e){if(!this._shouldRenderThis()){this._renderData=null;return}const t=this._renderOne(e),i=e.visibleRange.startLineNumber,s=e.visibleRange.endLineNumber,o=this._cursorLineNumbers.length;let r=0;const a=[];for(let l=i;l<=s;l++){const c=l-i;for(;r=this._renderData.length?"":this._renderData[i]}_shouldRenderInMargin(){return(this._renderLineHighlight==="gutter"||this._renderLineHighlight==="all")&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderInContent(){return(this._renderLineHighlight==="line"||this._renderLineHighlight==="all")&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}class pwe extends Sq{_renderOne(e){return`
`}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class mwe extends Sq{_renderOne(e){return`
`}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}Tr((n,e)=>{const t=n.getColor(cq);if(t&&(e.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${t}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${t}; border: none; }`)),!t||t.isTransparent()||n.defines(y7)){const i=n.getColor(y7);i&&(e.addRule(`.monaco-editor .view-overlays .current-line { border: 2px solid ${i}; }`),e.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { border: 2px solid ${i}; }`),lc(n.type)&&(e.addRule(".monaco-editor .view-overlays .current-line { border-width: 1px; }"),e.addRule(".monaco-editor .margin-view-overlays .current-line-margin { border-width: 1px; }")))}});class _we extends Xf{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged||e.scrollWidthChanged}onZonesChanged(e){return!0}prepareRender(e){const t=e.getDecorationsInViewport();let i=[],s=0;for(let l=0,c=t.length;l{if(l.options.zIndexc.options.zIndex)return 1;const d=l.options.className,u=c.options.className;return du?1:N.compareRangesUsingStarts(l.range,c.range)});const o=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,a=[];for(let l=o;l<=r;l++){const c=l-o;a[c]=""}this._renderWholeLineDecorations(e,i,a),this._renderNormalDecorations(e,i,a),this._renderResult=a}_renderWholeLineDecorations(e,t,i){const s=String(this._lineHeight),o=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber;for(let a=0,l=t.length;a',u=Math.max(c.range.startLineNumber,o),h=Math.min(c.range.endLineNumber,r);for(let f=u;f<=h;f++){const g=f-o;i[g]+=d}}}_renderNormalDecorations(e,t,i){var s;const o=String(this._lineHeight),r=e.visibleRange.startLineNumber;let a=null,l=!1,c=null,d=!1;for(let u=0,h=t.length;u';l[f]+=b}}}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class bwe extends oo{constructor(e,t,i,s){super(e);const o=this._context.configuration.options,r=o.get(102),a=o.get(74),l=o.get(40),c=o.get(105),d={listenOnDomNode:i.domNode,className:"editor-scrollable "+TT(e.theme.type),useShadows:!1,lazyRender:!0,vertical:r.vertical,horizontal:r.horizontal,verticalHasArrows:r.verticalHasArrows,horizontalHasArrows:r.horizontalHasArrows,verticalScrollbarSize:r.verticalScrollbarSize,verticalSliderSize:r.verticalSliderSize,horizontalScrollbarSize:r.horizontalScrollbarSize,horizontalSliderSize:r.horizontalSliderSize,handleMouseWheel:r.handleMouseWheel,alwaysConsumeMouseWheel:r.alwaysConsumeMouseWheel,arrowSize:r.arrowSize,mouseWheelScrollSensitivity:a,fastScrollSensitivity:l,scrollPredominantAxis:c,scrollByPage:r.scrollByPage};this.scrollbar=this._register(new y3(t.domNode,d,this._context.viewLayout.getScrollable())),sl.write(this.scrollbar.getDomNode(),5),this.scrollbarDomNode=bt(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const u=(h,f,g)=>{const p={};{const _=h.scrollTop;_&&(p.scrollTop=this._context.viewLayout.getCurrentScrollTop()+_,h.scrollTop=0)}if(g){const _=h.scrollLeft;_&&(p.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+_,h.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(p,1)};this._register(K(i.domNode,"scroll",h=>u(i.domNode,!0,!0))),this._register(K(t.domNode,"scroll",h=>u(t.domNode,!0,!1))),this._register(K(s.domNode,"scroll",h=>u(s.domNode,!0,!1))),this._register(K(this.scrollbarDomNode.domNode,"scroll",h=>u(this.scrollbarDomNode.domNode,!0,!1)))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(143);this.scrollbarDomNode.setLeft(t.contentLeft),e.get(72).side==="right"?this.scrollbarDomNode.setWidth(t.contentWidth+t.minimap.minimapWidth):this.scrollbarDomNode.setWidth(t.contentWidth),this.scrollbarDomNode.setHeight(t.height)}getOverviewRulerLayoutInfo(){return this.scrollbar.getOverviewRulerLayoutInfo()}getDomNode(){return this.scrollbarDomNode}delegateVerticalScrollbarPointerDown(e){this.scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this.scrollbar.delegateScrollFromMouseWheelEvent(e)}onConfigurationChanged(e){if(e.hasChanged(102)||e.hasChanged(74)||e.hasChanged(40)){const t=this._context.configuration.options,i=t.get(102),s=t.get(74),o=t.get(40),r=t.get(105),a={vertical:i.vertical,horizontal:i.horizontal,verticalScrollbarSize:i.verticalScrollbarSize,horizontalScrollbarSize:i.horizontalScrollbarSize,scrollByPage:i.scrollByPage,handleMouseWheel:i.handleMouseWheel,mouseWheelScrollSensitivity:s,fastScrollSensitivity:o,scrollPredominantAxis:r};this.scrollbar.updateOptions(a)}return e.hasChanged(143)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+TT(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}class xq extends Y{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function mD(n,e){let t=0,i=0;const s=n.length;for(;is)throw new qi("Illegal value for lineNumber");const o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=!!(o&&o.offSide);let a=-2,l=-1,c=-2,d=-1;const u=x=>{if(a!==-1&&(a===-2||a>x-1)){a=-1,l=-1;for(let D=x-2;D>=0;D--){const k=this._computeIndentLevel(D);if(k>=0){a=D,l=k;break}}}if(c===-2){c=-1,d=-1;for(let D=x;D=0){c=D,d=k;break}}}};let h=-2,f=-1,g=-2,p=-1;const _=x=>{if(h===-2){h=-1,f=-1;for(let D=x-2;D>=0;D--){const k=this._computeIndentLevel(D);if(k>=0){h=D,f=k;break}}}if(g!==-1&&(g===-2||g=0){g=D,p=k;break}}}};let v=0,b=!0,y=0,w=!0,S=0,L=0;for(let x=0;b||w;x++){const D=e-x,k=e+x;x>1&&(D<1||D1&&(k>s||k>i)&&(w=!1),x>5e4&&(b=!1,w=!1);let P=-1;if(b&&D>=1){const M=this._computeIndentLevel(D-1);M>=0?(c=D-1,d=M,P=Math.ceil(M/this.textModel.getOptions().indentSize)):(u(D),P=this._getIndentLevelForWhitespaceLine(r,l,d))}let O=-1;if(w&&k<=s){const M=this._computeIndentLevel(k-1);M>=0?(h=k-1,f=M,O=Math.ceil(M/this.textModel.getOptions().indentSize)):(_(k),O=this._getIndentLevelForWhitespaceLine(r,f,p))}if(x===0){L=P;continue}if(x===1){if(k<=s&&O>=0&&L+1===O){b=!1,v=k,y=k,S=O;continue}if(D>=1&&P>=0&&P-1===L){w=!1,v=D,y=D,S=P;continue}if(v=e,y=e,S=L,S===0)return{startLineNumber:v,endLineNumber:y,indent:S}}b&&(P>=S?v=D:b=!1),w&&(O>=S?y=k:w=!1)}return{startLineNumber:v,endLineNumber:y,indent:S}}getLinesBracketGuides(e,t,i,s){var o;const r=[];for(let h=e;h<=t;h++)r.push([]);const a=!0,l=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new N(e,1,t,this.textModel.getLineMaxColumn(t))).toArray();let c;if(i&&l.length>0){const h=(e<=i.lineNumber&&i.lineNumber<=t?l:this.textModel.bracketPairs.getBracketPairsInRange(N.fromPositions(i)).toArray()).filter(f=>N.strictContainsPosition(f.range,i));c=(o=gT(h,f=>a))===null||o===void 0?void 0:o.range}const d=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,u=new Lq;for(const h of l){if(!h.closingBracketRange)continue;const f=c&&h.range.equalsRange(c);if(!f&&!s.includeInactive)continue;const g=u.getInlineClassName(h.nestingLevel,h.nestingLevelOfEqualBracketType,d)+(s.highlightActive&&f?" "+u.activeClassName:""),p=h.openingBracketRange.getStartPosition(),_=h.closingBracketRange.getStartPosition(),v=s.horizontalGuides===ef.Enabled||s.horizontalGuides===ef.EnabledForActive&&f;if(h.range.startLineNumber===h.range.endLineNumber){v&&r[h.range.startLineNumber-e].push(new Ah(-1,h.openingBracketRange.getEndPosition().column,g,new H_(!1,_.column),-1,-1));continue}const b=this.getVisibleColumnFromPosition(_),y=this.getVisibleColumnFromPosition(h.openingBracketRange.getStartPosition()),w=Math.min(y,b,h.minVisibleColumnIndentation+1);let S=!1;Ys(this.textModel.getLineContent(h.closingBracketRange.startLineNumber))=e&&y>w&&r[p.lineNumber-e].push(new Ah(w,-1,g,new H_(!1,p.column),-1,-1)),_.lineNumber<=t&&b>w&&r[_.lineNumber-e].push(new Ah(w,-1,g,new H_(!S,_.column),-1,-1)))}for(const h of r)h.sort((f,g)=>f.visibleColumn-g.visibleColumn);return r}getVisibleColumnFromPosition(e){return Gi.visibleColumnFromColumn(this.textModel.getLineContent(e.lineNumber),e.column,this.textModel.getOptions().tabSize)+1}getLinesIndentGuides(e,t){this.assertNotDisposed();const i=this.textModel.getLineCount();if(e<1||e>i)throw new Error("Illegal value for startLineNumber");if(t<1||t>i)throw new Error("Illegal value for endLineNumber");const s=this.textModel.getOptions(),o=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,r=!!(o&&o.offSide),a=new Array(t-e+1);let l=-2,c=-1,d=-2,u=-1;for(let h=e;h<=t;h++){const f=h-e,g=this._computeIndentLevel(h-1);if(g>=0){l=h-1,c=g,a[f]=Math.ceil(g/s.indentSize);continue}if(l===-2){l=-1,c=-1;for(let p=h-2;p>=0;p--){const _=this._computeIndentLevel(p);if(_>=0){l=p,c=_;break}}}if(d!==-1&&(d===-2||d=0){d=p,u=_;break}}}a[f]=this._getIndentLevelForWhitespaceLine(r,c,u)}return a}_getIndentLevelForWhitespaceLine(e,t,i){const s=this.textModel.getOptions();return t===-1||i===-1?0:tl||this._maxIndentLeft>0&&y>this._maxIndentLeft)break;const w=b.horizontalLine?b.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",S=b.horizontalLine?((o=(s=e.visibleRangeForPosition(new V(f,b.horizontalLine.endColumn)))===null||s===void 0?void 0:s.left)!==null&&o!==void 0?o:y+this._spaceWidth)-y:this._spaceWidth;_+=`
`}h[g]=_}this._renderResult=h}getGuidesByLine(e,t,i){const s=this._bracketPairGuideOptions.bracketPairs!==!1?this._context.viewModel.getBracketGuidesInRangeByLine(e,t,i,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:this._bracketPairGuideOptions.bracketPairsHorizontal===!0?ef.Enabled:this._bracketPairGuideOptions.bracketPairsHorizontal==="active"?ef.EnabledForActive:ef.Disabled,includeInactive:this._bracketPairGuideOptions.bracketPairs===!0}):null,o=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null;let r=0,a=0,l=0;if(this._bracketPairGuideOptions.highlightActiveIndentation!==!1&&i){const u=this._context.viewModel.getActiveIndentGuide(i.lineNumber,e,t);r=u.startLineNumber,a=u.endLineNumber,l=u.indent}const{indentSize:c}=this._context.viewModel.model.getOptions(),d=[];for(let u=e;u<=t;u++){const h=new Array;d.push(h);const f=s?s[u-e]:[],g=new _c(f),p=o?o[u-e]:0;for(let _=1;_<=p;_++){const v=(_-1)*c+1,b=(this._bracketPairGuideOptions.highlightActiveIndentation==="always"||f.length===0)&&r<=u&&u<=a&&_===l;h.push(...g.takeWhile(w=>w.visibleColumn!0)||[])}return d}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function vg(n){if(!(n&&n.isTransparent()))return n}Tr((n,e)=>{const t=[{bracketColor:uq,guideColor:Tye,guideColorActive:Fye},{bracketColor:hq,guideColor:Nye,guideColorActive:Bye},{bracketColor:fq,guideColor:Rye,guideColorActive:Wye},{bracketColor:gq,guideColor:Mye,guideColorActive:Vye},{bracketColor:pq,guideColor:Pye,guideColorActive:zye},{bracketColor:mq,guideColor:Oye,guideColorActive:Hye}],i=new Lq,s=[{indentColor:ty,indentColorActive:iy},{indentColor:hye,indentColorActive:_ye},{indentColor:fye,indentColorActive:bye},{indentColor:gye,indentColorActive:vye},{indentColor:pye,indentColorActive:yye},{indentColor:mye,indentColorActive:wye}],o=t.map(a=>{var l,c;const d=n.getColor(a.bracketColor),u=n.getColor(a.guideColor),h=n.getColor(a.guideColorActive),f=vg((l=vg(u))!==null&&l!==void 0?l:d==null?void 0:d.transparent(.3)),g=vg((c=vg(h))!==null&&c!==void 0?c:d);if(!(!f||!g))return{guideColor:f,guideColorActive:g}}).filter(uS),r=s.map(a=>{const l=n.getColor(a.indentColor),c=n.getColor(a.indentColorActive),d=vg(l),u=vg(c);if(!(!d||!u))return{indentColor:d,indentColorActive:u}}).filter(uS);if(o.length>0){for(let a=0;a<30;a++){const l=o[a%o.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(a).replace(/ /g,".")} { --guide-color: ${l.guideColor}; --guide-color-active: ${l.guideColorActive}; }`)}e.addRule(".monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }"),e.addRule(".monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }"),e.addRule(".monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }"),e.addRule(`.monaco-editor .vertical.${i.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),e.addRule(`.monaco-editor .horizontal-top.${i.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),e.addRule(`.monaco-editor .horizontal-bottom.${i.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}if(r.length>0){for(let a=0;a<30;a++){const l=r[a%r.length];e.addRule(`.monaco-editor .lines-content .core-guide-indent.lvl-${a} { --indent-color: ${l.indentColor}; --indent-color-active: ${l.indentColorActive}; }`)}e.addRule(".monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 var(--indent-color) inset; }"),e.addRule(".monaco-editor .lines-content .core-guide-indent.indent-active { box-shadow: 1px 0 0 0 var(--indent-color-active) inset; }")}});class E2{get didDomLayout(){return this._didDomLayout}readClientRect(){if(!this._clientRectRead){this._clientRectRead=!0;const e=this._domNode.getBoundingClientRect();this.markDidDomLayout(),this._clientRectDeltaLeft=e.left,this._clientRectScale=e.width/this._domNode.offsetWidth}}get clientRectDeltaLeft(){return this._clientRectRead||this.readClientRect(),this._clientRectDeltaLeft}get clientRectScale(){return this._clientRectRead||this.readClientRect(),this._clientRectScale}constructor(e,t){this._domNode=e,this.endNode=t,this._didDomLayout=!1,this._clientRectDeltaLeft=0,this._clientRectScale=1,this._clientRectRead=!1}markDidDomLayout(){this._didDomLayout=!0}}class wwe{constructor(){this._currentVisibleRange=new N(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class Cwe{constructor(e,t,i,s,o,r,a){this.minimalReveal=e,this.lineNumber=t,this.startColumn=i,this.endColumn=s,this.startScrollTop=o,this.stopScrollTop=r,this.scrollType=a,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class Swe{constructor(e,t,i,s,o){this.minimalReveal=e,this.selections=t,this.startScrollTop=i,this.stopScrollTop=s,this.scrollType=o,this.type="selections";let r=t[0].startLineNumber,a=t[0].endLineNumber;for(let l=1,c=t.length;l{this._updateLineWidthsSlow()},200),this._asyncCheckMonospaceFontAssumptions=new Li(()=>{this._checkMonospaceFontAssumptions()},2e3),this._lastRenderedData=new wwe,this._horizontalRevealRequest=null,this._stickyScrollEnabled=s.get(114).enabled,this._maxNumberStickyLines=s.get(114).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new Ia(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(144)&&(this._maxLineWidth=0);const t=this._context.configuration.options,i=t.get(50),s=t.get(144);return this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=s.isViewportWrapping,this._revealHorizontalRightPadding=t.get(99),this._cursorSurroundingLines=t.get(29),this._cursorSurroundingLinesStyle=t.get(30),this._canUseLayerHinting=!t.get(32),this._stickyScrollEnabled=t.get(114).enabled,this._maxNumberStickyLines=t.get(114).maxLineCount,Nn(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(143)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new p7(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const i=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();for(let o=i;o<=s;o++)this._visibleLines.getVisibleLine(o).onOptionsChanged(this._viewLineOptions);return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let s=!1;for(let o=t;o<=i;o++)s=this._visibleLines.getVisibleLine(o).onSelectionChanged()||s;return s}onDecorationsChanged(e){{const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let s=t;s<=i;s++)this._visibleLines.getVisibleLine(s).onDecorationsChanged()}return!0}onFlushed(e){const t=this._visibleLines.onFlushed(e);return this._maxLineWidth=0,t}onLinesChanged(e){return this._visibleLines.onLinesChanged(e)}onLinesDeleted(e){return this._visibleLines.onLinesDeleted(e)}onLinesInserted(e){return this._visibleLines.onLinesInserted(e)}onRevealRangeRequest(e){const t=this._computeScrollTopToRevealRange(this._context.viewLayout.getFutureViewport(),e.source,e.minimalReveal,e.range,e.selections,e.verticalType);if(t===-1)return!1;let i=this._context.viewLayout.validateScrollPosition({scrollTop:t});e.revealHorizontal?e.range&&e.range.startLineNumber!==e.range.endLineNumber?i={scrollTop:i.scrollTop,scrollLeft:0}:e.range?this._horizontalRevealRequest=new Cwe(e.minimalReveal,e.range.startLineNumber,e.range.startColumn,e.range.endColumn,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType):e.selections&&e.selections.length>0&&(this._horizontalRevealRequest=new Swe(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const o=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(i,o),!0}onScrollChanged(e){if(this._horizontalRevealRequest&&e.scrollLeftChanged&&(this._horizontalRevealRequest=null),this._horizontalRevealRequest&&e.scrollTopChanged){const t=Math.min(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop),i=Math.max(this._horizontalRevealRequest.startScrollTop,this._horizontalRevealRequest.stopScrollTop);(e.scrollTopi)&&(this._horizontalRevealRequest=null)}return this.domNode.setWidth(e.scrollWidth),this._visibleLines.onScrollChanged(e)||!0}onTokensChanged(e){return this._visibleLines.onTokensChanged(e)}onZonesChanged(e){return this._context.viewModel.viewLayout.setMaxLineWidth(this._maxLineWidth),this._visibleLines.onZonesChanged(e)}onThemeChanged(e){return this._onOptionsMaybeChanged()}getPositionFromDOMInfo(e,t){const i=this._getViewLineDomNode(e);if(i===null)return null;const s=this._getLineNumberFor(i);if(s===-1||s<1||s>this._context.viewModel.getLineCount())return null;if(this._context.viewModel.getLineMaxColumn(s)===1)return new V(s,1);const o=this._visibleLines.getStartLineNumber(),r=this._visibleLines.getEndLineNumber();if(sr)return null;let a=this._visibleLines.getVisibleLine(s).getColumnOfNodeOffset(e,t);const l=this._context.viewModel.getLineMinColumn(s);return ai)return-1;const s=new E2(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getWidth(s);return this._updateLineWidthsSlowIfDomDidLayout(s),o}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const i=e.endLineNumber,s=N.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!s)return null;const o=[];let r=0;const a=new E2(this.domNode.domNode,this._textRangeRestingSpot);let l=0;t&&(l=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new V(s.startLineNumber,1)).lineNumber);const c=this._visibleLines.getStartLineNumber(),d=this._visibleLines.getEndLineNumber();for(let u=s.startLineNumber;u<=s.endLineNumber;u++){if(ud)continue;const h=u===s.startLineNumber?s.startColumn:1,f=u!==s.endLineNumber,g=f?this._context.viewModel.getLineMaxColumn(u):s.endColumn,p=this._visibleLines.getVisibleLine(u).getVisibleRangesForRange(u,h,g,a);if(p){if(t&&uthis._visibleLines.getEndLineNumber())return null;const s=new E2(this.domNode.domNode,this._textRangeRestingSpot),o=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,i,s);return this._updateLineWidthsSlowIfDomDidLayout(s),o}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new R1e(t.outsideRenderedLine,t.ranges[0].left):null}_updateLineWidthsFast(){return this._updateLineWidths(!0)}_updateLineWidthsSlow(){this._updateLineWidths(!1)}_updateLineWidthsSlowIfDomDidLayout(e){e.didDomLayout&&(this._asyncUpdateLineWidths.isScheduled()||(this._asyncUpdateLineWidths.cancel(),this._updateLineWidthsSlow()))}_updateLineWidths(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let s=1,o=!0;for(let r=t;r<=i;r++){const a=this._visibleLines.getVisibleLine(r);if(e&&!a.getWidthIsFast()){o=!1;continue}s=Math.max(s,a.getWidth(null))}return o&&t===1&&i===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(s),o}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const i=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();for(let o=i;o<=s;o++){const r=this._visibleLines.getVisibleLine(o);if(r.needsMonospaceFontCheck()){const a=r.getWidth(null);a>t&&(t=a,e=o)}}if(e!==-1&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let o=i;o<=s;o++)this._visibleLines.getVisibleLine(o).onMonospaceAssumptionsInvalidated()}prepareRender(){throw new Error("Not supported")}render(){throw new Error("Not supported")}renderText(e){if(this._visibleLines.renderLines(e),this._lastRenderedData.setCurrentVisibleRange(e.visibleRange),this.domNode.setWidth(this._context.viewLayout.getScrollWidth()),this.domNode.setHeight(Math.min(this._context.viewLayout.getScrollHeight(),1e6)),this._horizontalRevealRequest){const i=this._horizontalRevealRequest;if(e.startLineNumber<=i.minLineNumber&&i.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();const s=this._computeScrollLeftToReveal(i);s&&(this._isViewportWrapping||this._ensureMaxLineWidth(s.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:s.scrollLeft},i.scrollType))}}if(this._updateLineWidthsFast()?this._asyncUpdateLineWidths.cancel():this._asyncUpdateLineWidths.schedule(),Xn&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const i=this._visibleLines.getStartLineNumber(),s=this._visibleLines.getEndLineNumber();for(let o=i;o<=s;o++)if(this._visibleLines.getVisibleLine(o).needsMonospaceFontCheck()){this._asyncCheckMonospaceFontAssumptions.schedule();break}}this._linesContent.setLayerHinting(this._canUseLayerHinting),this._linesContent.setContain("strict");const t=this._context.viewLayout.getCurrentScrollTop()-e.bigNumbersDelta;this._linesContent.setTop(-t),this._linesContent.setLeft(-this._context.viewLayout.getCurrentScrollLeft())}_ensureMaxLineWidth(e){const t=Math.ceil(e);this._maxLineWidth0){let v=o[0].startLineNumber,b=o[0].endLineNumber;for(let y=1,w=o.length;yl){if(!d)return-1;_=u}else if(r===5||r===6)if(r===6&&a<=u&&h<=c)_=a;else{const v=Math.max(5*this._lineHeight,l*.2),b=u-v,y=h-l;_=Math.max(y,b)}else if(r===1||r===2)if(r===2&&a<=u&&h<=c)_=a;else{const v=(u+h)/2;_=Math.max(0,v-l/2)}else _=this._computeMinimumScrolling(a,c,u,h,r===3,r===4);return _}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),i=this._context.configuration.options.get(143),s=t.left,o=s+t.width-i.verticalScrollbarWidth;let r=1073741824,a=0;if(e.type==="range"){const c=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!c)return null;for(const d of c.ranges)r=Math.min(r,Math.round(d.left)),a=Math.max(a,Math.round(d.left+d.width))}else for(const c of e.selections){if(c.startLineNumber!==c.endLineNumber)return null;const d=this._visibleRangesForLineRange(c.startLineNumber,c.startColumn,c.endColumn);if(!d)return null;for(const u of d.ranges)r=Math.min(r,Math.round(u.left)),a=Math.max(a,Math.round(u.left+u.width))}return e.minimalReveal||(r=Math.max(0,r-_D.HORIZONTAL_EXTRA_PX),a+=this._revealHorizontalRightPadding),e.type==="selections"&&a-r>t.width?null:{scrollLeft:this._computeMinimumScrolling(s,o,r,a),maxHorizontalOffset:a}}_computeMinimumScrolling(e,t,i,s,o,r){e=e|0,t=t|0,i=i|0,s=s|0,o=!!o,r=!!r;const a=t-e;if(s-it)return Math.max(0,s-a)}else return i;return e}}_D.HORIZONTAL_EXTRA_PX=30;class PT{constructor(e,t,i,s){this._decorationToRenderBrand=void 0,this.startLineNumber=+e,this.endLineNumber=+t,this.className=String(i),this.zIndex=s??0}}class xwe{constructor(e,t){this.className=e,this.zIndex=t}}class Lwe{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class Dq extends Xf{_render(e,t,i){const s=[];for(let a=e;a<=t;a++){const l=a-e;s[l]=new Lwe}if(i.length===0)return s;i.sort((a,l)=>a.className===l.className?a.startLineNumber===l.startLineNumber?a.endLineNumber-l.endLineNumber:a.startLineNumber-l.startLineNumber:a.classNames)continue;const a=Math.max(r.startLineNumber,i),l=Math.min(o.preference.lane,this._glyphMarginDecorationLaneCount);t.push(new Ewe(a,l,o.preference.zIndex,o))}}_collectSortedGlyphRenderRequests(e){const t=[];return this._collectDecorationBasedGlyphRenderRequest(e,t),this._collectWidgetBasedGlyphRenderRequest(e,t),t.sort((i,s)=>i.lineNumber===s.lineNumber?i.lane===s.lane?i.zIndex===s.zIndex?s.type===i.type?i.type===0&&s.type===0?i.className0;){const s=t.peek();if(!s)break;const o=t.takeWhile(a=>a.lineNumber===s.lineNumber&&a.lane===s.lane);if(!o||o.length===0)break;const r=o[0];if(r.type===0){const a=[];for(const l of o){if(l.zIndex!==r.zIndex||l.type!==r.type)break;(a.length===0||a[a.length-1]!==l.className)&&a.push(l.className)}i.push(r.accept(a.join(" ")))}else r.widget.renderInfo={lineNumber:r.lineNumber,lane:r.lane}}this._decorationGlyphsToRender=i}render(e){if(!this._glyphMargin){for(const i of Object.values(this._widgets))i.domNode.setDisplay("none");for(;this._managedDomNodes.length>0;){const i=this._managedDomNodes.pop();i==null||i.domNode.remove()}return}const t=Math.round(this._glyphMarginWidth/this._glyphMarginDecorationLaneCount);for(const i of Object.values(this._widgets))if(!i.renderInfo)i.domNode.setDisplay("none");else{const s=e.viewportData.relativeVerticalOffset[i.renderInfo.lineNumber-e.viewportData.startLineNumber],o=this._glyphMarginLeft+(i.renderInfo.lane-1)*this._lineHeight;i.domNode.setDisplay("block"),i.domNode.setTop(s),i.domNode.setLeft(o),i.domNode.setWidth(t),i.domNode.setHeight(this._lineHeight)}for(let i=0;ithis._decorationGlyphsToRender.length;){const i=this._managedDomNodes.pop();i==null||i.domNode.remove()}}}class kwe{constructor(e,t,i,s){this.lineNumber=e,this.lane=t,this.zIndex=i,this.className=s,this.type=0}accept(e){return new Awe(this.lineNumber,this.lane,e)}}class Ewe{constructor(e,t,i,s){this.lineNumber=e,this.lane=t,this.zIndex=i,this.widget=s,this.type=1}}class Awe{constructor(e,t,i){this.lineNumber=e,this.lane=t,this.combinedClassName=i}}class Iwe extends Dq{constructor(e){super(),this._context=e;const i=this._context.configuration.options.get(143);this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.decorationsWidth,this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const i=this._context.configuration.options.get(143);return this._decorationsLeft=i.decorationsLeft,this._decorationsWidth=i.decorationsWidth,!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_getDecorations(e){const t=e.getDecorationsInViewport(),i=[];let s=0;for(let o=0,r=t.length;o',l=[];for(let c=t;c<=i;c++){const d=c-t,u=s[d].getDecorations();let h="";for(const f of u)h+='
';o[a]=c}this._renderResult=o}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}class Fo{constructor(e,t,i,s){this._rgba8Brand=void 0,this.r=Fo._clamp(e),this.g=Fo._clamp(t),this.b=Fo._clamp(i),this.a=Fo._clamp(s)}equals(e){return this.r===e.r&&this.g===e.g&&this.b===e.b&&this.a===e.a}static _clamp(e){return e<0?0:e>255?255:e|0}}Fo.Empty=new Fo(0,0,0,0);class sy extends Y{static getInstance(){return this._INSTANCE||(this._INSTANCE=new sy),this._INSTANCE}constructor(){super(),this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(Si.onDidChange(e=>{e.changedColorMap&&this._updateColorMap()}))}_updateColorMap(){const e=Si.getColorMap();if(!e){this._colors=[Fo.Empty],this._backgroundIsLight=!0;return}this._colors=[Fo.Empty];for(let i=1;i=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}}sy._INSTANCE=null;const Nwe=(()=>{const n=[];for(let e=32;e<=126;e++)n.push(e);return n.push(65533),n})(),Rwe=(n,e)=>(n-=32,n<0||n>96?e<=2?(n+96)%96:95:n);class dv{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=dv.soften(e,12/15),this.charDataLight=dv.soften(e,50/60)}static soften(e,t){const i=new Uint8ClampedArray(e.length);for(let s=0,o=e.length;se.width||i+g>e.height){console.warn("bad render request outside image data");return}const p=d?this.charDataLight:this.charDataNormal,_=Rwe(s,c),v=e.width*4,b=a.r,y=a.g,w=a.b,S=o.r-b,L=o.g-y,x=o.b-w,D=Math.max(r,l),k=e.data;let P=_*h*f,O=i*v+t*4;for(let M=0;Me.width||i+u>e.height){console.warn("bad render request outside image data");return}const h=e.width*4,f=.5*(o/255),g=r.r,p=r.g,_=r.b,v=s.r-g,b=s.g-p,y=s.b-_,w=g+v*f,S=p+b*f,L=_+y*f,x=Math.max(o,a),D=e.data;let k=i*h+t*4;for(let P=0;P{const e=new Uint8ClampedArray(n.length/2);for(let t=0;t>1]=k7[n[t]]<<4|k7[n[t+1]]&15;return e},A7={1:pm(()=>E7("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792")),2:pm(()=>E7("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126"))};class $_{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return A7[e]?i=new dv(A7[e](),e):i=$_.createFromSampleData($_.createSampleData(t).data,e),this.lastFontFamily=t,this.lastCreated=i,i}static createSampleData(e){const t=document.createElement("canvas"),i=t.getContext("2d");t.style.height="16px",t.height=16,t.width=96*10,t.style.width=96*10+"px",i.fillStyle="#ffffff",i.font=`bold 16px ${e}`,i.textBaseline="middle";let s=0;for(const o of Nwe)i.fillText(String.fromCharCode(o),s,16/2),s+=10;return i.getImageData(0,0,96*10,16)}static createFromSampleData(e,t){if(e.length!==61440)throw new Error("Unexpected source in MinimapCharRenderer");const s=$_._downsample(e,t);return new dv(s,t)}static _downsampleChar(e,t,i,s,o){const r=1*o,a=2*o;let l=s,c=0;for(let d=0;d0){const c=255/l;for(let d=0;d$_.create(this.fontScale,l.fontFamily)),this.defaultBackgroundColor=i.getColor(2),this.backgroundColor=uv._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=uv._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const i=e.getColor(b1e);return i?new Fo(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(v1e);return t?Fo._clamp(Math.round(255*t.rgba.a)):255}equals(e){return this.renderMinimap===e.renderMinimap&&this.size===e.size&&this.minimapHeightIsEditorHeight===e.minimapHeightIsEditorHeight&&this.scrollBeyondLastLine===e.scrollBeyondLastLine&&this.paddingTop===e.paddingTop&&this.paddingBottom===e.paddingBottom&&this.showSlider===e.showSlider&&this.autohide===e.autohide&&this.pixelRatio===e.pixelRatio&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.lineHeight===e.lineHeight&&this.minimapLeft===e.minimapLeft&&this.minimapWidth===e.minimapWidth&&this.minimapHeight===e.minimapHeight&&this.canvasInnerWidth===e.canvasInnerWidth&&this.canvasInnerHeight===e.canvasInnerHeight&&this.canvasOuterWidth===e.canvasOuterWidth&&this.canvasOuterHeight===e.canvasOuterHeight&&this.isSampling===e.isSampling&&this.editorHeight===e.editorHeight&&this.fontScale===e.fontScale&&this.minimapLineHeight===e.minimapLineHeight&&this.minimapCharWidth===e.minimapCharWidth&&this.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}}class U_{constructor(e,t,i,s,o,r,a,l,c){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=s,this.sliderTop=o,this.sliderHeight=r,this.topPaddingLineCount=a,this.startLineNumber=l,this.endLineNumber=c}getDesiredScrollTopFromDelta(e){return Math.round(this.scrollTop+e/this._computedSliderRatio)}getDesiredScrollTopFromTouchLocation(e){return Math.round((e-this.sliderHeight/2)/this._computedSliderRatio)}intersectWithViewport(e){const t=Math.max(this.startLineNumber,e.startLineNumber),i=Math.min(this.endLineNumber,e.endLineNumber);return t>i?null:[t,i]}getYForLineNumber(e,t){return+(e-this.startLineNumber+this.topPaddingLineCount)*t}static create(e,t,i,s,o,r,a,l,c,d,u){const h=e.pixelRatio,f=e.minimapLineHeight,g=Math.floor(e.canvasInnerHeight/f),p=e.lineHeight;if(e.minimapHeightIsEditorHeight){let L=l*e.lineHeight+e.paddingTop+e.paddingBottom;e.scrollBeyondLastLine&&(L+=Math.max(0,o-e.lineHeight-e.paddingBottom));const x=Math.max(1,Math.floor(o*o/L)),D=Math.max(0,e.minimapHeight-x),k=D/(d-o),P=c*k,O=D>0,M=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),R=Math.floor(e.paddingTop/e.lineHeight);return new U_(c,d,O,k,P,x,R,1,Math.min(a,M))}let _;if(r&&i!==a){const L=i-t+1;_=Math.floor(L*f/h)}else{const L=o/p;_=Math.floor(L*f/h)}const v=Math.floor(e.paddingTop/p);let b=Math.floor(e.paddingBottom/p);if(e.scrollBeyondLastLine){const L=o/p;b=Math.max(b,L-1)}let y;if(b>0){const L=o/p;y=(v+a+b-L-1)*f/h}else y=Math.max(0,(v+a)*f/h-_);y=Math.min(e.minimapHeight-_,y);const w=y/(d-o),S=c*w;if(g>=v+a+b){const L=y>0;return new U_(c,d,L,w,S,_,v,1,a)}else{let L;t>1?L=t+v:L=Math.max(1,c/p);let x,D=Math.max(1,Math.floor(L-S*h/f));Dc&&(D=Math.min(D,u.startLineNumber),x=Math.max(x,u.topPaddingLineCount)),u.scrollTop=e.paddingTop?O=(t-D+x+P)*f/h:O=c/e.paddingTop*(x+P)*f/h,new U_(c,d,!0,w,O,_,x,D,k)}}}class $S{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}}$S.INVALID=new $S(-1);class I7{constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLines=new yq(()=>$S.INVALID),this._renderedLines._set(e.startLineNumber,i)}linesEquals(e){if(!this.scrollEquals(e))return!1;const i=this._renderedLines._get().lines;for(let s=0,o=i.length;s1){for(let v=0,b=s-1;v0&&this.minimapLines[i-1]>=e;)i--;let s=this.modelLineToMinimapLine(t)-1;for(;s+1t)return null}return[i+1,s+1]}decorationLineRangeToMinimapLineRange(e,t){let i=this.modelLineToMinimapLine(e),s=this.modelLineToMinimapLine(t);return e!==t&&s===i&&(s===this.minimapLines.length?i>1&&i--:s++),[i,s]}onLinesDeleted(e){const t=e.toLineNumber-e.fromLineNumber+1;let i=this.minimapLines.length,s=0;for(let o=this.minimapLines.length-1;o>=0&&!(this.minimapLines[o]=0&&!(this.minimapLines[i]0,scrollWidth:e.scrollWidth,scrollHeight:e.scrollHeight,viewportStartLineNumber:t,viewportEndLineNumber:i,viewportStartLineNumberVerticalOffset:e.getVerticalOffsetForLineNumber(t),scrollTop:e.scrollTop,scrollLeft:e.scrollLeft,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight};this._actual.render(s)}_recreateLineSampling(){this._minimapSelections=null;const e=!!this._samplingState,[t,i]=hv.compute(this.options,this._context.viewModel.getLineCount(),this._samplingState);if(this._samplingState=t,e&&this._samplingState)for(const s of i)switch(s.type){case"deleted":this._actual.onLinesDeleted(s.deleteFromLineNumber,s.deleteToLineNumber);break;case"inserted":this._actual.onLinesInserted(s.insertFromLineNumber,s.insertToLineNumber);break;case"flush":this._actual.onFlushed();break}}getLineCount(){return this._samplingState?this._samplingState.minimapLines.length:this._context.viewModel.getLineCount()}getRealLineCount(){return this._context.viewModel.getLineCount()}getLineContent(e){return this._samplingState?this._context.viewModel.getLineContent(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineContent(e)}getLineMaxColumn(e){return this._samplingState?this._context.viewModel.getLineMaxColumn(this._samplingState.minimapLines[e-1]):this._context.viewModel.getLineMaxColumn(e)}getMinimapLinesRenderingData(e,t,i){if(this._samplingState){const s=[];for(let o=0,r=t-e+1;o{if(i.preventDefault(),this._model.options.renderMinimap===0||!this._lastRenderData)return;if(this._model.options.size!=="proportional"){if(i.button===0&&this._lastRenderData){const c=Tn(this._slider.domNode),d=c.top+c.height/2;this._startSliderDragging(i,d,this._lastRenderData.renderedLayout)}return}const o=this._model.options.minimapLineHeight,r=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*i.offsetY;let l=Math.floor(r/o)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;l=Math.min(l,this._model.getLineCount()),this._model.revealLineNumber(l)}),this._sliderPointerMoveMonitor=new lD,this._sliderPointerDownListener=Ui(this._slider.domNode,de.POINTER_DOWN,i=>{i.preventDefault(),i.stopPropagation(),i.button===0&&this._lastRenderData&&this._startSliderDragging(i,i.pageY,this._lastRenderData.renderedLayout)}),this._gestureDisposable=Rt.addTarget(this._domNode.domNode),this._sliderTouchStartListener=K(this._domNode.domNode,Pt.Start,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(i))},{passive:!1}),this._sliderTouchMoveListener=K(this._domNode.domNode,Pt.Change,i=>{i.preventDefault(),i.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(i)},{passive:!1}),this._sliderTouchEndListener=Ui(this._domNode.domNode,Pt.End,i=>{i.preventDefault(),i.stopPropagation(),this._gestureInProgress=!1,this._slider.toggleClassName("active",!1)})}_startSliderDragging(e,t,i){if(!e.target||!(e.target instanceof Element))return;const s=e.pageX;this._slider.toggleClassName("active",!0);const o=(r,a)=>{const l=Tn(this._domNode.domNode),c=Math.min(Math.abs(a-s),Math.abs(a-l.left),Math.abs(a-l.left-l.width));if(Ps&&c>Mwe){this._model.setScrollTop(i.scrollTop);return}const d=r-t;this._model.setScrollTop(i.getDesiredScrollTopFromDelta(d))};e.pageY!==t&&o(e.pageY,s),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>o(r.pageY,r.pageX),()=>{this._slider.toggleClassName("active",!1)})}scrollDueToTouchEvent(e){const t=this._domNode.domNode.getBoundingClientRect().top,i=this._lastRenderData.renderedLayout.getDesiredScrollTopFromTouchLocation(e.pageY-t);this._model.setScrollTop(i)}dispose(){this._pointerDownListener.dispose(),this._sliderPointerMoveMonitor.dispose(),this._sliderPointerDownListener.dispose(),this._gestureDisposable.dispose(),this._sliderTouchStartListener.dispose(),this._sliderTouchMoveListener.dispose(),this._sliderTouchEndListener.dispose(),super.dispose()}_getMinimapDomNodeClassName(){const e=["minimap"];return this._model.options.showSlider==="always"?e.push("slider-always"):e.push("slider-mouseover"),this._model.options.autohide&&e.push("autohide"),e.join(" ")}getDomNode(){return this._domNode}_applyLayout(){this._domNode.setLeft(this._model.options.minimapLeft),this._domNode.setWidth(this._model.options.minimapWidth),this._domNode.setHeight(this._model.options.minimapHeight),this._shadow.setHeight(this._model.options.minimapHeight),this._canvas.setWidth(this._model.options.canvasOuterWidth),this._canvas.setHeight(this._model.options.canvasOuterHeight),this._canvas.domNode.width=this._model.options.canvasInnerWidth,this._canvas.domNode.height=this._model.options.canvasInnerHeight,this._decorationsCanvas.setWidth(this._model.options.canvasOuterWidth),this._decorationsCanvas.setHeight(this._model.options.canvasOuterHeight),this._decorationsCanvas.domNode.width=this._model.options.canvasInnerWidth,this._decorationsCanvas.domNode.height=this._model.options.canvasInnerHeight,this._slider.setWidth(this._model.options.minimapWidth)}_getBuffer(){return this._buffers||this._model.options.canvasInnerWidth>0&&this._model.options.canvasInnerHeight>0&&(this._buffers=new x3(this._canvas.domNode.getContext("2d"),this._model.options.canvasInnerWidth,this._model.options.canvasInnerHeight,this._model.options.backgroundColor)),this._buffers?this._buffers.getBuffer():null}onDidChangeOptions(){this._lastRenderData=null,this._buffers=null,this._applyLayout(),this._domNode.setClassName(this._getMinimapDomNodeClassName())}onSelectionChanged(){return this._renderDecorations=!0,!0}onDecorationsChanged(){return this._renderDecorations=!0,!0}onFlushed(){return this._lastRenderData=null,!0}onLinesChanged(e,t){return this._lastRenderData?this._lastRenderData.onLinesChanged(e,t):!1}onLinesDeleted(e,t){var i;return(i=this._lastRenderData)===null||i===void 0||i.onLinesDeleted(e,t),!0}onLinesInserted(e,t){var i;return(i=this._lastRenderData)===null||i===void 0||i.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(u7),this._renderDecorations=!0,!0}onTokensChanged(e){return this._lastRenderData?this._lastRenderData.onTokensChanged(e):!1}onTokensColorsChanged(){return this._lastRenderData=null,this._buffers=null,!0}onZonesChanged(){return this._lastRenderData=null,!0}render(e){if(this._model.options.renderMinimap===0){this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),this._sliderHorizontal.setHeight(0);return}e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");const i=U_.create(this._model.options,e.viewportStartLineNumber,e.viewportEndLineNumber,e.viewportStartLineNumberVerticalOffset,e.viewportHeight,e.viewportContainsWhitespaceGaps,this._model.getLineCount(),this._model.getRealLineCount(),e.scrollTop,e.scrollHeight,this._lastRenderData?this._lastRenderData.renderedLayout:null);this._slider.setDisplay(i.sliderNeeded?"block":"none"),this._slider.setTop(i.sliderTop),this._slider.setHeight(i.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(i.sliderHeight),this.renderDecorations(i),this._lastRenderData=this.renderLines(i)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;const t=this._model.getSelections();t.sort(N.compareRangesUsingStarts);const i=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);i.sort((h,f)=>(h.options.zIndex||0)-(f.options.zIndex||0));const{canvasInnerWidth:s,canvasInnerHeight:o}=this._model.options,r=this._model.options.minimapLineHeight,a=this._model.options.minimapCharWidth,l=this._model.getOptions().tabSize,c=this._decorationsCanvas.domNode.getContext("2d");c.clearRect(0,0,s,o);const d=new T7(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(c,t,d,e,r),this._renderDecorationsLineHighlights(c,i,d,e,r);const u=new T7(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(c,t,u,e,r,l,a,s),this._renderDecorationsHighlights(c,i,u,e,r,l,a,s)}}_renderSelectionLineHighlights(e,t,i,s,o){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let r=0,a=0;for(const l of t){const c=s.intersectWithViewport(l);if(!c)continue;const[d,u]=c;for(let g=d;g<=u;g++)i.set(g,!0);const h=s.getYForLineNumber(d,o),f=s.getYForLineNumber(u,o);a>=h||(a>r&&e.fillRect(Wc,r,e.canvas.width,a-r),r=h),a=f}a>r&&e.fillRect(Wc,r,e.canvas.width,a-r)}_renderDecorationsLineHighlights(e,t,i,s,o){const r=new Map;for(let a=t.length-1;a>=0;a--){const l=t[a],c=l.options.minimap;if(!c||c.position!==Zs.Inline)continue;const d=s.intersectWithViewport(l.range);if(!d)continue;const[u,h]=d,f=c.getColor(this._theme.value);if(!f||f.isTransparent())continue;let g=r.get(f.toString());g||(g=f.transparent(.5).toString(),r.set(f.toString(),g)),e.fillStyle=g;for(let p=u;p<=h;p++){if(i.has(p))continue;i.set(p,!0);const _=s.getYForLineNumber(u,o);e.fillRect(Wc,_,e.canvas.width,o)}}}_renderSelectionsHighlights(e,t,i,s,o,r,a,l){if(!(!this._selectionColor||this._selectionColor.isTransparent()))for(const c of t){const d=s.intersectWithViewport(c);if(!d)continue;const[u,h]=d;for(let f=u;f<=h;f++)this.renderDecorationOnLine(e,i,c,this._selectionColor,s,f,o,o,r,a,l)}}_renderDecorationsHighlights(e,t,i,s,o,r,a,l){for(const c of t){const d=c.options.minimap;if(!d)continue;const u=s.intersectWithViewport(c.range);if(!u)continue;const[h,f]=u,g=d.getColor(this._theme.value);if(!(!g||g.isTransparent()))for(let p=h;p<=f;p++)switch(d.position){case Zs.Inline:this.renderDecorationOnLine(e,i,c.range,g,s,p,o,o,r,a,l);continue;case Zs.Gutter:{const _=s.getYForLineNumber(p,o);this.renderDecoration(e,g,2,_,Pwe,o);continue}}}}renderDecorationOnLine(e,t,i,s,o,r,a,l,c,d,u){const h=o.getYForLineNumber(r,l);if(h+a<0||h>this._model.options.canvasInnerHeight)return;const{startLineNumber:f,endLineNumber:g}=i,p=f===r?i.startColumn:1,_=g===r?i.endColumn:this._model.getLineMaxColumn(r),v=this.getXOffsetForPosition(t,r,p,c,d,u),b=this.getXOffsetForPosition(t,r,_,c,d,u);this.renderDecoration(e,s,v,h,b-v,a)}getXOffsetForPosition(e,t,i,s,o,r){if(i===1)return Wc;if((i-1)*o>=r)return r;let l=e.get(t);if(!l){const c=this._model.getLineContent(t);l=[Wc];let d=Wc;for(let u=1;u=r){l[u]=r;break}l[u]=g,d=g}e.set(t,l)}return i-1S?Math.floor((s-S)/2):0,x=h.a/255,D=new Fo(Math.round((h.r-u.r)*x+u.r),Math.round((h.g-u.g)*x+u.g),Math.round((h.b-u.b)*x+u.b),255);let k=e.topPaddingLineCount*s;const P=[];for(let G=0,te=i-t+1;G=0&&Ob)return;const M=_.charCodeAt(S);if(M===9){const R=h-(S+L)%h;L+=R-1,w+=R*r}else if(M===32)w+=r;else{const R=tu(M)?2:1;for(let z=0;zb)return}}}}}class T7{constructor(e,t,i){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=i,this._values=[];for(let s=0,o=this._endLineNumber-this._startLineNumber+1;sthis._endLineNumber||(this._values[e-this._startLineNumber]=t)}get(e){return ethis._endLineNumber?this._defaultValue:this._values[e-this._startLineNumber]}}class Fwe extends oo{constructor(e){super(e);const i=this._context.configuration.options.get(143);this._widgets={},this._verticalScrollbarWidth=i.verticalScrollbarWidth,this._minimapWidth=i.minimap.minimapWidth,this._horizontalScrollbarHeight=i.horizontalScrollbarHeight,this._editorHeight=i.height,this._editorWidth=i.width,this._domNode=bt(document.createElement("div")),sl.write(this._domNode,4),this._domNode.setClassName("overlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const i=this._context.configuration.options.get(143);return this._verticalScrollbarWidth=i.verticalScrollbarWidth,this._minimapWidth=i.minimap.minimapWidth,this._horizontalScrollbarHeight=i.horizontalScrollbarHeight,this._editorHeight=i.height,this._editorWidth=i.width,!0}addWidget(e){const t=bt(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),this._domNode.appendChild(t),this.setShouldRender(),this._updateMaxMinWidth()}setWidgetPosition(e,t){const i=this._widgets[e.getId()];return i.preference===t?(this._updateMaxMinWidth(),!1):(i.preference=t,this.setShouldRender(),this._updateMaxMinWidth(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const s=this._widgets[t].domNode.domNode;delete this._widgets[t],s.parentNode.removeChild(s),this.setShouldRender(),this._updateMaxMinWidth()}}_updateMaxMinWidth(){var e,t;let i=0;const s=Object.keys(this._widgets);for(let o=0,r=s.length;o=3){const o=Math.floor(s/3),r=Math.floor(s/3),a=s-o-r,l=e,c=l+o,d=l+o+a;return[[0,l,c,l,d,l,c,l],[0,o,a,o+a,r,o+a+r,a+r,o+a+r]]}else if(i===2){const o=Math.floor(s/2),r=s-o,a=e,l=a+o;return[[0,a,a,a,l,a,a,a],[0,o,o,o,r,o+r,o+r,o+r]]}else{const o=e,r=s;return[[0,o,o,o,o,o,o,o],[0,r,r,r,r,r,r,r]]}}equals(e){return this.lineHeight===e.lineHeight&&this.pixelRatio===e.pixelRatio&&this.overviewRulerLanes===e.overviewRulerLanes&&this.renderBorder===e.renderBorder&&this.borderColor===e.borderColor&&this.hideCursor===e.hideCursor&&this.cursorColor===e.cursorColor&&this.themeType===e.themeType&&H.equals(this.backgroundColor,e.backgroundColor)&&this.top===e.top&&this.right===e.right&&this.domWidth===e.domWidth&&this.domHeight===e.domHeight&&this.canvasWidth===e.canvasWidth&&this.canvasHeight===e.canvasHeight}}class Wwe extends oo{constructor(e){super(e),this._actualShouldRender=0,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=bt(document.createElement("canvas")),this._domNode.setClassName("decorationsOverviewRuler"),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._domNode.setAttribute("aria-hidden","true"),this._updateSettings(!1),this._tokensColorTrackerListener=Si.onDidChange(t=>{t.changedColorMap&&this._updateSettings(!0)}),this._cursorPositions=[]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new Bwe(this._context.configuration,this._context.theme);return this._settings&&this._settings.equals(t)?!1:(this._settings=t,this._domNode.setTop(this._settings.top),this._domNode.setRight(this._settings.right),this._domNode.setWidth(this._settings.domWidth),this._domNode.setHeight(this._settings.domHeight),this._domNode.domNode.width=this._settings.canvasWidth,this._domNode.domNode.height=this._settings.canvasHeight,e&&this._render(),!0)}_markRenderingIsNeeded(){return this._actualShouldRender=2,!0}_markRenderingIsMaybeNeeded(){return this._actualShouldRender=1,!0}onConfigurationChanged(e){return this._updateSettings(!1)?this._markRenderingIsNeeded():!1}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,i=e.selections.length;tg.lineNumber===p.lineNumber)&&(this._actualShouldRender=2),this._actualShouldRender===1)return;this._renderedDecorations=t,this._renderedCursorPositions=this._cursorPositions,this._domNode.setDisplay("block");const i=this._settings.canvasWidth,s=this._settings.canvasHeight,o=this._settings.lineHeight,r=this._context.viewLayout,a=this._context.viewLayout.getScrollHeight(),l=s/a,c=6*this._settings.pixelRatio|0,d=c/2|0,u=this._domNode.domNode.getContext("2d");e?e.isOpaque()?(u.fillStyle=H.Format.CSS.formatHexA(e),u.fillRect(0,0,i,s)):(u.clearRect(0,0,i,s),u.fillStyle=H.Format.CSS.formatHexA(e),u.fillRect(0,0,i,s)):u.clearRect(0,0,i,s);const h=this._settings.x,f=this._settings.w;for(const g of t){const p=g.color,_=g.data;u.fillStyle=p;let v=0,b=0,y=0;for(let w=0,S=_.length/3;ws&&(M=s-d),k=M-d,P=M+d}k>y+1||L!==v?(w!==0&&u.fillRect(h[v],b,f[v],y-b),v=L,b=k,y=P):P>y&&(y=P)}u.fillRect(h[v],b,f[v],y-b)}if(!this._settings.hideCursor&&this._settings.cursorColor){const g=2*this._settings.pixelRatio|0,p=g/2|0,_=this._settings.x[7],v=this._settings.w[7];u.fillStyle=this._settings.cursorColor;let b=-100,y=-100;for(let w=0,S=this._cursorPositions.length;ws&&(x=s-p);const D=x-p,k=D+g;D>y+1?(w!==0&&u.fillRect(_,b,v,y-b),b=D,y=k):k>y&&(y=k)}u.fillRect(_,b,v,y-b)}this._settings.renderBorder&&this._settings.borderColor&&this._settings.overviewRulerLanes>0&&(u.beginPath(),u.lineWidth=1,u.strokeStyle=this._settings.borderColor,u.moveTo(0,0),u.lineTo(0,s),u.stroke(),u.moveTo(0,0),u.lineTo(i,0),u.stroke())}}class N7{constructor(e,t,i){this._colorZoneBrand=void 0,this.from=e|0,this.to=t|0,this.colorId=i|0}static compare(e,t){return e.colorId===t.colorId?e.from===t.from?e.to-t.to:e.from-t.from:e.colorId-t.colorId}}class kq{constructor(e,t,i,s){this._overviewRulerZoneBrand=void 0,this.startLineNumber=e,this.endLineNumber=t,this.heightInLines=i,this.color=s,this._colorZone=null}static compare(e,t){return e.color===t.color?e.startLineNumber===t.startLineNumber?e.heightInLines===t.heightInLines?e.endLineNumber-t.endLineNumber:e.heightInLines-t.heightInLines:e.startLineNumber-t.startLineNumber:e.colori&&(p=i-_);const v=d.color;let b=this._color2Id[v];b||(b=++this._lastAssignedId,this._color2Id[v]=b,this._id2Color[b]=v);const y=new N7(p-_,p+_,b);d.setColorZone(y),a.push(y)}return this._colorZonesInvalid=!1,a.sort(N7.compare),a}}class zwe extends J1{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=bt(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new Vwe(s=>this._context.viewLayout.getVerticalOffsetForLineNumber(s)),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(i.get(66)),this._zoneManager.setPixelRatio(i.get(141)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(66)&&(this._zoneManager.setLineHeight(t.get(66)),this._render()),e.hasChanged(141)&&(this._zoneManager.setPixelRatio(t.get(141)),this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render()),!0}onFlushed(e){return this._render(),!0}onScrollChanged(e){return e.scrollHeightChanged&&(this._zoneManager.setOuterHeight(e.scrollHeight),this._render()),!0}onZonesChanged(e){return this._render(),!0}getDomNode(){return this._domNode.domNode}setLayout(e){this._domNode.setTop(e.top),this._domNode.setRight(e.right);let t=!1;t=this._zoneManager.setDOMWidth(e.width)||t,t=this._zoneManager.setDOMHeight(e.height)||t,t&&(this._domNode.setWidth(this._zoneManager.getDOMWidth()),this._domNode.setHeight(this._zoneManager.getDOMHeight()),this._domNode.domNode.width=this._zoneManager.getCanvasWidth(),this._domNode.domNode.height=this._zoneManager.getCanvasHeight(),this._render())}setZones(e){this._zoneManager.setZones(e),this._render()}_render(){if(this._zoneManager.getOuterHeight()===0)return!1;const e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),i=this._zoneManager.resolveColorZones(),s=this._zoneManager.getId2Color(),o=this._domNode.domNode.getContext("2d");return o.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(o,i,s,e),!0}_renderOneLane(e,t,i,s){let o=0,r=0,a=0;for(const l of t){const c=l.colorId,d=l.from,u=l.to;c!==o?(e.fillRect(0,r,s,a-r),o=c,e.fillStyle=i[o],r=d,a=u):a>=d?a=Math.max(a,u):(e.fillRect(0,r,s,a-r),r=d,a=u)}e.fillRect(0,r,s,a-r)}}class Hwe extends oo{constructor(e){super(e),this.domNode=bt(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.domNode.setClassName("view-rulers"),this._renderedRulers=[];const t=this._context.configuration.options;this._rulers=t.get(101),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(101),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,!0}onScrollChanged(e){return e.scrollHeightChanged}prepareRender(e){}_ensureRulersCount(){const e=this._renderedRulers.length,t=this._rulers.length;if(e===t)return;if(e0;){const a=bt(document.createElement("div"));a.setClassName("view-ruler"),a.setWidth(o),this.domNode.appendChild(a),this._renderedRulers.push(a),r--}return}let i=e-t;for(;i>0;){const s=this._renderedRulers.pop();this.domNode.removeChild(s),i--}}render(e){this._ensureRulersCount();for(let t=0,i=this._rulers.length;t0;return this._shouldShow!==e?(this._shouldShow=e,!0):!1}getDomNode(){return this._domNode}_updateWidth(){const t=this._context.configuration.options.get(143);t.minimap.renderMinimap===0||t.minimap.minimapWidth>0&&t.minimap.minimapLeft===0?this._width=t.width:this._width=t.width-t.verticalScrollbarWidth}onConfigurationChanged(e){const i=this._context.configuration.options.get(102);return this._useShadows=i.useShadows,this._updateWidth(),this._updateShouldShow(),!0}onScrollChanged(e){return this._scrollTop=e.scrollTop,this._updateShouldShow()}prepareRender(e){}render(e){this._domNode.setWidth(this._width),this._domNode.setClassName(this._shouldShow?"scroll-decoration":"")}}class Uwe{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class jwe{constructor(e,t){this.lineNumber=e,this.ranges=t}}function qwe(n){return new Uwe(n)}function Gwe(n){return new jwe(n.lineNumber,n.ranges.map(qwe))}class pi extends Xf{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(66),this._roundedSelection=t.get(100),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,this._selections=[],this._renderResult=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),this._renderResult=null,super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._lineHeight=t.get(66),this._roundedSelection=t.get(100),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth,!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLinesChanged(e){return!0}onLinesDeleted(e){return!0}onLinesInserted(e){return!0}onScrollChanged(e){return e.scrollTopChanged}onZonesChanged(e){return!0}_visibleRangesHaveGaps(e){for(let t=0,i=e.length;t1)return!0;return!1}_enrichVisibleRangesWithStyle(e,t,i){const s=this._typicalHalfwidthCharacterWidth/4;let o=null,r=null;if(i&&i.length>0&&t.length>0){const a=t[0].lineNumber;if(a===e.startLineNumber)for(let c=0;!o&&c=0;c--)i[c].lineNumber===l&&(r=i[c].ranges[0]);o&&!o.startStyle&&(o=null),r&&!r.startStyle&&(r=null)}for(let a=0,l=t.length;a0){const g=t[a-1].ranges[0].left,p=t[a-1].ranges[0].left+t[a-1].ranges[0].width;ew(d-g)g&&(h.top=1),ew(u-p)'}_actualRenderOneSelection(e,t,i,s){if(s.length===0)return;const o=!!s[0].ranges[0].startStyle,r=this._lineHeight.toString(),a=(this._lineHeight-1).toString(),l=s[0].lineNumber,c=s[s.length-1].lineNumber;for(let d=0,u=s.length;d1,c)}this._previousFrameVisibleRangesWithStyle=o,this._renderResult=t.map(([r,a])=>r+a)}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}pi.SELECTION_CLASS_NAME="selected-text";pi.SELECTION_TOP_LEFT="top-left-radius";pi.SELECTION_BOTTOM_LEFT="bottom-left-radius";pi.SELECTION_TOP_RIGHT="top-right-radius";pi.SELECTION_BOTTOM_RIGHT="bottom-right-radius";pi.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background";pi.ROUNDED_PIECE_WIDTH=10;Tr((n,e)=>{const t=n.getColor(Ave);t&&!t.isTransparent()&&e.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${t}; }`)});function ew(n){return n<0?-n:n}class R7{constructor(e,t,i,s,o,r,a){this.top=e,this.left=t,this.paddingLeft=i,this.width=s,this.height=o,this.textContent=r,this.textContentClassName=a}}class M7{constructor(e){this._context=e;const t=this._context.configuration.options,i=t.get(50);this._cursorStyle=t.get(28),this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=bt(document.createElement("div")),this._domNode.setClassName(`cursor ${Sp}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),Nn(this._domNode,i),this._domNode.setDisplay("none"),this._position=new V(1,1),this._lastRenderedContent="",this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}show(){this._isVisible||(this._domNode.setVisibility("inherit"),this._isVisible=!0)}hide(){this._isVisible&&(this._domNode.setVisibility("hidden"),this._isVisible=!1)}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(50);return this._cursorStyle=t.get(28),this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),Nn(this._domNode,i),!0}onCursorPositionChanged(e,t){return t?this._domNode.domNode.style.transitionProperty="none":this._domNode.domNode.style.transitionProperty="",this._position=e,!0}_getGraphemeAwarePosition(){const{lineNumber:e,column:t}=this._position,i=this._context.viewModel.getLineContent(e),[s,o]=rpe(i,t-1);return[new V(e,s+1),i.substring(s,o)]}_prepareRender(e){let t="",i="";const[s,o]=this._getGraphemeAwarePosition();if(this._cursorStyle===fn.Line||this._cursorStyle===fn.LineThin){const h=e.visibleRangeForPosition(s);if(!h||h.outsideRenderedLine)return null;let f;this._cursorStyle===fn.Line?(f=c9(this._lineCursorWidth>0?this._lineCursorWidth:2),f>2&&(t=o,i=this._getTokenClassName(s))):f=c9(1);let g=h.left,p=0;f>=2&&g>=1&&(p=1,g-=p);const _=e.getVerticalOffsetForLineNumber(s.lineNumber)-e.bigNumbersDelta;return new R7(_,g,p,f,this._lineHeight,t,i)}const r=e.linesVisibleRangesForRange(new N(s.lineNumber,s.column,s.lineNumber,s.column+o.length),!1);if(!r||r.length===0)return null;const a=r[0];if(a.outsideRenderedLine||a.ranges.length===0)return null;const l=a.ranges[0],c=o===" "?this._typicalHalfwidthCharacterWidth:l.width<1?this._typicalHalfwidthCharacterWidth:l.width;this._cursorStyle===fn.Block&&(t=o,i=this._getTokenClassName(s));let d=e.getVerticalOffsetForLineNumber(s.lineNumber)-e.bigNumbersDelta,u=this._lineHeight;return(this._cursorStyle===fn.Underline||this._cursorStyle===fn.UnderlineThin)&&(d+=this._lineHeight-2,u=2),new R7(d,l.left,0,c,u,t,i)}_getTokenClassName(e){const t=this._context.viewModel.getViewLineData(e.lineNumber),i=t.tokens.findTokenIndexAtOffset(e.column-1);return t.tokens.getClassName(i)}prepareRender(e){this._renderData=this._prepareRender(e)}render(e){return this._renderData?(this._lastRenderedContent!==this._renderData.textContent&&(this._lastRenderedContent=this._renderData.textContent,this._domNode.domNode.textContent=this._lastRenderedContent),this._domNode.setClassName(`cursor ${Sp} ${this._renderData.textContentClassName}`),this._domNode.setDisplay("block"),this._domNode.setTop(this._renderData.top),this._domNode.setLeft(this._renderData.left),this._domNode.setPaddingLeft(this._renderData.paddingLeft),this._domNode.setWidth(this._renderData.width),this._domNode.setLineHeight(this._renderData.height),this._domNode.setHeight(this._renderData.height),{domNode:this._domNode.domNode,position:this._position,contentLeft:this._renderData.left,height:this._renderData.height,width:2}):(this._domNode.setDisplay("none"),null)}}class fv extends oo{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(90),this._cursorBlinking=t.get(26),this._cursorStyle=t.get(28),this._cursorSmoothCaretAnimation=t.get(27),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new M7(this._context),this._secondaryCursors=[],this._renderData=[],this._domNode=bt(document.createElement("div")),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._updateDomClassName(),this._domNode.appendChild(this._primaryCursor.getDomNode()),this._startCursorBlinkAnimation=new Lc,this._cursorFlatBlinkInterval=new Y1,this._blinkingEnabled=!1,this._editorHasFocus=!1,this._updateBlinking()}dispose(){super.dispose(),this._startCursorBlinkAnimation.dispose(),this._cursorFlatBlinkInterval.dispose()}getDomNode(){return this._domNode}onCompositionStart(e){return this._isComposingInput=!0,this._updateBlinking(),!0}onCompositionEnd(e){return this._isComposingInput=!1,this._updateBlinking(),!0}onConfigurationChanged(e){const t=this._context.configuration.options;this._readOnly=t.get(90),this._cursorBlinking=t.get(26),this._cursorStyle=t.get(28),this._cursorSmoothCaretAnimation=t.get(27),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let i=0,s=this._secondaryCursors.length;it.length){const o=this._secondaryCursors.length-t.length;for(let r=0;r{for(let s=0,o=e.ranges.length;s{this._isVisible?this._hide():this._show()},fv.BLINK_INTERVAL):this._startCursorBlinkAnimation.setIfNotSet(()=>{this._blinkingEnabled=!0,this._updateDomClassName()},fv.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case fn.Line:e+=" cursor-line-style";break;case fn.Block:e+=" cursor-block-style";break;case fn.Underline:e+=" cursor-underline-style";break;case fn.LineThin:e+=" cursor-line-thin-style";break;case fn.BlockOutline:e+=" cursor-block-outline-style";break;case fn.UnderlineThin:e+=" cursor-underline-thin-style";break;default:e+=" cursor-line-style"}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case 1:e+=" cursor-blink";break;case 2:e+=" cursor-smooth";break;case 3:e+=" cursor-phase";break;case 4:e+=" cursor-expand";break;case 5:e+=" cursor-solid";break;default:e+=" cursor-solid"}else e+=" cursor-solid";return(this._cursorSmoothCaretAnimation==="on"||this._cursorSmoothCaretAnimation==="explicit")&&(e+=" cursor-smooth-caret-animation"),e}_show(){this._primaryCursor.show();for(let e=0,t=this._secondaryCursors.length;e{const t=n.getColor(dq);if(t){let i=n.getColor(dye);i||(i=t.opposite()),e.addRule(`.monaco-editor .cursors-layer .cursor { background-color: ${t}; border-color: ${t}; color: ${i}; }`),lc(n.type)&&e.addRule(`.monaco-editor .cursors-layer.has-selection .cursor { border-left: 1px solid ${i}; border-right: 1px solid ${i}; }`)}});const A2=()=>{throw new Error("Invalid change accessor")};class Kwe extends oo{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(143);this._lineHeight=t.get(66),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,this.domNode=bt(document.createElement("div")),this.domNode.setClassName("view-zones"),this.domNode.setPosition("absolute"),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this.marginDomNode=bt(document.createElement("div")),this.marginDomNode.setClassName("margin-view-zones"),this.marginDomNode.setPosition("absolute"),this.marginDomNode.setAttribute("role","presentation"),this.marginDomNode.setAttribute("aria-hidden","true"),this._zones={}}dispose(){super.dispose(),this._zones={}}_recomputeWhitespacesProps(){const e=this._context.viewLayout.getWhitespaces(),t=new Map;for(const s of e)t.set(s.id,s);let i=!1;return this._context.viewModel.changeWhitespace(s=>{const o=Object.keys(this._zones);for(let r=0,a=o.length;r{const s={addZone:o=>(t=!0,this._addZone(i,o)),removeZone:o=>{o&&(t=this._removeZone(i,o)||t)},layoutZone:o=>{o&&(t=this._layoutZone(i,o)||t)}};Ywe(e,s),s.addZone=A2,s.removeZone=A2,s.layoutZone=A2}),t}_addZone(e,t){const i=this._computeWhitespaceProps(t),o={whitespaceId:e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),delegate:t,isInHiddenArea:i.isInHiddenArea,isVisible:!1,domNode:bt(t.domNode),marginDomNode:t.marginDomNode?bt(t.marginDomNode):null};return this._safeCallOnComputedHeight(o.delegate,i.heightInPx),o.domNode.setPosition("absolute"),o.domNode.domNode.style.width="100%",o.domNode.setDisplay("none"),o.domNode.setAttribute("monaco-view-zone",o.whitespaceId),this.domNode.appendChild(o.domNode),o.marginDomNode&&(o.marginDomNode.setPosition("absolute"),o.marginDomNode.domNode.style.width="100%",o.marginDomNode.setDisplay("none"),o.marginDomNode.setAttribute("monaco-view-zone",o.whitespaceId),this.marginDomNode.appendChild(o.marginDomNode)),this._zones[o.whitespaceId]=o,this.setShouldRender(),o.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t];return delete this._zones[t],e.removeWhitespace(i.whitespaceId),i.domNode.removeAttribute("monaco-visible-view-zone"),i.domNode.removeAttribute("monaco-view-zone"),i.domNode.domNode.parentNode.removeChild(i.domNode.domNode),i.marginDomNode&&(i.marginDomNode.removeAttribute("monaco-visible-view-zone"),i.marginDomNode.removeAttribute("monaco-view-zone"),i.marginDomNode.domNode.parentNode.removeChild(i.marginDomNode.domNode)),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t],s=this._computeWhitespaceProps(i.delegate);return i.isInHiddenArea=s.isInHiddenArea,e.changeOneWhitespace(i.whitespaceId,s.afterViewLineNumber,s.heightInPx),this._safeCallOnComputedHeight(i.delegate,s.heightInPx),this.setShouldRender(),!0}return!1}shouldSuppressMouseDownOnViewZone(e){return this._zones.hasOwnProperty(e)?!!this._zones[e].delegate.suppressMouseDown:!1}_heightInPixels(e){return typeof e.heightInPx=="number"?e.heightInPx:typeof e.heightInLines=="number"?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){return typeof e.minWidthInPx=="number"?e.minWidthInPx:0}_safeCallOnComputedHeight(e,t){if(typeof e.onComputedHeight=="function")try{e.onComputedHeight(t)}catch(i){mt(i)}}_safeCallOnDomNodeTop(e,t){if(typeof e.onDomNodeTop=="function")try{e.onDomNodeTop(t)}catch(i){mt(i)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,i={};let s=!1;for(const r of t)this._zones[r.id].isInHiddenArea||(i[r.id]=r,s=!0);const o=Object.keys(this._zones);for(let r=0,a=o.length;ra)continue;const f=h.startLineNumber===a?h.startColumn:c.minColumn,g=h.endLineNumber===a?h.endColumn:c.maxColumn;f=P.endOffset&&(k++,P=i&&i[k]),R!==9&&R!==32||h&&!L&&M<=D)continue;if(u&&M>=x&&M<=D&&R===32){const G=M-1>=0?a.charCodeAt(M-1):0,te=M+1=0?a.charCodeAt(M-1):0;if(R===32&&G!==32&&G!==9)continue}if(i&&(!P||P.startOffset>M||P.endOffset<=M))continue;const z=e.visibleRangeForPosition(new V(t,M+1));z&&(r?(O=Math.max(O,z.left),R===9?S+=this._renderArrow(f,_,z.left):S+=``):R===9?S+=`
${w?"→":"→"}
`:S+=`
${String.fromCharCode(y)}
`)}return r?(O=Math.round(O+_),``+S+""):S}_renderArrow(e,t,i){const s=t/7,o=t,r=e/2,a=i,l={x:0,y:s/2},c={x:100/125*o,y:l.y},d={x:c.x-.2*c.x,y:c.y+.2*c.x},u={x:d.x+.1*c.x,y:d.y+.1*c.x},h={x:u.x+.35*c.x,y:u.y-.35*c.x},f={x:h.x,y:-h.y},g={x:u.x,y:-u.y},p={x:d.x,y:-d.y},_={x:c.x,y:-c.y},v={x:l.x,y:-l.y};return``}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class P7{constructor(e){const t=e.options,i=t.get(50),s=t.get(38);s==="off"?(this.renderWhitespace="none",this.renderWithSVG=!1):s==="svg"?(this.renderWhitespace=t.get(98),this.renderWithSVG=!0):(this.renderWhitespace=t.get(98),this.renderWithSVG=!1),this.spaceWidth=i.spaceWidth,this.middotWidth=i.middotWidth,this.wsmiddotWidth=i.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=i.canUseHalfwidthRightwardsArrow,this.lineHeight=t.get(66),this.stopRenderingLineAfter=t.get(116)}equals(e){return this.renderWhitespace===e.renderWhitespace&&this.renderWithSVG===e.renderWithSVG&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.lineHeight===e.lineHeight&&this.stopRenderingLineAfter===e.stopRenderingLineAfter}}var tCe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},iCe=function(n,e){return function(t,i){e(t,i,n)}};let OT=class extends J1{constructor(e,t,i,s,o,r,a){super(),this._instantiationService=a,this._shouldRecomputeGlyphMarginLanes=!1,this._selections=[new lt(1,1,1,1)],this._renderAnimationFrame=null;const l=new cwe(t,s,o,e);this._context=new Xwe(t,i,s),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=this._instantiationService.createInstance(NT,this._context,l,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=bt(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=bt(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=bt(document.createElement("div")),sl.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new bwe(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new _D(this._context,this._linesContent),this._viewZones=new Kwe(this._context),this._viewParts.push(this._viewZones);const c=new Wwe(this._context);this._viewParts.push(c);const d=new $we(this._context);this._viewParts.push(d);const u=new uwe(this._context);this._viewParts.push(u),u.addDynamicOverlay(new pwe(this._context)),u.addDynamicOverlay(new pi(this._context)),u.addDynamicOverlay(new ywe(this._context)),u.addDynamicOverlay(new _we(this._context)),u.addDynamicOverlay(new eCe(this._context));const h=new hwe(this._context);this._viewParts.push(h),h.addDynamicOverlay(new mwe(this._context)),h.addDynamicOverlay(new Twe(this._context)),h.addDynamicOverlay(new Iwe(this._context)),h.addDynamicOverlay(new ny(this._context)),this._glyphMarginWidgets=new Dwe(this._context),this._viewParts.push(this._glyphMarginWidgets);const f=new Sf(this._context);f.getDomNode().appendChild(this._viewZones.marginDomNode),f.getDomNode().appendChild(h.getDomNode()),f.getDomNode().appendChild(this._glyphMarginWidgets.domNode),this._viewParts.push(f),this._contentWidgets=new fwe(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new fv(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new Fwe(this._context),this._viewParts.push(this._overlayWidgets);const g=new Hwe(this._context);this._viewParts.push(g);const p=new Jwe(this._context);this._viewParts.push(p);const _=new Owe(this._context);if(this._viewParts.push(_),c){const v=this._scrollbar.getOverviewRulerLayoutInfo();v.parent.insertBefore(c.getDomNode(),v.insertBefore)}this._linesContent.appendChild(u.getDomNode()),this._linesContent.appendChild(g.domNode),this._linesContent.appendChild(this._viewZones.domNode),this._linesContent.appendChild(this._viewLines.getDomNode()),this._linesContent.appendChild(this._contentWidgets.domNode),this._linesContent.appendChild(this._viewCursors.getDomNode()),this._overflowGuardContainer.appendChild(f.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._overflowGuardContainer.appendChild(d.getDomNode()),this._overflowGuardContainer.appendChild(this._textAreaHandler.textArea),this._overflowGuardContainer.appendChild(this._textAreaHandler.textAreaCover),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(_.getDomNode()),this._overflowGuardContainer.appendChild(p.domNode),this.domNode.appendChild(this._overflowGuardContainer),r?r.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode):this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this._applyLayout(),this._pointerHandler=this._register(new aye(this._context,l,this._createPointerHandlerHelper()))}_flushAccumulatedAndRenderNow(){this._shouldRecomputeGlyphMarginLanes&&(this._shouldRecomputeGlyphMarginLanes=!1,this._context.configuration.setGlyphMarginDecorationLaneCount(this._computeGlyphMarginLaneCount())),_d.onRenderStart(),this._renderNow()}_computeGlyphMarginLaneCount(){const e=this._context.viewModel.model;let t=[];t=t.concat(e.getAllMarginDecorations().map(o=>{var r,a;const l=(a=(r=o.options.glyphMargin)===null||r===void 0?void 0:r.position)!==null&&a!==void 0?a:vp.Left;return{range:o.range,lane:l}})),t=t.concat(this._glyphMarginWidgets.getWidgets().map(o=>({range:e.validateRange(o.preference.range),lane:o.preference.lane}))),t.sort((o,r)=>N.compareRangesUsingStarts(o.range,r.range));let i=null,s=null;for(const o of t)if(o.lane===vp.Left&&(!i||N.compareRangesUsingEnds(i,o.range)<0)&&(i=o.range),o.lane===vp.Right&&(!s||N.compareRangesUsingEnds(s,o.range)<0)&&(s=o.range),i&&s){if(i.endLineNumber{this.focus()},dispatchTextAreaEvent:e=>{this._textAreaHandler.textArea.domNode.dispatchEvent(e)},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._textAreaHandler.getLastRenderData();return new B1e(e,t)},renderNow:()=>{this.render(!0,!1)},shouldSuppressMouseDownOnViewZone:e=>this._viewZones.shouldSuppressMouseDownOnViewZone(e),shouldSuppressMouseDownOnWidget:e=>this._contentWidgets.shouldSuppressMouseDownOnWidget(e),getPositionFromDOMInfo:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getPositionFromDOMInfo(e,t)),visibleRangeForPosition:(e,t)=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(new V(e,t))),getLineWidth:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getLineWidth(e))}}_createTextAreaHandlerHelper(){return{visibleRangeForPosition:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(e))}}_applyLayout(){const t=this._context.configuration.options.get(143);this.domNode.setWidth(t.width),this.domNode.setHeight(t.height),this._overflowGuardContainer.setWidth(t.width),this._overflowGuardContainer.setHeight(t.height),this._linesContent.setWidth(1e6),this._linesContent.setHeight(1e6)}_getEditorClassName(){const e=this._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(140)+" "+TT(this._context.theme.type)+e}handleEvents(e){super.handleEvents(e),this._scheduleRender()}onConfigurationChanged(e){return this.domNode.setClassName(this._getEditorClassName()),this._applyLayout(),!1}onCursorStateChanged(e){return this._selections=e.selections,!1}onDecorationsChanged(e){return e.affectsGlyphMargin&&(this._shouldRecomputeGlyphMarginLanes=!0),!1}onFocusChanged(e){return this.domNode.setClassName(this._getEditorClassName()),!1}onThemeChanged(e){return this._context.theme.update(e.theme),this.domNode.setClassName(this._getEditorClassName()),!1}dispose(){this._renderAnimationFrame!==null&&(this._renderAnimationFrame.dispose(),this._renderAnimationFrame=null),this._contentWidgets.overflowingContentWidgetsDomNode.domNode.remove(),this._context.removeEventHandler(this),this._viewLines.dispose();for(const e of this._viewParts)e.dispose();super.dispose()}_scheduleRender(){this._renderAnimationFrame===null&&(this._renderAnimationFrame=QU(this._onRenderScheduled.bind(this),100))}_onRenderScheduled(){this._renderAnimationFrame=null,this._flushAccumulatedAndRenderNow()}_renderNow(){nCe(()=>this._actualRender())}_getViewPartsToRender(){const e=[];let t=0;for(const i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_actualRender(){if(!Y4(this.domNode.domNode))return;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&e.length===0)return;const t=this._context.viewLayout.getLinesViewportData();this._context.viewModel.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);const i=new Qwe(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(i),this._viewLines.shouldRender()&&(this._viewLines.renderText(i),this._viewLines.onDidRender(),e=this._getViewPartsToRender());const s=new T1e(this._context.viewLayout,i,this._viewLines);for(const o of e)o.prepareRender(s);for(const o of e)o.render(s),o.onDidRender()}delegateVerticalScrollbarPointerDown(e){this._scrollbar.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){this._scrollbar.delegateScrollFromMouseWheelEvent(e)}restoreState(e){this._context.viewModel.viewLayout.setScrollPosition({scrollTop:e.scrollTop,scrollLeft:e.scrollLeft},1),this._context.viewModel.visibleLinesStabilized()}getOffsetForColumn(e,t){const i=this._context.viewModel.model.validatePosition({lineNumber:e,column:t}),s=this._context.viewModel.coordinatesConverter.convertModelPositionToViewPosition(i);this._flushAccumulatedAndRenderNow();const o=this._viewLines.visibleRangeForPosition(new V(s.lineNumber,s.column));return o?o.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?pD.convertViewToModelMouseTarget(i,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new zwe(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(const i of this._viewParts)i.forceShouldRender()}e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}writeScreenReaderContent(e){this._textAreaHandler.writeScreenReaderContent(e)}focus(){this._textAreaHandler.focusTextArea()}isFocused(){return this._textAreaHandler.isFocused()}setAriaOptions(e){this._textAreaHandler.setAriaOptions(e)}addContentWidget(e){this._contentWidgets.addWidget(e.widget),this.layoutContentWidget(e),this._scheduleRender()}layoutContentWidget(e){var t,i,s,o,r,a,l,c;this._contentWidgets.setWidgetPosition(e.widget,(i=(t=e.position)===null||t===void 0?void 0:t.position)!==null&&i!==void 0?i:null,(o=(s=e.position)===null||s===void 0?void 0:s.secondaryPosition)!==null&&o!==void 0?o:null,(a=(r=e.position)===null||r===void 0?void 0:r.preference)!==null&&a!==void 0?a:null,(c=(l=e.position)===null||l===void 0?void 0:l.positionAffinity)!==null&&c!==void 0?c:null),this._scheduleRender()}removeContentWidget(e){this._contentWidgets.removeWidget(e.widget),this._scheduleRender()}addOverlayWidget(e){this._overlayWidgets.addWidget(e.widget),this.layoutOverlayWidget(e),this._scheduleRender()}layoutOverlayWidget(e){const t=e.position?e.position.preference:null;this._overlayWidgets.setWidgetPosition(e.widget,t)&&this._scheduleRender()}removeOverlayWidget(e){this._overlayWidgets.removeWidget(e.widget),this._scheduleRender()}addGlyphMarginWidget(e){this._glyphMarginWidgets.addWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}layoutGlyphMarginWidget(e){const t=e.position;this._glyphMarginWidgets.setWidgetPosition(e.widget,t)&&(this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender())}removeGlyphMarginWidget(e){this._glyphMarginWidgets.removeWidget(e.widget),this._shouldRecomputeGlyphMarginLanes=!0,this._scheduleRender()}};OT=tCe([iCe(6,vt)],OT);function nCe(n){try{return n()}catch(e){mt(e)}}class Eq{constructor(e,t,i,s,o,r){this.id=e,this.label=t,this.alias=i,this._precondition=s,this._run=o,this._contextKeyService=r}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(e){return this.isSupported()?this._run(e):Promise.resolve(void 0)}}function Lf(n){let e=0,t=0,i=0,s=0;for(let o=0,r=n.length;o=wo&&(t=t-n%wo),t}function lCe(n,e){return n.reduce((t,i)=>Bi(t,e(i)),Es)}function Aq(n,e){return n===e}function pv(n,e){const t=n,i=e;if(i-t<=0)return Es;const o=Math.floor(t/wo),r=Math.floor(i/wo),a=i-r*wo;if(o===r){const l=t-o*wo;return Ci(0,a-l)}else return Ci(r-o,a)}function xp(n,e){return n=e}function Jg(n){return Ci(n.lineNumber-1,n.column-1)}function tf(n,e){const t=n,i=Math.floor(t/wo),s=t-i*wo,o=e,r=Math.floor(o/wo),a=o-r*wo;return new N(i+1,s+1,r+1,a+1)}function cCe(n){const e=$f(n);return Ci(e.length-1,e[e.length-1].length)}class nc{static fromModelContentChanges(e){return e.map(i=>{const s=N.lift(i.range);return new nc(Jg(s.getStartPosition()),Jg(s.getEndPosition()),cCe(i.text))}).reverse()}constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}toString(){return`[${$o(this.startOffset)}...${$o(this.endOffset)}) -> ${$o(this.newLength)}`}}class dCe{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map(t=>L3.from(t))}getOffsetBeforeChange(e){return this.adjustNextEdit(e),this.translateCurToOld(e)}getDistanceToNextChange(e){this.adjustNextEdit(e);const t=this.edits[this.nextEditIdx],i=t?this.translateOldToCur(t.offsetObj):null;return i===null?null:pv(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?Ci(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):Ci(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=$o(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?Ci(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):Ci(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx>5;if(s===0){const r=1<this.textBufferLineCount-1||this.lineIdx===this.textBufferLineCount-1&&this.lineCharOffset>=this.textBufferLastLineLength)return null;this.line===null&&(this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.line=this.lineTokens.getLineContent(),this.lineTokenOffset=this.lineCharOffset===0?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));const e=this.lineIdx,t=this.lineCharOffset;let i=0;for(;;){const o=this.lineTokens,r=o.getCount();let a=null;if(this.lineTokenOffset1e3))break;if(i>1500)break}const s=rCe(e,t,this.lineIdx,this.lineCharOffset);return new td(s,0,-1,Mi.getEmpty(),new ph(s))}}class bCe{constructor(e,t){this.text=e,this._offset=Es,this.idx=0;const i=t.getRegExpStr(),s=i?new RegExp(i+`| +`,"gi"):null,o=[];let r,a=0,l=0,c=0,d=0;const u=[];for(let g=0;g<60;g++)u.push(new td(Ci(0,g),0,-1,Mi.getEmpty(),new ph(Ci(0,g))));const h=[];for(let g=0;g<60;g++)h.push(new td(Ci(1,g),0,-1,Mi.getEmpty(),new ph(Ci(1,g))));if(s)for(s.lastIndex=0;(r=s.exec(e))!==null;){const g=r.index,p=r[0];if(p===` +`)a++,l=g+1;else{if(c!==g){let _;if(d===a){const v=g-c;if(vvCe(t)).join("|")}}get regExpGlobal(){if(!this.hasRegExp){const e=this.getRegExpStr();this._regExpGlobal=e?new RegExp(e,"gi"):null,this.hasRegExp=!0}return this._regExpGlobal}getToken(e){return this.map.get(e.toLowerCase())}findClosingTokenText(e){for(const[t,i]of this.map)if(i.kind===2&&i.bracketIds.intersects(e))return t}get isEmpty(){return this.map.size===0}}function vCe(n){let e=Sr(n);return/^[\w ]+/.test(n)&&(e=`\\b${e}`),/[\w ]+$/.test(n)&&(e=`${e}\\b`),e}class yCe{constructor(e,t){this.denseKeyProvider=e,this.getLanguageConfiguration=t,this.languageIdToBracketTokens=new Map}didLanguageChange(e){return this.languageIdToBracketTokens.has(e)}getSingleLanguageBracketTokens(e){let t=this.languageIdToBracketTokens.get(e);return t||(t=E3.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function wCe(n){if(n.length===0)return null;if(n.length===1)return n[0];let e=0;function t(){if(e>=n.length)return null;const r=e,a=n[r].listHeight;for(e++;e=2?Iq(r===0&&e===n.length?n:n.slice(r,e),!1):n[r]}let i=t(),s=t();if(!s)return i;for(let r=t();r;r=t())B7(i,s)<=B7(s,r)?(i=I2(i,s),s=r):s=I2(s,r);return I2(i,s)}function Iq(n,e=!1){if(n.length===0)return null;if(n.length===1)return n[0];let t=n.length;for(;t>3;){const i=t>>1;for(let s=0;s=3?n[2]:null,e)}function B7(n,e){return Math.abs(n.listHeight-e.listHeight)}function I2(n,e){return n.listHeight===e.listHeight?ol.create23(n,e,null,!1):n.listHeight>e.listHeight?CCe(n,e):SCe(e,n)}function CCe(n,e){n=n.toMutable();let t=n;const i=[];let s;for(;;){if(e.listHeight===t.listHeight){s=e;break}if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeLastElementMutable()}for(let o=i.length-1;o>=0;o--){const r=i[o];s?r.childrenLength>=3?s=ol.create23(r.unappendChild(),s,null,!1):(r.appendChildOfSameHeight(s),s=void 0):r.handleChildrenChanged()}return s?ol.create23(n,s,null,!1):n}function SCe(n,e){n=n.toMutable();let t=n;const i=[];for(;e.listHeight!==t.listHeight;){if(t.kind!==4)throw new Error("unexpected");i.push(t),t=t.makeFirstElementMutable()}let s=e;for(let o=i.length-1;o>=0;o--){const r=i[o];s?r.childrenLength>=3?s=ol.create23(s,r.unprependChild(),null,!1):(r.prependChildOfSameHeight(s),s=void 0):r.handleChildrenChanged()}return s?ol.create23(s,n,null,!1):n}class xCe{constructor(e){this.lastOffset=Es,this.nextNodes=[e],this.offsets=[Es],this.idxs=[]}readLongestNodeAt(e,t){if(xp(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=F0(this.nextNodes);if(!i)return;const s=F0(this.offsets);if(xp(e,s))return;if(xp(s,e))if(Bi(s,i.length)<=e)this.nextNodeAfterCurrent();else{const o=T2(i);o!==-1?(this.nextNodes.push(i.getChild(o)),this.offsets.push(s),this.idxs.push(o)):this.nextNodeAfterCurrent()}else{if(t(i))return this.nextNodeAfterCurrent(),i;{const o=T2(i);if(o===-1){this.nextNodeAfterCurrent();return}else this.nextNodes.push(i.getChild(o)),this.offsets.push(s),this.idxs.push(o)}}}}nextNodeAfterCurrent(){for(;;){const e=F0(this.offsets),t=F0(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),this.idxs.length===0)break;const i=F0(this.nextNodes),s=T2(i,this.idxs[this.idxs.length-1]);if(s!==-1){this.nextNodes.push(i.getChild(s)),this.offsets.push(Bi(e,t.length)),this.idxs[this.idxs.length-1]=s;break}else this.idxs.pop()}}}function T2(n,e=-1){for(;;){if(e++,e>=n.childrenLength)return-1;if(n.getChild(e))return e}}function F0(n){return n.length>0?n[n.length-1]:void 0}function W7(n,e,t,i){return new LCe(n,e,t,i).parseDocument()}class LCe{constructor(e,t,i,s){if(this.tokenizer=e,this.createImmutableLists=s,this._itemsConstructed=0,this._itemsFromCache=0,i&&s)throw new Error("Not supported");this.oldNodeReader=i?new xCe(i):void 0,this.positionMapper=new dCe(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(Mi.getEmpty(),0);return e||(e=ol.getEmpty()),e}parseList(e,t){const i=[];for(;;){let o=this.tryReadChildFromCache(e);if(!o){const r=this.tokenizer.peek();if(!r||r.kind===2&&r.bracketIds.intersects(e))break;o=this.parseChild(e,t+1)}o.kind===4&&o.childrenLength===0||i.push(o)}return this.oldNodeReader?wCe(i):Iq(i,this.createImmutableLists)}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(t===null||!jS(t)){const i=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),s=>t!==null&&!xp(s.length,t)?!1:s.canBeReused(e));if(i)return this._itemsFromCache++,this.tokenizer.skip(i.length),i}}}parseChild(e,t){this._itemsConstructed++;const i=this.tokenizer.read();switch(i.kind){case 2:return new pCe(i.bracketIds,i.length);case 0:return i.astNode;case 1:{if(t>300)return new ph(i.length);const s=e.merge(i.bracketIds),o=this.parseList(s,t+1),r=this.tokenizer.peek();return r&&r.kind===2&&(r.bracketId===i.bracketId||r.bracketIds.intersects(i.bracketIds))?(this.tokenizer.read(),mv.create(i.astNode,o,r.astNode)):mv.create(i.astNode,o,null)}default:throw new Error("unexpected")}}}function KS(n,e){if(n.length===0)return e;if(e.length===0)return n;const t=new _c(V7(n)),i=V7(e);i.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let s=t.dequeue();function o(c){if(c===void 0){const u=t.takeWhile(h=>!0)||[];return s&&u.unshift(s),u}const d=[];for(;s&&!jS(c);){const[u,h]=s.splitAt(c);d.push(u),c=pv(u.lengthAfter,c),s=h??t.dequeue()}return jS(c)||d.push(new bd(!1,c,c)),d}const r=[];function a(c,d,u){if(r.length>0&&Aq(r[r.length-1].endOffset,c)){const h=r[r.length-1];r[r.length-1]=new nc(h.startOffset,d,Bi(h.newLength,u))}else r.push({startOffset:c,endOffset:d,newLength:u})}let l=Es;for(const c of i){const d=o(c.lengthBefore);if(c.modified){const u=lCe(d,f=>f.lengthBefore),h=Bi(l,u);a(l,h,c.lengthAfter),l=h}else for(const u of d){const h=l;l=Bi(l,u.lengthBefore),u.modified&&a(h,l,u.lengthAfter)}}return r}class bd{constructor(e,t,i){this.modified=e,this.lengthBefore=t,this.lengthAfter=i}splitAt(e){const t=pv(e,this.lengthAfter);return Aq(t,Es)?[this,void 0]:this.modified?[new bd(this.modified,this.lengthBefore,e),new bd(this.modified,Es,t)]:[new bd(this.modified,e,e),new bd(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${$o(this.lengthBefore)} -> ${$o(this.lengthAfter)}`}}function V7(n){const e=[];let t=Es;for(const i of n){const s=pv(t,i.startOffset);jS(s)||e.push(new bd(!1,s,s));const o=pv(i.startOffset,i.endOffset);e.push(new bd(!0,o,i.newLength)),t=i.endOffset}return e}class DCe extends Y{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new B,this.denseKeyProvider=new uCe,this.brackets=new yCe(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],e.tokenization.hasTokens)e.tokenization.backgroundTokenizationState===2?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens);else{const i=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),s=new bCe(this.textModel.getValue(),i);this.initialAstWithoutTokens=W7(s,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}}handleDidChangeBackgroundTokenizationState(){if(this.textModel.tokenization.backgroundTokenizationState===2){const e=this.initialAstWithoutTokens===void 0;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){const t=e.map(i=>new nc(Ci(i.fromLineNumber-1,0),Ci(i.toLineNumber,0),Ci(i.toLineNumber-i.fromLineNumber+1,0)));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=nc.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const i=KS(this.queuedTextEdits,e);this.queuedTextEdits=i,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=KS(this.queuedTextEditsForInitialAstWithoutTokens,e))}flushQueue(){this.queuedTextEdits.length>0&&(this.astWithTokens=this.parseDocumentFromTextBuffer(this.queuedTextEdits,this.astWithTokens,!1),this.queuedTextEdits=[]),this.queuedTextEditsForInitialAstWithoutTokens.length>0&&(this.initialAstWithoutTokens&&(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer(this.queuedTextEditsForInitialAstWithoutTokens,this.initialAstWithoutTokens,!1)),this.queuedTextEditsForInitialAstWithoutTokens=[])}parseDocumentFromTextBuffer(e,t,i){const s=t,o=new mCe(this.textModel,this.brackets);return W7(o,e,s,i)}getBracketsInRange(e,t){this.flushQueue();const i=Ci(e.startLineNumber-1,e.startColumn-1),s=Ci(e.endLineNumber-1,e.endColumn-1);return new Za(o=>{const r=this.initialAstWithoutTokens||this.astWithTokens;FT(r,Es,r.length,i,s,o,0,0,new Map,t)})}getBracketPairsInRange(e,t){this.flushQueue();const i=Jg(e.getStartPosition()),s=Jg(e.getEndPosition());return new Za(o=>{const r=this.initialAstWithoutTokens||this.astWithTokens,a=new kCe(o,t,this.textModel);BT(r,Es,r.length,i,s,a,0,new Map)})}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return Nq(t,Es,t.length,Jg(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return Tq(t,Es,t.length,Jg(e))}}function Tq(n,e,t,i){if(n.kind===4||n.kind===2){const s=[];for(const o of n.children)t=Bi(e,o.length),s.push({nodeOffsetStart:e,nodeOffsetEnd:t}),e=t;for(let o=s.length-1;o>=0;o--){const{nodeOffsetStart:r,nodeOffsetEnd:a}=s[o];if(xp(r,i)){const l=Tq(n.children[o],r,a,i);if(l)return l}}return null}else{if(n.kind===3)return null;if(n.kind===1){const s=tf(e,t);return{bracketInfo:n.bracketInfo,range:s}}}return null}function Nq(n,e,t,i){if(n.kind===4||n.kind===2){for(const s of n.children){if(t=Bi(e,s.length),xp(i,t)){const o=Nq(s,e,t,i);if(o)return o}e=t}return null}else{if(n.kind===3)return null;if(n.kind===1){const s=tf(e,t);return{bracketInfo:n.bracketInfo,range:s}}}return null}function FT(n,e,t,i,s,o,r,a,l,c,d=!1){if(r>200)return!0;e:for(;;)switch(n.kind){case 4:{const u=n.childrenLength;for(let h=0;h200)return!0;let c=!0;if(n.kind===2){let d=0;if(a){let f=a.get(n.openingBracket.text);f===void 0&&(f=0),d=f,f++,a.set(n.openingBracket.text,f)}const u=Bi(e,n.openingBracket.length);let h=-1;if(o.includeMinIndentation&&(h=n.computeMinIndentation(e,o.textModel)),c=o.push(new oCe(tf(e,t),tf(e,u),n.closingBracket?tf(Bi(u,((l=n.child)===null||l===void 0?void 0:l.length)||Es),t):void 0,r,d,n,h)),e=u,c&&n.child){const f=n.child;if(t=Bi(e,f.length),Lp(e,s)&&b_(t,i)&&(c=BT(f,e,t,i,s,o,r+1,a),!c))return!1}a==null||a.set(n.openingBracket.text,d)}else{let d=e;for(const u of n.children){const h=d;if(d=Bi(d,u.length),Lp(h,s)&&Lp(i,d)&&(c=BT(u,h,d,i,s,o,r,a),!c))return!1}}return c}class ECe extends Y{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new sa),this.onDidChangeEmitter=new B,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1,this._register(this.languageConfigurationService.onDidChange(i=>{var s;(!i.languageId||!((s=this.bracketPairsTree.value)===null||s===void 0)&&s.object.didLanguageChange(i.languageId))&&(this.bracketPairsTree.clear(),this.updateBracketPairsTree())}))}handleDidChangeOptions(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeLanguage(e){this.bracketPairsTree.clear(),this.updateBracketPairsTree()}handleDidChangeContent(e){var t;(t=this.bracketPairsTree.value)===null||t===void 0||t.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){var e;(e=this.bracketPairsTree.value)===null||e===void 0||e.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){var t;(t=this.bracketPairsTree.value)===null||t===void 0||t.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.canBuildAST){if(!this.bracketPairsTree.value){const e=new pe;this.bracketPairsTree.value=ACe(e.add(new DCe(this.textModel,t=>this.languageConfigurationService.getLanguageConfiguration(t))),e),e.add(this.bracketPairsTree.value.object.onDidChange(t=>this.onDidChangeEmitter.fire(t))),this.onDidChangeEmitter.fire()}}else this.bracketPairsTree.value&&(this.bracketPairsTree.clear(),this.onDidChangeEmitter.fire())}getBracketPairsInRange(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getBracketPairsInRange(e,!1))||Za.empty}getBracketPairsInRangeWithMinIndentation(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getBracketPairsInRange(e,!0))||Za.empty}getBracketsInRange(e,t=!1){var i;return this.bracketsRequested=!0,this.updateBracketPairsTree(),((i=this.bracketPairsTree.value)===null||i===void 0?void 0:i.object.getBracketsInRange(e,t))||Za.empty}findMatchingBracketUp(e,t,i){const s=this.textModel.validatePosition(t),o=this.textModel.getLanguageIdAtPosition(s.lineNumber,s.column);if(this.canBuildAST){const r=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew.getClosingBracketInfo(e);if(!r)return null;const a=this.getBracketPairsInRange(N.fromPositions(t,t)).findLast(l=>r.closes(l.openingBracketInfo));return a?a.openingBracketRange:null}else{const r=e.toLowerCase(),a=this.languageConfigurationService.getLanguageConfiguration(o).brackets;if(!a)return null;const l=a.textIsBracket[r];return l?tw(this._findMatchingBracketUp(l,s,N2(i))):null}}matchBracket(e,t){if(this.canBuildAST){const i=this.getBracketPairsInRange(N.fromPositions(e,e)).filter(s=>s.closingBracketRange!==void 0&&(s.openingBracketRange.containsPosition(e)||s.closingBracketRange.containsPosition(e))).findLastMaxBy(pr(s=>s.openingBracketRange.containsPosition(e)?s.openingBracketRange:s.closingBracketRange,N.compareRangesUsingStarts));return i?[i.openingBracketRange,i.closingBracketRange]:null}else{const i=N2(t);return this._matchBracket(this.textModel.validatePosition(e),i)}}_establishBracketSearchOffsets(e,t,i,s){const o=t.getCount(),r=t.getLanguageId(s);let a=Math.max(0,e.column-1-i.maxBracketLength);for(let c=s-1;c>=0;c--){const d=t.getEndOffset(c);if(d<=a)break;if(ba(t.getStandardTokenType(c))||t.getLanguageId(c)!==r){a=d;break}}let l=Math.min(t.getLineContent().length,e.column-1+i.maxBracketLength);for(let c=s+1;c=l)break;if(ba(t.getStandardTokenType(c))||t.getLanguageId(c)!==r){l=d;break}}return{searchStartOffset:a,searchEndOffset:l}}_matchBracket(e,t){const i=e.lineNumber,s=this.textModel.tokenization.getLineTokens(i),o=this.textModel.getLineContent(i),r=s.findTokenIndexAtOffset(e.column-1);if(r<0)return null;const a=this.languageConfigurationService.getLanguageConfiguration(s.getLanguageId(r)).brackets;if(a&&!ba(s.getStandardTokenType(r))){let{searchStartOffset:l,searchEndOffset:c}=this._establishBracketSearchOffsets(e,s,a,r),d=null;for(;;){const u=sr.findNextBracketInRange(a.forwardRegex,i,o,l,c);if(!u)break;if(u.startColumn<=e.column&&e.column<=u.endColumn){const h=o.substring(u.startColumn-1,u.endColumn-1).toLowerCase(),f=this._matchFoundBracket(u,a.textIsBracket[h],a.textIsOpenBracket[h],t);if(f){if(f instanceof Ml)return null;d=f}}l=u.endColumn-1}if(d)return d}if(r>0&&s.getStartOffset(r)===e.column-1){const l=r-1,c=this.languageConfigurationService.getLanguageConfiguration(s.getLanguageId(l)).brackets;if(c&&!ba(s.getStandardTokenType(l))){const{searchStartOffset:d,searchEndOffset:u}=this._establishBracketSearchOffsets(e,s,c,l),h=sr.findPrevBracketInRange(c.reversedRegex,i,o,d,u);if(h&&h.startColumn<=e.column&&e.column<=h.endColumn){const f=o.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),g=this._matchFoundBracket(h,c.textIsBracket[f],c.textIsOpenBracket[f],t);if(g)return g instanceof Ml?null:g}}}return null}_matchFoundBracket(e,t,i,s){if(!t)return null;const o=i?this._findMatchingBracketDown(t,e.getEndPosition(),s):this._findMatchingBracketUp(t,e.getStartPosition(),s);return o?o instanceof Ml?o:[e,o]:null}_findMatchingBracketUp(e,t,i){const s=e.languageId,o=e.reversedRegex;let r=-1,a=0;const l=(c,d,u,h)=>{for(;;){if(i&&++a%100===0&&!i())return Ml.INSTANCE;const f=sr.findPrevBracketInRange(o,c,d,u,h);if(!f)break;const g=d.substring(f.startColumn-1,f.endColumn-1).toLowerCase();if(e.isOpen(g)?r++:e.isClose(g)&&r--,r===0)return f;h=f.startColumn-1}return null};for(let c=t.lineNumber;c>=1;c--){const d=this.textModel.tokenization.getLineTokens(c),u=d.getCount(),h=this.textModel.getLineContent(c);let f=u-1,g=h.length,p=h.length;c===t.lineNumber&&(f=d.findTokenIndexAtOffset(t.column-1),g=t.column-1,p=t.column-1);let _=!0;for(;f>=0;f--){const v=d.getLanguageId(f)===s&&!ba(d.getStandardTokenType(f));if(v)_?g=d.getStartOffset(f):(g=d.getStartOffset(f),p=d.getEndOffset(f));else if(_&&g!==p){const b=l(c,h,g,p);if(b)return b}_=v}if(_&&g!==p){const v=l(c,h,g,p);if(v)return v}}return null}_findMatchingBracketDown(e,t,i){const s=e.languageId,o=e.forwardRegex;let r=1,a=0;const l=(d,u,h,f)=>{for(;;){if(i&&++a%100===0&&!i())return Ml.INSTANCE;const g=sr.findNextBracketInRange(o,d,u,h,f);if(!g)break;const p=u.substring(g.startColumn-1,g.endColumn-1).toLowerCase();if(e.isOpen(p)?r++:e.isClose(p)&&r--,r===0)return g;h=g.endColumn-1}return null},c=this.textModel.getLineCount();for(let d=t.lineNumber;d<=c;d++){const u=this.textModel.tokenization.getLineTokens(d),h=u.getCount(),f=this.textModel.getLineContent(d);let g=0,p=0,_=0;d===t.lineNumber&&(g=u.findTokenIndexAtOffset(t.column-1),p=t.column-1,_=t.column-1);let v=!0;for(;g=1;a--){const l=this.textModel.tokenization.getLineTokens(a),c=l.getCount(),d=this.textModel.getLineContent(a);let u=c-1,h=d.length,f=d.length;if(a===i.lineNumber){u=l.findTokenIndexAtOffset(i.column-1),h=i.column-1,f=i.column-1;const p=l.getLanguageId(u);s!==p&&(s=p,o=this.languageConfigurationService.getLanguageConfiguration(s).brackets,r=this.languageConfigurationService.getLanguageConfiguration(s).bracketsNew)}let g=!0;for(;u>=0;u--){const p=l.getLanguageId(u);if(s!==p){if(o&&r&&g&&h!==f){const v=sr.findPrevBracketInRange(o.reversedRegex,a,d,h,f);if(v)return this._toFoundBracket(r,v);g=!1}s=p,o=this.languageConfigurationService.getLanguageConfiguration(s).brackets,r=this.languageConfigurationService.getLanguageConfiguration(s).bracketsNew}const _=!!o&&!ba(l.getStandardTokenType(u));if(_)g?h=l.getStartOffset(u):(h=l.getStartOffset(u),f=l.getEndOffset(u));else if(r&&o&&g&&h!==f){const v=sr.findPrevBracketInRange(o.reversedRegex,a,d,h,f);if(v)return this._toFoundBracket(r,v)}g=_}if(r&&o&&g&&h!==f){const p=sr.findPrevBracketInRange(o.reversedRegex,a,d,h,f);if(p)return this._toFoundBracket(r,p)}}return null}findNextBracket(e){var t;const i=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),((t=this.bracketPairsTree.value)===null||t===void 0?void 0:t.object.getFirstBracketAfter(i))||null;const s=this.textModel.getLineCount();let o=null,r=null,a=null;for(let l=i.lineNumber;l<=s;l++){const c=this.textModel.tokenization.getLineTokens(l),d=c.getCount(),u=this.textModel.getLineContent(l);let h=0,f=0,g=0;if(l===i.lineNumber){h=c.findTokenIndexAtOffset(i.column-1),f=i.column-1,g=i.column-1;const _=c.getLanguageId(h);o!==_&&(o=_,r=this.languageConfigurationService.getLanguageConfiguration(o).brackets,a=this.languageConfigurationService.getLanguageConfiguration(o).bracketsNew)}let p=!0;for(;hp.closingBracketRange!==void 0&&p.range.strictContainsRange(f));return g?[g.openingBracketRange,g.closingBracketRange]:null}const s=N2(t),o=this.textModel.getLineCount(),r=new Map;let a=[];const l=(f,g)=>{if(!r.has(f)){const p=[];for(let _=0,v=g?g.brackets.length:0;_{for(;;){if(s&&++c%100===0&&!s())return Ml.INSTANCE;const b=sr.findNextBracketInRange(f.forwardRegex,g,p,_,v);if(!b)break;const y=p.substring(b.startColumn-1,b.endColumn-1).toLowerCase(),w=f.textIsBracket[y];if(w&&(w.isOpen(y)?a[w.index]++:w.isClose(y)&&a[w.index]--,a[w.index]===-1))return this._matchFoundBracket(b,w,!1,s);_=b.endColumn-1}return null};let u=null,h=null;for(let f=i.lineNumber;f<=o;f++){const g=this.textModel.tokenization.getLineTokens(f),p=g.getCount(),_=this.textModel.getLineContent(f);let v=0,b=0,y=0;if(f===i.lineNumber){v=g.findTokenIndexAtOffset(i.column-1),b=i.column-1,y=i.column-1;const S=g.getLanguageId(v);u!==S&&(u=S,h=this.languageConfigurationService.getLanguageConfiguration(u).brackets,l(u,h))}let w=!0;for(;ve==null?void 0:e.dispose()}}function N2(n){if(typeof n>"u")return()=>!0;{const e=Date.now();return()=>Date.now()-e<=n}}class Ml{constructor(){this._searchCanceledBrand=void 0}}Ml.INSTANCE=new Ml;function tw(n){return n instanceof Ml?null:n}class ICe extends Y{constructor(e){super(),this.textModel=e,this.colorProvider=new Rq,this.onDidChangeEmitter=new B,this.onDidChange=this.onDidChangeEmitter.event,this.colorizationOptions=e.getOptions().bracketPairColorizationOptions,this._register(e.bracketPairs.onDidChange(t=>{this.onDidChangeEmitter.fire()}))}handleDidChangeOptions(e){this.colorizationOptions=this.textModel.getOptions().bracketPairColorizationOptions}getDecorationsInRange(e,t,i,s){return s?[]:t===void 0?[]:this.colorizationOptions.enabled?this.textModel.bracketPairs.getBracketsInRange(e,!0).map(r=>({id:`bracket${r.range.toString()}-${r.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(r,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:r.range})).toArray():[]}getAllDecorations(e,t){return e===void 0?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new N(1,1,this.textModel.getLineCount(),1),e,t):[]}}class Rq{constructor(){this.unexpectedClosingBracketClassName="unexpected-closing-bracket"}getInlineClassName(e,t){return e.isInvalid?this.unexpectedClosingBracketClassName:this.getInlineClassNameOfLevel(t?e.nestingLevelOfEqualBracketType:e.nestingLevel)}getInlineClassNameOfLevel(e){return`bracket-highlighting-${e%30}`}}Tr((n,e)=>{const t=[uq,hq,fq,gq,pq,mq],i=new Rq;e.addRule(`.monaco-editor .${i.unexpectedClosingBracketClassName} { color: ${n.getColor(Iye)}; }`);const s=t.map(o=>n.getColor(o)).filter(o=>!!o).filter(o=>!o.isTransparent());for(let o=0;o<30;o++){const r=s[o%s.length];e.addRule(`.monaco-editor .${i.getInlineClassNameOfLevel(o)} { color: ${r}; }`)}});function iw(n){return n.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}class vn{get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}constructor(e,t,i,s){this.oldPosition=e,this.oldText=t,this.newPosition=i,this.newText=s}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${iw(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${iw(this.oldText)}")`:`(replace@${this.oldPosition} "${iw(this.oldText)}" with "${iw(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const s=t.length;Ur(e,s,i),i+=4;for(let o=0;on.length)return!1;if(t){if(!O4(n,e))return!1;if(e.length===n.length)return!0;let o=e.length;return e.charAt(e.length-1)===i&&o--,n.charAt(o)===i}return e.charAt(e.length-1)!==i&&(e+=i),n.indexOf(e)===0}function RCe(n){return n>=65&&n<=90||n>=97&&n<=122}function vl(n){return vS(n,!0)}class MCe{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:zb(this.getComparisonKey(e,i),this.getComparisonKey(t,i))}isEqual(e,t,i=!1){return e===t?!0:!e||!t?!1:this.getComparisonKey(e,i)===this.getComparisonKey(t,i)}getComparisonKey(e,t=!1){return e.with({path:this._ignorePathCasing(e)?e.path.toLowerCase():void 0,fragment:t?null:void 0}).toString()}isEqualOrParent(e,t,i=!1){if(e.scheme===t.scheme){if(e.scheme===tt.file)return WT(vl(e),vl(t),this._ignorePathCasing(e))&&e.query===t.query&&(i||e.fragment===t.fragment);if($7(e.authority,t.authority))return WT(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(i||e.fragment===t.fragment)}return!1}joinPath(e,...t){return Ue.joinPath(e,...t)}basenameOrAuthority(e){return ra(e)||e.authority}basename(e){return Oi.basename(e.path)}extname(e){return Oi.extname(e.path)}dirname(e){if(e.path.length===0)return e;let t;return e.scheme===tt.file?t=Ue.file(Bge(vl(e))).path:(t=Oi.dirname(e.path),e.authority&&t.length&&t.charCodeAt(0)!==47&&(console.error(`dirname("${e.toString})) resulted in a relative path`),t="/")),e.with({path:t})}normalizePath(e){if(!e.path.length)return e;let t;return e.scheme===tt.file?t=Ue.file(wU(vl(e))).path:t=Oi.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!$7(e.authority,t.authority))return;if(e.scheme===tt.file){const o=Fge(vl(e),vl(t));return Ps?Mq(o):o}let i=e.path||"/";const s=t.path||"/";if(this._ignorePathCasing(e)){let o=0;for(const r=Math.min(i.length,s.length);oz7(i).length&&i[i.length-1]===t}else{const i=e.path;return i.length>1&&i.charCodeAt(i.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=Ed){return U7(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=Ed){let i=!1;if(e.scheme===tt.file){const s=vl(e);i=s!==void 0&&s.length===z7(s).length&&s[s.length-1]===t}else{t="/";const s=e.path;i=s.length===1&&s.charCodeAt(s.length-1)===47}return!i&&!U7(e,t)?e.with({path:e.path+"/"}):e}}const Ht=new MCe(()=>!1),A3=Ht.isEqual.bind(Ht);Ht.isEqualOrParent.bind(Ht);Ht.getComparisonKey.bind(Ht);const PCe=Ht.basenameOrAuthority.bind(Ht),ra=Ht.basename.bind(Ht);Ht.extname.bind(Ht);const I3=Ht.dirname.bind(Ht);Ht.joinPath.bind(Ht);const OCe=Ht.normalizePath.bind(Ht);Ht.relativePath.bind(Ht);const H7=Ht.resolvePath.bind(Ht);Ht.isAbsolutePath.bind(Ht);const $7=Ht.isEqualAuthority.bind(Ht),U7=Ht.hasTrailingPathSeparator.bind(Ht);Ht.removeTrailingPathSeparator.bind(Ht);Ht.addTrailingPathSeparator.bind(Ht);var YS;(function(n){n.META_DATA_LABEL="label",n.META_DATA_DESCRIPTION="description",n.META_DATA_SIZE="size",n.META_DATA_MIME="mime";function e(t){const i=new Map;t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";")).split(";").forEach(r=>{const[a,l]=r.split(":");a&&l&&i.set(a,l)});const o=t.path.substring(0,t.path.indexOf(";"));return o&&i.set(n.META_DATA_MIME,o),i}n.parseMetaData=e})(YS||(YS={}));function yg(n){return n.toString()}class Qi{static create(e,t){const i=e.getAlternativeVersionId(),s=VT(e);return new Qi(i,i,s,s,t,t,[])}constructor(e,t,i,s,o,r,a){this.beforeVersionId=e,this.afterVersionId=t,this.beforeEOL=i,this.afterEOL=s,this.beforeCursorState=o,this.afterCursorState=r,this.changes=a}append(e,t,i,s,o){t.length>0&&(this.changes=TCe(this.changes,t)),this.afterEOL=i,this.afterVersionId=s,this.afterCursorState=o}static _writeSelectionsSize(e){return 4+4*4*(e?e.length:0)}static _writeSelections(e,t,i){if(Ur(e,t?t.length:0,i),i+=4,t)for(const s of t)Ur(e,s.selectionStartLineNumber,i),i+=4,Ur(e,s.selectionStartColumn,i),i+=4,Ur(e,s.positionLineNumber,i),i+=4,Ur(e,s.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const s=$r(e,t);t+=4;for(let o=0;ot.toString()).join(", ")}matchesResource(e){return(Ue.isUri(this.model)?this.model:this.model.uri).toString()===e.toString()}setModel(e){this.model=e}canAppend(e){return this.model===e&&this._data instanceof Qi}append(e,t,i,s,o){this._data instanceof Qi&&this._data.append(e,t,i,s,o)}close(){this._data instanceof Qi&&(this._data=this._data.serialize())}open(){this._data instanceof Qi||(this._data=Qi.deserialize(this._data))}undo(){if(Ue.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Qi&&(this._data=this._data.serialize());const e=Qi.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(Ue.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Qi&&(this._data=this._data.serialize());const e=Qi.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof Qi&&(this._data=this._data.serialize()),this._data.byteLength+168}}class FCe{get resources(){return this._editStackElementsArr.map(e=>e.resource)}constructor(e,t,i){this.label=e,this.code=t,this.type=1,this._isOpen=!0,this._editStackElementsArr=i.slice(0),this._editStackElementsMap=new Map;for(const s of this._editStackElementsArr){const o=yg(s.resource);this._editStackElementsMap.set(o,s)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=yg(e);return this._editStackElementsMap.has(t)}setModel(e){const t=yg(Ue.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=yg(e.uri);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).canAppend(e):!1}append(e,t,i,s,o){const r=yg(e.uri);this._editStackElementsMap.get(r).append(e,t,i,s,o)}close(){this._isOpen=!1}open(){}undo(){this._isOpen=!1;for(const e of this._editStackElementsArr)e.undo()}redo(){for(const e of this._editStackElementsArr)e.redo()}heapSize(e){const t=yg(e);return this._editStackElementsMap.has(t)?this._editStackElementsMap.get(t).heapSize():0}split(){return this._editStackElementsArr}toString(){const e=[];for(const t of this._editStackElementsArr)e.push(`${ra(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function VT(n){return n.getEOL()===` +`?0:1}function Pl(n){return n?n instanceof Pq||n instanceof FCe:!1}class T3{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Pl(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Pl(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const i=this._undoRedoService.getLastElement(this._model.uri);if(Pl(i)&&i.canAppend(this._model))return i;const s=new Pq(m("edit","Typing"),"undoredo.textBufferEdit",this._model,e);return this._undoRedoService.pushElement(s,t),s}pushEOL(e){const t=this._getOrCreateEditStackElement(null,void 0);this._model.setEOL(e),t.append(this._model,[],VT(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,s){const o=this._getOrCreateEditStackElement(e,s),r=this._model.applyEdits(t,!0),a=T3._computeCursorState(i,r),l=r.map((c,d)=>({index:d,textChange:c.textChange}));return l.sort((c,d)=>c.textChange.oldPosition===d.textChange.oldPosition?c.index-d.index:c.textChange.oldPosition-d.textChange.oldPosition),o.append(this._model,l.map(c=>c.textChange),VT(this._model),this._model.getAlternativeVersionId(),a),a}static _computeCursorState(e,t){try{return e?e(t):null}catch(i){return mt(i),null}}}class BCe{constructor(){this.spacesDiff=0,this.looksLikeAlignment=!1}}function WCe(n,e,t,i,s){s.spacesDiff=0,s.looksLikeAlignment=!1;let o;for(o=0;o0&&a>0||l>0&&c>0)return;const d=Math.abs(a-c),u=Math.abs(r-l);if(d===0){s.spacesDiff=u,u>0&&0<=l-1&&l-10?s++:w>1&&o++,WCe(r,a,_,y,u),u.looksLikeAlignment&&!(t&&e===u.spacesDiff)))continue;const L=u.spacesDiff;L<=c&&d[L]++,r=_,a=y}let h=t;s!==o&&(h=s{const _=d[p];_>g&&(g=_,f=p)}),f===4&&d[4]>0&&d[2]>0&&d[2]>=d[4]/2&&(f=2)}return{insertSpaces:h,tabSize:f}}function bs(n){return(n.metadata&1)>>>0}function Wt(n,e){n.metadata=n.metadata&254|e<<0}function Cn(n){return(n.metadata&2)>>>1===1}function Ot(n,e){n.metadata=n.metadata&253|(e?1:0)<<1}function Oq(n){return(n.metadata&4)>>>2===1}function q7(n,e){n.metadata=n.metadata&251|(e?1:0)<<2}function Fq(n){return(n.metadata&64)>>>6===1}function G7(n,e){n.metadata=n.metadata&191|(e?1:0)<<6}function VCe(n){return(n.metadata&24)>>>3}function K7(n,e){n.metadata=n.metadata&231|e<<3}function zCe(n){return(n.metadata&32)>>>5===1}function Y7(n,e){n.metadata=n.metadata&223|(e?1:0)<<5}class Bq{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,Wt(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,q7(this,!1),G7(this,!1),K7(this,1),Y7(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,Ot(this,!1)}reset(e,t,i,s){this.start=t,this.end=i,this.maxEnd=i,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=s}setOptions(e){this.options=e;const t=this.options.className;q7(this,t==="squiggly-error"||t==="squiggly-warning"||t==="squiggly-info"),G7(this,this.options.glyphMarginClassName!==null),K7(this,this.options.stickiness),Y7(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(e,t,i){this.cachedVersionId!==i&&(this.range=null),this.cachedVersionId=i,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}detach(){this.parent=null,this.left=null,this.right=null}}const je=new Bq(null,0,0);je.parent=je;je.left=je;je.right=je;Wt(je,0);class R2{constructor(){this.root=je,this.requestNormalizeDelta=!1}intervalSearch(e,t,i,s,o,r){return this.root===je?[]:YCe(this,e,t,i,s,o,r)}search(e,t,i,s){return this.root===je?[]:KCe(this,e,t,i,s)}collectNodesFromOwner(e){return qCe(this,e)}collectNodesPostOrder(){return GCe(this)}insert(e){Z7(this,e),this._normalizeDeltaIfNecessary()}delete(e){X7(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){const i=e;let s=0;for(;e!==this.root;)e===e.parent.right&&(s+=e.parent.delta),e=e.parent;const o=i.start+s,r=i.end+s;i.setCachedOffsets(o,r,t)}acceptReplace(e,t,i,s){const o=UCe(this,e,e+t);for(let r=0,a=o.length;rt||i===1?!1:i===2?!0:e}function $Ce(n,e,t,i,s){const o=VCe(n),r=o===0||o===2,a=o===1||o===2,l=t-e,c=i,d=Math.min(l,c),u=n.start;let h=!1;const f=n.end;let g=!1;e<=u&&f<=t&&zCe(n)&&(n.start=e,h=!0,n.end=e,g=!0);{const _=s?1:l>0?2:0;!h&&wg(u,r,e,_)&&(h=!0),!g&&wg(f,a,e,_)&&(g=!0)}if(d>0&&!s){const _=l>c?2:0;!h&&wg(u,r,e+d,_)&&(h=!0),!g&&wg(f,a,e+d,_)&&(g=!0)}{const _=s?1:0;!h&&wg(u,r,t,_)&&(n.start=e+c,h=!0),!g&&wg(f,a,t,_)&&(n.end=e+c,g=!0)}const p=c-l;h||(n.start=Math.max(0,u+p)),g||(n.end=Math.max(0,f+p)),n.start>n.end&&(n.end=n.start)}function UCe(n,e,t){let i=n.root,s=0,o=0,r=0,a=0;const l=[];let c=0;for(;i!==je;){if(Cn(i)){Ot(i.left,!1),Ot(i.right,!1),i===i.parent.right&&(s-=i.parent.delta),i=i.parent;continue}if(!Cn(i.left)){if(o=s+i.maxEnd,ot){Ot(i,!0);continue}if(a=s+i.end,a>=e&&(i.setCachedOffsets(r,a,0),l[c++]=i),Ot(i,!0),i.right!==je&&!Cn(i.right)){s+=i.delta,i=i.right;continue}}return Ot(n.root,!1),l}function jCe(n,e,t,i){let s=n.root,o=0,r=0,a=0;const l=i-(t-e);for(;s!==je;){if(Cn(s)){Ot(s.left,!1),Ot(s.right,!1),s===s.parent.right&&(o-=s.parent.delta),au(s),s=s.parent;continue}if(!Cn(s.left)){if(r=o+s.maxEnd,rt){s.start+=l,s.end+=l,s.delta+=l,(s.delta<-1073741824||s.delta>1073741824)&&(n.requestNormalizeDelta=!0),Ot(s,!0);continue}if(Ot(s,!0),s.right!==je&&!Cn(s.right)){o+=s.delta,s=s.right;continue}}Ot(n.root,!1)}function qCe(n,e){let t=n.root;const i=[];let s=0;for(;t!==je;){if(Cn(t)){Ot(t.left,!1),Ot(t.right,!1),t=t.parent;continue}if(t.left!==je&&!Cn(t.left)){t=t.left;continue}if(t.ownerId===e&&(i[s++]=t),Ot(t,!0),t.right!==je&&!Cn(t.right)){t=t.right;continue}}return Ot(n.root,!1),i}function GCe(n){let e=n.root;const t=[];let i=0;for(;e!==je;){if(Cn(e)){Ot(e.left,!1),Ot(e.right,!1),e=e.parent;continue}if(e.left!==je&&!Cn(e.left)){e=e.left;continue}if(e.right!==je&&!Cn(e.right)){e=e.right;continue}t[i++]=e,Ot(e,!0)}return Ot(n.root,!1),t}function KCe(n,e,t,i,s){let o=n.root,r=0,a=0,l=0;const c=[];let d=0;for(;o!==je;){if(Cn(o)){Ot(o.left,!1),Ot(o.right,!1),o===o.parent.right&&(r-=o.parent.delta),o=o.parent;continue}if(o.left!==je&&!Cn(o.left)){o=o.left;continue}a=r+o.start,l=r+o.end,o.setCachedOffsets(a,l,i);let u=!0;if(e&&o.ownerId&&o.ownerId!==e&&(u=!1),t&&Oq(o)&&(u=!1),s&&!Fq(o)&&(u=!1),u&&(c[d++]=o),Ot(o,!0),o.right!==je&&!Cn(o.right)){r+=o.delta,o=o.right;continue}}return Ot(n.root,!1),c}function YCe(n,e,t,i,s,o,r){let a=n.root,l=0,c=0,d=0,u=0;const h=[];let f=0;for(;a!==je;){if(Cn(a)){Ot(a.left,!1),Ot(a.right,!1),a===a.parent.right&&(l-=a.parent.delta),a=a.parent;continue}if(!Cn(a.left)){if(c=l+a.maxEnd,ct){Ot(a,!0);continue}if(u=l+a.end,u>=e){a.setCachedOffsets(d,u,o);let g=!0;i&&a.ownerId&&a.ownerId!==i&&(g=!1),s&&Oq(a)&&(g=!1),r&&!Fq(a)&&(g=!1),g&&(h[f++]=a)}if(Ot(a,!0),a.right!==je&&!Cn(a.right)){l+=a.delta,a=a.right;continue}}return Ot(n.root,!1),h}function Z7(n,e){if(n.root===je)return e.parent=je,e.left=je,e.right=je,Wt(e,0),n.root=e,n.root;ZCe(n,e),Uc(e.parent);let t=e;for(;t!==n.root&&bs(t.parent)===1;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;bs(i)===1?(Wt(t.parent,0),Wt(i,0),Wt(t.parent.parent,1),t=t.parent.parent):(t===t.parent.right&&(t=t.parent,j_(n,t)),Wt(t.parent,0),Wt(t.parent.parent,1),q_(n,t.parent.parent))}else{const i=t.parent.parent.left;bs(i)===1?(Wt(t.parent,0),Wt(i,0),Wt(t.parent.parent,1),t=t.parent.parent):(t===t.parent.left&&(t=t.parent,q_(n,t)),Wt(t.parent,0),Wt(t.parent.parent,1),j_(n,t.parent.parent))}return Wt(n.root,0),e}function ZCe(n,e){let t=0,i=n.root;const s=e.start,o=e.end;for(;;)if(QCe(s,o,i.start+t,i.end+t)<0)if(i.left===je){e.start-=t,e.end-=t,e.maxEnd-=t,i.left=e;break}else i=i.left;else if(i.right===je){e.start-=t+i.delta,e.end-=t+i.delta,e.maxEnd-=t+i.delta,i.right=e;break}else t+=i.delta,i=i.right;e.parent=i,e.left=je,e.right=je,Wt(e,1)}function X7(n,e){let t,i;if(e.left===je?(t=e.right,i=e,t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(n.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta):e.right===je?(t=e.left,i=e):(i=XCe(e.right),t=i.right,t.start+=i.delta,t.end+=i.delta,t.delta+=i.delta,(t.delta<-1073741824||t.delta>1073741824)&&(n.requestNormalizeDelta=!0),i.start+=e.delta,i.end+=e.delta,i.delta=e.delta,(i.delta<-1073741824||i.delta>1073741824)&&(n.requestNormalizeDelta=!0)),i===n.root){n.root=t,Wt(t,0),e.detach(),M2(),au(t),n.root.parent=je;return}const s=bs(i)===1;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?t.parent=i.parent:(i.parent===e?t.parent=i:t.parent=i.parent,i.left=e.left,i.right=e.right,i.parent=e.parent,Wt(i,bs(e)),e===n.root?n.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==je&&(i.left.parent=i),i.right!==je&&(i.right.parent=i)),e.detach(),s){Uc(t.parent),i!==e&&(Uc(i),Uc(i.parent)),M2();return}Uc(t),Uc(t.parent),i!==e&&(Uc(i),Uc(i.parent));let o;for(;t!==n.root&&bs(t)===0;)t===t.parent.left?(o=t.parent.right,bs(o)===1&&(Wt(o,0),Wt(t.parent,1),j_(n,t.parent),o=t.parent.right),bs(o.left)===0&&bs(o.right)===0?(Wt(o,1),t=t.parent):(bs(o.right)===0&&(Wt(o.left,0),Wt(o,1),q_(n,o),o=t.parent.right),Wt(o,bs(t.parent)),Wt(t.parent,0),Wt(o.right,0),j_(n,t.parent),t=n.root)):(o=t.parent.left,bs(o)===1&&(Wt(o,0),Wt(t.parent,1),q_(n,t.parent),o=t.parent.left),bs(o.left)===0&&bs(o.right)===0?(Wt(o,1),t=t.parent):(bs(o.left)===0&&(Wt(o.right,0),Wt(o,1),j_(n,o),o=t.parent.left),Wt(o,bs(t.parent)),Wt(t.parent,0),Wt(o.left,0),q_(n,t.parent),t=n.root));Wt(t,0),M2()}function XCe(n){for(;n.left!==je;)n=n.left;return n}function M2(){je.parent=je,je.delta=0,je.start=0,je.end=0}function j_(n,e){const t=e.right;t.delta+=e.delta,(t.delta<-1073741824||t.delta>1073741824)&&(n.requestNormalizeDelta=!0),t.start+=e.delta,t.end+=e.delta,e.right=t.left,t.left!==je&&(t.left.parent=e),t.parent=e.parent,e.parent===je?n.root=t:e===e.parent.left?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t,au(e),au(t)}function q_(n,e){const t=e.left;e.delta-=t.delta,(e.delta<-1073741824||e.delta>1073741824)&&(n.requestNormalizeDelta=!0),e.start-=t.delta,e.end-=t.delta,e.left=t.right,t.right!==je&&(t.right.parent=e),t.parent=e.parent,e.parent===je?n.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t,au(e),au(t)}function Wq(n){let e=n.end;if(n.left!==je){const t=n.left.maxEnd;t>e&&(e=t)}if(n.right!==je){const t=n.right.maxEnd+n.delta;t>e&&(e=t)}return e}function au(n){n.maxEnd=Wq(n)}function Uc(n){for(;n!==je;){const e=Wq(n);if(n.maxEnd===e)return;n.maxEnd=e,n=n.parent}}function QCe(n,e,t,i){return n===t?e-i:n-t}class zT{constructor(e,t){this.piece=e,this.color=t,this.size_left=0,this.lf_left=0,this.parent=this,this.left=this,this.right=this}next(){if(this.right!==Me)return N3(this.right);let e=this;for(;e.parent!==Me&&e.parent.left!==e;)e=e.parent;return e.parent===Me?Me:e.parent}prev(){if(this.left!==Me)return Vq(this.left);let e=this;for(;e.parent!==Me&&e.parent.right!==e;)e=e.parent;return e.parent===Me?Me:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const Me=new zT(null,0);Me.parent=Me;Me.left=Me;Me.right=Me;Me.color=0;function N3(n){for(;n.left!==Me;)n=n.left;return n}function Vq(n){for(;n.right!==Me;)n=n.right;return n}function R3(n){return n===Me?0:n.size_left+n.piece.length+R3(n.right)}function M3(n){return n===Me?0:n.lf_left+n.piece.lineFeedCnt+M3(n.right)}function P2(){Me.parent=Me}function G_(n,e){const t=e.right;t.size_left+=e.size_left+(e.piece?e.piece.length:0),t.lf_left+=e.lf_left+(e.piece?e.piece.lineFeedCnt:0),e.right=t.left,t.left!==Me&&(t.left.parent=e),t.parent=e.parent,e.parent===Me?n.root=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}function K_(n,e){const t=e.left;e.left=t.right,t.right!==Me&&(t.right.parent=e),t.parent=e.parent,e.size_left-=t.size_left+(t.piece?t.piece.length:0),e.lf_left-=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),e.parent===Me?n.root=t:e===e.parent.right?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}function nw(n,e){let t,i;if(e.left===Me?(i=e,t=i.right):e.right===Me?(i=e,t=i.left):(i=N3(e.right),t=i.right),i===n.root){n.root=t,t.color=0,e.detach(),P2(),n.root.parent=Me;return}const s=i.color===1;if(i===i.parent.left?i.parent.left=t:i.parent.right=t,i===e?(t.parent=i.parent,v_(n,t)):(i.parent===e?t.parent=i:t.parent=i.parent,v_(n,t),i.left=e.left,i.right=e.right,i.parent=e.parent,i.color=e.color,e===n.root?n.root=i:e===e.parent.left?e.parent.left=i:e.parent.right=i,i.left!==Me&&(i.left.parent=i),i.right!==Me&&(i.right.parent=i),i.size_left=e.size_left,i.lf_left=e.lf_left,v_(n,i)),e.detach(),t.parent.left===t){const r=R3(t),a=M3(t);if(r!==t.parent.size_left||a!==t.parent.lf_left){const l=r-t.parent.size_left,c=a-t.parent.lf_left;t.parent.size_left=r,t.parent.lf_left=a,El(n,t.parent,l,c)}}if(v_(n,t.parent),s){P2();return}let o;for(;t!==n.root&&t.color===0;)t===t.parent.left?(o=t.parent.right,o.color===1&&(o.color=0,t.parent.color=1,G_(n,t.parent),o=t.parent.right),o.left.color===0&&o.right.color===0?(o.color=1,t=t.parent):(o.right.color===0&&(o.left.color=0,o.color=1,K_(n,o),o=t.parent.right),o.color=t.parent.color,t.parent.color=0,o.right.color=0,G_(n,t.parent),t=n.root)):(o=t.parent.left,o.color===1&&(o.color=0,t.parent.color=1,K_(n,t.parent),o=t.parent.left),o.left.color===0&&o.right.color===0?(o.color=1,t=t.parent):(o.left.color===0&&(o.right.color=0,o.color=1,G_(n,o),o=t.parent.left),o.color=t.parent.color,t.parent.color=0,o.left.color=0,K_(n,t.parent),t=n.root));t.color=0,P2()}function Q7(n,e){for(v_(n,e);e!==n.root&&e.parent.color===1;)if(e.parent===e.parent.parent.left){const t=e.parent.parent.right;t.color===1?(e.parent.color=0,t.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.right&&(e=e.parent,G_(n,e)),e.parent.color=0,e.parent.parent.color=1,K_(n,e.parent.parent))}else{const t=e.parent.parent.left;t.color===1?(e.parent.color=0,t.color=0,e.parent.parent.color=1,e=e.parent.parent):(e===e.parent.left&&(e=e.parent,K_(n,e)),e.parent.color=0,e.parent.parent.color=1,G_(n,e.parent.parent))}n.root.color=0}function El(n,e,t,i){for(;e!==n.root&&e!==Me;)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}function v_(n,e){let t=0,i=0;if(e!==n.root){for(;e!==n.root&&e===e.parent.right;)e=e.parent;if(e!==n.root)for(e=e.parent,t=R3(e.left)-e.size_left,i=M3(e.left)-e.lf_left,e.size_left+=t,e.lf_left+=i;e!==n.root&&(t!==0||i!==0);)e.parent.left===e&&(e.parent.size_left+=t,e.parent.lf_left+=i),e=e.parent}}const yl=65535;function zq(n){let e;return n[n.length-1]<65536?e=new Uint16Array(n.length):e=new Uint32Array(n.length),e.set(n,0),e}class JCe{constructor(e,t,i,s,o){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=s,this.isBasicASCII=o}}function Al(n,e=!0){const t=[0];let i=1;for(let s=0,o=n.length;s126)&&(r=!1)}const a=new JCe(zq(n),i,s,o,r);return n.length=0,a}class Ws{constructor(e,t,i,s,o){this.bufferIndex=e,this.start=t,this.end=i,this.lineFeedCnt=s,this.length=o}}class mh{constructor(e,t){this.buffer=e,this.lineStarts=t}}class tSe{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==Me&&e.iterate(e.root,i=>(i!==Me&&this._pieces.push(i.piece),!0))}read(){return this._pieces.length===0?this._index===0?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:this._index===0?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}}class iSe{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartOffset<=e&&i.nodeStartOffset+i.node.piece.length>=e)return i}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){const i=this._cache[t];if(i.nodeStartLineNumber&&i.nodeStartLineNumber=e)return i}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1;const i=this._cache;for(let s=0;s=e){i[s]=null,t=!0;continue}}if(t){const s=[];for(const o of i)o!==null&&s.push(o);this._cache=s}}}class nSe{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new mh("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=Me,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let s=null;for(let o=0,r=e.length;o0){e[o].lineStarts||(e[o].lineStarts=Al(e[o].buffer));const a=new Ws(o+1,{line:0,column:0},{line:e[o].lineStarts.length-1,column:e[o].buffer.length-e[o].lineStarts[e[o].lineStarts.length-1]},e[o].lineStarts.length-1,e[o].buffer.length);this._buffers.push(e[o]),s=this.rbInsertRight(s,a)}this._searchCache=new iSe(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=yl,i=t-Math.floor(t/3),s=i*2;let o="",r=0;const a=[];if(this.iterate(this.root,l=>{const c=this.getNodeContent(l),d=c.length;if(r<=i||r+d0){const l=o.replace(/\r\n|\r|\n/g,e);a.push(new mh(l,Al(l)))}this.create(a,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new tSe(this,e)}getOffsetAt(e,t){let i=0,s=this.root;for(;s!==Me;)if(s.left!==Me&&s.lf_left+1>=e)s=s.left;else if(s.lf_left+s.piece.lineFeedCnt+1>=e){i+=s.size_left;const o=this.getAccumulatedValue(s,e-s.lf_left-2);return i+=o+t-1}else e-=s.lf_left+s.piece.lineFeedCnt,i+=s.size_left+s.piece.length,s=s.right;return i}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,i=0;const s=e;for(;t!==Me;)if(t.size_left!==0&&t.size_left>=e)t=t.left;else if(t.size_left+t.piece.length>=e){const o=this.getIndexOf(t,e-t.size_left);if(i+=t.lf_left+o.index,o.index===0){const r=this.getOffsetAt(i+1,1),a=s-r;return new V(i+1,a+1)}return new V(i+1,o.remainder+1)}else if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===Me){const o=this.getOffsetAt(i+1,1),r=s-e-o;return new V(i+1,r+1)}else t=t.right;return new V(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return"";const i=this.nodeAt2(e.startLineNumber,e.startColumn),s=this.nodeAt2(e.endLineNumber,e.endColumn),o=this.getValueInRange2(i,s);return t?t!==this._EOL||!this._EOLNormalized?o.replace(/\r\n|\r|\n/g,t):t===this.getEOL()&&this._EOLNormalized?o:o.replace(/\r\n|\r|\n/g,t):o}getValueInRange2(e,t){if(e.node===t.node){const a=e.node,l=this._buffers[a.piece.bufferIndex].buffer,c=this.offsetInBuffer(a.piece.bufferIndex,a.piece.start);return l.substring(c+e.remainder,c+t.remainder)}let i=e.node;const s=this._buffers[i.piece.bufferIndex].buffer,o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);let r=s.substring(o+e.remainder,o+i.piece.length);for(i=i.next();i!==Me;){const a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(i===t.node){r+=a.substring(l,l+t.remainder);break}else r+=a.substr(l,i.piece.length);i=i.next()}return r}getLinesContent(){const e=[];let t=0,i="",s=!1;return this.iterate(this.root,o=>{if(o===Me)return!0;const r=o.piece;let a=r.length;if(a===0)return!0;const l=this._buffers[r.bufferIndex].buffer,c=this._buffers[r.bufferIndex].lineStarts,d=r.start.line,u=r.end.line;let h=c[d]+r.start.column;if(s&&(l.charCodeAt(h)===10&&(h++,a--),e[t++]=i,i="",s=!1,a===0))return!0;if(d===u)return!this._EOLNormalized&&l.charCodeAt(h+a-1)===13?(s=!0,i+=l.substr(h,a-1)):i+=l.substr(h,a),!0;i+=this._EOLNormalized?l.substring(h,Math.max(h,c[d+1]-this._EOLLength)):l.substring(h,c[d+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;for(let f=d+1;fw+g,t.reset(0)):(b=h.buffer,y=w=>w,t.reset(g));do if(_=t.next(b),_){if(y(_.index)>=p)return d;this.positionInBuffer(e,y(_.index)-f,v);const w=this.getLineFeedCnt(e.piece.bufferIndex,o,v),S=v.line===o.line?v.column-o.column+s:v.column+1,L=S+_[0].length;if(u[d++]=ch(new N(i+w,S,i+w,L),_,l),y(_.index)+_[0].length>=p||d>=c)return d}while(_);return d}findMatchesLineByLine(e,t,i,s){const o=[];let r=0;const a=new Hg(t.wordSeparators,t.regex);let l=this.nodeAt2(e.startLineNumber,e.startColumn);if(l===null)return[];const c=this.nodeAt2(e.endLineNumber,e.endColumn);if(c===null)return[];let d=this.positionInBuffer(l.node,l.remainder);const u=this.positionInBuffer(c.node,c.remainder);if(l.node===c.node)return this.findMatchesInNode(l.node,a,e.startLineNumber,e.startColumn,d,u,t,i,s,r,o),o;let h=e.startLineNumber,f=l.node;for(;f!==c.node;){const p=this.getLineFeedCnt(f.piece.bufferIndex,d,f.piece.end);if(p>=1){const v=this._buffers[f.piece.bufferIndex].lineStarts,b=this.offsetInBuffer(f.piece.bufferIndex,f.piece.start),y=v[d.line+p],w=h===e.startLineNumber?e.startColumn:1;if(r=this.findMatchesInNode(f,a,h,w,d,this.positionInBuffer(f,y-b),t,i,s,r,o),r>=s)return o;h+=p}const _=h===e.startLineNumber?e.startColumn-1:0;if(h===e.endLineNumber){const v=this.getLineContent(h).substring(_,e.endColumn-1);return r=this._findMatchesInLine(t,a,v,e.endLineNumber,_,r,o,i,s),o}if(r=this._findMatchesInLine(t,a,this.getLineContent(h).substr(_),h,_,r,o,i,s),r>=s)return o;h++,l=this.nodeAt2(h,1),f=l.node,d=this.positionInBuffer(l.node,l.remainder)}if(h===e.endLineNumber){const p=h===e.startLineNumber?e.startColumn-1:0,_=this.getLineContent(h).substring(p,e.endColumn-1);return r=this._findMatchesInLine(t,a,_,e.endLineNumber,p,r,o,i,s),o}const g=h===e.startLineNumber?e.startColumn:1;return r=this.findMatchesInNode(c.node,a,h,g,d,u,t,i,s,r,o),o}_findMatchesInLine(e,t,i,s,o,r,a,l,c){const d=e.wordSeparators;if(!l&&e.simpleSearch){const h=e.simpleSearch,f=h.length,g=i.length;let p=-f;for(;(p=i.indexOf(h,p+f))!==-1;)if((!d||t3(d,i,g,p,f))&&(a[r++]=new Kb(new N(s,p+1+o,s,p+1+f+o),null),r>=c))return r;return r}let u;t.reset(0);do if(u=t.next(i),u&&(a[r++]=ch(new N(s,u.index+1+o,s,u.index+1+u[0].length+o),u,l),r>=c))return r;while(u);return r}insert(e,t,i=!1){if(this._EOLNormalized=this._EOLNormalized&&i,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==Me){const{node:s,remainder:o,nodeStartOffset:r}=this.nodeAt(e),a=s.piece,l=a.bufferIndex,c=this.positionInBuffer(s,o);if(s.piece.bufferIndex===0&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&r+a.length===e&&t.lengthe){const d=[];let u=new Ws(a.bufferIndex,c,a.end,this.getLineFeedCnt(a.bufferIndex,c,a.end),this.offsetInBuffer(l,a.end)-this.offsetInBuffer(l,c));if(this.shouldCheckCRLF()&&this.endWithCR(t)&&this.nodeCharCodeAt(s,o)===10){const p={line:u.start.line+1,column:0};u=new Ws(u.bufferIndex,p,u.end,this.getLineFeedCnt(u.bufferIndex,p,u.end),u.length-1),t+=` +`}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(this.nodeCharCodeAt(s,o-1)===13){const p=this.positionInBuffer(s,o-1);this.deleteNodeTail(s,p),t="\r"+t,s.piece.length===0&&d.push(s)}else this.deleteNodeTail(s,c);else this.deleteNodeTail(s,c);const h=this.createNewPieces(t);u.length>0&&this.rbInsertRight(s,u);let f=s;for(let g=0;g=0;r--)o=this.rbInsertLeft(o,s[r]);this.validateCRLFWithPrevNode(o),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=` +`);const i=this.createNewPieces(e),s=this.rbInsertRight(t,i[0]);let o=s;for(let r=1;r=h)c=u+1;else break;return i?(i.line=u,i.column=l-f,null):{line:u,column:l-f}}getLineFeedCnt(e,t,i){if(i.column===0)return i.line-t.line;const s=this._buffers[e].lineStarts;if(i.line===s.length-1)return i.line-t.line;const o=s[i.line+1],r=s[i.line]+i.column;if(o>r+1)return i.line-t.line;const a=r-1;return this._buffers[e].buffer.charCodeAt(a)===13?i.line-t.line+1:i.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;tyl){const d=[];for(;e.length>yl;){const h=e.charCodeAt(yl-1);let f;h===13||h>=55296&&h<=56319?(f=e.substring(0,yl-1),e=e.substring(yl-1)):(f=e.substring(0,yl),e=e.substring(yl));const g=Al(f);d.push(new Ws(this._buffers.length,{line:0,column:0},{line:g.length-1,column:f.length-g[g.length-1]},g.length-1,f.length)),this._buffers.push(new mh(f,g))}const u=Al(e);return d.push(new Ws(this._buffers.length,{line:0,column:0},{line:u.length-1,column:e.length-u[u.length-1]},u.length-1,e.length)),this._buffers.push(new mh(e,u)),d}let t=this._buffers[0].buffer.length;const i=Al(e,!1);let s=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&t!==0&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},s=this._lastChangeBufferPos;for(let d=0;d=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const l=this.getAccumulatedValue(i,e-i.lf_left-2),c=this.getAccumulatedValue(i,e-i.lf_left-1),d=this._buffers[i.piece.bufferIndex].buffer,u=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return r+=i.size_left,this._searchCache.set({node:i,nodeStartOffset:r,nodeStartLineNumber:a-(e-1-i.lf_left)}),d.substring(u+l,u+c-t)}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const l=this.getAccumulatedValue(i,e-i.lf_left-2),c=this._buffers[i.piece.bufferIndex].buffer,d=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);s=c.substring(d+l,d+i.piece.length);break}else e-=i.lf_left+i.piece.lineFeedCnt,r+=i.size_left+i.piece.length,i=i.right}for(i=i.next();i!==Me;){const r=this._buffers[i.piece.bufferIndex].buffer;if(i.piece.lineFeedCnt>0){const a=this.getAccumulatedValue(i,0),l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return s+=r.substring(l,l+a-t),s}else{const a=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);s+=r.substr(a,i.piece.length)}i=i.next()}return s}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==Me;)t+=e.lf_left+e.piece.lineFeedCnt,i+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=i,this._searchCache.validate(this._length)}getIndexOf(e,t){const i=e.piece,s=this.positionInBuffer(e,t),o=s.line-i.start.line;if(this.offsetInBuffer(i.bufferIndex,i.end)-this.offsetInBuffer(i.bufferIndex,i.start)===t){const r=this.getLineFeedCnt(e.piece.bufferIndex,i.start,s);if(r!==o)return{index:r,remainder:0}}return{index:o,remainder:s.column}}getAccumulatedValue(e,t){if(t<0)return 0;const i=e.piece,s=this._buffers[i.bufferIndex].lineStarts,o=i.start.line+t+1;return o>i.end.line?s[i.end.line]+i.end.column-s[i.start.line]-i.start.column:s[o]-s[i.start.line]-i.start.column}deleteNodeTail(e,t){const i=e.piece,s=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.end),r=t,a=this.offsetInBuffer(i.bufferIndex,r),l=this.getLineFeedCnt(i.bufferIndex,i.start,r),c=l-s,d=a-o,u=i.length+d;e.piece=new Ws(i.bufferIndex,i.start,r,l,u),El(this,e,d,c)}deleteNodeHead(e,t){const i=e.piece,s=i.lineFeedCnt,o=this.offsetInBuffer(i.bufferIndex,i.start),r=t,a=this.getLineFeedCnt(i.bufferIndex,r,i.end),l=this.offsetInBuffer(i.bufferIndex,r),c=a-s,d=o-l,u=i.length+d;e.piece=new Ws(i.bufferIndex,r,i.end,a,u),El(this,e,d,c)}shrinkNode(e,t,i){const s=e.piece,o=s.start,r=s.end,a=s.length,l=s.lineFeedCnt,c=t,d=this.getLineFeedCnt(s.bufferIndex,s.start,c),u=this.offsetInBuffer(s.bufferIndex,t)-this.offsetInBuffer(s.bufferIndex,o);e.piece=new Ws(s.bufferIndex,s.start,c,d,u),El(this,e,u-a,d-l);const h=new Ws(s.bufferIndex,i,r,this.getLineFeedCnt(s.bufferIndex,i,r),this.offsetInBuffer(s.bufferIndex,r)-this.offsetInBuffer(s.bufferIndex,i)),f=this.rbInsertRight(e,h);this.validateCRLFWithPrevNode(f)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+=` +`);const i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),s=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const o=Al(t,!1);for(let f=0;fe)t=t.left;else if(t.size_left+t.piece.length>=e){s+=t.size_left;const o={node:t,remainder:e-t.size_left,nodeStartOffset:s};return this._searchCache.set(o),o}else e-=t.size_left+t.piece.length,s+=t.size_left+t.piece.length,t=t.right;return null}nodeAt2(e,t){let i=this.root,s=0;for(;i!==Me;)if(i.left!==Me&&i.lf_left>=e-1)i=i.left;else if(i.lf_left+i.piece.lineFeedCnt>e-1){const o=this.getAccumulatedValue(i,e-i.lf_left-2),r=this.getAccumulatedValue(i,e-i.lf_left-1);return s+=i.size_left,{node:i,remainder:Math.min(o+t-1,r),nodeStartOffset:s}}else if(i.lf_left+i.piece.lineFeedCnt===e-1){const o=this.getAccumulatedValue(i,e-i.lf_left-2);if(o+t-1<=i.piece.length)return{node:i,remainder:o+t-1,nodeStartOffset:s};t-=i.piece.length-o;break}else e-=i.lf_left+i.piece.lineFeedCnt,s+=i.size_left+i.piece.length,i=i.right;for(i=i.next();i!==Me;){if(i.piece.lineFeedCnt>0){const o=this.getAccumulatedValue(i,0),r=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,o),nodeStartOffset:r}}else if(i.piece.length>=t-1){const o=this.offsetOfNode(i);return{node:i,remainder:t-1,nodeStartOffset:o}}else t-=i.piece.length;i=i.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;const i=this._buffers[e.piece.bufferIndex],s=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return i.buffer.charCodeAt(s)}offsetOfNode(e){if(!e)return 0;let t=e.size_left;for(;e!==this.root;)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t}shouldCheckCRLF(){return!(this._EOLNormalized&&this._EOL===` +`)}startWithLF(e){if(typeof e=="string")return e.charCodeAt(0)===10;if(e===Me||e.piece.lineFeedCnt===0)return!1;const t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,s=t.start.line,o=i[s]+t.start.column;return s===i.length-1||i[s+1]>o+1?!1:this._buffers[t.bufferIndex].buffer.charCodeAt(o)===10}endWithCR(e){return typeof e=="string"?e.charCodeAt(e.length-1)===13:e===Me||e.piece.lineFeedCnt===0?!1:this.nodeCharCodeAt(e,e.piece.length-1)===13}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){const t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){const t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){const i=[],s=this._buffers[e.piece.bufferIndex].lineStarts;let o;e.piece.end.column===0?o={line:e.piece.end.line-1,column:s[e.piece.end.line]-s[e.piece.end.line-1]-1}:o={line:e.piece.end.line,column:e.piece.end.column-1};const r=e.piece.length-1,a=e.piece.lineFeedCnt-1;e.piece=new Ws(e.piece.bufferIndex,e.piece.start,o,a,r),El(this,e,-1,-1),e.piece.length===0&&i.push(e);const l={line:t.piece.start.line+1,column:0},c=t.piece.length-1,d=this.getLineFeedCnt(t.piece.bufferIndex,l,t.piece.end);t.piece=new Ws(t.piece.bufferIndex,l,t.piece.end,d,c),El(this,t,-1,-1),t.piece.length===0&&i.push(t);const u=this.createNewPieces(`\r +`);this.rbInsertRight(e,u[0]);for(let h=0;h_.sortIndex-v.sortIndex)}this._mightContainRTL=s,this._mightContainUnusualLineTerminators=o,this._mightContainNonBasicASCII=r;const f=this._doApplyEdits(l);let g=null;if(t&&u.length>0){u.sort((p,_)=>_.lineNumber-p.lineNumber),g=[];for(let p=0,_=u.length;p<_;p++){const v=u[p].lineNumber;if(p>0&&u[p-1].lineNumber===v)continue;const b=u[p].oldContent,y=this.getLineContent(v);y.length===0||y===b||Qs(y)!==-1||g.push(v)}}return this._onDidChangeContent.fire(),new q0e(h,f,g)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const i=e[0].range,s=e[e.length-1].range,o=new N(i.startLineNumber,i.startColumn,s.endLineNumber,s.endColumn);let r=i.startLineNumber,a=i.startColumn;const l=[];for(let f=0,g=e.length;f0&&l.push(p.text),r=_.endLineNumber,a=_.endColumn}const c=l.join(""),[d,u,h]=Cf(c);return{sortIndex:0,identifier:e[0].identifier,range:o,rangeOffset:this.getOffsetAt(o.startLineNumber,o.startColumn),rangeLength:this.getValueLengthInRange(o,0),text:c,eolCount:d,firstLineLength:u,lastLineLength:h,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(xp._sortOpsDescending);const t=[];for(let i=0;i0){const h=l.eolCount+1;h===1?u=new N(c,d,c,d+l.firstLineLength):u=new N(c,d,c+h-1,l.lastLineLength+1)}else u=new N(c,d,c,d);i=u.endLineNumber,s=u.endColumn,t.push(u),o=l}return t}static _sortOpsAscending(e,t){const i=N.compareRangesUsingEnds(e.range,t.range);return i===0?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){const i=N.compareRangesUsingEnds(e.range,t.range);return i===0?t.sortIndex-e.sortIndex:-i}}class BCe{constructor(e,t,i,s,o,r,a,l,c){this._chunks=e,this._bom=t,this._cr=i,this._lf=s,this._crlf=o,this._containsRTL=r,this._containsUnusualLineTerminators=a,this._isBasicASCII=l,this._normalizeEOL=c}_getEOL(e){const t=this._cr+this._lf+this._crlf,i=this._cr+this._crlf;return t===0?e===1?` +`;case 0:return this.getEOL();default:throw new Error("Unknown EOL preference")}}setEOL(e){this._pieceTree.setEOL(e)}applyEdits(e,t,i){let s=this._mightContainRTL,o=this._mightContainUnusualLineTerminators,r=this._mightContainNonBasicASCII,a=!0,l=[];for(let p=0;p_.sortIndex-v.sortIndex)}this._mightContainRTL=s,this._mightContainUnusualLineTerminators=o,this._mightContainNonBasicASCII=r;const f=this._doApplyEdits(l);let g=null;if(t&&u.length>0){u.sort((p,_)=>_.lineNumber-p.lineNumber),g=[];for(let p=0,_=u.length;p<_;p++){const v=u[p].lineNumber;if(p>0&&u[p-1].lineNumber===v)continue;const b=u[p].oldContent,y=this.getLineContent(v);y.length===0||y===b||Ys(y)!==-1||g.push(v)}}return this._onDidChangeContent.fire(),new h_e(h,f,g)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1;const i=e[0].range,s=e[e.length-1].range,o=new N(i.startLineNumber,i.startColumn,s.endLineNumber,s.endColumn);let r=i.startLineNumber,a=i.startColumn;const l=[];for(let f=0,g=e.length;f0&&l.push(p.text),r=_.endLineNumber,a=_.endColumn}const c=l.join(""),[d,u,h]=Lf(c);return{sortIndex:0,identifier:e[0].identifier,range:o,rangeOffset:this.getOffsetAt(o.startLineNumber,o.startColumn),rangeLength:this.getValueLengthInRange(o,0),text:c,eolCount:d,firstLineLength:u,lastLineLength:h,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(Dp._sortOpsDescending);const t=[];for(let i=0;i0){const h=l.eolCount+1;h===1?u=new N(c,d,c,d+l.firstLineLength):u=new N(c,d,c+h-1,l.lastLineLength+1)}else u=new N(c,d,c,d);i=u.endLineNumber,s=u.endColumn,t.push(u),o=l}return t}static _sortOpsAscending(e,t){const i=N.compareRangesUsingEnds(e.range,t.range);return i===0?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){const i=N.compareRangesUsingEnds(e.range,t.range);return i===0?t.sortIndex-e.sortIndex:-i}}class sSe{constructor(e,t,i,s,o,r,a,l,c){this._chunks=e,this._bom=t,this._cr=i,this._lf=s,this._crlf=o,this._containsRTL=r,this._containsUnusualLineTerminators=a,this._isBasicASCII=l,this._normalizeEOL=c}_getEOL(e){const t=this._cr+this._lf+this._crlf,i=this._cr+this._crlf;return t===0?e===1?` `:`\r `:i>t/2?`\r `:` `}create(e){const t=this._getEOL(e),i=this._chunks;if(this._normalizeEOL&&(t===`\r `&&(this._cr>0||this._lf>0)||t===` -`&&(this._cr>0||this._crlf>0)))for(let o=0,r=i.length;o=55296&&t<=56319?(this._acceptChunk1(e.substr(0,e.length-1),!1),this._hasPreviousChar=!0,this._previousChar=t):(this._acceptChunk1(e,!1),this._hasPreviousChar=!1,this._previousChar=t)}_acceptChunk1(e,t){!t&&e.length===0||(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){const t=MCe(this._tmpLineStarts,e);this.chunks.push(new gh(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=Vb(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=NU(e)))}finish(e=!0){return this._finish(),new BCe(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(this.chunks.length===0&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;const e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);const t=El(e.buffer);e.lineStarts=t,this._previousChar===13&&this.cr++}}}class WCe{constructor(e){this._default=e,this._store=[]}get(e){return e=this._store.length;)this._store[this._store.length]=this._default;this._store[e]=t}replace(e,t,i){if(e>=this._store.length)return;if(t===0){this.insert(e,i);return}else if(i===0){this.delete(e,t);return}const s=this._store.slice(0,e),o=this._store.slice(e+t),r=VCe(i,this._default);this._store=s.concat(r,o)}delete(e,t){t===0||e>=this._store.length||this._store.splice(e,t)}insert(e,t){if(t===0||e>=this._store.length)return;const i=[];for(let s=0;s0){const i=this._tokens[this._tokens.length-1];if(i.endLineNumber+1===e){i.appendLineTokens(t);return}}this._tokens.push(new zCe(e,[t]))}finalize(){return this._tokens}}class HCe{constructor(e,t){this.tokenizationSupport=t,this.initialState=this.tokenizationSupport.getInitialState(),this.store=new jT(e)}getStartState(e){return this.store.getStartState(e,this.initialState)}getFirstInvalidLine(){return this.store.getFirstInvalidLine(this.initialState)}}class $Ce extends HCe{constructor(e,t,i,s){super(e,t),this._textModel=i,this._languageIdCodec=s}updateTokensUntilLine(e,t){const i=this._textModel.getLanguageId();for(;;){const s=this.getFirstInvalidLine();if(!s||s.lineNumber>t)break;const o=this._textModel.getLineContent(s.lineNumber),r=M0(this._languageIdCodec,i,this.tokenizationSupport,o,!0,s.startState);e.add(s.lineNumber,r.tokens),this.store.setEndState(s.lineNumber,r.endState)}}getTokenTypeIfInsertingCharacter(e,t){const i=this.getStartState(e.lineNumber);if(!i)return 0;const s=this._textModel.getLanguageId(),o=this._textModel.getLineContent(e.lineNumber),r=o.substring(0,e.column-1)+t+o.substring(e.column-1),a=M0(this._languageIdCodec,s,this.tokenizationSupport,r,!0,i),l=new an(a.tokens,r,this._languageIdCodec);if(l.getCount()===0)return 0;const c=l.findTokenIndexAtOffset(e.column-1);return l.getStandardTokenType(c)}tokenizeLineWithEdit(e,t,i){const s=e.lineNumber,o=e.column,r=this.getStartState(s);if(!r)return null;const a=this._textModel.getLineContent(s),l=a.substring(0,o-1)+i+a.substring(o-1+t),c=this._textModel.getLanguageIdAtPosition(s,0),d=M0(this._languageIdCodec,c,this.tokenizationSupport,l,!0,r);return new an(d.tokens,l,this._languageIdCodec)}isCheapToTokenize(e){const t=this.store.getFirstInvalidEndStateLineNumberOrMax();return e1&&a>=1;a--){const l=this._textModel.getLineFirstNonWhitespaceColumn(a);if(l!==0&&l0&&i>0&&(i--,t--),this._lineEndStates.replace(e.startLineNumber,i,t)}}class jCe{constructor(){this._ranges=[]}get min(){return this._ranges.length===0?null:this._ranges[0].start}delete(e){const t=this._ranges.findIndex(i=>i.contains(e));if(t!==-1){const i=this._ranges[t];i.start===e?i.endExclusive===e+1?this._ranges.splice(t,1):this._ranges[t]=new Ye(e+1,i.endExclusive):i.endExclusive===e+1?this._ranges[t]=new Ye(i.start,e):this._ranges.splice(t,1,new Ye(i.start,e),new Ye(e+1,i.endExclusive))}}addRange(e){Ye.addRange(e,this._ranges)}addRangeAndResize(e,t){let i=0;for(;!(i>=this._ranges.length||e.start<=this._ranges[i].endExclusive);)i++;let s=i;for(;!(s>=this._ranges.length||e.endExclusivee.toString()).join(" + ")}}function M0(n,e,t,i,s,o){let r=null;if(t)try{r=t.tokenizeEncoded(i,s,o.clone())}catch(a){_t(a)}return r||(r=aP(n.encodeLanguageId(e),o)),an.convertToEndOffset(r.tokens,i.length),r}class qCe{constructor(e,t){this._tokenizerWithStateStore=e,this._backgroundTokenStore=t,this._isDisposed=!1,this._isScheduled=!1}dispose(){this._isDisposed=!0}handleChanges(){this._beginBackgroundTokenization()}_beginBackgroundTokenization(){this._isScheduled||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._isScheduled=!0,dd(e=>{this._isScheduled=!1,this._backgroundTokenizeWithDeadline(e)}))}_backgroundTokenizeWithDeadline(e){const t=Date.now()+e.timeRemaining(),i=()=>{this._isDisposed||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._backgroundTokenizeForAtLeast1ms(),Date.now()1||this._tokenizeOneInvalidLine(t)>=e)break;while(this._hasLinesToTokenize());this._backgroundTokenStore.setTokens(t.finalize()),this.checkFinished()}_hasLinesToTokenize(){return this._tokenizerWithStateStore?!this._tokenizerWithStateStore.store.allStatesValid():!1}_tokenizeOneInvalidLine(e){var t;const i=(t=this._tokenizerWithStateStore)===null||t===void 0?void 0:t.getFirstInvalidLine();return i?(this._tokenizerWithStateStore.updateTokensUntilLine(e,i.lineNumber),i.lineNumber):this._tokenizerWithStateStore._textModel.getLineCount()+1}checkFinished(){this._isDisposed||this._tokenizerWithStateStore.store.allStatesValid()&&this._backgroundTokenStore.backgroundTokenizationFinished()}requestTokens(e,t){this._tokenizerWithStateStore.store.invalidateEndStateRange(new Qe(e,t))}}const Al=new Uint32Array(0).buffer;class xa{static deleteBeginning(e,t){return e===null||e===Al?e:xa.delete(e,0,t)}static deleteEnding(e,t){if(e===null||e===Al)return e;const i=ql(e),s=i[i.length-2];return xa.delete(e,t,s)}static delete(e,t,i){if(e===null||e===Al||t===i)return e;const s=ql(e),o=s.length>>>1;if(t===0&&s[s.length-2]===i)return Al;const r=an.findIndexInTokensArray(s,t),a=r>0?s[r-1<<1]:0,l=s[r<<1];if(id&&(s[c++]=g,s[c++]=s[(f<<1)+1],d=g)}if(c===s.length)return e;const h=new Uint32Array(c);return h.set(s.subarray(0,c),0),h.buffer}static append(e,t){if(t===Al)return e;if(e===Al)return t;if(e===null)return e;if(t===null)return null;const i=ql(e),s=ql(t),o=s.length>>>1,r=new Uint32Array(i.length+s.length);r.set(i,0);let a=i.length;const l=i[i.length-2];for(let c=0;c>>1;let r=an.findIndexInTokensArray(s,t);r>0&&s[r-1<<1]===t&&r--;for(let a=r;a0}getTokens(e,t,i){let s=null;if(t1&&(o=qs.getLanguageId(s[1])!==e),!o)return Al}if(!s||s.length===0){const o=new Uint32Array(2);return o[0]=t,o[1]=n6(e),o.buffer}return s[s.length-2]=t,s.byteOffset===0&&s.byteLength===s.buffer.byteLength?s.buffer:s}_ensureLine(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++}_deleteLines(e,t){t!==0&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)}_insertLines(e,t){if(t===0)return;const i=[];for(let s=0;s=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;this._lineTokens[t]=xa.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1);return}this._lineTokens[t]=xa.deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let s=null;i=this._len)){if(t===0){this._lineTokens[s]=xa.insert(this._lineTokens[s],e.column-1,i);return}this._lineTokens[s]=xa.deleteEnding(this._lineTokens[s],e.column-1),this._lineTokens[s]=xa.insert(this._lineTokens[s],e.column-1,i),this._insertLines(e.lineNumber,t)}}setMultilineTokens(e,t){if(e.length===0)return{changes:[]};const i=[];for(let s=0,o=e.length;s>>0}class FP{constructor(e){this._pieces=[],this._isComplete=!1,this._languageIdCodec=e}flush(){this._pieces=[],this._isComplete=!1}isEmpty(){return this._pieces.length===0}set(e,t){this._pieces=e||[],this._isComplete=t}setPartial(e,t){let i=e;if(t.length>0){const o=t[0].getRange(),r=t[t.length-1].getRange();if(!o||!r)return e;i=e.plusRange(o).plusRange(r)}let s=null;for(let o=0,r=this._pieces.length;oi.endLineNumber){s=s||{index:o};break}if(a.removeTokens(i),a.isEmpty()){this._pieces.splice(o,1),o--,r--;continue}if(a.endLineNumberi.endLineNumber){s=s||{index:o};continue}const[l,c]=a.split(i);if(l.isEmpty()){s=s||{index:o};continue}c.isEmpty()||(this._pieces.splice(o,1,l,c),o++,r++,s=s||{index:o})}return s=s||{index:this._pieces.length},t.length>0&&(this._pieces=zL(this._pieces,s.index,t)),i}isComplete(){return this._isComplete}addSparseTokens(e,t){if(t.getLineContent().length===0)return t;const i=this._pieces;if(i.length===0)return t;const s=FP._findFirstPieceWithLine(i,e),o=i[s].getLineTokens(e);if(!o)return t;const r=t.getCount(),a=o.getCount();let l=0;const c=[];let d=0,u=0;const h=(f,g)=>{f!==u&&(u=f,c[d++]=f,c[d++]=g)};for(let f=0;f>>0,b=~v>>>0;for(;lt)s=o-1;else{for(;o>i&&e[o-1].startLineNumber<=t&&t<=e[o-1].endLineNumber;)o--;return o}}return i}acceptEdit(e,t,i,s,o){for(const r of this._pieces)r.acceptEdit(e,t,i,s,o)}}class nx extends Lq{constructor(e,t,i,s,o,r){super(),this._languageService=e,this._languageConfigurationService=t,this._textModel=i,this._bracketPairsTextModelPart=s,this._languageId=o,this._attachedViews=r,this._semanticTokens=new FP(this._languageService.languageIdCodec),this._onDidChangeLanguage=this._register(new B),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new B),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new B),this.onDidChangeTokens=this._onDidChangeTokens.event,this.grammarTokens=this._register(new GCe(this._languageService.languageIdCodec,this._textModel,()=>this._languageId,this._attachedViews)),this._register(this._languageConfigurationService.onDidChange(a=>{a.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})})),this._register(this.grammarTokens.onDidChangeTokens(a=>{this._emitModelTokensChangedEvent(a)})),this._register(this.grammarTokens.onDidChangeBackgroundTokenizationState(a=>{this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState()}))}handleDidChangeContent(e){if(e.isFlush)this._semanticTokens.flush();else if(!e.isEolChange)for(const t of e.changes){const[i,s,o]=Cf(t.text);this._semanticTokens.acceptEdit(t.range,i,s,o,t.text.length>0?t.text.charCodeAt(0):0)}this.grammarTokens.handleDidChangeContent(e)}handleDidChangeAttached(){this.grammarTokens.handleDidChangeAttached()}getLineTokens(e){this.validateLineNumber(e);const t=this.grammarTokens.getLineTokens(e);return this._semanticTokens.addSparseTokens(e,t)}_emitModelTokensChangedEvent(e){this._textModel._isDisposing()||(this._bracketPairsTextModelPart.handleDidChangeTokens(e),this._onDidChangeTokens.fire(e))}validateLineNumber(e){if(e<1||e>this._textModel.getLineCount())throw new Gi("Illegal value for lineNumber")}get hasTokens(){return this.grammarTokens.hasTokens}resetTokenization(){this.grammarTokens.resetTokenization()}get backgroundTokenizationState(){return this.grammarTokens.backgroundTokenizationState}forceTokenization(e){this.validateLineNumber(e),this.grammarTokens.forceTokenization(e)}isCheapToTokenize(e){return this.validateLineNumber(e),this.grammarTokens.isCheapToTokenize(e)}tokenizeIfCheap(e){this.validateLineNumber(e),this.grammarTokens.tokenizeIfCheap(e)}getTokenTypeIfInsertingCharacter(e,t,i){return this.grammarTokens.getTokenTypeIfInsertingCharacter(e,t,i)}tokenizeLineWithEdit(e,t,i){return this.grammarTokens.tokenizeLineWithEdit(e,t,i)}setSemanticTokens(e,t){this._semanticTokens.set(e,t),this._emitModelTokensChangedEvent({semanticTokensApplied:e!==null,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]})}hasCompleteSemanticTokens(){return this._semanticTokens.isComplete()}hasSomeSemanticTokens(){return!this._semanticTokens.isEmpty()}setPartialSemanticTokens(e,t){if(this.hasCompleteSemanticTokens())return;const i=this._textModel.validateRange(this._semanticTokens.setPartial(e,t));this._emitModelTokensChangedEvent({semanticTokensApplied:!0,ranges:[{fromLineNumber:i.startLineNumber,toLineNumber:i.endLineNumber}]})}getWordAtPosition(e){this.assertNotDisposed();const t=this._textModel.validatePosition(e),i=this._textModel.getLineContent(t.lineNumber),s=this.getLineTokens(t.lineNumber),o=s.findTokenIndexAtOffset(t.column-1),[r,a]=nx._findLanguageBoundaries(s,o),l=Pb(t.column,this.getLanguageConfiguration(s.getLanguageId(o)).getWordDefinition(),i.substring(r,a),r);if(l&&l.startColumn<=e.column&&e.column<=l.endColumn)return l;if(o>0&&r===t.column-1){const[c,d]=nx._findLanguageBoundaries(s,o-1),u=Pb(t.column,this.getLanguageConfiguration(s.getLanguageId(o-1)).getWordDefinition(),i.substring(c,d),c);if(u&&u.startColumn<=e.column&&e.column<=u.endColumn)return u}return null}getLanguageConfiguration(e){return this._languageConfigurationService.getLanguageConfiguration(e)}static _findLanguageBoundaries(e,t){const i=e.getLanguageId(t);let s=0;for(let r=t;r>=0&&e.getLanguageId(r)===i;r--)s=e.getStartOffset(r);let o=e.getLineContent().length;for(let r=t,a=e.getCount();r{const r=this.getLanguageId();o.changedLanguages.indexOf(r)!==-1&&this.resetTokenization()})),this.resetTokenization(),this._register(s.onDidChangeVisibleRanges(({view:o,state:r})=>{if(r){let a=this._attachedViewStates.get(o);a||(a=new KCe(()=>this.refreshRanges(a.lineRanges)),this._attachedViewStates.set(o,a)),a.handleStateChange(r)}else this._attachedViewStates.deleteAndDispose(o)}))}resetTokenization(e=!0){var t;this._tokens.flush(),(t=this._debugBackgroundTokens)===null||t===void 0||t.flush(),this._debugBackgroundStates&&(this._debugBackgroundStates=new jT(this._textModel.getLineCount())),e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]});const i=()=>{if(this._textModel.isTooLargeForTokenization())return[null,null];const r=xi.get(this.getLanguageId());if(!r)return[null,null];let a;try{a=r.getInitialState()}catch(l){return _t(l),[null,null]}return[r,a]},[s,o]=i();if(s&&o?this._tokenizer=new $Ce(this._textModel.getLineCount(),s,this._textModel,this._languageIdCodec):this._tokenizer=null,this._backgroundTokenizer.clear(),this._defaultBackgroundTokenizer=null,this._tokenizer){const r={setTokens:a=>{this.setTokens(a)},backgroundTokenizationFinished:()=>{if(this._backgroundTokenizationState===2)return;const a=2;this._backgroundTokenizationState=a,this._onDidChangeBackgroundTokenizationState.fire()},setEndState:(a,l)=>{var c;if(!this._tokenizer)return;const d=this._tokenizer.store.getFirstInvalidEndStateLineNumber();d!==null&&a>=d&&((c=this._tokenizer)===null||c===void 0||c.store.setEndState(a,l))}};s&&s.createBackgroundTokenizer&&!s.backgroundTokenizerShouldOnlyVerifyTokens&&(this._backgroundTokenizer.value=s.createBackgroundTokenizer(this._textModel,r)),this._backgroundTokenizer.value||(this._backgroundTokenizer.value=this._defaultBackgroundTokenizer=new qCe(this._tokenizer,r),this._defaultBackgroundTokenizer.handleChanges()),s!=null&&s.backgroundTokenizerShouldOnlyVerifyTokens&&s.createBackgroundTokenizer?(this._debugBackgroundTokens=new mv(this._languageIdCodec),this._debugBackgroundStates=new jT(this._textModel.getLineCount()),this._debugBackgroundTokenizer.clear(),this._debugBackgroundTokenizer.value=s.createBackgroundTokenizer(this._textModel,{setTokens:a=>{var l;(l=this._debugBackgroundTokens)===null||l===void 0||l.setMultilineTokens(a,this._textModel)},backgroundTokenizationFinished(){},setEndState:(a,l)=>{var c;(c=this._debugBackgroundStates)===null||c===void 0||c.setEndState(a,l)}})):(this._debugBackgroundTokens=void 0,this._debugBackgroundStates=void 0,this._debugBackgroundTokenizer.value=void 0)}this.refreshAllVisibleLineTokens()}handleDidChangeAttached(){var e;(e=this._defaultBackgroundTokenizer)===null||e===void 0||e.handleChanges()}handleDidChangeContent(e){var t,i,s;if(e.isFlush)this.resetTokenization(!1);else if(!e.isEolChange){for(const o of e.changes){const[r,a]=Cf(o.text);this._tokens.acceptEdit(o.range,r,a),(t=this._debugBackgroundTokens)===null||t===void 0||t.acceptEdit(o.range,r,a)}(i=this._debugBackgroundStates)===null||i===void 0||i.acceptChanges(e.changes),this._tokenizer&&this._tokenizer.store.acceptChanges(e.changes),(s=this._defaultBackgroundTokenizer)===null||s===void 0||s.handleChanges()}}setTokens(e){const{changes:t}=this._tokens.setMultilineTokens(e,this._textModel);return t.length>0&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:t}),{changes:t}}refreshAllVisibleLineTokens(){const e=Qe.joinMany([...this._attachedViewStates].map(([t,i])=>i.lineRanges));this.refreshRanges(e)}refreshRanges(e){for(const t of e)this.refreshRange(t.startLineNumber,t.endLineNumberExclusive-1)}refreshRange(e,t){var i,s;if(!this._tokenizer)return;e=Math.max(1,Math.min(this._textModel.getLineCount(),e)),t=Math.min(this._textModel.getLineCount(),t);const o=new UT,{heuristicTokens:r}=this._tokenizer.tokenizeHeuristically(o,e,t),a=this.setTokens(o.finalize());if(r)for(const l of a.changes)(i=this._backgroundTokenizer.value)===null||i===void 0||i.requestTokens(l.fromLineNumber,l.toLineNumber+1);(s=this._defaultBackgroundTokenizer)===null||s===void 0||s.checkFinished()}forceTokenization(e){var t,i;const s=new UT;(t=this._tokenizer)===null||t===void 0||t.updateTokensUntilLine(s,e),this.setTokens(s.finalize()),(i=this._defaultBackgroundTokenizer)===null||i===void 0||i.checkFinished()}isCheapToTokenize(e){return this._tokenizer?this._tokenizer.isCheapToTokenize(e):!0}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}getLineTokens(e){var t;const i=this._textModel.getLineContent(e),s=this._tokens.getTokens(this._textModel.getLanguageId(),e-1,i);if(this._debugBackgroundTokens&&this._debugBackgroundStates&&this._tokenizer&&this._debugBackgroundStates.getFirstInvalidEndStateLineNumberOrMax()>e&&this._tokenizer.store.getFirstInvalidEndStateLineNumberOrMax()>e){const o=this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(),e-1,i);!s.equals(o)&&(!((t=this._debugBackgroundTokenizer.value)===null||t===void 0)&&t.reportMismatchingTokens)&&this._debugBackgroundTokenizer.value.reportMismatchingTokens(e)}return s}getTokenTypeIfInsertingCharacter(e,t,i){if(!this._tokenizer)return 0;const s=this._textModel.validatePosition(new V(e,t));return this.forceTokenization(s.lineNumber),this._tokenizer.getTokenTypeIfInsertingCharacter(s,i)}tokenizeLineWithEdit(e,t,i){if(!this._tokenizer)return null;const s=this._textModel.validatePosition(e);return this.forceTokenization(s.lineNumber),this._tokenizer.tokenizeLineWithEdit(s,t,i)}get hasTokens(){return this._tokens.hasTokens}}class KCe extends Y{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new Di(()=>this.update(),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){Zi(this._computedLineRanges,this._lineRanges,(e,t)=>e.equals(t))||(this._computedLineRanges=this._lineRanges,this._refreshTokens())}handleStateChange(e){this._lineRanges=e.visibleLineRanges,e.stabilized?(this.runner.cancel(),this.update()):this.runner.schedule()}}class YCe{constructor(){this.changeType=1}}class ca{static applyInjectedText(e,t){if(!t||t.length===0)return e;let i="",s=0;for(const o of t)i+=e.substring(s,o.column-1),s=o.column-1,i+=o.options.content;return i+=e.substring(s),i}static fromDecorations(e){const t=[];for(const i of e)i.options.before&&i.options.before.content.length>0&&t.push(new ca(i.ownerId,i.range.startLineNumber,i.range.startColumn,i.options.before,0)),i.options.after&&i.options.after.content.length>0&&t.push(new ca(i.ownerId,i.range.endLineNumber,i.range.endColumn,i.options.after,1));return t.sort((i,s)=>i.lineNumber===s.lineNumber?i.column===s.column?i.order-s.order:i.column-s.column:i.lineNumber-s.lineNumber),t}constructor(e,t,i,s,o){this.ownerId=e,this.lineNumber=t,this.column=i,this.options=s,this.order=o}}class s6{constructor(e,t,i){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=i}}class ZCe{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class XCe{constructor(e,t,i,s){this.changeType=4,this.injectedTexts=s,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class QCe{constructor(){this.changeType=5}}class Lp{constructor(e,t,i,s){this.changes=e,this.versionId=t,this.isUndoing=i,this.isRedoing=s,this.resultingSelection=null}containsEvent(e){for(let t=0,i=this.changes.length;t=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},z2=function(n,e){return function(t,i){e(t,i,n)}},nh;function eSe(n){const e=new $q;return e.acceptChunk(n),e.finish()}function tSe(n){const e=new $q;let t;for(;typeof(t=n.read())=="string";)e.acceptChunk(t);return e.finish()}function o6(n,e){let t;return typeof n=="string"?t=eSe(n):U0e(n)?t=tSe(n):t=n,t.create(e)}let dw=0;const iSe=999,nSe=1e4;class sSe{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;const e=[];let t=0,i=0;do{const s=this._source.read();if(s===null)return this._eos=!0,t===0?null:e.join("");if(s.length>0&&(e[t++]=s,i+=s.length),i>=64*1024)return e.join("")}while(!0)}}const P0=()=>{throw new Error("Invalid change accessor")};let rl=nh=class extends Y{static resolveOptions(e,t){if(t.detectIndentation){const i=Y7(e,t.tabSize,t.insertSpaces);return new mC({tabSize:i.tabSize,indentSize:"tabSize",insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new mC(t)}get onDidChangeLanguage(){return this._tokenizationTextModelPart.onDidChangeLanguage}get onDidChangeLanguageConfiguration(){return this._tokenizationTextModelPart.onDidChangeLanguageConfiguration}get onDidChangeTokens(){return this._tokenizationTextModelPart.onDidChangeTokens}onDidChangeContent(e){return this._eventEmitter.slowEvent(t=>e(t.contentChangedEvent))}onDidChangeContentOrInjectedText(e){return br(this._eventEmitter.fastEvent(t=>e(t)),this._onDidChangeInjectedText.event(t=>e(t)))}_isDisposing(){return this.__isDisposing}get tokenization(){return this._tokenizationTextModelPart}get bracketPairs(){return this._bracketPairs}get guides(){return this._guidesTextModelPart}constructor(e,t,i,s=null,o,r,a){super(),this._undoRedoService=o,this._languageService=r,this._languageConfigurationService=a,this._onWillDispose=this._register(new B),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new cSe(f=>this.handleBeforeFireDecorationsChangedEvent(f))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new B),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new B),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeInjectedText=this._register(new B),this._eventEmitter=this._register(new dSe),this._languageSelectionListener=this._register(new ra),this._deltaDecorationCallCnt=0,this._attachedViews=new uSe,dw++,this.id="$model"+dw,this.isForSimpleWidget=i.isForSimpleWidget,typeof s>"u"||s===null?this._associatedResource=je.parse("inmemory://model/"+dw):this._associatedResource=s,this._attachedEditorCount=0;const{textBuffer:l,disposable:c}=o6(e,i.defaultEOL);this._buffer=l,this._bufferDisposable=c,this._options=nh.resolveOptions(this._buffer,i);const d=typeof t=="string"?t:t.languageId;typeof t!="string"&&(this._languageSelectionListener.value=t.onDidChange(()=>this._setLanguage(t.languageId))),this._bracketPairs=this._register(new lCe(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new Jye(this,this._languageConfigurationService)),this._decorationProvider=this._register(new dCe(this)),this._tokenizationTextModelPart=new nx(this._languageService,this._languageConfigurationService,this,this._bracketPairs,d,this._attachedViews);const u=this._buffer.getLineCount(),h=this._buffer.getValueLengthInRange(new N(1,1,u,this._buffer.getLineLength(u)+1),0);i.largeFileOptimizations?(this._isTooLargeForTokenization=h>nh.LARGE_FILE_SIZE_THRESHOLD||u>nh.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=h>nh.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._isTooLargeForSyncing=h>nh._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=RU(dw),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new r6,this._commandManager=new RP(this,this._undoRedoService),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._register(this._decorationProvider.onDidChange(()=>{this._onDidChangeDecorations.beginDeferredEmit(),this._onDidChangeDecorations.fire(),this._onDidChangeDecorations.endDeferredEmit()})),this._languageService.requestRichLanguageFeatures(d)}dispose(){this.__isDisposing=!0,this._onWillDispose.fire(),this._tokenizationTextModelPart.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this.__isDisposing=!1;const e=new xp([],"",` -`,!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=Y.None}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.fire(new Jh(e,t)))}setValue(e){if(this._assertNotDisposed(),e==null)throw oc();const{textBuffer:t,disposable:i}=o6(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,i)}_createContentChanged2(e,t,i,s,o,r,a,l){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:s}],eol:this._buffer.getEOL(),isEolChange:l,versionId:this.getVersionId(),isUndoing:o,isRedoing:r,isFlush:a}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const i=this.getFullModelRange(),s=this.getValueLengthInRange(i),o=this.getLineCount(),r=this.getLineMaxColumn(o);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new r6,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new Lp([new YCe],this._versionId,!1,!1),this._createContentChanged2(new N(1,1,o,r),0,s,this.getValue(),!1,!1,!0,!1))}setEOL(e){this._assertNotDisposed();const t=e===1?`\r +`&&(this._cr>0||this._crlf>0)))for(let o=0,r=i.length;o=55296&&t<=56319?(this._acceptChunk1(e.substr(0,e.length-1),!1),this._hasPreviousChar=!0,this._previousChar=t):(this._acceptChunk1(e,!1),this._hasPreviousChar=!1,this._previousChar=t)}_acceptChunk1(e,t){!t&&e.length===0||(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){const t=eSe(this._tmpLineStarts,e);this.chunks.push(new mh(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=Hb(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=TU(e)))}finish(e=!0){return this._finish(),new sSe(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(this.chunks.length===0&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;const e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);const t=Al(e.buffer);e.lineStarts=t,this._previousChar===13&&this.cr++}}}class oSe{constructor(e){this._default=e,this._store=[]}get(e){return e=this._store.length;)this._store[this._store.length]=this._default;this._store[e]=t}replace(e,t,i){if(e>=this._store.length)return;if(t===0){this.insert(e,i);return}else if(i===0){this.delete(e,t);return}const s=this._store.slice(0,e),o=this._store.slice(e+t),r=rSe(i,this._default);this._store=s.concat(r,o)}delete(e,t){t===0||e>=this._store.length||this._store.splice(e,t)}insert(e,t){if(t===0||e>=this._store.length)return;const i=[];for(let s=0;s0){const i=this._tokens[this._tokens.length-1];if(i.endLineNumber+1===e){i.appendLineTokens(t);return}}this._tokens.push(new aSe(e,[t]))}finalize(){return this._tokens}}class lSe{constructor(e,t){this.tokenizationSupport=t,this.initialState=this.tokenizationSupport.getInitialState(),this.store=new $T(e)}getStartState(e){return this.store.getStartState(e,this.initialState)}getFirstInvalidLine(){return this.store.getFirstInvalidLine(this.initialState)}}class cSe extends lSe{constructor(e,t,i,s){super(e,t),this._textModel=i,this._languageIdCodec=s}updateTokensUntilLine(e,t){const i=this._textModel.getLanguageId();for(;;){const s=this.getFirstInvalidLine();if(!s||s.lineNumber>t)break;const o=this._textModel.getLineContent(s.lineNumber),r=B0(this._languageIdCodec,i,this.tokenizationSupport,o,!0,s.startState);e.add(s.lineNumber,r.tokens),this.store.setEndState(s.lineNumber,r.endState)}}getTokenTypeIfInsertingCharacter(e,t){const i=this.getStartState(e.lineNumber);if(!i)return 0;const s=this._textModel.getLanguageId(),o=this._textModel.getLineContent(e.lineNumber),r=o.substring(0,e.column-1)+t+o.substring(e.column-1),a=B0(this._languageIdCodec,s,this.tokenizationSupport,r,!0,i),l=new on(a.tokens,r,this._languageIdCodec);if(l.getCount()===0)return 0;const c=l.findTokenIndexAtOffset(e.column-1);return l.getStandardTokenType(c)}tokenizeLineWithEdit(e,t,i){const s=e.lineNumber,o=e.column,r=this.getStartState(s);if(!r)return null;const a=this._textModel.getLineContent(s),l=a.substring(0,o-1)+i+a.substring(o-1+t),c=this._textModel.getLanguageIdAtPosition(s,0),d=B0(this._languageIdCodec,c,this.tokenizationSupport,l,!0,r);return new on(d.tokens,l,this._languageIdCodec)}isCheapToTokenize(e){const t=this.store.getFirstInvalidEndStateLineNumberOrMax();return e1&&a>=1;a--){const l=this._textModel.getLineFirstNonWhitespaceColumn(a);if(l!==0&&l0&&i>0&&(i--,t--),this._lineEndStates.replace(e.startLineNumber,i,t)}}class uSe{constructor(){this._ranges=[]}get min(){return this._ranges.length===0?null:this._ranges[0].start}delete(e){const t=this._ranges.findIndex(i=>i.contains(e));if(t!==-1){const i=this._ranges[t];i.start===e?i.endExclusive===e+1?this._ranges.splice(t,1):this._ranges[t]=new Ke(e+1,i.endExclusive):i.endExclusive===e+1?this._ranges[t]=new Ke(i.start,e):this._ranges.splice(t,1,new Ke(i.start,e),new Ke(e+1,i.endExclusive))}}addRange(e){Ke.addRange(e,this._ranges)}addRangeAndResize(e,t){let i=0;for(;!(i>=this._ranges.length||e.start<=this._ranges[i].endExclusive);)i++;let s=i;for(;!(s>=this._ranges.length||e.endExclusivee.toString()).join(" + ")}}function B0(n,e,t,i,s,o){let r=null;if(t)try{r=t.tokenizeEncoded(i,s,o.clone())}catch(a){mt(a)}return r||(r=o3(n.encodeLanguageId(e),o)),on.convertToEndOffset(r.tokens,i.length),r}class hSe{constructor(e,t){this._tokenizerWithStateStore=e,this._backgroundTokenStore=t,this._isDisposed=!1,this._isScheduled=!1}dispose(){this._isDisposed=!0}handleChanges(){this._beginBackgroundTokenization()}_beginBackgroundTokenization(){this._isScheduled||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._isScheduled=!0,ud(e=>{this._isScheduled=!1,this._backgroundTokenizeWithDeadline(e)}))}_backgroundTokenizeWithDeadline(e){const t=Date.now()+e.timeRemaining(),i=()=>{this._isDisposed||!this._tokenizerWithStateStore._textModel.isAttachedToEditor()||!this._hasLinesToTokenize()||(this._backgroundTokenizeForAtLeast1ms(),Date.now()1||this._tokenizeOneInvalidLine(t)>=e)break;while(this._hasLinesToTokenize());this._backgroundTokenStore.setTokens(t.finalize()),this.checkFinished()}_hasLinesToTokenize(){return this._tokenizerWithStateStore?!this._tokenizerWithStateStore.store.allStatesValid():!1}_tokenizeOneInvalidLine(e){var t;const i=(t=this._tokenizerWithStateStore)===null||t===void 0?void 0:t.getFirstInvalidLine();return i?(this._tokenizerWithStateStore.updateTokensUntilLine(e,i.lineNumber),i.lineNumber):this._tokenizerWithStateStore._textModel.getLineCount()+1}checkFinished(){this._isDisposed||this._tokenizerWithStateStore.store.allStatesValid()&&this._backgroundTokenStore.backgroundTokenizationFinished()}requestTokens(e,t){this._tokenizerWithStateStore.store.invalidateEndStateRange(new Xe(e,t))}}const Il=new Uint32Array(0).buffer;class Ca{static deleteBeginning(e,t){return e===null||e===Il?e:Ca.delete(e,0,t)}static deleteEnding(e,t){if(e===null||e===Il)return e;const i=Gl(e),s=i[i.length-2];return Ca.delete(e,t,s)}static delete(e,t,i){if(e===null||e===Il||t===i)return e;const s=Gl(e),o=s.length>>>1;if(t===0&&s[s.length-2]===i)return Il;const r=on.findIndexInTokensArray(s,t),a=r>0?s[r-1<<1]:0,l=s[r<<1];if(id&&(s[c++]=g,s[c++]=s[(f<<1)+1],d=g)}if(c===s.length)return e;const h=new Uint32Array(c);return h.set(s.subarray(0,c),0),h.buffer}static append(e,t){if(t===Il)return e;if(e===Il)return t;if(e===null)return e;if(t===null)return null;const i=Gl(e),s=Gl(t),o=s.length>>>1,r=new Uint32Array(i.length+s.length);r.set(i,0);let a=i.length;const l=i[i.length-2];for(let c=0;c>>1;let r=on.findIndexInTokensArray(s,t);r>0&&s[r-1<<1]===t&&r--;for(let a=r;a0}getTokens(e,t,i){let s=null;if(t1&&(o=Us.getLanguageId(s[1])!==e),!o)return Il}if(!s||s.length===0){const o=new Uint32Array(2);return o[0]=t,o[1]=J7(e),o.buffer}return s[s.length-2]=t,s.byteOffset===0&&s.byteLength===s.buffer.byteLength?s.buffer:s}_ensureLine(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++}_deleteLines(e,t){t!==0&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)}_insertLines(e,t){if(t===0)return;const i=[];for(let s=0;s=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;this._lineTokens[t]=Ca.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1);return}this._lineTokens[t]=Ca.deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let s=null;i=this._len)){if(t===0){this._lineTokens[s]=Ca.insert(this._lineTokens[s],e.column-1,i);return}this._lineTokens[s]=Ca.deleteEnding(this._lineTokens[s],e.column-1),this._lineTokens[s]=Ca.insert(this._lineTokens[s],e.column-1,i),this._insertLines(e.lineNumber,t)}}setMultilineTokens(e,t){if(e.length===0)return{changes:[]};const i=[];for(let s=0,o=e.length;s>>0}class P3{constructor(e){this._pieces=[],this._isComplete=!1,this._languageIdCodec=e}flush(){this._pieces=[],this._isComplete=!1}isEmpty(){return this._pieces.length===0}set(e,t){this._pieces=e||[],this._isComplete=t}setPartial(e,t){let i=e;if(t.length>0){const o=t[0].getRange(),r=t[t.length-1].getRange();if(!o||!r)return e;i=e.plusRange(o).plusRange(r)}let s=null;for(let o=0,r=this._pieces.length;oi.endLineNumber){s=s||{index:o};break}if(a.removeTokens(i),a.isEmpty()){this._pieces.splice(o,1),o--,r--;continue}if(a.endLineNumberi.endLineNumber){s=s||{index:o};continue}const[l,c]=a.split(i);if(l.isEmpty()){s=s||{index:o};continue}c.isEmpty()||(this._pieces.splice(o,1,l,c),o++,r++,s=s||{index:o})}return s=s||{index:this._pieces.length},t.length>0&&(this._pieces=ML(this._pieces,s.index,t)),i}isComplete(){return this._isComplete}addSparseTokens(e,t){if(t.getLineContent().length===0)return t;const i=this._pieces;if(i.length===0)return t;const s=P3._findFirstPieceWithLine(i,e),o=i[s].getLineTokens(e);if(!o)return t;const r=t.getCount(),a=o.getCount();let l=0;const c=[];let d=0,u=0;const h=(f,g)=>{f!==u&&(u=f,c[d++]=f,c[d++]=g)};for(let f=0;f>>0,b=~v>>>0;for(;lt)s=o-1;else{for(;o>i&&e[o-1].startLineNumber<=t&&t<=e[o-1].endLineNumber;)o--;return o}}return i}acceptEdit(e,t,i,s,o){for(const r of this._pieces)r.acceptEdit(e,t,i,s,o)}}class ZS extends xq{constructor(e,t,i,s,o,r){super(),this._languageService=e,this._languageConfigurationService=t,this._textModel=i,this._bracketPairsTextModelPart=s,this._languageId=o,this._attachedViews=r,this._semanticTokens=new P3(this._languageService.languageIdCodec),this._onDidChangeLanguage=this._register(new B),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new B),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new B),this.onDidChangeTokens=this._onDidChangeTokens.event,this.grammarTokens=this._register(new fSe(this._languageService.languageIdCodec,this._textModel,()=>this._languageId,this._attachedViews)),this._register(this._languageConfigurationService.onDidChange(a=>{a.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})})),this._register(this.grammarTokens.onDidChangeTokens(a=>{this._emitModelTokensChangedEvent(a)})),this._register(this.grammarTokens.onDidChangeBackgroundTokenizationState(a=>{this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState()}))}handleDidChangeContent(e){if(e.isFlush)this._semanticTokens.flush();else if(!e.isEolChange)for(const t of e.changes){const[i,s,o]=Lf(t.text);this._semanticTokens.acceptEdit(t.range,i,s,o,t.text.length>0?t.text.charCodeAt(0):0)}this.grammarTokens.handleDidChangeContent(e)}handleDidChangeAttached(){this.grammarTokens.handleDidChangeAttached()}getLineTokens(e){this.validateLineNumber(e);const t=this.grammarTokens.getLineTokens(e);return this._semanticTokens.addSparseTokens(e,t)}_emitModelTokensChangedEvent(e){this._textModel._isDisposing()||(this._bracketPairsTextModelPart.handleDidChangeTokens(e),this._onDidChangeTokens.fire(e))}validateLineNumber(e){if(e<1||e>this._textModel.getLineCount())throw new qi("Illegal value for lineNumber")}get hasTokens(){return this.grammarTokens.hasTokens}resetTokenization(){this.grammarTokens.resetTokenization()}get backgroundTokenizationState(){return this.grammarTokens.backgroundTokenizationState}forceTokenization(e){this.validateLineNumber(e),this.grammarTokens.forceTokenization(e)}isCheapToTokenize(e){return this.validateLineNumber(e),this.grammarTokens.isCheapToTokenize(e)}tokenizeIfCheap(e){this.validateLineNumber(e),this.grammarTokens.tokenizeIfCheap(e)}getTokenTypeIfInsertingCharacter(e,t,i){return this.grammarTokens.getTokenTypeIfInsertingCharacter(e,t,i)}tokenizeLineWithEdit(e,t,i){return this.grammarTokens.tokenizeLineWithEdit(e,t,i)}setSemanticTokens(e,t){this._semanticTokens.set(e,t),this._emitModelTokensChangedEvent({semanticTokensApplied:e!==null,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]})}hasCompleteSemanticTokens(){return this._semanticTokens.isComplete()}hasSomeSemanticTokens(){return!this._semanticTokens.isEmpty()}setPartialSemanticTokens(e,t){if(this.hasCompleteSemanticTokens())return;const i=this._textModel.validateRange(this._semanticTokens.setPartial(e,t));this._emitModelTokensChangedEvent({semanticTokensApplied:!0,ranges:[{fromLineNumber:i.startLineNumber,toLineNumber:i.endLineNumber}]})}getWordAtPosition(e){this.assertNotDisposed();const t=this._textModel.validatePosition(e),i=this._textModel.getLineContent(t.lineNumber),s=this.getLineTokens(t.lineNumber),o=s.findTokenIndexAtOffset(t.column-1),[r,a]=ZS._findLanguageBoundaries(s,o),l=Fb(t.column,this.getLanguageConfiguration(s.getLanguageId(o)).getWordDefinition(),i.substring(r,a),r);if(l&&l.startColumn<=e.column&&e.column<=l.endColumn)return l;if(o>0&&r===t.column-1){const[c,d]=ZS._findLanguageBoundaries(s,o-1),u=Fb(t.column,this.getLanguageConfiguration(s.getLanguageId(o-1)).getWordDefinition(),i.substring(c,d),c);if(u&&u.startColumn<=e.column&&e.column<=u.endColumn)return u}return null}getLanguageConfiguration(e){return this._languageConfigurationService.getLanguageConfiguration(e)}static _findLanguageBoundaries(e,t){const i=e.getLanguageId(t);let s=0;for(let r=t;r>=0&&e.getLanguageId(r)===i;r--)s=e.getStartOffset(r);let o=e.getLineContent().length;for(let r=t,a=e.getCount();r{const r=this.getLanguageId();o.changedLanguages.indexOf(r)!==-1&&this.resetTokenization()})),this.resetTokenization(),this._register(s.onDidChangeVisibleRanges(({view:o,state:r})=>{if(r){let a=this._attachedViewStates.get(o);a||(a=new gSe(()=>this.refreshRanges(a.lineRanges)),this._attachedViewStates.set(o,a)),a.handleStateChange(r)}else this._attachedViewStates.deleteAndDispose(o)}))}resetTokenization(e=!0){var t;this._tokens.flush(),(t=this._debugBackgroundTokens)===null||t===void 0||t.flush(),this._debugBackgroundStates&&(this._debugBackgroundStates=new $T(this._textModel.getLineCount())),e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]});const i=()=>{if(this._textModel.isTooLargeForTokenization())return[null,null];const r=Si.get(this.getLanguageId());if(!r)return[null,null];let a;try{a=r.getInitialState()}catch(l){return mt(l),[null,null]}return[r,a]},[s,o]=i();if(s&&o?this._tokenizer=new cSe(this._textModel.getLineCount(),s,this._textModel,this._languageIdCodec):this._tokenizer=null,this._backgroundTokenizer.clear(),this._defaultBackgroundTokenizer=null,this._tokenizer){const r={setTokens:a=>{this.setTokens(a)},backgroundTokenizationFinished:()=>{if(this._backgroundTokenizationState===2)return;const a=2;this._backgroundTokenizationState=a,this._onDidChangeBackgroundTokenizationState.fire()},setEndState:(a,l)=>{var c;if(!this._tokenizer)return;const d=this._tokenizer.store.getFirstInvalidEndStateLineNumber();d!==null&&a>=d&&((c=this._tokenizer)===null||c===void 0||c.store.setEndState(a,l))}};s&&s.createBackgroundTokenizer&&!s.backgroundTokenizerShouldOnlyVerifyTokens&&(this._backgroundTokenizer.value=s.createBackgroundTokenizer(this._textModel,r)),this._backgroundTokenizer.value||(this._backgroundTokenizer.value=this._defaultBackgroundTokenizer=new hSe(this._tokenizer,r),this._defaultBackgroundTokenizer.handleChanges()),s!=null&&s.backgroundTokenizerShouldOnlyVerifyTokens&&s.createBackgroundTokenizer?(this._debugBackgroundTokens=new bv(this._languageIdCodec),this._debugBackgroundStates=new $T(this._textModel.getLineCount()),this._debugBackgroundTokenizer.clear(),this._debugBackgroundTokenizer.value=s.createBackgroundTokenizer(this._textModel,{setTokens:a=>{var l;(l=this._debugBackgroundTokens)===null||l===void 0||l.setMultilineTokens(a,this._textModel)},backgroundTokenizationFinished(){},setEndState:(a,l)=>{var c;(c=this._debugBackgroundStates)===null||c===void 0||c.setEndState(a,l)}})):(this._debugBackgroundTokens=void 0,this._debugBackgroundStates=void 0,this._debugBackgroundTokenizer.value=void 0)}this.refreshAllVisibleLineTokens()}handleDidChangeAttached(){var e;(e=this._defaultBackgroundTokenizer)===null||e===void 0||e.handleChanges()}handleDidChangeContent(e){var t,i,s;if(e.isFlush)this.resetTokenization(!1);else if(!e.isEolChange){for(const o of e.changes){const[r,a]=Lf(o.text);this._tokens.acceptEdit(o.range,r,a),(t=this._debugBackgroundTokens)===null||t===void 0||t.acceptEdit(o.range,r,a)}(i=this._debugBackgroundStates)===null||i===void 0||i.acceptChanges(e.changes),this._tokenizer&&this._tokenizer.store.acceptChanges(e.changes),(s=this._defaultBackgroundTokenizer)===null||s===void 0||s.handleChanges()}}setTokens(e){const{changes:t}=this._tokens.setMultilineTokens(e,this._textModel);return t.length>0&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:t}),{changes:t}}refreshAllVisibleLineTokens(){const e=Xe.joinMany([...this._attachedViewStates].map(([t,i])=>i.lineRanges));this.refreshRanges(e)}refreshRanges(e){for(const t of e)this.refreshRange(t.startLineNumber,t.endLineNumberExclusive-1)}refreshRange(e,t){var i,s;if(!this._tokenizer)return;e=Math.max(1,Math.min(this._textModel.getLineCount(),e)),t=Math.min(this._textModel.getLineCount(),t);const o=new HT,{heuristicTokens:r}=this._tokenizer.tokenizeHeuristically(o,e,t),a=this.setTokens(o.finalize());if(r)for(const l of a.changes)(i=this._backgroundTokenizer.value)===null||i===void 0||i.requestTokens(l.fromLineNumber,l.toLineNumber+1);(s=this._defaultBackgroundTokenizer)===null||s===void 0||s.checkFinished()}forceTokenization(e){var t,i;const s=new HT;(t=this._tokenizer)===null||t===void 0||t.updateTokensUntilLine(s,e),this.setTokens(s.finalize()),(i=this._defaultBackgroundTokenizer)===null||i===void 0||i.checkFinished()}isCheapToTokenize(e){return this._tokenizer?this._tokenizer.isCheapToTokenize(e):!0}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}getLineTokens(e){var t;const i=this._textModel.getLineContent(e),s=this._tokens.getTokens(this._textModel.getLanguageId(),e-1,i);if(this._debugBackgroundTokens&&this._debugBackgroundStates&&this._tokenizer&&this._debugBackgroundStates.getFirstInvalidEndStateLineNumberOrMax()>e&&this._tokenizer.store.getFirstInvalidEndStateLineNumberOrMax()>e){const o=this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(),e-1,i);!s.equals(o)&&(!((t=this._debugBackgroundTokenizer.value)===null||t===void 0)&&t.reportMismatchingTokens)&&this._debugBackgroundTokenizer.value.reportMismatchingTokens(e)}return s}getTokenTypeIfInsertingCharacter(e,t,i){if(!this._tokenizer)return 0;const s=this._textModel.validatePosition(new V(e,t));return this.forceTokenization(s.lineNumber),this._tokenizer.getTokenTypeIfInsertingCharacter(s,i)}tokenizeLineWithEdit(e,t,i){if(!this._tokenizer)return null;const s=this._textModel.validatePosition(e);return this.forceTokenization(s.lineNumber),this._tokenizer.tokenizeLineWithEdit(s,t,i)}get hasTokens(){return this._tokens.hasTokens}}class gSe extends Y{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new Li(()=>this.update(),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){Yi(this._computedLineRanges,this._lineRanges,(e,t)=>e.equals(t))||(this._computedLineRanges=this._lineRanges,this._refreshTokens())}handleStateChange(e){this._lineRanges=e.visibleLineRanges,e.stabilized?(this.runner.cancel(),this.update()):this.runner.schedule()}}class pSe{constructor(){this.changeType=1}}class aa{static applyInjectedText(e,t){if(!t||t.length===0)return e;let i="",s=0;for(const o of t)i+=e.substring(s,o.column-1),s=o.column-1,i+=o.options.content;return i+=e.substring(s),i}static fromDecorations(e){const t=[];for(const i of e)i.options.before&&i.options.before.content.length>0&&t.push(new aa(i.ownerId,i.range.startLineNumber,i.range.startColumn,i.options.before,0)),i.options.after&&i.options.after.content.length>0&&t.push(new aa(i.ownerId,i.range.endLineNumber,i.range.endColumn,i.options.after,1));return t.sort((i,s)=>i.lineNumber===s.lineNumber?i.column===s.column?i.order-s.order:i.column-s.column:i.lineNumber-s.lineNumber),t}constructor(e,t,i,s,o){this.ownerId=e,this.lineNumber=t,this.column=i,this.options=s,this.order=o}}class e6{constructor(e,t,i){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=i}}class mSe{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class _Se{constructor(e,t,i,s){this.changeType=4,this.injectedTexts=s,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class bSe{constructor(){this.changeType=5}}class kp{constructor(e,t,i,s){this.changes=e,this.versionId=t,this.isUndoing=i,this.isRedoing=s,this.resultingSelection=null}containsEvent(e){for(let t=0,i=this.changes.length;t=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},O2=function(n,e){return function(t,i){e(t,i,n)}},sh;function ySe(n){const e=new Hq;return e.acceptChunk(n),e.finish()}function wSe(n){const e=new Hq;let t;for(;typeof(t=n.read())=="string";)e.acceptChunk(t);return e.finish()}function t6(n,e){let t;return typeof n=="string"?t=ySe(n):d_e(n)?t=wSe(n):t=n,t.create(e)}let sw=0;const CSe=999,SSe=1e4;class xSe{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;const e=[];let t=0,i=0;do{const s=this._source.read();if(s===null)return this._eos=!0,t===0?null:e.join("");if(s.length>0&&(e[t++]=s,i+=s.length),i>=64*1024)return e.join("")}while(!0)}}const W0=()=>{throw new Error("Invalid change accessor")};let rl=sh=class extends Y{static resolveOptions(e,t){if(t.detectIndentation){const i=j7(e,t.tabSize,t.insertSpaces);return new dC({tabSize:i.tabSize,indentSize:"tabSize",insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new dC(t)}get onDidChangeLanguage(){return this._tokenizationTextModelPart.onDidChangeLanguage}get onDidChangeLanguageConfiguration(){return this._tokenizationTextModelPart.onDidChangeLanguageConfiguration}get onDidChangeTokens(){return this._tokenizationTextModelPart.onDidChangeTokens}onDidChangeContent(e){return this._eventEmitter.slowEvent(t=>e(t.contentChangedEvent))}onDidChangeContentOrInjectedText(e){return _r(this._eventEmitter.fastEvent(t=>e(t)),this._onDidChangeInjectedText.event(t=>e(t)))}_isDisposing(){return this.__isDisposing}get tokenization(){return this._tokenizationTextModelPart}get bracketPairs(){return this._bracketPairs}get guides(){return this._guidesTextModelPart}constructor(e,t,i,s=null,o,r,a){super(),this._undoRedoService=o,this._languageService=r,this._languageConfigurationService=a,this._onWillDispose=this._register(new B),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new ASe(f=>this.handleBeforeFireDecorationsChangedEvent(f))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new B),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new B),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeInjectedText=this._register(new B),this._eventEmitter=this._register(new ISe),this._languageSelectionListener=this._register(new sa),this._deltaDecorationCallCnt=0,this._attachedViews=new TSe,sw++,this.id="$model"+sw,this.isForSimpleWidget=i.isForSimpleWidget,typeof s>"u"||s===null?this._associatedResource=Ue.parse("inmemory://model/"+sw):this._associatedResource=s,this._attachedEditorCount=0;const{textBuffer:l,disposable:c}=t6(e,i.defaultEOL);this._buffer=l,this._bufferDisposable=c,this._options=sh.resolveOptions(this._buffer,i);const d=typeof t=="string"?t:t.languageId;typeof t!="string"&&(this._languageSelectionListener.value=t.onDidChange(()=>this._setLanguage(t.languageId))),this._bracketPairs=this._register(new ECe(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new vwe(this,this._languageConfigurationService)),this._decorationProvider=this._register(new ICe(this)),this._tokenizationTextModelPart=new ZS(this._languageService,this._languageConfigurationService,this,this._bracketPairs,d,this._attachedViews);const u=this._buffer.getLineCount(),h=this._buffer.getValueLengthInRange(new N(1,1,u,this._buffer.getLineLength(u)+1),0);i.largeFileOptimizations?(this._isTooLargeForTokenization=h>sh.LARGE_FILE_SIZE_THRESHOLD||u>sh.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=h>sh.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._isTooLargeForSyncing=h>sh._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=NU(sw),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new i6,this._commandManager=new T3(this,this._undoRedoService),this._isUndoing=!1,this._isRedoing=!1,this._trimAutoWhitespaceLines=null,this._register(this._decorationProvider.onDidChange(()=>{this._onDidChangeDecorations.beginDeferredEmit(),this._onDidChangeDecorations.fire(),this._onDidChangeDecorations.endDeferredEmit()})),this._languageService.requestRichLanguageFeatures(d)}dispose(){this.__isDisposing=!0,this._onWillDispose.fire(),this._tokenizationTextModelPart.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this.__isDisposing=!1;const e=new Dp([],"",` +`,!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=Y.None}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.fire(new nf(e,t)))}setValue(e){if(this._assertNotDisposed(),e==null)throw rc();const{textBuffer:t,disposable:i}=t6(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,i)}_createContentChanged2(e,t,i,s,o,r,a,l){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:s}],eol:this._buffer.getEOL(),isEolChange:l,versionId:this.getVersionId(),isUndoing:o,isRedoing:r,isFlush:a}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const i=this.getFullModelRange(),s=this.getValueLengthInRange(i),o=this.getLineCount(),r=this.getLineMaxColumn(o);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new i6,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new kp([new pSe],this._versionId,!1,!1),this._createContentChanged2(new N(1,1,o,r),0,s,this.getValue(),!1,!1,!0,!1))}setEOL(e){this._assertNotDisposed();const t=e===1?`\r `:` -`;if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),s=this.getValueLengthInRange(i),o=this.getLineCount(),r=this.getLineMaxColumn(o);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new Lp([new QCe],this._versionId,!1,!1),this._createContentChanged2(new N(1,1,o,r),0,s,this.getValue(),!1,!1,!1,!0))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let i=0,s=t.length;i0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}isTooLargeForHeapOperation(){return this._isTooLargeForHeapOperation}isDisposed(){return this._isDisposed}isDominatedByLongLines(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;let e=0,t=0;const i=this._buffer.getLineCount();for(let s=1;s<=i;s++){const o=this._buffer.getLineLength(s);o>=nSe?t+=o:e+=o}return t>e}get uri(){return this._associatedResource}getOptions(){return this._assertNotDisposed(),this._options}getFormattingOptions(){return{tabSize:this._options.indentSize,insertSpaces:this._options.insertSpaces}}updateOptions(e){this._assertNotDisposed();const t=typeof e.tabSize<"u"?e.tabSize:this._options.tabSize,i=typeof e.indentSize<"u"?e.indentSize:this._options.originalIndentSize,s=typeof e.insertSpaces<"u"?e.insertSpaces:this._options.insertSpaces,o=typeof e.trimAutoWhitespace<"u"?e.trimAutoWhitespace:this._options.trimAutoWhitespace,r=typeof e.bracketColorizationOptions<"u"?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,a=new mC({tabSize:t,indentSize:i,insertSpaces:s,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:o,bracketPairColorizationOptions:r});if(this._options.equals(a))return;const l=this._options.createChangeEvent(a);this._options=a,this._bracketPairs.handleDidChangeOptions(l),this._decorationProvider.handleDidChangeOptions(l),this._onDidChangeOptions.fire(l)}detectIndentation(e,t){this._assertNotDisposed();const i=Y7(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),bq(e,this._options.indentSize,this._options.insertSpaces)}getVersionId(){return this._assertNotDisposed(),this._versionId}mightContainRTL(){return this._buffer.mightContainRTL()}mightContainUnusualLineTerminators(){return this._buffer.mightContainUnusualLineTerminators()}removeUnusualLineTerminators(e=null){const t=this.findMatches(TU.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map(i=>({range:i.range,text:null})),()=>null)}mightContainNonBasicASCII(){return this._buffer.mightContainNonBasicASCII()}getAlternativeVersionId(){return this._assertNotDisposed(),this._alternativeVersionId}getInitialUndoRedoSnapshot(){return this._assertNotDisposed(),this._initialUndoRedoSnapshot}getOffsetAt(e){this._assertNotDisposed();const t=this._validatePosition(e.lineNumber,e.column,0);return this._buffer.getOffsetAt(t.lineNumber,t.column)}getPositionAt(e){this._assertNotDisposed();const t=Math.min(this._buffer.getLength(),Math.max(0,e));return this._buffer.getPositionAt(t)}_increaseVersionId(){this._versionId=this._versionId+1,this._alternativeVersionId=this._versionId}_overwriteVersionId(e){this._versionId=e}_overwriteAlternativeVersionId(e){this._alternativeVersionId=e}_overwriteInitialUndoRedoSnapshot(e){this._initialUndoRedoSnapshot=e}getValue(e,t=!1){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new Gi("Operation would exceed heap memory limits");const i=this.getFullModelRange(),s=this.getValueInRange(i,e);return t?this._buffer.getBOM()+s:s}createSnapshot(e=!1){return new sSe(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();const i=this.getFullModelRange(),s=this.getValueLengthInRange(i,e);return t?this._buffer.getBOM().length+s:s}getValueInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueInRange(this.validateRange(e),t)}getValueLengthInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueLengthInRange(this.validateRange(e),t)}getCharacterCountInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getCharacterCountInRange(this.validateRange(e),t)}getLineCount(){return this._assertNotDisposed(),this._buffer.getLineCount()}getLineContent(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Gi("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Gi("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new Gi("Operation would exceed heap memory limits");return this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),this._buffer.getEOL()===` -`?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Gi("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Gi("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new Gi("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,s=e.startColumn;let o=Math.floor(typeof i=="number"&&!isNaN(i)?i:1),r=Math.floor(typeof s=="number"&&!isNaN(s)?s:1);if(o<1)o=1,r=1;else if(o>t)o=t,r=this.getLineMaxColumn(o);else if(r<=1)r=1;else{const u=this.getLineMaxColumn(o);r>=u&&(r=u)}const a=e.endLineNumber,l=e.endColumn;let c=Math.floor(typeof a=="number"&&!isNaN(a)?a:1),d=Math.floor(typeof l=="number"&&!isNaN(l)?l:1);if(c<1)c=1,d=1;else if(c>t)c=t,d=this.getLineMaxColumn(c);else if(d<=1)d=1;else{const u=this.getLineMaxColumn(c);d>=u&&(d=u)}return i===o&&s===r&&a===c&&l===d&&e instanceof N&&!(e instanceof ct)?e:new N(o,r,c,d)}_isValidPosition(e,t,i){if(typeof e!="number"||typeof t!="number"||isNaN(e)||isNaN(t)||e<1||t<1||(e|0)!==e||(t|0)!==t)return!1;const s=this._buffer.getLineCount();if(e>s)return!1;if(t===1)return!0;const o=this.getLineMaxColumn(e);if(t>o)return!1;if(i===1){const r=this._buffer.getLineCharCode(e,t-2);if(sn(r))return!1}return!0}_validatePosition(e,t,i){const s=Math.floor(typeof e=="number"&&!isNaN(e)?e:1),o=Math.floor(typeof t=="number"&&!isNaN(t)?t:1),r=this._buffer.getLineCount();if(s<1)return new V(1,1);if(s>r)return new V(r,this.getLineMaxColumn(r));if(o<=1)return new V(s,1);const a=this.getLineMaxColumn(s);if(o>=a)return new V(s,a);if(i===1){const l=this._buffer.getLineCharCode(s,o-2);if(sn(l))return new V(s,o-1)}return new V(s,o)}validatePosition(e){return this._assertNotDisposed(),e instanceof V&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}_isValidRange(e,t){const i=e.startLineNumber,s=e.startColumn,o=e.endLineNumber,r=e.endColumn;if(!this._isValidPosition(i,s,0)||!this._isValidPosition(o,r,0))return!1;if(t===1){const a=s>1?this._buffer.getLineCharCode(i,s-2):0,l=r>1&&r<=this._buffer.getLineLength(o)?this._buffer.getLineCharCode(o,r-2):0,c=sn(a),d=sn(l);return!c&&!d}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof N&&!(e instanceof ct)&&this._isValidRange(e,1))return e;const i=this._validatePosition(e.startLineNumber,e.startColumn,0),s=this._validatePosition(e.endLineNumber,e.endColumn,0),o=i.lineNumber,r=i.column,a=s.lineNumber,l=s.column;{const c=r>1?this._buffer.getLineCharCode(o,r-2):0,d=l>1&&l<=this._buffer.getLineLength(a)?this._buffer.getLineCharCode(a,l-2):0,u=sn(c),h=sn(d);return!u&&!h?new N(o,r,a,l):o===a&&r===l?new N(o,r-1,a,l-1):u&&h?new N(o,r-1,a,l+1):u?new N(o,r-1,a,l):new N(o,r,a,l+1)}}modifyPosition(e,t){this._assertNotDisposed();const i=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,i)))}getFullModelRange(){this._assertNotDisposed();const e=this.getLineCount();return new N(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,s){return this._buffer.findMatchesLineByLine(e,t,i,s)}findMatches(e,t,i,s,o,r,a=iSe){this._assertNotDisposed();let l=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(u=>N.isIRange(u))&&(l=t.map(u=>this.validateRange(u)))),l===null&&(l=[this.getFullModelRange()]),l=l.sort((u,h)=>u.startLineNumber-h.startLineNumber||u.startColumn-h.startColumn);const c=[];c.push(l.reduce((u,h)=>N.areIntersecting(u,h)?u.plusRange(h):(c.push(u),h)));let d;if(!i&&e.indexOf(` -`)<0){const h=new ih(e,i,s,o).parseSearchRequest();if(!h)return[];d=f=>this.findMatchesLineByLine(f,h,r,a)}else d=u=>Zy.findMatches(this,new ih(e,i,s,o),u,r,a);return c.map(d).reduce((u,h)=>u.concat(h),[])}findNextMatch(e,t,i,s,o,r){this._assertNotDisposed();const a=this.validatePosition(t);if(!i&&e.indexOf(` -`)<0){const c=new ih(e,i,s,o).parseSearchRequest();if(!c)return null;const d=this.getLineCount();let u=new N(a.lineNumber,a.column,d,this.getLineMaxColumn(d)),h=this.findMatchesLineByLine(u,c,r,1);return Zy.findNextMatch(this,new ih(e,i,s,o),a,r),h.length>0||(u=new N(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),h=this.findMatchesLineByLine(u,c,r,1),h.length>0)?h[0]:null}return Zy.findNextMatch(this,new ih(e,i,s,o),a,r)}findPreviousMatch(e,t,i,s,o,r){this._assertNotDisposed();const a=this.validatePosition(t);return Zy.findPreviousMatch(this,new ih(e,i,s,o),a,r)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if((this.getEOL()===` -`?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof w2?e:new w2(e.identifier||null,this.validateRange(e.range),e.text,e.forceMoveMarkers||!1,e.isAutoWhitespaceEdit||!1,e._isTracked||!1)}_validateEditOperations(e){const t=[];for(let i=0,s=e.length;i({range:this.validateRange(a.range),text:a.text}));let r=!0;if(e)for(let a=0,l=e.length;ac.endLineNumber,p=c.startLineNumber>f.endLineNumber;if(!g&&!p){d=!0;break}}if(!d){r=!1;break}}if(r)for(let a=0,l=this._trimAutoWhitespaceLines.length;ag.endLineNumber)&&!(c===g.startLineNumber&&g.startColumn===d&&g.isEmpty()&&p&&p.length>0&&p.charAt(0)===` +`;if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),s=this.getValueLengthInRange(i),o=this.getLineCount(),r=this.getLineMaxColumn(o);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new kp([new bSe],this._versionId,!1,!1),this._createContentChanged2(new N(1,1,o,r),0,s,this.getValue(),!1,!1,!1,!0))}_onBeforeEOLChange(){this._decorationsTree.ensureAllNodesHaveRanges(this)}_onAfterEOLChange(){const e=this.getVersionId(),t=this._decorationsTree.collectNodesPostOrder();for(let i=0,s=t.length;i0}getAttachedEditorCount(){return this._attachedEditorCount}isTooLargeForSyncing(){return this._isTooLargeForSyncing}isTooLargeForTokenization(){return this._isTooLargeForTokenization}isTooLargeForHeapOperation(){return this._isTooLargeForHeapOperation}isDisposed(){return this._isDisposed}isDominatedByLongLines(){if(this._assertNotDisposed(),this.isTooLargeForTokenization())return!1;let e=0,t=0;const i=this._buffer.getLineCount();for(let s=1;s<=i;s++){const o=this._buffer.getLineLength(s);o>=SSe?t+=o:e+=o}return t>e}get uri(){return this._associatedResource}getOptions(){return this._assertNotDisposed(),this._options}getFormattingOptions(){return{tabSize:this._options.indentSize,insertSpaces:this._options.insertSpaces}}updateOptions(e){this._assertNotDisposed();const t=typeof e.tabSize<"u"?e.tabSize:this._options.tabSize,i=typeof e.indentSize<"u"?e.indentSize:this._options.originalIndentSize,s=typeof e.insertSpaces<"u"?e.insertSpaces:this._options.insertSpaces,o=typeof e.trimAutoWhitespace<"u"?e.trimAutoWhitespace:this._options.trimAutoWhitespace,r=typeof e.bracketColorizationOptions<"u"?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,a=new dC({tabSize:t,indentSize:i,insertSpaces:s,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:o,bracketPairColorizationOptions:r});if(this._options.equals(a))return;const l=this._options.createChangeEvent(a);this._options=a,this._bracketPairs.handleDidChangeOptions(l),this._decorationProvider.handleDidChangeOptions(l),this._onDidChangeOptions.fire(l)}detectIndentation(e,t){this._assertNotDisposed();const i=j7(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),_q(e,this._options.indentSize,this._options.insertSpaces)}getVersionId(){return this._assertNotDisposed(),this._versionId}mightContainRTL(){return this._buffer.mightContainRTL()}mightContainUnusualLineTerminators(){return this._buffer.mightContainUnusualLineTerminators()}removeUnusualLineTerminators(e=null){const t=this.findMatches(IU.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map(i=>({range:i.range,text:null})),()=>null)}mightContainNonBasicASCII(){return this._buffer.mightContainNonBasicASCII()}getAlternativeVersionId(){return this._assertNotDisposed(),this._alternativeVersionId}getInitialUndoRedoSnapshot(){return this._assertNotDisposed(),this._initialUndoRedoSnapshot}getOffsetAt(e){this._assertNotDisposed();const t=this._validatePosition(e.lineNumber,e.column,0);return this._buffer.getOffsetAt(t.lineNumber,t.column)}getPositionAt(e){this._assertNotDisposed();const t=Math.min(this._buffer.getLength(),Math.max(0,e));return this._buffer.getPositionAt(t)}_increaseVersionId(){this._versionId=this._versionId+1,this._alternativeVersionId=this._versionId}_overwriteVersionId(e){this._versionId=e}_overwriteAlternativeVersionId(e){this._alternativeVersionId=e}_overwriteInitialUndoRedoSnapshot(e){this._initialUndoRedoSnapshot=e}getValue(e,t=!1){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new qi("Operation would exceed heap memory limits");const i=this.getFullModelRange(),s=this.getValueInRange(i,e);return t?this._buffer.getBOM()+s:s}createSnapshot(e=!1){return new xSe(this._buffer.createSnapshot(e))}getValueLength(e,t=!1){this._assertNotDisposed();const i=this.getFullModelRange(),s=this.getValueLengthInRange(i,e);return t?this._buffer.getBOM().length+s:s}getValueInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueInRange(this.validateRange(e),t)}getValueLengthInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueLengthInRange(this.validateRange(e),t)}getCharacterCountInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getCharacterCountInRange(this.validateRange(e),t)}getLineCount(){return this._assertNotDisposed(),this._buffer.getLineCount()}getLineContent(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new qi("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new qi("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new qi("Operation would exceed heap memory limits");return this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),this._buffer.getEOL()===` +`?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new qi("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new qi("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new qi("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,s=e.startColumn;let o=Math.floor(typeof i=="number"&&!isNaN(i)?i:1),r=Math.floor(typeof s=="number"&&!isNaN(s)?s:1);if(o<1)o=1,r=1;else if(o>t)o=t,r=this.getLineMaxColumn(o);else if(r<=1)r=1;else{const u=this.getLineMaxColumn(o);r>=u&&(r=u)}const a=e.endLineNumber,l=e.endColumn;let c=Math.floor(typeof a=="number"&&!isNaN(a)?a:1),d=Math.floor(typeof l=="number"&&!isNaN(l)?l:1);if(c<1)c=1,d=1;else if(c>t)c=t,d=this.getLineMaxColumn(c);else if(d<=1)d=1;else{const u=this.getLineMaxColumn(c);d>=u&&(d=u)}return i===o&&s===r&&a===c&&l===d&&e instanceof N&&!(e instanceof lt)?e:new N(o,r,c,d)}_isValidPosition(e,t,i){if(typeof e!="number"||typeof t!="number"||isNaN(e)||isNaN(t)||e<1||t<1||(e|0)!==e||(t|0)!==t)return!1;const s=this._buffer.getLineCount();if(e>s)return!1;if(t===1)return!0;const o=this.getLineMaxColumn(e);if(t>o)return!1;if(i===1){const r=this._buffer.getLineCharCode(e,t-2);if(tn(r))return!1}return!0}_validatePosition(e,t,i){const s=Math.floor(typeof e=="number"&&!isNaN(e)?e:1),o=Math.floor(typeof t=="number"&&!isNaN(t)?t:1),r=this._buffer.getLineCount();if(s<1)return new V(1,1);if(s>r)return new V(r,this.getLineMaxColumn(r));if(o<=1)return new V(s,1);const a=this.getLineMaxColumn(s);if(o>=a)return new V(s,a);if(i===1){const l=this._buffer.getLineCharCode(s,o-2);if(tn(l))return new V(s,o-1)}return new V(s,o)}validatePosition(e){return this._assertNotDisposed(),e instanceof V&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}_isValidRange(e,t){const i=e.startLineNumber,s=e.startColumn,o=e.endLineNumber,r=e.endColumn;if(!this._isValidPosition(i,s,0)||!this._isValidPosition(o,r,0))return!1;if(t===1){const a=s>1?this._buffer.getLineCharCode(i,s-2):0,l=r>1&&r<=this._buffer.getLineLength(o)?this._buffer.getLineCharCode(o,r-2):0,c=tn(a),d=tn(l);return!c&&!d}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof N&&!(e instanceof lt)&&this._isValidRange(e,1))return e;const i=this._validatePosition(e.startLineNumber,e.startColumn,0),s=this._validatePosition(e.endLineNumber,e.endColumn,0),o=i.lineNumber,r=i.column,a=s.lineNumber,l=s.column;{const c=r>1?this._buffer.getLineCharCode(o,r-2):0,d=l>1&&l<=this._buffer.getLineLength(a)?this._buffer.getLineCharCode(a,l-2):0,u=tn(c),h=tn(d);return!u&&!h?new N(o,r,a,l):o===a&&r===l?new N(o,r-1,a,l-1):u&&h?new N(o,r-1,a,l+1):u?new N(o,r-1,a,l):new N(o,r,a,l+1)}}modifyPosition(e,t){this._assertNotDisposed();const i=this.getOffsetAt(e)+t;return this.getPositionAt(Math.min(this._buffer.getLength(),Math.max(0,i)))}getFullModelRange(){this._assertNotDisposed();const e=this.getLineCount();return new N(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,s){return this._buffer.findMatchesLineByLine(e,t,i,s)}findMatches(e,t,i,s,o,r,a=CSe){this._assertNotDisposed();let l=null;t!==null&&(Array.isArray(t)||(t=[t]),t.every(u=>N.isIRange(u))&&(l=t.map(u=>this.validateRange(u)))),l===null&&(l=[this.getFullModelRange()]),l=l.sort((u,h)=>u.startLineNumber-h.startLineNumber||u.startColumn-h.startColumn);const c=[];c.push(l.reduce((u,h)=>N.areIntersecting(u,h)?u.plusRange(h):(c.push(u),h)));let d;if(!i&&e.indexOf(` +`)<0){const h=new nh(e,i,s,o).parseSearchRequest();if(!h)return[];d=f=>this.findMatchesLineByLine(f,h,r,a)}else d=u=>Uy.findMatches(this,new nh(e,i,s,o),u,r,a);return c.map(d).reduce((u,h)=>u.concat(h),[])}findNextMatch(e,t,i,s,o,r){this._assertNotDisposed();const a=this.validatePosition(t);if(!i&&e.indexOf(` +`)<0){const c=new nh(e,i,s,o).parseSearchRequest();if(!c)return null;const d=this.getLineCount();let u=new N(a.lineNumber,a.column,d,this.getLineMaxColumn(d)),h=this.findMatchesLineByLine(u,c,r,1);return Uy.findNextMatch(this,new nh(e,i,s,o),a,r),h.length>0||(u=new N(1,1,a.lineNumber,this.getLineMaxColumn(a.lineNumber)),h=this.findMatchesLineByLine(u,c,r,1),h.length>0)?h[0]:null}return Uy.findNextMatch(this,new nh(e,i,s,o),a,r)}findPreviousMatch(e,t,i,s,o,r){this._assertNotDisposed();const a=this.validatePosition(t);return Uy.findPreviousMatch(this,new nh(e,i,s,o),a,r)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if((this.getEOL()===` +`?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof m2?e:new m2(e.identifier||null,this.validateRange(e.range),e.text,e.forceMoveMarkers||!1,e.isAutoWhitespaceEdit||!1,e._isTracked||!1)}_validateEditOperations(e){const t=[];for(let i=0,s=e.length;i({range:this.validateRange(a.range),text:a.text}));let r=!0;if(e)for(let a=0,l=e.length;ac.endLineNumber,p=c.startLineNumber>f.endLineNumber;if(!g&&!p){d=!0;break}}if(!d){r=!1;break}}if(r)for(let a=0,l=this._trimAutoWhitespaceLines.length;ag.endLineNumber)&&!(c===g.startLineNumber&&g.startColumn===d&&g.isEmpty()&&p&&p.length>0&&p.charAt(0)===` `)&&!(c===g.startLineNumber&&g.startColumn===1&&g.isEmpty()&&p&&p.length>0&&p.charAt(p.length-1)===` -`)){u=!1;break}}if(u){const h=new N(c,1,c,d);t.push(new w2(null,h,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i,s)}_applyUndo(e,t,i,s){const o=e.map(r=>{const a=this.getPositionAt(r.newPosition),l=this.getPositionAt(r.newEnd);return{range:new N(a.lineNumber,a.column,l.lineNumber,l.column),text:r.oldText}});this._applyUndoRedoEdits(o,t,!0,!1,i,s)}_applyRedo(e,t,i,s){const o=e.map(r=>{const a=this.getPositionAt(r.oldPosition),l=this.getPositionAt(r.oldEnd);return{range:new N(a.lineNumber,a.column,l.lineNumber,l.column),text:r.newText}});this._applyUndoRedoEdits(o,t,!1,!0,i,s)}_applyUndoRedoEdits(e,t,i,s,o,r){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=s,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(o)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(r),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t=!1){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const i=this._validateEditOperations(e);return this._doApplyEdits(i,t)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t){const i=this._buffer.getLineCount(),s=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),o=this._buffer.getLineCount(),r=s.changes;if(this._trimAutoWhitespaceLines=s.trimAutoWhitespaceLineNumbers,r.length!==0){for(let c=0,d=r.length;c=0;k--){const P=f+k,O=y+k;D.takeFromEndWhile(R=>R.lineNumber>O);const M=D.takeFromEndWhile(R=>R.lineNumber===O);a.push(new s6(P,this.getLineContent(O),M))}if(vae.lineNumberae.lineNumber===te)}a.push(new XCe(P+1,f+_,z,R))}l+=b}this._emitContentChangedEvent(new Lp(a,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:r,eol:this._buffer.getEOL(),isEolChange:!1,versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return s.reverseEdits===null?void 0:s.reverseEdits}undo(){return this._undoRedoService.undo(this.uri)}canUndo(){return this._undoRedoService.canUndo(this.uri)}redo(){return this._undoRedoService.redo(this.uri)}canRedo(){return this._undoRedoService.canRedo(this.uri)}handleBeforeFireDecorationsChangedEvent(e){if(e===null||e.size===0)return;const i=Array.from(e).map(s=>new s6(s,this.getLineContent(s),this._getInjectedTextInLine(s)));this._onDidChangeInjectedText.fire(new Uq(i))}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){const i={addDecoration:(o,r)=>this._deltaDecorationsImpl(e,[],[{range:o,options:r}])[0],changeDecoration:(o,r)=>{this._changeDecorationImpl(o,r)},changeDecorationOptions:(o,r)=>{this._changeDecorationOptionsImpl(o,l6(r))},removeDecoration:o=>{this._deltaDecorationsImpl(e,[o],[])},deltaDecorations:(o,r)=>o.length===0&&r.length===0?[]:this._deltaDecorationsImpl(e,o,r)};let s=null;try{s=t(i)}catch(o){_t(o)}return i.addDecoration=P0,i.changeDecoration=P0,i.changeDecorationOptions=P0,i.removeDecoration=P0,i.deltaDecorations=P0,s}deltaDecorations(e,t,i=0){if(this._assertNotDisposed(),e||(e=[]),e.length===0&&t.length===0)return[];try{return this._deltaDecorationCallCnt++,this._deltaDecorationCallCnt>1&&(console.warn("Invoking deltaDecorations recursively could lead to leaking decorations."),_t(new Error("Invoking deltaDecorations recursively could lead to leaking decorations."))),this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(i,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit(),this._deltaDecorationCallCnt--}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,i){const s=e?this._decorations[e]:null;if(!s)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:a6[i]}],!0)[0]:null;if(!t)return this._decorationsTree.delete(s),delete this._decorations[s.id],null;const o=this._validateRangeRelaxedNoAllocations(t),r=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),a=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);return this._decorationsTree.delete(s),s.reset(this.getVersionId(),r,a,o),s.setOptions(a6[i]),this._decorationsTree.insert(s),s.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let i=0,s=t.length;ithis.getLineCount()?[]:this.getLinesDecorations(e,e,t,i)}getLinesDecorations(e,t,i=0,s=!1,o=!1){const r=this.getLineCount(),a=Math.min(r,Math.max(1,e)),l=Math.min(r,Math.max(1,t)),c=this.getLineMaxColumn(l),d=new N(a,1,l,c),u=this._getDecorationsInRange(d,i,s,o);return tI(u,this._decorationProvider.getDecorationsInRange(d,i,s)),u}getDecorationsInRange(e,t=0,i=!1,s=!1,o=!1){const r=this.validateRange(e),a=this._getDecorationsInRange(r,t,i,o);return tI(a,this._decorationProvider.getDecorationsInRange(r,t,i,s)),a}getOverviewRulerDecorations(e=0,t=!1){return this._decorationsTree.getAll(this,e,t,!0,!1)}getInjectedTextDecorations(e=0){return this._decorationsTree.getAllInjectedText(this,e)}_getInjectedTextInLine(e){const t=this._buffer.getOffsetAt(e,1),i=t+this._buffer.getLineLength(e),s=this._decorationsTree.getInjectedTextInInterval(this,t,i,0);return ca.fromDecorations(s).filter(o=>o.lineNumber===e)}getAllDecorations(e=0,t=!1){let i=this._decorationsTree.getAll(this,e,t,!1,!1);return i=i.concat(this._decorationProvider.getAllDecorations(e,t)),i}getAllMarginDecorations(e=0){return this._decorationsTree.getAll(this,e,!1,!1,!0)}_getDecorationsInRange(e,t,i,s){const o=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),r=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,o,r,t,i,s)}getRangeAt(e,t){return this._buffer.getRangeAt(e,t-e)}_changeDecorationImpl(e,t){const i=this._decorations[e];if(!i)return;if(i.options.after){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.endLineNumber)}if(i.options.before){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.startLineNumber)}const s=this._validateRangeRelaxedNoAllocations(t),o=this._buffer.getOffsetAt(s.startLineNumber,s.startColumn),r=this._buffer.getOffsetAt(s.endLineNumber,s.endColumn);this._decorationsTree.delete(i),i.reset(this.getVersionId(),o,r,s),this._decorationsTree.insert(i),this._onDidChangeDecorations.checkAffectedAndFire(i.options),i.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.endLineNumber),i.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.startLineNumber)}_changeDecorationOptionsImpl(e,t){const i=this._decorations[e];if(!i)return;const s=!!(i.options.overviewRuler&&i.options.overviewRuler.color),o=!!(t.overviewRuler&&t.overviewRuler.color);if(this._onDidChangeDecorations.checkAffectedAndFire(i.options),this._onDidChangeDecorations.checkAffectedAndFire(t),i.options.after||t.after){const r=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(r.endLineNumber)}if(i.options.before||t.before){const r=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(r.startLineNumber)}s!==o?(this._decorationsTree.delete(i),i.setOptions(t),this._decorationsTree.insert(i)):i.setOptions(t)}_deltaDecorationsImpl(e,t,i,s=!1){const o=this.getVersionId(),r=t.length;let a=0;const l=i.length;let c=0;this._onDidChangeDecorations.beginDeferredEmit();try{const d=new Array(l);for(;athis._setLanguage(e.languageId,t)),this._setLanguage(e.languageId,t))}_setLanguage(e,t){this.tokenization.setLanguageId(e,t),this._languageService.requestRichLanguageFeatures(e)}getLanguageIdAtPosition(e,t){return this.tokenization.getLanguageIdAtPosition(e,t)}getWordAtPosition(e){return this._tokenizationTextModelPart.getWordAtPosition(e)}getWordUntilPosition(e){return this._tokenizationTextModelPart.getWordUntilPosition(e)}normalizePosition(e,t){return e}getLineIndentColumn(e){return oSe(this.getLineContent(e))+1}};rl._MODEL_SYNC_LIMIT=50*1024*1024;rl.LARGE_FILE_SIZE_THRESHOLD=20*1024*1024;rl.LARGE_FILE_LINE_COUNT_THRESHOLD=300*1e3;rl.LARGE_FILE_HEAP_OPERATION_THRESHOLD=256*1024*1024;rl.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:In.tabSize,indentSize:In.indentSize,insertSpaces:In.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:In.trimAutoWhitespace,largeFileOptimizations:In.largeFileOptimizations,bracketPairColorizationOptions:In.bracketPairColorizationOptions};rl=nh=JCe([z2(4,LD),z2(5,Ni),z2(6,ao)],rl);function oSe(n){let e=0;for(const t of n)if(t===" "||t===" ")e++;else break;return e}function H2(n){return!!(n.options.overviewRuler&&n.options.overviewRuler.color)}function $2(n){return!!n.options.after||!!n.options.before}class r6{constructor(){this._decorationsTree0=new B2,this._decorationsTree1=new B2,this._injectedTextDecorationsTree=new B2}ensureAllNodesHaveRanges(e){this.getAll(e,0,!1,!1,!1)}_ensureNodesHaveRanges(e,t){for(const i of t)i.range===null&&(i.range=e.getRangeAt(i.cachedAbsoluteStart,i.cachedAbsoluteEnd));return t}getAllInInterval(e,t,i,s,o,r){const a=e.getVersionId(),l=this._intervalSearch(t,i,s,o,a,r);return this._ensureNodesHaveRanges(e,l)}_intervalSearch(e,t,i,s,o,r){const a=this._decorationsTree0.intervalSearch(e,t,i,s,o,r),l=this._decorationsTree1.intervalSearch(e,t,i,s,o,r),c=this._injectedTextDecorationsTree.intervalSearch(e,t,i,s,o,r);return a.concat(l).concat(c)}getInjectedTextInInterval(e,t,i,s){const o=e.getVersionId(),r=this._injectedTextDecorationsTree.intervalSearch(t,i,s,!1,o,!1);return this._ensureNodesHaveRanges(e,r).filter(a=>a.options.showIfCollapsed||!a.range.isEmpty())}getAllInjectedText(e,t){const i=e.getVersionId(),s=this._injectedTextDecorationsTree.search(t,!1,i,!1);return this._ensureNodesHaveRanges(e,s).filter(o=>o.options.showIfCollapsed||!o.range.isEmpty())}getAll(e,t,i,s,o){const r=e.getVersionId(),a=this._search(t,i,s,r,o);return this._ensureNodesHaveRanges(e,a)}_search(e,t,i,s,o){if(i)return this._decorationsTree1.search(e,t,s,o);{const r=this._decorationsTree0.search(e,t,s,o),a=this._decorationsTree1.search(e,t,s,o),l=this._injectedTextDecorationsTree.search(e,t,s,o);return r.concat(a).concat(l)}}collectNodesFromOwner(e){const t=this._decorationsTree0.collectNodesFromOwner(e),i=this._decorationsTree1.collectNodesFromOwner(e),s=this._injectedTextDecorationsTree.collectNodesFromOwner(e);return t.concat(i).concat(s)}collectNodesPostOrder(){const e=this._decorationsTree0.collectNodesPostOrder(),t=this._decorationsTree1.collectNodesPostOrder(),i=this._injectedTextDecorationsTree.collectNodesPostOrder();return e.concat(t).concat(i)}insert(e){$2(e)?this._injectedTextDecorationsTree.insert(e):H2(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){$2(e)?this._injectedTextDecorationsTree.delete(e):H2(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}getNodeRange(e,t){const i=e.getVersionId();return t.cachedVersionId!==i&&this._resolveNode(t,i),t.range===null&&(t.range=e.getRangeAt(t.cachedAbsoluteStart,t.cachedAbsoluteEnd)),t.range}_resolveNode(e,t){$2(e)?this._injectedTextDecorationsTree.resolveNode(e,t):H2(e)?this._decorationsTree1.resolveNode(e,t):this._decorationsTree0.resolveNode(e,t)}acceptReplace(e,t,i,s){this._decorationsTree0.acceptReplace(e,t,i,s),this._decorationsTree1.acceptReplace(e,t,i,s),this._injectedTextDecorationsTree.acceptReplace(e,t,i,s)}}function yl(n){return n.replace(/[^a-z0-9\-_]/gi," ")}class qq{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class rSe extends qq{constructor(e){super(e),this._resolvedColor=null,this.position=typeof e.position=="number"?e.position:Go.Center}getColor(e){return this._resolvedColor||(e.type!=="light"&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=null}_resolveColor(e,t){if(typeof e=="string")return e;const i=e?t.getColor(e.id):null;return i?i.toString():""}}class aSe{constructor(e){var t;this.position=(t=e==null?void 0:e.position)!==null&&t!==void 0?t:_p.Left}}class lSe extends qq{constructor(e){super(e),this.position=e.position}getColor(e){return this._resolvedColor||(e.type!=="light"&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=void 0}_resolveColor(e,t){return typeof e=="string"?H.fromHex(e):t.getColor(e.id)}}class Im{static from(e){return e instanceof Im?e:new Im(e)}constructor(e){this.content=e.content||"",this.inlineClassName=e.inlineClassName||null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.attachedData=e.attachedData||null,this.cursorStops=e.cursorStops||null}}class et{static register(e){return new et(e)}static createDynamic(e){return new et(e)}constructor(e){var t,i,s,o,r,a;this.description=e.description,this.blockClassName=e.blockClassName?yl(e.blockClassName):null,this.blockDoesNotCollapse=(t=e.blockDoesNotCollapse)!==null&&t!==void 0?t:null,this.blockIsAfterEnd=(i=e.blockIsAfterEnd)!==null&&i!==void 0?i:null,this.blockPadding=(s=e.blockPadding)!==null&&s!==void 0?s:null,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?yl(e.className):null,this.shouldFillLineOnLineBreak=(o=e.shouldFillLineOnLineBreak)!==null&&o!==void 0?o:null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new rSe(e.overviewRuler):null,this.minimap=e.minimap?new lSe(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new aSe(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?yl(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?yl(e.linesDecorationsClassName):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?yl(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?yl(e.marginClassName):null,this.inlineClassName=e.inlineClassName?yl(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?yl(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?yl(e.afterContentClassName):null,this.after=e.after?Im.from(e.after):null,this.before=e.before?Im.from(e.before):null,this.hideInCommentTokens=(r=e.hideInCommentTokens)!==null&&r!==void 0?r:!1,this.hideInStringTokens=(a=e.hideInStringTokens)!==null&&a!==void 0?a:!1}}et.EMPTY=et.register({description:"empty"});const a6=[et.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),et.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),et.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),et.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function l6(n){return n instanceof et?n:et.createDynamic(n)}class cSe extends Y{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new B),this.event=this._actual.event,this._affectedInjectedTextLines=null,this._deferredCnt=0,this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(){var e;this._deferredCnt--,this._deferredCnt===0&&(this._shouldFireDeferred&&this.doFire(),(e=this._affectedInjectedTextLines)===null||e===void 0||e.clear(),this._affectedInjectedTextLines=null)}recordLineAffectedByInjectedText(e){this._affectedInjectedTextLines||(this._affectedInjectedTextLines=new Set),this._affectedInjectedTextLines.add(e)}checkAffectedAndFire(e){this._affectsMinimap||(this._affectsMinimap=!!(e.minimap&&e.minimap.position)),this._affectsOverviewRuler||(this._affectsOverviewRuler=!!(e.overviewRuler&&e.overviewRuler.color)),this._affectsGlyphMargin||(this._affectsGlyphMargin=!!e.glyphMarginClassName),this.tryFire()}fire(){this._affectsMinimap=!0,this._affectsOverviewRuler=!0,this._affectsGlyphMargin=!0,this.tryFire()}tryFire(){this._deferredCnt===0?this.doFire():this._shouldFireDeferred=!0}doFire(){this.handleBeforeFire(this._affectedInjectedTextLines);const e={affectsMinimap:this._affectsMinimap,affectsOverviewRuler:this._affectsOverviewRuler,affectsGlyphMargin:this._affectsGlyphMargin};this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._actual.fire(e)}}class dSe extends Y{constructor(){super(),this._fastEmitter=this._register(new B),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new B),this.slowEvent=this._slowEmitter.event,this._deferredCnt=0,this._deferredEvent=null}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(e=null){if(this._deferredCnt--,this._deferredCnt===0&&this._deferredEvent!==null){this._deferredEvent.rawContentChangedEvent.resultingSelection=e;const t=this._deferredEvent;this._deferredEvent=null,this._fastEmitter.fire(t),this._slowEmitter.fire(t)}}fire(e){if(this._deferredCnt>0){this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e;return}this._fastEmitter.fire(e),this._slowEmitter.fire(e)}}class uSe{constructor(){this._onDidChangeVisibleRanges=new B,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set}attachView(){const e=new hSe(t=>{this._onDidChangeVisibleRanges.fire({view:e,state:t})});return this._views.add(e),e}detachView(e){this._views.delete(e),this._onDidChangeVisibleRanges.fire({view:e,state:void 0})}}class hSe{constructor(e){this.handleStateChange=e}setVisibleLines(e,t){const i=e.map(s=>new Qe(s.startLineNumber,s.endLineNumber+1));this.handleStateChange({visibleLineRanges:i,stabilized:t})}}class sx{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new gn(new N(1,1,1,1),0,0,new V(1,1),0),new gn(new N(1,1,1,1),0,0,new V(1,1),0))}dispose(e){this._removeTrackedRange(e)}startTrackingSelection(e){this._trackSelection=!0,this._updateTrackedRange(e)}stopTrackingSelection(e){this._trackSelection=!1,this._removeTrackedRange(e)}_updateTrackedRange(e){this._trackSelection&&(this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,this.modelState.selection,0))}_removeTrackedRange(e){this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,null,0)}asCursorState(){return new ot(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?ct.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):ct.fromRange(t,this.modelState.selection.getDirection())}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,t,i){this._setState(e,t,i)}static _validatePositionWithCache(e,t,i,s){return t.equals(i)?s:e.normalizePosition(t,2)}static _validateViewState(e,t){const i=t.position,s=t.selectionStart.getStartPosition(),o=t.selectionStart.getEndPosition(),r=e.normalizePosition(i,2),a=this._validatePositionWithCache(e,s,i,r),l=this._validatePositionWithCache(e,o,s,a);return i.equals(r)&&s.equals(a)&&o.equals(l)?t:new gn(N.fromPositions(a,l),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+s.column-a.column,r,t.leftoverVisibleColumns+i.column-r.column)}_setState(e,t,i){if(i&&(i=sx._validateViewState(e.viewModel,i)),t){const s=e.model.validateRange(t.selectionStart),o=t.selectionStart.equalsRange(s)?t.selectionStartLeftoverVisibleColumns:0,r=e.model.validatePosition(t.position),a=t.position.equals(r)?t.leftoverVisibleColumns:0;t=new gn(s,t.selectionStartKind,o,r,a)}else{if(!i)return;const s=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(i.selectionStart)),o=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(i.position));t=new gn(s,i.selectionStartKind,i.selectionStartLeftoverVisibleColumns,o,i.leftoverVisibleColumns)}if(i){const s=e.coordinatesConverter.validateViewRange(i.selectionStart,t.selectionStart),o=e.coordinatesConverter.validateViewPosition(i.position,t.position);i=new gn(s,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,o,t.leftoverVisibleColumns)}else{const s=e.coordinatesConverter.convertModelPositionToViewPosition(new V(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),o=e.coordinatesConverter.convertModelPositionToViewPosition(new V(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),r=new N(s.lineNumber,s.column,o.lineNumber,o.column),a=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new gn(r,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,a,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class c6{constructor(e){this.context=e,this.cursors=[new sx(e)],this.lastAddedCursorIndex=0}dispose(){for(const e of this.cursors)e.dispose(this.context)}startTrackingSelections(){for(const e of this.cursors)e.startTrackingSelection(this.context)}stopTrackingSelections(){for(const e of this.cursors)e.stopTrackingSelection(this.context)}updateContext(e){this.context=e}ensureValidState(){for(const e of this.cursors)e.ensureValidState(this.context)}readSelectionFromMarkers(){return this.cursors.map(e=>e.readSelectionFromMarkers(this.context))}getAll(){return this.cursors.map(e=>e.asCursorState())}getViewPositions(){return this.cursors.map(e=>e.viewState.position)}getTopMostViewPosition(){return s_e(this.cursors,mr(e=>e.viewState.position,V.compare)).viewState.position}getBottomMostViewPosition(){return n_e(this.cursors,mr(e=>e.viewState.position,V.compare)).viewState.position}getSelections(){return this.cursors.map(e=>e.modelState.selection)}getViewSelections(){return this.cursors.map(e=>e.viewState.selection)}setSelections(e){this.setStates(ot.fromModelSelections(e))}getPrimaryCursor(){return this.cursors[0].asCursorState()}setStates(e){e!==null&&(this.cursors[0].setState(this.context,e[0].modelState,e[0].viewState),this._setSecondaryStates(e.slice(1)))}_setSecondaryStates(e){const t=this.cursors.length-1,i=e.length;if(ti){const s=t-i;for(let o=0;o=e+1&&this.lastAddedCursorIndex--,this.cursors[e+1].dispose(this.context),this.cursors.splice(e+1,1)}normalize(){if(this.cursors.length===1)return;const e=this.cursors.slice(0),t=[];for(let i=0,s=e.length;ii.selection,N.compareRangesUsingStarts));for(let i=0;iu&&p.index--;e.splice(u,1),t.splice(d,1),this._removeSecondaryCursor(u-1),i--}}}}class d6{constructor(e,t,i,s){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=s}}class fSe{constructor(){this.type=0}}class gSe{constructor(){this.type=1}}class pSe{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class mSe{constructor(e,t,i){this.selections=e,this.modelSelections=t,this.reason=i,this.type=3}}class vg{constructor(e){this.type=4,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler,this.affectsGlyphMargin=e.affectsGlyphMargin):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0,this.affectsGlyphMargin=!0)}}class uw{constructor(){this.type=5}}class _Se{constructor(e){this.type=6,this.isFocused=e}}class bSe{constructor(){this.type=7}}class hw{constructor(){this.type=8}}class Gq{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=9}}class qT{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class GT{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class LC{constructor(e,t,i,s,o,r,a){this.source=e,this.minimalReveal=t,this.range=i,this.selections=s,this.verticalType=o,this.revealHorizontal=r,this.scrollType=a,this.type=12}}class vSe{constructor(e){this.type=13,this.scrollWidth=e.scrollWidth,this.scrollLeft=e.scrollLeft,this.scrollHeight=e.scrollHeight,this.scrollTop=e.scrollTop,this.scrollWidthChanged=e.scrollWidthChanged,this.scrollLeftChanged=e.scrollLeftChanged,this.scrollHeightChanged=e.scrollHeightChanged,this.scrollTopChanged=e.scrollTopChanged}}class ySe{constructor(e){this.theme=e,this.type=14}}class wSe{constructor(e){this.type=15,this.ranges=e}}class CSe{constructor(){this.type=16}}let SSe=class{constructor(){this.type=17}};class xSe extends Y{constructor(){super(),this._onEvent=this._register(new B),this.onEvent=this._onEvent.event,this._eventHandlers=[],this._viewEventQueue=null,this._isConsumingViewEventQueue=!1,this._collector=null,this._collectorCnt=0,this._outgoingEvents=[]}emitOutgoingEvent(e){this._addOutgoingEvent(e),this._emitOutgoingEvents()}_addOutgoingEvent(e){for(let t=0,i=this._outgoingEvents.length;t0;){if(this._collector||this._isConsumingViewEventQueue)return;const e=this._outgoingEvents.shift();e.isNoOp()||this._onEvent.fire(e)}}addViewEventHandler(e){for(let t=0,i=this._eventHandlers.length;t0&&this._emitMany(t)}this._emitOutgoingEvents()}emitSingleViewEvent(e){try{this.beginEmitViewEvents().emitViewEvent(e)}finally{this.endEmitViewEvents()}}_emitMany(e){this._viewEventQueue?this._viewEventQueue=this._viewEventQueue.concat(e):this._viewEventQueue=e,this._isConsumingViewEventQueue||this._consumeViewEventQueue()}_consumeViewEventQueue(){try{this._isConsumingViewEventQueue=!0,this._doConsumeQueue()}finally{this._isConsumingViewEventQueue=!1}}_doConsumeQueue(){for(;this._viewEventQueue;){const e=this._viewEventQueue;this._viewEventQueue=null;const t=this._eventHandlers.slice(0);for(const i of t)i.handleEvents(e)}}}class LSe{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class BP{constructor(e,t,i,s){this.kind=0,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=i,this.contentHeight=s,this.contentWidthChanged=this._oldContentWidth!==this.contentWidth,this.contentHeightChanged=this._oldContentHeight!==this.contentHeight}isNoOp(){return!this.contentWidthChanged&&!this.contentHeightChanged}attemptToMerge(e){return e.kind!==this.kind?null:new BP(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class WP{constructor(e,t){this.kind=1,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new WP(this.oldHasFocus,e.hasFocus)}}class VP{constructor(e,t,i,s,o,r,a,l){this.kind=2,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=s,this.scrollWidth=o,this.scrollLeft=r,this.scrollHeight=a,this.scrollTop=l,this.scrollWidthChanged=this._oldScrollWidth!==this.scrollWidth,this.scrollLeftChanged=this._oldScrollLeft!==this.scrollLeft,this.scrollHeightChanged=this._oldScrollHeight!==this.scrollHeight,this.scrollTopChanged=this._oldScrollTop!==this.scrollTop}isNoOp(){return!this.scrollWidthChanged&&!this.scrollLeftChanged&&!this.scrollHeightChanged&&!this.scrollTopChanged}attemptToMerge(e){return e.kind!==this.kind?null:new VP(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class DSe{constructor(){this.kind=3}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class kSe{constructor(){this.kind=4}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class ox{constructor(e,t,i,s,o,r,a){this.kind=6,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=s,this.source=o,this.reason=r,this.reachedMaxCursorCount=a}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const i=e.length,s=t.length;if(i!==s)return!1;for(let o=0;o0){const e=this._cursors.getSelections();for(let t=0;tr&&(s=s.slice(0,r),o=!0);const a=U_.from(this._model,this);return this._cursors.setStates(s),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,a,o)}setCursorColumnSelectData(e){this._columnSelectData=e}revealPrimary(e,t,i,s,o,r){const a=this._cursors.getViewPositions();let l=null,c=null;a.length>1?c=this._cursors.getViewSelections():l=N.fromPositions(a[0],a[0]),e.emitViewEvent(new LC(t,i,l,c,s,o,r))}saveState(){const e=[],t=this._cursors.getSelections();for(let i=0,s=t.length;i0){const o=ot.fromModelSelections(i.resultingSelection);this.setStates(e,"modelChange",i.isUndoing?5:i.isRedoing?6:2,o)&&this.revealPrimary(e,"modelChange",!1,0,!0,0)}else{const o=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,ot.fromModelSelections(o))}}}getSelection(){return this._cursors.getPrimaryCursor().modelState.selection}getTopMostViewPosition(){return this._cursors.getTopMostViewPosition()}getBottomMostViewPosition(){return this._cursors.getBottomMostViewPosition()}getCursorColumnSelectData(){if(this._columnSelectData)return this._columnSelectData;const e=this._cursors.getPrimaryCursor(),t=e.viewState.selectionStart.getStartPosition(),i=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber,fromViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,t),toViewLineNumber:i.lineNumber,toViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,i)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,i,s){this.setStates(e,t,s,ot.fromModelSelections(i))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){const i=[],s=[];for(let a=0,l=e.length;a0&&this._pushAutoClosedAction(i,s),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}_interpretCommandResult(e){(!e||e.length===0)&&(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()}_emitStateChangedIfNecessary(e,t,i,s,o){const r=U_.from(this._model,this);if(r.equals(s))return!1;const a=this._cursors.getSelections(),l=this._cursors.getViewSelections();if(e.emitViewEvent(new mSe(l,a,i)),!s||s.cursorState.length!==r.cursorState.length||r.cursorState.some((c,d)=>!c.modelState.equals(s.cursorState[d].modelState))){const c=s?s.cursorState.map(u=>u.modelState.selection):null,d=s?s.modelVersionId:0;e.emitOutgoingEvent(new ox(c,a,d,r.modelVersionId,t||"keyboard",i,o))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const t=[];for(let i=0,s=e.length;i=0)return null;const r=o.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!r)return null;const a=r[1],l=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(a);if(!l||l.length!==1)return null;const c=l[0].open,d=o.text.length-r[2].length-1,u=o.text.lastIndexOf(c,d-1);if(u===-1)return null;t.push([u,d])}return t}executeEdits(e,t,i,s){let o=null;t==="snippet"&&(o=this._findAutoClosingPairs(i)),o&&(i[0]._isTracked=!0);const r=[],a=[],l=this._model.pushEditOperations(this.getSelections(),i,c=>{if(o)for(let u=0,h=o.length;u0&&this._pushAutoClosedAction(r,a)}_executeEdit(e,t,i,s=0){if(this.context.cursorConfig.readOnly)return;const o=U_.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(r){_t(r)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,s,o,!1)&&this.revealPrimary(t,i,!1,0,!0,0)}getAutoClosedCharacters(){return u6.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new j_(this._model,this.getSelections())}endComposition(e,t){const i=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit(()=>{t==="keyboard"&&this._executeEditOperation(pi.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,i,this.getSelections(),this.getAutoClosedCharacters()))},e,t)}type(e,t,i){this._executeEdit(()=>{if(i==="keyboard"){const s=t.length;let o=0;for(;o{const c=l.getPosition();return new ct(c.lineNumber,c.column+o,c.lineNumber,c.column+o)});this.setSelections(e,r,a,0)}return}this._executeEdit(()=>{this._executeEditOperation(pi.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,s,o))},e,r)}paste(e,t,i,s,o){this._executeEdit(()=>{this._executeEditOperation(pi.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,s||[]))},e,o,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(wf.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new bs(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new bs(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}}class U_{static from(e,t){return new U_(e.getVersionId(),t.getCursorStates())}constructor(e,t){this.modelVersionId=e,this.cursorState=t}equals(e){if(!e||this.modelVersionId!==e.modelVersionId||this.cursorState.length!==e.cursorState.length)return!1;for(let t=0,i=this.cursorState.length;t=t.length||!t[i].strictContainsRange(e[i]))return!1;return!0}}class OSe{static executeCommands(e,t,i){const s={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},o=this._innerExecuteCommands(s,i);for(let r=0,a=s.trackedRanges.length;r0&&(r[0]._isTracked=!0);let a=e.model.pushEditOperations(e.selectionsBefore,r,c=>{const d=[];for(let f=0;ff.identifier.minor-g.identifier.minor,h=[];for(let f=0;f0?(d[f].sort(u),h[f]=t[f].computeCursorState(e.model,{getInverseEditOperations:()=>d[f],getTrackedSelection:g=>{const p=parseInt(g,10),_=e.model._getTrackedRange(e.trackedRanges[p]);return e.trackedRangesDirection[p]===0?new ct(_.startLineNumber,_.startColumn,_.endLineNumber,_.endColumn):new ct(_.endLineNumber,_.endColumn,_.startLineNumber,_.startColumn)}})):h[f]=e.selectionsBefore[f];return h});a||(a=e.selectionsBefore);const l=[];for(const c in o)o.hasOwnProperty(c)&&l.push(parseInt(c,10));l.sort((c,d)=>d-c);for(const c of l)a.splice(c,1);return a}static _arrayIsEmpty(e){for(let t=0,i=e.length;t{N.isEmpty(u)&&h===""||s.push({identifier:{major:t,minor:o++},range:u,text:h,forceMoveMarkers:f,isAutoWhitespaceEdit:i.insertsAutoWhitespace})};let a=!1;const d={addEditOperation:r,addTrackedEditOperation:(u,h,f)=>{a=!0,r(u,h,f)},trackSelection:(u,h)=>{const f=ct.liftSelection(u);let g;if(f.isEmpty())if(typeof h=="boolean")h?g=2:g=3;else{const v=e.model.getLineMaxColumn(f.startLineNumber);f.startColumn===v?g=2:g=3}else g=1;const p=e.trackedRanges.length,_=e.model._setTrackedRange(null,f,g);return e.trackedRanges[p]=_,e.trackedRangesDirection[p]=f.getDirection(),p.toString()}};try{i.getEditOperations(e.model,d)}catch(u){return _t(u),{operations:[],hadTrackedEditOperation:!1}}return{operations:s,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((i,s)=>-N.compareRangesUsingEnds(i.range,s.range));const t={};for(let i=1;io.identifier.major?r=s.identifier.major:r=o.identifier.major,t[r.toString()]=!0;for(let a=0;a0&&i--}}return t}}class FSe{constructor(e,t,i){this.text=e,this.startSelection=t,this.endSelection=i}}class j_{static _capture(e,t){const i=[];for(const s of t){if(s.startLineNumber!==s.endLineNumber)return null;i.push(new FSe(e.getLineContent(s.startLineNumber),s.startColumn-1,s.endColumn-1))}return i}constructor(e,t){this._original=j_._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;const i=j_._capture(e,t);if(!i||this._original.length!==i.length)return null;const s=[];for(let o=0,r=this._original.length;oXb,tokenizeEncoded:(n,e,t)=>aP(0,t)};function WSe(n,e,t){return BSe(this,void 0,void 0,function*(){if(!t)return f6(e,n.languageIdCodec,h6);const i=yield xi.getOrCreate(t);return f6(e,n.languageIdCodec,i||h6)})}function VSe(n,e,t,i,s,o,r){let a="
",l=i,c=0,d=!0;for(let u=0,h=e.getCount();u0;)r&&d?(g+=" ",d=!1):(g+=" ",d=!0),_--;break}case 60:g+="<",d=!1;break;case 62:g+=">",d=!1;break;case 38:g+="&",d=!1;break;case 0:g+="�",d=!1;break;case 65279:case 8232:case 8233:case 133:g+="�",d=!1;break;case 13:g+="​",d=!1;break;case 32:r&&d?(g+=" ",d=!1):(g+=" ",d=!0);break;default:g+=String.fromCharCode(p),d=!1}}if(a+=`${g}`,f>s||l>=s)break}return a+="
",a}function f6(n,e,t){let i='
';const s=Vf(n);let o=t.getInitialState();for(let r=0,a=s.length;r0&&(i+="
");const c=t.tokenizeEncoded(l,!0,o);an.convertToEndOffset(c.tokens,l.length);const u=new an(c.tokens,l,e).inflate();let h=0;for(let f=0,g=u.getCount();f${kS(l.substring(h,_))}`,h=_}o=c.endState}return i+="
",i}class zSe{constructor(){this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[]}insert(e){this._hasPending=!0,this._inserts.push(e)}change(e){this._hasPending=!0,this._changes.push(e)}remove(e){this._hasPending=!0,this._removes.push(e)}mustCommit(){return this._hasPending}commit(e){if(!this._hasPending)return;const t=this._inserts,i=this._changes,s=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],e._commitPendingChanges(t,i,s)}}class HSe{constructor(e,t,i,s,o){this.id=e,this.afterLineNumber=t,this.ordinal=i,this.height=s,this.minWidth=o,this.prefixSum=0}}let Kq=class KT{constructor(e,t,i,s){this._instanceId=RU(++KT.INSTANCE_COUNT),this._pendingChanges=new zSe,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=e,this._lineHeight=t,this._paddingTop=i,this._paddingBottom=s}static findInsertionIndex(e,t,i){let s=0,o=e.length;for(;s>>1;t===e[r].afterLineNumber?i{t=!0,s=s|0,o=o|0,r=r|0,a=a|0;const l=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new HSe(l,s,o,r,a)),l},changeOneWhitespace:(s,o,r)=>{t=!0,o=o|0,r=r|0,this._pendingChanges.change({id:s,newAfterLineNumber:o,newHeight:r})},removeWhitespace:s=>{t=!0,this._pendingChanges.remove({id:s})}})}finally{this._pendingChanges.commit(this)}return t}_commitPendingChanges(e,t,i){if((e.length>0||i.length>0)&&(this._minWidth=-1),e.length+t.length+i.length<=1){for(const l of e)this._insertWhitespace(l);for(const l of t)this._changeOneWhitespace(l.id,l.newAfterLineNumber,l.newHeight);for(const l of i){const c=this._findWhitespaceIndex(l.id);c!==-1&&this._removeWhitespace(c)}return}const s=new Set;for(const l of i)s.add(l.id);const o=new Map;for(const l of t)o.set(l.id,l);const r=l=>{const c=[];for(const d of l)if(!s.has(d.id)){if(o.has(d.id)){const u=o.get(d.id);d.afterLineNumber=u.newAfterLineNumber,d.height=u.newHeight}c.push(d)}return c},a=r(this._arr).concat(r(e));a.sort((l,c)=>l.afterLineNumber===c.afterLineNumber?l.ordinal-c.ordinal:l.afterLineNumber-c.afterLineNumber),this._arr=a,this._prefixSumValidIndex=-1}_checkPendingChanges(){this._pendingChanges.mustCommit()&&this._pendingChanges.commit(this)}_insertWhitespace(e){const t=KT.findInsertionIndex(this._arr,e.afterLineNumber,e.ordinal);this._arr.splice(t,0,e),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,t-1)}_findWhitespaceIndex(e){const t=this._arr;for(let i=0,s=t.length;it&&(this._arr[i].afterLineNumber-=t-e+1)}}onLinesInserted(e,t){this._checkPendingChanges(),e=e|0,t=t|0,this._lineCount+=t-e+1;for(let i=0,s=this._arr.length;i=t.length||t[a+1].afterLineNumber>=e)return a;i=a+1|0}else s=a-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e=e|0;const i=this._findLastWhitespaceBeforeLineNumber(e)+1;return i1?i=this._lineHeight*(e-1):i=0;const s=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e-(t?1:0));return i+s+this._paddingTop}getVerticalOffsetAfterLineNumber(e,t=!1){this._checkPendingChanges(),e=e|0;const i=this._lineHeight*e,s=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e+(t?1:0));return i+s+this._paddingTop}getWhitespaceMinWidth(){if(this._checkPendingChanges(),this._minWidth===-1){let e=0;for(let t=0,i=this._arr.length;tt}isInTopPadding(e){return this._paddingTop===0?!1:(this._checkPendingChanges(),e=t-this._paddingBottom}getLineNumberAtOrAfterVerticalOffset(e){if(this._checkPendingChanges(),e=e|0,e<0)return 1;const t=this._lineCount|0,i=this._lineHeight;let s=1,o=t;for(;s=a+i)s=r+1;else{if(e>=a)return r;o=r}}return s>t?t:s}getLinesViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const i=this._lineHeight,s=this.getLineNumberAtOrAfterVerticalOffset(e)|0,o=this.getVerticalOffsetForLineNumber(s)|0;let r=this._lineCount|0,a=this.getFirstWhitespaceIndexAfterLineNumber(s)|0;const l=this.getWhitespacesCount()|0;let c,d;a===-1?(a=l,d=r+1,c=0):(d=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);let u=o,h=u;const f=5e5;let g=0;o>=f&&(g=Math.floor(o/f)*f,g=Math.floor(g/i)*i,h-=g);const p=[],_=e+(t-e)/2;let v=-1;for(let C=s;C<=r;C++){if(v===-1){const L=u,x=u+i;(L<=_&&__)&&(v=C)}for(u+=i,p[C-s]=h,h+=i;d===C;)h+=c,u+=c,a++,a>=l?d=r+1:(d=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);if(u>=t){r=C;break}}v===-1&&(v=r);const b=this.getVerticalOffsetForLineNumber(r)|0;let y=s,w=r;return yt&&w--,{bigNumbersDelta:g,startLineNumber:s,endLineNumber:r,relativeVerticalOffset:p,centeredLineNumber:v,completelyVisibleStartLineNumber:y,completelyVisibleEndLineNumber:w}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e=e|0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let i;t>=1?i=this._lineHeight*t:i=0;let s;return e>0?s=this.getWhitespacesAccumulatedHeight(e-1):s=0,i+s+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e=e|0;let t=0,i=this.getWhitespacesCount()-1;if(i<0)return-1;const s=this.getVerticalOffsetForWhitespaceIndex(i),o=this.getHeightForWhitespaceIndex(i);if(e>=s+o)return-1;for(;t=a+l)t=r+1;else{if(e>=a)return r;i=r}}return t}getWhitespaceAtVerticalOffset(e){this._checkPendingChanges(),e=e|0;const t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0||t>=this.getWhitespacesCount())return null;const i=this.getVerticalOffsetForWhitespaceIndex(t);if(i>e)return null;const s=this.getHeightForWhitespaceIndex(t),o=this.getIdForWhitespaceIndex(t),r=this.getAfterLineNumberForWhitespaceIndex(t);return{id:o,afterLineNumber:r,verticalOffset:i,height:s}}getWhitespaceViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const i=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),s=this.getWhitespacesCount()-1;if(i<0)return[];const o=[];for(let r=i;r<=s;r++){const a=this.getVerticalOffsetForWhitespaceIndex(r),l=this.getHeightForWhitespaceIndex(r);if(a>=t)break;o.push({id:this.getIdForWhitespaceIndex(r),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(r),verticalOffset:a,height:l})}return o}getWhitespaces(){return this._checkPendingChanges(),this._arr.slice(0)}getWhitespacesCount(){return this._checkPendingChanges(),this._arr.length}getIdForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].id}getAfterLineNumberForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].afterLineNumber}getHeightForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].height}};Kq.INSTANCE_COUNT=0;const $Se=125;class p_{constructor(e,t,i,s){e=e|0,t=t|0,i=i|0,s=s|0,e<0&&(e=0),t<0&&(t=0),i<0&&(i=0),s<0&&(s=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=i,this.contentHeight=s,this.scrollHeight=Math.max(i,s)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}}class USe extends Y{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new B),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new p_(0,0,0,0),this._scrollable=this._register(new Q1({forceIntegerValues:!0,smoothScrollDuration:e,scheduleAtNextAnimationFrame:t})),this.onDidScroll=this._scrollable.onScroll}getScrollable(){return this._scrollable}setSmoothScrollDuration(e){this._scrollable.setSmoothScrollDuration(e)}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}getScrollDimensions(){return this._dimensions}setScrollDimensions(e){if(this._dimensions.equals(e))return;const t=this._dimensions;this._dimensions=e,this._scrollable.setScrollDimensions({width:e.width,scrollWidth:e.scrollWidth,height:e.height,scrollHeight:e.scrollHeight},!0);const i=t.contentWidth!==e.contentWidth,s=t.contentHeight!==e.contentHeight;(i||s)&&this._onDidContentSizeChange.fire(new BP(t.contentWidth,t.contentHeight,e.contentWidth,e.contentHeight))}getFutureScrollPosition(){return this._scrollable.getFutureScrollPosition()}getCurrentScrollPosition(){return this._scrollable.getCurrentScrollPosition()}setScrollPositionNow(e){this._scrollable.setScrollPositionNow(e)}setScrollPositionSmooth(e){this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}}class jSe extends Y{constructor(e,t,i){super(),this._configuration=e;const s=this._configuration.options,o=s.get(143),r=s.get(83);this._linesLayout=new Kq(t,s.get(66),r.top,r.bottom),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new USe(0,i)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new p_(o.contentWidth,0,o.height,0)),this.onDidScroll=this._scrollable.onDidScroll,this.onDidContentSizeChange=this._scrollable.onDidContentSizeChange,this._updateHeight()}dispose(){super.dispose()}getScrollable(){return this._scrollable.getScrollable()}onHeightMaybeChanged(){this._updateHeight()}_configureSmoothScrollDuration(){this._scrollable.setSmoothScrollDuration(this._configuration.options.get(113)?$Se:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(66)&&this._linesLayout.setLineHeight(t.get(66)),e.hasChanged(83)){const i=t.get(83);this._linesLayout.setPadding(i.top,i.bottom)}if(e.hasChanged(143)){const i=t.get(143),s=i.contentWidth,o=i.height,r=this._scrollable.getScrollDimensions(),a=r.contentWidth;this._scrollable.setScrollDimensions(new p_(s,r.contentWidth,o,this._getContentHeight(s,o,a)))}else this._updateHeight();e.hasChanged(113)&&this._configureSmoothScrollDuration()}onFlushed(e){this._linesLayout.onFlushed(e)}onLinesDeleted(e,t){this._linesLayout.onLinesDeleted(e,t)}onLinesInserted(e,t){this._linesLayout.onLinesInserted(e,t)}_getHorizontalScrollbarHeight(e,t){const s=this._configuration.options.get(102);return s.horizontal===2||e>=t?0:s.horizontalScrollbarSize}_getContentHeight(e,t,i){const s=this._configuration.options;let o=this._linesLayout.getLinesTotalHeight();return s.get(104)?o+=Math.max(0,t-s.get(66)-s.get(83).bottom):o+=this._getHorizontalScrollbarHeight(e,i),o}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,i=e.height,s=e.contentWidth;this._scrollable.setScrollDimensions(new p_(t,e.contentWidth,i,this._getContentHeight(t,i,s)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new i7(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new i7(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(){const e=this._configuration.options,t=this._maxLineWidth,i=e.get(144),s=e.get(50),o=e.get(143);if(i.isViewportWrapping){const r=e.get(72);return t>o.contentWidth+s.typicalHalfwidthCharacterWidth&&r.enabled&&r.side==="right"?t+o.verticalScrollbarWidth:t}else{const r=e.get(103)*s.typicalHalfwidthCharacterWidth,a=this._linesLayout.getWhitespaceMinWidth();return Math.max(t+r+o.verticalScrollbarWidth,a,this._overlayWidgetsMinWidth)}}setMaxLineWidth(e){this._maxLineWidth=e,this._updateContentWidth()}setOverlayWidgetsMinWidth(e){this._overlayWidgetsMinWidth=e,this._updateContentWidth()}_updateContentWidth(){const e=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new p_(e.width,this._computeContentWidth(),e.height,e.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition(),t=e.scrollTop,i=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t),s=this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(i);return{scrollTop:t,scrollTopWithoutViewZones:t-s,scrollLeft:e.scrollLeft}}changeWhitespace(e){const t=this._linesLayout.changeWhitespace(e);return t&&this.onHeightMaybeChanged(),t}getVerticalOffsetForLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetAfterLineNumber(e,t)}isAfterLines(e){return this._linesLayout.isAfterLines(e)}isInTopPadding(e){return this._linesLayout.isInTopPadding(e)}isInBottomPadding(e){return this._linesLayout.isInBottomPadding(e)}getLineNumberAtVerticalOffset(e){return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e)}getWhitespaceAtVerticalOffset(e){return this._linesLayout.getWhitespaceAtVerticalOffset(e)}getLinesViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getLinesViewportData(e.top,e.top+e.height)}getLinesViewportDataAtScrollTop(e){const t=this._scrollable.getScrollDimensions();return e+t.height>t.scrollHeight&&(e=t.scrollHeight-t.height),e<0&&(e=0),this._linesLayout.getLinesViewportData(e,e+t.height)}getWhitespaceViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getWhitespaceViewportData(e.top,e.top+e.height)}getWhitespaces(){return this._linesLayout.getWhitespaces()}getContentWidth(){return this._scrollable.getScrollDimensions().contentWidth}getScrollWidth(){return this._scrollable.getScrollDimensions().scrollWidth}getContentHeight(){return this._scrollable.getScrollDimensions().contentHeight}getScrollHeight(){return this._scrollable.getScrollDimensions().scrollHeight}getCurrentScrollLeft(){return this._scrollable.getCurrentScrollPosition().scrollLeft}getCurrentScrollTop(){return this._scrollable.getCurrentScrollPosition().scrollTop}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}setScrollPosition(e,t){t===1?this._scrollable.setScrollPositionNow(e):this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}deltaScrollNow(e,t){const i=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:i.scrollLeft+e,scrollTop:i.scrollTop+t})}}class qSe{constructor(e,t,i,s,o){this.editorId=e,this.model=t,this.configuration=i,this._linesCollection=s,this._coordinatesConverter=o,this._decorationsCache=Object.create(null),this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}_clearCachedModelDecorationsResolver(){this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}dispose(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}reset(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onModelDecorationsChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onLineMappingChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}_getOrCreateViewModelDecoration(e){const t=e.id;let i=this._decorationsCache[t];if(!i){const s=e.range,o=e.options;let r;if(o.isWholeLine){const a=this._coordinatesConverter.convertModelPositionToViewPosition(new V(s.startLineNumber,1),0,!1,!0),l=this._coordinatesConverter.convertModelPositionToViewPosition(new V(s.endLineNumber,this.model.getLineMaxColumn(s.endLineNumber)),1);r=new N(a.lineNumber,a.column,l.lineNumber,l.column)}else r=this._coordinatesConverter.convertModelRangeToViewRange(s,1);i=new zj(r,o),this._decorationsCache[t]=i}return i}getMinimapDecorationsInRange(e){return this._getDecorationsInRange(e,!0,!1).decorations}getDecorationsViewportData(e){let t=this._cachedModelDecorationsResolver!==null;return t=t&&e.equalsRange(this._cachedModelDecorationsResolverViewRange),t||(this._cachedModelDecorationsResolver=this._getDecorationsInRange(e,!1,!1),this._cachedModelDecorationsResolverViewRange=e),this._cachedModelDecorationsResolver}getInlineDecorationsOnLine(e,t=!1,i=!1){const s=new N(e,this._linesCollection.getViewLineMinColumn(e),e,this._linesCollection.getViewLineMaxColumn(e));return this._getDecorationsInRange(s,t,i).inlineDecorations[0]}_getDecorationsInRange(e,t,i){const s=this._linesCollection.getDecorationsInRange(e,this.editorId,CS(this.configuration.options),t,i),o=e.startLineNumber,r=e.endLineNumber,a=[];let l=0;const c=[];for(let d=o;d<=r;d++)c[d-o]=[];for(let d=0,u=s.length;dt===1)}function YSe(n,e){return Yq(n,e.range,t=>t===2)}function Yq(n,e,t){for(let i=e.startLineNumber;i<=e.endLineNumber;i++){const s=n.tokenization.getLineTokens(i),o=i===e.startLineNumber,r=i===e.endLineNumber;let a=o?s.findTokenIndexAtOffset(e.startColumn-1):0;for(;ae.endColumn-1);){if(!t(s.getStandardTokenType(a)))return!1;a++}}return!0}function U2(n,e){return n===null?e?rx.INSTANCE:ax.INSTANCE:new ZSe(n,e)}class ZSe{constructor(e,t){this._projectionData=e,this._isVisible=t}isVisible(){return this._isVisible}setVisible(e){return this._isVisible=e,this}getProjectionData(){return this._projectionData}getViewLineCount(){return this._isVisible?this._projectionData.getOutputLineCount():0}getViewLineContent(e,t,i){this._assertVisible();const s=i>0?this._projectionData.breakOffsets[i-1]:0,o=this._projectionData.breakOffsets[i];let r;if(this._projectionData.injectionOffsets!==null){const a=this._projectionData.injectionOffsets.map((c,d)=>new ca(0,0,c+1,this._projectionData.injectionOptions[d],0));r=ca.applyInjectedText(e.getLineContent(t),a).substring(s,o)}else r=e.getValueInRange({startLineNumber:t,startColumn:s+1,endLineNumber:t,endColumn:o+1});return i>0&&(r=g6(this._projectionData.wrappedTextIndentLength)+r),r}getViewLineLength(e,t,i){return this._assertVisible(),this._projectionData.getLineLength(i)}getViewLineMinColumn(e,t,i){return this._assertVisible(),this._projectionData.getMinOutputOffset(i)+1}getViewLineMaxColumn(e,t,i){return this._assertVisible(),this._projectionData.getMaxOutputOffset(i)+1}getViewLineData(e,t,i){const s=new Array;return this.getViewLinesData(e,t,i,1,0,[!0],s),s[0]}getViewLinesData(e,t,i,s,o,r,a){this._assertVisible();const l=this._projectionData,c=l.injectionOffsets,d=l.injectionOptions;let u=null;if(c){u=[];let f=0,g=0;for(let p=0;p0?l.breakOffsets[p-1]:0,b=l.breakOffsets[p];for(;gb)break;if(v0?l.wrappedTextIndentLength:0,D=x+Math.max(w-v,0),k=x+Math.min(C-v,b-v);D!==k&&_.push(new ibe(D,k,L.inlineClassName,L.inlineClassNameAffectsLetterSpacing))}}if(C<=b)f+=y,g++;else break}}}let h;c?h=e.tokenization.getLineTokens(t).withInserted(c.map((f,g)=>({offset:f,text:d[g].content,tokenMetadata:an.defaultTokenMetadata}))):h=e.tokenization.getLineTokens(t);for(let f=i;f0?s.wrappedTextIndentLength:0,r=i>0?s.breakOffsets[i-1]:0,a=s.breakOffsets[i],l=e.sliceAndInflate(r,a,o);let c=l.getLineContent();i>0&&(c=g6(s.wrappedTextIndentLength)+c);const d=this._projectionData.getMinOutputOffset(i)+1,u=c.length+1,h=i+1=j2.length)for(let e=1;e<=n;e++)j2[e]=XSe(e);return j2[n]}function XSe(n){return new Array(n+1).join(" ")}class QSe{constructor(e,t,i,s,o,r,a,l,c,d){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=i,this._monospaceLineBreaksComputerFactory=s,this.fontInfo=o,this.tabSize=r,this.wrappingStrategy=a,this.wrappingColumn=l,this.wrappingIndent=c,this.wordBreak=d,this._constructLines(!0,null)}dispose(){this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[])}createCoordinatesConverter(){return new exe(this)}_constructLines(e,t){this.modelLineProjections=[],e&&(this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[]));const i=this.model.getLinesContent(),s=this.model.getInjectedTextDecorations(this._editorId),o=i.length,r=this.createLineBreaksComputer(),a=new _c(ca.fromDecorations(s));for(let p=0;pv.lineNumber===p+1);r.addRequest(i[p],_,t?t[p]:null)}const l=r.finalize(),c=[],d=this.hiddenAreasDecorationIds.map(p=>this.model.getDecorationRange(p)).sort(N.compareRangesUsingStarts);let u=1,h=0,f=-1,g=f+1=u&&_<=h,b=U2(l[p],!v);c[p]=b.getViewLineCount(),this.modelLineProjections[p]=b}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new P0e(c)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e))}setHiddenAreas(e){const t=e.map(h=>this.model.validateRange(h)),i=JSe(t),s=this.hiddenAreasDecorationIds.map(h=>this.model.getDecorationRange(h)).sort(N.compareRangesUsingStarts);if(i.length===s.length){let h=!1;for(let f=0;f({range:h,options:et.EMPTY}));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,o);const r=i;let a=1,l=0,c=-1,d=c+1=a&&f<=l?this.modelLineProjections[h].isVisible()&&(this.modelLineProjections[h]=this.modelLineProjections[h].setVisible(!1),g=!0):(u=!0,this.modelLineProjections[h].isVisible()||(this.modelLineProjections[h]=this.modelLineProjections[h].setVisible(!0),g=!0)),g){const p=this.modelLineProjections[h].getViewLineCount();this.projectedModelLineLineCounts.setValue(h,p)}}return u||this.setHiddenAreas([]),!0}modelPositionIsVisible(e,t){return e<1||e>this.modelLineProjections.length?!1:this.modelLineProjections[e-1].isVisible()}getModelLineViewLineCount(e){return e<1||e>this.modelLineProjections.length?1:this.modelLineProjections[e-1].getViewLineCount()}setTabSize(e){return this.tabSize===e?!1:(this.tabSize=e,this._constructLines(!1,null),!0)}setWrappingSettings(e,t,i,s,o){const r=this.fontInfo.equals(e),a=this.wrappingStrategy===t,l=this.wrappingColumn===i,c=this.wrappingIndent===s,d=this.wordBreak===o;if(r&&a&&l&&c&&d)return!1;const u=r&&a&&!l&&c&&d;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=i,this.wrappingIndent=s,this.wordBreak=o;let h=null;if(u){h=[];for(let f=0,g=this.modelLineProjections.length;f2&&!this.modelLineProjections[t-2].isVisible(),r=t===1?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1;let a=0;const l=[],c=[];for(let d=0,u=s.length;dl?(d=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,u=d+l-1,g=u+1,p=g+(o-l)-1,c=!0):ot?t:e|0}getActiveIndentGuide(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),i=this._toValidViewLineNumber(i);const s=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),o=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),r=this.convertViewPositionToModelPosition(i,this.getViewLineMinColumn(i)),a=this.model.guides.getActiveIndentGuide(s.lineNumber,o.lineNumber,r.lineNumber),l=this.convertModelPositionToViewPosition(a.startLineNumber,1),c=this.convertModelPositionToViewPosition(a.endLineNumber,this.model.getLineMaxColumn(a.endLineNumber));return{startLineNumber:l.lineNumber,endLineNumber:c.lineNumber,indent:a.indent}}getViewLineInfo(e){e=this._toValidViewLineNumber(e);const t=this.projectedModelLineLineCounts.getIndexOf(e-1),i=t.index,s=t.remainder;return new p6(i+1,s)}getMinColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getMaxColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getModelStartPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),s=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new V(e.modelLineNumber,s)}getModelEndPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),s=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new V(e.modelLineNumber,s)}getViewLineInfosGroupedByModelRanges(e,t){const i=this.getViewLineInfo(e),s=this.getViewLineInfo(t),o=new Array;let r=this.getModelStartPositionOfViewLine(i),a=new Array;for(let l=i.modelLineNumber;l<=s.modelLineNumber;l++){const c=this.modelLineProjections[l-1];if(c.isVisible()){const d=l===i.modelLineNumber?i.modelLineWrappedLineIdx:0,u=l===s.modelLineNumber?s.modelLineWrappedLineIdx+1:c.getViewLineCount();for(let h=d;h{if(f.forWrappedLinesAfterColumn!==-1&&this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,f.forWrappedLinesAfterColumn).lineNumber>=d.modelLineWrappedLineIdx||f.forWrappedLinesBeforeOrAtColumn!==-1&&this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,f.forWrappedLinesBeforeOrAtColumn).lineNumberd.modelLineWrappedLineIdx)return}const p=this.convertModelPositionToViewPosition(d.modelLineNumber,f.horizontalLine.endColumn),_=this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,f.horizontalLine.endColumn);return _.lineNumber===d.modelLineWrappedLineIdx?new Ah(f.visibleColumn,g,f.className,new F_(f.horizontalLine.top,p.column),-1,-1):_.lineNumber!!f))}}return r}getViewLinesIndentGuides(e,t){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const i=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),s=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t));let o=[];const r=[],a=[],l=i.lineNumber-1,c=s.lineNumber-1;let d=null;for(let g=l;g<=c;g++){const p=this.modelLineProjections[g];if(p.isVisible()){const _=p.getViewLineNumberOfModelPosition(0,g===l?i.column:1),v=p.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(g+1)),b=v-_+1;let y=0;b>1&&p.getViewLineMinColumn(this.model,g+1,v)===1&&(y=_===0?1:2),r.push(b),a.push(y),d===null&&(d=new V(g+1,0))}else d!==null&&(o=o.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,g)),d=null)}d!==null&&(o=o.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,s.lineNumber)),d=null);const u=t-e+1,h=new Array(u);let f=0;for(let g=0,p=o.length;gt&&(g=!0,f=t-o+1),u.getViewLinesData(this.model,c+1,h,f,o-e,i,l),o+=f,g)break}return l}validateViewPosition(e,t,i){e=this._toValidViewLineNumber(e);const s=this.projectedModelLineLineCounts.getIndexOf(e-1),o=s.index,r=s.remainder,a=this.modelLineProjections[o],l=a.getViewLineMinColumn(this.model,o+1,r),c=a.getViewLineMaxColumn(this.model,o+1,r);tc&&(t=c);const d=a.getModelColumnOfViewPosition(r,t);return this.model.validatePosition(new V(o+1,d)).equals(i)?new V(e,t):this.convertModelPositionToViewPosition(i.lineNumber,i.column)}validateViewRange(e,t){const i=this.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),s=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new N(i.lineNumber,i.column,s.lineNumber,s.column)}convertViewPositionToModelPosition(e,t){const i=this.getViewLineInfo(e),s=this.modelLineProjections[i.modelLineNumber-1].getModelColumnOfViewPosition(i.modelLineWrappedLineIdx,t);return this.model.validatePosition(new V(i.modelLineNumber,s))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new N(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t,i=2,s=!1,o=!1){const r=this.model.validatePosition(new V(e,t)),a=r.lineNumber,l=r.column;let c=a-1,d=!1;if(o)for(;c0&&!this.modelLineProjections[c].isVisible();)c--,d=!0;if(c===0&&!this.modelLineProjections[c].isVisible())return new V(s?0:1,1);const u=1+this.projectedModelLineLineCounts.getPrefixSum(c);let h;return d?o?h=this.modelLineProjections[c].getViewPositionOfModelPosition(u,1,i):h=this.modelLineProjections[c].getViewPositionOfModelPosition(u,this.model.getLineMaxColumn(c+1),i):h=this.modelLineProjections[a-1].getViewPositionOfModelPosition(u,l,i),h}convertModelRangeToViewRange(e,t=0){if(e.isEmpty()){const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return N.fromPositions(i)}else{const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),s=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new N(i.lineNumber,i.column,s.lineNumber,s.column)}}getViewLineNumberOfModelPosition(e,t){let i=e-1;if(this.modelLineProjections[i].isVisible()){const o=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(o,t)}for(;i>0&&!this.modelLineProjections[i].isVisible();)i--;if(i===0&&!this.modelLineProjections[i].isVisible())return 1;const s=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(s,this.model.getLineMaxColumn(i+1))}getDecorationsInRange(e,t,i,s,o){const r=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),a=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(a.lineNumber-r.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new N(r.lineNumber,1,a.lineNumber,a.column),t,i,s,o);let l=[];const c=r.lineNumber-1,d=a.lineNumber-1;let u=null;for(let p=c;p<=d;p++)if(this.modelLineProjections[p].isVisible())u===null&&(u=new V(p+1,p===c?r.column:1));else if(u!==null){const v=this.model.getLineMaxColumn(p);l=l.concat(this.model.getDecorationsInRange(new N(u.lineNumber,u.column,p,v),t,i,s)),u=null}u!==null&&(l=l.concat(this.model.getDecorationsInRange(new N(u.lineNumber,u.column,a.lineNumber,a.column),t,i,s)),u=null),l.sort((p,_)=>{const v=N.compareRangesUsingStarts(p.range,_.range);return v===0?p.id<_.id?-1:p.id>_.id?1:0:v});const h=[];let f=0,g=null;for(const p of l){const _=p.id;g!==_&&(g=_,h[f++]=p)}return h}getInjectedTextAt(e){const t=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[t.modelLineNumber-1].getInjectedTextAt(t.modelLineWrappedLineIdx,e.column)}normalizePosition(e,t){const i=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[i.modelLineNumber-1].normalizePosition(i.modelLineWrappedLineIdx,e,t)}getLineIndentColumn(e){const t=this.getViewLineInfo(e);return t.modelLineWrappedLineIdx===0?this.model.getLineIndentColumn(t.modelLineNumber):0}}function JSe(n){if(n.length===0)return[];const e=n.slice();e.sort(N.compareRangesUsingStarts);const t=[];let i=e[0].startLineNumber,s=e[0].endLineNumber;for(let o=1,r=e.length;os+1?(t.push(new N(i,1,s,1)),i=a.startLineNumber,s=a.endLineNumber):a.endLineNumber>s&&(s=a.endLineNumber)}return t.push(new N(i,1,s,1)),t}class p6{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class m6{constructor(e,t){this.modelRange=e,this.viewLines=t}}class exe{constructor(e){this._lines=e}convertViewPositionToModelPosition(e){return this._lines.convertViewPositionToModelPosition(e.lineNumber,e.column)}convertViewRangeToModelRange(e){return this._lines.convertViewRangeToModelRange(e)}validateViewPosition(e,t){return this._lines.validateViewPosition(e.lineNumber,e.column,t)}validateViewRange(e,t){return this._lines.validateViewRange(e,t)}convertModelPositionToViewPosition(e,t,i,s){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t,i,s)}convertModelRangeToViewRange(e,t){return this._lines.convertModelRangeToViewRange(e,t)}modelPositionIsVisible(e){return this._lines.modelPositionIsVisible(e.lineNumber,e.column)}getModelLineViewLineCount(e){return this._lines.getModelLineViewLineCount(e)}getViewLineNumberOfModelPosition(e,t){return this._lines.getViewLineNumberOfModelPosition(e,t)}}class txe{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new ixe(this)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,i,s){return!1}createLineBreaksComputer(){const e=[];return{addRequest:(t,i,s)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,i){return new qT(t,i)}onModelLinesInserted(e,t,i,s){return new GT(t,i)}onModelLineChanged(e,t,i){return[!1,new Gq(t,1),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,i){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesBracketGuides(e,t,i){return new Array(t-e+1).fill([])}getViewLinesIndentGuides(e,t){const i=t-e+1,s=new Array(i);for(let o=0;ot)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,t){return e}}let nxe=class extends Y{constructor(e,t,i,s,o,r,a,l,c){if(super(),this.languageConfigurationService=a,this._themeService=l,this._attachedView=c,this.hiddenAreasModel=new oxe,this.previousHiddenAreas=[],this._editorId=e,this._configuration=t,this.model=i,this._eventDispatcher=new xSe,this.onEvent=this._eventDispatcher.onEvent,this.cursorConfig=new pg(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._updateConfigurationViewLineCount=this._register(new Di(()=>this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStart=zP.create(this.model),this.model.isTooLargeForTokenization())this._lines=new txe(this.model);else{const d=this._configuration.options,u=d.get(50),h=d.get(137),f=d.get(144),g=d.get(136),p=d.get(128);this._lines=new QSe(this._editorId,this.model,s,o,u,this.model.getOptions().tabSize,h,f.wrappingColumn,g,p)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new PSe(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new jSe(this._configuration,this.getLineCount(),r)),this._register(this.viewLayout.onDidScroll(d=>{d.scrollTopChanged&&this._handleVisibleLinesChanged(),d.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new vSe(d)),this._eventDispatcher.emitOutgoingEvent(new VP(d.oldScrollWidth,d.oldScrollLeft,d.oldScrollHeight,d.oldScrollTop,d.scrollWidth,d.scrollLeft,d.scrollHeight,d.scrollTop))})),this._register(this.viewLayout.onDidContentSizeChange(d=>{this._eventDispatcher.emitOutgoingEvent(d)})),this._decorations=new qSe(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast(d=>{try{const u=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(u,d)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(iy.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new CSe)})),this._register(this._themeService.onDidColorThemeChange(d=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new ySe(d))})),this._updateConfigurationViewLineCountNow()}dispose(){super.dispose(),this._decorations.dispose(),this._lines.dispose(),this._viewportStart.dispose(),this._eventDispatcher.dispose()}createLineBreaksComputer(){return this._lines.createLineBreaksComputer()}addViewEventHandler(e){this._eventDispatcher.addViewEventHandler(e)}removeViewEventHandler(e){this._eventDispatcher.removeViewEventHandler(e)}_updateConfigurationViewLineCountNow(){this._configuration.setViewLineCount(this._lines.getViewLineCount())}getModelVisibleRanges(){const e=this.viewLayout.getLinesViewportData(),t=new N(e.startLineNumber,this.getLineMinColumn(e.startLineNumber),e.endLineNumber,this.getLineMaxColumn(e.endLineNumber));return this._toModelVisibleRanges(t)}visibleLinesStabilized(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!0)}_handleVisibleLinesChanged(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!1)}setHasFocus(e){this._hasFocus=e,this._cursor.setHasFocus(e),this._eventDispatcher.emitSingleViewEvent(new _Se(e)),this._eventDispatcher.emitOutgoingEvent(new WP(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new fSe)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new gSe)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){const e=new V(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber)),t=this.coordinatesConverter.convertViewPositionToModelPosition(e);return new b6(t,this._viewportStart.startLineDelta)}return new b6(null,0)}_onConfigurationChanged(e,t){const i=this._captureStableViewport(),s=this._configuration.options,o=s.get(50),r=s.get(137),a=s.get(144),l=s.get(136),c=s.get(128);this._lines.setWrappingSettings(o,r,a.wrappingColumn,l,c)&&(e.emitViewEvent(new uw),e.emitViewEvent(new hw),e.emitViewEvent(new vg(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(90)&&(this._decorations.reset(),e.emitViewEvent(new vg(null))),e.emitViewEvent(new pSe(t)),this.viewLayout.onConfigurationChanged(t),i.recoverViewportStart(this.coordinatesConverter,this.viewLayout),pg.shouldRecreate(t)&&(this.cursorConfig=new pg(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText(e=>{try{const i=this._eventDispatcher.beginEmitViewEvents();let s=!1,o=!1;const r=e instanceof Jh?e.rawContentChangedEvent.changes:e.changes,a=e instanceof Jh?e.rawContentChangedEvent.versionId:null,l=this._lines.createLineBreaksComputer();for(const u of r)switch(u.changeType){case 4:{for(let h=0;h!p.ownerId||p.ownerId===this._editorId)),l.addRequest(f,g,null)}break}case 2:{let h=null;u.injectedText&&(h=u.injectedText.filter(f=>!f.ownerId||f.ownerId===this._editorId)),l.addRequest(u.detail,h,null);break}}const c=l.finalize(),d=new _c(c);for(const u of r)switch(u.changeType){case 1:{this._lines.onModelFlushed(),i.emitViewEvent(new uw),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),s=!0;break}case 3:{const h=this._lines.onModelLinesDeleted(a,u.fromLineNumber,u.toLineNumber);h!==null&&(i.emitViewEvent(h),this.viewLayout.onLinesDeleted(h.fromLineNumber,h.toLineNumber)),s=!0;break}case 4:{const h=d.takeCount(u.detail.length),f=this._lines.onModelLinesInserted(a,u.fromLineNumber,u.toLineNumber,h);f!==null&&(i.emitViewEvent(f),this.viewLayout.onLinesInserted(f.fromLineNumber,f.toLineNumber)),s=!0;break}case 2:{const h=d.dequeue(),[f,g,p,_]=this._lines.onModelLineChanged(a,u.lineNumber,h);o=f,g&&i.emitViewEvent(g),p&&(i.emitViewEvent(p),this.viewLayout.onLinesInserted(p.fromLineNumber,p.toLineNumber)),_&&(i.emitViewEvent(_),this.viewLayout.onLinesDeleted(_.fromLineNumber,_.toLineNumber));break}case 5:break}a!==null&&this._lines.acceptVersionId(a),this.viewLayout.onHeightMaybeChanged(),!s&&o&&(i.emitViewEvent(new hw),i.emitViewEvent(new vg(null)),this._cursor.onLineMappingChanged(i),this._decorations.onLineMappingChanged())}finally{this._eventDispatcher.endEmitViewEvents()}const t=this._viewportStart.isValid;if(this._viewportStart.invalidate(),this._configuration.setModelLineCount(this.model.getLineCount()),this._updateConfigurationViewLineCountNow(),!this._hasFocus&&this.model.getAttachedEditorCount()>=2&&t){const i=this.model._getTrackedRange(this._viewportStart.modelTrackedRange);if(i){const s=this.coordinatesConverter.convertModelPositionToViewPosition(i.getStartPosition()),o=this.viewLayout.getVerticalOffsetForLineNumber(s.lineNumber);this.viewLayout.setScrollPosition({scrollTop:o+this._viewportStart.startLineDelta},1)}}try{const i=this._eventDispatcher.beginEmitViewEvents();e instanceof Jh&&i.emitOutgoingEvent(new NSe(e.contentChangedEvent)),this._cursor.onModelContentChanged(i,e)}finally{this._eventDispatcher.endEmitViewEvents()}this._handleVisibleLinesChanged()})),this._register(this.model.onDidChangeTokens(e=>{const t=[];for(let i=0,s=e.ranges.length;i{this._eventDispatcher.emitSingleViewEvent(new bSe),this.cursorConfig=new pg(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new TSe(e))})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new pg(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new ISe(e))})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const t=this._eventDispatcher.beginEmitViewEvents();t.emitViewEvent(new uw),t.emitViewEvent(new hw),t.emitViewEvent(new vg(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new pg(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new RSe(e))})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new vg(e)),this._eventDispatcher.emitOutgoingEvent(new ASe(e))}))}setHiddenAreas(e,t){this.hiddenAreasModel.setHiddenAreas(t,e);const i=this.hiddenAreasModel.getMergedRanges();if(i===this.previousHiddenAreas)return;this.previousHiddenAreas=i;const s=this._captureStableViewport();let o=!1;try{const r=this._eventDispatcher.beginEmitViewEvents();o=this._lines.setHiddenAreas(i),o&&(r.emitViewEvent(new uw),r.emitViewEvent(new hw),r.emitViewEvent(new vg(null)),this._cursor.onLineMappingChanged(r),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged()),s.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),o&&this._eventDispatcher.emitOutgoingEvent(new kSe)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(143),t=this._configuration.options.get(66),i=Math.max(20,Math.round(e.height/t)),s=this.viewLayout.getLinesViewportData(),o=Math.max(1,s.completelyVisibleStartLineNumber-i),r=Math.min(this.getLineCount(),s.completelyVisibleEndLineNumber+i);return this._toModelVisibleRanges(new N(o,this.getLineMinColumn(o),r,this.getLineMaxColumn(r)))}getVisibleRanges(){const e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}getHiddenAreas(){return this._lines.getHiddenAreas()}_toModelVisibleRanges(e){const t=this.coordinatesConverter.convertViewRangeToModelRange(e),i=this._lines.getHiddenAreas();if(i.length===0)return[t];const s=[];let o=0,r=t.startLineNumber,a=t.startColumn;const l=t.endLineNumber,c=t.endColumn;for(let d=0,u=i.length;dl||(r"u")return this._reduceRestoreStateCompatibility(e);const t=this.model.validatePosition(e.firstPosition),i=this.coordinatesConverter.convertModelPositionToViewPosition(t),s=this.viewLayout.getVerticalOffsetForLineNumber(i.lineNumber)-e.firstPositionDeltaTop;return{scrollLeft:e.scrollLeft,scrollTop:s}}_reduceRestoreStateCompatibility(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTopWithoutViewZones}}getTabSize(){return this.model.getOptions().tabSize}getLineCount(){return this._lines.getViewLineCount()}setViewport(e,t,i){this._viewportStart.update(this,e)}getActiveIndentGuide(e,t,i){return this._lines.getActiveIndentGuide(e,t,i)}getLinesIndentGuides(e,t){return this._lines.getViewLinesIndentGuides(e,t)}getBracketGuidesInRangeByLine(e,t,i,s){return this._lines.getViewLinesBracketGuides(e,t,i,s)}getLineContent(e){return this._lines.getViewLineContent(e)}getLineLength(e){return this._lines.getViewLineLength(e)}getLineMinColumn(e){return this._lines.getViewLineMinColumn(e)}getLineMaxColumn(e){return this._lines.getViewLineMaxColumn(e)}getLineFirstNonWhitespaceColumn(e){const t=Qs(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=zf(this.getLineContent(e));return t===-1?0:t+2}getMinimapDecorationsInRange(e){return this._decorations.getMinimapDecorationsInRange(e)}getDecorationsInViewport(e){return this._decorations.getDecorationsViewportData(e).decorations}getInjectedTextAt(e){return this._lines.getInjectedTextAt(e)}getViewportViewLineRenderingData(e,t){const s=this._decorations.getDecorationsViewportData(e).inlineDecorations[t-e.startLineNumber];return this._getViewLineRenderingData(t,s)}getViewLineRenderingData(e){const t=this._decorations.getInlineDecorationsOnLine(e);return this._getViewLineRenderingData(e,t)}_getViewLineRenderingData(e,t){const i=this.model.mightContainRTL(),s=this.model.mightContainNonBasicASCII(),o=this.getTabSize(),r=this._lines.getViewLineData(e);return r.inlineDecorations&&(t=[...t,...r.inlineDecorations.map(a=>a.toInlineDecoration(e))]),new Eo(r.minColumn,r.maxColumn,r.content,r.continuesWithWrappedLine,i,s,r.tokens,t,o,r.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,i){const s=this._lines.getViewLinesData(e,t,i);return new tbe(this.getTabSize(),s)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,CS(this._configuration.options)),i=new sxe;for(const s of t){const o=s.options,r=o.overviewRuler;if(!r)continue;const a=r.position;if(a===0)continue;const l=r.getColor(e.value),c=this.coordinatesConverter.getViewLineNumberOfModelPosition(s.range.startLineNumber,s.range.startColumn),d=this.coordinatesConverter.getViewLineNumberOfModelPosition(s.range.endLineNumber,s.range.endColumn);i.accept(l,o.zIndex,c,d,a)}return i.asArray}_invalidateDecorationsColorCache(){const e=this.model.getOverviewRulerDecorations();for(const t of e){const i=t.options.overviewRuler;i==null||i.invalidateCachedColor();const s=t.options.minimap;s==null||s.invalidateCachedColor()}}getValueInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(i,t)}getValueLengthInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueLengthInRange(i,t)}modifyPosition(e,t){const i=this.coordinatesConverter.convertViewPositionToModelPosition(e);return this.model.modifyPosition(i,t)}deduceModelPositionRelativeToViewPosition(e,t,i){const s=this.coordinatesConverter.convertViewPositionToModelPosition(e);this.model.getEOL().length===2&&(t<0?t-=i:t+=i);const r=this.model.getOffsetAt(s)+t;return this.model.getPositionAt(r)}getPlainTextToCopy(e,t,i){const s=i?`\r -`:this.model.getEOL();e=e.slice(0),e.sort(N.compareRangesUsingStarts);let o=!1,r=!1;for(const l of e)l.isEmpty()?o=!0:r=!0;if(!r){if(!t)return"";const l=e.map(d=>d.startLineNumber);let c="";for(let d=0;d0&&l[d-1]===l[d]||(c+=this.model.getLineContent(l[d])+s);return c}if(o&&t){const l=[];let c=0;for(const d of e){const u=d.startLineNumber;d.isEmpty()?u!==c&&l.push(this.model.getLineContent(u)):l.push(this.model.getValueInRange(d,i?2:0)),c=u}return l.length===1?l[0]:l}const a=[];for(const l of e)l.isEmpty()||a.push(this.model.getValueInRange(l,i?2:0));return a.length===1?a[0]:a}getRichTextToCopy(e,t){const i=this.model.getLanguageId();if(i===$o||e.length!==1)return null;let s=e[0];if(s.isEmpty()){if(!t)return null;const d=s.startLineNumber;s=new N(d,this.model.getLineMinColumn(d),d,this.model.getLineMaxColumn(d))}const o=this._configuration.options.get(50),r=this._getColorMap(),l=/[:;\\\/<>]/.test(o.fontFamily)||o.fontFamily===Ho.fontFamily;let c;return l?c=Ho.fontFamily:(c=o.fontFamily,c=c.replace(/"/g,"'"),/[,']/.test(c)||/[+ ]/.test(c)&&(c=`'${c}'`),c=`${c}, ${Ho.fontFamily}`),{mode:i,html:`
`+this._getHTMLToCopy(s,r)+"
"}}_getHTMLToCopy(e,t){const i=e.startLineNumber,s=e.startColumn,o=e.endLineNumber,r=e.endColumn,a=this.getTabSize();let l="";for(let c=i;c<=o;c++){const d=this.model.tokenization.getLineTokens(c),u=d.getLineContent(),h=c===i?s-1:0,f=c===o?r-1:u.length;u===""?l+="
":l+=VSe(u,d.inflate(),t,h,f,a,Fs)}return l}_getColorMap(){const e=xi.getColorMap(),t=["#000000"];if(e)for(let i=1,s=e.length;ithis._cursor.setStates(s,e,t,i))}getCursorColumnSelectData(){return this._cursor.getCursorColumnSelectData()}getCursorAutoClosedCharacters(){return this._cursor.getAutoClosedCharacters()}setCursorColumnSelectData(e){this._cursor.setCursorColumnSelectData(e)}getPrevEditOperationType(){return this._cursor.getPrevEditOperationType()}setPrevEditOperationType(e){this._cursor.setPrevEditOperationType(e)}getSelection(){return this._cursor.getSelection()}getSelections(){return this._cursor.getSelections()}getPosition(){return this._cursor.getPrimaryCursorState().modelState.position}setSelections(e,t,i=0){this._withViewEventsCollector(s=>this._cursor.setSelections(s,e,t,i))}saveCursorState(){return this._cursor.saveState()}restoreCursorState(e){this._withViewEventsCollector(t=>this._cursor.restoreState(t,e))}_executeCursorEdit(e){if(this._cursor.context.cursorConfig.readOnly){this._eventDispatcher.emitOutgoingEvent(new ESe);return}this._withViewEventsCollector(e)}executeEdits(e,t,i){this._executeCursorEdit(s=>this._cursor.executeEdits(s,e,t,i))}startComposition(){this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._executeCursorEdit(t=>this._cursor.endComposition(t,e))}type(e,t){this._executeCursorEdit(i=>this._cursor.type(i,e,t))}compositionType(e,t,i,s,o){this._executeCursorEdit(r=>this._cursor.compositionType(r,e,t,i,s,o))}paste(e,t,i,s){this._executeCursorEdit(o=>this._cursor.paste(o,e,t,i,s))}cut(e){this._executeCursorEdit(t=>this._cursor.cut(t,e))}executeCommand(e,t){this._executeCursorEdit(i=>this._cursor.executeCommand(i,e,t))}executeCommands(e,t){this._executeCursorEdit(i=>this._cursor.executeCommands(i,e,t))}revealPrimaryCursor(e,t,i=!1){this._withViewEventsCollector(s=>this._cursor.revealPrimary(s,e,i,0,t,0))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),i=new N(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(s=>s.emitViewEvent(new LC(e,!1,i,null,0,!0,0)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new N(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(s=>s.emitViewEvent(new LC(e,!1,i,null,0,!0,0)))}revealRange(e,t,i,s,o){this._withViewEventsCollector(r=>r.emitViewEvent(new LC(e,!1,i,null,s,t,o)))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new SSe),this._eventDispatcher.emitOutgoingEvent(new DSe))}_withViewEventsCollector(e){try{const t=this._eventDispatcher.beginEmitViewEvents();return e(t)}finally{this._eventDispatcher.endEmitViewEvents()}}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}};class zP{static create(e){const t=e._setTrackedRange(null,new N(1,1,1,1),1);return new zP(e,1,!1,t,0)}get viewLineNumber(){return this._viewLineNumber}get isValid(){return this._isValid}get modelTrackedRange(){return this._modelTrackedRange}get startLineDelta(){return this._startLineDelta}constructor(e,t,i,s,o){this._model=e,this._viewLineNumber=t,this._isValid=i,this._modelTrackedRange=s,this._startLineDelta=o}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,1)}update(e,t){const i=e.coordinatesConverter.convertViewPositionToModelPosition(new V(t,e.getLineMinColumn(t))),s=e.model._setTrackedRange(this._modelTrackedRange,new N(i.lineNumber,i.column,i.lineNumber,i.column),1),o=e.viewLayout.getVerticalOffsetForLineNumber(t),r=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=s,this._startLineDelta=r-o}invalidate(){this._isValid=!1}}class sxe{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,i,s,o){const r=this._asMap[e];if(r){const a=r.data,l=a[a.length-3],c=a[a.length-1];if(l===o&&c+1>=i){s>c&&(a[a.length-1]=s);return}a.push(o,i,s)}else{const a=new Qb(e,t,[o,i,s]);this._asMap[e]=a,this.asArray.push(a)}}}class oxe{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const i=this.hiddenAreas.get(e);i&&_6(i,t)||(this.hiddenAreas.set(e,t),this.shouldRecompute=!0)}getMergedRanges(){if(!this.shouldRecompute)return this.ranges;this.shouldRecompute=!1;const e=Array.from(this.hiddenAreas.values()).reduce((t,i)=>rxe(t,i),[]);return _6(this.ranges,e)?this.ranges:(this.ranges=e,this.ranges)}}function rxe(n,e){const t=[];let i=0,s=0;for(;i0?this.wrappedTextIndentLength:0}getLineLength(e){const t=e>0?this.breakOffsets[e-1]:0;let s=this.breakOffsets[e]-t;return e>0&&(s+=this.wrappedTextIndentLength),s}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let s=e===0?t:this.breakOffsets[e-1]+t;if(this.injectionOffsets!==null)for(let o=0;othis.injectionOffsets[o];o++)s0?this.breakOffsets[o-1]:0,t===0)if(e<=r)s=o-1;else if(e>l)i=o+1;else break;else if(e=l)i=o+1;else break}let a=e-r;return o>0&&(a+=this.wrappedTextIndentLength),new fw(o,a)}normalizeOutputPosition(e,t,i){if(this.injectionOffsets!==null){const s=this.outputPositionToOffsetInInputWithInjections(e,t),o=this.normalizeOffsetInInputWithInjectionsAroundInjections(s,i);if(o!==s)return this.offsetInInputWithInjectionsToOutputPosition(o,i)}if(i===0){if(e>0&&t===this.getMinOutputOffset(e))return new fw(e-1,this.getMaxOutputOffset(e-1))}else if(i===1){const s=this.getOutputLineCount()-1;if(e0&&(t=Math.max(0,t-this.wrappedTextIndentLength)),(e>0?this.breakOffsets[e-1]:0)+t}normalizeOffsetInInputWithInjectionsAroundInjections(e,t){const i=this.getInjectedTextAtOffset(e);if(!i)return e;if(t===2){if(e===i.offsetInInputWithInjections+i.length&&v6(this.injectionOptions[i.injectedTextIndex].cursorStops))return i.offsetInInputWithInjections+i.length;{let s=i.offsetInInputWithInjections;if(y6(this.injectionOptions[i.injectedTextIndex].cursorStops))return s;let o=i.injectedTextIndex-1;for(;o>=0&&this.injectionOffsets[o]===this.injectionOffsets[i.injectedTextIndex]&&!(v6(this.injectionOptions[o].cursorStops)||(s-=this.injectionOptions[o].content.length,y6(this.injectionOptions[o].cursorStops)));)o--;return s}}else if(t===1||t===4){let s=i.offsetInInputWithInjections+i.length,o=i.injectedTextIndex;for(;o+1=0&&this.injectionOffsets[o-1]===this.injectionOffsets[o];)s-=this.injectionOptions[o-1].content.length,o--;return s}K4()}getInjectedText(e,t){const i=this.outputPositionToOffsetInInputWithInjections(e,t),s=this.getInjectedTextAtOffset(i);return s?{options:this.injectionOptions[s.injectedTextIndex]}:null}getInjectedTextAtOffset(e){const t=this.injectionOffsets,i=this.injectionOptions;if(t!==null){let s=0;for(let o=0;oe)break;if(e<=l)return{injectedTextIndex:o,offsetInInputWithInjections:a,length:r};s+=r}}}}function v6(n){return n==null?!0:n===Cm.Right||n===Cm.Both}function y6(n){return n==null?!0:n===Cm.Left||n===Cm.Both}class fw{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new V(e+this.outputLineIndex,this.outputOffset+1)}}class HP{static create(e){return new HP(e.get(132),e.get(131))}constructor(e,t){this.classifier=new lxe(e,t)}createLineBreaksComputer(e,t,i,s,o){const r=[],a=[],l=[];return{addRequest:(c,d,u)=>{r.push(c),a.push(d),l.push(u)},finalize:()=>{const c=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,d=[];for(let u=0,h=r.length;u=0&&e<256?this._asciiMap[e]:e>=12352&&e<=12543||e>=13312&&e<=19903||e>=19968&&e<=40959?3:this._map.get(e)||this._defaultValue}}let YT=[],ZT=[];function cxe(n,e,t,i,s,o,r,a){if(s===-1)return null;const l=t.length;if(l<=1)return null;const c=a==="keepAll",d=e.breakOffsets,u=e.breakOffsetsVisibleColumn,h=Xq(t,i,s,o,r),f=s-h,g=YT,p=ZT;let _=0,v=0,b=0,y=s;const w=d.length;let C=0;if(C>=0){let L=Math.abs(u[C]-y);for(;C+1=L)break;L=x,C++}}for(;CL&&(L=v,x=b);let D=0,k=0,P=0,O=0;if(x<=y){let R=x,z=L===0?0:t.charCodeAt(L-1),G=L===0?0:n.get(z),te=!0;for(let ae=L;aev&&XT(z,G,oe,Se,c)&&(D=fe,k=R),R+=Ie,R>y){fe>v?(P=fe,O=R-Ie):(P=ae+1,O=R),R-k>f&&(D=0),te=!1;break}z=oe,G=Se}if(te){_>0&&(g[_]=d[d.length-1],p[_]=u[d.length-1],_++);break}}if(D===0){let R=x,z=t.charCodeAt(L),G=n.get(z),te=!1;for(let ae=L-1;ae>=v;ae--){const fe=ae+1,oe=t.charCodeAt(ae);if(oe===9){te=!0;break}let Se,Ie;if(pm(oe)?(ae--,Se=0,Ie=2):(Se=n.get(oe),Ie=eu(oe)?o:1),R<=y){if(P===0&&(P=fe,O=R),R<=y-f)break;if(XT(oe,Se,z,G,c)){D=fe,k=R;break}}R-=Ie,z=oe,G=Se}if(D!==0){const ae=f-(O-k);if(ae<=i){const fe=t.charCodeAt(P);let oe;sn(fe)?oe=2:oe=G_(fe,O,i,o),ae-oe<0&&(D=0)}}if(te){C--;continue}}if(D===0&&(D=P,k=O),D<=v){const R=t.charCodeAt(v);sn(R)?(D=v+2,k=b+2):(D=v+1,k=b+G_(R,b,i,o))}for(v=D,g[_]=D,b=k,p[_]=k,_++,y=k+f;C<0||C=M)break;M=R,C++}}return _===0?null:(g.length=_,p.length=_,YT=e.breakOffsets,ZT=e.breakOffsetsVisibleColumn,e.breakOffsets=g,e.breakOffsetsVisibleColumn=p,e.wrappedTextIndentLength=h,e)}function dxe(n,e,t,i,s,o,r,a){const l=ca.applyInjectedText(e,t);let c,d;if(t&&t.length>0?(c=t.map(k=>k.options),d=t.map(k=>k.column-1)):(c=null,d=null),s===-1)return c?new q_(d,c,[l.length],[],0):null;const u=l.length;if(u<=1)return c?new q_(d,c,[l.length],[],0):null;const h=a==="keepAll",f=Xq(l,i,s,o,r),g=s-f,p=[],_=[];let v=0,b=0,y=0,w=s,C=l.charCodeAt(0),L=n.get(C),x=G_(C,0,i,o),D=1;sn(C)&&(x+=1,C=l.charCodeAt(1),L=n.get(C),D++);for(let k=D;kw&&((b===0||x-y>g)&&(b=P,y=x-R),p[v]=b,_[v]=y,v++,w=y+g,b=0),C=O,L=M}return v===0&&(!t||t.length===0)?null:(p[v]=u,_[v]=x,new q_(d,c,p,_,f))}function G_(n,e,t,i){return n===9?t-e%t:eu(n)||n<32?i:1}function w6(n,e){return e-n%e}function XT(n,e,t,i,s){return t!==32&&(e===2&&i!==2||e!==1&&i===1||!s&&e===3&&i!==2||!s&&i===3&&e!==1)}function Xq(n,e,t,i,s){let o=0;if(s!==0){const r=Qs(n);if(r!==-1){for(let l=0;lt&&(o=0)}}return o}const q2=jf("domLineBreaksComputer",{createHTML:n=>n});class $P{static create(){return new $P}constructor(){}createLineBreaksComputer(e,t,i,s,o){const r=[],a=[];return{addRequest:(l,c,d)=>{r.push(l),a.push(c)},finalize:()=>uxe(r,e,t,i,s,o,a)}}}function uxe(n,e,t,i,s,o,r){var a;function l(k){const P=r[k];if(P){const O=ca.applyInjectedText(n[k],P),M=P.map(z=>z.options),R=P.map(z=>z.column-1);return new q_(R,M,[O.length],[],0)}else return null}if(i===-1){const k=[];for(let P=0,O=n.length;Pc?(O=0,M=0):R=c-te}const z=P.substr(O),G=hxe(z,M,t,R,g,h);p[k]=O,_[k]=M,v[k]=z,b[k]=G[0],y[k]=G[1]}const w=g.build(),C=(a=q2==null?void 0:q2.createHTML(w))!==null&&a!==void 0?a:w;f.innerHTML=C,f.style.position="absolute",f.style.top="10000",o==="keepAll"?(f.style.wordBreak="keep-all",f.style.overflowWrap="anywhere"):(f.style.wordBreak="inherit",f.style.overflowWrap="break-word"),document.body.appendChild(f);const L=document.createRange(),x=Array.prototype.slice.call(f.children,0),D=[];for(let k=0;koe.options),ae=fe.map(oe=>oe.column-1)):(te=null,ae=null),D[k]=new q_(ae,te,O,G,R)}return document.body.removeChild(f),D}function hxe(n,e,t,i,s,o){if(o!==0){const h=String(o);s.appendString('
');const r=n.length;let a=e,l=0;const c=[],d=[];let u=0");for(let h=0;h"),c[h]=l,d[h]=a;const f=u;u=h+1"),c[n.length]=l,d[n.length]=a,s.appendString("
"),[c,d]}function fxe(n,e,t,i){if(t.length<=1)return null;const s=Array.prototype.slice.call(e.children,0),o=[];try{QT(n,s,i,0,null,t.length-1,null,o)}catch(r){return console.log(r),null}return o.length===0?null:(o.push(t.length),o)}function QT(n,e,t,i,s,o,r,a){if(i===o||(s=s||G2(n,e,t[i],t[i+1]),r=r||G2(n,e,t[o],t[o+1]),Math.abs(s[0].top-r[0].top)<=.1))return;if(i+1===o){a.push(o);return}const l=i+(o-i)/2|0,c=G2(n,e,t[l],t[l+1]);QT(n,e,t,i,s,l,c,a),QT(n,e,t,l,c,o,r,a)}function G2(n,e,t,i){return n.setStart(e[t/16384|0].firstChild,t%16384),n.setEnd(e[i/16384|0].firstChild,i%16384),n.getClientRects()}class gxe extends Y{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new T4),this._pending=new Map,this._finishedInstantiation=[],this._finishedInstantiation[0]=!1,this._finishedInstantiation[1]=!1,this._finishedInstantiation[2]=!1,this._finishedInstantiation[3]=!1}initialize(e,t,i){this._editor=e,this._instantiationService=i;for(const s of t){if(this._pending.has(s.id)){_t(new Error(`Cannot have two contributions with the same id ${s.id}`));continue}this._pending.set(s.id,s)}this._instantiateSome(0),this._register(dd(()=>{this._instantiateSome(1)})),this._register(dd(()=>{this._instantiateSome(2)})),this._register(dd(()=>{this._instantiateSome(3)},5e3))}saveViewState(){const e={};for(const[t,i]of this._instances)typeof i.saveViewState=="function"&&(e[t]=i.saveViewState());return e}restoreViewState(e){for(const[t,i]of this._instances)typeof i.restoreViewState=="function"&&i.restoreViewState(e[t])}get(e){return this._instantiateById(e),this._instances.get(e)||null}onBeforeInteractionEvent(){this._instantiateSome(2)}onAfterModelAttached(){this._register(dd(()=>{this._instantiateSome(1)},50))}_instantiateSome(e){if(this._finishedInstantiation[e])return;this._finishedInstantiation[e]=!0;const t=this._findPendingContributionsByInstantiation(e);for(const i of t)this._instantiateById(i.id)}_findPendingContributionsByInstantiation(e){const t=[];for(const[,i]of this._pending)i.instantiation===e&&t.push(i);return t}_instantiateById(e){const t=this._pending.get(e);if(t){if(this._pending.delete(e),!this._instantiationService||!this._editor)throw new Error("Cannot instantiate contributions before being initialized!");try{const i=this._instantiationService.createInstance(t.ctor,this._editor);this._instances.set(t.id,i),typeof i.restoreViewState=="function"&&t.instantiation!==0&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(i){_t(i)}}}}var pxe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},wl=function(n,e){return function(t,i){e(t,i,n)}},mxe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},sh;let _xe=0,bxe=class{constructor(e,t,i,s,o,r){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=s,this.listenersToRemove=o,this.attachedView=r}dispose(){Bt(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}},Tm=sh=class extends Y{get isSimpleWidget(){return this._configuration.isSimpleWidget}constructor(e,t,i,s,o,r,a,l,c,d,u,h){var f;super(),this.languageConfigurationService=u,this._deliveryQueue=nge(),this._contributions=this._register(new gxe),this._onDidDispose=this._register(new B),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeModelTokens=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelTokens=this._onDidChangeModelTokens.event,this._onDidChangeConfiguration=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onDidChangeModel=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new jn(this._contributions,this._deliveryQueue)),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new C6({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new C6({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new jn(this._contributions,this._deliveryQueue)),this.onWillType=this._onWillType.event,this._onDidType=this._register(new jn(this._contributions,this._deliveryQueue)),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new jn(this._contributions,this._deliveryQueue)),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new jn(this._contributions,this._deliveryQueue)),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new jn(this._contributions,this._deliveryQueue)),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new jn(this._contributions,this._deliveryQueue)),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new jn(this._contributions,this._deliveryQueue)),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new jn(this._contributions,this._deliveryQueue)),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new jn(this._contributions,this._deliveryQueue)),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new jn(this._contributions,this._deliveryQueue)),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onDropIntoEditor=this._register(new jn(this._contributions,this._deliveryQueue)),this.onDropIntoEditor=this._onDropIntoEditor.event,this._onContextMenu=this._register(new jn(this._contributions,this._deliveryQueue)),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new jn(this._contributions,this._deliveryQueue)),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new jn(this._contributions,this._deliveryQueue)),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new jn(this._contributions,this._deliveryQueue)),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new jn(this._contributions,this._deliveryQueue)),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new jn(this._contributions,this._deliveryQueue)),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event,this._actions=new Map,this._bannerDomNode=null,this._dropIntoEditorDecorations=this.createDecorationsCollection(),o.willCreateCodeEditor();const g=Object.assign({},t);this._domElement=e,this._overflowWidgetsDomNode=g.overflowWidgetsDomNode,delete g.overflowWidgetsDomNode,this._id=++_xe,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this._telemetryData=i.telemetryData,this._configuration=this._register(this._createConfiguration(i.isSimpleWidget||!1,g,d)),this._register(this._configuration.onDidChange(v=>{this._onDidChangeConfiguration.fire(v);const b=this._configuration.options;if(v.hasChanged(143)){const y=b.get(143);this._onDidLayoutChange.fire(y)}})),this._contextKeyService=this._register(a.createScoped(this._domElement)),this._notificationService=c,this._codeEditorService=o,this._commandService=r,this._themeService=l,this._register(new vxe(this,this._contextKeyService)),this._register(new yxe(this,this._contextKeyService,h)),this._instantiationService=s.createChild(new DD([tt,this._contextKeyService])),this._modelData=null,this._focusTracker=new wxe(e),this._register(this._focusTracker.onChange(()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())})),this._contentWidgets={},this._overlayWidgets={},this._glyphMarginWidgets={};let p;Array.isArray(i.contributions)?p=i.contributions:p=gp.getEditorContributions(),this._contributions.initialize(this,p,this._instantiationService);for(const v of gp.getEditorActions()){if(this._actions.has(v.id)){_t(new Error(`Cannot have two actions with the same id ${v.id}`));continue}const b=new Aq(v.id,v.label,v.alias,(f=v.precondition)!==null&&f!==void 0?f:void 0,()=>this._instantiationService.invokeFunction(y=>Promise.resolve(v.runEditorCommand(y,this,null))),this._contextKeyService);this._actions.set(b.id,b)}const _=()=>!this._configuration.options.get(90)&&this._configuration.options.get(36).enabled;this._register(new Cme(this._domElement,{onDragEnter:()=>{},onDragOver:v=>{if(!_())return;const b=this.getTargetAtClientPoint(v.clientX,v.clientY);b!=null&&b.position&&this.showDropIndicatorAt(b.position)},onDrop:v=>mxe(this,void 0,void 0,function*(){if(!_()||(this.removeDropIndicator(),!v.dataTransfer))return;const b=this.getTargetAtClientPoint(v.clientX,v.clientY);b!=null&&b.position&&this._onDropIntoEditor.fire({position:b.position,event:v})}),onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this)}writeScreenReaderContent(e){var t;(t=this._modelData)===null||t===void 0||t.view.writeScreenReaderContent(e)}_createConfiguration(e,t,i){return new DT(e,t,this._domElement,i)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return fD.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._focusTracker.dispose(),this._actions.clear(),this._contentWidgets={},this._overlayWidgets={},this._removeDecorationTypes(),this._postDetachModelCleanup(this._detachModel()),this._onDidDispose.fire(),super.dispose()}invokeWithinContext(e){return this._instantiationService.invokeFunction(e)}updateOptions(e){this._configuration.updateOptions(e||{})}getOptions(){return this._configuration.options}getOption(e){return this._configuration.options.get(e)}getRawOptions(){return this._configuration.getRawOptions()}getOverflowWidgetsDomNode(){return this._overflowWidgetsDomNode}getConfiguredWordAtPosition(e){return this._modelData?Ci.getWordAtPosition(this._modelData.model,this._configuration.options.get(129),e):null}getValue(e=null){if(!this._modelData)return"";const t=!!(e&&e.preserveBOM);let i=0;return e&&e.lineEnding&&e.lineEnding===` +`)){u=!1;break}}if(u){const h=new N(c,1,c,d);t.push(new m2(null,h,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return this._initialUndoRedoSnapshot===null&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i,s)}_applyUndo(e,t,i,s){const o=e.map(r=>{const a=this.getPositionAt(r.newPosition),l=this.getPositionAt(r.newEnd);return{range:new N(a.lineNumber,a.column,l.lineNumber,l.column),text:r.oldText}});this._applyUndoRedoEdits(o,t,!0,!1,i,s)}_applyRedo(e,t,i,s){const o=e.map(r=>{const a=this.getPositionAt(r.oldPosition),l=this.getPositionAt(r.oldEnd);return{range:new N(a.lineNumber,a.column,l.lineNumber,l.column),text:r.newText}});this._applyUndoRedoEdits(o,t,!1,!0,i,s)}_applyUndoRedoEdits(e,t,i,s,o,r){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=s,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(o)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(r),this._onDidChangeDecorations.endDeferredEmit()}}applyEdits(e,t=!1){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit();const i=this._validateEditOperations(e);return this._doApplyEdits(i,t)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_doApplyEdits(e,t){const i=this._buffer.getLineCount(),s=this._buffer.applyEdits(e,this._options.trimAutoWhitespace,t),o=this._buffer.getLineCount(),r=s.changes;if(this._trimAutoWhitespaceLines=s.trimAutoWhitespaceLineNumbers,r.length!==0){for(let c=0,d=r.length;c=0;k--){const P=f+k,O=y+k;D.takeFromEndWhile(R=>R.lineNumber>O);const M=D.takeFromEndWhile(R=>R.lineNumber===O);a.push(new e6(P,this.getLineContent(O),M))}if(vae.lineNumberae.lineNumber===te)}a.push(new _Se(P+1,f+_,z,R))}l+=b}this._emitContentChangedEvent(new kp(a,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:r,eol:this._buffer.getEOL(),isEolChange:!1,versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return s.reverseEdits===null?void 0:s.reverseEdits}undo(){return this._undoRedoService.undo(this.uri)}canUndo(){return this._undoRedoService.canUndo(this.uri)}redo(){return this._undoRedoService.redo(this.uri)}canRedo(){return this._undoRedoService.canRedo(this.uri)}handleBeforeFireDecorationsChangedEvent(e){if(e===null||e.size===0)return;const i=Array.from(e).map(s=>new e6(s,this.getLineContent(s),this._getInjectedTextInLine(s)));this._onDidChangeInjectedText.fire(new $q(i))}changeDecorations(e,t=0){this._assertNotDisposed();try{return this._onDidChangeDecorations.beginDeferredEmit(),this._changeDecorations(t,e)}finally{this._onDidChangeDecorations.endDeferredEmit()}}_changeDecorations(e,t){const i={addDecoration:(o,r)=>this._deltaDecorationsImpl(e,[],[{range:o,options:r}])[0],changeDecoration:(o,r)=>{this._changeDecorationImpl(o,r)},changeDecorationOptions:(o,r)=>{this._changeDecorationOptionsImpl(o,s6(r))},removeDecoration:o=>{this._deltaDecorationsImpl(e,[o],[])},deltaDecorations:(o,r)=>o.length===0&&r.length===0?[]:this._deltaDecorationsImpl(e,o,r)};let s=null;try{s=t(i)}catch(o){mt(o)}return i.addDecoration=W0,i.changeDecoration=W0,i.changeDecorationOptions=W0,i.removeDecoration=W0,i.deltaDecorations=W0,s}deltaDecorations(e,t,i=0){if(this._assertNotDisposed(),e||(e=[]),e.length===0&&t.length===0)return[];try{return this._deltaDecorationCallCnt++,this._deltaDecorationCallCnt>1&&(console.warn("Invoking deltaDecorations recursively could lead to leaking decorations."),mt(new Error("Invoking deltaDecorations recursively could lead to leaking decorations."))),this._onDidChangeDecorations.beginDeferredEmit(),this._deltaDecorationsImpl(i,e,t)}finally{this._onDidChangeDecorations.endDeferredEmit(),this._deltaDecorationCallCnt--}}_getTrackedRange(e){return this.getDecorationRange(e)}_setTrackedRange(e,t,i){const s=e?this._decorations[e]:null;if(!s)return t?this._deltaDecorationsImpl(0,[],[{range:t,options:n6[i]}],!0)[0]:null;if(!t)return this._decorationsTree.delete(s),delete this._decorations[s.id],null;const o=this._validateRangeRelaxedNoAllocations(t),r=this._buffer.getOffsetAt(o.startLineNumber,o.startColumn),a=this._buffer.getOffsetAt(o.endLineNumber,o.endColumn);return this._decorationsTree.delete(s),s.reset(this.getVersionId(),r,a,o),s.setOptions(n6[i]),this._decorationsTree.insert(s),s.id}removeAllDecorationsWithOwnerId(e){if(this._isDisposed)return;const t=this._decorationsTree.collectNodesFromOwner(e);for(let i=0,s=t.length;ithis.getLineCount()?[]:this.getLinesDecorations(e,e,t,i)}getLinesDecorations(e,t,i=0,s=!1,o=!1){const r=this.getLineCount(),a=Math.min(r,Math.max(1,e)),l=Math.min(r,Math.max(1,t)),c=this.getLineMaxColumn(l),d=new N(a,1,l,c),u=this._getDecorationsInRange(d,i,s,o);return JA(u,this._decorationProvider.getDecorationsInRange(d,i,s)),u}getDecorationsInRange(e,t=0,i=!1,s=!1,o=!1){const r=this.validateRange(e),a=this._getDecorationsInRange(r,t,i,o);return JA(a,this._decorationProvider.getDecorationsInRange(r,t,i,s)),a}getOverviewRulerDecorations(e=0,t=!1){return this._decorationsTree.getAll(this,e,t,!0,!1)}getInjectedTextDecorations(e=0){return this._decorationsTree.getAllInjectedText(this,e)}_getInjectedTextInLine(e){const t=this._buffer.getOffsetAt(e,1),i=t+this._buffer.getLineLength(e),s=this._decorationsTree.getInjectedTextInInterval(this,t,i,0);return aa.fromDecorations(s).filter(o=>o.lineNumber===e)}getAllDecorations(e=0,t=!1){let i=this._decorationsTree.getAll(this,e,t,!1,!1);return i=i.concat(this._decorationProvider.getAllDecorations(e,t)),i}getAllMarginDecorations(e=0){return this._decorationsTree.getAll(this,e,!1,!1,!0)}_getDecorationsInRange(e,t,i,s){const o=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),r=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,o,r,t,i,s)}getRangeAt(e,t){return this._buffer.getRangeAt(e,t-e)}_changeDecorationImpl(e,t){const i=this._decorations[e];if(!i)return;if(i.options.after){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.endLineNumber)}if(i.options.before){const a=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(a.startLineNumber)}const s=this._validateRangeRelaxedNoAllocations(t),o=this._buffer.getOffsetAt(s.startLineNumber,s.startColumn),r=this._buffer.getOffsetAt(s.endLineNumber,s.endColumn);this._decorationsTree.delete(i),i.reset(this.getVersionId(),o,r,s),this._decorationsTree.insert(i),this._onDidChangeDecorations.checkAffectedAndFire(i.options),i.options.after&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.endLineNumber),i.options.before&&this._onDidChangeDecorations.recordLineAffectedByInjectedText(s.startLineNumber)}_changeDecorationOptionsImpl(e,t){const i=this._decorations[e];if(!i)return;const s=!!(i.options.overviewRuler&&i.options.overviewRuler.color),o=!!(t.overviewRuler&&t.overviewRuler.color);if(this._onDidChangeDecorations.checkAffectedAndFire(i.options),this._onDidChangeDecorations.checkAffectedAndFire(t),i.options.after||t.after){const r=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(r.endLineNumber)}if(i.options.before||t.before){const r=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(r.startLineNumber)}s!==o?(this._decorationsTree.delete(i),i.setOptions(t),this._decorationsTree.insert(i)):i.setOptions(t)}_deltaDecorationsImpl(e,t,i,s=!1){const o=this.getVersionId(),r=t.length;let a=0;const l=i.length;let c=0;this._onDidChangeDecorations.beginDeferredEmit();try{const d=new Array(l);for(;athis._setLanguage(e.languageId,t)),this._setLanguage(e.languageId,t))}_setLanguage(e,t){this.tokenization.setLanguageId(e,t),this._languageService.requestRichLanguageFeatures(e)}getLanguageIdAtPosition(e,t){return this.tokenization.getLanguageIdAtPosition(e,t)}getWordAtPosition(e){return this._tokenizationTextModelPart.getWordAtPosition(e)}getWordUntilPosition(e){return this._tokenizationTextModelPart.getWordUntilPosition(e)}normalizePosition(e,t){return e}getLineIndentColumn(e){return LSe(this.getLineContent(e))+1}};rl._MODEL_SYNC_LIMIT=50*1024*1024;rl.LARGE_FILE_SIZE_THRESHOLD=20*1024*1024;rl.LARGE_FILE_LINE_COUNT_THRESHOLD=300*1e3;rl.LARGE_FILE_HEAP_OPERATION_THRESHOLD=256*1024*1024;rl.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:En.tabSize,indentSize:En.indentSize,insertSpaces:En.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:En.trimAutoWhitespace,largeFileOptimizations:En.largeFileOptimizations,bracketPairColorizationOptions:En.bracketPairColorizationOptions};rl=sh=vSe([O2(4,bD),O2(5,Ni),O2(6,so)],rl);function LSe(n){let e=0;for(const t of n)if(t===" "||t===" ")e++;else break;return e}function F2(n){return!!(n.options.overviewRuler&&n.options.overviewRuler.color)}function B2(n){return!!n.options.after||!!n.options.before}class i6{constructor(){this._decorationsTree0=new R2,this._decorationsTree1=new R2,this._injectedTextDecorationsTree=new R2}ensureAllNodesHaveRanges(e){this.getAll(e,0,!1,!1,!1)}_ensureNodesHaveRanges(e,t){for(const i of t)i.range===null&&(i.range=e.getRangeAt(i.cachedAbsoluteStart,i.cachedAbsoluteEnd));return t}getAllInInterval(e,t,i,s,o,r){const a=e.getVersionId(),l=this._intervalSearch(t,i,s,o,a,r);return this._ensureNodesHaveRanges(e,l)}_intervalSearch(e,t,i,s,o,r){const a=this._decorationsTree0.intervalSearch(e,t,i,s,o,r),l=this._decorationsTree1.intervalSearch(e,t,i,s,o,r),c=this._injectedTextDecorationsTree.intervalSearch(e,t,i,s,o,r);return a.concat(l).concat(c)}getInjectedTextInInterval(e,t,i,s){const o=e.getVersionId(),r=this._injectedTextDecorationsTree.intervalSearch(t,i,s,!1,o,!1);return this._ensureNodesHaveRanges(e,r).filter(a=>a.options.showIfCollapsed||!a.range.isEmpty())}getAllInjectedText(e,t){const i=e.getVersionId(),s=this._injectedTextDecorationsTree.search(t,!1,i,!1);return this._ensureNodesHaveRanges(e,s).filter(o=>o.options.showIfCollapsed||!o.range.isEmpty())}getAll(e,t,i,s,o){const r=e.getVersionId(),a=this._search(t,i,s,r,o);return this._ensureNodesHaveRanges(e,a)}_search(e,t,i,s,o){if(i)return this._decorationsTree1.search(e,t,s,o);{const r=this._decorationsTree0.search(e,t,s,o),a=this._decorationsTree1.search(e,t,s,o),l=this._injectedTextDecorationsTree.search(e,t,s,o);return r.concat(a).concat(l)}}collectNodesFromOwner(e){const t=this._decorationsTree0.collectNodesFromOwner(e),i=this._decorationsTree1.collectNodesFromOwner(e),s=this._injectedTextDecorationsTree.collectNodesFromOwner(e);return t.concat(i).concat(s)}collectNodesPostOrder(){const e=this._decorationsTree0.collectNodesPostOrder(),t=this._decorationsTree1.collectNodesPostOrder(),i=this._injectedTextDecorationsTree.collectNodesPostOrder();return e.concat(t).concat(i)}insert(e){B2(e)?this._injectedTextDecorationsTree.insert(e):F2(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){B2(e)?this._injectedTextDecorationsTree.delete(e):F2(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}getNodeRange(e,t){const i=e.getVersionId();return t.cachedVersionId!==i&&this._resolveNode(t,i),t.range===null&&(t.range=e.getRangeAt(t.cachedAbsoluteStart,t.cachedAbsoluteEnd)),t.range}_resolveNode(e,t){B2(e)?this._injectedTextDecorationsTree.resolveNode(e,t):F2(e)?this._decorationsTree1.resolveNode(e,t):this._decorationsTree0.resolveNode(e,t)}acceptReplace(e,t,i,s){this._decorationsTree0.acceptReplace(e,t,i,s),this._decorationsTree1.acceptReplace(e,t,i,s),this._injectedTextDecorationsTree.acceptReplace(e,t,i,s)}}function wl(n){return n.replace(/[^a-z0-9\-_]/gi," ")}class jq{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class DSe extends jq{constructor(e){super(e),this._resolvedColor=null,this.position=typeof e.position=="number"?e.position:qo.Center}getColor(e){return this._resolvedColor||(e.type!=="light"&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=null}_resolveColor(e,t){if(typeof e=="string")return e;const i=e?t.getColor(e.id):null;return i?i.toString():""}}class kSe{constructor(e){var t;this.position=(t=e==null?void 0:e.position)!==null&&t!==void 0?t:vp.Left}}class ESe extends jq{constructor(e){super(e),this.position=e.position}getColor(e){return this._resolvedColor||(e.type!=="light"&&this.darkColor?this._resolvedColor=this._resolveColor(this.darkColor,e):this._resolvedColor=this._resolveColor(this.color,e)),this._resolvedColor}invalidateCachedColor(){this._resolvedColor=void 0}_resolveColor(e,t){return typeof e=="string"?H.fromHex(e):t.getColor(e.id)}}class Rm{static from(e){return e instanceof Rm?e:new Rm(e)}constructor(e){this.content=e.content||"",this.inlineClassName=e.inlineClassName||null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.attachedData=e.attachedData||null,this.cursorStops=e.cursorStops||null}}class Je{static register(e){return new Je(e)}static createDynamic(e){return new Je(e)}constructor(e){var t,i,s,o,r,a;this.description=e.description,this.blockClassName=e.blockClassName?wl(e.blockClassName):null,this.blockDoesNotCollapse=(t=e.blockDoesNotCollapse)!==null&&t!==void 0?t:null,this.blockIsAfterEnd=(i=e.blockIsAfterEnd)!==null&&i!==void 0?i:null,this.blockPadding=(s=e.blockPadding)!==null&&s!==void 0?s:null,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?wl(e.className):null,this.shouldFillLineOnLineBreak=(o=e.shouldFillLineOnLineBreak)!==null&&o!==void 0?o:null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new DSe(e.overviewRuler):null,this.minimap=e.minimap?new ESe(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new kSe(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?wl(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?wl(e.linesDecorationsClassName):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?wl(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?wl(e.marginClassName):null,this.inlineClassName=e.inlineClassName?wl(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?wl(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?wl(e.afterContentClassName):null,this.after=e.after?Rm.from(e.after):null,this.before=e.before?Rm.from(e.before):null,this.hideInCommentTokens=(r=e.hideInCommentTokens)!==null&&r!==void 0?r:!1,this.hideInStringTokens=(a=e.hideInStringTokens)!==null&&a!==void 0?a:!1}}Je.EMPTY=Je.register({description:"empty"});const n6=[Je.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),Je.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),Je.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),Je.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function s6(n){return n instanceof Je?n:Je.createDynamic(n)}class ASe extends Y{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new B),this.event=this._actual.event,this._affectedInjectedTextLines=null,this._deferredCnt=0,this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(){var e;this._deferredCnt--,this._deferredCnt===0&&(this._shouldFireDeferred&&this.doFire(),(e=this._affectedInjectedTextLines)===null||e===void 0||e.clear(),this._affectedInjectedTextLines=null)}recordLineAffectedByInjectedText(e){this._affectedInjectedTextLines||(this._affectedInjectedTextLines=new Set),this._affectedInjectedTextLines.add(e)}checkAffectedAndFire(e){this._affectsMinimap||(this._affectsMinimap=!!(e.minimap&&e.minimap.position)),this._affectsOverviewRuler||(this._affectsOverviewRuler=!!(e.overviewRuler&&e.overviewRuler.color)),this._affectsGlyphMargin||(this._affectsGlyphMargin=!!e.glyphMarginClassName),this.tryFire()}fire(){this._affectsMinimap=!0,this._affectsOverviewRuler=!0,this._affectsGlyphMargin=!0,this.tryFire()}tryFire(){this._deferredCnt===0?this.doFire():this._shouldFireDeferred=!0}doFire(){this.handleBeforeFire(this._affectedInjectedTextLines);const e={affectsMinimap:this._affectsMinimap,affectsOverviewRuler:this._affectsOverviewRuler,affectsGlyphMargin:this._affectsGlyphMargin};this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._actual.fire(e)}}class ISe extends Y{constructor(){super(),this._fastEmitter=this._register(new B),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new B),this.slowEvent=this._slowEmitter.event,this._deferredCnt=0,this._deferredEvent=null}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(e=null){if(this._deferredCnt--,this._deferredCnt===0&&this._deferredEvent!==null){this._deferredEvent.rawContentChangedEvent.resultingSelection=e;const t=this._deferredEvent;this._deferredEvent=null,this._fastEmitter.fire(t),this._slowEmitter.fire(t)}}fire(e){if(this._deferredCnt>0){this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e;return}this._fastEmitter.fire(e),this._slowEmitter.fire(e)}}class TSe{constructor(){this._onDidChangeVisibleRanges=new B,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set}attachView(){const e=new NSe(t=>{this._onDidChangeVisibleRanges.fire({view:e,state:t})});return this._views.add(e),e}detachView(e){this._views.delete(e),this._onDidChangeVisibleRanges.fire({view:e,state:void 0})}}class NSe{constructor(e){this.handleStateChange=e}setVisibleLines(e,t){const i=e.map(s=>new Xe(s.startLineNumber,s.endLineNumber+1));this.handleStateChange({visibleLineRanges:i,stabilized:t})}}class XS{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new hn(new N(1,1,1,1),0,0,new V(1,1),0),new hn(new N(1,1,1,1),0,0,new V(1,1),0))}dispose(e){this._removeTrackedRange(e)}startTrackingSelection(e){this._trackSelection=!0,this._updateTrackedRange(e)}stopTrackingSelection(e){this._trackSelection=!1,this._removeTrackedRange(e)}_updateTrackedRange(e){this._trackSelection&&(this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,this.modelState.selection,0))}_removeTrackedRange(e){this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,null,0)}asCursorState(){return new st(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?lt.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):lt.fromRange(t,this.modelState.selection.getDirection())}ensureValidState(e){this._setState(e,this.modelState,this.viewState)}setState(e,t,i){this._setState(e,t,i)}static _validatePositionWithCache(e,t,i,s){return t.equals(i)?s:e.normalizePosition(t,2)}static _validateViewState(e,t){const i=t.position,s=t.selectionStart.getStartPosition(),o=t.selectionStart.getEndPosition(),r=e.normalizePosition(i,2),a=this._validatePositionWithCache(e,s,i,r),l=this._validatePositionWithCache(e,o,s,a);return i.equals(r)&&s.equals(a)&&o.equals(l)?t:new hn(N.fromPositions(a,l),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+s.column-a.column,r,t.leftoverVisibleColumns+i.column-r.column)}_setState(e,t,i){if(i&&(i=XS._validateViewState(e.viewModel,i)),t){const s=e.model.validateRange(t.selectionStart),o=t.selectionStart.equalsRange(s)?t.selectionStartLeftoverVisibleColumns:0,r=e.model.validatePosition(t.position),a=t.position.equals(r)?t.leftoverVisibleColumns:0;t=new hn(s,t.selectionStartKind,o,r,a)}else{if(!i)return;const s=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(i.selectionStart)),o=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(i.position));t=new hn(s,i.selectionStartKind,i.selectionStartLeftoverVisibleColumns,o,i.leftoverVisibleColumns)}if(i){const s=e.coordinatesConverter.validateViewRange(i.selectionStart,t.selectionStart),o=e.coordinatesConverter.validateViewPosition(i.position,t.position);i=new hn(s,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,o,t.leftoverVisibleColumns)}else{const s=e.coordinatesConverter.convertModelPositionToViewPosition(new V(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),o=e.coordinatesConverter.convertModelPositionToViewPosition(new V(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),r=new N(s.lineNumber,s.column,o.lineNumber,o.column),a=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new hn(r,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,a,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class o6{constructor(e){this.context=e,this.cursors=[new XS(e)],this.lastAddedCursorIndex=0}dispose(){for(const e of this.cursors)e.dispose(this.context)}startTrackingSelections(){for(const e of this.cursors)e.startTrackingSelection(this.context)}stopTrackingSelections(){for(const e of this.cursors)e.stopTrackingSelection(this.context)}updateContext(e){this.context=e}ensureValidState(){for(const e of this.cursors)e.ensureValidState(this.context)}readSelectionFromMarkers(){return this.cursors.map(e=>e.readSelectionFromMarkers(this.context))}getAll(){return this.cursors.map(e=>e.asCursorState())}getViewPositions(){return this.cursors.map(e=>e.viewState.position)}getTopMostViewPosition(){return x_e(this.cursors,pr(e=>e.viewState.position,V.compare)).viewState.position}getBottomMostViewPosition(){return S_e(this.cursors,pr(e=>e.viewState.position,V.compare)).viewState.position}getSelections(){return this.cursors.map(e=>e.modelState.selection)}getViewSelections(){return this.cursors.map(e=>e.viewState.selection)}setSelections(e){this.setStates(st.fromModelSelections(e))}getPrimaryCursor(){return this.cursors[0].asCursorState()}setStates(e){e!==null&&(this.cursors[0].setState(this.context,e[0].modelState,e[0].viewState),this._setSecondaryStates(e.slice(1)))}_setSecondaryStates(e){const t=this.cursors.length-1,i=e.length;if(ti){const s=t-i;for(let o=0;o=e+1&&this.lastAddedCursorIndex--,this.cursors[e+1].dispose(this.context),this.cursors.splice(e+1,1)}normalize(){if(this.cursors.length===1)return;const e=this.cursors.slice(0),t=[];for(let i=0,s=e.length;ii.selection,N.compareRangesUsingStarts));for(let i=0;iu&&p.index--;e.splice(u,1),t.splice(d,1),this._removeSecondaryCursor(u-1),i--}}}}class r6{constructor(e,t,i,s){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=s}}class RSe{constructor(){this.type=0}}class MSe{constructor(){this.type=1}}class PSe{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class OSe{constructor(e,t,i){this.selections=e,this.modelSelections=t,this.reason=i,this.type=3}}class Cg{constructor(e){this.type=4,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler,this.affectsGlyphMargin=e.affectsGlyphMargin):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0,this.affectsGlyphMargin=!0)}}class ow{constructor(){this.type=5}}class FSe{constructor(e){this.type=6,this.isFocused=e}}class BSe{constructor(){this.type=7}}class rw{constructor(){this.type=8}}class qq{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=9}}class UT{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class jT{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class vC{constructor(e,t,i,s,o,r,a){this.source=e,this.minimalReveal=t,this.range=i,this.selections=s,this.verticalType=o,this.revealHorizontal=r,this.scrollType=a,this.type=12}}class WSe{constructor(e){this.type=13,this.scrollWidth=e.scrollWidth,this.scrollLeft=e.scrollLeft,this.scrollHeight=e.scrollHeight,this.scrollTop=e.scrollTop,this.scrollWidthChanged=e.scrollWidthChanged,this.scrollLeftChanged=e.scrollLeftChanged,this.scrollHeightChanged=e.scrollHeightChanged,this.scrollTopChanged=e.scrollTopChanged}}class VSe{constructor(e){this.theme=e,this.type=14}}class zSe{constructor(e){this.type=15,this.ranges=e}}class HSe{constructor(){this.type=16}}let $Se=class{constructor(){this.type=17}};class USe extends Y{constructor(){super(),this._onEvent=this._register(new B),this.onEvent=this._onEvent.event,this._eventHandlers=[],this._viewEventQueue=null,this._isConsumingViewEventQueue=!1,this._collector=null,this._collectorCnt=0,this._outgoingEvents=[]}emitOutgoingEvent(e){this._addOutgoingEvent(e),this._emitOutgoingEvents()}_addOutgoingEvent(e){for(let t=0,i=this._outgoingEvents.length;t0;){if(this._collector||this._isConsumingViewEventQueue)return;const e=this._outgoingEvents.shift();e.isNoOp()||this._onEvent.fire(e)}}addViewEventHandler(e){for(let t=0,i=this._eventHandlers.length;t0&&this._emitMany(t)}this._emitOutgoingEvents()}emitSingleViewEvent(e){try{this.beginEmitViewEvents().emitViewEvent(e)}finally{this.endEmitViewEvents()}}_emitMany(e){this._viewEventQueue?this._viewEventQueue=this._viewEventQueue.concat(e):this._viewEventQueue=e,this._isConsumingViewEventQueue||this._consumeViewEventQueue()}_consumeViewEventQueue(){try{this._isConsumingViewEventQueue=!0,this._doConsumeQueue()}finally{this._isConsumingViewEventQueue=!1}}_doConsumeQueue(){for(;this._viewEventQueue;){const e=this._viewEventQueue;this._viewEventQueue=null;const t=this._eventHandlers.slice(0);for(const i of t)i.handleEvents(e)}}}class jSe{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class O3{constructor(e,t,i,s){this.kind=0,this._oldContentWidth=e,this._oldContentHeight=t,this.contentWidth=i,this.contentHeight=s,this.contentWidthChanged=this._oldContentWidth!==this.contentWidth,this.contentHeightChanged=this._oldContentHeight!==this.contentHeight}isNoOp(){return!this.contentWidthChanged&&!this.contentHeightChanged}attemptToMerge(e){return e.kind!==this.kind?null:new O3(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class F3{constructor(e,t){this.kind=1,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new F3(this.oldHasFocus,e.hasFocus)}}class B3{constructor(e,t,i,s,o,r,a,l){this.kind=2,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=s,this.scrollWidth=o,this.scrollLeft=r,this.scrollHeight=a,this.scrollTop=l,this.scrollWidthChanged=this._oldScrollWidth!==this.scrollWidth,this.scrollLeftChanged=this._oldScrollLeft!==this.scrollLeft,this.scrollHeightChanged=this._oldScrollHeight!==this.scrollHeight,this.scrollTopChanged=this._oldScrollTop!==this.scrollTop}isNoOp(){return!this.scrollWidthChanged&&!this.scrollLeftChanged&&!this.scrollHeightChanged&&!this.scrollTopChanged}attemptToMerge(e){return e.kind!==this.kind?null:new B3(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class qSe{constructor(){this.kind=3}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class GSe{constructor(){this.kind=4}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class QS{constructor(e,t,i,s,o,r,a){this.kind=6,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=s,this.source=o,this.reason=r,this.reachedMaxCursorCount=a}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const i=e.length,s=t.length;if(i!==s)return!1;for(let o=0;o0){const e=this._cursors.getSelections();for(let t=0;tr&&(s=s.slice(0,r),o=!0);const a=Y_.from(this._model,this);return this._cursors.setStates(s),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,a,o)}setCursorColumnSelectData(e){this._columnSelectData=e}revealPrimary(e,t,i,s,o,r){const a=this._cursors.getViewPositions();let l=null,c=null;a.length>1?c=this._cursors.getViewSelections():l=N.fromPositions(a[0],a[0]),e.emitViewEvent(new vC(t,i,l,c,s,o,r))}saveState(){const e=[],t=this._cursors.getSelections();for(let i=0,s=t.length;i0){const o=st.fromModelSelections(i.resultingSelection);this.setStates(e,"modelChange",i.isUndoing?5:i.isRedoing?6:2,o)&&this.revealPrimary(e,"modelChange",!1,0,!0,0)}else{const o=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,st.fromModelSelections(o))}}}getSelection(){return this._cursors.getPrimaryCursor().modelState.selection}getTopMostViewPosition(){return this._cursors.getTopMostViewPosition()}getBottomMostViewPosition(){return this._cursors.getBottomMostViewPosition()}getCursorColumnSelectData(){if(this._columnSelectData)return this._columnSelectData;const e=this._cursors.getPrimaryCursor(),t=e.viewState.selectionStart.getStartPosition(),i=e.viewState.position;return{isReal:!1,fromViewLineNumber:t.lineNumber,fromViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,t),toViewLineNumber:i.lineNumber,toViewVisualColumn:this.context.cursorConfig.visibleColumnFromColumn(this._viewModel,i)}}getSelections(){return this._cursors.getSelections()}setSelections(e,t,i,s){this.setStates(e,t,s,st.fromModelSelections(i))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){const i=[],s=[];for(let a=0,l=e.length;a0&&this._pushAutoClosedAction(i,s),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}_interpretCommandResult(e){(!e||e.length===0)&&(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()}_emitStateChangedIfNecessary(e,t,i,s,o){const r=Y_.from(this._model,this);if(r.equals(s))return!1;const a=this._cursors.getSelections(),l=this._cursors.getViewSelections();if(e.emitViewEvent(new OSe(l,a,i)),!s||s.cursorState.length!==r.cursorState.length||r.cursorState.some((c,d)=>!c.modelState.equals(s.cursorState[d].modelState))){const c=s?s.cursorState.map(u=>u.modelState.selection):null,d=s?s.modelVersionId:0;e.emitOutgoingEvent(new QS(c,a,d,r.modelVersionId,t||"keyboard",i,o))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const t=[];for(let i=0,s=e.length;i=0)return null;const r=o.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!r)return null;const a=r[1],l=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(a);if(!l||l.length!==1)return null;const c=l[0].open,d=o.text.length-r[2].length-1,u=o.text.lastIndexOf(c,d-1);if(u===-1)return null;t.push([u,d])}return t}executeEdits(e,t,i,s){let o=null;t==="snippet"&&(o=this._findAutoClosingPairs(i)),o&&(i[0]._isTracked=!0);const r=[],a=[],l=this._model.pushEditOperations(this.getSelections(),i,c=>{if(o)for(let u=0,h=o.length;u0&&this._pushAutoClosedAction(r,a)}_executeEdit(e,t,i,s=0){if(this.context.cursorConfig.readOnly)return;const o=Y_.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(r){mt(r)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,s,o,!1)&&this.revealPrimary(t,i,!1,0,!0,0)}getAutoClosedCharacters(){return a6.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new Z_(this._model,this.getSelections())}endComposition(e,t){const i=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit(()=>{t==="keyboard"&&this._executeEditOperation(gi.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,i,this.getSelections(),this.getAutoClosedCharacters()))},e,t)}type(e,t,i){this._executeEdit(()=>{if(i==="keyboard"){const s=t.length;let o=0;for(;o{const c=l.getPosition();return new lt(c.lineNumber,c.column+o,c.lineNumber,c.column+o)});this.setSelections(e,r,a,0)}return}this._executeEdit(()=>{this._executeEditOperation(gi.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,s,o))},e,r)}paste(e,t,i,s,o){this._executeEdit(()=>{this._executeEditOperation(gi.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,s||[]))},e,o,4)}cut(e,t){this._executeEdit(()=>{this._executeEditOperation(xf.cut(this.context.cursorConfig,this._model,this.getSelections()))},e,t)}executeCommand(e,t,i){this._executeEdit(()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new _s(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}executeCommands(e,t,i){this._executeEdit(()=>{this._executeEditOperation(new _s(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))},e,i)}}class Y_{static from(e,t){return new Y_(e.getVersionId(),t.getCursorStates())}constructor(e,t){this.modelVersionId=e,this.cursorState=t}equals(e){if(!e||this.modelVersionId!==e.modelVersionId||this.cursorState.length!==e.cursorState.length)return!1;for(let t=0,i=this.cursorState.length;t=t.length||!t[i].strictContainsRange(e[i]))return!1;return!0}}class ixe{static executeCommands(e,t,i){const s={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},o=this._innerExecuteCommands(s,i);for(let r=0,a=s.trackedRanges.length;r0&&(r[0]._isTracked=!0);let a=e.model.pushEditOperations(e.selectionsBefore,r,c=>{const d=[];for(let f=0;ff.identifier.minor-g.identifier.minor,h=[];for(let f=0;f0?(d[f].sort(u),h[f]=t[f].computeCursorState(e.model,{getInverseEditOperations:()=>d[f],getTrackedSelection:g=>{const p=parseInt(g,10),_=e.model._getTrackedRange(e.trackedRanges[p]);return e.trackedRangesDirection[p]===0?new lt(_.startLineNumber,_.startColumn,_.endLineNumber,_.endColumn):new lt(_.endLineNumber,_.endColumn,_.startLineNumber,_.startColumn)}})):h[f]=e.selectionsBefore[f];return h});a||(a=e.selectionsBefore);const l=[];for(const c in o)o.hasOwnProperty(c)&&l.push(parseInt(c,10));l.sort((c,d)=>d-c);for(const c of l)a.splice(c,1);return a}static _arrayIsEmpty(e){for(let t=0,i=e.length;t{N.isEmpty(u)&&h===""||s.push({identifier:{major:t,minor:o++},range:u,text:h,forceMoveMarkers:f,isAutoWhitespaceEdit:i.insertsAutoWhitespace})};let a=!1;const d={addEditOperation:r,addTrackedEditOperation:(u,h,f)=>{a=!0,r(u,h,f)},trackSelection:(u,h)=>{const f=lt.liftSelection(u);let g;if(f.isEmpty())if(typeof h=="boolean")h?g=2:g=3;else{const v=e.model.getLineMaxColumn(f.startLineNumber);f.startColumn===v?g=2:g=3}else g=1;const p=e.trackedRanges.length,_=e.model._setTrackedRange(null,f,g);return e.trackedRanges[p]=_,e.trackedRangesDirection[p]=f.getDirection(),p.toString()}};try{i.getEditOperations(e.model,d)}catch(u){return mt(u),{operations:[],hadTrackedEditOperation:!1}}return{operations:s,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){e=e.slice(0),e.sort((i,s)=>-N.compareRangesUsingEnds(i.range,s.range));const t={};for(let i=1;io.identifier.major?r=s.identifier.major:r=o.identifier.major,t[r.toString()]=!0;for(let a=0;a0&&i--}}return t}}class nxe{constructor(e,t,i){this.text=e,this.startSelection=t,this.endSelection=i}}class Z_{static _capture(e,t){const i=[];for(const s of t){if(s.startLineNumber!==s.endLineNumber)return null;i.push(new nxe(e.getLineContent(s.startLineNumber),s.startColumn-1,s.endColumn-1))}return i}constructor(e,t){this._original=Z_._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;const i=Z_._capture(e,t);if(!i||this._original.length!==i.length)return null;const s=[];for(let o=0,r=this._original.length;oJb,tokenizeEncoded:(n,e,t)=>o3(0,t)};function oxe(n,e,t){return sxe(this,void 0,void 0,function*(){if(!t)return c6(e,n.languageIdCodec,l6);const i=yield Si.getOrCreate(t);return c6(e,n.languageIdCodec,i||l6)})}function rxe(n,e,t,i,s,o,r){let a="
",l=i,c=0,d=!0;for(let u=0,h=e.getCount();u0;)r&&d?(g+=" ",d=!1):(g+=" ",d=!0),_--;break}case 60:g+="<",d=!1;break;case 62:g+=">",d=!1;break;case 38:g+="&",d=!1;break;case 0:g+="�",d=!1;break;case 65279:case 8232:case 8233:case 133:g+="�",d=!1;break;case 13:g+="​",d=!1;break;case 32:r&&d?(g+=" ",d=!1):(g+=" ",d=!0);break;default:g+=String.fromCharCode(p),d=!1}}if(a+=`${g}`,f>s||l>=s)break}return a+="
",a}function c6(n,e,t){let i='
';const s=$f(n);let o=t.getInitialState();for(let r=0,a=s.length;r0&&(i+="
");const c=t.tokenizeEncoded(l,!0,o);on.convertToEndOffset(c.tokens,l.length);const u=new on(c.tokens,l,e).inflate();let h=0;for(let f=0,g=u.getCount();f${yS(l.substring(h,_))}`,h=_}o=c.endState}return i+="
",i}class axe{constructor(){this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[]}insert(e){this._hasPending=!0,this._inserts.push(e)}change(e){this._hasPending=!0,this._changes.push(e)}remove(e){this._hasPending=!0,this._removes.push(e)}mustCommit(){return this._hasPending}commit(e){if(!this._hasPending)return;const t=this._inserts,i=this._changes,s=this._removes;this._hasPending=!1,this._inserts=[],this._changes=[],this._removes=[],e._commitPendingChanges(t,i,s)}}class lxe{constructor(e,t,i,s,o){this.id=e,this.afterLineNumber=t,this.ordinal=i,this.height=s,this.minWidth=o,this.prefixSum=0}}let Gq=class qT{constructor(e,t,i,s){this._instanceId=NU(++qT.INSTANCE_COUNT),this._pendingChanges=new axe,this._lastWhitespaceId=0,this._arr=[],this._prefixSumValidIndex=-1,this._minWidth=-1,this._lineCount=e,this._lineHeight=t,this._paddingTop=i,this._paddingBottom=s}static findInsertionIndex(e,t,i){let s=0,o=e.length;for(;s>>1;t===e[r].afterLineNumber?i{t=!0,s=s|0,o=o|0,r=r|0,a=a|0;const l=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new lxe(l,s,o,r,a)),l},changeOneWhitespace:(s,o,r)=>{t=!0,o=o|0,r=r|0,this._pendingChanges.change({id:s,newAfterLineNumber:o,newHeight:r})},removeWhitespace:s=>{t=!0,this._pendingChanges.remove({id:s})}})}finally{this._pendingChanges.commit(this)}return t}_commitPendingChanges(e,t,i){if((e.length>0||i.length>0)&&(this._minWidth=-1),e.length+t.length+i.length<=1){for(const l of e)this._insertWhitespace(l);for(const l of t)this._changeOneWhitespace(l.id,l.newAfterLineNumber,l.newHeight);for(const l of i){const c=this._findWhitespaceIndex(l.id);c!==-1&&this._removeWhitespace(c)}return}const s=new Set;for(const l of i)s.add(l.id);const o=new Map;for(const l of t)o.set(l.id,l);const r=l=>{const c=[];for(const d of l)if(!s.has(d.id)){if(o.has(d.id)){const u=o.get(d.id);d.afterLineNumber=u.newAfterLineNumber,d.height=u.newHeight}c.push(d)}return c},a=r(this._arr).concat(r(e));a.sort((l,c)=>l.afterLineNumber===c.afterLineNumber?l.ordinal-c.ordinal:l.afterLineNumber-c.afterLineNumber),this._arr=a,this._prefixSumValidIndex=-1}_checkPendingChanges(){this._pendingChanges.mustCommit()&&this._pendingChanges.commit(this)}_insertWhitespace(e){const t=qT.findInsertionIndex(this._arr,e.afterLineNumber,e.ordinal);this._arr.splice(t,0,e),this._prefixSumValidIndex=Math.min(this._prefixSumValidIndex,t-1)}_findWhitespaceIndex(e){const t=this._arr;for(let i=0,s=t.length;it&&(this._arr[i].afterLineNumber-=t-e+1)}}onLinesInserted(e,t){this._checkPendingChanges(),e=e|0,t=t|0,this._lineCount+=t-e+1;for(let i=0,s=this._arr.length;i=t.length||t[a+1].afterLineNumber>=e)return a;i=a+1|0}else s=a-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e=e|0;const i=this._findLastWhitespaceBeforeLineNumber(e)+1;return i1?i=this._lineHeight*(e-1):i=0;const s=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e-(t?1:0));return i+s+this._paddingTop}getVerticalOffsetAfterLineNumber(e,t=!1){this._checkPendingChanges(),e=e|0;const i=this._lineHeight*e,s=this.getWhitespaceAccumulatedHeightBeforeLineNumber(e+(t?1:0));return i+s+this._paddingTop}getWhitespaceMinWidth(){if(this._checkPendingChanges(),this._minWidth===-1){let e=0;for(let t=0,i=this._arr.length;tt}isInTopPadding(e){return this._paddingTop===0?!1:(this._checkPendingChanges(),e=t-this._paddingBottom}getLineNumberAtOrAfterVerticalOffset(e){if(this._checkPendingChanges(),e=e|0,e<0)return 1;const t=this._lineCount|0,i=this._lineHeight;let s=1,o=t;for(;s=a+i)s=r+1;else{if(e>=a)return r;o=r}}return s>t?t:s}getLinesViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const i=this._lineHeight,s=this.getLineNumberAtOrAfterVerticalOffset(e)|0,o=this.getVerticalOffsetForLineNumber(s)|0;let r=this._lineCount|0,a=this.getFirstWhitespaceIndexAfterLineNumber(s)|0;const l=this.getWhitespacesCount()|0;let c,d;a===-1?(a=l,d=r+1,c=0):(d=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);let u=o,h=u;const f=5e5;let g=0;o>=f&&(g=Math.floor(o/f)*f,g=Math.floor(g/i)*i,h-=g);const p=[],_=e+(t-e)/2;let v=-1;for(let S=s;S<=r;S++){if(v===-1){const L=u,x=u+i;(L<=_&&__)&&(v=S)}for(u+=i,p[S-s]=h,h+=i;d===S;)h+=c,u+=c,a++,a>=l?d=r+1:(d=this.getAfterLineNumberForWhitespaceIndex(a)|0,c=this.getHeightForWhitespaceIndex(a)|0);if(u>=t){r=S;break}}v===-1&&(v=r);const b=this.getVerticalOffsetForLineNumber(r)|0;let y=s,w=r;return yt&&w--,{bigNumbersDelta:g,startLineNumber:s,endLineNumber:r,relativeVerticalOffset:p,centeredLineNumber:v,completelyVisibleStartLineNumber:y,completelyVisibleEndLineNumber:w}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e=e|0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let i;t>=1?i=this._lineHeight*t:i=0;let s;return e>0?s=this.getWhitespacesAccumulatedHeight(e-1):s=0,i+s+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e=e|0;let t=0,i=this.getWhitespacesCount()-1;if(i<0)return-1;const s=this.getVerticalOffsetForWhitespaceIndex(i),o=this.getHeightForWhitespaceIndex(i);if(e>=s+o)return-1;for(;t=a+l)t=r+1;else{if(e>=a)return r;i=r}}return t}getWhitespaceAtVerticalOffset(e){this._checkPendingChanges(),e=e|0;const t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0||t>=this.getWhitespacesCount())return null;const i=this.getVerticalOffsetForWhitespaceIndex(t);if(i>e)return null;const s=this.getHeightForWhitespaceIndex(t),o=this.getIdForWhitespaceIndex(t),r=this.getAfterLineNumberForWhitespaceIndex(t);return{id:o,afterLineNumber:r,verticalOffset:i,height:s}}getWhitespaceViewportData(e,t){this._checkPendingChanges(),e=e|0,t=t|0;const i=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),s=this.getWhitespacesCount()-1;if(i<0)return[];const o=[];for(let r=i;r<=s;r++){const a=this.getVerticalOffsetForWhitespaceIndex(r),l=this.getHeightForWhitespaceIndex(r);if(a>=t)break;o.push({id:this.getIdForWhitespaceIndex(r),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(r),verticalOffset:a,height:l})}return o}getWhitespaces(){return this._checkPendingChanges(),this._arr.slice(0)}getWhitespacesCount(){return this._checkPendingChanges(),this._arr.length}getIdForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].id}getAfterLineNumberForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].afterLineNumber}getHeightForWhitespaceIndex(e){return this._checkPendingChanges(),e=e|0,this._arr[e].height}};Gq.INSTANCE_COUNT=0;const cxe=125;class y_{constructor(e,t,i,s){e=e|0,t=t|0,i=i|0,s=s|0,e<0&&(e=0),t<0&&(t=0),i<0&&(i=0),s<0&&(s=0),this.width=e,this.contentWidth=t,this.scrollWidth=Math.max(e,t),this.height=i,this.contentHeight=s,this.scrollHeight=Math.max(i,s)}equals(e){return this.width===e.width&&this.contentWidth===e.contentWidth&&this.height===e.height&&this.contentHeight===e.contentHeight}}class dxe extends Y{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new B),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new y_(0,0,0,0),this._scrollable=this._register(new ey({forceIntegerValues:!0,smoothScrollDuration:e,scheduleAtNextAnimationFrame:t})),this.onDidScroll=this._scrollable.onScroll}getScrollable(){return this._scrollable}setSmoothScrollDuration(e){this._scrollable.setSmoothScrollDuration(e)}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}getScrollDimensions(){return this._dimensions}setScrollDimensions(e){if(this._dimensions.equals(e))return;const t=this._dimensions;this._dimensions=e,this._scrollable.setScrollDimensions({width:e.width,scrollWidth:e.scrollWidth,height:e.height,scrollHeight:e.scrollHeight},!0);const i=t.contentWidth!==e.contentWidth,s=t.contentHeight!==e.contentHeight;(i||s)&&this._onDidContentSizeChange.fire(new O3(t.contentWidth,t.contentHeight,e.contentWidth,e.contentHeight))}getFutureScrollPosition(){return this._scrollable.getFutureScrollPosition()}getCurrentScrollPosition(){return this._scrollable.getCurrentScrollPosition()}setScrollPositionNow(e){this._scrollable.setScrollPositionNow(e)}setScrollPositionSmooth(e){this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}}class uxe extends Y{constructor(e,t,i){super(),this._configuration=e;const s=this._configuration.options,o=s.get(143),r=s.get(83);this._linesLayout=new Gq(t,s.get(66),r.top,r.bottom),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new dxe(0,i)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new y_(o.contentWidth,0,o.height,0)),this.onDidScroll=this._scrollable.onDidScroll,this.onDidContentSizeChange=this._scrollable.onDidContentSizeChange,this._updateHeight()}dispose(){super.dispose()}getScrollable(){return this._scrollable.getScrollable()}onHeightMaybeChanged(){this._updateHeight()}_configureSmoothScrollDuration(){this._scrollable.setSmoothScrollDuration(this._configuration.options.get(113)?cxe:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(66)&&this._linesLayout.setLineHeight(t.get(66)),e.hasChanged(83)){const i=t.get(83);this._linesLayout.setPadding(i.top,i.bottom)}if(e.hasChanged(143)){const i=t.get(143),s=i.contentWidth,o=i.height,r=this._scrollable.getScrollDimensions(),a=r.contentWidth;this._scrollable.setScrollDimensions(new y_(s,r.contentWidth,o,this._getContentHeight(s,o,a)))}else this._updateHeight();e.hasChanged(113)&&this._configureSmoothScrollDuration()}onFlushed(e){this._linesLayout.onFlushed(e)}onLinesDeleted(e,t){this._linesLayout.onLinesDeleted(e,t)}onLinesInserted(e,t){this._linesLayout.onLinesInserted(e,t)}_getHorizontalScrollbarHeight(e,t){const s=this._configuration.options.get(102);return s.horizontal===2||e>=t?0:s.horizontalScrollbarSize}_getContentHeight(e,t,i){const s=this._configuration.options;let o=this._linesLayout.getLinesTotalHeight();return s.get(104)?o+=Math.max(0,t-s.get(66)-s.get(83).bottom):o+=this._getHorizontalScrollbarHeight(e,i),o}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,i=e.height,s=e.contentWidth;this._scrollable.setScrollDimensions(new y_(t,e.contentWidth,i,this._getContentHeight(t,i,s)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new Q9(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new Q9(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(){const e=this._configuration.options,t=this._maxLineWidth,i=e.get(144),s=e.get(50),o=e.get(143);if(i.isViewportWrapping){const r=e.get(72);return t>o.contentWidth+s.typicalHalfwidthCharacterWidth&&r.enabled&&r.side==="right"?t+o.verticalScrollbarWidth:t}else{const r=e.get(103)*s.typicalHalfwidthCharacterWidth,a=this._linesLayout.getWhitespaceMinWidth();return Math.max(t+r+o.verticalScrollbarWidth,a,this._overlayWidgetsMinWidth)}}setMaxLineWidth(e){this._maxLineWidth=e,this._updateContentWidth()}setOverlayWidgetsMinWidth(e){this._overlayWidgetsMinWidth=e,this._updateContentWidth()}_updateContentWidth(){const e=this._scrollable.getScrollDimensions();this._scrollable.setScrollDimensions(new y_(e.width,this._computeContentWidth(),e.height,e.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition(),t=e.scrollTop,i=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t),s=this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(i);return{scrollTop:t,scrollTopWithoutViewZones:t-s,scrollLeft:e.scrollLeft}}changeWhitespace(e){const t=this._linesLayout.changeWhitespace(e);return t&&this.onHeightMaybeChanged(),t}getVerticalOffsetForLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetForLineNumber(e,t)}getVerticalOffsetAfterLineNumber(e,t=!1){return this._linesLayout.getVerticalOffsetAfterLineNumber(e,t)}isAfterLines(e){return this._linesLayout.isAfterLines(e)}isInTopPadding(e){return this._linesLayout.isInTopPadding(e)}isInBottomPadding(e){return this._linesLayout.isInBottomPadding(e)}getLineNumberAtVerticalOffset(e){return this._linesLayout.getLineNumberAtOrAfterVerticalOffset(e)}getWhitespaceAtVerticalOffset(e){return this._linesLayout.getWhitespaceAtVerticalOffset(e)}getLinesViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getLinesViewportData(e.top,e.top+e.height)}getLinesViewportDataAtScrollTop(e){const t=this._scrollable.getScrollDimensions();return e+t.height>t.scrollHeight&&(e=t.scrollHeight-t.height),e<0&&(e=0),this._linesLayout.getLinesViewportData(e,e+t.height)}getWhitespaceViewportData(){const e=this.getCurrentViewport();return this._linesLayout.getWhitespaceViewportData(e.top,e.top+e.height)}getWhitespaces(){return this._linesLayout.getWhitespaces()}getContentWidth(){return this._scrollable.getScrollDimensions().contentWidth}getScrollWidth(){return this._scrollable.getScrollDimensions().scrollWidth}getContentHeight(){return this._scrollable.getScrollDimensions().contentHeight}getScrollHeight(){return this._scrollable.getScrollDimensions().scrollHeight}getCurrentScrollLeft(){return this._scrollable.getCurrentScrollPosition().scrollLeft}getCurrentScrollTop(){return this._scrollable.getCurrentScrollPosition().scrollTop}validateScrollPosition(e){return this._scrollable.validateScrollPosition(e)}setScrollPosition(e,t){t===1?this._scrollable.setScrollPositionNow(e):this._scrollable.setScrollPositionSmooth(e)}hasPendingScrollAnimation(){return this._scrollable.hasPendingScrollAnimation()}deltaScrollNow(e,t){const i=this._scrollable.getCurrentScrollPosition();this._scrollable.setScrollPositionNow({scrollLeft:i.scrollLeft+e,scrollTop:i.scrollTop+t})}}class hxe{constructor(e,t,i,s,o){this.editorId=e,this.model=t,this.configuration=i,this._linesCollection=s,this._coordinatesConverter=o,this._decorationsCache=Object.create(null),this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}_clearCachedModelDecorationsResolver(){this._cachedModelDecorationsResolver=null,this._cachedModelDecorationsResolverViewRange=null}dispose(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}reset(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onModelDecorationsChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}onLineMappingChanged(){this._decorationsCache=Object.create(null),this._clearCachedModelDecorationsResolver()}_getOrCreateViewModelDecoration(e){const t=e.id;let i=this._decorationsCache[t];if(!i){const s=e.range,o=e.options;let r;if(o.isWholeLine){const a=this._coordinatesConverter.convertModelPositionToViewPosition(new V(s.startLineNumber,1),0,!1,!0),l=this._coordinatesConverter.convertModelPositionToViewPosition(new V(s.endLineNumber,this.model.getLineMaxColumn(s.endLineNumber)),1);r=new N(a.lineNumber,a.column,l.lineNumber,l.column)}else r=this._coordinatesConverter.convertModelRangeToViewRange(s,1);i=new Vj(r,o),this._decorationsCache[t]=i}return i}getMinimapDecorationsInRange(e){return this._getDecorationsInRange(e,!0,!1).decorations}getDecorationsViewportData(e){let t=this._cachedModelDecorationsResolver!==null;return t=t&&e.equalsRange(this._cachedModelDecorationsResolverViewRange),t||(this._cachedModelDecorationsResolver=this._getDecorationsInRange(e,!1,!1),this._cachedModelDecorationsResolverViewRange=e),this._cachedModelDecorationsResolver}getInlineDecorationsOnLine(e,t=!1,i=!1){const s=new N(e,this._linesCollection.getViewLineMinColumn(e),e,this._linesCollection.getViewLineMaxColumn(e));return this._getDecorationsInRange(s,t,i).inlineDecorations[0]}_getDecorationsInRange(e,t,i){const s=this._linesCollection.getDecorationsInRange(e,this.editorId,pS(this.configuration.options),t,i),o=e.startLineNumber,r=e.endLineNumber,a=[];let l=0;const c=[];for(let d=o;d<=r;d++)c[d-o]=[];for(let d=0,u=s.length;dt===1)}function pxe(n,e){return Kq(n,e.range,t=>t===2)}function Kq(n,e,t){for(let i=e.startLineNumber;i<=e.endLineNumber;i++){const s=n.tokenization.getLineTokens(i),o=i===e.startLineNumber,r=i===e.endLineNumber;let a=o?s.findTokenIndexAtOffset(e.startColumn-1):0;for(;ae.endColumn-1);){if(!t(s.getStandardTokenType(a)))return!1;a++}}return!0}function W2(n,e){return n===null?e?JS.INSTANCE:ex.INSTANCE:new mxe(n,e)}class mxe{constructor(e,t){this._projectionData=e,this._isVisible=t}isVisible(){return this._isVisible}setVisible(e){return this._isVisible=e,this}getProjectionData(){return this._projectionData}getViewLineCount(){return this._isVisible?this._projectionData.getOutputLineCount():0}getViewLineContent(e,t,i){this._assertVisible();const s=i>0?this._projectionData.breakOffsets[i-1]:0,o=this._projectionData.breakOffsets[i];let r;if(this._projectionData.injectionOffsets!==null){const a=this._projectionData.injectionOffsets.map((c,d)=>new aa(0,0,c+1,this._projectionData.injectionOptions[d],0));r=aa.applyInjectedText(e.getLineContent(t),a).substring(s,o)}else r=e.getValueInRange({startLineNumber:t,startColumn:s+1,endLineNumber:t,endColumn:o+1});return i>0&&(r=d6(this._projectionData.wrappedTextIndentLength)+r),r}getViewLineLength(e,t,i){return this._assertVisible(),this._projectionData.getLineLength(i)}getViewLineMinColumn(e,t,i){return this._assertVisible(),this._projectionData.getMinOutputOffset(i)+1}getViewLineMaxColumn(e,t,i){return this._assertVisible(),this._projectionData.getMaxOutputOffset(i)+1}getViewLineData(e,t,i){const s=new Array;return this.getViewLinesData(e,t,i,1,0,[!0],s),s[0]}getViewLinesData(e,t,i,s,o,r,a){this._assertVisible();const l=this._projectionData,c=l.injectionOffsets,d=l.injectionOptions;let u=null;if(c){u=[];let f=0,g=0;for(let p=0;p0?l.breakOffsets[p-1]:0,b=l.breakOffsets[p];for(;gb)break;if(v0?l.wrappedTextIndentLength:0,D=x+Math.max(w-v,0),k=x+Math.min(S-v,b-v);D!==k&&_.push(new Cbe(D,k,L.inlineClassName,L.inlineClassNameAffectsLetterSpacing))}}if(S<=b)f+=y,g++;else break}}}let h;c?h=e.tokenization.getLineTokens(t).withInserted(c.map((f,g)=>({offset:f,text:d[g].content,tokenMetadata:on.defaultTokenMetadata}))):h=e.tokenization.getLineTokens(t);for(let f=i;f0?s.wrappedTextIndentLength:0,r=i>0?s.breakOffsets[i-1]:0,a=s.breakOffsets[i],l=e.sliceAndInflate(r,a,o);let c=l.getLineContent();i>0&&(c=d6(s.wrappedTextIndentLength)+c);const d=this._projectionData.getMinOutputOffset(i)+1,u=c.length+1,h=i+1=V2.length)for(let e=1;e<=n;e++)V2[e]=_xe(e);return V2[n]}function _xe(n){return new Array(n+1).join(" ")}class bxe{constructor(e,t,i,s,o,r,a,l,c,d){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=i,this._monospaceLineBreaksComputerFactory=s,this.fontInfo=o,this.tabSize=r,this.wrappingStrategy=a,this.wrappingColumn=l,this.wrappingIndent=c,this.wordBreak=d,this._constructLines(!0,null)}dispose(){this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[])}createCoordinatesConverter(){return new yxe(this)}_constructLines(e,t){this.modelLineProjections=[],e&&(this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[]));const i=this.model.getLinesContent(),s=this.model.getInjectedTextDecorations(this._editorId),o=i.length,r=this.createLineBreaksComputer(),a=new _c(aa.fromDecorations(s));for(let p=0;pv.lineNumber===p+1);r.addRequest(i[p],_,t?t[p]:null)}const l=r.finalize(),c=[],d=this.hiddenAreasDecorationIds.map(p=>this.model.getDecorationRange(p)).sort(N.compareRangesUsingStarts);let u=1,h=0,f=-1,g=f+1=u&&_<=h,b=W2(l[p],!v);c[p]=b.getViewLineCount(),this.modelLineProjections[p]=b}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new t_e(c)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map(e=>this.model.getDecorationRange(e))}setHiddenAreas(e){const t=e.map(h=>this.model.validateRange(h)),i=vxe(t),s=this.hiddenAreasDecorationIds.map(h=>this.model.getDecorationRange(h)).sort(N.compareRangesUsingStarts);if(i.length===s.length){let h=!1;for(let f=0;f({range:h,options:Je.EMPTY}));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,o);const r=i;let a=1,l=0,c=-1,d=c+1=a&&f<=l?this.modelLineProjections[h].isVisible()&&(this.modelLineProjections[h]=this.modelLineProjections[h].setVisible(!1),g=!0):(u=!0,this.modelLineProjections[h].isVisible()||(this.modelLineProjections[h]=this.modelLineProjections[h].setVisible(!0),g=!0)),g){const p=this.modelLineProjections[h].getViewLineCount();this.projectedModelLineLineCounts.setValue(h,p)}}return u||this.setHiddenAreas([]),!0}modelPositionIsVisible(e,t){return e<1||e>this.modelLineProjections.length?!1:this.modelLineProjections[e-1].isVisible()}getModelLineViewLineCount(e){return e<1||e>this.modelLineProjections.length?1:this.modelLineProjections[e-1].getViewLineCount()}setTabSize(e){return this.tabSize===e?!1:(this.tabSize=e,this._constructLines(!1,null),!0)}setWrappingSettings(e,t,i,s,o){const r=this.fontInfo.equals(e),a=this.wrappingStrategy===t,l=this.wrappingColumn===i,c=this.wrappingIndent===s,d=this.wordBreak===o;if(r&&a&&l&&c&&d)return!1;const u=r&&a&&!l&&c&&d;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=i,this.wrappingIndent=s,this.wordBreak=o;let h=null;if(u){h=[];for(let f=0,g=this.modelLineProjections.length;f2&&!this.modelLineProjections[t-2].isVisible(),r=t===1?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1;let a=0;const l=[],c=[];for(let d=0,u=s.length;dl?(d=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,u=d+l-1,g=u+1,p=g+(o-l)-1,c=!0):ot?t:e|0}getActiveIndentGuide(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),i=this._toValidViewLineNumber(i);const s=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),o=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),r=this.convertViewPositionToModelPosition(i,this.getViewLineMinColumn(i)),a=this.model.guides.getActiveIndentGuide(s.lineNumber,o.lineNumber,r.lineNumber),l=this.convertModelPositionToViewPosition(a.startLineNumber,1),c=this.convertModelPositionToViewPosition(a.endLineNumber,this.model.getLineMaxColumn(a.endLineNumber));return{startLineNumber:l.lineNumber,endLineNumber:c.lineNumber,indent:a.indent}}getViewLineInfo(e){e=this._toValidViewLineNumber(e);const t=this.projectedModelLineLineCounts.getIndexOf(e-1),i=t.index,s=t.remainder;return new u6(i+1,s)}getMinColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getMaxColumnOfViewLine(e){return this.modelLineProjections[e.modelLineNumber-1].getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx)}getModelStartPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMinColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),s=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new V(e.modelLineNumber,s)}getModelEndPositionOfViewLine(e){const t=this.modelLineProjections[e.modelLineNumber-1],i=t.getViewLineMaxColumn(this.model,e.modelLineNumber,e.modelLineWrappedLineIdx),s=t.getModelColumnOfViewPosition(e.modelLineWrappedLineIdx,i);return new V(e.modelLineNumber,s)}getViewLineInfosGroupedByModelRanges(e,t){const i=this.getViewLineInfo(e),s=this.getViewLineInfo(t),o=new Array;let r=this.getModelStartPositionOfViewLine(i),a=new Array;for(let l=i.modelLineNumber;l<=s.modelLineNumber;l++){const c=this.modelLineProjections[l-1];if(c.isVisible()){const d=l===i.modelLineNumber?i.modelLineWrappedLineIdx:0,u=l===s.modelLineNumber?s.modelLineWrappedLineIdx+1:c.getViewLineCount();for(let h=d;h{if(f.forWrappedLinesAfterColumn!==-1&&this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,f.forWrappedLinesAfterColumn).lineNumber>=d.modelLineWrappedLineIdx||f.forWrappedLinesBeforeOrAtColumn!==-1&&this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,f.forWrappedLinesBeforeOrAtColumn).lineNumberd.modelLineWrappedLineIdx)return}const p=this.convertModelPositionToViewPosition(d.modelLineNumber,f.horizontalLine.endColumn),_=this.modelLineProjections[d.modelLineNumber-1].getViewPositionOfModelPosition(0,f.horizontalLine.endColumn);return _.lineNumber===d.modelLineWrappedLineIdx?new Ah(f.visibleColumn,g,f.className,new H_(f.horizontalLine.top,p.column),-1,-1):_.lineNumber!!f))}}return r}getViewLinesIndentGuides(e,t){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t);const i=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),s=this.convertViewPositionToModelPosition(t,this.getViewLineMaxColumn(t));let o=[];const r=[],a=[],l=i.lineNumber-1,c=s.lineNumber-1;let d=null;for(let g=l;g<=c;g++){const p=this.modelLineProjections[g];if(p.isVisible()){const _=p.getViewLineNumberOfModelPosition(0,g===l?i.column:1),v=p.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(g+1)),b=v-_+1;let y=0;b>1&&p.getViewLineMinColumn(this.model,g+1,v)===1&&(y=_===0?1:2),r.push(b),a.push(y),d===null&&(d=new V(g+1,0))}else d!==null&&(o=o.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,g)),d=null)}d!==null&&(o=o.concat(this.model.guides.getLinesIndentGuides(d.lineNumber,s.lineNumber)),d=null);const u=t-e+1,h=new Array(u);let f=0;for(let g=0,p=o.length;gt&&(g=!0,f=t-o+1),u.getViewLinesData(this.model,c+1,h,f,o-e,i,l),o+=f,g)break}return l}validateViewPosition(e,t,i){e=this._toValidViewLineNumber(e);const s=this.projectedModelLineLineCounts.getIndexOf(e-1),o=s.index,r=s.remainder,a=this.modelLineProjections[o],l=a.getViewLineMinColumn(this.model,o+1,r),c=a.getViewLineMaxColumn(this.model,o+1,r);tc&&(t=c);const d=a.getModelColumnOfViewPosition(r,t);return this.model.validatePosition(new V(o+1,d)).equals(i)?new V(e,t):this.convertModelPositionToViewPosition(i.lineNumber,i.column)}validateViewRange(e,t){const i=this.validateViewPosition(e.startLineNumber,e.startColumn,t.getStartPosition()),s=this.validateViewPosition(e.endLineNumber,e.endColumn,t.getEndPosition());return new N(i.lineNumber,i.column,s.lineNumber,s.column)}convertViewPositionToModelPosition(e,t){const i=this.getViewLineInfo(e),s=this.modelLineProjections[i.modelLineNumber-1].getModelColumnOfViewPosition(i.modelLineWrappedLineIdx,t);return this.model.validatePosition(new V(i.modelLineNumber,s))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new N(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t,i=2,s=!1,o=!1){const r=this.model.validatePosition(new V(e,t)),a=r.lineNumber,l=r.column;let c=a-1,d=!1;if(o)for(;c0&&!this.modelLineProjections[c].isVisible();)c--,d=!0;if(c===0&&!this.modelLineProjections[c].isVisible())return new V(s?0:1,1);const u=1+this.projectedModelLineLineCounts.getPrefixSum(c);let h;return d?o?h=this.modelLineProjections[c].getViewPositionOfModelPosition(u,1,i):h=this.modelLineProjections[c].getViewPositionOfModelPosition(u,this.model.getLineMaxColumn(c+1),i):h=this.modelLineProjections[a-1].getViewPositionOfModelPosition(u,l,i),h}convertModelRangeToViewRange(e,t=0){if(e.isEmpty()){const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return N.fromPositions(i)}else{const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),s=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new N(i.lineNumber,i.column,s.lineNumber,s.column)}}getViewLineNumberOfModelPosition(e,t){let i=e-1;if(this.modelLineProjections[i].isVisible()){const o=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(o,t)}for(;i>0&&!this.modelLineProjections[i].isVisible();)i--;if(i===0&&!this.modelLineProjections[i].isVisible())return 1;const s=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(s,this.model.getLineMaxColumn(i+1))}getDecorationsInRange(e,t,i,s,o){const r=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),a=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(a.lineNumber-r.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new N(r.lineNumber,1,a.lineNumber,a.column),t,i,s,o);let l=[];const c=r.lineNumber-1,d=a.lineNumber-1;let u=null;for(let p=c;p<=d;p++)if(this.modelLineProjections[p].isVisible())u===null&&(u=new V(p+1,p===c?r.column:1));else if(u!==null){const v=this.model.getLineMaxColumn(p);l=l.concat(this.model.getDecorationsInRange(new N(u.lineNumber,u.column,p,v),t,i,s)),u=null}u!==null&&(l=l.concat(this.model.getDecorationsInRange(new N(u.lineNumber,u.column,a.lineNumber,a.column),t,i,s)),u=null),l.sort((p,_)=>{const v=N.compareRangesUsingStarts(p.range,_.range);return v===0?p.id<_.id?-1:p.id>_.id?1:0:v});const h=[];let f=0,g=null;for(const p of l){const _=p.id;g!==_&&(g=_,h[f++]=p)}return h}getInjectedTextAt(e){const t=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[t.modelLineNumber-1].getInjectedTextAt(t.modelLineWrappedLineIdx,e.column)}normalizePosition(e,t){const i=this.getViewLineInfo(e.lineNumber);return this.modelLineProjections[i.modelLineNumber-1].normalizePosition(i.modelLineWrappedLineIdx,e,t)}getLineIndentColumn(e){const t=this.getViewLineInfo(e);return t.modelLineWrappedLineIdx===0?this.model.getLineIndentColumn(t.modelLineNumber):0}}function vxe(n){if(n.length===0)return[];const e=n.slice();e.sort(N.compareRangesUsingStarts);const t=[];let i=e[0].startLineNumber,s=e[0].endLineNumber;for(let o=1,r=e.length;os+1?(t.push(new N(i,1,s,1)),i=a.startLineNumber,s=a.endLineNumber):a.endLineNumber>s&&(s=a.endLineNumber)}return t.push(new N(i,1,s,1)),t}class u6{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class h6{constructor(e,t){this.modelRange=e,this.viewLines=t}}class yxe{constructor(e){this._lines=e}convertViewPositionToModelPosition(e){return this._lines.convertViewPositionToModelPosition(e.lineNumber,e.column)}convertViewRangeToModelRange(e){return this._lines.convertViewRangeToModelRange(e)}validateViewPosition(e,t){return this._lines.validateViewPosition(e.lineNumber,e.column,t)}validateViewRange(e,t){return this._lines.validateViewRange(e,t)}convertModelPositionToViewPosition(e,t,i,s){return this._lines.convertModelPositionToViewPosition(e.lineNumber,e.column,t,i,s)}convertModelRangeToViewRange(e,t){return this._lines.convertModelRangeToViewRange(e,t)}modelPositionIsVisible(e){return this._lines.modelPositionIsVisible(e.lineNumber,e.column)}getModelLineViewLineCount(e){return this._lines.getModelLineViewLineCount(e)}getViewLineNumberOfModelPosition(e,t){return this._lines.getViewLineNumberOfModelPosition(e,t)}}class wxe{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new Cxe(this)}getHiddenAreas(){return[]}setHiddenAreas(e){return!1}setTabSize(e){return!1}setWrappingSettings(e,t,i,s){return!1}createLineBreaksComputer(){const e=[];return{addRequest:(t,i,s)=>{e.push(null)},finalize:()=>e}}onModelFlushed(){}onModelLinesDeleted(e,t,i){return new UT(t,i)}onModelLinesInserted(e,t,i,s){return new jT(t,i)}onModelLineChanged(e,t,i){return[!1,new qq(t,1),null,null]}acceptVersionId(e){}getViewLineCount(){return this.model.getLineCount()}getActiveIndentGuide(e,t,i){return{startLineNumber:e,endLineNumber:e,indent:0}}getViewLinesBracketGuides(e,t,i){return new Array(t-e+1).fill([])}getViewLinesIndentGuides(e,t){const i=t-e+1,s=new Array(i);for(let o=0;ot)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,t){return e}}let Sxe=class extends Y{constructor(e,t,i,s,o,r,a,l,c){if(super(),this.languageConfigurationService=a,this._themeService=l,this._attachedView=c,this.hiddenAreasModel=new Lxe,this.previousHiddenAreas=[],this._editorId=e,this._configuration=t,this.model=i,this._eventDispatcher=new USe,this.onEvent=this._eventDispatcher.onEvent,this.cursorConfig=new bg(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._updateConfigurationViewLineCount=this._register(new Li(()=>this._updateConfigurationViewLineCountNow(),0)),this._hasFocus=!1,this._viewportStart=W3.create(this.model),this.model.isTooLargeForTokenization())this._lines=new wxe(this.model);else{const d=this._configuration.options,u=d.get(50),h=d.get(137),f=d.get(144),g=d.get(136),p=d.get(128);this._lines=new bxe(this._editorId,this.model,s,o,u,this.model.getOptions().tabSize,h,f.wrappingColumn,g,p)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new txe(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new uxe(this._configuration,this.getLineCount(),r)),this._register(this.viewLayout.onDidScroll(d=>{d.scrollTopChanged&&this._handleVisibleLinesChanged(),d.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new WSe(d)),this._eventDispatcher.emitOutgoingEvent(new B3(d.oldScrollWidth,d.oldScrollLeft,d.oldScrollHeight,d.oldScrollTop,d.scrollWidth,d.scrollLeft,d.scrollHeight,d.scrollTop))})),this._register(this.viewLayout.onDidContentSizeChange(d=>{this._eventDispatcher.emitOutgoingEvent(d)})),this._decorations=new hxe(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast(d=>{try{const u=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(u,d)}finally{this._eventDispatcher.endEmitViewEvents()}})),this._register(sy.getInstance().onDidChange(()=>{this._eventDispatcher.emitSingleViewEvent(new HSe)})),this._register(this._themeService.onDidColorThemeChange(d=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new VSe(d))})),this._updateConfigurationViewLineCountNow()}dispose(){super.dispose(),this._decorations.dispose(),this._lines.dispose(),this._viewportStart.dispose(),this._eventDispatcher.dispose()}createLineBreaksComputer(){return this._lines.createLineBreaksComputer()}addViewEventHandler(e){this._eventDispatcher.addViewEventHandler(e)}removeViewEventHandler(e){this._eventDispatcher.removeViewEventHandler(e)}_updateConfigurationViewLineCountNow(){this._configuration.setViewLineCount(this._lines.getViewLineCount())}getModelVisibleRanges(){const e=this.viewLayout.getLinesViewportData(),t=new N(e.startLineNumber,this.getLineMinColumn(e.startLineNumber),e.endLineNumber,this.getLineMaxColumn(e.endLineNumber));return this._toModelVisibleRanges(t)}visibleLinesStabilized(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!0)}_handleVisibleLinesChanged(){const e=this.getModelVisibleRanges();this._attachedView.setVisibleLines(e,!1)}setHasFocus(e){this._hasFocus=e,this._cursor.setHasFocus(e),this._eventDispatcher.emitSingleViewEvent(new FSe(e)),this._eventDispatcher.emitOutgoingEvent(new F3(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new RSe)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new MSe)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){const e=new V(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber)),t=this.coordinatesConverter.convertViewPositionToModelPosition(e);return new g6(t,this._viewportStart.startLineDelta)}return new g6(null,0)}_onConfigurationChanged(e,t){const i=this._captureStableViewport(),s=this._configuration.options,o=s.get(50),r=s.get(137),a=s.get(144),l=s.get(136),c=s.get(128);this._lines.setWrappingSettings(o,r,a.wrappingColumn,l,c)&&(e.emitViewEvent(new ow),e.emitViewEvent(new rw),e.emitViewEvent(new Cg(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(90)&&(this._decorations.reset(),e.emitViewEvent(new Cg(null))),e.emitViewEvent(new PSe(t)),this.viewLayout.onConfigurationChanged(t),i.recoverViewportStart(this.coordinatesConverter,this.viewLayout),bg.shouldRecreate(t)&&(this.cursorConfig=new bg(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText(e=>{try{const i=this._eventDispatcher.beginEmitViewEvents();let s=!1,o=!1;const r=e instanceof nf?e.rawContentChangedEvent.changes:e.changes,a=e instanceof nf?e.rawContentChangedEvent.versionId:null,l=this._lines.createLineBreaksComputer();for(const u of r)switch(u.changeType){case 4:{for(let h=0;h!p.ownerId||p.ownerId===this._editorId)),l.addRequest(f,g,null)}break}case 2:{let h=null;u.injectedText&&(h=u.injectedText.filter(f=>!f.ownerId||f.ownerId===this._editorId)),l.addRequest(u.detail,h,null);break}}const c=l.finalize(),d=new _c(c);for(const u of r)switch(u.changeType){case 1:{this._lines.onModelFlushed(),i.emitViewEvent(new ow),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),s=!0;break}case 3:{const h=this._lines.onModelLinesDeleted(a,u.fromLineNumber,u.toLineNumber);h!==null&&(i.emitViewEvent(h),this.viewLayout.onLinesDeleted(h.fromLineNumber,h.toLineNumber)),s=!0;break}case 4:{const h=d.takeCount(u.detail.length),f=this._lines.onModelLinesInserted(a,u.fromLineNumber,u.toLineNumber,h);f!==null&&(i.emitViewEvent(f),this.viewLayout.onLinesInserted(f.fromLineNumber,f.toLineNumber)),s=!0;break}case 2:{const h=d.dequeue(),[f,g,p,_]=this._lines.onModelLineChanged(a,u.lineNumber,h);o=f,g&&i.emitViewEvent(g),p&&(i.emitViewEvent(p),this.viewLayout.onLinesInserted(p.fromLineNumber,p.toLineNumber)),_&&(i.emitViewEvent(_),this.viewLayout.onLinesDeleted(_.fromLineNumber,_.toLineNumber));break}case 5:break}a!==null&&this._lines.acceptVersionId(a),this.viewLayout.onHeightMaybeChanged(),!s&&o&&(i.emitViewEvent(new rw),i.emitViewEvent(new Cg(null)),this._cursor.onLineMappingChanged(i),this._decorations.onLineMappingChanged())}finally{this._eventDispatcher.endEmitViewEvents()}const t=this._viewportStart.isValid;if(this._viewportStart.invalidate(),this._configuration.setModelLineCount(this.model.getLineCount()),this._updateConfigurationViewLineCountNow(),!this._hasFocus&&this.model.getAttachedEditorCount()>=2&&t){const i=this.model._getTrackedRange(this._viewportStart.modelTrackedRange);if(i){const s=this.coordinatesConverter.convertModelPositionToViewPosition(i.getStartPosition()),o=this.viewLayout.getVerticalOffsetForLineNumber(s.lineNumber);this.viewLayout.setScrollPosition({scrollTop:o+this._viewportStart.startLineDelta},1)}}try{const i=this._eventDispatcher.beginEmitViewEvents();e instanceof nf&&i.emitOutgoingEvent(new QSe(e.contentChangedEvent)),this._cursor.onModelContentChanged(i,e)}finally{this._eventDispatcher.endEmitViewEvents()}this._handleVisibleLinesChanged()})),this._register(this.model.onDidChangeTokens(e=>{const t=[];for(let i=0,s=e.ranges.length;i{this._eventDispatcher.emitSingleViewEvent(new BSe),this.cursorConfig=new bg(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new XSe(e))})),this._register(this.model.onDidChangeLanguage(e=>{this.cursorConfig=new bg(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new ZSe(e))})),this._register(this.model.onDidChangeOptions(e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const t=this._eventDispatcher.beginEmitViewEvents();t.emitViewEvent(new ow),t.emitViewEvent(new rw),t.emitViewEvent(new Cg(null)),this._cursor.onLineMappingChanged(t),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new bg(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new JSe(e))})),this._register(this.model.onDidChangeDecorations(e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new Cg(e)),this._eventDispatcher.emitOutgoingEvent(new YSe(e))}))}setHiddenAreas(e,t){this.hiddenAreasModel.setHiddenAreas(t,e);const i=this.hiddenAreasModel.getMergedRanges();if(i===this.previousHiddenAreas)return;this.previousHiddenAreas=i;const s=this._captureStableViewport();let o=!1;try{const r=this._eventDispatcher.beginEmitViewEvents();o=this._lines.setHiddenAreas(i),o&&(r.emitViewEvent(new ow),r.emitViewEvent(new rw),r.emitViewEvent(new Cg(null)),this._cursor.onLineMappingChanged(r),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged()),s.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),o&&this._eventDispatcher.emitOutgoingEvent(new GSe)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(143),t=this._configuration.options.get(66),i=Math.max(20,Math.round(e.height/t)),s=this.viewLayout.getLinesViewportData(),o=Math.max(1,s.completelyVisibleStartLineNumber-i),r=Math.min(this.getLineCount(),s.completelyVisibleEndLineNumber+i);return this._toModelVisibleRanges(new N(o,this.getLineMinColumn(o),r,this.getLineMaxColumn(r)))}getVisibleRanges(){const e=this.getCompletelyVisibleViewRange();return this._toModelVisibleRanges(e)}getHiddenAreas(){return this._lines.getHiddenAreas()}_toModelVisibleRanges(e){const t=this.coordinatesConverter.convertViewRangeToModelRange(e),i=this._lines.getHiddenAreas();if(i.length===0)return[t];const s=[];let o=0,r=t.startLineNumber,a=t.startColumn;const l=t.endLineNumber,c=t.endColumn;for(let d=0,u=i.length;dl||(r"u")return this._reduceRestoreStateCompatibility(e);const t=this.model.validatePosition(e.firstPosition),i=this.coordinatesConverter.convertModelPositionToViewPosition(t),s=this.viewLayout.getVerticalOffsetForLineNumber(i.lineNumber)-e.firstPositionDeltaTop;return{scrollLeft:e.scrollLeft,scrollTop:s}}_reduceRestoreStateCompatibility(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTopWithoutViewZones}}getTabSize(){return this.model.getOptions().tabSize}getLineCount(){return this._lines.getViewLineCount()}setViewport(e,t,i){this._viewportStart.update(this,e)}getActiveIndentGuide(e,t,i){return this._lines.getActiveIndentGuide(e,t,i)}getLinesIndentGuides(e,t){return this._lines.getViewLinesIndentGuides(e,t)}getBracketGuidesInRangeByLine(e,t,i,s){return this._lines.getViewLinesBracketGuides(e,t,i,s)}getLineContent(e){return this._lines.getViewLineContent(e)}getLineLength(e){return this._lines.getViewLineLength(e)}getLineMinColumn(e){return this._lines.getViewLineMinColumn(e)}getLineMaxColumn(e){return this._lines.getViewLineMaxColumn(e)}getLineFirstNonWhitespaceColumn(e){const t=Ys(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){const t=Uf(this.getLineContent(e));return t===-1?0:t+2}getMinimapDecorationsInRange(e){return this._decorations.getMinimapDecorationsInRange(e)}getDecorationsInViewport(e){return this._decorations.getDecorationsViewportData(e).decorations}getInjectedTextAt(e){return this._lines.getInjectedTextAt(e)}getViewportViewLineRenderingData(e,t){const s=this._decorations.getDecorationsViewportData(e).inlineDecorations[t-e.startLineNumber];return this._getViewLineRenderingData(t,s)}getViewLineRenderingData(e){const t=this._decorations.getInlineDecorationsOnLine(e);return this._getViewLineRenderingData(e,t)}_getViewLineRenderingData(e,t){const i=this.model.mightContainRTL(),s=this.model.mightContainNonBasicASCII(),o=this.getTabSize(),r=this._lines.getViewLineData(e);return r.inlineDecorations&&(t=[...t,...r.inlineDecorations.map(a=>a.toInlineDecoration(e))]),new Lo(r.minColumn,r.maxColumn,r.content,r.continuesWithWrappedLine,i,s,r.tokens,t,o,r.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,i){const s=this._lines.getViewLinesData(e,t,i);return new wbe(this.getTabSize(),s)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,pS(this._configuration.options)),i=new xxe;for(const s of t){const o=s.options,r=o.overviewRuler;if(!r)continue;const a=r.position;if(a===0)continue;const l=r.getColor(e.value),c=this.coordinatesConverter.getViewLineNumberOfModelPosition(s.range.startLineNumber,s.range.startColumn),d=this.coordinatesConverter.getViewLineNumberOfModelPosition(s.range.endLineNumber,s.range.endColumn);i.accept(l,o.zIndex,c,d,a)}return i.asArray}_invalidateDecorationsColorCache(){const e=this.model.getOverviewRulerDecorations();for(const t of e){const i=t.options.overviewRuler;i==null||i.invalidateCachedColor();const s=t.options.minimap;s==null||s.invalidateCachedColor()}}getValueInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueInRange(i,t)}getValueLengthInRange(e,t){const i=this.coordinatesConverter.convertViewRangeToModelRange(e);return this.model.getValueLengthInRange(i,t)}modifyPosition(e,t){const i=this.coordinatesConverter.convertViewPositionToModelPosition(e);return this.model.modifyPosition(i,t)}deduceModelPositionRelativeToViewPosition(e,t,i){const s=this.coordinatesConverter.convertViewPositionToModelPosition(e);this.model.getEOL().length===2&&(t<0?t-=i:t+=i);const r=this.model.getOffsetAt(s)+t;return this.model.getPositionAt(r)}getPlainTextToCopy(e,t,i){const s=i?`\r +`:this.model.getEOL();e=e.slice(0),e.sort(N.compareRangesUsingStarts);let o=!1,r=!1;for(const l of e)l.isEmpty()?o=!0:r=!0;if(!r){if(!t)return"";const l=e.map(d=>d.startLineNumber);let c="";for(let d=0;d0&&l[d-1]===l[d]||(c+=this.model.getLineContent(l[d])+s);return c}if(o&&t){const l=[];let c=0;for(const d of e){const u=d.startLineNumber;d.isEmpty()?u!==c&&l.push(this.model.getLineContent(u)):l.push(this.model.getValueInRange(d,i?2:0)),c=u}return l.length===1?l[0]:l}const a=[];for(const l of e)l.isEmpty()||a.push(this.model.getValueInRange(l,i?2:0));return a.length===1?a[0]:a}getRichTextToCopy(e,t){const i=this.model.getLanguageId();if(i===Ho||e.length!==1)return null;let s=e[0];if(s.isEmpty()){if(!t)return null;const d=s.startLineNumber;s=new N(d,this.model.getLineMinColumn(d),d,this.model.getLineMaxColumn(d))}const o=this._configuration.options.get(50),r=this._getColorMap(),l=/[:;\\\/<>]/.test(o.fontFamily)||o.fontFamily===zo.fontFamily;let c;return l?c=zo.fontFamily:(c=o.fontFamily,c=c.replace(/"/g,"'"),/[,']/.test(c)||/[+ ]/.test(c)&&(c=`'${c}'`),c=`${c}, ${zo.fontFamily}`),{mode:i,html:`
`+this._getHTMLToCopy(s,r)+"
"}}_getHTMLToCopy(e,t){const i=e.startLineNumber,s=e.startColumn,o=e.endLineNumber,r=e.endColumn,a=this.getTabSize();let l="";for(let c=i;c<=o;c++){const d=this.model.tokenization.getLineTokens(c),u=d.getLineContent(),h=c===i?s-1:0,f=c===o?r-1:u.length;u===""?l+="
":l+=rxe(u,d.inflate(),t,h,f,a,Ps)}return l}_getColorMap(){const e=Si.getColorMap(),t=["#000000"];if(e)for(let i=1,s=e.length;ithis._cursor.setStates(s,e,t,i))}getCursorColumnSelectData(){return this._cursor.getCursorColumnSelectData()}getCursorAutoClosedCharacters(){return this._cursor.getAutoClosedCharacters()}setCursorColumnSelectData(e){this._cursor.setCursorColumnSelectData(e)}getPrevEditOperationType(){return this._cursor.getPrevEditOperationType()}setPrevEditOperationType(e){this._cursor.setPrevEditOperationType(e)}getSelection(){return this._cursor.getSelection()}getSelections(){return this._cursor.getSelections()}getPosition(){return this._cursor.getPrimaryCursorState().modelState.position}setSelections(e,t,i=0){this._withViewEventsCollector(s=>this._cursor.setSelections(s,e,t,i))}saveCursorState(){return this._cursor.saveState()}restoreCursorState(e){this._withViewEventsCollector(t=>this._cursor.restoreState(t,e))}_executeCursorEdit(e){if(this._cursor.context.cursorConfig.readOnly){this._eventDispatcher.emitOutgoingEvent(new KSe);return}this._withViewEventsCollector(e)}executeEdits(e,t,i){this._executeCursorEdit(s=>this._cursor.executeEdits(s,e,t,i))}startComposition(){this._executeCursorEdit(e=>this._cursor.startComposition(e))}endComposition(e){this._executeCursorEdit(t=>this._cursor.endComposition(t,e))}type(e,t){this._executeCursorEdit(i=>this._cursor.type(i,e,t))}compositionType(e,t,i,s,o){this._executeCursorEdit(r=>this._cursor.compositionType(r,e,t,i,s,o))}paste(e,t,i,s){this._executeCursorEdit(o=>this._cursor.paste(o,e,t,i,s))}cut(e){this._executeCursorEdit(t=>this._cursor.cut(t,e))}executeCommand(e,t){this._executeCursorEdit(i=>this._cursor.executeCommand(i,e,t))}executeCommands(e,t){this._executeCursorEdit(i=>this._cursor.executeCommands(i,e,t))}revealPrimaryCursor(e,t,i=!1){this._withViewEventsCollector(s=>this._cursor.revealPrimary(s,e,i,0,t,0))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),i=new N(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(s=>s.emitViewEvent(new vC(e,!1,i,null,0,!0,0)))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new N(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector(s=>s.emitViewEvent(new vC(e,!1,i,null,0,!0,0)))}revealRange(e,t,i,s,o){this._withViewEventsCollector(r=>r.emitViewEvent(new vC(e,!1,i,null,s,t,o)))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new $Se),this._eventDispatcher.emitOutgoingEvent(new qSe))}_withViewEventsCollector(e){try{const t=this._eventDispatcher.beginEmitViewEvents();return e(t)}finally{this._eventDispatcher.endEmitViewEvents()}}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}};class W3{static create(e){const t=e._setTrackedRange(null,new N(1,1,1,1),1);return new W3(e,1,!1,t,0)}get viewLineNumber(){return this._viewLineNumber}get isValid(){return this._isValid}get modelTrackedRange(){return this._modelTrackedRange}get startLineDelta(){return this._startLineDelta}constructor(e,t,i,s,o){this._model=e,this._viewLineNumber=t,this._isValid=i,this._modelTrackedRange=s,this._startLineDelta=o}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,1)}update(e,t){const i=e.coordinatesConverter.convertViewPositionToModelPosition(new V(t,e.getLineMinColumn(t))),s=e.model._setTrackedRange(this._modelTrackedRange,new N(i.lineNumber,i.column,i.lineNumber,i.column),1),o=e.viewLayout.getVerticalOffsetForLineNumber(t),r=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=s,this._startLineDelta=r-o}invalidate(){this._isValid=!1}}class xxe{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,i,s,o){const r=this._asMap[e];if(r){const a=r.data,l=a[a.length-3],c=a[a.length-1];if(l===o&&c+1>=i){s>c&&(a[a.length-1]=s);return}a.push(o,i,s)}else{const a=new ev(e,t,[o,i,s]);this._asMap[e]=a,this.asArray.push(a)}}}class Lxe{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const i=this.hiddenAreas.get(e);i&&f6(i,t)||(this.hiddenAreas.set(e,t),this.shouldRecompute=!0)}getMergedRanges(){if(!this.shouldRecompute)return this.ranges;this.shouldRecompute=!1;const e=Array.from(this.hiddenAreas.values()).reduce((t,i)=>Dxe(t,i),[]);return f6(this.ranges,e)?this.ranges:(this.ranges=e,this.ranges)}}function Dxe(n,e){const t=[];let i=0,s=0;for(;i0?this.wrappedTextIndentLength:0}getLineLength(e){const t=e>0?this.breakOffsets[e-1]:0;let s=this.breakOffsets[e]-t;return e>0&&(s+=this.wrappedTextIndentLength),s}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let s=e===0?t:this.breakOffsets[e-1]+t;if(this.injectionOffsets!==null)for(let o=0;othis.injectionOffsets[o];o++)s0?this.breakOffsets[o-1]:0,t===0)if(e<=r)s=o-1;else if(e>l)i=o+1;else break;else if(e=l)i=o+1;else break}let a=e-r;return o>0&&(a+=this.wrappedTextIndentLength),new aw(o,a)}normalizeOutputPosition(e,t,i){if(this.injectionOffsets!==null){const s=this.outputPositionToOffsetInInputWithInjections(e,t),o=this.normalizeOffsetInInputWithInjectionsAroundInjections(s,i);if(o!==s)return this.offsetInInputWithInjectionsToOutputPosition(o,i)}if(i===0){if(e>0&&t===this.getMinOutputOffset(e))return new aw(e-1,this.getMaxOutputOffset(e-1))}else if(i===1){const s=this.getOutputLineCount()-1;if(e0&&(t=Math.max(0,t-this.wrappedTextIndentLength)),(e>0?this.breakOffsets[e-1]:0)+t}normalizeOffsetInInputWithInjectionsAroundInjections(e,t){const i=this.getInjectedTextAtOffset(e);if(!i)return e;if(t===2){if(e===i.offsetInInputWithInjections+i.length&&p6(this.injectionOptions[i.injectedTextIndex].cursorStops))return i.offsetInInputWithInjections+i.length;{let s=i.offsetInInputWithInjections;if(m6(this.injectionOptions[i.injectedTextIndex].cursorStops))return s;let o=i.injectedTextIndex-1;for(;o>=0&&this.injectionOffsets[o]===this.injectionOffsets[i.injectedTextIndex]&&!(p6(this.injectionOptions[o].cursorStops)||(s-=this.injectionOptions[o].content.length,m6(this.injectionOptions[o].cursorStops)));)o--;return s}}else if(t===1||t===4){let s=i.offsetInInputWithInjections+i.length,o=i.injectedTextIndex;for(;o+1=0&&this.injectionOffsets[o-1]===this.injectionOffsets[o];)s-=this.injectionOptions[o-1].content.length,o--;return s}q4()}getInjectedText(e,t){const i=this.outputPositionToOffsetInInputWithInjections(e,t),s=this.getInjectedTextAtOffset(i);return s?{options:this.injectionOptions[s.injectedTextIndex]}:null}getInjectedTextAtOffset(e){const t=this.injectionOffsets,i=this.injectionOptions;if(t!==null){let s=0;for(let o=0;oe)break;if(e<=l)return{injectedTextIndex:o,offsetInInputWithInjections:a,length:r};s+=r}}}}function p6(n){return n==null?!0:n===Lm.Right||n===Lm.Both}function m6(n){return n==null?!0:n===Lm.Left||n===Lm.Both}class aw{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new V(e+this.outputLineIndex,this.outputOffset+1)}}class V3{static create(e){return new V3(e.get(132),e.get(131))}constructor(e,t){this.classifier=new Exe(e,t)}createLineBreaksComputer(e,t,i,s,o){const r=[],a=[],l=[];return{addRequest:(c,d,u)=>{r.push(c),a.push(d),l.push(u)},finalize:()=>{const c=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,d=[];for(let u=0,h=r.length;u=0&&e<256?this._asciiMap[e]:e>=12352&&e<=12543||e>=13312&&e<=19903||e>=19968&&e<=40959?3:this._map.get(e)||this._defaultValue}}let GT=[],KT=[];function Axe(n,e,t,i,s,o,r,a){if(s===-1)return null;const l=t.length;if(l<=1)return null;const c=a==="keepAll",d=e.breakOffsets,u=e.breakOffsetsVisibleColumn,h=Zq(t,i,s,o,r),f=s-h,g=GT,p=KT;let _=0,v=0,b=0,y=s;const w=d.length;let S=0;if(S>=0){let L=Math.abs(u[S]-y);for(;S+1=L)break;L=x,S++}}for(;SL&&(L=v,x=b);let D=0,k=0,P=0,O=0;if(x<=y){let R=x,z=L===0?0:t.charCodeAt(L-1),G=L===0?0:n.get(z),te=!0;for(let ae=L;aev&&YT(z,G,oe,Se,c)&&(D=fe,k=R),R+=Ie,R>y){fe>v?(P=fe,O=R-Ie):(P=ae+1,O=R),R-k>f&&(D=0),te=!1;break}z=oe,G=Se}if(te){_>0&&(g[_]=d[d.length-1],p[_]=u[d.length-1],_++);break}}if(D===0){let R=x,z=t.charCodeAt(L),G=n.get(z),te=!1;for(let ae=L-1;ae>=v;ae--){const fe=ae+1,oe=t.charCodeAt(ae);if(oe===9){te=!0;break}let Se,Ie;if(bm(oe)?(ae--,Se=0,Ie=2):(Se=n.get(oe),Ie=tu(oe)?o:1),R<=y){if(P===0&&(P=fe,O=R),R<=y-f)break;if(YT(oe,Se,z,G,c)){D=fe,k=R;break}}R-=Ie,z=oe,G=Se}if(D!==0){const ae=f-(O-k);if(ae<=i){const fe=t.charCodeAt(P);let oe;tn(fe)?oe=2:oe=Q_(fe,O,i,o),ae-oe<0&&(D=0)}}if(te){S--;continue}}if(D===0&&(D=P,k=O),D<=v){const R=t.charCodeAt(v);tn(R)?(D=v+2,k=b+2):(D=v+1,k=b+Q_(R,b,i,o))}for(v=D,g[_]=D,b=k,p[_]=k,_++,y=k+f;S<0||S=M)break;M=R,S++}}return _===0?null:(g.length=_,p.length=_,GT=e.breakOffsets,KT=e.breakOffsetsVisibleColumn,e.breakOffsets=g,e.breakOffsetsVisibleColumn=p,e.wrappedTextIndentLength=h,e)}function Ixe(n,e,t,i,s,o,r,a){const l=aa.applyInjectedText(e,t);let c,d;if(t&&t.length>0?(c=t.map(k=>k.options),d=t.map(k=>k.column-1)):(c=null,d=null),s===-1)return c?new X_(d,c,[l.length],[],0):null;const u=l.length;if(u<=1)return c?new X_(d,c,[l.length],[],0):null;const h=a==="keepAll",f=Zq(l,i,s,o,r),g=s-f,p=[],_=[];let v=0,b=0,y=0,w=s,S=l.charCodeAt(0),L=n.get(S),x=Q_(S,0,i,o),D=1;tn(S)&&(x+=1,S=l.charCodeAt(1),L=n.get(S),D++);for(let k=D;kw&&((b===0||x-y>g)&&(b=P,y=x-R),p[v]=b,_[v]=y,v++,w=y+g,b=0),S=O,L=M}return v===0&&(!t||t.length===0)?null:(p[v]=u,_[v]=x,new X_(d,c,p,_,f))}function Q_(n,e,t,i){return n===9?t-e%t:tu(n)||n<32?i:1}function _6(n,e){return e-n%e}function YT(n,e,t,i,s){return t!==32&&(e===2&&i!==2||e!==1&&i===1||!s&&e===3&&i!==2||!s&&i===3&&e!==1)}function Zq(n,e,t,i,s){let o=0;if(s!==0){const r=Ys(n);if(r!==-1){for(let l=0;lt&&(o=0)}}return o}const z2=Kf("domLineBreaksComputer",{createHTML:n=>n});class z3{static create(){return new z3}constructor(){}createLineBreaksComputer(e,t,i,s,o){const r=[],a=[];return{addRequest:(l,c,d)=>{r.push(l),a.push(c)},finalize:()=>Txe(r,e,t,i,s,o,a)}}}function Txe(n,e,t,i,s,o,r){var a;function l(k){const P=r[k];if(P){const O=aa.applyInjectedText(n[k],P),M=P.map(z=>z.options),R=P.map(z=>z.column-1);return new X_(R,M,[O.length],[],0)}else return null}if(i===-1){const k=[];for(let P=0,O=n.length;Pc?(O=0,M=0):R=c-te}const z=P.substr(O),G=Nxe(z,M,t,R,g,h);p[k]=O,_[k]=M,v[k]=z,b[k]=G[0],y[k]=G[1]}const w=g.build(),S=(a=z2==null?void 0:z2.createHTML(w))!==null&&a!==void 0?a:w;f.innerHTML=S,f.style.position="absolute",f.style.top="10000",o==="keepAll"?(f.style.wordBreak="keep-all",f.style.overflowWrap="anywhere"):(f.style.wordBreak="inherit",f.style.overflowWrap="break-word"),document.body.appendChild(f);const L=document.createRange(),x=Array.prototype.slice.call(f.children,0),D=[];for(let k=0;koe.options),ae=fe.map(oe=>oe.column-1)):(te=null,ae=null),D[k]=new X_(ae,te,O,G,R)}return document.body.removeChild(f),D}function Nxe(n,e,t,i,s,o){if(o!==0){const h=String(o);s.appendString('
');const r=n.length;let a=e,l=0;const c=[],d=[];let u=0");for(let h=0;h"),c[h]=l,d[h]=a;const f=u;u=h+1"),c[n.length]=l,d[n.length]=a,s.appendString("
"),[c,d]}function Rxe(n,e,t,i){if(t.length<=1)return null;const s=Array.prototype.slice.call(e.children,0),o=[];try{ZT(n,s,i,0,null,t.length-1,null,o)}catch(r){return console.log(r),null}return o.length===0?null:(o.push(t.length),o)}function ZT(n,e,t,i,s,o,r,a){if(i===o||(s=s||H2(n,e,t[i],t[i+1]),r=r||H2(n,e,t[o],t[o+1]),Math.abs(s[0].top-r[0].top)<=.1))return;if(i+1===o){a.push(o);return}const l=i+(o-i)/2|0,c=H2(n,e,t[l],t[l+1]);ZT(n,e,t,i,s,l,c,a),ZT(n,e,t,l,c,o,r,a)}function H2(n,e,t,i){return n.setStart(e[t/16384|0].firstChild,t%16384),n.setEnd(e[i/16384|0].firstChild,i%16384),n.getClientRects()}class Mxe extends Y{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new A4),this._pending=new Map,this._finishedInstantiation=[],this._finishedInstantiation[0]=!1,this._finishedInstantiation[1]=!1,this._finishedInstantiation[2]=!1,this._finishedInstantiation[3]=!1}initialize(e,t,i){this._editor=e,this._instantiationService=i;for(const s of t){if(this._pending.has(s.id)){mt(new Error(`Cannot have two contributions with the same id ${s.id}`));continue}this._pending.set(s.id,s)}this._instantiateSome(0),this._register(ud(()=>{this._instantiateSome(1)})),this._register(ud(()=>{this._instantiateSome(2)})),this._register(ud(()=>{this._instantiateSome(3)},5e3))}saveViewState(){const e={};for(const[t,i]of this._instances)typeof i.saveViewState=="function"&&(e[t]=i.saveViewState());return e}restoreViewState(e){for(const[t,i]of this._instances)typeof i.restoreViewState=="function"&&i.restoreViewState(e[t])}get(e){return this._instantiateById(e),this._instances.get(e)||null}onBeforeInteractionEvent(){this._instantiateSome(2)}onAfterModelAttached(){this._register(ud(()=>{this._instantiateSome(1)},50))}_instantiateSome(e){if(this._finishedInstantiation[e])return;this._finishedInstantiation[e]=!0;const t=this._findPendingContributionsByInstantiation(e);for(const i of t)this._instantiateById(i.id)}_findPendingContributionsByInstantiation(e){const t=[];for(const[,i]of this._pending)i.instantiation===e&&t.push(i);return t}_instantiateById(e){const t=this._pending.get(e);if(t){if(this._pending.delete(e),!this._instantiationService||!this._editor)throw new Error("Cannot instantiate contributions before being initialized!");try{const i=this._instantiationService.createInstance(t.ctor,this._editor);this._instances.set(t.id,i),typeof i.restoreViewState=="function"&&t.instantiation!==0&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(i){mt(i)}}}}var Pxe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Cl=function(n,e){return function(t,i){e(t,i,n)}},Oxe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},oh;let Fxe=0,Bxe=class{constructor(e,t,i,s,o,r){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=s,this.listenersToRemove=o,this.attachedView=r}dispose(){Ft(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}},Mm=oh=class extends Y{get isSimpleWidget(){return this._configuration.isSimpleWidget}constructor(e,t,i,s,o,r,a,l,c,d,u,h){var f;super(),this.languageConfigurationService=u,this._deliveryQueue=Sge(),this._contributions=this._register(new Mxe),this._onDidDispose=this._register(new B),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeModelTokens=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelTokens=this._onDidChangeModelTokens.event,this._onDidChangeConfiguration=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onDidChangeModel=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new Hn(this._contributions,this._deliveryQueue)),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new b6({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new b6({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new Hn(this._contributions,this._deliveryQueue)),this.onWillType=this._onWillType.event,this._onDidType=this._register(new Hn(this._contributions,this._deliveryQueue)),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new Hn(this._contributions,this._deliveryQueue)),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new Hn(this._contributions,this._deliveryQueue)),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new Hn(this._contributions,this._deliveryQueue)),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new Hn(this._contributions,this._deliveryQueue)),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new Hn(this._contributions,this._deliveryQueue)),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new Hn(this._contributions,this._deliveryQueue)),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new Hn(this._contributions,this._deliveryQueue)),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new Hn(this._contributions,this._deliveryQueue)),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onDropIntoEditor=this._register(new Hn(this._contributions,this._deliveryQueue)),this.onDropIntoEditor=this._onDropIntoEditor.event,this._onContextMenu=this._register(new Hn(this._contributions,this._deliveryQueue)),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new Hn(this._contributions,this._deliveryQueue)),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new Hn(this._contributions,this._deliveryQueue)),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new Hn(this._contributions,this._deliveryQueue)),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new Hn(this._contributions,this._deliveryQueue)),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new Hn(this._contributions,this._deliveryQueue)),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new B({deliveryQueue:this._deliveryQueue})),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event,this._actions=new Map,this._bannerDomNode=null,this._dropIntoEditorDecorations=this.createDecorationsCollection(),o.willCreateCodeEditor();const g=Object.assign({},t);this._domElement=e,this._overflowWidgetsDomNode=g.overflowWidgetsDomNode,delete g.overflowWidgetsDomNode,this._id=++Fxe,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this._telemetryData=i.telemetryData,this._configuration=this._register(this._createConfiguration(i.isSimpleWidget||!1,g,d)),this._register(this._configuration.onDidChange(v=>{this._onDidChangeConfiguration.fire(v);const b=this._configuration.options;if(v.hasChanged(143)){const y=b.get(143);this._onDidLayoutChange.fire(y)}})),this._contextKeyService=this._register(a.createScoped(this._domElement)),this._notificationService=c,this._codeEditorService=o,this._commandService=r,this._themeService=l,this._register(new Wxe(this,this._contextKeyService)),this._register(new Vxe(this,this._contextKeyService,h)),this._instantiationService=s.createChild(new vD([et,this._contextKeyService])),this._modelData=null,this._focusTracker=new zxe(e),this._register(this._focusTracker.onChange(()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())})),this._contentWidgets={},this._overlayWidgets={},this._glyphMarginWidgets={};let p;Array.isArray(i.contributions)?p=i.contributions:p=mp.getEditorContributions(),this._contributions.initialize(this,p,this._instantiationService);for(const v of mp.getEditorActions()){if(this._actions.has(v.id)){mt(new Error(`Cannot have two actions with the same id ${v.id}`));continue}const b=new Eq(v.id,v.label,v.alias,(f=v.precondition)!==null&&f!==void 0?f:void 0,()=>this._instantiationService.invokeFunction(y=>Promise.resolve(v.runEditorCommand(y,this,null))),this._contextKeyService);this._actions.set(b.id,b)}const _=()=>!this._configuration.options.get(90)&&this._configuration.options.get(36).enabled;this._register(new Hme(this._domElement,{onDragEnter:()=>{},onDragOver:v=>{if(!_())return;const b=this.getTargetAtClientPoint(v.clientX,v.clientY);b!=null&&b.position&&this.showDropIndicatorAt(b.position)},onDrop:v=>Oxe(this,void 0,void 0,function*(){if(!_()||(this.removeDropIndicator(),!v.dataTransfer))return;const b=this.getTargetAtClientPoint(v.clientX,v.clientY);b!=null&&b.position&&this._onDropIntoEditor.fire({position:b.position,event:v})}),onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this)}writeScreenReaderContent(e){var t;(t=this._modelData)===null||t===void 0||t.view.writeScreenReaderContent(e)}_createConfiguration(e,t,i){return new xT(e,t,this._domElement,i)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return rD.ICodeEditor}dispose(){this._codeEditorService.removeCodeEditor(this),this._focusTracker.dispose(),this._actions.clear(),this._contentWidgets={},this._overlayWidgets={},this._removeDecorationTypes(),this._postDetachModelCleanup(this._detachModel()),this._onDidDispose.fire(),super.dispose()}invokeWithinContext(e){return this._instantiationService.invokeFunction(e)}updateOptions(e){this._configuration.updateOptions(e||{})}getOptions(){return this._configuration.options}getOption(e){return this._configuration.options.get(e)}getRawOptions(){return this._configuration.getRawOptions()}getOverflowWidgetsDomNode(){return this._overflowWidgetsDomNode}getConfiguredWordAtPosition(e){return this._modelData?wi.getWordAtPosition(this._modelData.model,this._configuration.options.get(129),e):null}getValue(e=null){if(!this._modelData)return"";const t=!!(e&&e.preserveBOM);let i=0;return e&&e.lineEnding&&e.lineEnding===` `?i=1:e&&e.lineEnding&&e.lineEnding===`\r -`&&(i=2),this._modelData.model.getValue(i,t)}setValue(e){this._modelData&&this._modelData.model.setValue(e)}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){const t=e;if(this._modelData===null&&t===null||this._modelData&&this._modelData.model===t)return;const i=this.hasTextFocus(),s=this._detachModel();this._attachModel(t),i&&this.hasModel()&&this.focus();const o={oldModelUrl:s?s.uri:null,newModelUrl:t?t.uri:null};this._removeDecorationTypes(),this._onDidChangeModel.fire(o),this._postDetachModelCleanup(s),this._contributions.onAfterModelAttached()}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(const e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(const i in t)this._removeDecorationType(e+"-"+i)}this._decorationTypeSubtypes={}}}getVisibleRanges(){return this._modelData?this._modelData.viewModel.getVisibleRanges():[]}getVisibleRangesPlusViewportAboveBelow(){return this._modelData?this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow():[]}getWhitespaces(){return this._modelData?this._modelData.viewModel.viewLayout.getWhitespaces():[]}static _getVerticalOffsetAfterPosition(e,t,i,s){const o=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(r.lineNumber,s)}getTopForLineNumber(e,t=!1){return this._modelData?sh._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?sh._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,i,s=!1){const o=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber,s)}getBottomForLineNumber(e,t=!1){return this._modelData?sh._getVerticalOffsetAfterPosition(this._modelData,e,1,t):-1}setHiddenAreas(e,t){var i;(i=this._modelData)===null||i===void 0||i.viewModel.setHiddenAreas(e.map(s=>N.lift(s)),t)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return Ki.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(this._modelData){if(!V.isIPosition(e))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,t,i,s){if(!this._modelData)return;if(!N.isIRange(e))throw new Error("Invalid arguments");const o=this._modelData.model.validateRange(e),r=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(o);this._modelData.viewModel.revealRange("api",i,r,t,s)}revealLine(e,t=0){this._revealLine(e,0,t)}revealLineInCenter(e,t=0){this._revealLine(e,1,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._revealLine(e,2,t)}revealLineNearTop(e,t=0){this._revealLine(e,5,t)}_revealLine(e,t,i){if(typeof e!="number")throw new Error("Invalid arguments");this._sendRevealRange(new N(e,1,e,1),t,!1,i)}revealPosition(e,t=0){this._revealPosition(e,0,!0,t)}revealPositionInCenter(e,t=0){this._revealPosition(e,1,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._revealPosition(e,2,!0,t)}revealPositionNearTop(e,t=0){this._revealPosition(e,5,!0,t)}_revealPosition(e,t,i,s){if(!V.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new N(e.lineNumber,e.column,e.lineNumber,e.column),t,i,s)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,t="api"){const i=ct.isISelection(e),s=N.isIRange(e);if(!i&&!s)throw new Error("Invalid arguments");if(i)this._setSelectionImpl(e,t);else if(s){const o={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(o,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;const i=new ct(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[i])}revealLines(e,t,i=0){this._revealLines(e,t,0,i)}revealLinesInCenter(e,t,i=0){this._revealLines(e,t,1,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._revealLines(e,t,2,i)}revealLinesNearTop(e,t,i=0){this._revealLines(e,t,5,i)}_revealLines(e,t,i,s){if(typeof e!="number"||typeof t!="number")throw new Error("Invalid arguments");this._sendRevealRange(new N(e,1,t,1),i,!1,s)}revealRange(e,t=0,i=!1,s=!0){this._revealRange(e,i?1:0,s,t)}revealRangeInCenter(e,t=0){this._revealRange(e,1,!0,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._revealRange(e,2,!0,t)}revealRangeNearTop(e,t=0){this._revealRange(e,5,!0,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._revealRange(e,6,!0,t)}revealRangeAtTop(e,t=0){this._revealRange(e,3,!0,t)}_revealRange(e,t,i,s){if(!N.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(N.lift(e),t,i,s)}setSelections(e,t="api",i=0){if(this._modelData){if(!e||e.length===0)throw new Error("Invalid arguments");for(let s=0,o=e.length;s0&&this._modelData.viewModel.restoreCursorState(i):this._modelData.viewModel.restoreCursorState([i]),this._contributions.restoreViewState(t.contributionsState||{});const s=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(s)}}handleInitialized(){var e;(e=this._getViewModel())===null||e===void 0||e.visibleLinesStabilized()}getContribution(e){return this._contributions.get(e)}getActions(){return Array.from(this._actions.values())}getSupportedActions(){let e=this.getActions();return e=e.filter(t=>t.isSupported()),e}getAction(e){return this._actions.get(e)||null}trigger(e,t,i){switch(i=i||{},t){case"compositionStart":this._startComposition();return;case"compositionEnd":this._endComposition(e);return;case"type":{const o=i;this._type(e,o.text||"");return}case"replacePreviousChar":{const o=i;this._compositionType(e,o.text||"",o.replaceCharCnt||0,0,0);return}case"compositionType":{const o=i;this._compositionType(e,o.text||"",o.replacePrevCharCnt||0,o.replaceNextCharCnt||0,o.positionDelta||0);return}case"paste":{const o=i;this._paste(e,o.text||"",o.pasteOnNewLine||!1,o.multicursorText||null,o.mode||null);return}case"cut":this._cut(e);return}const s=this.getAction(t);if(s){Promise.resolve(s.run(i)).then(void 0,_t);return}this._modelData&&(this._triggerEditorCommand(e,t,i)||this._triggerCommand(t,i))}_triggerCommand(e,t){this._commandService.executeCommand(e,t)}_startComposition(){this._modelData&&(this._modelData.viewModel.startComposition(),this._onDidCompositionStart.fire())}_endComposition(e){this._modelData&&(this._modelData.viewModel.endComposition(e),this._onDidCompositionEnd.fire())}_type(e,t){!this._modelData||t.length===0||(e==="keyboard"&&this._onWillType.fire(t),this._modelData.viewModel.type(t,e),e==="keyboard"&&this._onDidType.fire(t))}_compositionType(e,t,i,s,o){this._modelData&&this._modelData.viewModel.compositionType(t,i,s,o,e)}_paste(e,t,i,s,o){if(!this._modelData||t.length===0)return;const r=this._modelData.viewModel,a=r.getSelection().getStartPosition();r.paste(t,i,s,e);const l=r.getSelection().getStartPosition();e==="keyboard"&&this._onDidPaste.fire({range:new N(a.lineNumber,a.column,l.lineNumber,l.column),languageId:o})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){const s=gp.getEditorCommand(t);return s?(i=i||{},i.source=e,this._instantiationService.invokeFunction(o=>{Promise.resolve(s.runEditorCommand(o,this,i)).then(void 0,_t)}),!0):!1}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!this._modelData||this._configuration.options.get(90)?!1:(this._modelData.model.pushStackElement(),!0)}popUndoStop(){return!this._modelData||this._configuration.options.get(90)?!1:(this._modelData.model.popStackElement(),!0)}executeEdits(e,t,i){if(!this._modelData||this._configuration.options.get(90))return!1;let s;return i?Array.isArray(i)?s=()=>i:s=i:s=()=>null,this._modelData.viewModel.executeEdits(e,t,s),!0}executeCommand(e,t){this._modelData&&this._modelData.viewModel.executeCommand(t,e)}executeCommands(e,t){this._modelData&&this._modelData.viewModel.executeCommands(t,e)}createDecorationsCollection(e){return new Cxe(this,e)}changeDecorations(e){return this._modelData?this._modelData.model.changeDecorations(e,this._id):null}getLineDecorations(e){return this._modelData?this._modelData.model.getLineDecorations(e,this._id,CS(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,CS(this._configuration.options)):null}deltaDecorations(e,t){return this._modelData?e.length===0&&t.length===0?e:this._modelData.model.deltaDecorations(e,t,this._id):[]}removeDecorations(e){!this._modelData||e.length===0||this._modelData.model.changeDecorations(t=>{t.deltaDecorations(e,[])})}removeDecorationsByType(e){const t=this._decorationTypeKeysToIds[e];t&&this.deltaDecorations(t,[]),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(143)}createOverviewRuler(e){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.createOverviewRuler(e)}getContainerDomNode(){return this._domElement}getDomNode(){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.domNode.domNode}delegateVerticalScrollbarPointerDown(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateScrollFromMouseWheelEvent(e)}layout(e){this._configuration.observeContainer(e),this.render()}focus(){!this._modelData||!this._modelData.hasRealView||this._modelData.view.focus()}hasTextFocus(){return!this._modelData||!this._modelData.hasRealView?!1:this._modelData.view.isFocused()}hasWidgetFocus(){return this._focusTracker&&this._focusTracker.hasFocus()}addContentWidget(e){const t={widget:e,position:e.getPosition()};this._contentWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a content widget with the same id."),this._contentWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addContentWidget(t)}layoutContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(i)}}removeContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(i)}}addOverlayWidget(e){const t={widget:e,position:e.getPosition()};this._overlayWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting an overlay widget with the same id."),this._overlayWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addOverlayWidget(t)}layoutOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(i)}}removeOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(i)}}addGlyphMarginWidget(e){const t={widget:e,position:e.getPosition()};this._glyphMarginWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a glyph margin widget with the same id."),this._glyphMarginWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addGlyphMarginWidget(t)}layoutGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const i=this._glyphMarginWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutGlyphMarginWidget(i)}}removeGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const i=this._glyphMarginWidgets[t];delete this._glyphMarginWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeGlyphMarginWidget(i)}}changeViewZones(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.change(e)}getTargetAtClientPoint(e,t){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.getTargetAtClientPoint(e,t)}getScrolledVisiblePosition(e){if(!this._modelData||!this._modelData.hasRealView)return null;const t=this._modelData.model.validatePosition(e),i=this._configuration.options,s=i.get(143),o=sh._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),r=this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+s.glyphMarginWidth+s.lineNumbersWidth+s.decorationsWidth-this.getScrollLeft();return{top:o,left:r,height:i.get(66)}}getOffsetForColumn(e,t){return!this._modelData||!this._modelData.hasRealView?-1:this._modelData.view.getOffsetForColumn(e,t)}render(e=!1){!this._modelData||!this._modelData.hasRealView||this._modelData.view.render(!0,e)}setAriaOptions(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.setAriaOptions(e)}applyFontInfo(e){Mn(e,this._configuration.options.get(50))}setBanner(e,t){this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),this._bannerDomNode=e,this._configuration.setReservedHeight(e?t:0),this._bannerDomNode&&this._domElement.prepend(this._bannerDomNode)}_attachModel(e){if(!e){this._modelData=null;return}const t=[];this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setModelLineCount(e.getLineCount());const i=e.onBeforeAttached(),s=new nxe(this._id,this._configuration,e,$P.create(),HP.create(this._configuration.options),a=>qo(a),this.languageConfigurationService,this._themeService,i);t.push(e.onWillDispose(()=>this.setModel(null))),t.push(s.onEvent(a=>{switch(a.kind){case 0:this._onDidContentSizeChange.fire(a);break;case 1:this._editorTextFocus.setValue(a.hasFocus);break;case 2:this._onDidScrollChange.fire(a);break;case 3:this._onDidChangeViewZones.fire();break;case 4:this._onDidChangeHiddenAreas.fire();break;case 5:this._onDidAttemptReadOnlyEdit.fire();break;case 6:{if(a.reachedMaxCursorCount){const u=this.getOption(79),h=m("cursors.maximum","The number of cursors has been limited to {0}. Consider using [find and replace](https://code.visualstudio.com/docs/editor/codebasics#_find-and-replace) for larger changes or increase the editor multi cursor limit setting.",u);this._notificationService.prompt(Zq.Warning,h,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:m("goToSetting","Increase Multi Cursor Limit"),run:()=>{this._commandService.executeCommand("workbench.action.openSettings2",{query:"editor.multiCursorLimit"})}}])}const l=[];for(let u=0,h=a.selections.length;u{this._paste("keyboard",o,r,a,l)},type:o=>{this._type("keyboard",o)},compositionType:(o,r,a,l)=>{this._compositionType("keyboard",o,r,a,l)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:t={paste:(o,r,a,l)=>{const c={text:o,pasteOnNewLine:r,multicursorText:a,mode:l};this._commandService.executeCommand("paste",c)},type:o=>{const r={text:o};this._commandService.executeCommand("type",r)},compositionType:(o,r,a,l)=>{if(a||l){const c={text:o,replacePrevCharCnt:r,replaceNextCharCnt:a,positionDelta:l};this._commandService.executeCommand("compositionType",c)}else{const c={text:o,replaceCharCnt:r};this._commandService.executeCommand("replacePreviousChar",c)}},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};const i=new CD(e.coordinatesConverter);return i.onKeyDown=o=>this._onKeyDown.fire(o),i.onKeyUp=o=>this._onKeyUp.fire(o),i.onContextMenu=o=>this._onContextMenu.fire(o),i.onMouseMove=o=>this._onMouseMove.fire(o),i.onMouseLeave=o=>this._onMouseLeave.fire(o),i.onMouseDown=o=>this._onMouseDown.fire(o),i.onMouseUp=o=>this._onMouseUp.fire(o),i.onMouseDrag=o=>this._onMouseDrag.fire(o),i.onMouseDrop=o=>this._onMouseDrop.fire(o),i.onMouseDropCanceled=o=>this._onMouseDropCanceled.fire(o),i.onMouseWheel=o=>this._onMouseWheel.fire(o),[new BT(t,this._configuration,this._themeService.getColorTheme(),e,i,this._overflowWidgetsDomNode,this._instantiationService),!0]}_postDetachModelCleanup(e){e==null||e.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){if(!this._modelData)return null;const e=this._modelData.model,t=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),t&&this._domElement.contains(t)&&this._domElement.removeChild(t),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),e}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return this._modelData!==null}showDropIndicatorAt(e){const t=[{range:new N(e.lineNumber,e.column,e.lineNumber,e.column),options:sh.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,1)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}setContextValue(e,t){this._contextKeyService.createKey(e,t)}};Tm.dropIntoEditorDecorationOptions=et.register({description:"workbench-dnd-target",className:"dnd-target"});Tm=sh=pxe([wl(3,yt),wl(4,qt),wl(5,gs),wl(6,tt),wl(7,co),wl(8,Dn),wl(9,Eu),wl(10,ao),wl(11,nt)],Tm);class C6 extends Y{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new B(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new B(this._emitterOptions)),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=0}setValue(e){const t=e?2:1;this._value!==t&&(this._value=t,this._value===2?this._onDidChangeToTrue.fire():this._value===1&&this._onDidChangeToFalse.fire())}}class jn extends B{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class vxe extends Y{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=$.editorSimpleInput.bindTo(t),this._editorFocus=$.focus.bindTo(t),this._textInputFocus=$.textInputFocus.bindTo(t),this._editorTextFocus=$.editorTextFocus.bindTo(t),this._tabMovesFocus=$.tabMovesFocus.bindTo(t),this._editorReadonly=$.readOnly.bindTo(t),this._inDiffEditor=$.inDiffEditor.bindTo(t),this._editorColumnSelection=$.columnSelection.bindTo(t),this._hasMultipleSelections=$.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=$.hasNonEmptySelection.bindTo(t),this._canUndo=$.canUndo.bindTo(t),this._canRedo=$.canRedo.bindTo(t),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromConfig())),this._register(this._editor.onDidChangeCursorSelection(()=>this._updateFromSelection())),this._register(this._editor.onDidFocusEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidFocusEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidChangeModel(()=>this._updateFromModel())),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromModel())),this._register(US.onDidChangeTabFocus(i=>this._tabMovesFocus.set(i))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._tabMovesFocus.set(US.getTabFocusMode()),this._editorReadonly.set(e.get(90)),this._inDiffEditor.set(e.get(61)),this._editorColumnSelection.set(e.get(22))}_updateFromSelection(){const e=this._editor.getSelections();e?(this._hasMultipleSelections.set(e.length>1),this._hasNonEmptySelection.set(e.some(t=>!t.isEmpty()))):(this._hasMultipleSelections.reset(),this._hasNonEmptySelection.reset())}_updateFromFocus(){this._editorFocus.set(this._editor.hasWidgetFocus()&&!this._editor.isSimpleWidget),this._editorTextFocus.set(this._editor.hasTextFocus()&&!this._editor.isSimpleWidget),this._textInputFocus.set(this._editor.hasTextFocus())}_updateFromModel(){const e=this._editor.getModel();this._canUndo.set(!!(e&&e.canUndo())),this._canRedo.set(!!(e&&e.canRedo()))}}class yxe extends Y{constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=i,this._langId=$.languageId.bindTo(t),this._hasCompletionItemProvider=$.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=$.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=$.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=$.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=$.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=$.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=$.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=$.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=$.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=$.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=$.hasReferenceProvider.bindTo(t),this._hasRenameProvider=$.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=$.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=$.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=$.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=$.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=$.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=$.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInWalkThrough=$.isInWalkThroughSnippet.bindTo(t);const s=()=>this._update();this._register(e.onDidChangeModel(s)),this._register(e.onDidChangeModelLanguage(s)),this._register(i.completionProvider.onDidChange(s)),this._register(i.codeActionProvider.onDidChange(s)),this._register(i.codeLensProvider.onDidChange(s)),this._register(i.definitionProvider.onDidChange(s)),this._register(i.declarationProvider.onDidChange(s)),this._register(i.implementationProvider.onDidChange(s)),this._register(i.typeDefinitionProvider.onDidChange(s)),this._register(i.hoverProvider.onDidChange(s)),this._register(i.documentHighlightProvider.onDidChange(s)),this._register(i.documentSymbolProvider.onDidChange(s)),this._register(i.referenceProvider.onDidChange(s)),this._register(i.renameProvider.onDidChange(s)),this._register(i.documentFormattingEditProvider.onDidChange(s)),this._register(i.documentRangeFormattingEditProvider.onDidChange(s)),this._register(i.signatureHelpProvider.onDidChange(s)),this._register(i.inlayHintsProvider.onDidChange(s)),s()}dispose(){super.dispose()}reset(){this._contextKeyService.bufferChangeEvents(()=>{this._langId.reset(),this._hasCompletionItemProvider.reset(),this._hasCodeActionsProvider.reset(),this._hasCodeLensProvider.reset(),this._hasDefinitionProvider.reset(),this._hasDeclarationProvider.reset(),this._hasImplementationProvider.reset(),this._hasTypeDefinitionProvider.reset(),this._hasHoverProvider.reset(),this._hasDocumentHighlightProvider.reset(),this._hasDocumentSymbolProvider.reset(),this._hasReferenceProvider.reset(),this._hasRenameProvider.reset(),this._hasDocumentFormattingProvider.reset(),this._hasDocumentSelectionFormattingProvider.reset(),this._hasSignatureHelpProvider.reset(),this._isInWalkThrough.reset()})}_update(){const e=this._editor.getModel();if(!e){this.reset();return}this._contextKeyService.bufferChangeEvents(()=>{this._langId.set(e.getLanguageId()),this._hasCompletionItemProvider.set(this._languageFeaturesService.completionProvider.has(e)),this._hasCodeActionsProvider.set(this._languageFeaturesService.codeActionProvider.has(e)),this._hasCodeLensProvider.set(this._languageFeaturesService.codeLensProvider.has(e)),this._hasDefinitionProvider.set(this._languageFeaturesService.definitionProvider.has(e)),this._hasDeclarationProvider.set(this._languageFeaturesService.declarationProvider.has(e)),this._hasImplementationProvider.set(this._languageFeaturesService.implementationProvider.has(e)),this._hasTypeDefinitionProvider.set(this._languageFeaturesService.typeDefinitionProvider.has(e)),this._hasHoverProvider.set(this._languageFeaturesService.hoverProvider.has(e)),this._hasDocumentHighlightProvider.set(this._languageFeaturesService.documentHighlightProvider.has(e)),this._hasDocumentSymbolProvider.set(this._languageFeaturesService.documentSymbolProvider.has(e)),this._hasReferenceProvider.set(this._languageFeaturesService.referenceProvider.has(e)),this._hasRenameProvider.set(this._languageFeaturesService.renameProvider.has(e)),this._hasSignatureHelpProvider.set(this._languageFeaturesService.signatureHelpProvider.has(e)),this._hasInlayHintsProvider.set(this._languageFeaturesService.inlayHintsProvider.has(e)),this._hasDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.has(e)||this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasMultipleDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.all(e).length+this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._hasMultipleDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._isInWalkThrough.set(e.uri.scheme===it.walkThroughSnippet)})}}class wxe extends Y{constructor(e){super(),this._onChange=this._register(new B),this.onChange=this._onChange.event,this._hasFocus=!1,this._domFocusTracker=this._register(tu(e)),this._register(this._domFocusTracker.onDidFocus(()=>{this._hasFocus=!0,this._onChange.fire(void 0)})),this._register(this._domFocusTracker.onDidBlur(()=>{this._hasFocus=!1,this._onChange.fire(void 0)}))}hasFocus(){return this._hasFocus}}class Cxe{get length(){return this._decorationIds.length}constructor(e,t){this._editor=e,this._decorationIds=[],this._isChangingDecorations=!1,Array.isArray(t)&&t.length>0&&this.set(t)}onDidChange(e,t,i){return this._editor.onDidChangeModelDecorations(s=>{this._isChangingDecorations||e.call(t,s)},i)}getRange(e){return!this._editor.hasModel()||e>=this._decorationIds.length?null:this._editor.getModel().getDecorationRange(this._decorationIds[e])}getRanges(){if(!this._editor.hasModel())return[];const e=this._editor.getModel(),t=[];for(const i of this._decorationIds){const s=e.getDecorationRange(i);s&&t.push(s)}return t}has(e){return this._decorationIds.includes(e.id)}clear(){this._decorationIds.length!==0&&this.set([])}set(e){try{this._isChangingDecorations=!0,this._editor.changeDecorations(t=>{this._decorationIds=t.deltaDecorations(this._decorationIds,e)})}finally{this._isChangingDecorations=!1}return this._decorationIds}}const Sxe=encodeURIComponent("");function K2(n){return Sxe+encodeURIComponent(n.toString())+xxe}const Lxe=encodeURIComponent('');function kxe(n){return Lxe+encodeURIComponent(n.toString())+Dxe}Nr((n,e)=>{const t=n.getColor(za);t&&e.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${K2(t)}") repeat-x bottom left; }`);const i=n.getColor(So);i&&e.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${K2(i)}") repeat-x bottom left; }`);const s=n.getColor(Es);s&&e.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${K2(s)}") repeat-x bottom left; }`);const o=n.getColor(eve);o&&e.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${kxe(o)}") no-repeat bottom left; }`);const r=n.getColor(oye);r&&e.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${r.rgba.a}; }`)});var Exe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Axe=function(n,e){return function(t,i){e(t,i,n)}},Ixe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,[])).next())})};let JT=class extends Y{constructor(e){super(),this._themeService=e,this._onWillCreateCodeEditor=this._register(new B),this._onCodeEditorAdd=this._register(new B),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new B),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new B),this._onDiffEditorAdd=this._register(new B),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new B),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._codeEditorOpenHandlers=new ks,this._modelProperties=new Map,this._codeEditors=Object.create(null),this._diffEditors=Object.create(null),this._globalStyleSheet=null}willCreateCodeEditor(){this._onWillCreateCodeEditor.fire()}addCodeEditor(e){this._codeEditors[e.getId()]=e,this._onCodeEditorAdd.fire(e)}removeCodeEditor(e){delete this._codeEditors[e.getId()]&&this._onCodeEditorRemove.fire(e)}listCodeEditors(){return Object.keys(this._codeEditors).map(e=>this._codeEditors[e])}willCreateDiffEditor(){this._onWillCreateDiffEditor.fire()}addDiffEditor(e){this._diffEditors[e.getId()]=e,this._onDiffEditorAdd.fire(e)}listDiffEditors(){return Object.keys(this._diffEditors).map(e=>this._diffEditors[e])}getFocusedCodeEditor(){let e=null;const t=this.listCodeEditors();for(const i of t){if(i.hasTextFocus())return i;i.hasWidgetFocus()&&(e=i)}return e}removeDecorationType(e){const t=this._decorationOptionProviders.get(e);t&&(t.refCount--,t.refCount<=0&&(this._decorationOptionProviders.delete(e),t.dispose(),this.listCodeEditors().forEach(i=>i.removeDecorationsByType(e))))}setModelProperty(e,t,i){const s=e.toString();let o;this._modelProperties.has(s)?o=this._modelProperties.get(s):(o=new Map,this._modelProperties.set(s,o)),o.set(t,i)}getModelProperty(e,t){const i=e.toString();if(this._modelProperties.has(i))return this._modelProperties.get(i).get(t)}openCodeEditor(e,t,i){return Ixe(this,void 0,void 0,function*(){for(const s of this._codeEditorOpenHandlers){const o=yield s(e,t,i);if(o!==null)return o}return null})}registerCodeEditorOpenHandler(e){const t=this._codeEditorOpenHandlers.unshift(e);return Ze(t)}};JT=Exe([Axe(0,co)],JT);var Txe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},S6=function(n,e){return function(t,i){e(t,i,n)}},Nxe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let lx=class extends JT{constructor(e,t){super(t),this._register(this.onCodeEditorAdd(()=>this._checkContextKey())),this._register(this.onCodeEditorRemove(()=>this._checkContextKey())),this._editorIsOpen=e.createKey("editorIsOpen",!1),this._activeCodeEditor=null,this._register(this.registerCodeEditorOpenHandler((i,s,o)=>Nxe(this,void 0,void 0,function*(){return s?this.doOpenEditor(s,i):null})))}_checkContextKey(){let e=!1;for(const t of this.listCodeEditors())if(!t.isSimpleWidget){e=!0;break}this._editorIsOpen.set(e)}setActiveCodeEditor(e){this._activeCodeEditor=e}getActiveCodeEditor(){return this._activeCodeEditor}doOpenEditor(e,t){if(!this.findModel(e,t.resource)){if(t.resource){const o=t.resource.scheme;if(o===it.http||o===it.https)return oj(t.resource.toString()),e}return null}const s=t.options?t.options.selection:null;if(s)if(typeof s.endLineNumber=="number"&&typeof s.endColumn=="number")e.setSelection(s),e.revealRangeInCenter(s,1);else{const o={lineNumber:s.startLineNumber,column:s.startColumn};e.setPosition(o),e.revealPositionInCenter(o,1)}return e}findModel(e,t){const i=e.getModel();return i&&i.uri.toString()!==t.toString()?null:i}};lx=Txe([S6(0,tt),S6(1,co)],lx);gt(qt,lx,0);const r0=at("layoutService");var Qq=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Jq=function(n,e){return function(t,i){e(t,i,n)}};let cx=class{get dimension(){return this._dimension||(this._dimension=nD(window.document.body)),this._dimension}get hasContainer(){return!1}get container(){throw new Error("ILayoutService.container is not available in the standalone editor!")}focus(){var e;(e=this._codeEditorService.getFocusedCodeEditor())===null||e===void 0||e.focus()}constructor(e){this._codeEditorService=e,this.onDidLayout=ue.None,this.offset={top:0,quickPickTop:0}}};cx=Qq([Jq(0,qt)],cx);let eN=class extends cx{get hasContainer(){return!1}get container(){return this._container}constructor(e,t){super(t),this._container=e}};eN=Qq([Jq(1,qt)],eN);gt(r0,cx,1);const eG=at("dialogService");var Rxe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},x6=function(n,e){return function(t,i){e(t,i,n)}},gw=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function pw(n){return n.scheme===it.file?n.fsPath:n.path}let tG=0;class mw{constructor(e,t,i,s,o,r,a){this.id=++tG,this.type=0,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabel=t,this.strResource=i,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.groupId=s,this.groupOrder=o,this.sourceId=r,this.sourceOrder=a,this.isValid=!0}setValid(e){this.isValid=e}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.isValid?" VALID":"INVALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class L6{constructor(e,t){this.resourceLabel=e,this.reason=t}}class D6{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,s]of this.elements)(s.reason===0?e:t).push(s.resourceLabel);const i=[];return e.length>0&&i.push(m({key:"externalRemoval",comment:["{0} is a list of filenames"]},"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&i.push(m({key:"noParallelUniverses",comment:["{0} is a list of filenames"]},"The following files have been modified in an incompatible way: {0}.",t.join(", "))),i.join(` -`)}get size(){return this.elements.size}has(e){return this.elements.has(e)}set(e,t){this.elements.set(e,t)}delete(e){return this.elements.delete(e)}}class Mxe{constructor(e,t,i,s,o,r,a){this.id=++tG,this.type=1,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=i,this.groupId=s,this.groupOrder=o,this.sourceId=r,this.sourceOrder=a,this.removedResources=null,this.invalidatedResources=null}canSplit(){return typeof this.actual.split=="function"}removeResource(e,t,i){this.removedResources||(this.removedResources=new D6),this.removedResources.has(t)||this.removedResources.set(t,new L6(e,i))}setValid(e,t,i){i?this.invalidatedResources&&(this.invalidatedResources.delete(t),this.invalidatedResources.size===0&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new D6),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new L6(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class iG{constructor(e,t){this.resourceLabel=e,this.strResource=t,this._past=[],this._future=[],this.locked=!1,this.versionId=1}dispose(){for(const e of this._past)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);for(const e of this._future)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);this.versionId++}toString(){const e=[];e.push(`* ${this.strResource}:`);for(let t=0;t=0;t--)e.push(` * [REDO] ${this._future[t]}`);return e.join(` -`)}flushAllElements(){this._past=[],this._future=[],this.versionId++}_setElementValidFlag(e,t){e.type===1?e.setValid(this.resourceLabel,this.strResource,t):e.setValid(t)}setElementsValidFlag(e,t){for(const i of this._past)t(i.actual)&&this._setElementValidFlag(i,e);for(const i of this._future)t(i.actual)&&this._setElementValidFlag(i,e)}pushElement(e){for(const t of this._future)t.type===1&&t.removeResource(this.resourceLabel,this.strResource,1);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let i=0,s=this._past.length;i=0;i--)t.push(this._future[i].id);return new jq(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,s=0,o=-1;for(let a=0,l=this._past.length;a=t||c.id!==e.elements[s])&&(i=!1,o=0),!i&&c.type===1&&c.removeResource(this.resourceLabel,this.strResource,0)}let r=-1;for(let a=this._future.length-1;a>=0;a--,s++){const l=this._future[a];i&&(s>=t||l.id!==e.elements[s])&&(i=!1,r=a),!i&&l.type===1&&l.removeResource(this.resourceLabel,this.strResource,0)}o!==-1&&(this._past=this._past.slice(0,o)),r!==-1&&(this._future=this._future.slice(r+1)),this.versionId++}getElements(){const e=[],t=[];for(const i of this._past)e.push(i.actual);for(const i of this._future)t.push(i.actual);return{past:e,future:t}}getClosestPastElement(){return this._past.length===0?null:this._past[this._past.length-1]}getSecondClosestPastElement(){return this._past.length<2?null:this._past[this._past.length-2]}getClosestFutureElement(){return this._future.length===0?null:this._future[this._future.length-1]}hasPastElements(){return this._past.length>0}hasFutureElements(){return this._future.length>0}splitPastWorkspaceElement(e,t){for(let i=this._past.length-1;i>=0;i--)if(this._past[i]===e){t.has(this.strResource)?this._past[i]=t.get(this.strResource):this._past.splice(i,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let i=this._future.length-1;i>=0;i--)if(this._future[i]===e){t.has(this.strResource)?this._future[i]=t.get(this.strResource):this._future.splice(i,1);break}this.versionId++}moveBackward(e){this._past.pop(),this._future.push(e),this.versionId++}moveForward(e){this._future.pop(),this._past.push(e),this.versionId++}}class Y2{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,i=this.editStacks.length;tt.sourceOrder)&&(t=r,i=s)}return[t,i]}canUndo(e){if(e instanceof Ra){const[,i]=this._findClosestUndoElementWithSource(e.id);return!!i}const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).hasPastElements():!1}_onError(e,t){_t(e);for(const i of t.strResources)this.removeElements(i);this._notificationService.error(e)}_acquireLocks(e){for(const t of e.editStacks)if(t.locked)throw new Error("Cannot acquire edit stack lock");for(const t of e.editStacks)t.locked=!0;return()=>{for(const t of e.editStacks)t.locked=!1}}_safeInvokeWithLocks(e,t,i,s,o){const r=this._acquireLocks(i);let a;try{a=t()}catch(l){return r(),s.dispose(),this._onError(l,e)}return a?a.then(()=>(r(),s.dispose(),o()),l=>(r(),s.dispose(),this._onError(l,e))):(r(),s.dispose(),o())}_invokeWorkspacePrepare(e){return gw(this,void 0,void 0,function*(){if(typeof e.actual.prepareUndoRedo>"u")return Y.None;const t=e.actual.prepareUndoRedo();return typeof t>"u"?Y.None:t})}_invokeResourcePrepare(e,t){if(e.actual.type!==1||typeof e.actual.prepareUndoRedo>"u")return t(Y.None);const i=e.actual.prepareUndoRedo();return i?Xfe(i)?t(i):i.then(s=>t(s)):t(Y.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||nG);return new Y2(t)}_tryToSplitAndUndo(e,t,i,s){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(s),new _w(this._undo(e,0,!0));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(s),new _w}_checkWorkspaceUndo(e,t,i,s){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,m({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not undo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(s&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,m({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not undo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const o=[];for(const a of i.editStacks)a.getClosestPastElement()!==t&&o.push(a.resourceLabel);if(o.length>0)return this._tryToSplitAndUndo(e,t,null,m({key:"cannotWorkspaceUndoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const r=[];for(const a of i.editStacks)a.locked&&r.push(a.resourceLabel);return r.length>0?this._tryToSplitAndUndo(e,t,null,m({key:"cannotWorkspaceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,r.join(", "))):i.isValid()?null:this._tryToSplitAndUndo(e,t,null,m({key:"cannotWorkspaceUndoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceUndo(e,t,i){const s=this._getAffectedEditStacks(t),o=this._checkWorkspaceUndo(e,t,s,!1);return o?o.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,s,i)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(const[,t]of this._editStacks){const i=t.getClosestPastElement();if(i){if(i===e){const s=t.getSecondClosestPastElement();if(s&&s.groupId===e.groupId)return!0}if(i.groupId===e.groupId)return!0}}return!1}_confirmAndExecuteWorkspaceUndo(e,t,i,s){return gw(this,void 0,void 0,function*(){if(t.canSplit()&&!this._isPartOfUndoGroup(t)){let a;(function(d){d[d.All=0]="All",d[d.This=1]="This",d[d.Cancel=2]="Cancel"})(a||(a={}));const{result:l}=yield this._dialogService.prompt({type:bi.Info,message:m("confirmWorkspace","Would you like to undo '{0}' across all files?",t.label),buttons:[{label:m({key:"ok",comment:["{0} denotes a number that is > 1, && denotes a mnemonic"]},"&&Undo in {0} Files",i.editStacks.length),run:()=>a.All},{label:m({key:"nok",comment:["&& denotes a mnemonic"]},"Undo this &&File"),run:()=>a.This}],cancelButton:{run:()=>a.Cancel}});if(l===a.Cancel)return;if(l===a.This)return this._splitPastWorkspaceElement(t,null),this._undo(e,0,!0);const c=this._checkWorkspaceUndo(e,t,i,!1);if(c)return c.returnValue;s=!0}let o;try{o=yield this._invokeWorkspacePrepare(t)}catch(a){return this._onError(a,t)}const r=this._checkWorkspaceUndo(e,t,i,!0);if(r)return o.dispose(),r.returnValue;for(const a of i.editStacks)a.moveBackward(t);return this._safeInvokeWithLocks(t,()=>t.actual.undo(),i,o,()=>this._continueUndoInGroup(t.groupId,s))})}_resourceUndo(e,t,i){if(!t.isValid){e.flushAllElements();return}if(e.locked){const s=m({key:"cannotResourceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation."]},"Could not undo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(s);return}return this._invokeResourcePrepare(t,s=>(e.moveBackward(t),this._safeInvokeWithLocks(t,()=>t.actual.undo(),new Y2([e]),s,()=>this._continueUndoInGroup(t.groupId,i))))}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[s,o]of this._editStacks){const r=o.getClosestPastElement();r&&r.groupId===e&&(!t||r.groupOrder>t.groupOrder)&&(t=r,i=s)}return[t,i]}_continueUndoInGroup(e,t){if(!e)return;const[,i]=this._findClosestUndoElementInGroup(e);if(i)return this._undo(i,0,t)}undo(e){if(e instanceof Ra){const[,t]=this._findClosestUndoElementWithSource(e.id);return t?this._undo(t,e.id,!1):void 0}return typeof e=="string"?this._undo(e,0,!1):this._undo(this.getUriComparisonKey(e),0,!1)}_undo(e,t=0,i){if(!this._editStacks.has(e))return;const s=this._editStacks.get(e),o=s.getClosestPastElement();if(!o)return;if(o.groupId){const[a,l]=this._findClosestUndoElementInGroup(o.groupId);if(o!==a&&l)return this._undo(l,t,i)}if((o.sourceId!==t||o.confirmBeforeUndo)&&!i)return this._confirmAndContinueUndo(e,t,o);try{return o.type===1?this._workspaceUndo(e,o,i):this._resourceUndo(s,o,i)}finally{}}_confirmAndContinueUndo(e,t,i){return gw(this,void 0,void 0,function*(){if((yield this._dialogService.confirm({message:m("confirmDifferentSource","Would you like to undo '{0}'?",i.label),primaryButton:m({key:"confirmDifferentSource.yes",comment:["&& denotes a mnemonic"]},"&&Yes"),cancelButton:m("confirmDifferentSource.no","No")})).confirmed)return this._undo(e,t,!0)})}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[s,o]of this._editStacks){const r=o.getClosestFutureElement();r&&r.sourceId===e&&(!t||r.sourceOrder0)return this._tryToSplitAndRedo(e,t,null,m({key:"cannotWorkspaceRedoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const r=[];for(const a of i.editStacks)a.locked&&r.push(a.resourceLabel);return r.length>0?this._tryToSplitAndRedo(e,t,null,m({key:"cannotWorkspaceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,r.join(", "))):i.isValid()?null:this._tryToSplitAndRedo(e,t,null,m({key:"cannotWorkspaceRedoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceRedo(e,t){const i=this._getAffectedEditStacks(t),s=this._checkWorkspaceRedo(e,t,i,!1);return s?s.returnValue:this._executeWorkspaceRedo(e,t,i)}_executeWorkspaceRedo(e,t,i){return gw(this,void 0,void 0,function*(){let s;try{s=yield this._invokeWorkspacePrepare(t)}catch(r){return this._onError(r,t)}const o=this._checkWorkspaceRedo(e,t,i,!0);if(o)return s.dispose(),o.returnValue;for(const r of i.editStacks)r.moveForward(t);return this._safeInvokeWithLocks(t,()=>t.actual.redo(),i,s,()=>this._continueRedoInGroup(t.groupId))})}_resourceRedo(e,t){if(!t.isValid){e.flushAllElements();return}if(e.locked){const i=m({key:"cannotResourceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation."]},"Could not redo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(i);return}return this._invokeResourcePrepare(t,i=>(e.moveForward(t),this._safeInvokeWithLocks(t,()=>t.actual.redo(),new Y2([e]),i,()=>this._continueRedoInGroup(t.groupId))))}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[s,o]of this._editStacks){const r=o.getClosestFutureElement();r&&r.groupId===e&&(!t||r.groupOrderUP(n,t))}function Oxe(n){let e;const t=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(n.fragment);return t&&(e={startLineNumber:parseInt(t[1]),startColumn:t[2]?parseInt(t[2]):1,endLineNumber:t[4]?parseInt(t[4]):void 0,endColumn:t[4]?t[5]?parseInt(t[5]):1:void 0},n=n.with({fragment:""})),{selection:e,uri:n}}var Fxe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},E6=function(n,e){return function(t,i){e(t,i,n)}};const rG=at("ILanguageFeatureDebounceService");var dx;(function(n){const e=new WeakMap;let t=0;function i(s){let o=e.get(s);return o===void 0&&(o=++t,e.set(s,o)),o}n.of=i})(dx||(dx={}));class Bxe{constructor(e){this._default=e}get(e){return this._default}update(e,t){return this._default}default(){return this._default}}class Wxe{constructor(e,t,i,s,o,r){this._logService=e,this._name=t,this._registry=i,this._default=s,this._min=o,this._max=r,this._cache=new oP(50,.7)}_key(e){return e.id+this._registry.all(e).reduce((t,i)=>uD(dx.of(i),t),0)}get(e){const t=this._key(e),i=this._cache.get(t);return i?go(i.value,this._min,this._max):this.default()}update(e,t){const i=this._key(e);let s=this._cache.get(i);s||(s=new Pxe(6),this._cache.set(i,s));const o=go(s.update(t),this._min,this._max);return UP(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${o}ms`),o}_overall(){const e=new sG;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){const e=this._overall()|0||this._default;return go(e,this._min,this._max)}}let iN=class{constructor(e,t){this._logService=e,this._data=new Map,this._isDev=t.isExtensionDevelopment||!t.isBuilt}for(e,t,i){var s,o,r;const a=(s=i==null?void 0:i.min)!==null&&s!==void 0?s:50,l=(o=i==null?void 0:i.max)!==null&&o!==void 0?o:Math.pow(a,2),c=(r=i==null?void 0:i.key)!==null&&r!==void 0?r:void 0,d=`${dx.of(e)},${a}${c?","+c:""}`;let u=this._data.get(d);return u||(this._isDev?u=new Wxe(this._logService,t,e,this._overallAverage()|0||a*1.5,a,l):(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),u=new Bxe(a*1.5)),this._data.set(d,u)),u}_overallAverage(){const e=new sG;for(const t of this._data.values())e.update(t.default());return e.value}};iN=Fxe([E6(0,Sc),E6(1,oG)],iN);gt(rG,iN,1);var Vxe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Z2=function(n,e){return function(t,i){e(t,i,n)}};let nN=class{constructor(e,t,i,s){this._legend=e,this._themeService=t,this._languageService=i,this._logService=s,this._hasWarnedOverlappingTokens=!1,this._hasWarnedInvalidLengthTokens=!1,this._hasWarnedInvalidEditStart=!1,this._hashTable=new Pl}getMetadata(e,t,i){const s=this._languageService.languageIdCodec.encodeLanguageId(i),o=this._hashTable.get(e,t,s);let r;if(o)r=o.metadata,this._logService.getLevel()===Cn.Trace&&this._logService.trace(`SemanticTokensProviderStyling [CACHED] ${e} / ${t}: foreground ${qs.getForeground(r)}, fontStyle ${qs.getFontStyle(r).toString(2)}`);else{let a=this._legend.tokenTypes[e];const l=[];if(a){let c=t;for(let u=0;c>0&&u>1;c>0&&this._logService.getLevel()===Cn.Trace&&(this._logService.trace(`SemanticTokensProviderStyling: unknown token modifier index: ${t.toString(2)} for legend: ${JSON.stringify(this._legend.tokenModifiers)}`),l.push("not-in-legend"));const d=this._themeService.getColorTheme().getTokenStyleMetadata(a,l,i);if(typeof d>"u")r=2147483647;else{if(r=0,typeof d.italic<"u"){const u=(d.italic?1:0)<<11;r|=u|1}if(typeof d.bold<"u"){const u=(d.bold?2:0)<<11;r|=u|2}if(typeof d.underline<"u"){const u=(d.underline?4:0)<<11;r|=u|4}if(typeof d.strikethrough<"u"){const u=(d.strikethrough?8:0)<<11;r|=u|8}if(d.foreground){const u=d.foreground<<15;r|=u|16}r===0&&(r=2147483647)}}else this._logService.getLevel()===Cn.Trace&&this._logService.trace(`SemanticTokensProviderStyling: unknown token type index: ${e} for legend: ${JSON.stringify(this._legend.tokenTypes)}`),r=2147483647,a="not-in-legend";this._hashTable.add(e,t,s,r),this._logService.getLevel()===Cn.Trace&&this._logService.trace(`SemanticTokensProviderStyling ${e} (${a}) / ${t} (${l.join(" ")}): foreground ${qs.getForeground(r)}, fontStyle ${qs.getFontStyle(r).toString(2)}`)}return r}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,console.warn(`Overlapping semantic tokens detected at lineNumber ${e}, column ${t}`))}warnInvalidLengthSemanticTokens(e,t){this._hasWarnedInvalidLengthTokens||(this._hasWarnedInvalidLengthTokens=!0,console.warn(`Semantic token with invalid length detected at lineNumber ${e}, column ${t}`))}warnInvalidEditStart(e,t,i,s,o){this._hasWarnedInvalidEditStart||(this._hasWarnedInvalidEditStart=!0,console.warn(`Invalid semantic tokens edit detected (previousResultId: ${e}, resultId: ${t}) at edit #${i}: The provided start offset ${s} is outside the previous data (length ${o}).`))}};nN=Vxe([Z2(1,co),Z2(2,Ni),Z2(3,Sc)],nN);class zxe{constructor(e,t,i,s){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=i,this.metadata=s,this.next=null}}class Pl{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=Pl._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=this._growCount){const o=this._elements;this._currentLengthIndex++,this._currentLength=Pl._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},X2=function(n,e){return function(t,i){e(t,i,n)}};let sN=class extends Y{constructor(e,t,i){super(),this._themeService=e,this._logService=t,this._languageService=i,this._caches=new WeakMap,this._register(this._themeService.onDidColorThemeChange(()=>{this._caches=new WeakMap}))}getStyling(e){return this._caches.has(e)||this._caches.set(e,new nN(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};sN=$xe([X2(0,co),X2(1,Sc),X2(2,Ni)],sN);gt(Hxe,sN,1);var A6=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const bw="**",I6="/",DC="[/\\\\]",kC="[^/\\\\]",Uxe=/\//g;function T6(n,e){switch(n){case 0:return"";case 1:return`${kC}*?`;default:return`(?:${DC}|${kC}+${DC}${e?`|${DC}${kC}+`:""})*?`}}function N6(n,e){if(!n)return[];const t=[];let i=!1,s=!1,o="";for(const r of n){switch(r){case e:if(!i&&!s){t.push(o),o="";continue}break;case"{":i=!0;break;case"}":i=!1;break;case"[":s=!0;break;case"]":s=!1;break}o+=r}return o&&t.push(o),t}function aG(n){if(!n)return"";let e="";const t=N6(n,I6);if(t.every(i=>i===bw))e=".*";else{let i=!1;t.forEach((s,o)=>{if(s===bw){if(i)return;e+=T6(2,o===t.length-1)}else{let r=!1,a="",l=!1,c="";for(const d of s){if(d!=="}"&&r){a+=d;continue}if(l&&(d!=="]"||!c)){let u;d==="-"?u=d:(d==="^"||d==="!")&&!c?u="^":d===I6?u="":u=xr(d),c+=u;continue}switch(d){case"{":r=!0;continue;case"[":l=!0;continue;case"}":{const h=`(?:${N6(a,",").map(f=>aG(f)).join("|")})`;e+=h,r=!1,a="";break}case"]":{e+="["+c+"]",l=!1,c="";break}case"?":e+=kC;continue;case"*":e+=T6(1);continue;default:e+=xr(d)}}ojP(a,e)).filter(a=>a!==Qa),n),i=t.length;if(!i)return Qa;if(i===1)return t[0];const s=function(a,l){for(let c=0,d=t.length;c!!a.allBasenames);o&&(s.allBasenames=o.allBasenames);const r=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return r.length&&(s.allPaths=r),s}function O6(n,e,t){const i=kd===Fi.sep,s=i?n:n.replace(Uxe,kd),o=kd+s,r=Fi.sep+n;let a;return t?a=function(l,c){return typeof l=="string"&&(l===s||l.endsWith(o)||!i&&(l===n||l.endsWith(r)))?e:null}:a=function(l,c){return typeof l=="string"&&(l===s||!i&&l===n)?e:null},a.allPaths=[(t?"*/":"./")+n],a}function eLe(n){try{const e=new RegExp(`^${aG(n)}$`);return function(t){return e.lastIndex=0,typeof t=="string"&&e.test(t)?n:null}}catch{return Qa}}function tLe(n,e,t){return!n||typeof e!="string"?!1:lG(n)(e,void 0,t)}function lG(n,e={}){if(!n)return M6;if(typeof n=="string"||iLe(n)){const t=jP(n,e);if(t===Qa)return M6;const i=function(s,o){return!!t(s,o)};return t.allBasenames&&(i.allBasenames=t.allBasenames),t.allPaths&&(i.allPaths=t.allPaths),i}return nLe(n,e)}function iLe(n){const e=n;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}function nLe(n,e){const t=cG(Object.getOwnPropertyNames(n).map(a=>sLe(a,n[a],e)).filter(a=>a!==Qa)),i=t.length;if(!i)return Qa;if(!t.some(a=>!!a.requiresSiblings)){if(i===1)return t[0];const a=function(d,u){let h;for(let f=0,g=t.length;f!!d.allBasenames);l&&(a.allBasenames=l.allBasenames);const c=t.reduce((d,u)=>u.allPaths?d.concat(u.allPaths):d,[]);return c.length&&(a.allPaths=c),a}const s=function(a,l,c){let d,u;for(let h=0,f=t.length;h!!a.allBasenames);o&&(s.allBasenames=o.allBasenames);const r=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return r.length&&(s.allPaths=r),s}function sLe(n,e,t){if(e===!1)return Qa;const i=jP(n,t);if(i===Qa)return Qa;if(typeof e=="boolean")return i;if(e){const s=e.when;if(typeof s=="string"){const o=(r,a,l,c)=>{if(!c||!i(r,a))return null;const d=s.replace("$(basename)",()=>l),u=c(d);return cT(u)?u.then(h=>h?n:null):u?n:null};return o.requiresSiblings=!0,o}}return i}function cG(n,e){const t=n.filter(a=>!!a.basenames);if(t.length<2)return n;const i=t.reduce((a,l)=>{const c=l.basenames;return c?a.concat(c):a},[]);let s;if(e){s=[];for(let a=0,l=i.length;a{const c=l.patterns;return c?a.concat(c):a},[]);const o=function(a,l){if(typeof a!="string")return null;if(!l){let d;for(d=a.length;d>0;d--){const u=a.charCodeAt(d-1);if(u===47||u===92)break}l=a.substr(d)}const c=i.indexOf(l);return c!==-1?s[c]:null};o.basenames=i,o.patterns=s,o.allBasenames=i;const r=n.filter(a=>!a.basenames);return r.push(o),r}function dG(n,e,t,i,s,o){if(Array.isArray(n)){let r=0;for(const a of n){const l=dG(a,e,t,i,s,o);if(l===10)return l;l>r&&(r=l)}return r}else{if(typeof n=="string")return i?n==="*"?5:n===t?10:0:0;if(n){const{language:r,pattern:a,scheme:l,hasAccessToAllModels:c,notebookType:d}=n;if(!i&&!c)return 0;d&&s&&(e=s);let u=0;if(l)if(l===e.scheme)u=10;else if(l==="*")u=5;else return 0;if(r)if(r===t)u=10;else if(r==="*")u=Math.max(u,5);else return 0;if(d)if(d===o)u=10;else if(d==="*"&&o!==void 0)u=Math.max(u,5);else return 0;if(a){let h;if(typeof a=="string"?h=a:h=Object.assign(Object.assign({},a),{base:CU(a.base)}),h===e.fsPath||tLe(h,e.fsPath))u=10;else return 0}return u}else return 0}}function uG(n){return typeof n=="string"?!1:Array.isArray(n)?n.every(uG):!!n.exclusive}class F6{constructor(e,t,i,s){this.uri=e,this.languageId=t,this.notebookUri=i,this.notebookType=s}equals(e){var t,i;return this.notebookType===e.notebookType&&this.languageId===e.languageId&&this.uri.toString()===e.uri.toString()&&((t=this.notebookUri)===null||t===void 0?void 0:t.toString())===((i=e.notebookUri)===null||i===void 0?void 0:i.toString())}}class ai{constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new B,this.onDidChange=this._onDidChange.event}register(e,t){let i={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(i),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),Ze(()=>{if(i){const s=this._entries.indexOf(i);s>=0&&(this._entries.splice(s,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),i=void 0)}})}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e);const t=[];for(const i of this._entries)i._score>0&&t.push(i.provider);return t}ordered(e){const t=[];return this._orderedForEach(e,i=>t.push(i.provider)),t}orderedGroups(e){const t=[];let i,s;return this._orderedForEach(e,o=>{i&&s===o._score?i.push(o.provider):(s=o._score,i=[o.provider],t.push(i))}),t}_orderedForEach(e,t){this._updateScores(e);for(const i of this._entries)i._score>0&&t(i)}_updateScores(e){var t,i;const s=(t=this._notebookInfoResolver)===null||t===void 0?void 0:t.call(this,e.uri),o=s?new F6(e.uri,e.getLanguageId(),s.uri,s.type):new F6(e.uri,e.getLanguageId(),void 0,void 0);if(!(!((i=this._lastCandidate)===null||i===void 0)&&i.equals(o))){this._lastCandidate=o;for(const r of this._entries)if(r._score=dG(r.selector,o.uri,o.languageId,G0e(e),o.notebookUri,o.notebookType),uG(r.selector)&&r._score>0){for(const a of this._entries)a._score=0;r._score=1e3;break}this._entries.sort(ai._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._scoret._score?-1:m_(e.selector)&&!m_(t.selector)?1:!m_(e.selector)&&m_(t.selector)?-1:e._timet._time?-1:0}}function m_(n){return typeof n=="string"?!1:Array.isArray(n)?n.some(m_):!!n.isBuiltin}class oLe{constructor(){this.referenceProvider=new ai(this._score.bind(this)),this.renameProvider=new ai(this._score.bind(this)),this.codeActionProvider=new ai(this._score.bind(this)),this.definitionProvider=new ai(this._score.bind(this)),this.typeDefinitionProvider=new ai(this._score.bind(this)),this.declarationProvider=new ai(this._score.bind(this)),this.implementationProvider=new ai(this._score.bind(this)),this.documentSymbolProvider=new ai(this._score.bind(this)),this.inlayHintsProvider=new ai(this._score.bind(this)),this.colorProvider=new ai(this._score.bind(this)),this.codeLensProvider=new ai(this._score.bind(this)),this.documentFormattingEditProvider=new ai(this._score.bind(this)),this.documentRangeFormattingEditProvider=new ai(this._score.bind(this)),this.onTypeFormattingEditProvider=new ai(this._score.bind(this)),this.signatureHelpProvider=new ai(this._score.bind(this)),this.hoverProvider=new ai(this._score.bind(this)),this.documentHighlightProvider=new ai(this._score.bind(this)),this.selectionRangeProvider=new ai(this._score.bind(this)),this.foldingRangeProvider=new ai(this._score.bind(this)),this.linkProvider=new ai(this._score.bind(this)),this.inlineCompletionsProvider=new ai(this._score.bind(this)),this.completionProvider=new ai(this._score.bind(this)),this.linkedEditingRangeProvider=new ai(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new ai(this._score.bind(this)),this.documentSemanticTokensProvider=new ai(this._score.bind(this)),this.documentOnDropEditProvider=new ai(this._score.bind(this)),this.documentPasteEditProvider=new ai(this._score.bind(this))}_score(e){var t;return(t=this._notebookTypeResolver)===null||t===void 0?void 0:t.call(this,e)}}gt(nt,oLe,1);const hG=at("IWorkspaceEditService");class qP{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(ef.is(t))return ef.lift(t);if(Dp.is(t))return Dp.lift(t);throw new Error("Unsupported edit")})}}class ef extends qP{static is(e){return e instanceof ef?!0:Ds(e)&&je.isUri(e.resource)&&Ds(e.textEdit)}static lift(e){return e instanceof ef?e:new ef(e.resource,e.textEdit,e.versionId,e.metadata)}constructor(e,t,i=void 0,s){super(s),this.resource=e,this.textEdit=t,this.versionId=i}}class Dp extends qP{static is(e){return e instanceof Dp?!0:Ds(e)&&(!!e.newResource||!!e.oldResource)}static lift(e){return e instanceof Dp?e:new Dp(e.oldResource,e.newResource,e.options,e.metadata)}constructor(e,t,i={},s){super(s),this.oldResource=e,this.newResource=t,this.options=i}}const qn={enableSplitViewResizing:!0,splitViewDefaultRatio:.5,renderSideBySide:!0,renderMarginRevertIcon:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit",diffAlgorithm:"advanced",accessibilityVerbose:!1,experimental:{showMoves:!1,showEmptyDecorations:!0},hideUnchangedRegions:{enabled:!1,contextLineCount:3,minimumLineCount:3,revealLineCount:20},isInEmbeddedEditor:!1,onlyShowAccessibleDiffViewer:!1,renderSideBySideInlineBreakpoint:900,useInlineViewWhenSpaceIsLimited:!0},rLe=Object.freeze({id:"editor",order:5,type:"object",title:m("editorConfigurationTitle","Editor"),scope:5}),ux=Object.assign(Object.assign({},rLe),{properties:{"editor.tabSize":{type:"number",default:In.tabSize,minimum:1,markdownDescription:m("tabSize","The number of spaces a tab is equal to. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.indentSize":{anyOf:[{type:"string",enum:["tabSize"]},{type:"number",minimum:1}],default:"tabSize",markdownDescription:m("indentSize",'The number of spaces used for indentation or `"tabSize"` to use the value from `#editor.tabSize#`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.')},"editor.insertSpaces":{type:"boolean",default:In.insertSpaces,markdownDescription:m("insertSpaces","Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.detectIndentation":{type:"boolean",default:In.detectIndentation,markdownDescription:m("detectIndentation","Controls whether {0} and {1} will be automatically detected when a file is opened based on the file contents.","`#editor.tabSize#`","`#editor.insertSpaces#`")},"editor.trimAutoWhitespace":{type:"boolean",default:In.trimAutoWhitespace,description:m("trimAutoWhitespace","Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:In.largeFileOptimizations,description:m("largeFileOptimizations","Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{type:"boolean",default:!0,description:m("wordBasedSuggestions","Controls whether completions should be computed based on words in the document.")},"editor.wordBasedSuggestionsMode":{enum:["currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[m("wordBasedSuggestionsMode.currentDocument","Only suggest words from the active document."),m("wordBasedSuggestionsMode.matchingDocuments","Suggest words from all open documents of the same language."),m("wordBasedSuggestionsMode.allDocuments","Suggest words from all open documents.")],description:m("wordBasedSuggestionsMode","Controls from which documents word based completions are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[m("semanticHighlighting.true","Semantic highlighting enabled for all color themes."),m("semanticHighlighting.false","Semantic highlighting disabled for all color themes."),m("semanticHighlighting.configuredByTheme","Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:m("semanticHighlighting.enabled","Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:m("stablePeek","Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:m("maxTokenizationLineLength","Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!1,description:m("editor.experimental.asyncTokenization","Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:m("editor.experimental.asyncTokenizationLogging","Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:m("editor.experimental.asyncTokenizationVerification","Controls whether async tokenization should be verified against legacy background tokenization. Might slow down tokenization. For debugging only."),tags:["experimental"]},"editor.language.brackets":{type:["array","null"],default:null,description:m("schema.brackets","Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:m("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:m("schema.closeBracket","The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:m("schema.colorizedBracketPairs","Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),items:{type:"array",items:[{type:"string",description:m("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:m("schema.closeBracket","The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:qn.maxComputationTime,description:m("maxComputationTime","Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:qn.maxFileSize,description:m("maxFileSize","Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:qn.renderSideBySide,description:m("sideBySide","Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:qn.renderSideBySideInlineBreakpoint,description:m("renderSideBySideInlineBreakpoint","If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:qn.useInlineViewWhenSpaceIsLimited,description:m("useInlineViewWhenSpaceIsLimited","If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:qn.renderMarginRevertIcon,description:m("renderMarginRevertIcon","When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:qn.ignoreTrimWhitespace,description:m("ignoreTrimWhitespace","When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:qn.renderIndicators,description:m("renderIndicators","Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:qn.diffCodeLens,description:m("codeLens","Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:qn.diffWordWrap,markdownEnumDescriptions:[m("wordWrap.off","Lines will never wrap."),m("wordWrap.on","Lines will wrap at the viewport width."),m("wordWrap.inherit","Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:qn.diffAlgorithm,markdownEnumDescriptions:[m("diffAlgorithm.legacy","Uses the legacy diffing algorithm."),m("diffAlgorithm.advanced","Uses the advanced diffing algorithm.")],tags:["experimental"]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:qn.hideUnchangedRegions.enabled,markdownDescription:m("hideUnchangedRegions.enabled","Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:qn.hideUnchangedRegions.revealLineCount,markdownDescription:m("hideUnchangedRegions.revealLineCount","Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:qn.hideUnchangedRegions.minimumLineCount,markdownDescription:m("hideUnchangedRegions.minimumLineCount","Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:qn.hideUnchangedRegions.contextLineCount,markdownDescription:m("hideUnchangedRegions.contextLineCount","Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:qn.experimental.showMoves,markdownDescription:m("showMoves","Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:qn.experimental.showEmptyDecorations,description:m("showEmptyDecorations","Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")}}});function aLe(n){return typeof n.type<"u"||typeof n.anyOf<"u"}for(const n of Og){const e=n.schema;if(typeof e<"u")if(aLe(e))ux.properties[`editor.${n.name}`]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&(ux.properties[t]=e[t])}let vw=null;function fG(){return vw===null&&(vw=Object.create(null),Object.keys(ux.properties).forEach(n=>{vw[n]=!0})),vw}function lLe(n){return fG()[`editor.${n}`]||!1}function cLe(n){return fG()[`diffEditor.${n}`]||!1}const dLe=_n.as(qf.Configuration);dLe.registerConfiguration(ux);class uLe{static insert(e,t){return{range:new N(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}}static delete(e){return{range:e,text:null}}static replace(e,t){return{range:e,text:t}}static replaceMove(e,t){return{range:e,text:t,forceMoveMarkers:!0}}}function J2(n){return Object.isFrozen(n)?n:$he(n)}class An{constructor(e={},t=[],i=[],s){this._contents=e,this._keys=t,this._overrides=i,this.raw=s,this.overrideConfigurations=new Map}get rawConfiguration(){var e;if(!this._rawConfiguration)if(!((e=this.raw)===null||e===void 0)&&e.length){const t=this.raw.map(i=>{if(i instanceof An)return i;const s=new hLe("");return s.parseRaw(i),s.configurationModel});this._rawConfiguration=t.reduce((i,s)=>s===i?s:i.merge(s),t[0])}else this._rawConfiguration=this;return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}isEmpty(){return this._keys.length===0&&Object.keys(this._contents).length===0&&this._overrides.length===0}getValue(e){return e?C9(this.contents,e):this.contents}inspect(e,t){const i=this.rawConfiguration.getValue(e),s=t?this.rawConfiguration.getOverrideValue(e,t):void 0,o=t?this.rawConfiguration.override(t).getValue(e):i;return{value:i,override:s,merged:o}}getOverrideValue(e,t){const i=this.getContentsForOverrideIdentifer(t);return i?e?C9(i,e):i:void 0}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){var t,i;const s=Nl(this.contents),o=Nl(this.overrides),r=[...this.keys],a=!((t=this.raw)===null||t===void 0)&&t.length?[...this.raw]:[this];for(const l of e)if(a.push(...!((i=l.raw)===null||i===void 0)&&i.length?l.raw:[l]),!l.isEmpty()){this.mergeContents(s,l.contents);for(const c of l.overrides){const[d]=o.filter(u=>Zi(u.identifiers,c.identifiers));d?(this.mergeContents(d.contents,c.contents),d.keys.push(...c.keys),d.keys=mf(d.keys)):o.push(Nl(c))}for(const c of l.keys)r.indexOf(c)===-1&&r.push(c)}return new An(s,r,o,a.every(l=>l instanceof An)?void 0:a)}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||typeof t!="object"||!Object.keys(t).length)return this;const i={};for(const s of mf([...Object.keys(this.contents),...Object.keys(t)])){let o=this.contents[s];const r=t[s];r&&(typeof o=="object"&&typeof r=="object"?(o=Nl(o),this.mergeContents(o,r)):o=r),i[s]=o}return new An(i,this.keys,this.overrides)}mergeContents(e,t){for(const i of Object.keys(t)){if(i in e&&Ds(e[i])&&Ds(t[i])){this.mergeContents(e[i],t[i]);continue}e[i]=Nl(t[i])}}getContentsForOverrideIdentifer(e){let t=null,i=null;const s=o=>{o&&(i?this.mergeContents(i,o):i=Nl(o))};for(const o of this.overrides)o.identifiers.length===1&&o.identifiers[0]===e?t=o.contents:o.identifiers.includes(e)&&s(o.contents);return s(t),i}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}addValue(e,t){this.updateValue(e,t,!0)}setValue(e,t){this.updateValue(e,t,!1)}removeValue(e){const t=this.keys.indexOf(e);t!==-1&&(this.keys.splice(t,1),l0e(this.contents,e),nu.test(e)&&this.overrides.splice(this.overrides.findIndex(i=>Zi(i.identifiers,OS(e))),1))}updateValue(e,t,i){yj(this.contents,e,t,s=>console.error(s)),i=i||this.keys.indexOf(e)===-1,i&&this.keys.push(e),nu.test(e)&&this.overrides.push({identifiers:OS(e),keys:Object.keys(this.contents[e]),contents:hT(this.contents[e],s=>console.error(s))})}}class hLe{constructor(e){this._name=e,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||new An}parseRaw(e,t){this._raw=e;const{contents:i,keys:s,overrides:o,restricted:r,hasExcludedProperties:a}=this.doParseRaw(e,t);this._configurationModel=new An(i,s,o,a?[e]:void 0),this._restrictedConfigurations=r||[]}doParseRaw(e,t){const i=_n.as(qf.Configuration).getConfigurationProperties(),s=this.filter(e,i,!0,t);e=s.raw;const o=hT(e,l=>console.error(`Conflict in settings file ${this._name}: ${l}`)),r=Object.keys(e),a=this.toOverrides(e,l=>console.error(`Conflict in settings file ${this._name}: ${l}`));return{contents:o,keys:r,overrides:a,restricted:s.restricted,hasExcludedProperties:s.hasExcludedProperties}}filter(e,t,i,s){var o,r,a;let l=!1;if(!(s!=null&&s.scopes)&&!(s!=null&&s.skipRestricted)&&!(!((o=s==null?void 0:s.exclude)===null||o===void 0)&&o.length))return{raw:e,restricted:[],hasExcludedProperties:l};const c={},d=[];for(const u in e)if(nu.test(u)&&i){const h=this.filter(e[u],t,!1,s);c[u]=h.raw,l=l||h.hasExcludedProperties,d.push(...h.restricted)}else{const h=t[u],f=h?typeof h.scope<"u"?h.scope:3:void 0;h!=null&&h.restricted&&d.push(u),!(!((r=s.exclude)===null||r===void 0)&&r.includes(u))&&(!((a=s.include)===null||a===void 0)&&a.includes(u)||(f===void 0||s.scopes===void 0||s.scopes.includes(f))&&!(s.skipRestricted&&(h!=null&&h.restricted)))?c[u]=e[u]:l=!0}return{raw:c,restricted:d,hasExcludedProperties:l}}toOverrides(e,t){const i=[];for(const s of Object.keys(e))if(nu.test(s)){const o={};for(const r in e[s])o[r]=e[s][r];i.push({identifiers:OS(s),keys:Object.keys(o),contents:hT(o,t)})}return i}}class fLe{constructor(e,t,i,s,o,r,a,l,c,d,u,h,f){this.key=e,this.overrides=t,this._value=i,this.overrideIdentifiers=s,this.defaultConfiguration=o,this.policyConfiguration=r,this.applicationConfiguration=a,this.userConfiguration=l,this.localUserConfiguration=c,this.remoteUserConfiguration=d,this.workspaceConfiguration=u,this.folderConfigurationModel=h,this.memoryConfigurationModel=f}inspect(e,t,i){const s=e.inspect(t,i);return{get value(){return J2(s.value)},get override(){return J2(s.override)},get merged(){return J2(s.merged)}}}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.inspect(this.userConfiguration,this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get user(){return this.userInspectValue.value!==void 0||this.userInspectValue.override!==void 0?{value:this.userInspectValue.value,override:this.userInspectValue.override}:void 0}}class kD{constructor(e,t,i,s,o=new An,r=new An,a=new Tn,l=new An,c=new Tn){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=i,this._localUserConfiguration=s,this._remoteUserConfiguration=o,this._workspaceConfiguration=r,this._folderConfigurations=a,this._memoryConfiguration=l,this._memoryConfigurationByResource=c,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new Tn,this._userConfiguration=null}getValue(e,t,i){return this.getConsolidatedConfigurationModel(e,t,i).getValue(e)}updateValue(e,t,i={}){let s;i.resource?(s=this._memoryConfigurationByResource.get(i.resource),s||(s=new An,this._memoryConfigurationByResource.set(i.resource,s))):s=this._memoryConfiguration,t===void 0?s.removeValue(e):s.setValue(e,t),i.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,i){const s=this.getConsolidatedConfigurationModel(e,t,i),o=this.getFolderConfigurationModelForResource(t.resource,i),r=t.resource?this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration:this._memoryConfiguration,a=new Set;for(const l of s.overrides)for(const c of l.identifiers)s.getOverrideValue(e,c)!==void 0&&a.add(c);return new fLe(e,t,s.getValue(e),a.size?[...a]:void 0,this._defaultConfiguration,this._policyConfiguration.isEmpty()?void 0:this._policyConfiguration,this.applicationConfiguration.isEmpty()?void 0:this.applicationConfiguration,this.userConfiguration,this.localUserConfiguration,this.remoteUserConfiguration,i?this._workspaceConfiguration:void 0,o||void 0,r)}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){return this._userConfiguration||(this._userConfiguration=this._remoteUserConfiguration.isEmpty()?this._localUserConfiguration:this._localUserConfiguration.merge(this._remoteUserConfiguration)),this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}getConsolidatedConfigurationModel(e,t,i){let s=this.getConsolidatedConfigurationModelForResource(t,i);return t.overrideIdentifier&&(s=s.override(t.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(e)!==void 0&&(s=s.merge(this._policyConfiguration)),s}getConsolidatedConfigurationModelForResource({resource:e},t){let i=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const s=t.getFolder(e);s&&(i=this.getFolderConsolidatedConfiguration(s.uri)||i);const o=this._memoryConfigurationByResource.get(e);o&&(i=i.merge(o))}return i}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let t=this._foldersConsolidatedConfigurations.get(e);if(!t){const i=this.getWorkspaceConsolidatedConfiguration(),s=this._folderConfigurations.get(e);s?(t=i.merge(s),this._foldersConsolidatedConfigurations.set(e,t)):t=i}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){const i=t.getFolder(e);if(i)return this._folderConfigurations.get(i.uri)}}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},policy:{contents:this._policyConfiguration.contents,overrides:this._policyConfiguration.overrides,keys:this._policyConfiguration.keys},application:{contents:this.applicationConfiguration.contents,overrides:this.applicationConfiguration.overrides,keys:this.applicationConfiguration.keys},user:{contents:this.userConfiguration.contents,overrides:this.userConfiguration.overrides,keys:this.userConfiguration.keys},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce((e,t)=>{const{contents:i,overrides:s,keys:o}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:s,keys:o}]),e},[])}}static parse(e){const t=this.parseConfigurationModel(e.defaults),i=this.parseConfigurationModel(e.policy),s=this.parseConfigurationModel(e.application),o=this.parseConfigurationModel(e.user),r=this.parseConfigurationModel(e.workspace),a=e.folders.reduce((l,c)=>(l.set(je.revive(c[0]),this.parseConfigurationModel(c[1])),l),new Tn);return new kD(t,i,s,o,new An,r,a,new An,new Tn)}static parseConfigurationModel(e){return new An(e.contents,e.keys,e.overrides)}}class gLe{constructor(e,t,i,s){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=s,this._marker=` -`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=46,this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const o of e.keys)this.affectedKeys.add(o);for(const[,o]of e.overrides)for(const r of o)this.affectedKeys.add(r);this._affectsConfigStr=this._marker;for(const o of this.affectedKeys)this._affectsConfigStr+=o+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=kD.parse(this.previous.data)),this._previousConfiguration}affectsConfiguration(e,t){var i;const s=this._marker+e,o=this._affectsConfigStr.indexOf(s);if(o<0)return!1;const r=o+s.length;if(r>=this._affectsConfigStr.length)return!1;const a=this._affectsConfigStr.charCodeAt(r);if(a!==this._markerCode1&&a!==this._markerCode2)return!1;if(t){const l=this.previousConfiguration?this.previousConfiguration.getValue(e,t,(i=this.previous)===null||i===void 0?void 0:i.workspace):void 0,c=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!Lo(l,c)}return!0}}const hx={kind:0},pLe={kind:1};function mLe(n,e,t){return{kind:2,commandId:n,commandArgs:e,isBubble:t}}class K_{constructor(e,t,i){var s;this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const o of e){const r=o.command;r&&r.charAt(0)!=="-"&&this._defaultBoundCommands.set(r,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=K_.handleRemovals([].concat(e).concat(t));for(let o=0,r=this._keybindings.length;o"u"){this._map.set(e,[t]),this._addToLookupMap(t);return}for(let s=i.length-1;s>=0;s--){const o=i[s];if(o.command===t.command)continue;let r=!0;for(let a=1;a"u"?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}_removeFromLookupMap(e){if(!e.command)return;const t=this._lookupMap.get(e.command);if(!(typeof t>"u")){for(let i=0,s=t.length;i"u"||i.length===0)return null;if(i.length===1)return i[0];for(let s=i.length-1;s>=0;s--){const o=i[s];if(t.contextMatchesRules(o.when))return o}return i[i.length-1]}resolve(e,t,i){const s=[...t,i];this._log(`| Resolving ${s}`);const o=this._map.get(s[0]);if(o===void 0)return this._log("\\ No keybinding entries."),hx;let r=null;if(s.length<2)r=o;else{r=[];for(let l=0,c=o.length;ld.chords.length)continue;let u=!0;for(let h=1;h=0;i--){const s=t[i];if(K_._contextMatchesRules(e,s.when))return s}return null}static _contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function B6(n){return n?`${n.serialize()}`:"no when condition"}function W6(n){return n.extensionId?n.isBuiltinExtension?`built-in extension ${n.extensionId}`:`user extension ${n.extensionId}`:n.isDefault?"built-in":"user"}const _Le=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class bLe extends Y{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:ue.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,i,s,o){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=i,this._notificationService=s,this._logService=o,this._onDidUpdateKeybindings=this._register(new B),this._currentChords=[],this._currentChordChecker=new G1,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=Qg.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new Lc,this._logging=!1}dispose(){super.dispose()}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getKeybindings(){return this._getResolver().getKeybindings()}lookupKeybinding(e,t){const i=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService);if(i)return i.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){this._log("/ Soft dispatching keyboard event");const i=this.resolveKeyboardEvent(e);if(i.hasMultipleChords())return console.warn("keyboard event should not be mapped to multiple chords"),hx;const[s]=i.getDispatchChords();if(s===null)return this._log("\\ Keyboard event cannot be dispatched"),hx;const o=this._contextKeyService.getContext(t),r=this._currentChords.map(({keypress:a})=>a);return this._getResolver().resolve(o,r,s)}_scheduleLeaveChordMode(){const e=Date.now();this._currentChordChecker.cancelAndSet(()=>{if(!this._documentHasFocus()){this._leaveChordMode();return}Date.now()-e>5e3&&this._leaveChordMode()},500)}_expectAnotherChord(e,t){switch(this._currentChords.push({keypress:e,label:t}),this._currentChords.length){case 0:throw I4("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(m("first.chord","({0}) was pressed. Waiting for second key of chord...",t));break;default:{const i=this._currentChords.map(({label:s})=>s).join(", ");this._currentChordStatusMessage=this._notificationService.status(m("next.chord","({0}) was pressed. Waiting for next key of chord...",i))}}this._scheduleLeaveChordMode(),O_.enabled&&O_.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],O_.enable()}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const i=this.resolveKeyboardEvent(e),[s]=i.getSingleModifierDispatchChords();if(s)return this._ignoreSingleModifiers.has(s)?(this._log(`+ Ignoring single modifier ${s} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=Qg.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=Qg.EMPTY,this._currentSingleModifier===null?(this._log(`+ Storing single modifier for possible chord ${s}.`),this._currentSingleModifier=s,this._currentSingleModifierClearTimeout.cancelAndSet(()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null},300),!1):s===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${s} ${s}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(i,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${s}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[o]=i.getChords();return this._ignoreSingleModifiers=new Qg(o),this._currentSingleModifier!==null&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,i=!1){var s;let o=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let r=null,a=null;if(i){const[u]=e.getSingleModifierDispatchChords();r=u,a=u?[u]:[]}else[r]=e.getDispatchChords(),a=this._currentChords.map(({keypress:u})=>u);if(r===null)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),o;const l=this._contextKeyService.getContext(t),c=e.getLabel(),d=this._getResolver().resolve(l,a,r);switch(d.kind){case 0:{if(this._logService.trace("KeybindingService#dispatch",c,"[ No matching keybinding ]"),this.inChordMode){const u=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving multi-chord mode: Nothing bound to "${u}, ${c}".`),this._notificationService.status(m("missing.chord","The key combination ({0}, {1}) is not a command.",u,c),{hideAfter:10*1e3}),this._leaveChordMode(),o=!0}return o}case 1:return this._logService.trace("KeybindingService#dispatch",c,"[ Several keybindings match - more chords needed ]"),o=!0,this._expectAnotherChord(r,c),this._log(this._currentChords.length===1?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),o;case 2:{if(this._logService.trace("KeybindingService#dispatch",c,`[ Will dispatch command ${d.commandId} ]`),d.commandId===null||d.commandId===""){if(this.inChordMode){const u=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving chord mode: Nothing bound to "${u}, ${c}".`),this._notificationService.status(m("missing.chord","The key combination ({0}, {1}) is not a command.",u,c),{hideAfter:10*1e3}),this._leaveChordMode(),o=!0}}else this.inChordMode&&this._leaveChordMode(),d.isBubble||(o=!0),this._log(`+ Invoking command ${d.commandId}.`),typeof d.commandArgs>"u"?this._commandService.executeCommand(d.commandId).then(void 0,u=>this._notificationService.warn(u)):this._commandService.executeCommand(d.commandId,d.commandArgs).then(void 0,u=>this._notificationService.warn(u)),_Le.test(d.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:d.commandId,from:"keybinding",detail:(s=e.getUserSettingsLabel())!==null&&s!==void 0?s:void 0});return o}}}mightProducePrintableCharacter(e){return e.ctrlKey||e.metaKey?!1:e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30}}class Qg{constructor(e){this._ctrlKey=e?e.ctrlKey:!1,this._shiftKey=e?e.shiftKey:!1,this._altKey=e?e.altKey:!1,this._metaKey=e?e.metaKey:!1}has(e){switch(e){case"ctrl":return this._ctrlKey;case"shift":return this._shiftKey;case"alt":return this._altKey;case"meta":return this._metaKey}}}Qg.EMPTY=new Qg(null);class V6{constructor(e,t,i,s,o,r,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?oN(e.getDispatchChords()):[],e&&this.chords.length===0&&(this.chords=oN(e.getSingleModifierDispatchChords())),this.bubble=t?t.charCodeAt(0)===94:!1,this.command=this.bubble?t.substr(1):t,this.commandArgs=i,this.when=s,this.isDefault=o,this.extensionId=r,this.isBuiltinExtension=a}}function oN(n){const e=[];for(let t=0,i=n.length;tthis._getLabel(e))}getAriaLabel(){return vLe.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:yLe.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return wLe.toLabel(this._os,this._chords,e=>this._getUserSettingsLabel(e))}hasMultipleChords(){return this._chords.length>1}getChords(){return this._chords.map(e=>this._getChord(e))}_getChord(e){return new bpe(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchChords(){return this._chords.map(e=>this._getChordDispatch(e))}getSingleModifierDispatchChords(){return this._chords.map(e=>this._getSingleModifierChordDispatch(e))}}class bv extends SLe{constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(this._os===2)switch(e){case 15:return"←";case 16:return"↑";case 17:return"→";case 18:return"↓"}return Vl.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":Vl.toString(e.keyCode)}_getElectronAccelerator(e){return Vl.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=Vl.toUserSettingsUS(e.keyCode);return t&&t.toLowerCase()}_getChordDispatch(e){return bv.getDispatchStr(e)}static getDispatchStr(e){if(e.isModifierKey())return null;let t="";return e.ctrlKey&&(t+="ctrl+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.metaKey&&(t+="meta+"),t+=Vl.toString(e.keyCode),t}_getSingleModifierChordDispatch(e){return e.keyCode===5&&!e.shiftKey&&!e.altKey&&!e.metaKey?"ctrl":e.keyCode===4&&!e.ctrlKey&&!e.altKey&&!e.metaKey?"shift":e.keyCode===6&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey?"alt":e.keyCode===57&&!e.ctrlKey&&!e.shiftKey&&!e.altKey?"meta":null}static _scanCodeToKeyCode(e){const t=P4[e];if(t!==-1)return t;switch(e){case 10:return 31;case 11:return 32;case 12:return 33;case 13:return 34;case 14:return 35;case 15:return 36;case 16:return 37;case 17:return 38;case 18:return 39;case 19:return 40;case 20:return 41;case 21:return 42;case 22:return 43;case 23:return 44;case 24:return 45;case 25:return 46;case 26:return 47;case 27:return 48;case 28:return 49;case 29:return 50;case 30:return 51;case 31:return 52;case 32:return 53;case 33:return 54;case 34:return 55;case 35:return 56;case 36:return 22;case 37:return 23;case 38:return 24;case 39:return 25;case 40:return 26;case 41:return 27;case 42:return 28;case 43:return 29;case 44:return 30;case 45:return 21;case 51:return 88;case 52:return 86;case 53:return 92;case 54:return 94;case 55:return 93;case 56:return 0;case 57:return 85;case 58:return 95;case 59:return 91;case 60:return 87;case 61:return 89;case 62:return 90;case 106:return 97}return 0}static _toKeyCodeChord(e){if(!e)return null;if(e instanceof bf)return e;const t=this._scanCodeToKeyCode(e.scanCode);return t===0?null:new bf(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const i=oN(e.chords.map(s=>this._toKeyCodeChord(s)));return i.length>0?[new bv(i,t)]:[]}}const AD=at("labelService"),xLe=at("progressService");class kp{constructor(e,t){this.callback=e,this.report=t!=null&&t.async?this._reportAsync.bind(this):this._reportSync.bind(this)}_reportSync(e){this._value=e,this.callback(this._value)}_reportAsync(e){Promise.resolve(this._lastTask).finally(()=>{this._value=e;const t=this.callback(this._value);this._lastTask=Promise.resolve(t).finally(()=>this._lastTask=void 0)})}}kp.None=Object.freeze({report(){}});const ny=at("editorProgressService");class LLe{constructor(){this._value="",this._pos=0}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos=0;t--,this._valueLen--){const i=this._value.charCodeAt(t);if(!(i===47||this._splitOnBackslash&&i===92))break}return this.next()}hasNext(){return this._to!1,t=()=>!1){return new Y_(new ELe(e,t))}static forStrings(){return new Y_(new LLe)}static forConfigKeys(){return new Y_(new DLe)}constructor(e){this._iter=e}clear(){this._root=void 0}set(e,t){const i=this._iter.reset(e);let s;this._root||(this._root=new yw,this._root.segment=i.value());const o=[];for(s=this._root;;){const a=i.cmp(s.segment);if(a>0)s.left||(s.left=new yw,s.left.segment=i.value()),o.push([-1,s]),s=s.left;else if(a<0)s.right||(s.right=new yw,s.right.segment=i.value()),o.push([1,s]),s=s.right;else if(i.hasNext())i.next(),s.mid||(s.mid=new yw,s.mid.segment=i.value()),o.push([0,s]),s=s.mid;else break}const r=s.value;s.value=t,s.key=e;for(let a=o.length-1;a>=0;a--){const l=o[a][1];l.updateHeight();const c=l.balanceFactor();if(c<-1||c>1){const d=o[a][0],u=o[a+1][0];if(d===1&&u===1)o[a][1]=l.rotateLeft();else if(d===-1&&u===-1)o[a][1]=l.rotateRight();else if(d===1&&u===-1)l.right=o[a+1][1]=o[a+1][1].rotateRight(),o[a][1]=l.rotateLeft();else if(d===-1&&u===1)l.left=o[a+1][1]=o[a+1][1].rotateLeft(),o[a][1]=l.rotateRight();else throw new Error;if(a>0)switch(o[a-1][0]){case-1:o[a-1][1].left=o[a][1];break;case 1:o[a-1][1].right=o[a][1];break;case 0:o[a-1][1].mid=o[a][1];break}else this._root=o[0][1]}}return r}get(e){var t;return(t=this._getNode(e))===null||t===void 0?void 0:t.value}_getNode(e){const t=this._iter.reset(e);let i=this._root;for(;i;){const s=t.cmp(i.segment);if(s>0)i=i.left;else if(s<0)i=i.right;else if(t.hasNext())t.next(),i=i.mid;else break}return i}has(e){const t=this._getNode(e);return!((t==null?void 0:t.value)===void 0&&(t==null?void 0:t.mid)===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){var i;const s=this._iter.reset(e),o=[];let r=this._root;for(;r;){const a=s.cmp(r.segment);if(a>0)o.push([-1,r]),r=r.left;else if(a<0)o.push([1,r]),r=r.right;else if(s.hasNext())s.next(),o.push([0,r]),r=r.mid;else break}if(r){if(t?(r.left=void 0,r.mid=void 0,r.right=void 0,r.height=1):(r.key=void 0,r.value=void 0),!r.mid&&!r.value)if(r.left&&r.right){const a=this._min(r.right);if(a.key){const{key:l,value:c,segment:d}=a;this._delete(a.key,!1),r.key=l,r.value=c,r.segment=d}}else{const a=(i=r.left)!==null&&i!==void 0?i:r.right;if(o.length>0){const[l,c]=o[o.length-1];switch(l){case-1:c.left=a;break;case 0:c.mid=a;break;case 1:c.right=a;break}}else this._root=a}for(let a=o.length-1;a>=0;a--){const l=o[a][1];l.updateHeight();const c=l.balanceFactor();if(c>1?(l.right.balanceFactor()>=0||(l.right=l.right.rotateRight()),o[a][1]=l.rotateLeft()):c<-1&&(l.left.balanceFactor()<=0||(l.left=l.left.rotateLeft()),o[a][1]=l.rotateRight()),a>0)switch(o[a-1][0]){case-1:o[a-1][1].left=o[a][1];break;case 1:o[a-1][1].right=o[a][1];break;case 0:o[a-1][1].mid=o[a][1];break}else this._root=o[0][1]}}}_min(e){for(;e.left;)e=e.left;return e}findSubstr(e){const t=this._iter.reset(e);let i=this._root,s;for(;i;){const o=t.cmp(i.segment);if(o>0)i=i.left;else if(o<0)i=i.right;else if(t.hasNext())t.next(),s=i.value||s,i=i.mid;else break}return i&&i.value||s}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const i=this._iter.reset(e);let s=this._root;for(;s;){const o=i.cmp(s.segment);if(o>0)s=s.left;else if(o<0)s=s.right;else if(i.hasNext())i.next(),s=s.mid;else return s.mid?this._entries(s.mid):t?s.value:void 0}}forEach(e){for(const[t,i]of this)e(i,t)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){const t=[];return this._dfsEntries(e,t),t[Symbol.iterator]()}_dfsEntries(e,t){e&&(e.left&&this._dfsEntries(e.left,t),e.value&&t.push([e.key,e.value]),e.mid&&this._dfsEntries(e.mid,t),e.right&&this._dfsEntries(e.right,t))}}const ALe=at("contextService");class ILe{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}}const TLe="code-workspace";m("codeWorkspace","Code Workspace");const NLe="4064f6ec-cb38-4ad0-af64-ee6467e63c82";var z6;(function(n){n.inspectTokensAction=m("inspectTokens","Developer: Inspect Tokens")})(z6||(z6={}));var H6;(function(n){n.gotoLineActionLabel=m("gotoLineActionLabel","Go to Line/Column...")})(H6||(H6={}));var $6;(function(n){n.helpQuickAccessActionLabel=m("helpQuickAccess","Show all Quick Access Providers")})($6||($6={}));var U6;(function(n){n.quickCommandActionLabel=m("quickCommandActionLabel","Command Palette"),n.quickCommandHelp=m("quickCommandActionHelp","Show And Run Commands")})(U6||(U6={}));var j6;(function(n){n.quickOutlineActionLabel=m("quickOutlineActionLabel","Go to Symbol..."),n.quickOutlineByCategoryActionLabel=m("quickOutlineByCategoryActionLabel","Go to Symbol by Category...")})(j6||(j6={}));var fx;(function(n){n.editorViewAccessibleLabel=m("editorViewAccessibleLabel","Editor content"),n.accessibilityHelpMessage=m("accessibilityHelpMessage","Press Alt+F1 for Accessibility Options.")})(fx||(fx={}));var q6;(function(n){n.toggleHighContrast=m("toggleHighContrast","Toggle High Contrast Theme")})(q6||(q6={}));var rN;(function(n){n.bulkEditServiceSummary=m("bulkEditServiceSummary","Made {0} edits in {1} files")})(rN||(rN={}));const RLe=at("workspaceTrustManagementService"),Iu=at("contextViewService"),Tu=at("contextMenuService");var kn;(function(n){function e(o,r){if(o.start>=r.end||r.start>=o.end)return{start:0,end:0};const a=Math.max(o.start,r.start),l=Math.min(o.end,r.end);return l-a<=0?{start:0,end:0}:{start:a,end:l}}n.intersect=e;function t(o){return o.end-o.start<=0}n.isEmpty=t;function i(o,r){return!t(e(o,r))}n.intersects=i;function s(o,r){const a=[],l={start:o.start,end:Math.min(r.start,o.end)},c={start:Math.max(r.end,o.start),end:o.end};return t(l)||a.push(l),t(c)||a.push(c),a}n.relativeComplement=s})(kn||(kn={}));function MLe(n){const e=n;return!!e&&typeof e.x=="number"&&typeof e.y=="number"}var bd;(function(n){n[n.AVOID=0]="AVOID",n[n.ALIGN=1]="ALIGN"})(bd||(bd={}));function Jg(n,e,t){const i=t.mode===bd.ALIGN?t.offset:t.offset+t.size,s=t.mode===bd.ALIGN?t.offset+t.size:t.offset;return t.position===0?e<=n-i?i:e<=s?s-e:Math.max(n-e,0):e<=s?s-e:e<=n-i?i:0}class Nm extends Y{constructor(e,t){super(),this.container=null,this.delegate=null,this.toDisposeOnClean=Y.None,this.toDisposeOnSetContainer=Y.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=ye(".context-view"),this.useFixedPosition=!1,this.useShadowDOM=!1,ld(this.view),this.setContainer(e,t),this._register(Ze(()=>this.setContainer(null,1)))}setContainer(e,t){var i;if(this.container&&(this.toDisposeOnSetContainer.dispose(),this.shadowRoot?(this.shadowRoot.removeChild(this.view),this.shadowRoot=null,(i=this.shadowRootHostElement)===null||i===void 0||i.remove(),this.shadowRootHostElement=null):this.container.removeChild(this.view),this.container=null),e){if(this.container=e,this.useFixedPosition=t!==1,this.useShadowDOM=t===3,this.useShadowDOM){this.shadowRootHostElement=ye(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const o=document.createElement("style");o.textContent=PLe,this.shadowRoot.appendChild(o),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(ye("slot"))}else this.container.appendChild(this.view);const s=new pe;Nm.BUBBLE_UP_EVENTS.forEach(o=>{s.add(ji(this.container,o,r=>{this.onDOMEvent(r,!1)}))}),Nm.BUBBLE_DOWN_EVENTS.forEach(o=>{s.add(ji(this.container,o,r=>{this.onDOMEvent(r,!0)},!0))}),this.toDisposeOnSetContainer=s}}show(e){var t,i;this.isVisible()&&this.hide(),ko(this.view),this.view.className="context-view",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex="2575",this.view.style.position=this.useFixedPosition?"fixed":"absolute",Kh(this.view),this.toDisposeOnClean=e.render(this.view)||Y.None,this.delegate=e,this.doLayout(),(i=(t=this.delegate).focus)===null||i===void 0||i.call(t)}getViewElement(){return this.view}layout(){if(this.isVisible()){if(this.delegate.canRelayout===!1&&!(Jd&&Z4.pointerEvents)){this.hide();return}this.delegate.layout&&this.delegate.layout(),this.doLayout()}}doLayout(){if(!this.isVisible())return;const e=this.delegate.getAnchor();let t;if(Q4(e)){const u=Rn(e),h=cme(e);t={top:u.top*h,left:u.left*h,width:u.width*h,height:u.height*h}}else MLe(e)?t={top:e.y,left:e.x,width:e.width||1,height:e.height||2}:t={top:e.posy,left:e.posx,width:2,height:2};const i=ws(this.view),s=Dh(this.view),o=this.delegate.anchorPosition||0,r=this.delegate.anchorAlignment||0,a=this.delegate.anchorAxisAlignment||0;let l,c;if(a===0){const u={offset:t.top-window.pageYOffset,size:t.height,position:o===0?0:1},h={offset:t.left,size:t.width,position:r===0?0:1,mode:bd.ALIGN};l=Jg(window.innerHeight,s,u)+window.pageYOffset,kn.intersects({start:l,end:l+s},{start:u.offset,end:u.offset+u.size})&&(h.mode=bd.AVOID),c=Jg(window.innerWidth,i,h)}else{const u={offset:t.left,size:t.width,position:r===0?0:1},h={offset:t.top,size:t.height,position:o===0?0:1,mode:bd.ALIGN};c=Jg(window.innerWidth,i,u),kn.intersects({start:c,end:c+i},{start:u.offset,end:u.offset+u.size})&&(h.mode=bd.AVOID),l=Jg(window.innerHeight,s,h)+window.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(o===0?"bottom":"top"),this.view.classList.add(r===0?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const d=Rn(this.container);this.view.style.top=`${l-(this.useFixedPosition?Rn(this.view).top:d.top)}px`,this.view.style.left=`${c-(this.useFixedPosition?Rn(this.view).left:d.left)}px`,this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,t!=null&&t.onHide&&t.onHide(e),this.toDisposeOnClean.dispose(),ld(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,document.activeElement):t&&!Sn(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}Nm.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"];Nm.BUBBLE_DOWN_EVENTS=["click"];const PLe=` +`&&(i=2),this._modelData.model.getValue(i,t)}setValue(e){this._modelData&&this._modelData.model.setValue(e)}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){const t=e;if(this._modelData===null&&t===null||this._modelData&&this._modelData.model===t)return;const i=this.hasTextFocus(),s=this._detachModel();this._attachModel(t),i&&this.hasModel()&&this.focus();const o={oldModelUrl:s?s.uri:null,newModelUrl:t?t.uri:null};this._removeDecorationTypes(),this._onDidChangeModel.fire(o),this._postDetachModelCleanup(s),this._contributions.onAfterModelAttached()}_removeDecorationTypes(){if(this._decorationTypeKeysToIds={},this._decorationTypeSubtypes){for(const e in this._decorationTypeSubtypes){const t=this._decorationTypeSubtypes[e];for(const i in t)this._removeDecorationType(e+"-"+i)}this._decorationTypeSubtypes={}}}getVisibleRanges(){return this._modelData?this._modelData.viewModel.getVisibleRanges():[]}getVisibleRangesPlusViewportAboveBelow(){return this._modelData?this._modelData.viewModel.getVisibleRangesPlusViewportAboveBelow():[]}getWhitespaces(){return this._modelData?this._modelData.viewModel.viewLayout.getWhitespaces():[]}static _getVerticalOffsetAfterPosition(e,t,i,s){const o=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(r.lineNumber,s)}getTopForLineNumber(e,t=!1){return this._modelData?oh._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?oh._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,i,s=!1){const o=e.model.validatePosition({lineNumber:t,column:i}),r=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(o);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(r.lineNumber,s)}getBottomForLineNumber(e,t=!1){return this._modelData?oh._getVerticalOffsetAfterPosition(this._modelData,e,1,t):-1}setHiddenAreas(e,t){var i;(i=this._modelData)===null||i===void 0||i.viewModel.setHiddenAreas(e.map(s=>N.lift(s)),t)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return Gi.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(this._modelData){if(!V.isIPosition(e))throw new Error("Invalid arguments");this._modelData.viewModel.setSelections(t,[{selectionStartLineNumber:e.lineNumber,selectionStartColumn:e.column,positionLineNumber:e.lineNumber,positionColumn:e.column}])}}_sendRevealRange(e,t,i,s){if(!this._modelData)return;if(!N.isIRange(e))throw new Error("Invalid arguments");const o=this._modelData.model.validateRange(e),r=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(o);this._modelData.viewModel.revealRange("api",i,r,t,s)}revealLine(e,t=0){this._revealLine(e,0,t)}revealLineInCenter(e,t=0){this._revealLine(e,1,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._revealLine(e,2,t)}revealLineNearTop(e,t=0){this._revealLine(e,5,t)}_revealLine(e,t,i){if(typeof e!="number")throw new Error("Invalid arguments");this._sendRevealRange(new N(e,1,e,1),t,!1,i)}revealPosition(e,t=0){this._revealPosition(e,0,!0,t)}revealPositionInCenter(e,t=0){this._revealPosition(e,1,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._revealPosition(e,2,!0,t)}revealPositionNearTop(e,t=0){this._revealPosition(e,5,!0,t)}_revealPosition(e,t,i,s){if(!V.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new N(e.lineNumber,e.column,e.lineNumber,e.column),t,i,s)}getSelection(){return this._modelData?this._modelData.viewModel.getSelection():null}getSelections(){return this._modelData?this._modelData.viewModel.getSelections():null}setSelection(e,t="api"){const i=lt.isISelection(e),s=N.isIRange(e);if(!i&&!s)throw new Error("Invalid arguments");if(i)this._setSelectionImpl(e,t);else if(s){const o={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(o,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;const i=new lt(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[i])}revealLines(e,t,i=0){this._revealLines(e,t,0,i)}revealLinesInCenter(e,t,i=0){this._revealLines(e,t,1,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._revealLines(e,t,2,i)}revealLinesNearTop(e,t,i=0){this._revealLines(e,t,5,i)}_revealLines(e,t,i,s){if(typeof e!="number"||typeof t!="number")throw new Error("Invalid arguments");this._sendRevealRange(new N(e,1,t,1),i,!1,s)}revealRange(e,t=0,i=!1,s=!0){this._revealRange(e,i?1:0,s,t)}revealRangeInCenter(e,t=0){this._revealRange(e,1,!0,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._revealRange(e,2,!0,t)}revealRangeNearTop(e,t=0){this._revealRange(e,5,!0,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._revealRange(e,6,!0,t)}revealRangeAtTop(e,t=0){this._revealRange(e,3,!0,t)}_revealRange(e,t,i,s){if(!N.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(N.lift(e),t,i,s)}setSelections(e,t="api",i=0){if(this._modelData){if(!e||e.length===0)throw new Error("Invalid arguments");for(let s=0,o=e.length;s0&&this._modelData.viewModel.restoreCursorState(i):this._modelData.viewModel.restoreCursorState([i]),this._contributions.restoreViewState(t.contributionsState||{});const s=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(s)}}handleInitialized(){var e;(e=this._getViewModel())===null||e===void 0||e.visibleLinesStabilized()}getContribution(e){return this._contributions.get(e)}getActions(){return Array.from(this._actions.values())}getSupportedActions(){let e=this.getActions();return e=e.filter(t=>t.isSupported()),e}getAction(e){return this._actions.get(e)||null}trigger(e,t,i){switch(i=i||{},t){case"compositionStart":this._startComposition();return;case"compositionEnd":this._endComposition(e);return;case"type":{const o=i;this._type(e,o.text||"");return}case"replacePreviousChar":{const o=i;this._compositionType(e,o.text||"",o.replaceCharCnt||0,0,0);return}case"compositionType":{const o=i;this._compositionType(e,o.text||"",o.replacePrevCharCnt||0,o.replaceNextCharCnt||0,o.positionDelta||0);return}case"paste":{const o=i;this._paste(e,o.text||"",o.pasteOnNewLine||!1,o.multicursorText||null,o.mode||null);return}case"cut":this._cut(e);return}const s=this.getAction(t);if(s){Promise.resolve(s.run(i)).then(void 0,mt);return}this._modelData&&(this._triggerEditorCommand(e,t,i)||this._triggerCommand(t,i))}_triggerCommand(e,t){this._commandService.executeCommand(e,t)}_startComposition(){this._modelData&&(this._modelData.viewModel.startComposition(),this._onDidCompositionStart.fire())}_endComposition(e){this._modelData&&(this._modelData.viewModel.endComposition(e),this._onDidCompositionEnd.fire())}_type(e,t){!this._modelData||t.length===0||(e==="keyboard"&&this._onWillType.fire(t),this._modelData.viewModel.type(t,e),e==="keyboard"&&this._onDidType.fire(t))}_compositionType(e,t,i,s,o){this._modelData&&this._modelData.viewModel.compositionType(t,i,s,o,e)}_paste(e,t,i,s,o){if(!this._modelData||t.length===0)return;const r=this._modelData.viewModel,a=r.getSelection().getStartPosition();r.paste(t,i,s,e);const l=r.getSelection().getStartPosition();e==="keyboard"&&this._onDidPaste.fire({range:new N(a.lineNumber,a.column,l.lineNumber,l.column),languageId:o})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){const s=mp.getEditorCommand(t);return s?(i=i||{},i.source=e,this._instantiationService.invokeFunction(o=>{Promise.resolve(s.runEditorCommand(o,this,i)).then(void 0,mt)}),!0):!1}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!this._modelData||this._configuration.options.get(90)?!1:(this._modelData.model.pushStackElement(),!0)}popUndoStop(){return!this._modelData||this._configuration.options.get(90)?!1:(this._modelData.model.popStackElement(),!0)}executeEdits(e,t,i){if(!this._modelData||this._configuration.options.get(90))return!1;let s;return i?Array.isArray(i)?s=()=>i:s=i:s=()=>null,this._modelData.viewModel.executeEdits(e,t,s),!0}executeCommand(e,t){this._modelData&&this._modelData.viewModel.executeCommand(t,e)}executeCommands(e,t){this._modelData&&this._modelData.viewModel.executeCommands(t,e)}createDecorationsCollection(e){return new Hxe(this,e)}changeDecorations(e){return this._modelData?this._modelData.model.changeDecorations(e,this._id):null}getLineDecorations(e){return this._modelData?this._modelData.model.getLineDecorations(e,this._id,pS(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,pS(this._configuration.options)):null}deltaDecorations(e,t){return this._modelData?e.length===0&&t.length===0?e:this._modelData.model.deltaDecorations(e,t,this._id):[]}removeDecorations(e){!this._modelData||e.length===0||this._modelData.model.changeDecorations(t=>{t.deltaDecorations(e,[])})}removeDecorationsByType(e){const t=this._decorationTypeKeysToIds[e];t&&this.deltaDecorations(t,[]),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(143)}createOverviewRuler(e){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.createOverviewRuler(e)}getContainerDomNode(){return this._domElement}getDomNode(){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.domNode.domNode}delegateVerticalScrollbarPointerDown(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateVerticalScrollbarPointerDown(e)}delegateScrollFromMouseWheelEvent(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.delegateScrollFromMouseWheelEvent(e)}layout(e){this._configuration.observeContainer(e),this.render()}focus(){!this._modelData||!this._modelData.hasRealView||this._modelData.view.focus()}hasTextFocus(){return!this._modelData||!this._modelData.hasRealView?!1:this._modelData.view.isFocused()}hasWidgetFocus(){return this._focusTracker&&this._focusTracker.hasFocus()}addContentWidget(e){const t={widget:e,position:e.getPosition()};this._contentWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a content widget with the same id."),this._contentWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addContentWidget(t)}layoutContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutContentWidget(i)}}removeContentWidget(e){const t=e.getId();if(this._contentWidgets.hasOwnProperty(t)){const i=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(i)}}addOverlayWidget(e){const t={widget:e,position:e.getPosition()};this._overlayWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting an overlay widget with the same id."),this._overlayWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addOverlayWidget(t)}layoutOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutOverlayWidget(i)}}removeOverlayWidget(e){const t=e.getId();if(this._overlayWidgets.hasOwnProperty(t)){const i=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(i)}}addGlyphMarginWidget(e){const t={widget:e,position:e.getPosition()};this._glyphMarginWidgets.hasOwnProperty(e.getId())&&console.warn("Overwriting a glyph margin widget with the same id."),this._glyphMarginWidgets[e.getId()]=t,this._modelData&&this._modelData.hasRealView&&this._modelData.view.addGlyphMarginWidget(t)}layoutGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const i=this._glyphMarginWidgets[t];i.position=e.getPosition(),this._modelData&&this._modelData.hasRealView&&this._modelData.view.layoutGlyphMarginWidget(i)}}removeGlyphMarginWidget(e){const t=e.getId();if(this._glyphMarginWidgets.hasOwnProperty(t)){const i=this._glyphMarginWidgets[t];delete this._glyphMarginWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeGlyphMarginWidget(i)}}changeViewZones(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.change(e)}getTargetAtClientPoint(e,t){return!this._modelData||!this._modelData.hasRealView?null:this._modelData.view.getTargetAtClientPoint(e,t)}getScrolledVisiblePosition(e){if(!this._modelData||!this._modelData.hasRealView)return null;const t=this._modelData.model.validatePosition(e),i=this._configuration.options,s=i.get(143),o=oh._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),r=this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+s.glyphMarginWidth+s.lineNumbersWidth+s.decorationsWidth-this.getScrollLeft();return{top:o,left:r,height:i.get(66)}}getOffsetForColumn(e,t){return!this._modelData||!this._modelData.hasRealView?-1:this._modelData.view.getOffsetForColumn(e,t)}render(e=!1){!this._modelData||!this._modelData.hasRealView||this._modelData.view.render(!0,e)}setAriaOptions(e){!this._modelData||!this._modelData.hasRealView||this._modelData.view.setAriaOptions(e)}applyFontInfo(e){Nn(e,this._configuration.options.get(50))}setBanner(e,t){this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),this._bannerDomNode=e,this._configuration.setReservedHeight(e?t:0),this._bannerDomNode&&this._domElement.prepend(this._bannerDomNode)}_attachModel(e){if(!e){this._modelData=null;return}const t=[];this._domElement.setAttribute("data-mode-id",e.getLanguageId()),this._configuration.setIsDominatedByLongLines(e.isDominatedByLongLines()),this._configuration.setModelLineCount(e.getLineCount());const i=e.onBeforeAttached(),s=new Sxe(this._id,this._configuration,e,z3.create(),V3.create(this._configuration.options),a=>jo(a),this.languageConfigurationService,this._themeService,i);t.push(e.onWillDispose(()=>this.setModel(null))),t.push(s.onEvent(a=>{switch(a.kind){case 0:this._onDidContentSizeChange.fire(a);break;case 1:this._editorTextFocus.setValue(a.hasFocus);break;case 2:this._onDidScrollChange.fire(a);break;case 3:this._onDidChangeViewZones.fire();break;case 4:this._onDidChangeHiddenAreas.fire();break;case 5:this._onDidAttemptReadOnlyEdit.fire();break;case 6:{if(a.reachedMaxCursorCount){const u=this.getOption(79),h=m("cursors.maximum","The number of cursors has been limited to {0}. Consider using [find and replace](https://code.visualstudio.com/docs/editor/codebasics#_find-and-replace) for larger changes or increase the editor multi cursor limit setting.",u);this._notificationService.prompt(Yq.Warning,h,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:m("goToSetting","Increase Multi Cursor Limit"),run:()=>{this._commandService.executeCommand("workbench.action.openSettings2",{query:"editor.multiCursorLimit"})}}])}const l=[];for(let u=0,h=a.selections.length;u{this._paste("keyboard",o,r,a,l)},type:o=>{this._type("keyboard",o)},compositionType:(o,r,a,l)=>{this._compositionType("keyboard",o,r,a,l)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:t={paste:(o,r,a,l)=>{const c={text:o,pasteOnNewLine:r,multicursorText:a,mode:l};this._commandService.executeCommand("paste",c)},type:o=>{const r={text:o};this._commandService.executeCommand("type",r)},compositionType:(o,r,a,l)=>{if(a||l){const c={text:o,replacePrevCharCnt:r,replaceNextCharCnt:a,positionDelta:l};this._commandService.executeCommand("compositionType",c)}else{const c={text:o,replaceCharCnt:r};this._commandService.executeCommand("replacePreviousChar",c)}},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};const i=new pD(e.coordinatesConverter);return i.onKeyDown=o=>this._onKeyDown.fire(o),i.onKeyUp=o=>this._onKeyUp.fire(o),i.onContextMenu=o=>this._onContextMenu.fire(o),i.onMouseMove=o=>this._onMouseMove.fire(o),i.onMouseLeave=o=>this._onMouseLeave.fire(o),i.onMouseDown=o=>this._onMouseDown.fire(o),i.onMouseUp=o=>this._onMouseUp.fire(o),i.onMouseDrag=o=>this._onMouseDrag.fire(o),i.onMouseDrop=o=>this._onMouseDrop.fire(o),i.onMouseDropCanceled=o=>this._onMouseDropCanceled.fire(o),i.onMouseWheel=o=>this._onMouseWheel.fire(o),[new OT(t,this._configuration,this._themeService.getColorTheme(),e,i,this._overflowWidgetsDomNode,this._instantiationService),!0]}_postDetachModelCleanup(e){e==null||e.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){if(!this._modelData)return null;const e=this._modelData.model,t=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),t&&this._domElement.contains(t)&&this._domElement.removeChild(t),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),e}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return this._modelData!==null}showDropIndicatorAt(e){const t=[{range:new N(e.lineNumber,e.column,e.lineNumber,e.column),options:oh.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,1)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}setContextValue(e,t){this._contextKeyService.createKey(e,t)}};Mm.dropIntoEditorDecorationOptions=Je.register({description:"workbench-dnd-target",className:"dnd-target"});Mm=oh=Pxe([Cl(3,vt),Cl(4,jt),Cl(5,fs),Cl(6,et),Cl(7,ro),Cl(8,xn),Cl(9,Au),Cl(10,so),Cl(11,it)],Mm);class b6 extends Y{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new B(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new B(this._emitterOptions)),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=0}setValue(e){const t=e?2:1;this._value!==t&&(this._value=t,this._value===2?this._onDidChangeToTrue.fire():this._value===1&&this._onDidChangeToFalse.fire())}}class Hn extends B{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class Wxe extends Y{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=$.editorSimpleInput.bindTo(t),this._editorFocus=$.focus.bindTo(t),this._textInputFocus=$.textInputFocus.bindTo(t),this._editorTextFocus=$.editorTextFocus.bindTo(t),this._tabMovesFocus=$.tabMovesFocus.bindTo(t),this._editorReadonly=$.readOnly.bindTo(t),this._inDiffEditor=$.inDiffEditor.bindTo(t),this._editorColumnSelection=$.columnSelection.bindTo(t),this._hasMultipleSelections=$.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=$.hasNonEmptySelection.bindTo(t),this._canUndo=$.canUndo.bindTo(t),this._canRedo=$.canRedo.bindTo(t),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromConfig())),this._register(this._editor.onDidChangeCursorSelection(()=>this._updateFromSelection())),this._register(this._editor.onDidFocusEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorWidget(()=>this._updateFromFocus())),this._register(this._editor.onDidFocusEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidBlurEditorText(()=>this._updateFromFocus())),this._register(this._editor.onDidChangeModel(()=>this._updateFromModel())),this._register(this._editor.onDidChangeConfiguration(()=>this._updateFromModel())),this._register(FS.onDidChangeTabFocus(i=>this._tabMovesFocus.set(i))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._tabMovesFocus.set(FS.getTabFocusMode()),this._editorReadonly.set(e.get(90)),this._inDiffEditor.set(e.get(61)),this._editorColumnSelection.set(e.get(22))}_updateFromSelection(){const e=this._editor.getSelections();e?(this._hasMultipleSelections.set(e.length>1),this._hasNonEmptySelection.set(e.some(t=>!t.isEmpty()))):(this._hasMultipleSelections.reset(),this._hasNonEmptySelection.reset())}_updateFromFocus(){this._editorFocus.set(this._editor.hasWidgetFocus()&&!this._editor.isSimpleWidget),this._editorTextFocus.set(this._editor.hasTextFocus()&&!this._editor.isSimpleWidget),this._textInputFocus.set(this._editor.hasTextFocus())}_updateFromModel(){const e=this._editor.getModel();this._canUndo.set(!!(e&&e.canUndo())),this._canRedo.set(!!(e&&e.canRedo()))}}class Vxe extends Y{constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=i,this._langId=$.languageId.bindTo(t),this._hasCompletionItemProvider=$.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=$.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=$.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=$.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=$.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=$.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=$.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=$.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=$.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=$.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=$.hasReferenceProvider.bindTo(t),this._hasRenameProvider=$.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=$.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=$.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=$.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=$.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=$.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=$.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInWalkThrough=$.isInWalkThroughSnippet.bindTo(t);const s=()=>this._update();this._register(e.onDidChangeModel(s)),this._register(e.onDidChangeModelLanguage(s)),this._register(i.completionProvider.onDidChange(s)),this._register(i.codeActionProvider.onDidChange(s)),this._register(i.codeLensProvider.onDidChange(s)),this._register(i.definitionProvider.onDidChange(s)),this._register(i.declarationProvider.onDidChange(s)),this._register(i.implementationProvider.onDidChange(s)),this._register(i.typeDefinitionProvider.onDidChange(s)),this._register(i.hoverProvider.onDidChange(s)),this._register(i.documentHighlightProvider.onDidChange(s)),this._register(i.documentSymbolProvider.onDidChange(s)),this._register(i.referenceProvider.onDidChange(s)),this._register(i.renameProvider.onDidChange(s)),this._register(i.documentFormattingEditProvider.onDidChange(s)),this._register(i.documentRangeFormattingEditProvider.onDidChange(s)),this._register(i.signatureHelpProvider.onDidChange(s)),this._register(i.inlayHintsProvider.onDidChange(s)),s()}dispose(){super.dispose()}reset(){this._contextKeyService.bufferChangeEvents(()=>{this._langId.reset(),this._hasCompletionItemProvider.reset(),this._hasCodeActionsProvider.reset(),this._hasCodeLensProvider.reset(),this._hasDefinitionProvider.reset(),this._hasDeclarationProvider.reset(),this._hasImplementationProvider.reset(),this._hasTypeDefinitionProvider.reset(),this._hasHoverProvider.reset(),this._hasDocumentHighlightProvider.reset(),this._hasDocumentSymbolProvider.reset(),this._hasReferenceProvider.reset(),this._hasRenameProvider.reset(),this._hasDocumentFormattingProvider.reset(),this._hasDocumentSelectionFormattingProvider.reset(),this._hasSignatureHelpProvider.reset(),this._isInWalkThrough.reset()})}_update(){const e=this._editor.getModel();if(!e){this.reset();return}this._contextKeyService.bufferChangeEvents(()=>{this._langId.set(e.getLanguageId()),this._hasCompletionItemProvider.set(this._languageFeaturesService.completionProvider.has(e)),this._hasCodeActionsProvider.set(this._languageFeaturesService.codeActionProvider.has(e)),this._hasCodeLensProvider.set(this._languageFeaturesService.codeLensProvider.has(e)),this._hasDefinitionProvider.set(this._languageFeaturesService.definitionProvider.has(e)),this._hasDeclarationProvider.set(this._languageFeaturesService.declarationProvider.has(e)),this._hasImplementationProvider.set(this._languageFeaturesService.implementationProvider.has(e)),this._hasTypeDefinitionProvider.set(this._languageFeaturesService.typeDefinitionProvider.has(e)),this._hasHoverProvider.set(this._languageFeaturesService.hoverProvider.has(e)),this._hasDocumentHighlightProvider.set(this._languageFeaturesService.documentHighlightProvider.has(e)),this._hasDocumentSymbolProvider.set(this._languageFeaturesService.documentSymbolProvider.has(e)),this._hasReferenceProvider.set(this._languageFeaturesService.referenceProvider.has(e)),this._hasRenameProvider.set(this._languageFeaturesService.renameProvider.has(e)),this._hasSignatureHelpProvider.set(this._languageFeaturesService.signatureHelpProvider.has(e)),this._hasInlayHintsProvider.set(this._languageFeaturesService.inlayHintsProvider.has(e)),this._hasDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.has(e)||this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.has(e)),this._hasMultipleDocumentFormattingProvider.set(this._languageFeaturesService.documentFormattingEditProvider.all(e).length+this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._hasMultipleDocumentSelectionFormattingProvider.set(this._languageFeaturesService.documentRangeFormattingEditProvider.all(e).length>1),this._isInWalkThrough.set(e.uri.scheme===tt.walkThroughSnippet)})}}class zxe extends Y{constructor(e){super(),this._onChange=this._register(new B),this.onChange=this._onChange.event,this._hasFocus=!1,this._domFocusTracker=this._register(iu(e)),this._register(this._domFocusTracker.onDidFocus(()=>{this._hasFocus=!0,this._onChange.fire(void 0)})),this._register(this._domFocusTracker.onDidBlur(()=>{this._hasFocus=!1,this._onChange.fire(void 0)}))}hasFocus(){return this._hasFocus}}class Hxe{get length(){return this._decorationIds.length}constructor(e,t){this._editor=e,this._decorationIds=[],this._isChangingDecorations=!1,Array.isArray(t)&&t.length>0&&this.set(t)}onDidChange(e,t,i){return this._editor.onDidChangeModelDecorations(s=>{this._isChangingDecorations||e.call(t,s)},i)}getRange(e){return!this._editor.hasModel()||e>=this._decorationIds.length?null:this._editor.getModel().getDecorationRange(this._decorationIds[e])}getRanges(){if(!this._editor.hasModel())return[];const e=this._editor.getModel(),t=[];for(const i of this._decorationIds){const s=e.getDecorationRange(i);s&&t.push(s)}return t}has(e){return this._decorationIds.includes(e.id)}clear(){this._decorationIds.length!==0&&this.set([])}set(e){try{this._isChangingDecorations=!0,this._editor.changeDecorations(t=>{this._decorationIds=t.deltaDecorations(this._decorationIds,e)})}finally{this._isChangingDecorations=!1}return this._decorationIds}}const $xe=encodeURIComponent("");function $2(n){return $xe+encodeURIComponent(n.toString())+Uxe}const jxe=encodeURIComponent('');function Gxe(n){return jxe+encodeURIComponent(n.toString())+qxe}Tr((n,e)=>{const t=n.getColor(Va);t&&e.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${$2(t)}") repeat-x bottom left; }`);const i=n.getColor(yo);i&&e.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${$2(i)}") repeat-x bottom left; }`);const s=n.getColor(ks);s&&e.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${$2(s)}") repeat-x bottom left; }`);const o=n.getColor(yve);o&&e.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${Gxe(o)}") no-repeat bottom left; }`);const r=n.getColor(Lye);r&&e.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${r.rgba.a}; }`)});var Kxe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Yxe=function(n,e){return function(t,i){e(t,i,n)}},Zxe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,[])).next())})};let XT=class extends Y{constructor(e){super(),this._themeService=e,this._onWillCreateCodeEditor=this._register(new B),this._onCodeEditorAdd=this._register(new B),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new B),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new B),this._onDiffEditorAdd=this._register(new B),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new B),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._codeEditorOpenHandlers=new Ds,this._modelProperties=new Map,this._codeEditors=Object.create(null),this._diffEditors=Object.create(null),this._globalStyleSheet=null}willCreateCodeEditor(){this._onWillCreateCodeEditor.fire()}addCodeEditor(e){this._codeEditors[e.getId()]=e,this._onCodeEditorAdd.fire(e)}removeCodeEditor(e){delete this._codeEditors[e.getId()]&&this._onCodeEditorRemove.fire(e)}listCodeEditors(){return Object.keys(this._codeEditors).map(e=>this._codeEditors[e])}willCreateDiffEditor(){this._onWillCreateDiffEditor.fire()}addDiffEditor(e){this._diffEditors[e.getId()]=e,this._onDiffEditorAdd.fire(e)}listDiffEditors(){return Object.keys(this._diffEditors).map(e=>this._diffEditors[e])}getFocusedCodeEditor(){let e=null;const t=this.listCodeEditors();for(const i of t){if(i.hasTextFocus())return i;i.hasWidgetFocus()&&(e=i)}return e}removeDecorationType(e){const t=this._decorationOptionProviders.get(e);t&&(t.refCount--,t.refCount<=0&&(this._decorationOptionProviders.delete(e),t.dispose(),this.listCodeEditors().forEach(i=>i.removeDecorationsByType(e))))}setModelProperty(e,t,i){const s=e.toString();let o;this._modelProperties.has(s)?o=this._modelProperties.get(s):(o=new Map,this._modelProperties.set(s,o)),o.set(t,i)}getModelProperty(e,t){const i=e.toString();if(this._modelProperties.has(i))return this._modelProperties.get(i).get(t)}openCodeEditor(e,t,i){return Zxe(this,void 0,void 0,function*(){for(const s of this._codeEditorOpenHandlers){const o=yield s(e,t,i);if(o!==null)return o}return null})}registerCodeEditorOpenHandler(e){const t=this._codeEditorOpenHandlers.unshift(e);return Ye(t)}};XT=Kxe([Yxe(0,ro)],XT);var Xxe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},v6=function(n,e){return function(t,i){e(t,i,n)}},Qxe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let tx=class extends XT{constructor(e,t){super(t),this._register(this.onCodeEditorAdd(()=>this._checkContextKey())),this._register(this.onCodeEditorRemove(()=>this._checkContextKey())),this._editorIsOpen=e.createKey("editorIsOpen",!1),this._activeCodeEditor=null,this._register(this.registerCodeEditorOpenHandler((i,s,o)=>Qxe(this,void 0,void 0,function*(){return s?this.doOpenEditor(s,i):null})))}_checkContextKey(){let e=!1;for(const t of this.listCodeEditors())if(!t.isSimpleWidget){e=!0;break}this._editorIsOpen.set(e)}setActiveCodeEditor(e){this._activeCodeEditor=e}getActiveCodeEditor(){return this._activeCodeEditor}doOpenEditor(e,t){if(!this.findModel(e,t.resource)){if(t.resource){const o=t.resource.scheme;if(o===tt.http||o===tt.https)return sj(t.resource.toString()),e}return null}const s=t.options?t.options.selection:null;if(s)if(typeof s.endLineNumber=="number"&&typeof s.endColumn=="number")e.setSelection(s),e.revealRangeInCenter(s,1);else{const o={lineNumber:s.startLineNumber,column:s.startColumn};e.setPosition(o),e.revealPositionInCenter(o,1)}return e}findModel(e,t){const i=e.getModel();return i&&i.uri.toString()!==t.toString()?null:i}};tx=Xxe([v6(0,et),v6(1,ro)],tx);ft(jt,tx,0);const d0=rt("layoutService");var Xq=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Qq=function(n,e){return function(t,i){e(t,i,n)}};let ix=class{get dimension(){return this._dimension||(this._dimension=ZL(window.document.body)),this._dimension}get hasContainer(){return!1}get container(){throw new Error("ILayoutService.container is not available in the standalone editor!")}focus(){var e;(e=this._codeEditorService.getFocusedCodeEditor())===null||e===void 0||e.focus()}constructor(e){this._codeEditorService=e,this.onDidLayout=ue.None,this.offset={top:0,quickPickTop:0}}};ix=Xq([Qq(0,jt)],ix);let QT=class extends ix{get hasContainer(){return!1}get container(){return this._container}constructor(e,t){super(t),this._container=e}};QT=Xq([Qq(1,jt)],QT);ft(d0,ix,1);const Jq=rt("dialogService");var Jxe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},y6=function(n,e){return function(t,i){e(t,i,n)}},lw=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function cw(n){return n.scheme===tt.file?n.fsPath:n.path}let eG=0;class dw{constructor(e,t,i,s,o,r,a){this.id=++eG,this.type=0,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabel=t,this.strResource=i,this.resourceLabels=[this.resourceLabel],this.strResources=[this.strResource],this.groupId=s,this.groupOrder=o,this.sourceId=r,this.sourceOrder=a,this.isValid=!0}setValid(e){this.isValid=e}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.isValid?" VALID":"INVALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class w6{constructor(e,t){this.resourceLabel=e,this.reason=t}}class C6{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,s]of this.elements)(s.reason===0?e:t).push(s.resourceLabel);const i=[];return e.length>0&&i.push(m({key:"externalRemoval",comment:["{0} is a list of filenames"]},"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&i.push(m({key:"noParallelUniverses",comment:["{0} is a list of filenames"]},"The following files have been modified in an incompatible way: {0}.",t.join(", "))),i.join(` +`)}get size(){return this.elements.size}has(e){return this.elements.has(e)}set(e,t){this.elements.set(e,t)}delete(e){return this.elements.delete(e)}}class eLe{constructor(e,t,i,s,o,r,a){this.id=++eG,this.type=1,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=i,this.groupId=s,this.groupOrder=o,this.sourceId=r,this.sourceOrder=a,this.removedResources=null,this.invalidatedResources=null}canSplit(){return typeof this.actual.split=="function"}removeResource(e,t,i){this.removedResources||(this.removedResources=new C6),this.removedResources.has(t)||this.removedResources.set(t,new w6(e,i))}setValid(e,t,i){i?this.invalidatedResources&&(this.invalidatedResources.delete(t),this.invalidatedResources.size===0&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new C6),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new w6(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class tG{constructor(e,t){this.resourceLabel=e,this.strResource=t,this._past=[],this._future=[],this.locked=!1,this.versionId=1}dispose(){for(const e of this._past)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);for(const e of this._future)e.type===1&&e.removeResource(this.resourceLabel,this.strResource,0);this.versionId++}toString(){const e=[];e.push(`* ${this.strResource}:`);for(let t=0;t=0;t--)e.push(` * [REDO] ${this._future[t]}`);return e.join(` +`)}flushAllElements(){this._past=[],this._future=[],this.versionId++}_setElementValidFlag(e,t){e.type===1?e.setValid(this.resourceLabel,this.strResource,t):e.setValid(t)}setElementsValidFlag(e,t){for(const i of this._past)t(i.actual)&&this._setElementValidFlag(i,e);for(const i of this._future)t(i.actual)&&this._setElementValidFlag(i,e)}pushElement(e){for(const t of this._future)t.type===1&&t.removeResource(this.resourceLabel,this.strResource,1);this._future=[],this._past.push(e),this.versionId++}createSnapshot(e){const t=[];for(let i=0,s=this._past.length;i=0;i--)t.push(this._future[i].id);return new Uq(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,s=0,o=-1;for(let a=0,l=this._past.length;a=t||c.id!==e.elements[s])&&(i=!1,o=0),!i&&c.type===1&&c.removeResource(this.resourceLabel,this.strResource,0)}let r=-1;for(let a=this._future.length-1;a>=0;a--,s++){const l=this._future[a];i&&(s>=t||l.id!==e.elements[s])&&(i=!1,r=a),!i&&l.type===1&&l.removeResource(this.resourceLabel,this.strResource,0)}o!==-1&&(this._past=this._past.slice(0,o)),r!==-1&&(this._future=this._future.slice(r+1)),this.versionId++}getElements(){const e=[],t=[];for(const i of this._past)e.push(i.actual);for(const i of this._future)t.push(i.actual);return{past:e,future:t}}getClosestPastElement(){return this._past.length===0?null:this._past[this._past.length-1]}getSecondClosestPastElement(){return this._past.length<2?null:this._past[this._past.length-2]}getClosestFutureElement(){return this._future.length===0?null:this._future[this._future.length-1]}hasPastElements(){return this._past.length>0}hasFutureElements(){return this._future.length>0}splitPastWorkspaceElement(e,t){for(let i=this._past.length-1;i>=0;i--)if(this._past[i]===e){t.has(this.strResource)?this._past[i]=t.get(this.strResource):this._past.splice(i,1);break}this.versionId++}splitFutureWorkspaceElement(e,t){for(let i=this._future.length-1;i>=0;i--)if(this._future[i]===e){t.has(this.strResource)?this._future[i]=t.get(this.strResource):this._future.splice(i,1);break}this.versionId++}moveBackward(e){this._past.pop(),this._future.push(e),this.versionId++}moveForward(e){this._future.pop(),this._past.push(e),this.versionId++}}class U2{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,i=this.editStacks.length;tt.sourceOrder)&&(t=r,i=s)}return[t,i]}canUndo(e){if(e instanceof Ta){const[,i]=this._findClosestUndoElementWithSource(e.id);return!!i}const t=this.getUriComparisonKey(e);return this._editStacks.has(t)?this._editStacks.get(t).hasPastElements():!1}_onError(e,t){mt(e);for(const i of t.strResources)this.removeElements(i);this._notificationService.error(e)}_acquireLocks(e){for(const t of e.editStacks)if(t.locked)throw new Error("Cannot acquire edit stack lock");for(const t of e.editStacks)t.locked=!0;return()=>{for(const t of e.editStacks)t.locked=!1}}_safeInvokeWithLocks(e,t,i,s,o){const r=this._acquireLocks(i);let a;try{a=t()}catch(l){return r(),s.dispose(),this._onError(l,e)}return a?a.then(()=>(r(),s.dispose(),o()),l=>(r(),s.dispose(),this._onError(l,e))):(r(),s.dispose(),o())}_invokeWorkspacePrepare(e){return lw(this,void 0,void 0,function*(){if(typeof e.actual.prepareUndoRedo>"u")return Y.None;const t=e.actual.prepareUndoRedo();return typeof t>"u"?Y.None:t})}_invokeResourcePrepare(e,t){if(e.actual.type!==1||typeof e.actual.prepareUndoRedo>"u")return t(Y.None);const i=e.actual.prepareUndoRedo();return i?_ge(i)?t(i):i.then(s=>t(s)):t(Y.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||iG);return new U2(t)}_tryToSplitAndUndo(e,t,i,s){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(s),new uw(this._undo(e,0,!0));for(const o of t.strResources)this.removeElements(o);return this._notificationService.warn(s),new uw}_checkWorkspaceUndo(e,t,i,s){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,m({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not undo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(s&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,m({key:"cannotWorkspaceUndo",comment:["{0} is a label for an operation. {1} is another message."]},"Could not undo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const o=[];for(const a of i.editStacks)a.getClosestPastElement()!==t&&o.push(a.resourceLabel);if(o.length>0)return this._tryToSplitAndUndo(e,t,null,m({key:"cannotWorkspaceUndoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const r=[];for(const a of i.editStacks)a.locked&&r.push(a.resourceLabel);return r.length>0?this._tryToSplitAndUndo(e,t,null,m({key:"cannotWorkspaceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,r.join(", "))):i.isValid()?null:this._tryToSplitAndUndo(e,t,null,m({key:"cannotWorkspaceUndoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not undo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceUndo(e,t,i){const s=this._getAffectedEditStacks(t),o=this._checkWorkspaceUndo(e,t,s,!1);return o?o.returnValue:this._confirmAndExecuteWorkspaceUndo(e,t,s,i)}_isPartOfUndoGroup(e){if(!e.groupId)return!1;for(const[,t]of this._editStacks){const i=t.getClosestPastElement();if(i){if(i===e){const s=t.getSecondClosestPastElement();if(s&&s.groupId===e.groupId)return!0}if(i.groupId===e.groupId)return!0}}return!1}_confirmAndExecuteWorkspaceUndo(e,t,i,s){return lw(this,void 0,void 0,function*(){if(t.canSplit()&&!this._isPartOfUndoGroup(t)){let a;(function(d){d[d.All=0]="All",d[d.This=1]="This",d[d.Cancel=2]="Cancel"})(a||(a={}));const{result:l}=yield this._dialogService.prompt({type:_i.Info,message:m("confirmWorkspace","Would you like to undo '{0}' across all files?",t.label),buttons:[{label:m({key:"ok",comment:["{0} denotes a number that is > 1, && denotes a mnemonic"]},"&&Undo in {0} Files",i.editStacks.length),run:()=>a.All},{label:m({key:"nok",comment:["&& denotes a mnemonic"]},"Undo this &&File"),run:()=>a.This}],cancelButton:{run:()=>a.Cancel}});if(l===a.Cancel)return;if(l===a.This)return this._splitPastWorkspaceElement(t,null),this._undo(e,0,!0);const c=this._checkWorkspaceUndo(e,t,i,!1);if(c)return c.returnValue;s=!0}let o;try{o=yield this._invokeWorkspacePrepare(t)}catch(a){return this._onError(a,t)}const r=this._checkWorkspaceUndo(e,t,i,!0);if(r)return o.dispose(),r.returnValue;for(const a of i.editStacks)a.moveBackward(t);return this._safeInvokeWithLocks(t,()=>t.actual.undo(),i,o,()=>this._continueUndoInGroup(t.groupId,s))})}_resourceUndo(e,t,i){if(!t.isValid){e.flushAllElements();return}if(e.locked){const s=m({key:"cannotResourceUndoDueToInProgressUndoRedo",comment:["{0} is a label for an operation."]},"Could not undo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(s);return}return this._invokeResourcePrepare(t,s=>(e.moveBackward(t),this._safeInvokeWithLocks(t,()=>t.actual.undo(),new U2([e]),s,()=>this._continueUndoInGroup(t.groupId,i))))}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[s,o]of this._editStacks){const r=o.getClosestPastElement();r&&r.groupId===e&&(!t||r.groupOrder>t.groupOrder)&&(t=r,i=s)}return[t,i]}_continueUndoInGroup(e,t){if(!e)return;const[,i]=this._findClosestUndoElementInGroup(e);if(i)return this._undo(i,0,t)}undo(e){if(e instanceof Ta){const[,t]=this._findClosestUndoElementWithSource(e.id);return t?this._undo(t,e.id,!1):void 0}return typeof e=="string"?this._undo(e,0,!1):this._undo(this.getUriComparisonKey(e),0,!1)}_undo(e,t=0,i){if(!this._editStacks.has(e))return;const s=this._editStacks.get(e),o=s.getClosestPastElement();if(!o)return;if(o.groupId){const[a,l]=this._findClosestUndoElementInGroup(o.groupId);if(o!==a&&l)return this._undo(l,t,i)}if((o.sourceId!==t||o.confirmBeforeUndo)&&!i)return this._confirmAndContinueUndo(e,t,o);try{return o.type===1?this._workspaceUndo(e,o,i):this._resourceUndo(s,o,i)}finally{}}_confirmAndContinueUndo(e,t,i){return lw(this,void 0,void 0,function*(){if((yield this._dialogService.confirm({message:m("confirmDifferentSource","Would you like to undo '{0}'?",i.label),primaryButton:m({key:"confirmDifferentSource.yes",comment:["&& denotes a mnemonic"]},"&&Yes"),cancelButton:m("confirmDifferentSource.no","No")})).confirmed)return this._undo(e,t,!0)})}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[s,o]of this._editStacks){const r=o.getClosestFutureElement();r&&r.sourceId===e&&(!t||r.sourceOrder0)return this._tryToSplitAndRedo(e,t,null,m({key:"cannotWorkspaceRedoDueToChanges",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because changes were made to {1}",t.label,o.join(", ")));const r=[];for(const a of i.editStacks)a.locked&&r.push(a.resourceLabel);return r.length>0?this._tryToSplitAndRedo(e,t,null,m({key:"cannotWorkspaceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,r.join(", "))):i.isValid()?null:this._tryToSplitAndRedo(e,t,null,m({key:"cannotWorkspaceRedoDueToInMeantimeUndoRedo",comment:["{0} is a label for an operation. {1} is a list of filenames."]},"Could not redo '{0}' across all files because an undo or redo operation occurred in the meantime",t.label))}_workspaceRedo(e,t){const i=this._getAffectedEditStacks(t),s=this._checkWorkspaceRedo(e,t,i,!1);return s?s.returnValue:this._executeWorkspaceRedo(e,t,i)}_executeWorkspaceRedo(e,t,i){return lw(this,void 0,void 0,function*(){let s;try{s=yield this._invokeWorkspacePrepare(t)}catch(r){return this._onError(r,t)}const o=this._checkWorkspaceRedo(e,t,i,!0);if(o)return s.dispose(),o.returnValue;for(const r of i.editStacks)r.moveForward(t);return this._safeInvokeWithLocks(t,()=>t.actual.redo(),i,s,()=>this._continueRedoInGroup(t.groupId))})}_resourceRedo(e,t){if(!t.isValid){e.flushAllElements();return}if(e.locked){const i=m({key:"cannotResourceRedoDueToInProgressUndoRedo",comment:["{0} is a label for an operation."]},"Could not redo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(i);return}return this._invokeResourcePrepare(t,i=>(e.moveForward(t),this._safeInvokeWithLocks(t,()=>t.actual.redo(),new U2([e]),i,()=>this._continueRedoInGroup(t.groupId))))}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[s,o]of this._editStacks){const r=o.getClosestFutureElement();r&&r.groupId===e&&(!t||r.groupOrderH3(n,t))}function iLe(n){let e;const t=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(n.fragment);return t&&(e={startLineNumber:parseInt(t[1]),startColumn:t[2]?parseInt(t[2]):1,endLineNumber:t[4]?parseInt(t[4]):void 0,endColumn:t[4]?t[5]?parseInt(t[5]):1:void 0},n=n.with({fragment:""})),{selection:e,uri:n}}var nLe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},x6=function(n,e){return function(t,i){e(t,i,n)}};const oG=rt("ILanguageFeatureDebounceService");var nx;(function(n){const e=new WeakMap;let t=0;function i(s){let o=e.get(s);return o===void 0&&(o=++t,e.set(s,o)),o}n.of=i})(nx||(nx={}));class sLe{constructor(e){this._default=e}get(e){return this._default}update(e,t){return this._default}default(){return this._default}}class oLe{constructor(e,t,i,s,o,r){this._logService=e,this._name=t,this._registry=i,this._default=s,this._min=o,this._max=r,this._cache=new n3(50,.7)}_key(e){return e.id+this._registry.all(e).reduce((t,i)=>sD(nx.of(i),t),0)}get(e){const t=this._key(e),i=this._cache.get(t);return i?uo(i.value,this._min,this._max):this.default()}update(e,t){const i=this._key(e);let s=this._cache.get(i);s||(s=new tLe(6),this._cache.set(i,s));const o=uo(s.update(t),this._min,this._max);return H3(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${o}ms`),o}_overall(){const e=new nG;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){const e=this._overall()|0||this._default;return uo(e,this._min,this._max)}}let eN=class{constructor(e,t){this._logService=e,this._data=new Map,this._isDev=t.isExtensionDevelopment||!t.isBuilt}for(e,t,i){var s,o,r;const a=(s=i==null?void 0:i.min)!==null&&s!==void 0?s:50,l=(o=i==null?void 0:i.max)!==null&&o!==void 0?o:Math.pow(a,2),c=(r=i==null?void 0:i.key)!==null&&r!==void 0?r:void 0,d=`${nx.of(e)},${a}${c?","+c:""}`;let u=this._data.get(d);return u||(this._isDev?u=new oLe(this._logService,t,e,this._overallAverage()|0||a*1.5,a,l):(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),u=new sLe(a*1.5)),this._data.set(d,u)),u}_overallAverage(){const e=new nG;for(const t of this._data.values())e.update(t.default());return e.value}};eN=nLe([x6(0,Sc),x6(1,sG)],eN);ft(oG,eN,1);var rLe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},j2=function(n,e){return function(t,i){e(t,i,n)}};let tN=class{constructor(e,t,i,s){this._legend=e,this._themeService=t,this._languageService=i,this._logService=s,this._hasWarnedOverlappingTokens=!1,this._hasWarnedInvalidLengthTokens=!1,this._hasWarnedInvalidEditStart=!1,this._hashTable=new Ol}getMetadata(e,t,i){const s=this._languageService.languageIdCodec.encodeLanguageId(i),o=this._hashTable.get(e,t,s);let r;if(o)r=o.metadata,this._logService.getLevel()===yn.Trace&&this._logService.trace(`SemanticTokensProviderStyling [CACHED] ${e} / ${t}: foreground ${Us.getForeground(r)}, fontStyle ${Us.getFontStyle(r).toString(2)}`);else{let a=this._legend.tokenTypes[e];const l=[];if(a){let c=t;for(let u=0;c>0&&u>1;c>0&&this._logService.getLevel()===yn.Trace&&(this._logService.trace(`SemanticTokensProviderStyling: unknown token modifier index: ${t.toString(2)} for legend: ${JSON.stringify(this._legend.tokenModifiers)}`),l.push("not-in-legend"));const d=this._themeService.getColorTheme().getTokenStyleMetadata(a,l,i);if(typeof d>"u")r=2147483647;else{if(r=0,typeof d.italic<"u"){const u=(d.italic?1:0)<<11;r|=u|1}if(typeof d.bold<"u"){const u=(d.bold?2:0)<<11;r|=u|2}if(typeof d.underline<"u"){const u=(d.underline?4:0)<<11;r|=u|4}if(typeof d.strikethrough<"u"){const u=(d.strikethrough?8:0)<<11;r|=u|8}if(d.foreground){const u=d.foreground<<15;r|=u|16}r===0&&(r=2147483647)}}else this._logService.getLevel()===yn.Trace&&this._logService.trace(`SemanticTokensProviderStyling: unknown token type index: ${e} for legend: ${JSON.stringify(this._legend.tokenTypes)}`),r=2147483647,a="not-in-legend";this._hashTable.add(e,t,s,r),this._logService.getLevel()===yn.Trace&&this._logService.trace(`SemanticTokensProviderStyling ${e} (${a}) / ${t} (${l.join(" ")}): foreground ${Us.getForeground(r)}, fontStyle ${Us.getFontStyle(r).toString(2)}`)}return r}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,console.warn(`Overlapping semantic tokens detected at lineNumber ${e}, column ${t}`))}warnInvalidLengthSemanticTokens(e,t){this._hasWarnedInvalidLengthTokens||(this._hasWarnedInvalidLengthTokens=!0,console.warn(`Semantic token with invalid length detected at lineNumber ${e}, column ${t}`))}warnInvalidEditStart(e,t,i,s,o){this._hasWarnedInvalidEditStart||(this._hasWarnedInvalidEditStart=!0,console.warn(`Invalid semantic tokens edit detected (previousResultId: ${e}, resultId: ${t}) at edit #${i}: The provided start offset ${s} is outside the previous data (length ${o}).`))}};tN=rLe([j2(1,ro),j2(2,Ni),j2(3,Sc)],tN);class aLe{constructor(e,t,i,s){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=i,this.metadata=s,this.next=null}}class Ol{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=Ol._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=this._growCount){const o=this._elements;this._currentLengthIndex++,this._currentLength=Ol._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},q2=function(n,e){return function(t,i){e(t,i,n)}};let iN=class extends Y{constructor(e,t,i){super(),this._themeService=e,this._logService=t,this._languageService=i,this._caches=new WeakMap,this._register(this._themeService.onDidColorThemeChange(()=>{this._caches=new WeakMap}))}getStyling(e){return this._caches.has(e)||this._caches.set(e,new tN(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};iN=cLe([q2(0,ro),q2(1,Sc),q2(2,Ni)],iN);ft(lLe,iN,1);var L6=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const hw="**",D6="/",yC="[/\\\\]",wC="[^/\\\\]",dLe=/\//g;function k6(n,e){switch(n){case 0:return"";case 1:return`${wC}*?`;default:return`(?:${yC}|${wC}+${yC}${e?`|${yC}${wC}+`:""})*?`}}function E6(n,e){if(!n)return[];const t=[];let i=!1,s=!1,o="";for(const r of n){switch(r){case e:if(!i&&!s){t.push(o),o="";continue}break;case"{":i=!0;break;case"}":i=!1;break;case"[":s=!0;break;case"]":s=!1;break}o+=r}return o&&t.push(o),t}function rG(n){if(!n)return"";let e="";const t=E6(n,D6);if(t.every(i=>i===hw))e=".*";else{let i=!1;t.forEach((s,o)=>{if(s===hw){if(i)return;e+=k6(2,o===t.length-1)}else{let r=!1,a="",l=!1,c="";for(const d of s){if(d!=="}"&&r){a+=d;continue}if(l&&(d!=="]"||!c)){let u;d==="-"?u=d:(d==="^"||d==="!")&&!c?u="^":d===D6?u="":u=Sr(d),c+=u;continue}switch(d){case"{":r=!0;continue;case"[":l=!0;continue;case"}":{const h=`(?:${E6(a,",").map(f=>rG(f)).join("|")})`;e+=h,r=!1,a="";break}case"]":{e+="["+c+"]",l=!1,c="";break}case"?":e+=wC;continue;case"*":e+=k6(1);continue;default:e+=Sr(d)}}o$3(a,e)).filter(a=>a!==Xa),n),i=t.length;if(!i)return Xa;if(i===1)return t[0];const s=function(a,l){for(let c=0,d=t.length;c!!a.allBasenames);o&&(s.allBasenames=o.allBasenames);const r=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return r.length&&(s.allPaths=r),s}function N6(n,e,t){const i=Ed===Oi.sep,s=i?n:n.replace(dLe,Ed),o=Ed+s,r=Oi.sep+n;let a;return t?a=function(l,c){return typeof l=="string"&&(l===s||l.endsWith(o)||!i&&(l===n||l.endsWith(r)))?e:null}:a=function(l,c){return typeof l=="string"&&(l===s||!i&&l===n)?e:null},a.allPaths=[(t?"*/":"./")+n],a}function yLe(n){try{const e=new RegExp(`^${rG(n)}$`);return function(t){return e.lastIndex=0,typeof t=="string"&&e.test(t)?n:null}}catch{return Xa}}function wLe(n,e,t){return!n||typeof e!="string"?!1:aG(n)(e,void 0,t)}function aG(n,e={}){if(!n)return I6;if(typeof n=="string"||CLe(n)){const t=$3(n,e);if(t===Xa)return I6;const i=function(s,o){return!!t(s,o)};return t.allBasenames&&(i.allBasenames=t.allBasenames),t.allPaths&&(i.allPaths=t.allPaths),i}return SLe(n,e)}function CLe(n){const e=n;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}function SLe(n,e){const t=lG(Object.getOwnPropertyNames(n).map(a=>xLe(a,n[a],e)).filter(a=>a!==Xa)),i=t.length;if(!i)return Xa;if(!t.some(a=>!!a.requiresSiblings)){if(i===1)return t[0];const a=function(d,u){let h;for(let f=0,g=t.length;f!!d.allBasenames);l&&(a.allBasenames=l.allBasenames);const c=t.reduce((d,u)=>u.allPaths?d.concat(u.allPaths):d,[]);return c.length&&(a.allPaths=c),a}const s=function(a,l,c){let d,u;for(let h=0,f=t.length;h!!a.allBasenames);o&&(s.allBasenames=o.allBasenames);const r=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return r.length&&(s.allPaths=r),s}function xLe(n,e,t){if(e===!1)return Xa;const i=$3(n,t);if(i===Xa)return Xa;if(typeof e=="boolean")return i;if(e){const s=e.when;if(typeof s=="string"){const o=(r,a,l,c)=>{if(!c||!i(r,a))return null;const d=s.replace("$(basename)",()=>l),u=c(d);return aT(u)?u.then(h=>h?n:null):u?n:null};return o.requiresSiblings=!0,o}}return i}function lG(n,e){const t=n.filter(a=>!!a.basenames);if(t.length<2)return n;const i=t.reduce((a,l)=>{const c=l.basenames;return c?a.concat(c):a},[]);let s;if(e){s=[];for(let a=0,l=i.length;a{const c=l.patterns;return c?a.concat(c):a},[]);const o=function(a,l){if(typeof a!="string")return null;if(!l){let d;for(d=a.length;d>0;d--){const u=a.charCodeAt(d-1);if(u===47||u===92)break}l=a.substr(d)}const c=i.indexOf(l);return c!==-1?s[c]:null};o.basenames=i,o.patterns=s,o.allBasenames=i;const r=n.filter(a=>!a.basenames);return r.push(o),r}function cG(n,e,t,i,s,o){if(Array.isArray(n)){let r=0;for(const a of n){const l=cG(a,e,t,i,s,o);if(l===10)return l;l>r&&(r=l)}return r}else{if(typeof n=="string")return i?n==="*"?5:n===t?10:0:0;if(n){const{language:r,pattern:a,scheme:l,hasAccessToAllModels:c,notebookType:d}=n;if(!i&&!c)return 0;d&&s&&(e=s);let u=0;if(l)if(l===e.scheme)u=10;else if(l==="*")u=5;else return 0;if(r)if(r===t)u=10;else if(r==="*")u=Math.max(u,5);else return 0;if(d)if(d===o)u=10;else if(d==="*"&&o!==void 0)u=Math.max(u,5);else return 0;if(a){let h;if(typeof a=="string"?h=a:h=Object.assign(Object.assign({},a),{base:wU(a.base)}),h===e.fsPath||wLe(h,e.fsPath))u=10;else return 0}return u}else return 0}}function dG(n){return typeof n=="string"?!1:Array.isArray(n)?n.every(dG):!!n.exclusive}class R6{constructor(e,t,i,s){this.uri=e,this.languageId=t,this.notebookUri=i,this.notebookType=s}equals(e){var t,i;return this.notebookType===e.notebookType&&this.languageId===e.languageId&&this.uri.toString()===e.uri.toString()&&((t=this.notebookUri)===null||t===void 0?void 0:t.toString())===((i=e.notebookUri)===null||i===void 0?void 0:i.toString())}}class ri{constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new B,this.onDidChange=this._onDidChange.event}register(e,t){let i={selector:e,provider:t,_score:-1,_time:this._clock++};return this._entries.push(i),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),Ye(()=>{if(i){const s=this._entries.indexOf(i);s>=0&&(this._entries.splice(s,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),i=void 0)}})}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e);const t=[];for(const i of this._entries)i._score>0&&t.push(i.provider);return t}ordered(e){const t=[];return this._orderedForEach(e,i=>t.push(i.provider)),t}orderedGroups(e){const t=[];let i,s;return this._orderedForEach(e,o=>{i&&s===o._score?i.push(o.provider):(s=o._score,i=[o.provider],t.push(i))}),t}_orderedForEach(e,t){this._updateScores(e);for(const i of this._entries)i._score>0&&t(i)}_updateScores(e){var t,i;const s=(t=this._notebookInfoResolver)===null||t===void 0?void 0:t.call(this,e.uri),o=s?new R6(e.uri,e.getLanguageId(),s.uri,s.type):new R6(e.uri,e.getLanguageId(),void 0,void 0);if(!(!((i=this._lastCandidate)===null||i===void 0)&&i.equals(o))){this._lastCandidate=o;for(const r of this._entries)if(r._score=cG(r.selector,o.uri,o.languageId,f_e(e),o.notebookUri,o.notebookType),dG(r.selector)&&r._score>0){for(const a of this._entries)a._score=0;r._score=1e3;break}this._entries.sort(ri._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._scoret._score?-1:w_(e.selector)&&!w_(t.selector)?1:!w_(e.selector)&&w_(t.selector)?-1:e._timet._time?-1:0}}function w_(n){return typeof n=="string"?!1:Array.isArray(n)?n.some(w_):!!n.isBuiltin}class LLe{constructor(){this.referenceProvider=new ri(this._score.bind(this)),this.renameProvider=new ri(this._score.bind(this)),this.codeActionProvider=new ri(this._score.bind(this)),this.definitionProvider=new ri(this._score.bind(this)),this.typeDefinitionProvider=new ri(this._score.bind(this)),this.declarationProvider=new ri(this._score.bind(this)),this.implementationProvider=new ri(this._score.bind(this)),this.documentSymbolProvider=new ri(this._score.bind(this)),this.inlayHintsProvider=new ri(this._score.bind(this)),this.colorProvider=new ri(this._score.bind(this)),this.codeLensProvider=new ri(this._score.bind(this)),this.documentFormattingEditProvider=new ri(this._score.bind(this)),this.documentRangeFormattingEditProvider=new ri(this._score.bind(this)),this.onTypeFormattingEditProvider=new ri(this._score.bind(this)),this.signatureHelpProvider=new ri(this._score.bind(this)),this.hoverProvider=new ri(this._score.bind(this)),this.documentHighlightProvider=new ri(this._score.bind(this)),this.selectionRangeProvider=new ri(this._score.bind(this)),this.foldingRangeProvider=new ri(this._score.bind(this)),this.linkProvider=new ri(this._score.bind(this)),this.inlineCompletionsProvider=new ri(this._score.bind(this)),this.completionProvider=new ri(this._score.bind(this)),this.linkedEditingRangeProvider=new ri(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new ri(this._score.bind(this)),this.documentSemanticTokensProvider=new ri(this._score.bind(this)),this.documentOnDropEditProvider=new ri(this._score.bind(this)),this.documentPasteEditProvider=new ri(this._score.bind(this))}_score(e){var t;return(t=this._notebookTypeResolver)===null||t===void 0?void 0:t.call(this,e)}}ft(it,LLe,1);const uG=rt("IWorkspaceEditService");class U3{constructor(e){this.metadata=e}static convert(e){return e.edits.map(t=>{if(sf.is(t))return sf.lift(t);if(Ep.is(t))return Ep.lift(t);throw new Error("Unsupported edit")})}}class sf extends U3{static is(e){return e instanceof sf?!0:Ls(e)&&Ue.isUri(e.resource)&&Ls(e.textEdit)}static lift(e){return e instanceof sf?e:new sf(e.resource,e.textEdit,e.versionId,e.metadata)}constructor(e,t,i=void 0,s){super(s),this.resource=e,this.textEdit=t,this.versionId=i}}class Ep extends U3{static is(e){return e instanceof Ep?!0:Ls(e)&&(!!e.newResource||!!e.oldResource)}static lift(e){return e instanceof Ep?e:new Ep(e.oldResource,e.newResource,e.options,e.metadata)}constructor(e,t,i={},s){super(s),this.oldResource=e,this.newResource=t,this.options=i}}const $n={enableSplitViewResizing:!0,splitViewDefaultRatio:.5,renderSideBySide:!0,renderMarginRevertIcon:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit",diffAlgorithm:"advanced",accessibilityVerbose:!1,experimental:{showMoves:!1,showEmptyDecorations:!0},hideUnchangedRegions:{enabled:!1,contextLineCount:3,minimumLineCount:3,revealLineCount:20},isInEmbeddedEditor:!1,onlyShowAccessibleDiffViewer:!1,renderSideBySideInlineBreakpoint:900,useInlineViewWhenSpaceIsLimited:!0},DLe=Object.freeze({id:"editor",order:5,type:"object",title:m("editorConfigurationTitle","Editor"),scope:5}),sx=Object.assign(Object.assign({},DLe),{properties:{"editor.tabSize":{type:"number",default:En.tabSize,minimum:1,markdownDescription:m("tabSize","The number of spaces a tab is equal to. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.indentSize":{anyOf:[{type:"string",enum:["tabSize"]},{type:"number",minimum:1}],default:"tabSize",markdownDescription:m("indentSize",'The number of spaces used for indentation or `"tabSize"` to use the value from `#editor.tabSize#`. This setting is overridden based on the file contents when `#editor.detectIndentation#` is on.')},"editor.insertSpaces":{type:"boolean",default:En.insertSpaces,markdownDescription:m("insertSpaces","Insert spaces when pressing `Tab`. This setting is overridden based on the file contents when {0} is on.","`#editor.detectIndentation#`")},"editor.detectIndentation":{type:"boolean",default:En.detectIndentation,markdownDescription:m("detectIndentation","Controls whether {0} and {1} will be automatically detected when a file is opened based on the file contents.","`#editor.tabSize#`","`#editor.insertSpaces#`")},"editor.trimAutoWhitespace":{type:"boolean",default:En.trimAutoWhitespace,description:m("trimAutoWhitespace","Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:En.largeFileOptimizations,description:m("largeFileOptimizations","Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{type:"boolean",default:!0,description:m("wordBasedSuggestions","Controls whether completions should be computed based on words in the document.")},"editor.wordBasedSuggestionsMode":{enum:["currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[m("wordBasedSuggestionsMode.currentDocument","Only suggest words from the active document."),m("wordBasedSuggestionsMode.matchingDocuments","Suggest words from all open documents of the same language."),m("wordBasedSuggestionsMode.allDocuments","Suggest words from all open documents.")],description:m("wordBasedSuggestionsMode","Controls from which documents word based completions are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[m("semanticHighlighting.true","Semantic highlighting enabled for all color themes."),m("semanticHighlighting.false","Semantic highlighting disabled for all color themes."),m("semanticHighlighting.configuredByTheme","Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:m("semanticHighlighting.enabled","Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:m("stablePeek","Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:m("maxTokenizationLineLength","Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!1,description:m("editor.experimental.asyncTokenization","Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:m("editor.experimental.asyncTokenizationLogging","Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:m("editor.experimental.asyncTokenizationVerification","Controls whether async tokenization should be verified against legacy background tokenization. Might slow down tokenization. For debugging only."),tags:["experimental"]},"editor.language.brackets":{type:["array","null"],default:null,description:m("schema.brackets","Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:m("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:m("schema.closeBracket","The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:m("schema.colorizedBracketPairs","Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),items:{type:"array",items:[{type:"string",description:m("schema.openBracket","The opening bracket character or string sequence.")},{type:"string",description:m("schema.closeBracket","The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:$n.maxComputationTime,description:m("maxComputationTime","Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:$n.maxFileSize,description:m("maxFileSize","Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:$n.renderSideBySide,description:m("sideBySide","Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:$n.renderSideBySideInlineBreakpoint,description:m("renderSideBySideInlineBreakpoint","If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:$n.useInlineViewWhenSpaceIsLimited,description:m("useInlineViewWhenSpaceIsLimited","If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:$n.renderMarginRevertIcon,description:m("renderMarginRevertIcon","When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:$n.ignoreTrimWhitespace,description:m("ignoreTrimWhitespace","When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:$n.renderIndicators,description:m("renderIndicators","Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:$n.diffCodeLens,description:m("codeLens","Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:$n.diffWordWrap,markdownEnumDescriptions:[m("wordWrap.off","Lines will never wrap."),m("wordWrap.on","Lines will wrap at the viewport width."),m("wordWrap.inherit","Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:$n.diffAlgorithm,markdownEnumDescriptions:[m("diffAlgorithm.legacy","Uses the legacy diffing algorithm."),m("diffAlgorithm.advanced","Uses the advanced diffing algorithm.")],tags:["experimental"]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:$n.hideUnchangedRegions.enabled,markdownDescription:m("hideUnchangedRegions.enabled","Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:$n.hideUnchangedRegions.revealLineCount,markdownDescription:m("hideUnchangedRegions.revealLineCount","Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:$n.hideUnchangedRegions.minimumLineCount,markdownDescription:m("hideUnchangedRegions.minimumLineCount","Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:$n.hideUnchangedRegions.contextLineCount,markdownDescription:m("hideUnchangedRegions.contextLineCount","Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:$n.experimental.showMoves,markdownDescription:m("showMoves","Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:$n.experimental.showEmptyDecorations,description:m("showEmptyDecorations","Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")}}});function kLe(n){return typeof n.type<"u"||typeof n.anyOf<"u"}for(const n of Bg){const e=n.schema;if(typeof e<"u")if(kLe(e))sx.properties[`editor.${n.name}`]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&(sx.properties[t]=e[t])}let fw=null;function hG(){return fw===null&&(fw=Object.create(null),Object.keys(sx.properties).forEach(n=>{fw[n]=!0})),fw}function ELe(n){return hG()[`editor.${n}`]||!1}function ALe(n){return hG()[`diffEditor.${n}`]||!1}const ILe=pn.as(Yf.Configuration);ILe.registerConfiguration(sx);class TLe{static insert(e,t){return{range:new N(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}}static delete(e){return{range:e,text:null}}static replace(e,t){return{range:e,text:t}}static replaceMove(e,t){return{range:e,text:t,forceMoveMarkers:!0}}}function K2(n){return Object.isFrozen(n)?n:cfe(n)}class kn{constructor(e={},t=[],i=[],s){this._contents=e,this._keys=t,this._overrides=i,this.raw=s,this.overrideConfigurations=new Map}get rawConfiguration(){var e;if(!this._rawConfiguration)if(!((e=this.raw)===null||e===void 0)&&e.length){const t=this.raw.map(i=>{if(i instanceof kn)return i;const s=new NLe("");return s.parseRaw(i),s.configurationModel});this._rawConfiguration=t.reduce((i,s)=>s===i?s:i.merge(s),t[0])}else this._rawConfiguration=this;return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}isEmpty(){return this._keys.length===0&&Object.keys(this._contents).length===0&&this._overrides.length===0}getValue(e){return e?b9(this.contents,e):this.contents}inspect(e,t){const i=this.rawConfiguration.getValue(e),s=t?this.rawConfiguration.getOverrideValue(e,t):void 0,o=t?this.rawConfiguration.override(t).getValue(e):i;return{value:i,override:s,merged:o}}getOverrideValue(e,t){const i=this.getContentsForOverrideIdentifer(t);return i?e?b9(i,e):i:void 0}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){var t,i;const s=Rl(this.contents),o=Rl(this.overrides),r=[...this.keys],a=!((t=this.raw)===null||t===void 0)&&t.length?[...this.raw]:[this];for(const l of e)if(a.push(...!((i=l.raw)===null||i===void 0)&&i.length?l.raw:[l]),!l.isEmpty()){this.mergeContents(s,l.contents);for(const c of l.overrides){const[d]=o.filter(u=>Yi(u.identifiers,c.identifiers));d?(this.mergeContents(d.contents,c.contents),d.keys.push(...c.keys),d.keys=vf(d.keys)):o.push(Rl(c))}for(const c of l.keys)r.indexOf(c)===-1&&r.push(c)}return new kn(s,r,o,a.every(l=>l instanceof kn)?void 0:a)}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||typeof t!="object"||!Object.keys(t).length)return this;const i={};for(const s of vf([...Object.keys(this.contents),...Object.keys(t)])){let o=this.contents[s];const r=t[s];r&&(typeof o=="object"&&typeof r=="object"?(o=Rl(o),this.mergeContents(o,r)):o=r),i[s]=o}return new kn(i,this.keys,this.overrides)}mergeContents(e,t){for(const i of Object.keys(t)){if(i in e&&Ls(e[i])&&Ls(t[i])){this.mergeContents(e[i],t[i]);continue}e[i]=Rl(t[i])}}getContentsForOverrideIdentifer(e){let t=null,i=null;const s=o=>{o&&(i?this.mergeContents(i,o):i=Rl(o))};for(const o of this.overrides)o.identifiers.length===1&&o.identifiers[0]===e?t=o.contents:o.identifiers.includes(e)&&s(o.contents);return s(t),i}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}addValue(e,t){this.updateValue(e,t,!0)}setValue(e,t){this.updateValue(e,t,!1)}removeValue(e){const t=this.keys.indexOf(e);t!==-1&&(this.keys.splice(t,1),E0e(this.contents,e),su.test(e)&&this.overrides.splice(this.overrides.findIndex(i=>Yi(i.identifiers,AS(e))),1))}updateValue(e,t,i){vj(this.contents,e,t,s=>console.error(s)),i=i||this.keys.indexOf(e)===-1,i&&this.keys.push(e),su.test(e)&&this.overrides.push({identifiers:AS(e),keys:Object.keys(this.contents[e]),contents:dT(this.contents[e],s=>console.error(s))})}}class NLe{constructor(e){this._name=e,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||new kn}parseRaw(e,t){this._raw=e;const{contents:i,keys:s,overrides:o,restricted:r,hasExcludedProperties:a}=this.doParseRaw(e,t);this._configurationModel=new kn(i,s,o,a?[e]:void 0),this._restrictedConfigurations=r||[]}doParseRaw(e,t){const i=pn.as(Yf.Configuration).getConfigurationProperties(),s=this.filter(e,i,!0,t);e=s.raw;const o=dT(e,l=>console.error(`Conflict in settings file ${this._name}: ${l}`)),r=Object.keys(e),a=this.toOverrides(e,l=>console.error(`Conflict in settings file ${this._name}: ${l}`));return{contents:o,keys:r,overrides:a,restricted:s.restricted,hasExcludedProperties:s.hasExcludedProperties}}filter(e,t,i,s){var o,r,a;let l=!1;if(!(s!=null&&s.scopes)&&!(s!=null&&s.skipRestricted)&&!(!((o=s==null?void 0:s.exclude)===null||o===void 0)&&o.length))return{raw:e,restricted:[],hasExcludedProperties:l};const c={},d=[];for(const u in e)if(su.test(u)&&i){const h=this.filter(e[u],t,!1,s);c[u]=h.raw,l=l||h.hasExcludedProperties,d.push(...h.restricted)}else{const h=t[u],f=h?typeof h.scope<"u"?h.scope:3:void 0;h!=null&&h.restricted&&d.push(u),!(!((r=s.exclude)===null||r===void 0)&&r.includes(u))&&(!((a=s.include)===null||a===void 0)&&a.includes(u)||(f===void 0||s.scopes===void 0||s.scopes.includes(f))&&!(s.skipRestricted&&(h!=null&&h.restricted)))?c[u]=e[u]:l=!0}return{raw:c,restricted:d,hasExcludedProperties:l}}toOverrides(e,t){const i=[];for(const s of Object.keys(e))if(su.test(s)){const o={};for(const r in e[s])o[r]=e[s][r];i.push({identifiers:AS(s),keys:Object.keys(o),contents:dT(o,t)})}return i}}class RLe{constructor(e,t,i,s,o,r,a,l,c,d,u,h,f){this.key=e,this.overrides=t,this._value=i,this.overrideIdentifiers=s,this.defaultConfiguration=o,this.policyConfiguration=r,this.applicationConfiguration=a,this.userConfiguration=l,this.localUserConfiguration=c,this.remoteUserConfiguration=d,this.workspaceConfiguration=u,this.folderConfigurationModel=h,this.memoryConfigurationModel=f}inspect(e,t,i){const s=e.inspect(t,i);return{get value(){return K2(s.value)},get override(){return K2(s.override)},get merged(){return K2(s.merged)}}}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.inspect(this.userConfiguration,this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get user(){return this.userInspectValue.value!==void 0||this.userInspectValue.override!==void 0?{value:this.userInspectValue.value,override:this.userInspectValue.override}:void 0}}class yD{constructor(e,t,i,s,o=new kn,r=new kn,a=new An,l=new kn,c=new An){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=i,this._localUserConfiguration=s,this._remoteUserConfiguration=o,this._workspaceConfiguration=r,this._folderConfigurations=a,this._memoryConfiguration=l,this._memoryConfigurationByResource=c,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new An,this._userConfiguration=null}getValue(e,t,i){return this.getConsolidatedConfigurationModel(e,t,i).getValue(e)}updateValue(e,t,i={}){let s;i.resource?(s=this._memoryConfigurationByResource.get(i.resource),s||(s=new kn,this._memoryConfigurationByResource.set(i.resource,s))):s=this._memoryConfiguration,t===void 0?s.removeValue(e):s.setValue(e,t),i.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,i){const s=this.getConsolidatedConfigurationModel(e,t,i),o=this.getFolderConfigurationModelForResource(t.resource,i),r=t.resource?this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration:this._memoryConfiguration,a=new Set;for(const l of s.overrides)for(const c of l.identifiers)s.getOverrideValue(e,c)!==void 0&&a.add(c);return new RLe(e,t,s.getValue(e),a.size?[...a]:void 0,this._defaultConfiguration,this._policyConfiguration.isEmpty()?void 0:this._policyConfiguration,this.applicationConfiguration.isEmpty()?void 0:this.applicationConfiguration,this.userConfiguration,this.localUserConfiguration,this.remoteUserConfiguration,i?this._workspaceConfiguration:void 0,o||void 0,r)}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){return this._userConfiguration||(this._userConfiguration=this._remoteUserConfiguration.isEmpty()?this._localUserConfiguration:this._localUserConfiguration.merge(this._remoteUserConfiguration)),this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}getConsolidatedConfigurationModel(e,t,i){let s=this.getConsolidatedConfigurationModelForResource(t,i);return t.overrideIdentifier&&(s=s.override(t.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(e)!==void 0&&(s=s.merge(this._policyConfiguration)),s}getConsolidatedConfigurationModelForResource({resource:e},t){let i=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const s=t.getFolder(e);s&&(i=this.getFolderConsolidatedConfiguration(s.uri)||i);const o=this._memoryConfigurationByResource.get(e);o&&(i=i.merge(o))}return i}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let t=this._foldersConsolidatedConfigurations.get(e);if(!t){const i=this.getWorkspaceConsolidatedConfiguration(),s=this._folderConfigurations.get(e);s?(t=i.merge(s),this._foldersConsolidatedConfigurations.set(e,t)):t=i}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){const i=t.getFolder(e);if(i)return this._folderConfigurations.get(i.uri)}}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},policy:{contents:this._policyConfiguration.contents,overrides:this._policyConfiguration.overrides,keys:this._policyConfiguration.keys},application:{contents:this.applicationConfiguration.contents,overrides:this.applicationConfiguration.overrides,keys:this.applicationConfiguration.keys},user:{contents:this.userConfiguration.contents,overrides:this.userConfiguration.overrides,keys:this.userConfiguration.keys},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce((e,t)=>{const{contents:i,overrides:s,keys:o}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:s,keys:o}]),e},[])}}static parse(e){const t=this.parseConfigurationModel(e.defaults),i=this.parseConfigurationModel(e.policy),s=this.parseConfigurationModel(e.application),o=this.parseConfigurationModel(e.user),r=this.parseConfigurationModel(e.workspace),a=e.folders.reduce((l,c)=>(l.set(Ue.revive(c[0]),this.parseConfigurationModel(c[1])),l),new An);return new yD(t,i,s,o,new kn,r,a,new kn,new An)}static parseConfigurationModel(e){return new kn(e.contents,e.keys,e.overrides)}}class MLe{constructor(e,t,i,s){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=s,this._marker=` +`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=46,this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const o of e.keys)this.affectedKeys.add(o);for(const[,o]of e.overrides)for(const r of o)this.affectedKeys.add(r);this._affectsConfigStr=this._marker;for(const o of this.affectedKeys)this._affectsConfigStr+=o+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=yD.parse(this.previous.data)),this._previousConfiguration}affectsConfiguration(e,t){var i;const s=this._marker+e,o=this._affectsConfigStr.indexOf(s);if(o<0)return!1;const r=o+s.length;if(r>=this._affectsConfigStr.length)return!1;const a=this._affectsConfigStr.charCodeAt(r);if(a!==this._markerCode1&&a!==this._markerCode2)return!1;if(t){const l=this.previousConfiguration?this.previousConfiguration.getValue(e,t,(i=this.previous)===null||i===void 0?void 0:i.workspace):void 0,c=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!Co(l,c)}return!0}}const ox={kind:0},PLe={kind:1};function OLe(n,e,t){return{kind:2,commandId:n,commandArgs:e,isBubble:t}}class J_{constructor(e,t,i){var s;this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const o of e){const r=o.command;r&&r.charAt(0)!=="-"&&this._defaultBoundCommands.set(r,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=J_.handleRemovals([].concat(e).concat(t));for(let o=0,r=this._keybindings.length;o"u"){this._map.set(e,[t]),this._addToLookupMap(t);return}for(let s=i.length-1;s>=0;s--){const o=i[s];if(o.command===t.command)continue;let r=!0;for(let a=1;a"u"?(t=[e],this._lookupMap.set(e.command,t)):t.push(e)}_removeFromLookupMap(e){if(!e.command)return;const t=this._lookupMap.get(e.command);if(!(typeof t>"u")){for(let i=0,s=t.length;i"u"||i.length===0)return null;if(i.length===1)return i[0];for(let s=i.length-1;s>=0;s--){const o=i[s];if(t.contextMatchesRules(o.when))return o}return i[i.length-1]}resolve(e,t,i){const s=[...t,i];this._log(`| Resolving ${s}`);const o=this._map.get(s[0]);if(o===void 0)return this._log("\\ No keybinding entries."),ox;let r=null;if(s.length<2)r=o;else{r=[];for(let l=0,c=o.length;ld.chords.length)continue;let u=!0;for(let h=1;h=0;i--){const s=t[i];if(J_._contextMatchesRules(e,s.when))return s}return null}static _contextMatchesRules(e,t){return t?t.evaluate(e):!0}}function M6(n){return n?`${n.serialize()}`:"no when condition"}function P6(n){return n.extensionId?n.isBuiltinExtension?`built-in extension ${n.extensionId}`:`user extension ${n.extensionId}`:n.isDefault?"built-in":"user"}const FLe=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class BLe extends Y{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:ue.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,i,s,o){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=i,this._notificationService=s,this._logService=o,this._onDidUpdateKeybindings=this._register(new B),this._currentChords=[],this._currentChordChecker=new Y1,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=ep.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new Lc,this._logging=!1}dispose(){super.dispose()}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getKeybindings(){return this._getResolver().getKeybindings()}lookupKeybinding(e,t){const i=this._getResolver().lookupPrimaryKeybinding(e,t||this._contextKeyService);if(i)return i.resolvedKeybinding}dispatchEvent(e,t){return this._dispatch(e,t)}softDispatch(e,t){this._log("/ Soft dispatching keyboard event");const i=this.resolveKeyboardEvent(e);if(i.hasMultipleChords())return console.warn("keyboard event should not be mapped to multiple chords"),ox;const[s]=i.getDispatchChords();if(s===null)return this._log("\\ Keyboard event cannot be dispatched"),ox;const o=this._contextKeyService.getContext(t),r=this._currentChords.map(({keypress:a})=>a);return this._getResolver().resolve(o,r,s)}_scheduleLeaveChordMode(){const e=Date.now();this._currentChordChecker.cancelAndSet(()=>{if(!this._documentHasFocus()){this._leaveChordMode();return}Date.now()-e>5e3&&this._leaveChordMode()},500)}_expectAnotherChord(e,t){switch(this._currentChords.push({keypress:e,label:t}),this._currentChords.length){case 0:throw E4("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(m("first.chord","({0}) was pressed. Waiting for second key of chord...",t));break;default:{const i=this._currentChords.map(({label:s})=>s).join(", ");this._currentChordStatusMessage=this._notificationService.status(m("next.chord","({0}) was pressed. Waiting for next key of chord...",i))}}this._scheduleLeaveChordMode(),z_.enabled&&z_.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],z_.enable()}_dispatch(e,t){return this._doDispatch(this.resolveKeyboardEvent(e),t,!1)}_singleModifierDispatch(e,t){const i=this.resolveKeyboardEvent(e),[s]=i.getSingleModifierDispatchChords();if(s)return this._ignoreSingleModifiers.has(s)?(this._log(`+ Ignoring single modifier ${s} due to it being pressed together with other keys.`),this._ignoreSingleModifiers=ep.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=ep.EMPTY,this._currentSingleModifier===null?(this._log(`+ Storing single modifier for possible chord ${s}.`),this._currentSingleModifier=s,this._currentSingleModifierClearTimeout.cancelAndSet(()=>{this._log("+ Clearing single modifier due to 300ms elapsed."),this._currentSingleModifier=null},300),!1):s===this._currentSingleModifier?(this._log(`/ Dispatching single modifier chord ${s} ${s}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,this._doDispatch(i,t,!0)):(this._log(`+ Clearing single modifier due to modifier mismatch: ${this._currentSingleModifier} ${s}`),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1));const[o]=i.getChords();return this._ignoreSingleModifiers=new ep(o),this._currentSingleModifier!==null&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,i=!1){var s;let o=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let r=null,a=null;if(i){const[u]=e.getSingleModifierDispatchChords();r=u,a=u?[u]:[]}else[r]=e.getDispatchChords(),a=this._currentChords.map(({keypress:u})=>u);if(r===null)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),o;const l=this._contextKeyService.getContext(t),c=e.getLabel(),d=this._getResolver().resolve(l,a,r);switch(d.kind){case 0:{if(this._logService.trace("KeybindingService#dispatch",c,"[ No matching keybinding ]"),this.inChordMode){const u=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving multi-chord mode: Nothing bound to "${u}, ${c}".`),this._notificationService.status(m("missing.chord","The key combination ({0}, {1}) is not a command.",u,c),{hideAfter:10*1e3}),this._leaveChordMode(),o=!0}return o}case 1:return this._logService.trace("KeybindingService#dispatch",c,"[ Several keybindings match - more chords needed ]"),o=!0,this._expectAnotherChord(r,c),this._log(this._currentChords.length===1?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),o;case 2:{if(this._logService.trace("KeybindingService#dispatch",c,`[ Will dispatch command ${d.commandId} ]`),d.commandId===null||d.commandId===""){if(this.inChordMode){const u=this._currentChords.map(({label:h})=>h).join(", ");this._log(`+ Leaving chord mode: Nothing bound to "${u}, ${c}".`),this._notificationService.status(m("missing.chord","The key combination ({0}, {1}) is not a command.",u,c),{hideAfter:10*1e3}),this._leaveChordMode(),o=!0}}else this.inChordMode&&this._leaveChordMode(),d.isBubble||(o=!0),this._log(`+ Invoking command ${d.commandId}.`),typeof d.commandArgs>"u"?this._commandService.executeCommand(d.commandId).then(void 0,u=>this._notificationService.warn(u)):this._commandService.executeCommand(d.commandId,d.commandArgs).then(void 0,u=>this._notificationService.warn(u)),FLe.test(d.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:d.commandId,from:"keybinding",detail:(s=e.getUserSettingsLabel())!==null&&s!==void 0?s:void 0});return o}}}mightProducePrintableCharacter(e){return e.ctrlKey||e.metaKey?!1:e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30}}class ep{constructor(e){this._ctrlKey=e?e.ctrlKey:!1,this._shiftKey=e?e.shiftKey:!1,this._altKey=e?e.altKey:!1,this._metaKey=e?e.metaKey:!1}has(e){switch(e){case"ctrl":return this._ctrlKey;case"shift":return this._shiftKey;case"alt":return this._altKey;case"meta":return this._metaKey}}}ep.EMPTY=new ep(null);class O6{constructor(e,t,i,s,o,r,a){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?nN(e.getDispatchChords()):[],e&&this.chords.length===0&&(this.chords=nN(e.getSingleModifierDispatchChords())),this.bubble=t?t.charCodeAt(0)===94:!1,this.command=this.bubble?t.substr(1):t,this.commandArgs=i,this.when=s,this.isDefault=o,this.extensionId=r,this.isBuiltinExtension=a}}function nN(n){const e=[];for(let t=0,i=n.length;tthis._getLabel(e))}getAriaLabel(){return WLe.toLabel(this._os,this._chords,e=>this._getAriaLabel(e))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:VLe.toLabel(this._os,this._chords,e=>this._getElectronAccelerator(e))}getUserSettingsLabel(){return zLe.toLabel(this._os,this._chords,e=>this._getUserSettingsLabel(e))}hasMultipleChords(){return this._chords.length>1}getChords(){return this._chords.map(e=>this._getChord(e))}_getChord(e){return new Bpe(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,this._getLabel(e),this._getAriaLabel(e))}getDispatchChords(){return this._chords.map(e=>this._getChordDispatch(e))}getSingleModifierDispatchChords(){return this._chords.map(e=>this._getSingleModifierChordDispatch(e))}}class yv extends $Le{constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(this._os===2)switch(e){case 15:return"←";case 16:return"↑";case 17:return"→";case 18:return"↓"}return zl.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":zl.toString(e.keyCode)}_getElectronAccelerator(e){return zl.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=zl.toUserSettingsUS(e.keyCode);return t&&t.toLowerCase()}_getChordDispatch(e){return yv.getDispatchStr(e)}static getDispatchStr(e){if(e.isModifierKey())return null;let t="";return e.ctrlKey&&(t+="ctrl+"),e.shiftKey&&(t+="shift+"),e.altKey&&(t+="alt+"),e.metaKey&&(t+="meta+"),t+=zl.toString(e.keyCode),t}_getSingleModifierChordDispatch(e){return e.keyCode===5&&!e.shiftKey&&!e.altKey&&!e.metaKey?"ctrl":e.keyCode===4&&!e.ctrlKey&&!e.altKey&&!e.metaKey?"shift":e.keyCode===6&&!e.ctrlKey&&!e.shiftKey&&!e.metaKey?"alt":e.keyCode===57&&!e.ctrlKey&&!e.shiftKey&&!e.altKey?"meta":null}static _scanCodeToKeyCode(e){const t=R4[e];if(t!==-1)return t;switch(e){case 10:return 31;case 11:return 32;case 12:return 33;case 13:return 34;case 14:return 35;case 15:return 36;case 16:return 37;case 17:return 38;case 18:return 39;case 19:return 40;case 20:return 41;case 21:return 42;case 22:return 43;case 23:return 44;case 24:return 45;case 25:return 46;case 26:return 47;case 27:return 48;case 28:return 49;case 29:return 50;case 30:return 51;case 31:return 52;case 32:return 53;case 33:return 54;case 34:return 55;case 35:return 56;case 36:return 22;case 37:return 23;case 38:return 24;case 39:return 25;case 40:return 26;case 41:return 27;case 42:return 28;case 43:return 29;case 44:return 30;case 45:return 21;case 51:return 88;case 52:return 86;case 53:return 92;case 54:return 94;case 55:return 93;case 56:return 0;case 57:return 85;case 58:return 95;case 59:return 91;case 60:return 87;case 61:return 89;case 62:return 90;case 106:return 97}return 0}static _toKeyCodeChord(e){if(!e)return null;if(e instanceof wf)return e;const t=this._scanCodeToKeyCode(e.scanCode);return t===0?null:new wf(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const i=nN(e.chords.map(s=>this._toKeyCodeChord(s)));return i.length>0?[new yv(i,t)]:[]}}const CD=rt("labelService"),ULe=rt("progressService");class Ap{constructor(e,t){this.callback=e,this.report=t!=null&&t.async?this._reportAsync.bind(this):this._reportSync.bind(this)}_reportSync(e){this._value=e,this.callback(this._value)}_reportAsync(e){Promise.resolve(this._lastTask).finally(()=>{this._value=e;const t=this.callback(this._value);this._lastTask=Promise.resolve(t).finally(()=>this._lastTask=void 0)})}}Ap.None=Object.freeze({report(){}});const oy=rt("editorProgressService");class jLe{constructor(){this._value="",this._pos=0}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos=0;t--,this._valueLen--){const i=this._value.charCodeAt(t);if(!(i===47||this._splitOnBackslash&&i===92))break}return this.next()}hasNext(){return this._to!1,t=()=>!1){return new eb(new KLe(e,t))}static forStrings(){return new eb(new jLe)}static forConfigKeys(){return new eb(new qLe)}constructor(e){this._iter=e}clear(){this._root=void 0}set(e,t){const i=this._iter.reset(e);let s;this._root||(this._root=new gw,this._root.segment=i.value());const o=[];for(s=this._root;;){const a=i.cmp(s.segment);if(a>0)s.left||(s.left=new gw,s.left.segment=i.value()),o.push([-1,s]),s=s.left;else if(a<0)s.right||(s.right=new gw,s.right.segment=i.value()),o.push([1,s]),s=s.right;else if(i.hasNext())i.next(),s.mid||(s.mid=new gw,s.mid.segment=i.value()),o.push([0,s]),s=s.mid;else break}const r=s.value;s.value=t,s.key=e;for(let a=o.length-1;a>=0;a--){const l=o[a][1];l.updateHeight();const c=l.balanceFactor();if(c<-1||c>1){const d=o[a][0],u=o[a+1][0];if(d===1&&u===1)o[a][1]=l.rotateLeft();else if(d===-1&&u===-1)o[a][1]=l.rotateRight();else if(d===1&&u===-1)l.right=o[a+1][1]=o[a+1][1].rotateRight(),o[a][1]=l.rotateLeft();else if(d===-1&&u===1)l.left=o[a+1][1]=o[a+1][1].rotateLeft(),o[a][1]=l.rotateRight();else throw new Error;if(a>0)switch(o[a-1][0]){case-1:o[a-1][1].left=o[a][1];break;case 1:o[a-1][1].right=o[a][1];break;case 0:o[a-1][1].mid=o[a][1];break}else this._root=o[0][1]}}return r}get(e){var t;return(t=this._getNode(e))===null||t===void 0?void 0:t.value}_getNode(e){const t=this._iter.reset(e);let i=this._root;for(;i;){const s=t.cmp(i.segment);if(s>0)i=i.left;else if(s<0)i=i.right;else if(t.hasNext())t.next(),i=i.mid;else break}return i}has(e){const t=this._getNode(e);return!((t==null?void 0:t.value)===void 0&&(t==null?void 0:t.mid)===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){var i;const s=this._iter.reset(e),o=[];let r=this._root;for(;r;){const a=s.cmp(r.segment);if(a>0)o.push([-1,r]),r=r.left;else if(a<0)o.push([1,r]),r=r.right;else if(s.hasNext())s.next(),o.push([0,r]),r=r.mid;else break}if(r){if(t?(r.left=void 0,r.mid=void 0,r.right=void 0,r.height=1):(r.key=void 0,r.value=void 0),!r.mid&&!r.value)if(r.left&&r.right){const a=this._min(r.right);if(a.key){const{key:l,value:c,segment:d}=a;this._delete(a.key,!1),r.key=l,r.value=c,r.segment=d}}else{const a=(i=r.left)!==null&&i!==void 0?i:r.right;if(o.length>0){const[l,c]=o[o.length-1];switch(l){case-1:c.left=a;break;case 0:c.mid=a;break;case 1:c.right=a;break}}else this._root=a}for(let a=o.length-1;a>=0;a--){const l=o[a][1];l.updateHeight();const c=l.balanceFactor();if(c>1?(l.right.balanceFactor()>=0||(l.right=l.right.rotateRight()),o[a][1]=l.rotateLeft()):c<-1&&(l.left.balanceFactor()<=0||(l.left=l.left.rotateLeft()),o[a][1]=l.rotateRight()),a>0)switch(o[a-1][0]){case-1:o[a-1][1].left=o[a][1];break;case 1:o[a-1][1].right=o[a][1];break;case 0:o[a-1][1].mid=o[a][1];break}else this._root=o[0][1]}}}_min(e){for(;e.left;)e=e.left;return e}findSubstr(e){const t=this._iter.reset(e);let i=this._root,s;for(;i;){const o=t.cmp(i.segment);if(o>0)i=i.left;else if(o<0)i=i.right;else if(t.hasNext())t.next(),s=i.value||s,i=i.mid;else break}return i&&i.value||s}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const i=this._iter.reset(e);let s=this._root;for(;s;){const o=i.cmp(s.segment);if(o>0)s=s.left;else if(o<0)s=s.right;else if(i.hasNext())i.next(),s=s.mid;else return s.mid?this._entries(s.mid):t?s.value:void 0}}forEach(e){for(const[t,i]of this)e(i,t)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){const t=[];return this._dfsEntries(e,t),t[Symbol.iterator]()}_dfsEntries(e,t){e&&(e.left&&this._dfsEntries(e.left,t),e.value&&t.push([e.key,e.value]),e.mid&&this._dfsEntries(e.mid,t),e.right&&this._dfsEntries(e.right,t))}}const YLe=rt("contextService");class ZLe{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}}const XLe="code-workspace";m("codeWorkspace","Code Workspace");const QLe="4064f6ec-cb38-4ad0-af64-ee6467e63c82";var F6;(function(n){n.inspectTokensAction=m("inspectTokens","Developer: Inspect Tokens")})(F6||(F6={}));var B6;(function(n){n.gotoLineActionLabel=m("gotoLineActionLabel","Go to Line/Column...")})(B6||(B6={}));var W6;(function(n){n.helpQuickAccessActionLabel=m("helpQuickAccess","Show all Quick Access Providers")})(W6||(W6={}));var V6;(function(n){n.quickCommandActionLabel=m("quickCommandActionLabel","Command Palette"),n.quickCommandHelp=m("quickCommandActionHelp","Show And Run Commands")})(V6||(V6={}));var z6;(function(n){n.quickOutlineActionLabel=m("quickOutlineActionLabel","Go to Symbol..."),n.quickOutlineByCategoryActionLabel=m("quickOutlineByCategoryActionLabel","Go to Symbol by Category...")})(z6||(z6={}));var rx;(function(n){n.editorViewAccessibleLabel=m("editorViewAccessibleLabel","Editor content"),n.accessibilityHelpMessage=m("accessibilityHelpMessage","Press Alt+F1 for Accessibility Options.")})(rx||(rx={}));var H6;(function(n){n.toggleHighContrast=m("toggleHighContrast","Toggle High Contrast Theme")})(H6||(H6={}));var sN;(function(n){n.bulkEditServiceSummary=m("bulkEditServiceSummary","Made {0} edits in {1} files")})(sN||(sN={}));const JLe=rt("workspaceTrustManagementService"),Tu=rt("contextViewService"),Nu=rt("contextMenuService");var Ln;(function(n){function e(o,r){if(o.start>=r.end||r.start>=o.end)return{start:0,end:0};const a=Math.max(o.start,r.start),l=Math.min(o.end,r.end);return l-a<=0?{start:0,end:0}:{start:a,end:l}}n.intersect=e;function t(o){return o.end-o.start<=0}n.isEmpty=t;function i(o,r){return!t(e(o,r))}n.intersects=i;function s(o,r){const a=[],l={start:o.start,end:Math.min(r.start,o.end)},c={start:Math.max(r.end,o.start),end:o.end};return t(l)||a.push(l),t(c)||a.push(c),a}n.relativeComplement=s})(Ln||(Ln={}));function eDe(n){const e=n;return!!e&&typeof e.x=="number"&&typeof e.y=="number"}var vd;(function(n){n[n.AVOID=0]="AVOID",n[n.ALIGN=1]="ALIGN"})(vd||(vd={}));function tp(n,e,t){const i=t.mode===vd.ALIGN?t.offset:t.offset+t.size,s=t.mode===vd.ALIGN?t.offset+t.size:t.offset;return t.position===0?e<=n-i?i:e<=s?s-e:Math.max(n-e,0):e<=s?s-e:e<=n-i?i:0}class Pm extends Y{constructor(e,t){super(),this.container=null,this.delegate=null,this.toDisposeOnClean=Y.None,this.toDisposeOnSetContainer=Y.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=ye(".context-view"),this.useFixedPosition=!1,this.useShadowDOM=!1,cd(this.view),this.setContainer(e,t),this._register(Ye(()=>this.setContainer(null,1)))}setContainer(e,t){var i;if(this.container&&(this.toDisposeOnSetContainer.dispose(),this.shadowRoot?(this.shadowRoot.removeChild(this.view),this.shadowRoot=null,(i=this.shadowRootHostElement)===null||i===void 0||i.remove(),this.shadowRootHostElement=null):this.container.removeChild(this.view),this.container=null),e){if(this.container=e,this.useFixedPosition=t!==1,this.useShadowDOM=t===3,this.useShadowDOM){this.shadowRootHostElement=ye(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const o=document.createElement("style");o.textContent=tDe,this.shadowRoot.appendChild(o),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(ye("slot"))}else this.container.appendChild(this.view);const s=new pe;Pm.BUBBLE_UP_EVENTS.forEach(o=>{s.add(Ui(this.container,o,r=>{this.onDOMEvent(r,!1)}))}),Pm.BUBBLE_DOWN_EVENTS.forEach(o=>{s.add(Ui(this.container,o,r=>{this.onDOMEvent(r,!0)},!0))}),this.toDisposeOnSetContainer=s}}show(e){var t,i;this.isVisible()&&this.hide(),xo(this.view),this.view.className="context-view",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex="2575",this.view.style.position=this.useFixedPosition?"fixed":"absolute",Xh(this.view),this.toDisposeOnClean=e.render(this.view)||Y.None,this.delegate=e,this.doLayout(),(i=(t=this.delegate).focus)===null||i===void 0||i.call(t)}getViewElement(){return this.view}layout(){if(this.isVisible()){if(this.delegate.canRelayout===!1&&!(eu&&K4.pointerEvents)){this.hide();return}this.delegate.layout&&this.delegate.layout(),this.doLayout()}}doLayout(){if(!this.isVisible())return;const e=this.delegate.getAnchor();let t;if(Z4(e)){const u=Tn(e),h=Ame(e);t={top:u.top*h,left:u.left*h,width:u.width*h,height:u.height*h}}else eDe(e)?t={top:e.y,left:e.x,width:e.width||1,height:e.height||2}:t={top:e.posy,left:e.posx,width:2,height:2};const i=ys(this.view),s=Dh(this.view),o=this.delegate.anchorPosition||0,r=this.delegate.anchorAlignment||0,a=this.delegate.anchorAxisAlignment||0;let l,c;if(a===0){const u={offset:t.top-window.pageYOffset,size:t.height,position:o===0?0:1},h={offset:t.left,size:t.width,position:r===0?0:1,mode:vd.ALIGN};l=tp(window.innerHeight,s,u)+window.pageYOffset,Ln.intersects({start:l,end:l+s},{start:u.offset,end:u.offset+u.size})&&(h.mode=vd.AVOID),c=tp(window.innerWidth,i,h)}else{const u={offset:t.left,size:t.width,position:r===0?0:1},h={offset:t.top,size:t.height,position:o===0?0:1,mode:vd.ALIGN};c=tp(window.innerWidth,i,u),Ln.intersects({start:c,end:c+i},{start:u.offset,end:u.offset+u.size})&&(h.mode=vd.AVOID),l=tp(window.innerHeight,s,h)+window.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(o===0?"bottom":"top"),this.view.classList.add(r===0?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const d=Tn(this.container);this.view.style.top=`${l-(this.useFixedPosition?Tn(this.view).top:d.top)}px`,this.view.style.left=`${c-(this.useFixedPosition?Tn(this.view).left:d.left)}px`,this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,t!=null&&t.onHide&&t.onHide(e),this.toDisposeOnClean.dispose(),cd(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,document.activeElement):t&&!wn(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}Pm.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"];Pm.BUBBLE_DOWN_EVENTS=["click"];const tDe=` :host { all: initial; /* 1st rule so subsequent properties are reset. */ } @@ -3004,37 +2805,37 @@ Received: '{1}'.`,e,Ia.getLexeme(t)),o=t.offset,r=Ia.getLexeme(t);return this._p :host-context(.linux:lang(zh-Hant)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans TC", "Source Han Sans TW", "Source Han Sans", sans-serif; } :host-context(.linux:lang(ja)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans J", "Source Han Sans JP", "Source Han Sans", sans-serif; } :host-context(.linux:lang(ko)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans K", "Source Han Sans JR", "Source Han Sans", "UnDotum", "FBaekmuk Gulim", sans-serif; } -`;var OLe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},FLe=function(n,e){return function(t,i){e(t,i,n)}};let aN=class extends Y{constructor(e){super(),this.layoutService=e,this.currentViewDisposable=Y.None,this.container=e.hasContainer?e.container:null,this.contextView=this._register(new Nm(this.container,1)),this.layout(),this._register(e.onDidLayout(()=>this.layout()))}setContainer(e,t){this.contextView.setContainer(e,t||1)}showContextView(e,t,i){t?(t!==this.container||this.shadowRoot!==i)&&(this.container=t,this.setContainer(t,i?3:2)):this.layoutService.hasContainer&&this.container!==this.layoutService.container&&(this.container=this.layoutService.container,this.setContainer(this.container,1)),this.shadowRoot=i,this.contextView.show(e);const s=Ze(()=>{this.currentViewDisposable===s&&this.hideContextView()});return this.currentViewDisposable=s,s}getContextViewElement(){return this.contextView.getViewElement()}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e)}};aN=OLe([FLe(0,r0)],aN);let Rm=[],KP=[],gG=[];function ww(n,e=!1){BLe(n,!1,e)}function BLe(n,e,t){const i=WLe(n,e);Rm.push(i),i.userConfigured?gG.push(i):KP.push(i),t&&!i.userConfigured&&Rm.forEach(s=>{s.mime===i.mime||s.userConfigured||(i.extension&&s.extension===i.extension&&console.warn(`Overwriting extension <<${i.extension}>> to now point to mime <<${i.mime}>>`),i.filename&&s.filename===i.filename&&console.warn(`Overwriting filename <<${i.filename}>> to now point to mime <<${i.mime}>>`),i.filepattern&&s.filepattern===i.filepattern&&console.warn(`Overwriting filepattern <<${i.filepattern}>> to now point to mime <<${i.mime}>>`),i.firstline&&s.firstline===i.firstline&&console.warn(`Overwriting firstline <<${i.firstline}>> to now point to mime <<${i.mime}>>`))})}function WLe(n,e){return{id:n.id,mime:n.mime,filename:n.filename,extension:n.extension,filepattern:n.filepattern,firstline:n.firstline,userConfigured:e,filenameLowercase:n.filename?n.filename.toLowerCase():void 0,extensionLowercase:n.extension?n.extension.toLowerCase():void 0,filepatternLowercase:n.filepattern?lG(n.filepattern.toLowerCase()):void 0,filepatternOnPath:n.filepattern?n.filepattern.indexOf(Fi.sep)>=0:!1}}function VLe(){Rm=Rm.filter(n=>n.userConfigured),KP=[]}function zLe(n,e){return HLe(n,e).map(t=>t.id)}function HLe(n,e){let t;if(n)switch(n.scheme){case it.file:t=n.fsPath;break;case it.data:{t=ix.parseMetaData(n).get(ix.META_DATA_LABEL);break}case it.vscodeNotebookCell:t=void 0;break;default:t=n.path}if(!t)return[{id:"unknown",mime:$l.unknown}];t=t.toLowerCase();const i=SU(t),s=G6(t,i,gG);if(s)return[s,{id:$o,mime:$l.text}];const o=G6(t,i,KP);if(o)return[o,{id:$o,mime:$l.text}];if(e){const r=$Le(e);if(r)return[r,{id:$o,mime:$l.text}]}return[{id:"unknown",mime:$l.unknown}]}function G6(n,e,t){var i;let s,o,r;for(let a=t.length-1;a>=0;a--){const l=t[a];if(e===l.filenameLowercase){s=l;break}if(l.filepattern&&(!o||l.filepattern.length>o.filepattern.length)){const c=l.filepatternOnPath?n:e;!((i=l.filepatternLowercase)===null||i===void 0)&&i.call(l,c)&&(o=l)}l.extension&&(!r||l.extension.length>r.extension.length)&&e.endsWith(l.extensionLowercase)&&(r=l)}if(s)return s;if(o)return o;if(r)return r}function $Le(n){if(U4(n)&&(n=n.substr(1)),n.length>0)for(let e=Rm.length-1;e>=0;e--){const t=Rm[e];if(!t.firstline)continue;const i=n.match(t.firstline);if(i&&i.length>0)return t}}const Cw=Object.prototype.hasOwnProperty,K6="vs.editor.nullLanguage";class ULe{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(K6,0),this._register($o,1),this._nextLanguageId=2}_register(e,t){this._languageIdToLanguage[t]=e,this._languageToLanguageId.set(e,t)}register(e){if(this._languageToLanguageId.has(e))return;const t=this._nextLanguageId++;this._register(e,t)}encodeLanguageId(e){return this._languageToLanguageId.get(e)||0}decodeLanguageId(e){return this._languageIdToLanguage[e]||K6}}class vv extends Y{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,vv.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new ULe,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(ym.onDidChangeLanguages(i=>{this._initializeFromRegistry()})))}dispose(){vv.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},VLe();const e=[].concat(ym.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(e)}_registerLanguages(e){for(const t of e)this._registerLanguage(t);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach(t=>{const i=this._languages[t];i.name&&(this._nameMap[i.name]=i.identifier),i.aliases.forEach(s=>{this._lowercaseNameMap[s.toLowerCase()]=i.identifier}),i.mimetypes.forEach(s=>{this._mimeTypesMap[s]=i.identifier})}),_n.as(qf.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let i;Cw.call(this._languages,t)?i=this._languages[t]:(this.languageIdCodec.register(t),i={identifier:t,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[],icons:[]},this._languages[t]=i),this._mergeLanguage(i,e)}_mergeLanguage(e,t){const i=t.id;let s=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),s=t.mimetypes[0]),s||(s=`text/x-${i}`,e.mimetypes.push(s)),Array.isArray(t.extensions)){t.configuration?e.extensions=t.extensions.concat(e.extensions):e.extensions=e.extensions.concat(t.extensions);for(const a of t.extensions)ww({id:i,mime:s,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const a of t.filenames)ww({id:i,mime:s,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(const a of t.filenamePatterns)ww({id:i,mime:s,filepattern:a},this._warnOnOverwrite);if(typeof t.firstLine=="string"&&t.firstLine.length>0){let a=t.firstLine;a.charAt(0)!=="^"&&(a="^"+a);try{const l=new RegExp(a);Bge(l)||ww({id:i,mime:s,firstline:l},this._warnOnOverwrite)}catch(l){console.warn(`[${t.id}]: Invalid regular expression \`${a}\`: `,l)}}e.aliases.push(i);let o=null;if(typeof t.aliases<"u"&&Array.isArray(t.aliases)&&(t.aliases.length===0?o=[null]:o=t.aliases),o!==null)for(const a of o)!a||a.length===0||e.aliases.push(a);const r=o!==null&&o.length>0;if(!(r&&o[0]===null)){const a=(r?o[0]:null)||i;(r||!e.name)&&(e.name=a)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return e?Cw.call(this._languages,e):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return Cw.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&Cw.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return!e&&!t?[]:zLe(e,t)}}vv.instanceCount=0;class yv extends Y{constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new B),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new B),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new B({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,yv.instanceCount++,this._registry=this._register(new vv(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){yv.instanceCount--,super.dispose()}isRegisteredLanguageId(e){return this._registry.isRegisteredLanguageId(e)}getLanguageIdByLanguageName(e){return this._registry.getLanguageIdByLanguageName(e)}getLanguageIdByMimeType(e){return this._registry.getLanguageIdByMimeType(e)}guessLanguageIdByFilepathOrFirstLine(e,t){const i=this._registry.guessLanguageIdByFilepathOrFirstLine(e,t);return Q$(i,null)}createById(e){return new Y6(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByFilepathOrFirstLine(e,t){return new Y6(this.onDidChange,()=>{const i=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(i)})}_createAndGetLanguageIdentifier(e){return(!e||!this.isRegisteredLanguageId(e))&&(e=$o),e}requestBasicLanguageFeatures(e){this._requestedBasicLanguages.has(e)||(this._requestedBasicLanguages.add(e),this._onDidRequestBasicLanguageFeatures.fire(e))}requestRichLanguageFeatures(e){this._requestedRichLanguages.has(e)||(this._requestedRichLanguages.add(e),this.requestBasicLanguageFeatures(e),xi.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}}yv.instanceCount=0;class Y6{constructor(e,t){this._onDidChangeLanguages=e,this._selector=t,this._listener=null,this._emitter=null,this.languageId=this._selector()}_dispose(){this._listener&&(this._listener.dispose(),this._listener=null),this._emitter&&(this._emitter.dispose(),this._emitter=null)}get onDidChange(){return this._listener||(this._listener=this._onDidChangeLanguages(()=>this._evaluate())),this._emitter||(this._emitter=new B({onDidRemoveLastListener:()=>{this._dispose()}})),this._emitter.event}_evaluate(){var e;const t=this._selector();t!==this.languageId&&(this.languageId=t,(e=this._emitter)===null||e===void 0||e.fire(this.languageId))}}const pG={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:$l.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"};function mG(...n){return function(e,t){for(let i=0,s=n.length;i0?[{start:0,end:e.length}]:[]:null}function jLe(n,e){const t=e.toLowerCase().indexOf(n.toLowerCase());return t===-1?null:[{start:t,end:t+n.length}]}function qLe(n,e){return lN(n.toLowerCase(),e.toLowerCase(),0,0)}function lN(n,e,t,i){if(t===n.length)return[];if(i===e.length)return null;if(n[t]===e[i]){let s=null;return(s=lN(n,e,t+1,i+1))?vG({start:i,end:i+1},s):null}return lN(n,e,t,i+1)}function YP(n){return 97<=n&&n<=122}function ID(n){return 65<=n&&n<=90}function ZP(n){return 48<=n&&n<=57}function GLe(n){return n===32||n===9||n===10||n===13}const KLe=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(n=>KLe.add(n.charCodeAt(0)));function bG(n){return YP(n)||ID(n)||ZP(n)}function vG(n,e){return e.length===0?e=[n]:n.end===e[0].start?e[0].start=n.start:e.unshift(n),e}function yG(n,e){for(let t=e;t0&&!bG(n.charCodeAt(t-1)))return t}return n.length}function cN(n,e,t,i){if(t===n.length)return[];if(i===e.length)return null;if(n[t]!==e[i].toLowerCase())return null;{let s=null,o=i+1;for(s=cN(n,e,t+1,i+1);!s&&(o=yG(e,o)).6}function XLe(n){const{upperPercent:e,lowerPercent:t,alphaPercent:i,numericPercent:s}=n;return t>.2&&e<.8&&i>.6&&s<.2}function QLe(n){let e=0,t=0,i=0,s=0;for(let o=0;o60)return null;const t=YLe(e);if(!XLe(t)){if(!ZLe(t))return null;e=e.toLowerCase()}let i=null,s=0;for(n=n.toLowerCase();s"u")return[];const e=[],t=n[1];for(let i=n.length-1;i>1;i--){const s=n[i]+t,o=e[e.length-1];o&&o.end===s?o.end=s+1:e.push({start:s,end:s+1})}return e}const vd=128;function QP(){const n=[],e=[];for(let t=0;t<=vd;t++)e[t]=0;for(let t=0;t<=vd;t++)n.push(e.slice(0));return n}function CG(n){const e=[];for(let t=0;t<=n;t++)e[t]=0;return e}const SG=CG(2*vd),dN=CG(2*vd),Cl=QP(),ju=QP(),Sw=QP();function xw(n,e){if(e<0||e>=n.length)return!1;const t=n.codePointAt(e);switch(t){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 62:case 40:case 41:case 91:case 93:case 123:case 125:return!0;case void 0:return!1;default:return!!$4(t)}}function Q6(n,e){if(e<0||e>=n.length)return!1;switch(n.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}function EC(n,e,t){return e[n]!==t[n]}function iDe(n,e,t,i,s,o,r=!1){for(;evd?vd:n.length,l=i.length>vd?vd:i.length;if(t>=a||o>=l||a-t>l-o||!iDe(e,t,a,s,o,l,!0))return;nDe(a,l,t,o,e,s);let c=1,d=1,u=t,h=o;const f=[!1];for(c=1,u=t;ub,k=D?ju[c][d-1]+(Cl[c][d-1]>0?-5:0):0,P=h>b+1&&Cl[c][d-1]>0,O=P?ju[c][d-2]+(Cl[c][d-2]>0?-5:0):0;if(P&&(!D||O>=k)&&(!L||O>=x))ju[c][d]=O,Sw[c][d]=3,Cl[c][d]=0;else if(D&&(!L||k>=x))ju[c][d]=k,Sw[c][d]=2,Cl[c][d]=0;else if(L)ju[c][d]=x,Sw[c][d]=1,Cl[c][d]=Cl[c-1][d-1]+1;else throw new Error("not possible")}}if(!f[0]&&!r.firstMatchCanBeWeak)return;c--,d--;const g=[ju[c][d],o];let p=0,_=0;for(;c>=1;){let b=d;do{const y=Sw[c][b];if(y===3)b=b-2;else if(y===2)b=b-1;else break}while(b>=1);p>1&&e[t+c-1]===s[o+d-1]&&!EC(b+o-1,i,s)&&p+1>Cl[c][b]&&(b=d),b===d?p++:p=1,_||(_=b),c--,d=b-1,g.push(d)}l===a&&r.boostFullMatch&&(g[0]+=2);const v=_-a;return g[0]-=v,g}function nDe(n,e,t,i,s,o){let r=n-1,a=e-1;for(;r>=t&&a>=i;)s[r]===o[a]&&(dN[r]=a,r--),a--}function sDe(n,e,t,i,s,o,r,a,l,c,d){if(e[t]!==o[r])return Number.MIN_SAFE_INTEGER;let u=1,h=!1;return r===t-i?u=n[t]===s[r]?7:5:EC(r,s,o)&&(r===0||!EC(r-1,s,o))?(u=n[t]===s[r]?7:5,h=!0):xw(o,r)&&(r===0||!xw(o,r-1))?u=5:(xw(o,r-1)||Q6(o,r-1))&&(u=5,h=!0),u>1&&t===i&&(d[0]=!0),h||(h=EC(r,s,o)||xw(o,r-1)||Q6(o,r-1)),t===i?r>l&&(u-=h?3:5):c?u+=h?2:0:u+=h?0:1,r+1===a&&(u-=h?3:5),u}const oDe="$(",JP=new RegExp(`\\$\\(${Te.iconNameExpression}(?:${Te.iconModifierExpression})?\\)`,"g"),rDe=new RegExp(`(\\\\)?${JP.source}`,"g");function aDe(n){return n.replace(rDe,(e,t)=>t?e:`\\${e}`)}const lDe=new RegExp(`\\\\${JP.source}`,"g");function cDe(n){return n.replace(lDe,e=>`\\${e}`)}const dDe=new RegExp(`(\\s)?(\\\\)?${JP.source}(\\s)?`,"g");function DG(n){return n.indexOf(oDe)===-1?n:n.replace(dDe,(e,t,i,s)=>i?e:t||s||"")}function uDe(n){return n?n.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():""}const eE=new RegExp(`\\$\\(${Te.iconNameCharacter}+\\)`,"g");function __(n){eE.lastIndex=0;let e="";const t=[];let i=0;for(;;){const s=eE.lastIndex,o=eE.exec(n),r=n.substring(s,o==null?void 0:o.index);if(r.length>0){e+=r;for(let a=0;a" ".repeat(s.length)).replace(/\>/gm,"\\>").replace(/\n/g,t===1?`\\ +`;var iDe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},nDe=function(n,e){return function(t,i){e(t,i,n)}};let oN=class extends Y{constructor(e){super(),this.layoutService=e,this.currentViewDisposable=Y.None,this.container=e.hasContainer?e.container:null,this.contextView=this._register(new Pm(this.container,1)),this.layout(),this._register(e.onDidLayout(()=>this.layout()))}setContainer(e,t){this.contextView.setContainer(e,t||1)}showContextView(e,t,i){t?(t!==this.container||this.shadowRoot!==i)&&(this.container=t,this.setContainer(t,i?3:2)):this.layoutService.hasContainer&&this.container!==this.layoutService.container&&(this.container=this.layoutService.container,this.setContainer(this.container,1)),this.shadowRoot=i,this.contextView.show(e);const s=Ye(()=>{this.currentViewDisposable===s&&this.hideContextView()});return this.currentViewDisposable=s,s}getContextViewElement(){return this.contextView.getViewElement()}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e)}};oN=iDe([nDe(0,d0)],oN);let Om=[],q3=[],fG=[];function pw(n,e=!1){sDe(n,!1,e)}function sDe(n,e,t){const i=oDe(n,e);Om.push(i),i.userConfigured?fG.push(i):q3.push(i),t&&!i.userConfigured&&Om.forEach(s=>{s.mime===i.mime||s.userConfigured||(i.extension&&s.extension===i.extension&&console.warn(`Overwriting extension <<${i.extension}>> to now point to mime <<${i.mime}>>`),i.filename&&s.filename===i.filename&&console.warn(`Overwriting filename <<${i.filename}>> to now point to mime <<${i.mime}>>`),i.filepattern&&s.filepattern===i.filepattern&&console.warn(`Overwriting filepattern <<${i.filepattern}>> to now point to mime <<${i.mime}>>`),i.firstline&&s.firstline===i.firstline&&console.warn(`Overwriting firstline <<${i.firstline}>> to now point to mime <<${i.mime}>>`))})}function oDe(n,e){return{id:n.id,mime:n.mime,filename:n.filename,extension:n.extension,filepattern:n.filepattern,firstline:n.firstline,userConfigured:e,filenameLowercase:n.filename?n.filename.toLowerCase():void 0,extensionLowercase:n.extension?n.extension.toLowerCase():void 0,filepatternLowercase:n.filepattern?aG(n.filepattern.toLowerCase()):void 0,filepatternOnPath:n.filepattern?n.filepattern.indexOf(Oi.sep)>=0:!1}}function rDe(){Om=Om.filter(n=>n.userConfigured),q3=[]}function aDe(n,e){return lDe(n,e).map(t=>t.id)}function lDe(n,e){let t;if(n)switch(n.scheme){case tt.file:t=n.fsPath;break;case tt.data:{t=YS.parseMetaData(n).get(YS.META_DATA_LABEL);break}case tt.vscodeNotebookCell:t=void 0;break;default:t=n.path}if(!t)return[{id:"unknown",mime:Ul.unknown}];t=t.toLowerCase();const i=CU(t),s=$6(t,i,fG);if(s)return[s,{id:Ho,mime:Ul.text}];const o=$6(t,i,q3);if(o)return[o,{id:Ho,mime:Ul.text}];if(e){const r=cDe(e);if(r)return[r,{id:Ho,mime:Ul.text}]}return[{id:"unknown",mime:Ul.unknown}]}function $6(n,e,t){var i;let s,o,r;for(let a=t.length-1;a>=0;a--){const l=t[a];if(e===l.filenameLowercase){s=l;break}if(l.filepattern&&(!o||l.filepattern.length>o.filepattern.length)){const c=l.filepatternOnPath?n:e;!((i=l.filepatternLowercase)===null||i===void 0)&&i.call(l,c)&&(o=l)}l.extension&&(!r||l.extension.length>r.extension.length)&&e.endsWith(l.extensionLowercase)&&(r=l)}if(s)return s;if(o)return o;if(r)return r}function cDe(n){if(H4(n)&&(n=n.substr(1)),n.length>0)for(let e=Om.length-1;e>=0;e--){const t=Om[e];if(!t.firstline)continue;const i=n.match(t.firstline);if(i&&i.length>0)return t}}const mw=Object.prototype.hasOwnProperty,U6="vs.editor.nullLanguage";class dDe{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(U6,0),this._register(Ho,1),this._nextLanguageId=2}_register(e,t){this._languageIdToLanguage[t]=e,this._languageToLanguageId.set(e,t)}register(e){if(this._languageToLanguageId.has(e))return;const t=this._nextLanguageId++;this._register(e,t)}encodeLanguageId(e){return this._languageToLanguageId.get(e)||0}decodeLanguageId(e){return this._languageIdToLanguage[e]||U6}}class wv extends Y{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,wv.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new dDe,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(Sm.onDidChangeLanguages(i=>{this._initializeFromRegistry()})))}dispose(){wv.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},rDe();const e=[].concat(Sm.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(e)}_registerLanguages(e){for(const t of e)this._registerLanguage(t);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach(t=>{const i=this._languages[t];i.name&&(this._nameMap[i.name]=i.identifier),i.aliases.forEach(s=>{this._lowercaseNameMap[s.toLowerCase()]=i.identifier}),i.mimetypes.forEach(s=>{this._mimeTypesMap[s]=i.identifier})}),pn.as(Yf.Configuration).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let i;mw.call(this._languages,t)?i=this._languages[t]:(this.languageIdCodec.register(t),i={identifier:t,name:null,mimetypes:[],aliases:[],extensions:[],filenames:[],configurationFiles:[],icons:[]},this._languages[t]=i),this._mergeLanguage(i,e)}_mergeLanguage(e,t){const i=t.id;let s=null;if(Array.isArray(t.mimetypes)&&t.mimetypes.length>0&&(e.mimetypes.push(...t.mimetypes),s=t.mimetypes[0]),s||(s=`text/x-${i}`,e.mimetypes.push(s)),Array.isArray(t.extensions)){t.configuration?e.extensions=t.extensions.concat(e.extensions):e.extensions=e.extensions.concat(t.extensions);for(const a of t.extensions)pw({id:i,mime:s,extension:a},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const a of t.filenames)pw({id:i,mime:s,filename:a},this._warnOnOverwrite),e.filenames.push(a);if(Array.isArray(t.filenamePatterns))for(const a of t.filenamePatterns)pw({id:i,mime:s,filepattern:a},this._warnOnOverwrite);if(typeof t.firstLine=="string"&&t.firstLine.length>0){let a=t.firstLine;a.charAt(0)!=="^"&&(a="^"+a);try{const l=new RegExp(a);spe(l)||pw({id:i,mime:s,firstline:l},this._warnOnOverwrite)}catch(l){console.warn(`[${t.id}]: Invalid regular expression \`${a}\`: `,l)}}e.aliases.push(i);let o=null;if(typeof t.aliases<"u"&&Array.isArray(t.aliases)&&(t.aliases.length===0?o=[null]:o=t.aliases),o!==null)for(const a of o)!a||a.length===0||e.aliases.push(a);const r=o!==null&&o.length>0;if(!(r&&o[0]===null)){const a=(r?o[0]:null)||i;(r||!e.name)&&(e.name=a)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return e?mw.call(this._languages,e):!1}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return mw.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&mw.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return!e&&!t?[]:aDe(e,t)}}wv.instanceCount=0;class Cv extends Y{constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new B),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new B),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new B({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,Cv.instanceCount++,this._registry=this._register(new wv(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange(()=>this._onDidChange.fire()))}dispose(){Cv.instanceCount--,super.dispose()}isRegisteredLanguageId(e){return this._registry.isRegisteredLanguageId(e)}getLanguageIdByLanguageName(e){return this._registry.getLanguageIdByLanguageName(e)}getLanguageIdByMimeType(e){return this._registry.getLanguageIdByMimeType(e)}guessLanguageIdByFilepathOrFirstLine(e,t){const i=this._registry.guessLanguageIdByFilepathOrFirstLine(e,t);return X$(i,null)}createById(e){return new j6(this.onDidChange,()=>this._createAndGetLanguageIdentifier(e))}createByFilepathOrFirstLine(e,t){return new j6(this.onDidChange,()=>{const i=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(i)})}_createAndGetLanguageIdentifier(e){return(!e||!this.isRegisteredLanguageId(e))&&(e=Ho),e}requestBasicLanguageFeatures(e){this._requestedBasicLanguages.has(e)||(this._requestedBasicLanguages.add(e),this._onDidRequestBasicLanguageFeatures.fire(e))}requestRichLanguageFeatures(e){this._requestedRichLanguages.has(e)||(this._requestedRichLanguages.add(e),this.requestBasicLanguageFeatures(e),Si.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}}Cv.instanceCount=0;class j6{constructor(e,t){this._onDidChangeLanguages=e,this._selector=t,this._listener=null,this._emitter=null,this.languageId=this._selector()}_dispose(){this._listener&&(this._listener.dispose(),this._listener=null),this._emitter&&(this._emitter.dispose(),this._emitter=null)}get onDidChange(){return this._listener||(this._listener=this._onDidChangeLanguages(()=>this._evaluate())),this._emitter||(this._emitter=new B({onDidRemoveLastListener:()=>{this._dispose()}})),this._emitter.event}_evaluate(){var e;const t=this._selector();t!==this.languageId&&(this.languageId=t,(e=this._emitter)===null||e===void 0||e.fire(this.languageId))}}const gG={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:Ul.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"};function pG(...n){return function(e,t){for(let i=0,s=n.length;i0?[{start:0,end:e.length}]:[]:null}function uDe(n,e){const t=e.toLowerCase().indexOf(n.toLowerCase());return t===-1?null:[{start:t,end:t+n.length}]}function hDe(n,e){return rN(n.toLowerCase(),e.toLowerCase(),0,0)}function rN(n,e,t,i){if(t===n.length)return[];if(i===e.length)return null;if(n[t]===e[i]){let s=null;return(s=rN(n,e,t+1,i+1))?bG({start:i,end:i+1},s):null}return rN(n,e,t,i+1)}function G3(n){return 97<=n&&n<=122}function SD(n){return 65<=n&&n<=90}function K3(n){return 48<=n&&n<=57}function fDe(n){return n===32||n===9||n===10||n===13}const gDe=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(n=>gDe.add(n.charCodeAt(0)));function _G(n){return G3(n)||SD(n)||K3(n)}function bG(n,e){return e.length===0?e=[n]:n.end===e[0].start?e[0].start=n.start:e.unshift(n),e}function vG(n,e){for(let t=e;t0&&!_G(n.charCodeAt(t-1)))return t}return n.length}function aN(n,e,t,i){if(t===n.length)return[];if(i===e.length)return null;if(n[t]!==e[i].toLowerCase())return null;{let s=null,o=i+1;for(s=aN(n,e,t+1,i+1);!s&&(o=vG(e,o)).6}function _De(n){const{upperPercent:e,lowerPercent:t,alphaPercent:i,numericPercent:s}=n;return t>.2&&e<.8&&i>.6&&s<.2}function bDe(n){let e=0,t=0,i=0,s=0;for(let o=0;o60)return null;const t=pDe(e);if(!_De(t)){if(!mDe(t))return null;e=e.toLowerCase()}let i=null,s=0;for(n=n.toLowerCase();s"u")return[];const e=[],t=n[1];for(let i=n.length-1;i>1;i--){const s=n[i]+t,o=e[e.length-1];o&&o.end===s?o.end=s+1:e.push({start:s,end:s+1})}return e}const yd=128;function Z3(){const n=[],e=[];for(let t=0;t<=yd;t++)e[t]=0;for(let t=0;t<=yd;t++)n.push(e.slice(0));return n}function wG(n){const e=[];for(let t=0;t<=n;t++)e[t]=0;return e}const CG=wG(2*yd),lN=wG(2*yd),Sl=Z3(),qu=Z3(),_w=Z3();function bw(n,e){if(e<0||e>=n.length)return!1;const t=n.codePointAt(e);switch(t){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 62:case 40:case 41:case 91:case 93:case 123:case 125:return!0;case void 0:return!1;default:return!!z4(t)}}function K6(n,e){if(e<0||e>=n.length)return!1;switch(n.charCodeAt(e)){case 32:case 9:return!0;default:return!1}}function CC(n,e,t){return e[n]!==t[n]}function CDe(n,e,t,i,s,o,r=!1){for(;eyd?yd:n.length,l=i.length>yd?yd:i.length;if(t>=a||o>=l||a-t>l-o||!CDe(e,t,a,s,o,l,!0))return;SDe(a,l,t,o,e,s);let c=1,d=1,u=t,h=o;const f=[!1];for(c=1,u=t;ub,k=D?qu[c][d-1]+(Sl[c][d-1]>0?-5:0):0,P=h>b+1&&Sl[c][d-1]>0,O=P?qu[c][d-2]+(Sl[c][d-2]>0?-5:0):0;if(P&&(!D||O>=k)&&(!L||O>=x))qu[c][d]=O,_w[c][d]=3,Sl[c][d]=0;else if(D&&(!L||k>=x))qu[c][d]=k,_w[c][d]=2,Sl[c][d]=0;else if(L)qu[c][d]=x,_w[c][d]=1,Sl[c][d]=Sl[c-1][d-1]+1;else throw new Error("not possible")}}if(!f[0]&&!r.firstMatchCanBeWeak)return;c--,d--;const g=[qu[c][d],o];let p=0,_=0;for(;c>=1;){let b=d;do{const y=_w[c][b];if(y===3)b=b-2;else if(y===2)b=b-1;else break}while(b>=1);p>1&&e[t+c-1]===s[o+d-1]&&!CC(b+o-1,i,s)&&p+1>Sl[c][b]&&(b=d),b===d?p++:p=1,_||(_=b),c--,d=b-1,g.push(d)}l===a&&r.boostFullMatch&&(g[0]+=2);const v=_-a;return g[0]-=v,g}function SDe(n,e,t,i,s,o){let r=n-1,a=e-1;for(;r>=t&&a>=i;)s[r]===o[a]&&(lN[r]=a,r--),a--}function xDe(n,e,t,i,s,o,r,a,l,c,d){if(e[t]!==o[r])return Number.MIN_SAFE_INTEGER;let u=1,h=!1;return r===t-i?u=n[t]===s[r]?7:5:CC(r,s,o)&&(r===0||!CC(r-1,s,o))?(u=n[t]===s[r]?7:5,h=!0):bw(o,r)&&(r===0||!bw(o,r-1))?u=5:(bw(o,r-1)||K6(o,r-1))&&(u=5,h=!0),u>1&&t===i&&(d[0]=!0),h||(h=CC(r,s,o)||bw(o,r-1)||K6(o,r-1)),t===i?r>l&&(u-=h?3:5):c?u+=h?2:0:u+=h?0:1,r+1===a&&(u-=h?3:5),u}const LDe="$(",X3=new RegExp(`\\$\\(${Te.iconNameExpression}(?:${Te.iconModifierExpression})?\\)`,"g"),DDe=new RegExp(`(\\\\)?${X3.source}`,"g");function kDe(n){return n.replace(DDe,(e,t)=>t?e:`\\${e}`)}const EDe=new RegExp(`\\\\${X3.source}`,"g");function ADe(n){return n.replace(EDe,e=>`\\${e}`)}const IDe=new RegExp(`(\\s)?(\\\\)?${X3.source}(\\s)?`,"g");function LG(n){return n.indexOf(LDe)===-1?n:n.replace(IDe,(e,t,i,s)=>i?e:t||s||"")}function TDe(n){return n?n.replace(/\$\((.*?)\)/g,(e,t)=>` ${t} `).trim():""}const Y2=new RegExp(`\\$\\(${Te.iconNameCharacter}+\\)`,"g");function C_(n){Y2.lastIndex=0;let e="";const t=[];let i=0;for(;;){const s=Y2.lastIndex,o=Y2.exec(n),r=n.substring(s,o==null?void 0:o.index);if(r.length>0){e+=r;for(let a=0;a" ".repeat(s.length)).replace(/\>/gm,"\\>").replace(/\n/g,t===1?`\\ `:` `),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+="\n```",this.value+=e,this.value+=` -`,this.value+=t,this.value+="\n```\n",this}appendLink(e,t,i){return this.value+="[",this.value+=this._escape(t,"]"),this.value+="](",this.value+=this._escape(String(e),")"),i&&(this.value+=` "${this._escape(this._escape(i,'"'),")")}"`),this.value+=")",this}_escape(e,t){const i=new RegExp(xr(t),"g");return e.replace(i,(s,o)=>e.charAt(o-1)!=="\\"?`\\${s}`:s)}}function wv(n){return Rd(n)?!n.value:Array.isArray(n)?n.every(wv):!0}function Rd(n){return n instanceof Mm?!0:n&&typeof n=="object"?typeof n.value=="string"&&(typeof n.isTrusted=="boolean"||typeof n.isTrusted=="object"||n.isTrusted===void 0)&&(typeof n.supportThemeIcons=="boolean"||n.supportThemeIcons===void 0):!1}function hDe(n,e){return n===e?!0:!n||!e?!1:n.value===e.value&&n.isTrusted===e.isTrusted&&n.supportThemeIcons===e.supportThemeIcons&&n.supportHtml===e.supportHtml&&(n.baseUri===e.baseUri||!!n.baseUri&&!!e.baseUri&&TP(je.from(n.baseUri),je.from(e.baseUri)))}function fDe(n){return n.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}function Lw(n){return n.replace(/"/g,""")}function iE(n){return n&&n.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}function gDe(n){const e=[],t=n.split("|").map(s=>s.trim());n=t[0];const i=t[1];if(i){const s=/height=(\d+)/.exec(i),o=/width=(\d+)/.exec(i),r=s?s[1]:"",a=o?o[1]:"",l=isFinite(parseInt(a)),c=isFinite(parseInt(r));l&&e.push(`width="${a}"`),c&&e.push(`height="${r}"`)}return{href:n,dimensions:e}}var uN=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function pDe(n,e){Ms(e)?n.title=DG(e):e!=null&&e.markdownNotSupportedFallback?n.title=e.markdownNotSupportedFallback:n.removeAttribute("title")}class mDe{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}update(e,t,i){var s;return uN(this,void 0,void 0,function*(){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let o;if(e===void 0||Ms(e)||e instanceof HTMLElement)o=e;else if(!vS(e.markdown))o=(s=e.markdown)!==null&&s!==void 0?s:e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(m("iconLabel.loading","Loading..."),t),this._cancellationTokenSource=new Ir;const r=this._cancellationTokenSource.token;if(o=yield e.markdown(r),o===void 0&&(o=e.markdownNotSupportedFallback),this.isDisposed||r.isCancellationRequested)return}this.show(o,t,i)})}show(e,t,i){const s=this._hoverWidget;if(this.hasContent(e)){const o=Object.assign({content:e,target:this.target,showPointer:this.hoverDelegate.placement==="element",hoverPosition:2,skipFadeInAnimation:!this.fadeInAnimation||!!s},i);this._hoverWidget=this.hoverDelegate.showHover(o,t)}s==null||s.dispose()}hasContent(e){return e?Rd(e)?!!e.value:!0:!1}get isDisposed(){var e;return(e=this._hoverWidget)===null||e===void 0?void 0:e.isDisposed}dispose(){var e,t;(e=this._hoverWidget)===null||e===void 0||e.dispose(),(t=this._cancellationTokenSource)===null||t===void 0||t.dispose(!0),this._cancellationTokenSource=void 0}}function kG(n,e,t,i){let s,o;const r=(u,h)=>{var f;const g=o!==void 0;u&&(o==null||o.dispose(),o=void 0),h&&(s==null||s.dispose(),s=void 0),g&&((f=n.onDidHideHover)===null||f===void 0||f.call(n))},a=(u,h,f)=>new Lc(()=>uN(this,void 0,void 0,function*(){(!o||o.isDisposed)&&(o=new mDe(n,f||e,u>0),yield o.update(t,h,i))}),u),l=()=>{if(s)return;const u=new pe,h=p=>r(!1,p.fromElement===e);u.add(K(e,de.MOUSE_LEAVE,h,!0));const f=()=>r(!0,!0);u.add(K(e,de.MOUSE_DOWN,f,!0));const g={targetElements:[e],dispose:()=>{}};if(n.placement===void 0||n.placement==="mouse"){const p=_=>{g.x=_.x+10,_.target instanceof HTMLElement&&_.target.classList.contains("action-label")&&r(!0,!0)};u.add(K(e,de.MOUSE_MOVE,p,!0))}u.add(a(n.delay,!1,g)),s=u},c=K(e,de.MOUSE_OVER,l,!0);return{show:u=>{r(!1,!0),a(0,u)},hide:()=>{r(!0,!0)},update:(u,h)=>uN(this,void 0,void 0,function*(){t=u,yield o==null?void 0:o.update(t,void 0,h)}),dispose:()=>{c.dispose(),r(!0,!0)}}}function _De(n,e={}){const t=e3(e);return t.textContent=n,t}function bDe(n,e={}){const t=e3(e);return EG(t,yDe(n,!!e.renderCodeSegments),e.actionHandler,e.renderCodeSegments),t}function e3(n){const e=n.inline?"span":"div",t=document.createElement(e);return n.className&&(t.className=n.className),t}class vDe{constructor(e){this.source=e,this.index=0}eos(){return this.index>=this.source.length}next(){const e=this.peek();return this.advance(),e}peek(){return this.source[this.index]}advance(){this.index++}}function EG(n,e,t,i){let s;if(e.type===2)s=document.createTextNode(e.content||"");else if(e.type===3)s=document.createElement("b");else if(e.type===4)s=document.createElement("i");else if(e.type===7&&i)s=document.createElement("code");else if(e.type===5&&t){const o=document.createElement("a");t.disposables.add(ji(o,"click",r=>{t.callback(String(e.index),r)})),s=o}else e.type===8?s=document.createElement("br"):e.type===1&&(s=n);s&&n!==s&&n.appendChild(s),s&&Array.isArray(e.children)&&e.children.forEach(o=>{EG(s,o,t,i)})}function yDe(n,e){const t={type:1,children:[]};let i=0,s=t;const o=[],r=new vDe(n);for(;!r.eos();){let a=r.next();const l=a==="\\"&&hN(r.peek(),e)!==0;if(l&&(a=r.next()),!l&&wDe(a,e)&&a===r.peek()){r.advance(),s.type===2&&(s=o.pop());const c=hN(a,e);if(s.type===c||s.type===5&&c===6)s=o.pop();else{const d={type:c,children:[]};c===5&&(d.index=i,i++),s.children.push(d),o.push(s),s=d}}else if(a===` -`)s.type===2&&(s=o.pop()),s.children.push({type:8});else if(s.type!==2){const c={type:2,content:a};s.children.push(c),o.push(s),s=c}else s.content+=a}return s.type===2&&(s=o.pop()),t}function wDe(n,e){return hN(n,e)!==0}function hN(n,e){switch(n){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return e?7:0;default:return 0}}const CDe=new RegExp(`(\\\\)?\\$\\((${Te.iconNameExpression}(?:${Te.iconModifierExpression})?)\\)`,"g");function nf(n){const e=new Array;let t,i=0,s=0;for(;(t=CDe.exec(n))!==null;){s=t.index||0,iJ.length)&&(q=J.length);for(var U=0,A=new Array(q);U=J.length?{done:!0}:{done:!1,value:J[A++]}}}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{async:!1,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(J){e.defaults=J}var c=/[&<>"']/,d=/[&<>"']/g,u=/[<>"']|&(?!#?\w+;)/,h=/[<>"']|&(?!#?\w+;)/g,f={"&":"&","<":"<",">":">",'"':""","'":"'"},g=function(q){return f[q]};function p(J,q){if(q){if(c.test(J))return J.replace(d,g)}else if(u.test(J))return J.replace(h,g);return J}var _=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function v(J){return J.replace(_,function(q,U){return U=U.toLowerCase(),U==="colon"?":":U.charAt(0)==="#"?U.charAt(1)==="x"?String.fromCharCode(parseInt(U.substring(2),16)):String.fromCharCode(+U.substring(1)):""})}var b=/(^|[^\[])\^/g;function y(J,q){J=typeof J=="string"?J:J.source,q=q||"";var U={replace:function(T,W){return W=W.source||W,W=W.replace(b,"$1"),J=J.replace(T,W),U},getRegex:function(){return new RegExp(J,q)}};return U}var w=/[^\w:]/g,C=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function L(J,q,U){if(J){var A;try{A=decodeURIComponent(v(U)).replace(w,"").toLowerCase()}catch{return null}if(A.indexOf("javascript:")===0||A.indexOf("vbscript:")===0||A.indexOf("data:")===0)return null}q&&!C.test(U)&&(U=O(q,U));try{U=encodeURI(U).replace(/%25/g,"%")}catch{return null}return U}var x={},D=/^[^:]+:\/*[^/]*$/,k=/^([^:]+:)[\s\S]*$/,P=/^([^:]+:\/*[^/]*)[\s\S]*$/;function O(J,q){x[" "+J]||(D.test(J)?x[" "+J]=J+"/":x[" "+J]=G(J,"/",!0)),J=x[" "+J];var U=J.indexOf(":")===-1;return q.substring(0,2)==="//"?U?q:J.replace(k,"$1")+q:q.charAt(0)==="/"?U?q:J.replace(P,"$1")+q:J+q}var M={exec:function(){}};function R(J){for(var q=1,U,A;q=0&&Z[Ce]==="\\";)ce=!ce;return ce?"|":" |"}),A=U.split(/ \|/),T=0;if(A[0].trim()||A.shift(),A.length>0&&!A[A.length-1].trim()&&A.pop(),A.length>q)A.splice(q);else for(;A.length1;)q&1&&(U+=J),q>>=1,J+=J;return U+J}function oe(J,q,U,A){var T=q.href,W=q.title?p(q.title):null,F=J[1].replace(/\\([\[\]])/g,"$1");if(J[0].charAt(0)!=="!"){A.state.inLink=!0;var Z={type:"link",raw:U,href:T,title:W,text:F,tokens:A.inlineTokens(F)};return A.state.inLink=!1,Z}return{type:"image",raw:U,href:T,title:W,text:p(F)}}function Se(J,q){var U=J.match(/^(\s+)(?:```)/);if(U===null)return q;var A=U[1];return q.split(` +`,this.value+=t,this.value+="\n```\n",this}appendLink(e,t,i){return this.value+="[",this.value+=this._escape(t,"]"),this.value+="](",this.value+=this._escape(String(e),")"),i&&(this.value+=` "${this._escape(this._escape(i,'"'),")")}"`),this.value+=")",this}_escape(e,t){const i=new RegExp(Sr(t),"g");return e.replace(i,(s,o)=>e.charAt(o-1)!=="\\"?`\\${s}`:s)}}function Sv(n){return Md(n)?!n.value:Array.isArray(n)?n.every(Sv):!0}function Md(n){return n instanceof Fm?!0:n&&typeof n=="object"?typeof n.value=="string"&&(typeof n.isTrusted=="boolean"||typeof n.isTrusted=="object"||n.isTrusted===void 0)&&(typeof n.supportThemeIcons=="boolean"||n.supportThemeIcons===void 0):!1}function NDe(n,e){return n===e?!0:!n||!e?!1:n.value===e.value&&n.isTrusted===e.isTrusted&&n.supportThemeIcons===e.supportThemeIcons&&n.supportHtml===e.supportHtml&&(n.baseUri===e.baseUri||!!n.baseUri&&!!e.baseUri&&A3(Ue.from(n.baseUri),Ue.from(e.baseUri)))}function RDe(n){return n.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}function vw(n){return n.replace(/"/g,""")}function X2(n){return n&&n.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1")}function MDe(n){const e=[],t=n.split("|").map(s=>s.trim());n=t[0];const i=t[1];if(i){const s=/height=(\d+)/.exec(i),o=/width=(\d+)/.exec(i),r=s?s[1]:"",a=o?o[1]:"",l=isFinite(parseInt(a)),c=isFinite(parseInt(r));l&&e.push(`width="${a}"`),c&&e.push(`height="${r}"`)}return{href:n,dimensions:e}}var cN=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function PDe(n,e){Rs(e)?n.title=LG(e):e!=null&&e.markdownNotSupportedFallback?n.title=e.markdownNotSupportedFallback:n.removeAttribute("title")}class ODe{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}update(e,t,i){var s;return cN(this,void 0,void 0,function*(){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let o;if(e===void 0||Rs(e)||e instanceof HTMLElement)o=e;else if(!hS(e.markdown))o=(s=e.markdown)!==null&&s!==void 0?s:e.markdownNotSupportedFallback;else{this._hoverWidget||this.show(m("iconLabel.loading","Loading..."),t),this._cancellationTokenSource=new Ar;const r=this._cancellationTokenSource.token;if(o=yield e.markdown(r),o===void 0&&(o=e.markdownNotSupportedFallback),this.isDisposed||r.isCancellationRequested)return}this.show(o,t,i)})}show(e,t,i){const s=this._hoverWidget;if(this.hasContent(e)){const o=Object.assign({content:e,target:this.target,showPointer:this.hoverDelegate.placement==="element",hoverPosition:2,skipFadeInAnimation:!this.fadeInAnimation||!!s},i);this._hoverWidget=this.hoverDelegate.showHover(o,t)}s==null||s.dispose()}hasContent(e){return e?Md(e)?!!e.value:!0:!1}get isDisposed(){var e;return(e=this._hoverWidget)===null||e===void 0?void 0:e.isDisposed}dispose(){var e,t;(e=this._hoverWidget)===null||e===void 0||e.dispose(),(t=this._cancellationTokenSource)===null||t===void 0||t.dispose(!0),this._cancellationTokenSource=void 0}}function DG(n,e,t,i){let s,o;const r=(u,h)=>{var f;const g=o!==void 0;u&&(o==null||o.dispose(),o=void 0),h&&(s==null||s.dispose(),s=void 0),g&&((f=n.onDidHideHover)===null||f===void 0||f.call(n))},a=(u,h,f)=>new Lc(()=>cN(this,void 0,void 0,function*(){(!o||o.isDisposed)&&(o=new ODe(n,f||e,u>0),yield o.update(t,h,i))}),u),l=()=>{if(s)return;const u=new pe,h=p=>r(!1,p.fromElement===e);u.add(K(e,de.MOUSE_LEAVE,h,!0));const f=()=>r(!0,!0);u.add(K(e,de.MOUSE_DOWN,f,!0));const g={targetElements:[e],dispose:()=>{}};if(n.placement===void 0||n.placement==="mouse"){const p=_=>{g.x=_.x+10,_.target instanceof HTMLElement&&_.target.classList.contains("action-label")&&r(!0,!0)};u.add(K(e,de.MOUSE_MOVE,p,!0))}u.add(a(n.delay,!1,g)),s=u},c=K(e,de.MOUSE_OVER,l,!0);return{show:u=>{r(!1,!0),a(0,u)},hide:()=>{r(!0,!0)},update:(u,h)=>cN(this,void 0,void 0,function*(){t=u,yield o==null?void 0:o.update(t,void 0,h)}),dispose:()=>{c.dispose(),r(!0,!0)}}}function FDe(n,e={}){const t=Q3(e);return t.textContent=n,t}function BDe(n,e={}){const t=Q3(e);return kG(t,VDe(n,!!e.renderCodeSegments),e.actionHandler,e.renderCodeSegments),t}function Q3(n){const e=n.inline?"span":"div",t=document.createElement(e);return n.className&&(t.className=n.className),t}class WDe{constructor(e){this.source=e,this.index=0}eos(){return this.index>=this.source.length}next(){const e=this.peek();return this.advance(),e}peek(){return this.source[this.index]}advance(){this.index++}}function kG(n,e,t,i){let s;if(e.type===2)s=document.createTextNode(e.content||"");else if(e.type===3)s=document.createElement("b");else if(e.type===4)s=document.createElement("i");else if(e.type===7&&i)s=document.createElement("code");else if(e.type===5&&t){const o=document.createElement("a");t.disposables.add(Ui(o,"click",r=>{t.callback(String(e.index),r)})),s=o}else e.type===8?s=document.createElement("br"):e.type===1&&(s=n);s&&n!==s&&n.appendChild(s),s&&Array.isArray(e.children)&&e.children.forEach(o=>{kG(s,o,t,i)})}function VDe(n,e){const t={type:1,children:[]};let i=0,s=t;const o=[],r=new WDe(n);for(;!r.eos();){let a=r.next();const l=a==="\\"&&dN(r.peek(),e)!==0;if(l&&(a=r.next()),!l&&zDe(a,e)&&a===r.peek()){r.advance(),s.type===2&&(s=o.pop());const c=dN(a,e);if(s.type===c||s.type===5&&c===6)s=o.pop();else{const d={type:c,children:[]};c===5&&(d.index=i,i++),s.children.push(d),o.push(s),s=d}}else if(a===` +`)s.type===2&&(s=o.pop()),s.children.push({type:8});else if(s.type!==2){const c={type:2,content:a};s.children.push(c),o.push(s),s=c}else s.content+=a}return s.type===2&&(s=o.pop()),t}function zDe(n,e){return dN(n,e)!==0}function dN(n,e){switch(n){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return e?7:0;default:return 0}}const HDe=new RegExp(`(\\\\)?\\$\\((${Te.iconNameExpression}(?:${Te.iconModifierExpression})?)\\)`,"g");function rf(n){const e=new Array;let t,i=0,s=0;for(;(t=HDe.exec(n))!==null;){s=t.index||0,iJ.length)&&(q=J.length);for(var U=0,A=new Array(q);U=J.length?{done:!0}:{done:!1,value:J[A++]}}}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{async:!1,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(J){e.defaults=J}var c=/[&<>"']/,d=/[&<>"']/g,u=/[<>"']|&(?!#?\w+;)/,h=/[<>"']|&(?!#?\w+;)/g,f={"&":"&","<":"<",">":">",'"':""","'":"'"},g=function(q){return f[q]};function p(J,q){if(q){if(c.test(J))return J.replace(d,g)}else if(u.test(J))return J.replace(h,g);return J}var _=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function v(J){return J.replace(_,function(q,U){return U=U.toLowerCase(),U==="colon"?":":U.charAt(0)==="#"?U.charAt(1)==="x"?String.fromCharCode(parseInt(U.substring(2),16)):String.fromCharCode(+U.substring(1)):""})}var b=/(^|[^\[])\^/g;function y(J,q){J=typeof J=="string"?J:J.source,q=q||"";var U={replace:function(T,W){return W=W.source||W,W=W.replace(b,"$1"),J=J.replace(T,W),U},getRegex:function(){return new RegExp(J,q)}};return U}var w=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function L(J,q,U){if(J){var A;try{A=decodeURIComponent(v(U)).replace(w,"").toLowerCase()}catch{return null}if(A.indexOf("javascript:")===0||A.indexOf("vbscript:")===0||A.indexOf("data:")===0)return null}q&&!S.test(U)&&(U=O(q,U));try{U=encodeURI(U).replace(/%25/g,"%")}catch{return null}return U}var x={},D=/^[^:]+:\/*[^/]*$/,k=/^([^:]+:)[\s\S]*$/,P=/^([^:]+:\/*[^/]*)[\s\S]*$/;function O(J,q){x[" "+J]||(D.test(J)?x[" "+J]=J+"/":x[" "+J]=G(J,"/",!0)),J=x[" "+J];var U=J.indexOf(":")===-1;return q.substring(0,2)==="//"?U?q:J.replace(k,"$1")+q:q.charAt(0)==="/"?U?q:J.replace(P,"$1")+q:J+q}var M={exec:function(){}};function R(J){for(var q=1,U,A;q=0&&Z[Ce]==="\\";)ce=!ce;return ce?"|":" |"}),A=U.split(/ \|/),T=0;if(A[0].trim()||A.shift(),A.length>0&&!A[A.length-1].trim()&&A.pop(),A.length>q)A.splice(q);else for(;A.length1;)q&1&&(U+=J),q>>=1,J+=J;return U+J}function oe(J,q,U,A){var T=q.href,W=q.title?p(q.title):null,F=J[1].replace(/\\([\[\]])/g,"$1");if(J[0].charAt(0)!=="!"){A.state.inLink=!0;var Z={type:"link",raw:U,href:T,title:W,text:F,tokens:A.inlineTokens(F)};return A.state.inLink=!1,Z}return{type:"image",raw:U,href:T,title:W,text:p(F)}}function Se(J,q){var U=J.match(/^(\s+)(?:```)/);if(U===null)return q;var A=U[1];return q.split(` `).map(function(T){var W=T.match(/^\s+/);if(W===null)return T;var F=W[0];return F.length>=A.length?T.slice(A.length):T}).join(` `)}var Ie=function(){function J(U){this.options=U||e.defaults}var q=J.prototype;return q.space=function(A){var T=this.rules.block.newline.exec(A);if(T&&T[0].length>0)return{type:"space",raw:T[0]}},q.code=function(A){var T=this.rules.block.code.exec(A);if(T){var W=T[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:T[0],codeBlockStyle:"indented",text:this.options.pedantic?W:G(W,` -`)}}},q.fences=function(A){var T=this.rules.block.fences.exec(A);if(T){var W=T[0],F=Se(W,T[3]||"");return{type:"code",raw:W,lang:T[2]?T[2].trim():T[2],text:F}}},q.heading=function(A){var T=this.rules.block.heading.exec(A);if(T){var W=T[2].trim();if(/#$/.test(W)){var F=G(W,"#");(this.options.pedantic||!F||/ $/.test(F))&&(W=F.trim())}return{type:"heading",raw:T[0],depth:T[1].length,text:W,tokens:this.lexer.inline(W)}}},q.hr=function(A){var T=this.rules.block.hr.exec(A);if(T)return{type:"hr",raw:T[0]}},q.blockquote=function(A){var T=this.rules.block.blockquote.exec(A);if(T){var W=T[0].replace(/^ *>[ \t]?/gm,"");return{type:"blockquote",raw:T[0],tokens:this.lexer.blockTokens(W,[]),text:W}}},q.list=function(A){var T=this.rules.block.list.exec(A);if(T){var W,F,Z,ce,Ce,De,He,Fe,Rt,Et,Re,hi,fi=T[1].trim(),tr=fi.length>1,Ct={type:"list",raw:"",ordered:tr,start:tr?+fi.slice(0,-1):"",loose:!1,items:[]};fi=tr?"\\d{1,9}\\"+fi.slice(-1):"\\"+fi,this.options.pedantic&&(fi=tr?fi:"[*+-]");for(var Vi=new RegExp("^( {0,3}"+fi+")((?:[ ][^\\n]*)?(?:\\n|$))");A&&(hi=!1,!(!(T=Vi.exec(A))||this.rules.block.hr.test(A)));){if(W=T[0],A=A.substring(W.length),Fe=T[2].split(` -`,1)[0],Rt=A.split(` -`,1)[0],this.options.pedantic?(ce=2,Re=Fe.trimLeft()):(ce=T[2].search(/[^ ]/),ce=ce>4?1:ce,Re=Fe.slice(ce),ce+=T[1].length),De=!1,!Fe&&/^ *$/.test(Rt)&&(W+=Rt+` -`,A=A.substring(Rt.length+1),hi=!0),!hi)for(var Pu=new RegExp("^ {0,"+Math.min(3,ce-1)+"}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))"),Ou=new RegExp("^ {0,"+Math.min(3,ce-1)+"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"),Mr=new RegExp("^ {0,"+Math.min(3,ce-1)+"}(?:```|~~~)"),Ic=new RegExp("^ {0,"+Math.min(3,ce-1)+"}#");A&&(Et=A.split(` -`,1)[0],Fe=Et,this.options.pedantic&&(Fe=Fe.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(Mr.test(Fe)||Ic.test(Fe)||Pu.test(Fe)||Ou.test(A)));){if(Fe.search(/[^ ]/)>=ce||!Fe.trim())Re+=` -`+Fe.slice(ce);else if(!De)Re+=` -`+Fe;else break;!De&&!Fe.trim()&&(De=!0),W+=Et+` -`,A=A.substring(Et.length+1)}Ct.loose||(He?Ct.loose=!0:/\n *\n *$/.test(W)&&(He=!0)),this.options.gfm&&(F=/^\[[ xX]\] /.exec(Re),F&&(Z=F[0]!=="[ ] ",Re=Re.replace(/^\[[ xX]\] +/,""))),Ct.items.push({type:"list_item",raw:W,task:!!F,checked:Z,loose:!1,text:Re}),Ct.raw+=W}Ct.items[Ct.items.length-1].raw=W.trimRight(),Ct.items[Ct.items.length-1].text=Re.trimRight(),Ct.raw=Ct.raw.trimRight();var Fu=Ct.items.length;for(Ce=0;Ce1)return!0}return!1});!Ct.loose&&Bu.length&&rg&&(Ct.loose=!0,Ct.items[Ce].loose=!0)}return Ct}},q.html=function(A){var T=this.rules.block.html.exec(A);if(T){var W={type:"html",raw:T[0],pre:!this.options.sanitizer&&(T[1]==="pre"||T[1]==="script"||T[1]==="style"),text:T[0]};if(this.options.sanitize){var F=this.options.sanitizer?this.options.sanitizer(T[0]):p(T[0]);W.type="paragraph",W.text=F,W.tokens=this.lexer.inline(F)}return W}},q.def=function(A){var T=this.rules.block.def.exec(A);if(T){T[3]&&(T[3]=T[3].substring(1,T[3].length-1));var W=T[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:W,raw:T[0],href:T[2],title:T[3]}}},q.table=function(A){var T=this.rules.block.table.exec(A);if(T){var W={type:"table",header:z(T[1]).map(function(He){return{text:He}}),align:T[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:T[3]&&T[3].trim()?T[3].replace(/\n[ \t]*$/,"").split(` -`):[]};if(W.header.length===W.align.length){W.raw=T[0];var F=W.align.length,Z,ce,Ce,De;for(Z=0;Z/i.test(T[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(T[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(T[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:T[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(T[0]):p(T[0]):T[0]}},q.link=function(A){var T=this.rules.inline.link.exec(A);if(T){var W=T[2].trim();if(!this.options.pedantic&&/^$/.test(W))return;var F=G(W.slice(0,-1),"\\");if((W.length-F.length)%2===0)return}else{var Z=te(T[2],"()");if(Z>-1){var ce=T[0].indexOf("!")===0?5:4,Ce=ce+T[1].length+Z;T[2]=T[2].substring(0,Z),T[0]=T[0].substring(0,Ce).trim(),T[3]=""}}var De=T[2],He="";if(this.options.pedantic){var Fe=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(De);Fe&&(De=Fe[1],He=Fe[3])}else He=T[3]?T[3].slice(1,-1):"";return De=De.trim(),/^$/.test(W)?De=De.slice(1):De=De.slice(1,-1)),oe(T,{href:De&&De.replace(this.rules.inline._escapes,"$1"),title:He&&He.replace(this.rules.inline._escapes,"$1")},T[0],this.lexer)}},q.reflink=function(A,T){var W;if((W=this.rules.inline.reflink.exec(A))||(W=this.rules.inline.nolink.exec(A))){var F=(W[2]||W[1]).replace(/\s+/g," ");if(F=T[F.toLowerCase()],!F||!F.href){var Z=W[0].charAt(0);return{type:"text",raw:Z,text:Z}}return oe(W,F,W[0],this.lexer)}},q.emStrong=function(A,T,W){W===void 0&&(W="");var F=this.rules.inline.emStrong.lDelim.exec(A);if(F&&!(F[3]&&W.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 Z=F[1]||F[2]||"";if(!Z||Z&&(W===""||this.rules.inline.punctuation.exec(W))){var ce=F[0].length-1,Ce,De,He=ce,Fe=0,Rt=F[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(Rt.lastIndex=0,T=T.slice(-1*A.length+ce);(F=Rt.exec(T))!=null;)if(Ce=F[1]||F[2]||F[3]||F[4]||F[5]||F[6],!!Ce){if(De=Ce.length,F[3]||F[4]){He+=De;continue}else if((F[5]||F[6])&&ce%3&&!((ce+De)%3)){Fe+=De;continue}if(He-=De,!(He>0)){if(De=Math.min(De,De+He+Fe),Math.min(ce,De)%2){var Et=A.slice(1,ce+F.index+De);return{type:"em",raw:A.slice(0,ce+F.index+De+1),text:Et,tokens:this.lexer.inlineTokens(Et)}}var Re=A.slice(2,ce+F.index+De-1);return{type:"strong",raw:A.slice(0,ce+F.index+De+1),text:Re,tokens:this.lexer.inlineTokens(Re)}}}}}},q.codespan=function(A){var T=this.rules.inline.code.exec(A);if(T){var W=T[2].replace(/\n/g," "),F=/[^ ]/.test(W),Z=/^ /.test(W)&&/ $/.test(W);return F&&Z&&(W=W.substring(1,W.length-1)),W=p(W,!0),{type:"codespan",raw:T[0],text:W}}},q.br=function(A){var T=this.rules.inline.br.exec(A);if(T)return{type:"br",raw:T[0]}},q.del=function(A){var T=this.rules.inline.del.exec(A);if(T)return{type:"del",raw:T[0],text:T[2],tokens:this.lexer.inlineTokens(T[2])}},q.autolink=function(A,T){var W=this.rules.inline.autolink.exec(A);if(W){var F,Z;return W[2]==="@"?(F=p(this.options.mangle?T(W[1]):W[1]),Z="mailto:"+F):(F=p(W[1]),Z=F),{type:"link",raw:W[0],text:F,href:Z,tokens:[{type:"text",raw:F,text:F}]}}},q.url=function(A,T){var W;if(W=this.rules.inline.url.exec(A)){var F,Z;if(W[2]==="@")F=p(this.options.mangle?T(W[0]):W[0]),Z="mailto:"+F;else{var ce;do ce=W[0],W[0]=this.rules.inline._backpedal.exec(W[0])[0];while(ce!==W[0]);F=p(W[0]),W[1]==="www."?Z="http://"+F:Z=F}return{type:"link",raw:W[0],text:F,href:Z,tokens:[{type:"text",raw:F,text:F}]}}},q.inlineText=function(A,T){var W=this.rules.inline.text.exec(A);if(W){var F;return this.lexer.state.inRawBlock?F=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(W[0]):p(W[0]):W[0]:F=p(this.options.smartypants?T(W[0]):W[0]),{type:"text",raw:W[0],text:F}}},J}(),me={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]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:M,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};me._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/,me._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,me.def=y(me.def).replace("label",me._label).replace("title",me._title).getRegex(),me.bullet=/(?:[*+-]|\d{1,9}[.)])/,me.listItemStart=y(/^( *)(bull) */).replace("bull",me.bullet).getRegex(),me.list=y(me.list).replace(/bull/g,me.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+me.def.source+")").getRegex(),me._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",me._comment=/|$)/,me.html=y(me.html,"i").replace("comment",me._comment).replace("tag",me._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),me.paragraph=y(me._paragraph).replace("hr",me.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",")|<(?:script|pre|style|textarea|!--)").replace("tag",me._tag).getRegex(),me.blockquote=y(me.blockquote).replace("paragraph",me.paragraph).getRegex(),me.normal=R({},me),me.gfm=R({},me.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),me.gfm.table=y(me.gfm.table).replace("hr",me.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",")|<(?:script|pre|style|textarea|!--)").replace("tag",me._tag).getRegex(),me.gfm.paragraph=y(me._paragraph).replace("hr",me.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",me.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",me._tag).getRegex(),me.pedantic=R({},me.normal,{html:y(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",me._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:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:M,paragraph:y(me.normal._paragraph).replace("hr",me.hr).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",me.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ie={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:M,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\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:M,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",ie.punctuation=y(ie.punctuation).replace(/punctuation/g,ie._punctuation).getRegex(),ie.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,ie.escapedEmSt=/\\\*|\\_/g,ie._comment=y(me._comment).replace("(?:-->|$)","-->").getRegex(),ie.emStrong.lDelim=y(ie.emStrong.lDelim).replace(/punct/g,ie._punctuation).getRegex(),ie.emStrong.rDelimAst=y(ie.emStrong.rDelimAst,"g").replace(/punct/g,ie._punctuation).getRegex(),ie.emStrong.rDelimUnd=y(ie.emStrong.rDelimUnd,"g").replace(/punct/g,ie._punctuation).getRegex(),ie._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ie._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ie._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])?)+(?![-_])/,ie.autolink=y(ie.autolink).replace("scheme",ie._scheme).replace("email",ie._email).getRegex(),ie._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ie.tag=y(ie.tag).replace("comment",ie._comment).replace("attribute",ie._attribute).getRegex(),ie._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ie._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,ie._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ie.link=y(ie.link).replace("label",ie._label).replace("href",ie._href).replace("title",ie._title).getRegex(),ie.reflink=y(ie.reflink).replace("label",ie._label).replace("ref",me._label).getRegex(),ie.nolink=y(ie.nolink).replace("ref",me._label).getRegex(),ie.reflinkSearch=y(ie.reflinkSearch,"g").replace("reflink",ie.reflink).replace("nolink",ie.nolink).getRegex(),ie.normal=R({},ie),ie.pedantic=R({},ie.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:y(/^!?\[(label)\]\((.*?)\)/).replace("label",ie._label).getRegex(),reflink:y(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ie._label).getRegex()}),ie.gfm=R({},ie.normal,{escape:y(ie.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]*?(?:(?=[\\.5&&(A="x"+A.toString(16)),q+="&#"+A+";";return q}var Nt=function(){function J(U){this.tokens=[],this.tokens.links=Object.create(null),this.options=U||e.defaults,this.options.tokenizer=this.options.tokenizer||new Ie,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 A={block:me.normal,inline:ie.normal};this.options.pedantic?(A.block=me.pedantic,A.inline=ie.pedantic):this.options.gfm&&(A.block=me.gfm,this.options.breaks?A.inline=ie.breaks:A.inline=ie.gfm),this.tokenizer.rules=A}J.lex=function(A,T){var W=new J(T);return W.lex(A)},J.lexInline=function(A,T){var W=new J(T);return W.inlineTokens(A)};var q=J.prototype;return q.lex=function(A){A=A.replace(/\r\n|\r/g,` -`),this.blockTokens(A,this.tokens);for(var T;T=this.inlineQueue.shift();)this.inlineTokens(T.src,T.tokens);return this.tokens},q.blockTokens=function(A,T){var W=this;T===void 0&&(T=[]),this.options.pedantic?A=A.replace(/\t/g," ").replace(/^ +$/gm,""):A=A.replace(/^( *)(\t+)/gm,function(He,Fe,Rt){return Fe+" ".repeat(Rt.length)});for(var F,Z,ce,Ce;A;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(He){return(F=He.call({lexer:W},A,T))?(A=A.substring(F.raw.length),T.push(F),!0):!1}))){if(F=this.tokenizer.space(A)){A=A.substring(F.raw.length),F.raw.length===1&&T.length>0?T[T.length-1].raw+=` +`)}}},q.fences=function(A){var T=this.rules.block.fences.exec(A);if(T){var W=T[0],F=Se(W,T[3]||"");return{type:"code",raw:W,lang:T[2]?T[2].trim():T[2],text:F}}},q.heading=function(A){var T=this.rules.block.heading.exec(A);if(T){var W=T[2].trim();if(/#$/.test(W)){var F=G(W,"#");(this.options.pedantic||!F||/ $/.test(F))&&(W=F.trim())}return{type:"heading",raw:T[0],depth:T[1].length,text:W,tokens:this.lexer.inline(W)}}},q.hr=function(A){var T=this.rules.block.hr.exec(A);if(T)return{type:"hr",raw:T[0]}},q.blockquote=function(A){var T=this.rules.block.blockquote.exec(A);if(T){var W=T[0].replace(/^ *>[ \t]?/gm,"");return{type:"blockquote",raw:T[0],tokens:this.lexer.blockTokens(W,[]),text:W}}},q.list=function(A){var T=this.rules.block.list.exec(A);if(T){var W,F,Z,ce,Ce,De,ze,Oe,Nt,Et,Re,ui,hi=T[1].trim(),er=hi.length>1,wt={type:"list",raw:"",ordered:er,start:er?+hi.slice(0,-1):"",loose:!1,items:[]};hi=er?"\\d{1,9}\\"+hi.slice(-1):"\\"+hi,this.options.pedantic&&(hi=er?hi:"[*+-]");for(var Wi=new RegExp("^( {0,3}"+hi+")((?:[ ][^\\n]*)?(?:\\n|$))");A&&(ui=!1,!(!(T=Wi.exec(A))||this.rules.block.hr.test(A)));){if(W=T[0],A=A.substring(W.length),Oe=T[2].split(` +`,1)[0],Nt=A.split(` +`,1)[0],this.options.pedantic?(ce=2,Re=Oe.trimLeft()):(ce=T[2].search(/[^ ]/),ce=ce>4?1:ce,Re=Oe.slice(ce),ce+=T[1].length),De=!1,!Oe&&/^ *$/.test(Nt)&&(W+=Nt+` +`,A=A.substring(Nt.length+1),ui=!0),!ui)for(var Ou=new RegExp("^ {0,"+Math.min(3,ce-1)+"}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))"),Fu=new RegExp("^ {0,"+Math.min(3,ce-1)+"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"),Rr=new RegExp("^ {0,"+Math.min(3,ce-1)+"}(?:```|~~~)"),Ic=new RegExp("^ {0,"+Math.min(3,ce-1)+"}#");A&&(Et=A.split(` +`,1)[0],Oe=Et,this.options.pedantic&&(Oe=Oe.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(Rr.test(Oe)||Ic.test(Oe)||Ou.test(Oe)||Fu.test(A)));){if(Oe.search(/[^ ]/)>=ce||!Oe.trim())Re+=` +`+Oe.slice(ce);else if(!De)Re+=` +`+Oe;else break;!De&&!Oe.trim()&&(De=!0),W+=Et+` +`,A=A.substring(Et.length+1)}wt.loose||(ze?wt.loose=!0:/\n *\n *$/.test(W)&&(ze=!0)),this.options.gfm&&(F=/^\[[ xX]\] /.exec(Re),F&&(Z=F[0]!=="[ ] ",Re=Re.replace(/^\[[ xX]\] +/,""))),wt.items.push({type:"list_item",raw:W,task:!!F,checked:Z,loose:!1,text:Re}),wt.raw+=W}wt.items[wt.items.length-1].raw=W.trimRight(),wt.items[wt.items.length-1].text=Re.trimRight(),wt.raw=wt.raw.trimRight();var Bu=wt.items.length;for(Ce=0;Ce1)return!0}return!1});!wt.loose&&Wu.length&&cg&&(wt.loose=!0,wt.items[Ce].loose=!0)}return wt}},q.html=function(A){var T=this.rules.block.html.exec(A);if(T){var W={type:"html",raw:T[0],pre:!this.options.sanitizer&&(T[1]==="pre"||T[1]==="script"||T[1]==="style"),text:T[0]};if(this.options.sanitize){var F=this.options.sanitizer?this.options.sanitizer(T[0]):p(T[0]);W.type="paragraph",W.text=F,W.tokens=this.lexer.inline(F)}return W}},q.def=function(A){var T=this.rules.block.def.exec(A);if(T){T[3]&&(T[3]=T[3].substring(1,T[3].length-1));var W=T[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:W,raw:T[0],href:T[2],title:T[3]}}},q.table=function(A){var T=this.rules.block.table.exec(A);if(T){var W={type:"table",header:z(T[1]).map(function(ze){return{text:ze}}),align:T[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:T[3]&&T[3].trim()?T[3].replace(/\n[ \t]*$/,"").split(` +`):[]};if(W.header.length===W.align.length){W.raw=T[0];var F=W.align.length,Z,ce,Ce,De;for(Z=0;Z/i.test(T[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(T[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(T[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:T[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(T[0]):p(T[0]):T[0]}},q.link=function(A){var T=this.rules.inline.link.exec(A);if(T){var W=T[2].trim();if(!this.options.pedantic&&/^$/.test(W))return;var F=G(W.slice(0,-1),"\\");if((W.length-F.length)%2===0)return}else{var Z=te(T[2],"()");if(Z>-1){var ce=T[0].indexOf("!")===0?5:4,Ce=ce+T[1].length+Z;T[2]=T[2].substring(0,Z),T[0]=T[0].substring(0,Ce).trim(),T[3]=""}}var De=T[2],ze="";if(this.options.pedantic){var Oe=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(De);Oe&&(De=Oe[1],ze=Oe[3])}else ze=T[3]?T[3].slice(1,-1):"";return De=De.trim(),/^$/.test(W)?De=De.slice(1):De=De.slice(1,-1)),oe(T,{href:De&&De.replace(this.rules.inline._escapes,"$1"),title:ze&&ze.replace(this.rules.inline._escapes,"$1")},T[0],this.lexer)}},q.reflink=function(A,T){var W;if((W=this.rules.inline.reflink.exec(A))||(W=this.rules.inline.nolink.exec(A))){var F=(W[2]||W[1]).replace(/\s+/g," ");if(F=T[F.toLowerCase()],!F||!F.href){var Z=W[0].charAt(0);return{type:"text",raw:Z,text:Z}}return oe(W,F,W[0],this.lexer)}},q.emStrong=function(A,T,W){W===void 0&&(W="");var F=this.rules.inline.emStrong.lDelim.exec(A);if(F&&!(F[3]&&W.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 Z=F[1]||F[2]||"";if(!Z||Z&&(W===""||this.rules.inline.punctuation.exec(W))){var ce=F[0].length-1,Ce,De,ze=ce,Oe=0,Nt=F[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(Nt.lastIndex=0,T=T.slice(-1*A.length+ce);(F=Nt.exec(T))!=null;)if(Ce=F[1]||F[2]||F[3]||F[4]||F[5]||F[6],!!Ce){if(De=Ce.length,F[3]||F[4]){ze+=De;continue}else if((F[5]||F[6])&&ce%3&&!((ce+De)%3)){Oe+=De;continue}if(ze-=De,!(ze>0)){if(De=Math.min(De,De+ze+Oe),Math.min(ce,De)%2){var Et=A.slice(1,ce+F.index+De);return{type:"em",raw:A.slice(0,ce+F.index+De+1),text:Et,tokens:this.lexer.inlineTokens(Et)}}var Re=A.slice(2,ce+F.index+De-1);return{type:"strong",raw:A.slice(0,ce+F.index+De+1),text:Re,tokens:this.lexer.inlineTokens(Re)}}}}}},q.codespan=function(A){var T=this.rules.inline.code.exec(A);if(T){var W=T[2].replace(/\n/g," "),F=/[^ ]/.test(W),Z=/^ /.test(W)&&/ $/.test(W);return F&&Z&&(W=W.substring(1,W.length-1)),W=p(W,!0),{type:"codespan",raw:T[0],text:W}}},q.br=function(A){var T=this.rules.inline.br.exec(A);if(T)return{type:"br",raw:T[0]}},q.del=function(A){var T=this.rules.inline.del.exec(A);if(T)return{type:"del",raw:T[0],text:T[2],tokens:this.lexer.inlineTokens(T[2])}},q.autolink=function(A,T){var W=this.rules.inline.autolink.exec(A);if(W){var F,Z;return W[2]==="@"?(F=p(this.options.mangle?T(W[1]):W[1]),Z="mailto:"+F):(F=p(W[1]),Z=F),{type:"link",raw:W[0],text:F,href:Z,tokens:[{type:"text",raw:F,text:F}]}}},q.url=function(A,T){var W;if(W=this.rules.inline.url.exec(A)){var F,Z;if(W[2]==="@")F=p(this.options.mangle?T(W[0]):W[0]),Z="mailto:"+F;else{var ce;do ce=W[0],W[0]=this.rules.inline._backpedal.exec(W[0])[0];while(ce!==W[0]);F=p(W[0]),W[1]==="www."?Z="http://"+F:Z=F}return{type:"link",raw:W[0],text:F,href:Z,tokens:[{type:"text",raw:F,text:F}]}}},q.inlineText=function(A,T){var W=this.rules.inline.text.exec(A);if(W){var F;return this.lexer.state.inRawBlock?F=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(W[0]):p(W[0]):W[0]:F=p(this.options.smartypants?T(W[0]):W[0]),{type:"text",raw:W[0],text:F}}},J}(),me={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]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:M,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};me._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/,me._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,me.def=y(me.def).replace("label",me._label).replace("title",me._title).getRegex(),me.bullet=/(?:[*+-]|\d{1,9}[.)])/,me.listItemStart=y(/^( *)(bull) */).replace("bull",me.bullet).getRegex(),me.list=y(me.list).replace(/bull/g,me.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+me.def.source+")").getRegex(),me._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",me._comment=/|$)/,me.html=y(me.html,"i").replace("comment",me._comment).replace("tag",me._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),me.paragraph=y(me._paragraph).replace("hr",me.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",")|<(?:script|pre|style|textarea|!--)").replace("tag",me._tag).getRegex(),me.blockquote=y(me.blockquote).replace("paragraph",me.paragraph).getRegex(),me.normal=R({},me),me.gfm=R({},me.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),me.gfm.table=y(me.gfm.table).replace("hr",me.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",")|<(?:script|pre|style|textarea|!--)").replace("tag",me._tag).getRegex(),me.gfm.paragraph=y(me._paragraph).replace("hr",me.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",me.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",me._tag).getRegex(),me.pedantic=R({},me.normal,{html:y(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",me._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:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:M,paragraph:y(me.normal._paragraph).replace("hr",me.hr).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",me.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ie={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:M,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\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:M,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",ie.punctuation=y(ie.punctuation).replace(/punctuation/g,ie._punctuation).getRegex(),ie.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,ie.escapedEmSt=/\\\*|\\_/g,ie._comment=y(me._comment).replace("(?:-->|$)","-->").getRegex(),ie.emStrong.lDelim=y(ie.emStrong.lDelim).replace(/punct/g,ie._punctuation).getRegex(),ie.emStrong.rDelimAst=y(ie.emStrong.rDelimAst,"g").replace(/punct/g,ie._punctuation).getRegex(),ie.emStrong.rDelimUnd=y(ie.emStrong.rDelimUnd,"g").replace(/punct/g,ie._punctuation).getRegex(),ie._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ie._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ie._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])?)+(?![-_])/,ie.autolink=y(ie.autolink).replace("scheme",ie._scheme).replace("email",ie._email).getRegex(),ie._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ie.tag=y(ie.tag).replace("comment",ie._comment).replace("attribute",ie._attribute).getRegex(),ie._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ie._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,ie._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ie.link=y(ie.link).replace("label",ie._label).replace("href",ie._href).replace("title",ie._title).getRegex(),ie.reflink=y(ie.reflink).replace("label",ie._label).replace("ref",me._label).getRegex(),ie.nolink=y(ie.nolink).replace("ref",me._label).getRegex(),ie.reflinkSearch=y(ie.reflinkSearch,"g").replace("reflink",ie.reflink).replace("nolink",ie.nolink).getRegex(),ie.normal=R({},ie),ie.pedantic=R({},ie.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:y(/^!?\[(label)\]\((.*?)\)/).replace("label",ie._label).getRegex(),reflink:y(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ie._label).getRegex()}),ie.gfm=R({},ie.normal,{escape:y(ie.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]*?(?:(?=[\\.5&&(A="x"+A.toString(16)),q+="&#"+A+";";return q}var Tt=function(){function J(U){this.tokens=[],this.tokens.links=Object.create(null),this.options=U||e.defaults,this.options.tokenizer=this.options.tokenizer||new Ie,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 A={block:me.normal,inline:ie.normal};this.options.pedantic?(A.block=me.pedantic,A.inline=ie.pedantic):this.options.gfm&&(A.block=me.gfm,this.options.breaks?A.inline=ie.breaks:A.inline=ie.gfm),this.tokenizer.rules=A}J.lex=function(A,T){var W=new J(T);return W.lex(A)},J.lexInline=function(A,T){var W=new J(T);return W.inlineTokens(A)};var q=J.prototype;return q.lex=function(A){A=A.replace(/\r\n|\r/g,` +`),this.blockTokens(A,this.tokens);for(var T;T=this.inlineQueue.shift();)this.inlineTokens(T.src,T.tokens);return this.tokens},q.blockTokens=function(A,T){var W=this;T===void 0&&(T=[]),this.options.pedantic?A=A.replace(/\t/g," ").replace(/^ +$/gm,""):A=A.replace(/^( *)(\t+)/gm,function(ze,Oe,Nt){return Oe+" ".repeat(Nt.length)});for(var F,Z,ce,Ce;A;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(ze){return(F=ze.call({lexer:W},A,T))?(A=A.substring(F.raw.length),T.push(F),!0):!1}))){if(F=this.tokenizer.space(A)){A=A.substring(F.raw.length),F.raw.length===1&&T.length>0?T[T.length-1].raw+=` `:T.push(F);continue}if(F=this.tokenizer.code(A)){A=A.substring(F.raw.length),Z=T[T.length-1],Z&&(Z.type==="paragraph"||Z.type==="text")?(Z.raw+=` `+F.raw,Z.text+=` `+F.text,this.inlineQueue[this.inlineQueue.length-1].src=Z.text):T.push(F);continue}if(F=this.tokenizer.fences(A)){A=A.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.heading(A)){A=A.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.hr(A)){A=A.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.blockquote(A)){A=A.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.list(A)){A=A.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.html(A)){A=A.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.def(A)){A=A.substring(F.raw.length),Z=T[T.length-1],Z&&(Z.type==="paragraph"||Z.type==="text")?(Z.raw+=` `+F.raw,Z.text+=` -`+F.raw,this.inlineQueue[this.inlineQueue.length-1].src=Z.text):this.tokens.links[F.tag]||(this.tokens.links[F.tag]={href:F.href,title:F.title});continue}if(F=this.tokenizer.table(A)){A=A.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.lheading(A)){A=A.substring(F.raw.length),T.push(F);continue}if(ce=A,this.options.extensions&&this.options.extensions.startBlock&&function(){var He=1/0,Fe=A.slice(1),Rt=void 0;W.options.extensions.startBlock.forEach(function(Et){Rt=Et.call({lexer:this},Fe),typeof Rt=="number"&&Rt>=0&&(He=Math.min(He,Rt))}),He<1/0&&He>=0&&(ce=A.substring(0,He+1))}(),this.state.top&&(F=this.tokenizer.paragraph(ce))){Z=T[T.length-1],Ce&&Z.type==="paragraph"?(Z.raw+=` +`+F.raw,this.inlineQueue[this.inlineQueue.length-1].src=Z.text):this.tokens.links[F.tag]||(this.tokens.links[F.tag]={href:F.href,title:F.title});continue}if(F=this.tokenizer.table(A)){A=A.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.lheading(A)){A=A.substring(F.raw.length),T.push(F);continue}if(ce=A,this.options.extensions&&this.options.extensions.startBlock&&function(){var ze=1/0,Oe=A.slice(1),Nt=void 0;W.options.extensions.startBlock.forEach(function(Et){Nt=Et.call({lexer:this},Oe),typeof Nt=="number"&&Nt>=0&&(ze=Math.min(ze,Nt))}),ze<1/0&&ze>=0&&(ce=A.substring(0,ze+1))}(),this.state.top&&(F=this.tokenizer.paragraph(ce))){Z=T[T.length-1],Ce&&Z.type==="paragraph"?(Z.raw+=` `+F.raw,Z.text+=` `+F.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=Z.text):T.push(F),Ce=ce.length!==A.length,A=A.substring(F.raw.length);continue}if(F=this.tokenizer.text(A)){A=A.substring(F.raw.length),Z=T[T.length-1],Z&&Z.type==="text"?(Z.raw+=` `+F.raw,Z.text+=` -`+F.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=Z.text):T.push(F);continue}if(A){var De="Infinite loop on byte: "+A.charCodeAt(0);if(this.options.silent){console.error(De);break}else throw new Error(De)}}return this.state.top=!0,T},q.inline=function(A,T){return T===void 0&&(T=[]),this.inlineQueue.push({src:A,tokens:T}),T},q.inlineTokens=function(A,T){var W=this;T===void 0&&(T=[]);var F,Z,ce,Ce=A,De,He,Fe;if(this.tokens.links){var Rt=Object.keys(this.tokens.links);if(Rt.length>0)for(;(De=this.tokenizer.rules.inline.reflinkSearch.exec(Ce))!=null;)Rt.includes(De[0].slice(De[0].lastIndexOf("[")+1,-1))&&(Ce=Ce.slice(0,De.index)+"["+fe("a",De[0].length-2)+"]"+Ce.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(De=this.tokenizer.rules.inline.blockSkip.exec(Ce))!=null;)Ce=Ce.slice(0,De.index)+"["+fe("a",De[0].length-2)+"]"+Ce.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(De=this.tokenizer.rules.inline.escapedEmSt.exec(Ce))!=null;)Ce=Ce.slice(0,De.index)+"++"+Ce.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;A;)if(He||(Fe=""),He=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(Re){return(F=Re.call({lexer:W},A,T))?(A=A.substring(F.raw.length),T.push(F),!0):!1}))){if(F=this.tokenizer.escape(A)){A=A.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.tag(A)){A=A.substring(F.raw.length),Z=T[T.length-1],Z&&F.type==="text"&&Z.type==="text"?(Z.raw+=F.raw,Z.text+=F.text):T.push(F);continue}if(F=this.tokenizer.link(A)){A=A.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.reflink(A,this.tokens.links)){A=A.substring(F.raw.length),Z=T[T.length-1],Z&&F.type==="text"&&Z.type==="text"?(Z.raw+=F.raw,Z.text+=F.text):T.push(F);continue}if(F=this.tokenizer.emStrong(A,Ce,Fe)){A=A.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.codespan(A)){A=A.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.br(A)){A=A.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.del(A)){A=A.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.autolink(A,Dt)){A=A.substring(F.raw.length),T.push(F);continue}if(!this.state.inLink&&(F=this.tokenizer.url(A,Dt))){A=A.substring(F.raw.length),T.push(F);continue}if(ce=A,this.options.extensions&&this.options.extensions.startInline&&function(){var Re=1/0,hi=A.slice(1),fi=void 0;W.options.extensions.startInline.forEach(function(tr){fi=tr.call({lexer:this},hi),typeof fi=="number"&&fi>=0&&(Re=Math.min(Re,fi))}),Re<1/0&&Re>=0&&(ce=A.substring(0,Re+1))}(),F=this.tokenizer.inlineText(ce,Xt)){A=A.substring(F.raw.length),F.raw.slice(-1)!=="_"&&(Fe=F.raw.slice(-1)),He=!0,Z=T[T.length-1],Z&&Z.type==="text"?(Z.raw+=F.raw,Z.text+=F.text):T.push(F);continue}if(A){var Et="Infinite loop on byte: "+A.charCodeAt(0);if(this.options.silent){console.error(Et);break}else throw new Error(Et)}}return T},i(J,null,[{key:"rules",get:function(){return{block:me,inline:ie}}}]),J}(),Ge=function(){function J(U){this.options=U||e.defaults}var q=J.prototype;return q.code=function(A,T,W){var F=(T||"").match(/\S*/)[0];if(this.options.highlight){var Z=this.options.highlight(A,F);Z!=null&&Z!==A&&(W=!0,A=Z)}return A=A.replace(/\n$/,"")+` +`+F.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=Z.text):T.push(F);continue}if(A){var De="Infinite loop on byte: "+A.charCodeAt(0);if(this.options.silent){console.error(De);break}else throw new Error(De)}}return this.state.top=!0,T},q.inline=function(A,T){return T===void 0&&(T=[]),this.inlineQueue.push({src:A,tokens:T}),T},q.inlineTokens=function(A,T){var W=this;T===void 0&&(T=[]);var F,Z,ce,Ce=A,De,ze,Oe;if(this.tokens.links){var Nt=Object.keys(this.tokens.links);if(Nt.length>0)for(;(De=this.tokenizer.rules.inline.reflinkSearch.exec(Ce))!=null;)Nt.includes(De[0].slice(De[0].lastIndexOf("[")+1,-1))&&(Ce=Ce.slice(0,De.index)+"["+fe("a",De[0].length-2)+"]"+Ce.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(De=this.tokenizer.rules.inline.blockSkip.exec(Ce))!=null;)Ce=Ce.slice(0,De.index)+"["+fe("a",De[0].length-2)+"]"+Ce.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(De=this.tokenizer.rules.inline.escapedEmSt.exec(Ce))!=null;)Ce=Ce.slice(0,De.index)+"++"+Ce.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;A;)if(ze||(Oe=""),ze=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(Re){return(F=Re.call({lexer:W},A,T))?(A=A.substring(F.raw.length),T.push(F),!0):!1}))){if(F=this.tokenizer.escape(A)){A=A.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.tag(A)){A=A.substring(F.raw.length),Z=T[T.length-1],Z&&F.type==="text"&&Z.type==="text"?(Z.raw+=F.raw,Z.text+=F.text):T.push(F);continue}if(F=this.tokenizer.link(A)){A=A.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.reflink(A,this.tokens.links)){A=A.substring(F.raw.length),Z=T[T.length-1],Z&&F.type==="text"&&Z.type==="text"?(Z.raw+=F.raw,Z.text+=F.text):T.push(F);continue}if(F=this.tokenizer.emStrong(A,Ce,Oe)){A=A.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.codespan(A)){A=A.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.br(A)){A=A.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.del(A)){A=A.substring(F.raw.length),T.push(F);continue}if(F=this.tokenizer.autolink(A,Dt)){A=A.substring(F.raw.length),T.push(F);continue}if(!this.state.inLink&&(F=this.tokenizer.url(A,Dt))){A=A.substring(F.raw.length),T.push(F);continue}if(ce=A,this.options.extensions&&this.options.extensions.startInline&&function(){var Re=1/0,ui=A.slice(1),hi=void 0;W.options.extensions.startInline.forEach(function(er){hi=er.call({lexer:this},ui),typeof hi=="number"&&hi>=0&&(Re=Math.min(Re,hi))}),Re<1/0&&Re>=0&&(ce=A.substring(0,Re+1))}(),F=this.tokenizer.inlineText(ce,Zt)){A=A.substring(F.raw.length),F.raw.slice(-1)!=="_"&&(Oe=F.raw.slice(-1)),ze=!0,Z=T[T.length-1],Z&&Z.type==="text"?(Z.raw+=F.raw,Z.text+=F.text):T.push(F);continue}if(A){var Et="Infinite loop on byte: "+A.charCodeAt(0);if(this.options.silent){console.error(Et);break}else throw new Error(Et)}}return T},i(J,null,[{key:"rules",get:function(){return{block:me,inline:ie}}}]),J}(),qe=function(){function J(U){this.options=U||e.defaults}var q=J.prototype;return q.code=function(A,T,W){var F=(T||"").match(/\S*/)[0];if(this.options.highlight){var Z=this.options.highlight(A,F);Z!=null&&Z!==A&&(W=!0,A=Z)}return A=A.replace(/\n$/,"")+` `,F?'
'+(W?A:p(A,!0))+`
`:"
"+(W?A:p(A,!0))+`
`},q.blockquote=function(A){return`
@@ -3054,29 +2855,29 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `},q.tablerow=function(A){return` `+A+` `},q.tablecell=function(A,T){var W=T.header?"th":"td",F=T.align?"<"+W+' align="'+T.align+'">':"<"+W+">";return F+A+(" -`)},q.strong=function(A){return""+A+""},q.em=function(A){return""+A+""},q.codespan=function(A){return""+A+""},q.br=function(){return this.options.xhtml?"
":"
"},q.del=function(A){return""+A+""},q.link=function(A,T,W){if(A=L(this.options.sanitize,this.options.baseUrl,A),A===null)return W;var F='",F},q.image=function(A,T,W){if(A=L(this.options.sanitize,this.options.baseUrl,A),A===null)return W;var F=''+W+'":">",F},q.text=function(A){return A},J}(),si=function(){function J(){}var q=J.prototype;return q.strong=function(A){return A},q.em=function(A){return A},q.codespan=function(A){return A},q.del=function(A){return A},q.html=function(A){return A},q.text=function(A){return A},q.link=function(A,T,W){return""+W},q.image=function(A,T,W){return""+W},q.br=function(){return""},J}(),ke=function(){function J(){this.seen={}}var q=J.prototype;return q.serialize=function(A){return A.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},q.getNextSafeSlug=function(A,T){var W=A,F=0;if(this.seen.hasOwnProperty(W)){F=this.seen[A];do F++,W=A+"-"+F;while(this.seen.hasOwnProperty(W))}return T||(this.seen[A]=F,this.seen[W]=0),W},q.slug=function(A,T){T===void 0&&(T={});var W=this.serialize(A);return this.getNextSafeSlug(W,T.dryrun)},J}(),Ve=function(){function J(U){this.options=U||e.defaults,this.options.renderer=this.options.renderer||new Ge,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new si,this.slugger=new ke}J.parse=function(A,T){var W=new J(T);return W.parse(A)},J.parseInline=function(A,T){var W=new J(T);return W.parseInline(A)};var q=J.prototype;return q.parse=function(A,T){T===void 0&&(T=!0);var W="",F,Z,ce,Ce,De,He,Fe,Rt,Et,Re,hi,fi,tr,Ct,Vi,Pu,Ou,Mr,Ic,Fu=A.length;for(F=0;F0&&Vi.tokens[0].type==="paragraph"?(Vi.tokens[0].text=Mr+" "+Vi.tokens[0].text,Vi.tokens[0].tokens&&Vi.tokens[0].tokens.length>0&&Vi.tokens[0].tokens[0].type==="text"&&(Vi.tokens[0].tokens[0].text=Mr+" "+Vi.tokens[0].tokens[0].text)):Vi.tokens.unshift({type:"text",text:Mr}):Ct+=Mr),Ct+=this.parse(Vi.tokens,tr),Et+=this.renderer.listitem(Ct,Ou,Pu);W+=this.renderer.list(Et,hi,fi);continue}case"html":{W+=this.renderer.html(Re.text);continue}case"paragraph":{W+=this.renderer.paragraph(this.parseInline(Re.tokens));continue}case"text":{for(Et=Re.tokens?this.parseInline(Re.tokens):Re.text;F+1"u"||J===null)throw new Error("marked(): input parameter is undefined or null");if(typeof J!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(J)+", string expected");if(typeof q=="function"&&(U=q,q=null),q=R({},ge.defaults,q||{}),ae(q),U){var A=q.highlight,T;try{T=Nt.lex(J,q)}catch(Ce){return U(Ce)}var W=function(De){var He;if(!De)try{q.walkTokens&&ge.walkTokens(T,q.walkTokens),He=Ve.parse(T,q)}catch(Fe){De=Fe}return q.highlight=A,De?U(De):U(null,He)};if(!A||A.length<3||(delete q.highlight,!T.length))return W();var F=0;ge.walkTokens(T,function(Ce){Ce.type==="code"&&(F++,setTimeout(function(){A(Ce.text,Ce.lang,function(De,He){if(De)return W(De);He!=null&&He!==Ce.text&&(Ce.text=He,Ce.escaped=!0),F--,F===0&&W()})},0))}),F===0&&W();return}function Z(Ce){if(Ce.message+=` -Please report this to https://github.com/markedjs/marked.`,q.silent)return"

An error occurred:

"+p(Ce.message+"",!0)+"
";throw Ce}try{var ce=Nt.lex(J,q);if(q.walkTokens){if(q.async)return Promise.all(ge.walkTokens(ce,q.walkTokens)).then(function(){return Ve.parse(ce,q)}).catch(Z);ge.walkTokens(ce,q.walkTokens)}return Ve.parse(ce,q)}catch(Ce){Z(Ce)}}ge.options=ge.setOptions=function(J){return R(ge.defaults,J),l(ge.defaults),ge},ge.getDefaults=a,ge.defaults=e.defaults,ge.use=function(){for(var J=arguments.length,q=new Array(J),U=0;U"u"||J===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof J!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(J)+", string expected");q=R({},ge.defaults,q||{}),ae(q);try{var U=Nt.lexInline(J,q);return q.walkTokens&&ge.walkTokens(U,q.walkTokens),Ve.parseInline(U,q)}catch(A){if(A.message+=` -Please report this to https://github.com/markedjs/marked.`,q.silent)return"

An error occurred:

"+p(A.message+"",!0)+"
";throw A}},ge.Parser=Ve,ge.parser=Ve.parse,ge.Renderer=Ge,ge.TextRenderer=si,ge.Lexer=Nt,ge.lexer=Nt.lex,ge.Tokenizer=Ie,ge.Slugger=ke,ge.parse=ge;var he=ge.options,Ei=ge.setOptions,kt=ge.use,Tt=ge.walkTokens,yi=ge.parseInline,er=ge,Mu=Ve.parse,ck=Nt.lex;e.Lexer=Nt,e.Parser=Ve,e.Renderer=Ge,e.Slugger=ke,e.TextRenderer=si,e.Tokenizer=Ie,e.getDefaults=a,e.lexer=ck,e.marked=ge,e.options=he,e.parse=er,e.parseInline=yi,e.parser=Mu,e.setOptions=Ei,e.use=kt,e.walkTokens=Tt,Object.defineProperty(e,"__esModule",{value:!0})})})();ps.Lexer||exports.Lexer;ps.Parser||exports.Parser;ps.Renderer||exports.Renderer;ps.Slugger||exports.Slugger;ps.TextRenderer||exports.TextRenderer;ps.Tokenizer||exports.Tokenizer;ps.getDefaults||exports.getDefaults;ps.lexer||exports.lexer;var Ma=ps.marked||exports.marked;ps.options||exports.options;ps.parse||exports.parse;ps.parseInline||exports.parseInline;ps.parser||exports.parser;ps.setOptions||exports.setOptions;ps.use||exports.use;ps.walkTokens||exports.walkTokens;function SDe(n){return JSON.stringify(n,xDe)}function pN(n){let e=JSON.parse(n);return e=mN(e),e}function xDe(n,e){return e instanceof RegExp?{$mid:2,source:e.source,flags:e.flags}:e}function mN(n,e=0){if(!n||e>200)return n;if(typeof n=="object"){switch(n.$mid){case 1:return je.revive(n);case 2:return new RegExp(n.source,n.flags);case 17:return new Date(n.source)}if(n instanceof eP||n instanceof Uint8Array)return n;if(Array.isArray(n))for(let t=0;t{let i=[],s=[];return n&&({href:n,dimensions:i}=gDe(n),s.push(`src="${Lw(n)}"`)),t&&s.push(`alt="${Lw(t)}"`),e&&s.push(`title="${Lw(e)}"`),i.length&&(s=s.concat(i)),""},paragraph:n=>`

${n}

`,link:(n,e,t)=>typeof n!="string"?"":(n===t&&(t=iE(t)),e=typeof e=="string"?Lw(iE(e)):"",n=iE(n),n=n.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),`
${t}`)});function TD(n,e={},t={}){var i,s;const o=new pe;let r=!1;const a=e3(e),l=function(v){let b;try{b=pN(decodeURIComponent(v))}catch{}return b?(b=sU(b,y=>{if(n.uris&&n.uris[y])return je.revive(n.uris[y])}),encodeURIComponent(JSON.stringify(b))):v},c=function(v,b){const y=n.uris&&n.uris[v];let w=je.revive(y);return b?v.startsWith(it.data+":")?v:(w||(w=je.parse(v)),XU.uriToBrowserUri(w).toString(!0)):!w||je.parse(v).toString()===w.toString()?v:(w.query&&(w=w.with({query:l(w.query)})),w.toString())},d=new Ma.Renderer;d.image=nE.image,d.link=nE.link,d.paragraph=nE.paragraph;const u=[],h=[];if(e.codeBlockRendererSync?d.code=(v,b)=>{const y=gN.nextId(),w=e.codeBlockRendererSync(J6(b),v);return h.push([y,w]),`
${kS(v)}
`}:e.codeBlockRenderer&&(d.code=(v,b)=>{const y=gN.nextId(),w=e.codeBlockRenderer(J6(b),v);return u.push(w.then(C=>[y,C])),`
${kS(v)}
`}),e.actionHandler){const v=function(w){let C=w.target;if(!(C.tagName!=="A"&&(C=C.parentElement,!C||C.tagName!=="A")))try{let L=C.dataset.href;L&&(n.baseUri&&(L=sE(je.from(n.baseUri),L)),e.actionHandler.callback(L,w))}catch(L){_t(L)}finally{w.preventDefault()}},b=e.actionHandler.disposables.add(new rt(a,"click")),y=e.actionHandler.disposables.add(new rt(a,"auxclick"));e.actionHandler.disposables.add(ue.any(b.event,y.event)(w=>{const C=new ur(w);!C.leftButton&&!C.middleButton||v(C)})),e.actionHandler.disposables.add(K(a,"keydown",w=>{const C=new Ht(w);!C.equals(10)&&!C.equals(3)||v(C)}))}n.supportHtml||(t.sanitizer=v=>(n.isTrusted?v.match(/^(]+>)|(<\/\s*span>)$/):void 0)?v:"",t.sanitize=!0,t.silent=!0),t.renderer=d;let f=(i=n.value)!==null&&i!==void 0?i:"";f.length>1e5&&(f=`${f.substr(0,1e5)}…`),n.supportThemeIcons&&(f=cDe(f));let g;if(e.fillInIncompleteTokens){const v=Object.assign(Object.assign({},Ma.defaults),t),b=Ma.lexer(f,v),y=NDe(b);g=Ma.parser(y,v)}else g=Ma.parse(f,t);n.supportThemeIcons&&(g=nf(g).map(b=>typeof b=="string"?b:b.outerHTML).join(""));const _=new DOMParser().parseFromString(_N(n,g),"text/html");if(_.body.querySelectorAll("img").forEach(v=>{const b=v.getAttribute("src");if(b){let y=b;try{n.baseUri&&(y=sE(je.from(n.baseUri),y))}catch{}v.src=c(y,!0)}}),_.body.querySelectorAll("a").forEach(v=>{const b=v.getAttribute("href");if(v.setAttribute("href",""),!b||/^data:|javascript:/i.test(b)||/^command:/i.test(b)&&!n.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(b))v.replaceWith(...v.childNodes);else{let y=c(b,!1);n.baseUri&&(y=sE(je.from(n.baseUri),b)),v.dataset.href=y}}),a.innerHTML=_N(n,_.body.innerHTML),u.length>0)Promise.all(u).then(v=>{var b,y;if(r)return;const w=new Map(v),C=a.querySelectorAll("div[data-code]");for(const L of C){const x=w.get((b=L.dataset.code)!==null&&b!==void 0?b:"");x&&ds(L,x)}(y=e.asyncRenderCallback)===null||y===void 0||y.call(e)});else if(h.length>0){const v=new Map(h),b=a.querySelectorAll("div[data-code]");for(const y of b){const w=v.get((s=y.dataset.code)!==null&&s!==void 0?s:"");w&&ds(y,w)}}if(e.asyncRenderCallback)for(const v of a.getElementsByTagName("img")){const b=o.add(K(v,"load",()=>{b.dispose(),e.asyncRenderCallback()}))}return{element:a,dispose:()=>{r=!0,o.dispose()}}}function J6(n){if(!n)return"";const e=n.split(/[\s+|:|,|\{|\?]/,1);return e.length?e[0]:n}function sE(n,e){return/^\w[\w\d+.-]*:/.test(e)?e:n.path.endsWith("/")?q7(n,e).toString():q7(NP(n),e).toString()}function _N(n,e){const{config:t,allowedSchemes:i}=DDe(n);KU("uponSanitizeAttribute",(o,r)=>{if(r.attrName==="style"||r.attrName==="class"){if(o.tagName==="SPAN"){if(r.attrName==="style"){r.keepAttr=/^(color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?(background-color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?$/.test(r.attrValue);return}else if(r.attrName==="class"){r.keepAttr=/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(r.attrValue);return}}r.keepAttr=!1;return}});const s=yme(i);try{return GU(e,Object.assign(Object.assign({},t),{RETURN_TRUSTED_TYPE:!0}))}finally{YU("uponSanitizeAttribute"),s.dispose()}}const LDe=["align","autoplay","alt","class","controls","data-code","data-href","height","href","loop","muted","playsinline","poster","src","style","target","title","width","start"];function DDe(n){const e=[it.http,it.https,it.mailto,it.data,it.file,it.vscodeFileResource,it.vscodeRemote,it.vscodeRemoteResource];return n.isTrusted&&e.push(it.command),{config:{ALLOWED_TAGS:[...wme],ALLOWED_ATTR:LDe,ALLOW_UNKNOWN_PROTOCOLS:!0},allowedSchemes:e}}function kDe(n){return typeof n=="string"?n:EDe(n)}function EDe(n){var e;let t=(e=n.value)!==null&&e!==void 0?e:"";t.length>1e5&&(t=`${t.substr(0,1e5)}…`);const i=Ma.parse(t,{renderer:IDe.value}).replace(/&(#\d+|[a-zA-Z]+);/g,s=>{var o;return(o=ADe.get(s))!==null&&o!==void 0?o:s});return _N({isTrusted:!1},i).toString()}const ADe=new Map([[""",'"'],[" "," "],["&","&"],["'","'"],["<","<"],[">",">"]]),IDe=new Wf(()=>{const n=new Ma.Renderer;return n.code=e=>e,n.blockquote=e=>e,n.html=e=>"",n.heading=(e,t,i)=>e+` +`)},q.strong=function(A){return""+A+""},q.em=function(A){return""+A+""},q.codespan=function(A){return""+A+""},q.br=function(){return this.options.xhtml?"
":"
"},q.del=function(A){return""+A+""},q.link=function(A,T,W){if(A=L(this.options.sanitize,this.options.baseUrl,A),A===null)return W;var F='",F},q.image=function(A,T,W){if(A=L(this.options.sanitize,this.options.baseUrl,A),A===null)return W;var F=''+W+'":">",F},q.text=function(A){return A},J}(),ni=function(){function J(){}var q=J.prototype;return q.strong=function(A){return A},q.em=function(A){return A},q.codespan=function(A){return A},q.del=function(A){return A},q.html=function(A){return A},q.text=function(A){return A},q.link=function(A,T,W){return""+W},q.image=function(A,T,W){return""+W},q.br=function(){return""},J}(),ke=function(){function J(){this.seen={}}var q=J.prototype;return q.serialize=function(A){return A.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},q.getNextSafeSlug=function(A,T){var W=A,F=0;if(this.seen.hasOwnProperty(W)){F=this.seen[A];do F++,W=A+"-"+F;while(this.seen.hasOwnProperty(W))}return T||(this.seen[A]=F,this.seen[W]=0),W},q.slug=function(A,T){T===void 0&&(T={});var W=this.serialize(A);return this.getNextSafeSlug(W,T.dryrun)},J}(),Ve=function(){function J(U){this.options=U||e.defaults,this.options.renderer=this.options.renderer||new qe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ni,this.slugger=new ke}J.parse=function(A,T){var W=new J(T);return W.parse(A)},J.parseInline=function(A,T){var W=new J(T);return W.parseInline(A)};var q=J.prototype;return q.parse=function(A,T){T===void 0&&(T=!0);var W="",F,Z,ce,Ce,De,ze,Oe,Nt,Et,Re,ui,hi,er,wt,Wi,Ou,Fu,Rr,Ic,Bu=A.length;for(F=0;F0&&Wi.tokens[0].type==="paragraph"?(Wi.tokens[0].text=Rr+" "+Wi.tokens[0].text,Wi.tokens[0].tokens&&Wi.tokens[0].tokens.length>0&&Wi.tokens[0].tokens[0].type==="text"&&(Wi.tokens[0].tokens[0].text=Rr+" "+Wi.tokens[0].tokens[0].text)):Wi.tokens.unshift({type:"text",text:Rr}):wt+=Rr),wt+=this.parse(Wi.tokens,er),Et+=this.renderer.listitem(wt,Fu,Ou);W+=this.renderer.list(Et,ui,hi);continue}case"html":{W+=this.renderer.html(Re.text);continue}case"paragraph":{W+=this.renderer.paragraph(this.parseInline(Re.tokens));continue}case"text":{for(Et=Re.tokens?this.parseInline(Re.tokens):Re.text;F+1"u"||J===null)throw new Error("marked(): input parameter is undefined or null");if(typeof J!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(J)+", string expected");if(typeof q=="function"&&(U=q,q=null),q=R({},ge.defaults,q||{}),ae(q),U){var A=q.highlight,T;try{T=Tt.lex(J,q)}catch(Ce){return U(Ce)}var W=function(De){var ze;if(!De)try{q.walkTokens&&ge.walkTokens(T,q.walkTokens),ze=Ve.parse(T,q)}catch(Oe){De=Oe}return q.highlight=A,De?U(De):U(null,ze)};if(!A||A.length<3||(delete q.highlight,!T.length))return W();var F=0;ge.walkTokens(T,function(Ce){Ce.type==="code"&&(F++,setTimeout(function(){A(Ce.text,Ce.lang,function(De,ze){if(De)return W(De);ze!=null&&ze!==Ce.text&&(Ce.text=ze,Ce.escaped=!0),F--,F===0&&W()})},0))}),F===0&&W();return}function Z(Ce){if(Ce.message+=` +Please report this to https://github.com/markedjs/marked.`,q.silent)return"

An error occurred:

"+p(Ce.message+"",!0)+"
";throw Ce}try{var ce=Tt.lex(J,q);if(q.walkTokens){if(q.async)return Promise.all(ge.walkTokens(ce,q.walkTokens)).then(function(){return Ve.parse(ce,q)}).catch(Z);ge.walkTokens(ce,q.walkTokens)}return Ve.parse(ce,q)}catch(Ce){Z(Ce)}}ge.options=ge.setOptions=function(J){return R(ge.defaults,J),l(ge.defaults),ge},ge.getDefaults=a,ge.defaults=e.defaults,ge.use=function(){for(var J=arguments.length,q=new Array(J),U=0;U"u"||J===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof J!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(J)+", string expected");q=R({},ge.defaults,q||{}),ae(q);try{var U=Tt.lexInline(J,q);return q.walkTokens&&ge.walkTokens(U,q.walkTokens),Ve.parseInline(U,q)}catch(A){if(A.message+=` +Please report this to https://github.com/markedjs/marked.`,q.silent)return"

An error occurred:

"+p(A.message+"",!0)+"
";throw A}},ge.Parser=Ve,ge.parser=Ve.parse,ge.Renderer=qe,ge.TextRenderer=ni,ge.Lexer=Tt,ge.lexer=Tt.lex,ge.Tokenizer=Ie,ge.Slugger=ke,ge.parse=ge;var he=ge.options,ki=ge.setOptions,kt=ge.use,It=ge.walkTokens,vi=ge.parseInline,Jo=ge,Pu=Ve.parse,ik=Tt.lex;e.Lexer=Tt,e.Parser=Ve,e.Renderer=qe,e.Slugger=ke,e.TextRenderer=ni,e.Tokenizer=Ie,e.getDefaults=a,e.lexer=ik,e.marked=ge,e.options=he,e.parse=Jo,e.parseInline=vi,e.parser=Pu,e.setOptions=ki,e.use=kt,e.walkTokens=It,Object.defineProperty(e,"__esModule",{value:!0})})})();gs.Lexer||exports.Lexer;gs.Parser||exports.Parser;gs.Renderer||exports.Renderer;gs.Slugger||exports.Slugger;gs.TextRenderer||exports.TextRenderer;gs.Tokenizer||exports.Tokenizer;gs.getDefaults||exports.getDefaults;gs.lexer||exports.lexer;var Na=gs.marked||exports.marked;gs.options||exports.options;gs.parse||exports.parse;gs.parseInline||exports.parseInline;gs.parser||exports.parser;gs.setOptions||exports.setOptions;gs.use||exports.use;gs.walkTokens||exports.walkTokens;function $De(n){return JSON.stringify(n,UDe)}function fN(n){let e=JSON.parse(n);return e=gN(e),e}function UDe(n,e){return e instanceof RegExp?{$mid:2,source:e.source,flags:e.flags}:e}function gN(n,e=0){if(!n||e>200)return n;if(typeof n=="object"){switch(n.$mid){case 1:return Ue.revive(n);case 2:return new RegExp(n.source,n.flags);case 17:return new Date(n.source)}if(n instanceof Q4||n instanceof Uint8Array)return n;if(Array.isArray(n))for(let t=0;t{let i=[],s=[];return n&&({href:n,dimensions:i}=MDe(n),s.push(`src="${vw(n)}"`)),t&&s.push(`alt="${vw(t)}"`),e&&s.push(`title="${vw(e)}"`),i.length&&(s=s.concat(i)),""},paragraph:n=>`

${n}

`,link:(n,e,t)=>typeof n!="string"?"":(n===t&&(t=X2(t)),e=typeof e=="string"?vw(X2(e)):"",n=X2(n),n=n.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),`
${t}`)});function xD(n,e={},t={}){var i,s;const o=new pe;let r=!1;const a=Q3(e),l=function(v){let b;try{b=fN(decodeURIComponent(v))}catch{}return b?(b=nU(b,y=>{if(n.uris&&n.uris[y])return Ue.revive(n.uris[y])}),encodeURIComponent(JSON.stringify(b))):v},c=function(v,b){const y=n.uris&&n.uris[v];let w=Ue.revive(y);return b?v.startsWith(tt.data+":")?v:(w||(w=Ue.parse(v)),ZU.uriToBrowserUri(w).toString(!0)):!w||Ue.parse(v).toString()===w.toString()?v:(w.query&&(w=w.with({query:l(w.query)})),w.toString())},d=new Na.Renderer;d.image=Q2.image,d.link=Q2.link,d.paragraph=Q2.paragraph;const u=[],h=[];if(e.codeBlockRendererSync?d.code=(v,b)=>{const y=hN.nextId(),w=e.codeBlockRendererSync(Y6(b),v);return h.push([y,w]),`
${yS(v)}
`}:e.codeBlockRenderer&&(d.code=(v,b)=>{const y=hN.nextId(),w=e.codeBlockRenderer(Y6(b),v);return u.push(w.then(S=>[y,S])),`
${yS(v)}
`}),e.actionHandler){const v=function(w){let S=w.target;if(!(S.tagName!=="A"&&(S=S.parentElement,!S||S.tagName!=="A")))try{let L=S.dataset.href;L&&(n.baseUri&&(L=J2(Ue.from(n.baseUri),L)),e.actionHandler.callback(L,w))}catch(L){mt(L)}finally{w.preventDefault()}},b=e.actionHandler.disposables.add(new ot(a,"click")),y=e.actionHandler.disposables.add(new ot(a,"auxclick"));e.actionHandler.disposables.add(ue.any(b.event,y.event)(w=>{const S=new dr(w);!S.leftButton&&!S.middleButton||v(S)})),e.actionHandler.disposables.add(K(a,"keydown",w=>{const S=new zt(w);!S.equals(10)&&!S.equals(3)||v(S)}))}n.supportHtml||(t.sanitizer=v=>(n.isTrusted?v.match(/^(]+>)|(<\/\s*span>)$/):void 0)?v:"",t.sanitize=!0,t.silent=!0),t.renderer=d;let f=(i=n.value)!==null&&i!==void 0?i:"";f.length>1e5&&(f=`${f.substr(0,1e5)}…`),n.supportThemeIcons&&(f=ADe(f));let g;if(e.fillInIncompleteTokens){const v=Object.assign(Object.assign({},Na.defaults),t),b=Na.lexer(f,v),y=QDe(b);g=Na.parser(y,v)}else g=Na.parse(f,t);n.supportThemeIcons&&(g=rf(g).map(b=>typeof b=="string"?b:b.outerHTML).join(""));const _=new DOMParser().parseFromString(pN(n,g),"text/html");if(_.body.querySelectorAll("img").forEach(v=>{const b=v.getAttribute("src");if(b){let y=b;try{n.baseUri&&(y=J2(Ue.from(n.baseUri),y))}catch{}v.src=c(y,!0)}}),_.body.querySelectorAll("a").forEach(v=>{const b=v.getAttribute("href");if(v.setAttribute("href",""),!b||/^data:|javascript:/i.test(b)||/^command:/i.test(b)&&!n.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(b))v.replaceWith(...v.childNodes);else{let y=c(b,!1);n.baseUri&&(y=J2(Ue.from(n.baseUri),b)),v.dataset.href=y}}),a.innerHTML=pN(n,_.body.innerHTML),u.length>0)Promise.all(u).then(v=>{var b,y;if(r)return;const w=new Map(v),S=a.querySelectorAll("div[data-code]");for(const L of S){const x=w.get((b=L.dataset.code)!==null&&b!==void 0?b:"");x&&ls(L,x)}(y=e.asyncRenderCallback)===null||y===void 0||y.call(e)});else if(h.length>0){const v=new Map(h),b=a.querySelectorAll("div[data-code]");for(const y of b){const w=v.get((s=y.dataset.code)!==null&&s!==void 0?s:"");w&&ls(y,w)}}if(e.asyncRenderCallback)for(const v of a.getElementsByTagName("img")){const b=o.add(K(v,"load",()=>{b.dispose(),e.asyncRenderCallback()}))}return{element:a,dispose:()=>{r=!0,o.dispose()}}}function Y6(n){if(!n)return"";const e=n.split(/[\s+|:|,|\{|\?]/,1);return e.length?e[0]:n}function J2(n,e){return/^\w[\w\d+.-]*:/.test(e)?e:n.path.endsWith("/")?H7(n,e).toString():H7(I3(n),e).toString()}function pN(n,e){const{config:t,allowedSchemes:i}=qDe(n);GU("uponSanitizeAttribute",(o,r)=>{if(r.attrName==="style"||r.attrName==="class"){if(o.tagName==="SPAN"){if(r.attrName==="style"){r.keepAttr=/^(color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?(background-color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?$/.test(r.attrValue);return}else if(r.attrName==="class"){r.keepAttr=/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(r.attrValue);return}}r.keepAttr=!1;return}});const s=Vme(i);try{return qU(e,Object.assign(Object.assign({},t),{RETURN_TRUSTED_TYPE:!0}))}finally{KU("uponSanitizeAttribute"),s.dispose()}}const jDe=["align","autoplay","alt","class","controls","data-code","data-href","height","href","loop","muted","playsinline","poster","src","style","target","title","width","start"];function qDe(n){const e=[tt.http,tt.https,tt.mailto,tt.data,tt.file,tt.vscodeFileResource,tt.vscodeRemote,tt.vscodeRemoteResource];return n.isTrusted&&e.push(tt.command),{config:{ALLOWED_TAGS:[...zme],ALLOWED_ATTR:jDe,ALLOW_UNKNOWN_PROTOCOLS:!0},allowedSchemes:e}}function GDe(n){return typeof n=="string"?n:KDe(n)}function KDe(n){var e;let t=(e=n.value)!==null&&e!==void 0?e:"";t.length>1e5&&(t=`${t.substr(0,1e5)}…`);const i=Na.parse(t,{renderer:ZDe.value}).replace(/&(#\d+|[a-zA-Z]+);/g,s=>{var o;return(o=YDe.get(s))!==null&&o!==void 0?o:s});return pN({isTrusted:!1},i).toString()}const YDe=new Map([[""",'"'],[" "," "],["&","&"],["'","'"],["<","<"],[">",">"]]),ZDe=new Hf(()=>{const n=new Na.Renderer;return n.code=e=>e,n.blockquote=e=>e,n.html=e=>"",n.heading=(e,t,i)=>e+` `,n.hr=()=>"",n.list=(e,t)=>e,n.listitem=e=>e+` `,n.paragraph=e=>e+` `,n.table=(e,t)=>e+t+` `,n.tablerow=e=>e,n.tablecell=(e,t)=>e+" ",n.strong=e=>e,n.em=e=>e,n.codespan=e=>e,n.br=()=>` -`,n.del=e=>e,n.image=(e,t,i)=>"",n.text=e=>e,n.link=(e,t,i)=>i,n});function i3(n){let e="";return n.forEach(t=>{e+=t.raw}),e}function TDe(n){for(const e of n.tokens)if(e.type==="text"){const t=e.raw.split(` -`),i=t[t.length-1];if(i.includes("`"))return MDe(n);if(i.includes("**"))return WDe(n);if(i.match(/\*\w/))return PDe(n);if(i.match(/(^|\s)__\w/))return VDe(n);if(i.match(/(^|\s)_\w/))return ODe(n);if(i.match(/(^|\s)\[.*\]\(\w*/))return FDe(n);if(i.match(/(^|\s)\[\w/))return BDe(n)}}function NDe(n){let e,t;for(e=0;ee,n.image=(e,t,i)=>"",n.text=e=>e,n.link=(e,t,i)=>i,n});function eP(n){let e="";return n.forEach(t=>{e+=t.raw}),e}function XDe(n){for(const e of n.tokens)if(e.type==="text"){const t=e.raw.split(` +`),i=t[t.length-1];if(i.includes("`"))return eke(n);if(i.includes("**"))return oke(n);if(i.match(/\*\w/))return tke(n);if(i.match(/(^|\s)__\w/))return rke(n);if(i.match(/(^|\s)_\w/))return ike(n);if(i.match(/(^|\s)\[.*\]\(\w*/))return nke(n);if(i.match(/(^|\s)\[\w/))return ske(n)}}function QDe(n){let e,t;for(e=0;e"u"&&r.match(/^\s*\|/)){const a=r.match(/(\|[^\|]+)(?=\||$)/g);a&&(i=a.length)}else if(typeof i=="number")if(r.match(/^\s*\|/)){if(o!==t.length-1)return;s=!0}else return}if(typeof i=="number"&&i>0){const o=s?t.slice(0,-1).join(` `):e,r=!!o.match(/\|\s*$/),a=o+(r?"":"|")+` -|${" --- |".repeat(i)}`;return Ma.lexer(a)}}class HDe{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(s=>s.splice(e,t,i))}}class yg extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function e8(n,e){const t=[];for(const i of e){if(n.start>=i.range.end)continue;if(n.ende.concat(t),[]))}class t8{get paddingTop(){return this._paddingTop}set paddingTop(e){this._size=this._size+e-this._paddingTop,this._paddingTop=e}constructor(e){this.groups=[],this._size=0,this._paddingTop=0,this._paddingTop=e??0,this._size=this._paddingTop}splice(e,t,i=[]){const s=i.length-t,o=e8({start:0,end:e},this.groups),r=e8({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(l=>({range:bN(l.range,s),size:l.size})),a=i.map((l,c)=>({range:{start:e+c,end:e+c+1},size:l.size}));this.groups=UDe(o,a,r),this._size=this._paddingTop+this.groups.reduce((l,c)=>l+c.size*(c.range.end-c.range.start),0)}get count(){const e=this.groups.length;return e?this.groups[e-1].range.end:0}get size(){return this._size}indexAt(e){if(e<0)return-1;if(e{for(const i of e)this.getRenderer(t).disposeTemplate(i.templateData),i.templateData=null}),this.cache.clear(),this.transactionNodesPendingRemoval.clear()}getRenderer(e){const t=this.renderers.get(e);if(!t)throw new Error(`No renderer found for ${e}`);return t}}var kc=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};const qu={CurrentDragAndDropData:void 0},ba={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(n){return[n]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class sy{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class GDe{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class KDe{constructor(){this.types=[],this.files=[]}update(e){if(e.types&&this.types.splice(0,this.types.length,...e.types),e.files){this.files.splice(0,this.files.length);for(let t=0;ts,e!=null&&e.getPosInSet?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(t,i)=>i+1,e!=null&&e.getRole?this.getRole=e.getRole.bind(e):this.getRole=t=>"listitem",e!=null&&e.isChecked?this.isChecked=e.isChecked.bind(e):this.isChecked=t=>{}}}class Qo{get contentHeight(){return this.rangeMap.size}get onDidScroll(){return this.scrollableElement.onScroll}get horizontalScrolling(){return this._horizontalScrolling}set horizontalScrolling(e){if(e!==this._horizontalScrolling){if(e&&this.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");if(this._horizontalScrolling=e,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this._horizontalScrolling){for(const t of this.items)this.measureItemWidth(t);this.updateScrollWidth(),this.scrollableElement.setScrollDimensions({width:d2(this.domNode)}),this.rowsContainer.style.width=`${Math.max(this.scrollWidth||0,this.renderWidth)}px`}else this.scrollableElementWidthDelayer.cancel(),this.scrollableElement.setScrollDimensions({width:this.renderWidth,scrollWidth:this.renderWidth}),this.rowsContainer.style.width=""}}constructor(e,t,i,s=ba){var o,r,a,l,c,d,u,h,f,g,p,_,v;if(this.virtualDelegate=t,this.domId=`list_id_${++Qo.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new Du(50),this.splicing=!1,this.dragOverAnimationStopDisposable=Y.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=Y.None,this.onDragLeaveTimeout=Y.None,this.disposables=new pe,this._onDidChangeContentHeight=new B,this._onDidChangeContentWidth=new B,this._horizontalScrolling=!1,s.horizontalScrolling&&s.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=new t8((o=s.paddingTop)!==null&&o!==void 0?o:0);for(const y of i)this.renderers.set(y.templateId,y);this.cache=this.disposables.add(new qDe(this.renderers)),this.lastRenderTop=0,this.lastRenderHeight=0,this.domNode=document.createElement("div"),this.domNode.className="monaco-list",this.domNode.classList.add(this.domId),this.domNode.tabIndex=0,this.domNode.classList.toggle("mouse-support",typeof s.mouseSupport=="boolean"?s.mouseSupport:!0),this._horizontalScrolling=(r=s.horizontalScrolling)!==null&&r!==void 0?r:ba.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=typeof s.paddingBottom>"u"?0:s.paddingBottom,this.accessibilityProvider=new ZDe(s.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",((a=s.transformOptimization)!==null&&a!==void 0?a:ba.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(Mt.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new Q1({forceIntegerValues:!0,smoothScrollDuration:(l=s.smoothScrolling)!==null&&l!==void 0&&l?125:0,scheduleAtNextAnimationFrame:y=>qo(y)})),this.scrollableElement=this.disposables.add(new CP(this.rowsContainer,{alwaysConsumeMouseWheel:(c=s.alwaysConsumeMouseWheel)!==null&&c!==void 0?c:ba.alwaysConsumeMouseWheel,horizontal:1,vertical:(d=s.verticalScrollMode)!==null&&d!==void 0?d:ba.verticalScrollMode,useShadows:(u=s.useShadows)!==null&&u!==void 0?u:ba.useShadows,mouseWheelScrollSensitivity:s.mouseWheelScrollSensitivity,fastScrollSensitivity:s.fastScrollSensitivity,scrollByPage:s.scrollByPage},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(K(this.rowsContainer,Ot.Change,y=>this.onTouchChange(y))),this.disposables.add(K(this.scrollableElement.getDomNode(),"scroll",y=>y.target.scrollTop=0)),this.disposables.add(K(this.domNode,"dragover",y=>this.onDragOver(this.toDragEvent(y)))),this.disposables.add(K(this.domNode,"drop",y=>this.onDrop(this.toDragEvent(y)))),this.disposables.add(K(this.domNode,"dragleave",y=>this.onDragLeave(this.toDragEvent(y)))),this.disposables.add(K(this.domNode,"dragend",y=>this.onDragEnd(y))),this.setRowLineHeight=(h=s.setRowLineHeight)!==null&&h!==void 0?h:ba.setRowLineHeight,this.setRowHeight=(f=s.setRowHeight)!==null&&f!==void 0?f:ba.setRowHeight,this.supportDynamicHeights=(g=s.supportDynamicHeights)!==null&&g!==void 0?g:ba.supportDynamicHeights,this.dnd=(p=s.dnd)!==null&&p!==void 0?p:this.disposables.add(ba.dnd),this.layout((_=s.initialSize)===null||_===void 0?void 0:_.height,(v=s.initialSize)===null||v===void 0?void 0:v.width)}updateOptions(e){e.paddingBottom!==void 0&&(this.paddingBottom=e.paddingBottom,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),e.smoothScrolling!==void 0&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),e.horizontalScrolling!==void 0&&(this.horizontalScrolling=e.horizontalScrolling);let t;if(e.scrollByPage!==void 0&&(t=Object.assign(Object.assign({},t??{}),{scrollByPage:e.scrollByPage})),e.mouseWheelScrollSensitivity!==void 0&&(t=Object.assign(Object.assign({},t??{}),{mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity})),e.fastScrollSensitivity!==void 0&&(t=Object.assign(Object.assign({},t??{}),{fastScrollSensitivity:e.fastScrollSensitivity})),t&&this.scrollableElement.updateOptions(t),e.paddingTop!==void 0&&e.paddingTop!==this.rangeMap.paddingTop){const i=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),s=e.paddingTop-this.rangeMap.paddingTop;this.rangeMap.paddingTop=e.paddingTop,this.render(i,Math.max(0,this.lastRenderTop+s),this.lastRenderHeight,void 0,void 0,!0),this.setScrollTop(this.lastRenderTop),this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.lastRenderTop,this.lastRenderHeight)}}splice(e,t,i=[]){if(this.splicing)throw new Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(e,t,i)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,t,i=[]){const s=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),o={start:e,end:e+t},r=kn.intersect(s,o),a=new Map;for(let L=r.end-1;L>=r.start;L--){const x=this.items[L];if(x.dragStartDisposable.dispose(),x.checkedDisposable.dispose(),x.row){let D=a.get(x.templateId);D||(D=[],a.set(x.templateId,D));const k=this.renderers.get(x.templateId);k&&k.disposeElement&&k.disposeElement(x.element,L,x.row.templateData,x.size),D.push(x.row)}x.row=null}const l={start:e+t,end:this.items.length},c=kn.intersect(l,s),d=kn.relativeComplement(l,s),u=i.map(L=>({id:String(this.itemId++),element:L,templateId:this.virtualDelegate.getTemplateId(L),size:this.virtualDelegate.getHeight(L),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(L),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:Y.None,checkedDisposable:Y.None}));let h;e===0&&t>=this.items.length?(this.rangeMap=new t8(this.rangeMap.paddingTop),this.rangeMap.splice(0,0,u),h=this.items,this.items=u):(this.rangeMap.splice(e,t,u),h=this.items.splice(e,t,...u));const f=i.length-t,g=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),p=bN(c,f),_=kn.intersect(g,p);for(let L=_.start;L<_.end;L++)this.updateItemInDOM(this.items[L],L);const v=kn.relativeComplement(p,g);for(const L of v)for(let x=L.start;xbN(L,f)),w=[{start:e,end:e+i.length},...b].map(L=>kn.intersect(g,L)),C=this.getNextToLastElement(w);for(const L of w)for(let x=L.start;xL.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=qo(()=>{this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight}),this.updateScrollWidth(),this.scrollableElementUpdateDisposable=null}))}eventuallyUpdateScrollWidth(){if(!this.horizontalScrolling){this.scrollableElementWidthDelayer.cancel();return}this.scrollableElementWidthDelayer.trigger(()=>this.updateScrollWidth())}updateScrollWidth(){if(!this.horizontalScrolling)return;let e=0;for(const t of this.items)typeof t.width<"u"&&(e=Math.max(e,t.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:e===0?0:e+10}),this._onDidChangeContentWidth.fire(this.scrollWidth)}rerender(){if(this.supportDynamicHeights){for(const e of this.items)e.lastDynamicHeightWidth=void 0;this._rerender(this.lastRenderTop,this.lastRenderHeight)}}get length(){return this.items.length}get renderHeight(){return this.scrollableElement.getScrollDimensions().height}get firstVisibleIndex(){const e=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),t=this.rangeMap.positionAt(e.start),i=this.rangeMap.positionAt(e.start+1);return i!==-1&&(i-t)/2+t{for(const u of c)for(let h=u.start;hs.row.domNode.setAttribute("aria-checked",String(!!u));d(a.value),s.checkedDisposable=a.onDidChange(d)}(o||!s.row.domNode.parentElement)&&(t?this.rowsContainer.insertBefore(s.row.domNode,t):this.rowsContainer.appendChild(s.row.domNode)),this.updateItemInDOM(s,e);const l=this.renderers.get(s.templateId);if(!l)throw new Error(`No renderer found for template id ${s.templateId}`);l==null||l.renderElement(s.element,e,s.row.templateData,s.size);const c=this.dnd.getDragURI(s.element);s.dragStartDisposable.dispose(),s.row.domNode.draggable=!!c,c&&(s.dragStartDisposable=K(s.row.domNode,"dragstart",d=>this.onDragStart(s.element,c,d))),this.horizontalScrolling&&(this.measureItemWidth(s),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width="fit-content",e.width=d2(e.row.domNode);const t=window.getComputedStyle(e.row.domNode);t.paddingLeft&&(e.width+=parseFloat(t.paddingLeft)),t.paddingRight&&(e.width+=parseFloat(t.paddingRight)),e.row.domNode.style.width=""}updateItemInDOM(e,t){e.row.domNode.style.top=`${this.elementTop(t)}px`,this.setRowHeight&&(e.row.domNode.style.height=`${e.size}px`),this.setRowLineHeight&&(e.row.domNode.style.lineHeight=`${e.size}px`),e.row.domNode.setAttribute("data-index",`${t}`),e.row.domNode.setAttribute("data-last-element",t===this.length-1?"true":"false"),e.row.domNode.setAttribute("data-parity",t%2===0?"even":"odd"),e.row.domNode.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(e.element,t,this.length))),e.row.domNode.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(e.element,t))),e.row.domNode.setAttribute("id",this.getElementDomId(t)),e.row.domNode.classList.toggle("drop-target",e.dropTarget)}removeItemFromDOM(e){const t=this.items[e];if(t.dragStartDisposable.dispose(),t.checkedDisposable.dispose(),t.row){const i=this.renderers.get(t.templateId);i&&i.disposeElement&&i.disposeElement(t.element,e,t.row.templateData,t.size),this.cache.release(t.row),t.row=null}this.horizontalScrolling&&this.eventuallyUpdateScrollWidth()}getScrollTop(){return this.scrollableElement.getScrollPosition().scrollTop}setScrollTop(e,t){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),this.scrollableElement.setScrollPosition({scrollTop:e,reuseAnimation:t})}get scrollTop(){return this.getScrollTop()}set scrollTop(e){this.setScrollTop(e)}get scrollHeight(){return this._scrollHeight+(this.horizontalScrolling?10:0)+this.paddingBottom}get onMouseClick(){return ue.map(this.disposables.add(new rt(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return ue.map(this.disposables.add(new rt(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return ue.filter(ue.map(this.disposables.add(new rt(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e),this.disposables),e=>e.browserEvent.button===1,this.disposables)}get onMouseDown(){return ue.map(this.disposables.add(new rt(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return ue.map(this.disposables.add(new rt(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return ue.map(this.disposables.add(new rt(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return ue.any(ue.map(this.disposables.add(new rt(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),ue.map(this.disposables.add(new rt(this.domNode,Ot.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return ue.map(this.disposables.add(new rt(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return ue.map(this.disposables.add(new rt(this.rowsContainer,Ot.Tap)).event,e=>this.toGestureEvent(e),this.disposables)}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}onScroll(e){try{const t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.render(t,e.scrollTop,e.height,e.scrollLeft,e.scrollWidth),this.supportDynamicHeights&&this._rerender(e.scrollTop,e.height,e.inSmoothScrolling)}catch(t){throw console.error("Got bad scroll event:",e),t}}onTouchChange(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY}onDragStart(e,t,i){var s,o;if(!i.dataTransfer)return;const r=this.dnd.getDragElements(e);if(i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setData(pG.TEXT,t),i.dataTransfer.setDragImage){let a;this.dnd.getDragLabel&&(a=this.dnd.getDragLabel(r,i)),typeof a>"u"&&(a=String(r.length));const l=ye(".monaco-drag-image");l.textContent=a;const d=(u=>{for(;u&&!u.classList.contains("monaco-workbench");)u=u.parentElement;return u||document.body})(this.domNode);d.appendChild(l),i.dataTransfer.setDragImage(l,-10,-10),setTimeout(()=>d.removeChild(l),0)}this.domNode.classList.add("dragging"),this.currentDragData=new sy(r),qu.CurrentDragAndDropData=new GDe(r),(o=(s=this.dnd).onDragStart)===null||o===void 0||o.call(s,this.currentDragData,i)}onDragOver(e){var t;if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),qu.CurrentDragAndDropData&&qu.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(qu.CurrentDragAndDropData)this.currentDragData=qu.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new KDe}const i=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.browserEvent);if(this.canDrop=typeof i=="boolean"?i:i.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;e.browserEvent.dataTransfer.dropEffect=typeof i!="boolean"&&i.effect===0?"copy":"move";let s;if(typeof i!="boolean"&&i.feedback?s=i.feedback:typeof e.index>"u"?s=[-1]:s=[e.index],s=mf(s).filter(o=>o>=-1&&oo-r),s=s[0]===-1?[-1]:s,YDe(this.currentDragFeedback,s))return!0;if(this.currentDragFeedback=s,this.currentDragFeedbackDisposable.dispose(),s[0]===-1)this.domNode.classList.add("drop-target"),this.rowsContainer.classList.add("drop-target"),this.currentDragFeedbackDisposable=Ze(()=>{this.domNode.classList.remove("drop-target"),this.rowsContainer.classList.remove("drop-target")});else{for(const o of s){const r=this.items[o];r.dropTarget=!0,(t=r.row)===null||t===void 0||t.domNode.classList.add("drop-target")}this.currentDragFeedbackDisposable=Ze(()=>{var o;for(const r of s){const a=this.items[r];a.dropTarget=!1,(o=a.row)===null||o===void 0||o.domNode.classList.remove("drop-target")}})}return!0}onDragLeave(e){var t,i;this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=MS(()=>this.clearDragOverFeedback(),100,this.disposables),this.currentDragData&&((i=(t=this.dnd).onDragLeave)===null||i===void 0||i.call(t,this.currentDragData,e.element,e.index,e.browserEvent))}onDrop(e){if(!this.canDrop)return;const t=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,qu.CurrentDragAndDropData=void 0,!(!t||!e.browserEvent.dataTransfer)&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.browserEvent))}onDragEnd(e){var t,i;this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,qu.CurrentDragAndDropData=void 0,(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=Y.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const t=ej(this.domNode).top;this.dragOverAnimationDisposable=vme(this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=MS(()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)},1e3,this.disposables),this.dragOverMouseY=e.pageY}animateDragAndDropScrollTop(e){if(this.dragOverMouseY===void 0)return;const t=this.dragOverMouseY-e,i=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>i&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-i))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let i=e;for(;i instanceof HTMLElement&&i!==this.rowsContainer&&t.contains(i);){const s=i.getAttribute("data-index");if(s){const o=Number(s);if(!isNaN(o))return o}i=i.parentElement}}getRenderRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}_rerender(e,t,i){const s=this.getRenderRange(e,t);let o,r;e===this.elementTop(s.start)?(o=s.start,r=0):s.end-s.start>1&&(o=s.start+1,r=this.elementTop(o)-e);let a=0;for(;;){const l=this.getRenderRange(e,t);let c=!1;for(let d=l.start;d=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},i8=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class XDe{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.name}`}renderTemplate(e){return e}renderElement(e,t,i){const s=this.renderedElements.findIndex(o=>o.templateData===i);if(s>=0){const o=this.renderedElements[s];this.trait.unrender(i),o.index=t}else{const o={index:t,templateData:i};this.renderedElements.push(o)}this.trait.renderIndex(t,i)}splice(e,t,i){const s=[];for(const o of this.renderedElements)o.index=e+t&&s.push({index:o.index+i-t,templateData:o.templateData});this.renderedElements=s}renderIndexes(e){for(const{index:t,templateData:i}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,i)}disposeTemplate(e){const t=this.renderedElements.findIndex(i=>i.templateData===e);t<0||this.renderedElements.splice(t,1)}}let px=class{get name(){return this._trait}get renderer(){return new XDe(this)}constructor(e){this._trait=e,this.length=0,this.indexes=[],this.sortedIndexes=[],this._onChange=new B,this.onChange=this._onChange.event}splice(e,t,i){var s;t=Math.max(0,Math.min(t,this.length-e));const o=i.length-t,r=e+t,a=[];let l=0;for(;l=r;)a.push(this.sortedIndexes[l++]+o);const c=this.length+o;if(this.sortedIndexes.length>0&&a.length===0&&c>0){const d=(s=this.sortedIndexes.find(u=>u>=e))!==null&&s!==void 0?s:c-1;a.push(Math.min(d,c-1))}this.renderer.splice(e,t,i.length),this._set(a,a),this.length=c}renderIndex(e,t){t.classList.toggle(this._trait,this.contains(e))}unrender(e){e.classList.remove(this._trait)}set(e,t){return this._set(e,[...e].sort(s8),t)}_set(e,t,i){const s=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const r=vN(o,e);return this.renderer.renderIndexes(r),this._onChange.fire({indexes:e,browserEvent:i}),s}get(){return this.indexes}contains(e){return Y$(this.sortedIndexes,e,s8)>=0}dispose(){Bt(this._onChange)}};Xf([ki],px.prototype,"renderer",null);class QDe extends px{constructor(e){super("selected"),this.setAriaSelected=e}renderIndex(e,t){super.renderIndex(e,t),this.setAriaSelected&&(this.contains(e)?t.setAttribute("aria-selected","true"):t.setAttribute("aria-selected","false"))}}class oE{constructor(e,t,i){this.trait=e,this.view=t,this.identityProvider=i}splice(e,t,i){if(!this.identityProvider)return this.trait.splice(e,t,new Array(i.length).fill(!1));const s=this.trait.get().map(a=>this.identityProvider.getId(this.view.element(a)).toString());if(s.length===0)return this.trait.splice(e,t,new Array(i.length).fill(!1));const o=new Set(s),r=i.map(a=>o.has(this.identityProvider.getId(a).toString()));this.trait.splice(e,t,r)}}function Md(n){return n.tagName==="INPUT"||n.tagName==="TEXTAREA"}function ep(n){return n.classList.contains("monaco-editor")?!0:n.classList.contains("monaco-list")||!n.parentElement?!1:ep(n.parentElement)}function AG(n){return n.tagName==="A"&&n.classList.contains("monaco-button")||n.tagName==="DIV"&&n.classList.contains("monaco-button-dropdown")?!0:n.classList.contains("monaco-list")||!n.parentElement?!1:AG(n.parentElement)}class IG{get onKeyDown(){return ue.chain(this.disposables.add(new rt(this.view.domNode,"keydown")).event,e=>e.filter(t=>!Md(t.target)).map(t=>new Ht(t)))}constructor(e,t,i){this.list=e,this.view=t,this.disposables=new pe,this.multipleSelectionDisposables=new pe,this.multipleSelectionSupport=i.multipleSelectionSupport,this.disposables.add(this.onKeyDown(s=>{switch(s.keyCode){case 3:return this.onEnter(s);case 16:return this.onUpArrow(s);case 18:return this.onDownArrow(s);case 11:return this.onPageUpArrow(s);case 12:return this.onPageDownArrow(s);case 9:return this.onEscape(s);case 31:this.multipleSelectionSupport&&(mt?s.metaKey:s.ctrlKey)&&this.onCtrlA(s)}}))}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionSupport=e.multipleSelectionSupport)}onEnter(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(this.list.getFocus(),e.browserEvent)}onUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPrevious(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNext(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPreviousPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNextPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onCtrlA(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(is(this.list.length),e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus()}onEscape(e){this.list.getSelection().length&&(e.preventDefault(),e.stopPropagation(),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus())}dispose(){this.disposables.dispose(),this.multipleSelectionDisposables.dispose()}}Xf([ki],IG.prototype,"onKeyDown",null);var Pa;(function(n){n[n.Automatic=0]="Automatic",n[n.Trigger=1]="Trigger"})(Pa||(Pa={}));var tp;(function(n){n[n.Idle=0]="Idle",n[n.Typing=1]="Typing"})(tp||(tp={}));const JDe=new class{mightProducePrintableCharacter(n){return n.ctrlKey||n.metaKey||n.altKey?!1:n.keyCode>=31&&n.keyCode<=56||n.keyCode>=21&&n.keyCode<=30||n.keyCode>=98&&n.keyCode<=107||n.keyCode>=85&&n.keyCode<=95}};class eke{constructor(e,t,i,s,o){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.keyboardNavigationEventFilter=s,this.delegate=o,this.enabled=!1,this.state=tp.Idle,this.mode=Pa.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new pe,this.disposables=new pe,this.updateOptions(e.options)}updateOptions(e){var t,i;!((t=e.typeNavigationEnabled)!==null&&t!==void 0)||t?this.enable():this.disable(),this.mode=(i=e.typeNavigationMode)!==null&&i!==void 0?i:Pa.Automatic}enable(){if(this.enabled)return;let e=!1;const t=ue.chain(this.enabledDisposables.add(new rt(this.view.domNode,"keydown")).event,o=>o.filter(r=>!Md(r.target)).filter(()=>this.mode===Pa.Automatic||this.triggered).map(r=>new Ht(r)).filter(r=>e||this.keyboardNavigationEventFilter(r)).filter(r=>this.delegate.mightProducePrintableCharacter(r)).forEach(r=>Ue.stop(r,!0)).map(r=>r.browserEvent.key)),i=ue.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);ue.reduce(ue.any(t,i),(o,r)=>r===null?null:(o||"")+r,void 0,this.enabledDisposables)(this.onInput,this,this.enabledDisposables),i(this.onClear,this,this.enabledDisposables),t(()=>e=!0,void 0,this.enabledDisposables),i(()=>e=!1,void 0,this.enabledDisposables),this.enabled=!0,this.triggered=!1}disable(){this.enabled&&(this.enabledDisposables.clear(),this.enabled=!1,this.triggered=!1)}onClear(){var e;const t=this.list.getFocus();if(t.length>0&&t[0]===this.previouslyFocused){const i=(e=this.list.options.accessibilityProvider)===null||e===void 0?void 0:e.getAriaLabel(this.list.element(t[0]));i&&Z1(i)}this.previouslyFocused=-1}onInput(e){if(!e){this.state=tp.Idle,this.triggered=!1;return}const t=this.list.getFocus(),i=t.length>0?t[0]:0,s=this.state===tp.Idle?1:0;this.state=tp.Typing;for(let o=0;o1&&c.length===1){this.previouslyFocused=i,this.list.setFocus([r]),this.list.reveal(r);return}}}else if(typeof l>"u"||gx(e,l)){this.previouslyFocused=i,this.list.setFocus([r]),this.list.reveal(r);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class tke{constructor(e,t){this.list=e,this.view=t,this.disposables=new pe;const i=ue.chain(this.disposables.add(new rt(t.domNode,"keydown")).event,o=>o.filter(r=>!Md(r.target)).map(r=>new Ht(r)));ue.chain(i,o=>o.filter(r=>r.keyCode===2&&!r.ctrlKey&&!r.metaKey&&!r.shiftKey&&!r.altKey))(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;const t=this.list.getFocus();if(t.length===0)return;const i=this.view.domElement(t[0]);if(!i)return;const s=i.querySelector("[tabIndex]");if(!s||!(s instanceof HTMLElement)||s.tabIndex===-1)return;const o=window.getComputedStyle(s);o.visibility==="hidden"||o.display==="none"||(e.preventDefault(),e.stopPropagation(),s.focus())}dispose(){this.disposables.dispose()}}function TG(n){return mt?n.browserEvent.metaKey:n.browserEvent.ctrlKey}function NG(n){return n.browserEvent.shiftKey}function ike(n){return n instanceof MouseEvent&&n.button===2}const n8={isSelectionSingleChangeEvent:TG,isSelectionRangeChangeEvent:NG};class RG{constructor(e){this.list=e,this.disposables=new pe,this._onPointer=new B,this.onPointer=this._onPointer.event,e.options.multipleSelectionSupport!==!1&&(this.multipleSelectionController=this.list.options.multipleSelectionController||n8),this.mouseSupport=typeof e.options.mouseSupport>"u"||!!e.options.mouseSupport,this.mouseSupport&&(e.onMouseDown(this.onMouseDown,this,this.disposables),e.onContextMenu(this.onContextMenu,this,this.disposables),e.onMouseDblClick(this.onDoubleClick,this,this.disposables),e.onTouchStart(this.onMouseDown,this,this.disposables),this.disposables.add(Mt.addTarget(e.getHTMLElement()))),ue.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionController=void 0,e.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||n8))}isSelectionSingleChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionSingleChangeEvent(e):!1}isSelectionRangeChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionRangeChangeEvent(e):!1}isSelectionChangeEvent(e){return this.isSelectionSingleChangeEvent(e)||this.isSelectionRangeChangeEvent(e)}onMouseDown(e){ep(e.browserEvent.target)||document.activeElement!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(Md(e.browserEvent.target)||ep(e.browserEvent.target))return;const t=typeof e.index>"u"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||Md(e.browserEvent.target)||ep(e.browserEvent.target)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=e.index;if(typeof t>"u"){this.list.setFocus([],e.browserEvent),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0);return}if(this.isSelectionChangeEvent(e))return this.changeSelection(e);this.list.setFocus([t],e.browserEvent),this.list.setAnchor(t),ike(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(Md(e.browserEvent.target)||ep(e.browserEvent.target)||this.isSelectionChangeEvent(e)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=this.list.getFocus();this.list.setSelection(t,e.browserEvent)}changeSelection(e){const t=e.index;let i=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){if(typeof i>"u"){const d=this.list.getFocus()[0];i=d??t,this.list.setAnchor(i)}const s=Math.min(i,t),o=Math.max(i,t),r=is(s,o+1),a=this.list.getSelection(),l=oke(vN(a,[i]),i);if(l.length===0)return;const c=vN(r,rke(a,l));this.list.setSelection(c,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const s=this.list.getSelection(),o=s.filter(r=>r!==t);this.list.setFocus([t]),this.list.setAnchor(t),s.length===o.length?this.list.setSelection([...o,t],e.browserEvent):this.list.setSelection(o,e.browserEvent)}}dispose(){this.disposables.dispose()}}class MG{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){var t,i;const s=this.selectorSuffix&&`.${this.selectorSuffix}`,o=[];e.listBackground&&o.push(`.monaco-list${s} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(o.push(`.monaco-list${s}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),o.push(`.monaco-list${s}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&o.push(`.monaco-list${s}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(o.push(`.monaco-list${s}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),o.push(`.monaco-list${s}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&o.push(`.monaco-list${s}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&o.push(`.monaco-list${s}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&o.push(` +|${" --- |".repeat(i)}`;return Na.lexer(a)}}class lke{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach(s=>s.splice(e,t,i))}}class Sg extends Error{constructor(e,t){super(`ListError [${e}] ${t}`)}}function Z6(n,e){const t=[];for(const i of e){if(n.start>=i.range.end)continue;if(n.ende.concat(t),[]))}class X6{get paddingTop(){return this._paddingTop}set paddingTop(e){this._size=this._size+e-this._paddingTop,this._paddingTop=e}constructor(e){this.groups=[],this._size=0,this._paddingTop=0,this._paddingTop=e??0,this._size=this._paddingTop}splice(e,t,i=[]){const s=i.length-t,o=Z6({start:0,end:e},this.groups),r=Z6({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map(l=>({range:mN(l.range,s),size:l.size})),a=i.map((l,c)=>({range:{start:e+c,end:e+c+1},size:l.size}));this.groups=dke(o,a,r),this._size=this._paddingTop+this.groups.reduce((l,c)=>l+c.size*(c.range.end-c.range.start),0)}get count(){const e=this.groups.length;return e?this.groups[e-1].range.end:0}get size(){return this._size}indexAt(e){if(e<0)return-1;if(e{for(const i of e)this.getRenderer(t).disposeTemplate(i.templateData),i.templateData=null}),this.cache.clear(),this.transactionNodesPendingRemoval.clear()}getRenderer(e){const t=this.renderers.get(e);if(!t)throw new Error(`No renderer found for ${e}`);return t}}var kc=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};const Gu={CurrentDragAndDropData:void 0},ma={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements(n){return[n]},getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class ry{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class fke{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class gke{constructor(){this.types=[],this.files=[]}update(e){if(e.types&&this.types.splice(0,this.types.length,...e.types),e.files){this.files.splice(0,this.files.length);for(let t=0;ts,e!=null&&e.getPosInSet?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(t,i)=>i+1,e!=null&&e.getRole?this.getRole=e.getRole.bind(e):this.getRole=t=>"listitem",e!=null&&e.isChecked?this.isChecked=e.isChecked.bind(e):this.isChecked=t=>{}}}class Xo{get contentHeight(){return this.rangeMap.size}get onDidScroll(){return this.scrollableElement.onScroll}get horizontalScrolling(){return this._horizontalScrolling}set horizontalScrolling(e){if(e!==this._horizontalScrolling){if(e&&this.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");if(this._horizontalScrolling=e,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this._horizontalScrolling){for(const t of this.items)this.measureItemWidth(t);this.updateScrollWidth(),this.scrollableElement.setScrollDimensions({width:o2(this.domNode)}),this.rowsContainer.style.width=`${Math.max(this.scrollWidth||0,this.renderWidth)}px`}else this.scrollableElementWidthDelayer.cancel(),this.scrollableElement.setScrollDimensions({width:this.renderWidth,scrollWidth:this.renderWidth}),this.rowsContainer.style.width=""}}constructor(e,t,i,s=ma){var o,r,a,l,c,d,u,h,f,g,p,_,v;if(this.virtualDelegate=t,this.domId=`list_id_${++Xo.InstanceCount}`,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new ku(50),this.splicing=!1,this.dragOverAnimationStopDisposable=Y.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=Y.None,this.onDragLeaveTimeout=Y.None,this.disposables=new pe,this._onDidChangeContentHeight=new B,this._onDidChangeContentWidth=new B,this._horizontalScrolling=!1,s.horizontalScrolling&&s.supportDynamicHeights)throw new Error("Horizontal scrolling and dynamic heights not supported simultaneously");this.items=[],this.itemId=0,this.rangeMap=new X6((o=s.paddingTop)!==null&&o!==void 0?o:0);for(const y of i)this.renderers.set(y.templateId,y);this.cache=this.disposables.add(new hke(this.renderers)),this.lastRenderTop=0,this.lastRenderHeight=0,this.domNode=document.createElement("div"),this.domNode.className="monaco-list",this.domNode.classList.add(this.domId),this.domNode.tabIndex=0,this.domNode.classList.toggle("mouse-support",typeof s.mouseSupport=="boolean"?s.mouseSupport:!0),this._horizontalScrolling=(r=s.horizontalScrolling)!==null&&r!==void 0?r:ma.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=typeof s.paddingBottom>"u"?0:s.paddingBottom,this.accessibilityProvider=new mke(s.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows",((a=s.transformOptimization)!==null&&a!==void 0?a:ma.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(Rt.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new ey({forceIntegerValues:!0,smoothScrollDuration:(l=s.smoothScrolling)!==null&&l!==void 0&&l?125:0,scheduleAtNextAnimationFrame:y=>jo(y)})),this.scrollableElement=this.disposables.add(new y3(this.rowsContainer,{alwaysConsumeMouseWheel:(c=s.alwaysConsumeMouseWheel)!==null&&c!==void 0?c:ma.alwaysConsumeMouseWheel,horizontal:1,vertical:(d=s.verticalScrollMode)!==null&&d!==void 0?d:ma.verticalScrollMode,useShadows:(u=s.useShadows)!==null&&u!==void 0?u:ma.useShadows,mouseWheelScrollSensitivity:s.mouseWheelScrollSensitivity,fastScrollSensitivity:s.fastScrollSensitivity,scrollByPage:s.scrollByPage},this.scrollable)),this.domNode.appendChild(this.scrollableElement.getDomNode()),e.appendChild(this.domNode),this.scrollableElement.onScroll(this.onScroll,this,this.disposables),this.disposables.add(K(this.rowsContainer,Pt.Change,y=>this.onTouchChange(y))),this.disposables.add(K(this.scrollableElement.getDomNode(),"scroll",y=>y.target.scrollTop=0)),this.disposables.add(K(this.domNode,"dragover",y=>this.onDragOver(this.toDragEvent(y)))),this.disposables.add(K(this.domNode,"drop",y=>this.onDrop(this.toDragEvent(y)))),this.disposables.add(K(this.domNode,"dragleave",y=>this.onDragLeave(this.toDragEvent(y)))),this.disposables.add(K(this.domNode,"dragend",y=>this.onDragEnd(y))),this.setRowLineHeight=(h=s.setRowLineHeight)!==null&&h!==void 0?h:ma.setRowLineHeight,this.setRowHeight=(f=s.setRowHeight)!==null&&f!==void 0?f:ma.setRowHeight,this.supportDynamicHeights=(g=s.supportDynamicHeights)!==null&&g!==void 0?g:ma.supportDynamicHeights,this.dnd=(p=s.dnd)!==null&&p!==void 0?p:this.disposables.add(ma.dnd),this.layout((_=s.initialSize)===null||_===void 0?void 0:_.height,(v=s.initialSize)===null||v===void 0?void 0:v.width)}updateOptions(e){e.paddingBottom!==void 0&&(this.paddingBottom=e.paddingBottom,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),e.smoothScrolling!==void 0&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),e.horizontalScrolling!==void 0&&(this.horizontalScrolling=e.horizontalScrolling);let t;if(e.scrollByPage!==void 0&&(t=Object.assign(Object.assign({},t??{}),{scrollByPage:e.scrollByPage})),e.mouseWheelScrollSensitivity!==void 0&&(t=Object.assign(Object.assign({},t??{}),{mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity})),e.fastScrollSensitivity!==void 0&&(t=Object.assign(Object.assign({},t??{}),{fastScrollSensitivity:e.fastScrollSensitivity})),t&&this.scrollableElement.updateOptions(t),e.paddingTop!==void 0&&e.paddingTop!==this.rangeMap.paddingTop){const i=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),s=e.paddingTop-this.rangeMap.paddingTop;this.rangeMap.paddingTop=e.paddingTop,this.render(i,Math.max(0,this.lastRenderTop+s),this.lastRenderHeight,void 0,void 0,!0),this.setScrollTop(this.lastRenderTop),this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.lastRenderTop,this.lastRenderHeight)}}splice(e,t,i=[]){if(this.splicing)throw new Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(e,t,i)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,t,i=[]){const s=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),o={start:e,end:e+t},r=Ln.intersect(s,o),a=new Map;for(let L=r.end-1;L>=r.start;L--){const x=this.items[L];if(x.dragStartDisposable.dispose(),x.checkedDisposable.dispose(),x.row){let D=a.get(x.templateId);D||(D=[],a.set(x.templateId,D));const k=this.renderers.get(x.templateId);k&&k.disposeElement&&k.disposeElement(x.element,L,x.row.templateData,x.size),D.push(x.row)}x.row=null}const l={start:e+t,end:this.items.length},c=Ln.intersect(l,s),d=Ln.relativeComplement(l,s),u=i.map(L=>({id:String(this.itemId++),element:L,templateId:this.virtualDelegate.getTemplateId(L),size:this.virtualDelegate.getHeight(L),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(L),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:Y.None,checkedDisposable:Y.None}));let h;e===0&&t>=this.items.length?(this.rangeMap=new X6(this.rangeMap.paddingTop),this.rangeMap.splice(0,0,u),h=this.items,this.items=u):(this.rangeMap.splice(e,t,u),h=this.items.splice(e,t,...u));const f=i.length-t,g=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),p=mN(c,f),_=Ln.intersect(g,p);for(let L=_.start;L<_.end;L++)this.updateItemInDOM(this.items[L],L);const v=Ln.relativeComplement(p,g);for(const L of v)for(let x=L.start;xmN(L,f)),w=[{start:e,end:e+i.length},...b].map(L=>Ln.intersect(g,L)),S=this.getNextToLastElement(w);for(const L of w)for(let x=L.start;xL.element)}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=jo(()=>{this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight}),this.updateScrollWidth(),this.scrollableElementUpdateDisposable=null}))}eventuallyUpdateScrollWidth(){if(!this.horizontalScrolling){this.scrollableElementWidthDelayer.cancel();return}this.scrollableElementWidthDelayer.trigger(()=>this.updateScrollWidth())}updateScrollWidth(){if(!this.horizontalScrolling)return;let e=0;for(const t of this.items)typeof t.width<"u"&&(e=Math.max(e,t.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:e===0?0:e+10}),this._onDidChangeContentWidth.fire(this.scrollWidth)}rerender(){if(this.supportDynamicHeights){for(const e of this.items)e.lastDynamicHeightWidth=void 0;this._rerender(this.lastRenderTop,this.lastRenderHeight)}}get length(){return this.items.length}get renderHeight(){return this.scrollableElement.getScrollDimensions().height}get firstVisibleIndex(){const e=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),t=this.rangeMap.positionAt(e.start),i=this.rangeMap.positionAt(e.start+1);return i!==-1&&(i-t)/2+t{for(const u of c)for(let h=u.start;hs.row.domNode.setAttribute("aria-checked",String(!!u));d(a.value),s.checkedDisposable=a.onDidChange(d)}(o||!s.row.domNode.parentElement)&&(t?this.rowsContainer.insertBefore(s.row.domNode,t):this.rowsContainer.appendChild(s.row.domNode)),this.updateItemInDOM(s,e);const l=this.renderers.get(s.templateId);if(!l)throw new Error(`No renderer found for template id ${s.templateId}`);l==null||l.renderElement(s.element,e,s.row.templateData,s.size);const c=this.dnd.getDragURI(s.element);s.dragStartDisposable.dispose(),s.row.domNode.draggable=!!c,c&&(s.dragStartDisposable=K(s.row.domNode,"dragstart",d=>this.onDragStart(s.element,c,d))),this.horizontalScrolling&&(this.measureItemWidth(s),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width="fit-content",e.width=o2(e.row.domNode);const t=window.getComputedStyle(e.row.domNode);t.paddingLeft&&(e.width+=parseFloat(t.paddingLeft)),t.paddingRight&&(e.width+=parseFloat(t.paddingRight)),e.row.domNode.style.width=""}updateItemInDOM(e,t){e.row.domNode.style.top=`${this.elementTop(t)}px`,this.setRowHeight&&(e.row.domNode.style.height=`${e.size}px`),this.setRowLineHeight&&(e.row.domNode.style.lineHeight=`${e.size}px`),e.row.domNode.setAttribute("data-index",`${t}`),e.row.domNode.setAttribute("data-last-element",t===this.length-1?"true":"false"),e.row.domNode.setAttribute("data-parity",t%2===0?"even":"odd"),e.row.domNode.setAttribute("aria-setsize",String(this.accessibilityProvider.getSetSize(e.element,t,this.length))),e.row.domNode.setAttribute("aria-posinset",String(this.accessibilityProvider.getPosInSet(e.element,t))),e.row.domNode.setAttribute("id",this.getElementDomId(t)),e.row.domNode.classList.toggle("drop-target",e.dropTarget)}removeItemFromDOM(e){const t=this.items[e];if(t.dragStartDisposable.dispose(),t.checkedDisposable.dispose(),t.row){const i=this.renderers.get(t.templateId);i&&i.disposeElement&&i.disposeElement(t.element,e,t.row.templateData,t.size),this.cache.release(t.row),t.row=null}this.horizontalScrolling&&this.eventuallyUpdateScrollWidth()}getScrollTop(){return this.scrollableElement.getScrollPosition().scrollTop}setScrollTop(e,t){this.scrollableElementUpdateDisposable&&(this.scrollableElementUpdateDisposable.dispose(),this.scrollableElementUpdateDisposable=null,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),this.scrollableElement.setScrollPosition({scrollTop:e,reuseAnimation:t})}get scrollTop(){return this.getScrollTop()}set scrollTop(e){this.setScrollTop(e)}get scrollHeight(){return this._scrollHeight+(this.horizontalScrolling?10:0)+this.paddingBottom}get onMouseClick(){return ue.map(this.disposables.add(new ot(this.domNode,"click")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseDblClick(){return ue.map(this.disposables.add(new ot(this.domNode,"dblclick")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseMiddleClick(){return ue.filter(ue.map(this.disposables.add(new ot(this.domNode,"auxclick")).event,e=>this.toMouseEvent(e),this.disposables),e=>e.browserEvent.button===1,this.disposables)}get onMouseDown(){return ue.map(this.disposables.add(new ot(this.domNode,"mousedown")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOver(){return ue.map(this.disposables.add(new ot(this.domNode,"mouseover")).event,e=>this.toMouseEvent(e),this.disposables)}get onMouseOut(){return ue.map(this.disposables.add(new ot(this.domNode,"mouseout")).event,e=>this.toMouseEvent(e),this.disposables)}get onContextMenu(){return ue.any(ue.map(this.disposables.add(new ot(this.domNode,"contextmenu")).event,e=>this.toMouseEvent(e),this.disposables),ue.map(this.disposables.add(new ot(this.domNode,Pt.Contextmenu)).event,e=>this.toGestureEvent(e),this.disposables))}get onTouchStart(){return ue.map(this.disposables.add(new ot(this.domNode,"touchstart")).event,e=>this.toTouchEvent(e),this.disposables)}get onTap(){return ue.map(this.disposables.add(new ot(this.rowsContainer,Pt.Tap)).event,e=>this.toGestureEvent(e),this.disposables)}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=typeof t>"u"?void 0:this.items[t],s=i&&i.element;return{browserEvent:e,index:t,element:s}}onScroll(e){try{const t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight);this.render(t,e.scrollTop,e.height,e.scrollLeft,e.scrollWidth),this.supportDynamicHeights&&this._rerender(e.scrollTop,e.height,e.inSmoothScrolling)}catch(t){throw console.error("Got bad scroll event:",e),t}}onTouchChange(e){e.preventDefault(),e.stopPropagation(),this.scrollTop-=e.translationY}onDragStart(e,t,i){var s,o;if(!i.dataTransfer)return;const r=this.dnd.getDragElements(e);if(i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setData(gG.TEXT,t),i.dataTransfer.setDragImage){let a;this.dnd.getDragLabel&&(a=this.dnd.getDragLabel(r,i)),typeof a>"u"&&(a=String(r.length));const l=ye(".monaco-drag-image");l.textContent=a;const d=(u=>{for(;u&&!u.classList.contains("monaco-workbench");)u=u.parentElement;return u||document.body})(this.domNode);d.appendChild(l),i.dataTransfer.setDragImage(l,-10,-10),setTimeout(()=>d.removeChild(l),0)}this.domNode.classList.add("dragging"),this.currentDragData=new ry(r),Gu.CurrentDragAndDropData=new fke(r),(o=(s=this.dnd).onDragStart)===null||o===void 0||o.call(s,this.currentDragData,i)}onDragOver(e){var t;if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),Gu.CurrentDragAndDropData&&Gu.CurrentDragAndDropData.getData()==="vscode-ui"||(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer))return!1;if(!this.currentDragData)if(Gu.CurrentDragAndDropData)this.currentDragData=Gu.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new gke}const i=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.browserEvent);if(this.canDrop=typeof i=="boolean"?i:i.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;e.browserEvent.dataTransfer.dropEffect=typeof i!="boolean"&&i.effect===0?"copy":"move";let s;if(typeof i!="boolean"&&i.feedback?s=i.feedback:typeof e.index>"u"?s=[-1]:s=[e.index],s=vf(s).filter(o=>o>=-1&&oo-r),s=s[0]===-1?[-1]:s,pke(this.currentDragFeedback,s))return!0;if(this.currentDragFeedback=s,this.currentDragFeedbackDisposable.dispose(),s[0]===-1)this.domNode.classList.add("drop-target"),this.rowsContainer.classList.add("drop-target"),this.currentDragFeedbackDisposable=Ye(()=>{this.domNode.classList.remove("drop-target"),this.rowsContainer.classList.remove("drop-target")});else{for(const o of s){const r=this.items[o];r.dropTarget=!0,(t=r.row)===null||t===void 0||t.domNode.classList.add("drop-target")}this.currentDragFeedbackDisposable=Ye(()=>{var o;for(const r of s){const a=this.items[r];a.dropTarget=!1,(o=a.row)===null||o===void 0||o.domNode.classList.remove("drop-target")}})}return!0}onDragLeave(e){var t,i;this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=kS(()=>this.clearDragOverFeedback(),100,this.disposables),this.currentDragData&&((i=(t=this.dnd).onDragLeave)===null||i===void 0||i.call(t,this.currentDragData,e.element,e.index,e.browserEvent))}onDrop(e){if(!this.canDrop)return;const t=this.currentDragData;this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,Gu.CurrentDragAndDropData=void 0,!(!t||!e.browserEvent.dataTransfer)&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.browserEvent))}onDragEnd(e){var t,i;this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,Gu.CurrentDragAndDropData=void 0,(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=Y.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const t=JU(this.domNode).top;this.dragOverAnimationDisposable=Wme(this.animateDragAndDropScrollTop.bind(this,t))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=kS(()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)},1e3,this.disposables),this.dragOverMouseY=e.pageY}animateDragAndDropScrollTop(e){if(this.dragOverMouseY===void 0)return;const t=this.dragOverMouseY-e,i=this.renderHeight-35;t<35?this.scrollTop+=Math.max(-14,Math.floor(.3*(t-35))):t>i&&(this.scrollTop+=Math.min(14,Math.floor(.3*(t-i))))}teardownDragAndDropScrollTopAnimation(){this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let i=e;for(;i instanceof HTMLElement&&i!==this.rowsContainer&&t.contains(i);){const s=i.getAttribute("data-index");if(s){const o=Number(s);if(!isNaN(o))return o}i=i.parentElement}}getRenderRange(e,t){return{start:this.rangeMap.indexAt(e),end:this.rangeMap.indexAfter(e+t-1)}}_rerender(e,t,i){const s=this.getRenderRange(e,t);let o,r;e===this.elementTop(s.start)?(o=s.start,r=0):s.end-s.start>1&&(o=s.start+1,r=this.elementTop(o)-e);let a=0;for(;;){const l=this.getRenderRange(e,t);let c=!1;for(let d=l.start;d=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Q6=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class _ke{constructor(e){this.trait=e,this.renderedElements=[]}get templateId(){return`template:${this.trait.name}`}renderTemplate(e){return e}renderElement(e,t,i){const s=this.renderedElements.findIndex(o=>o.templateData===i);if(s>=0){const o=this.renderedElements[s];this.trait.unrender(i),o.index=t}else{const o={index:t,templateData:i};this.renderedElements.push(o)}this.trait.renderIndex(t,i)}splice(e,t,i){const s=[];for(const o of this.renderedElements)o.index=e+t&&s.push({index:o.index+i-t,templateData:o.templateData});this.renderedElements=s}renderIndexes(e){for(const{index:t,templateData:i}of this.renderedElements)e.indexOf(t)>-1&&this.trait.renderIndex(t,i)}disposeTemplate(e){const t=this.renderedElements.findIndex(i=>i.templateData===e);t<0||this.renderedElements.splice(t,1)}}let lx=class{get name(){return this._trait}get renderer(){return new _ke(this)}constructor(e){this._trait=e,this.length=0,this.indexes=[],this.sortedIndexes=[],this._onChange=new B,this.onChange=this._onChange.event}splice(e,t,i){var s;t=Math.max(0,Math.min(t,this.length-e));const o=i.length-t,r=e+t,a=[];let l=0;for(;l=r;)a.push(this.sortedIndexes[l++]+o);const c=this.length+o;if(this.sortedIndexes.length>0&&a.length===0&&c>0){const d=(s=this.sortedIndexes.find(u=>u>=e))!==null&&s!==void 0?s:c-1;a.push(Math.min(d,c-1))}this.renderer.splice(e,t,i.length),this._set(a,a),this.length=c}renderIndex(e,t){t.classList.toggle(this._trait,this.contains(e))}unrender(e){e.classList.remove(this._trait)}set(e,t){return this._set(e,[...e].sort(e8),t)}_set(e,t,i){const s=this.indexes,o=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const r=_N(o,e);return this.renderer.renderIndexes(r),this._onChange.fire({indexes:e,browserEvent:i}),s}get(){return this.indexes}contains(e){return K$(this.sortedIndexes,e,e8)>=0}dispose(){Ft(this._onChange)}};eg([Di],lx.prototype,"renderer",null);class bke extends lx{constructor(e){super("selected"),this.setAriaSelected=e}renderIndex(e,t){super.renderIndex(e,t),this.setAriaSelected&&(this.contains(e)?t.setAttribute("aria-selected","true"):t.setAttribute("aria-selected","false"))}}class eE{constructor(e,t,i){this.trait=e,this.view=t,this.identityProvider=i}splice(e,t,i){if(!this.identityProvider)return this.trait.splice(e,t,new Array(i.length).fill(!1));const s=this.trait.get().map(a=>this.identityProvider.getId(this.view.element(a)).toString());if(s.length===0)return this.trait.splice(e,t,new Array(i.length).fill(!1));const o=new Set(s),r=i.map(a=>o.has(this.identityProvider.getId(a).toString()));this.trait.splice(e,t,r)}}function Pd(n){return n.tagName==="INPUT"||n.tagName==="TEXTAREA"}function ip(n){return n.classList.contains("monaco-editor")?!0:n.classList.contains("monaco-list")||!n.parentElement?!1:ip(n.parentElement)}function EG(n){return n.tagName==="A"&&n.classList.contains("monaco-button")||n.tagName==="DIV"&&n.classList.contains("monaco-button-dropdown")?!0:n.classList.contains("monaco-list")||!n.parentElement?!1:EG(n.parentElement)}class AG{get onKeyDown(){return ue.chain(this.disposables.add(new ot(this.view.domNode,"keydown")).event,e=>e.filter(t=>!Pd(t.target)).map(t=>new zt(t)))}constructor(e,t,i){this.list=e,this.view=t,this.disposables=new pe,this.multipleSelectionDisposables=new pe,this.multipleSelectionSupport=i.multipleSelectionSupport,this.disposables.add(this.onKeyDown(s=>{switch(s.keyCode){case 3:return this.onEnter(s);case 16:return this.onUpArrow(s);case 18:return this.onDownArrow(s);case 11:return this.onPageUpArrow(s);case 12:return this.onPageDownArrow(s);case 9:return this.onEscape(s);case 31:this.multipleSelectionSupport&&(pt?s.metaKey:s.ctrlKey)&&this.onCtrlA(s)}}))}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionSupport=e.multipleSelectionSupport)}onEnter(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(this.list.getFocus(),e.browserEvent)}onUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPrevious(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNext(1,!1,e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageUpArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusPreviousPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onPageDownArrow(e){e.preventDefault(),e.stopPropagation(),this.list.focusNextPage(e.browserEvent);const t=this.list.getFocus()[0];this.list.setAnchor(t),this.list.reveal(t),this.view.domNode.focus()}onCtrlA(e){e.preventDefault(),e.stopPropagation(),this.list.setSelection(es(this.list.length),e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus()}onEscape(e){this.list.getSelection().length&&(e.preventDefault(),e.stopPropagation(),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0),this.view.domNode.focus())}dispose(){this.disposables.dispose(),this.multipleSelectionDisposables.dispose()}}eg([Di],AG.prototype,"onKeyDown",null);var Ra;(function(n){n[n.Automatic=0]="Automatic",n[n.Trigger=1]="Trigger"})(Ra||(Ra={}));var np;(function(n){n[n.Idle=0]="Idle",n[n.Typing=1]="Typing"})(np||(np={}));const vke=new class{mightProducePrintableCharacter(n){return n.ctrlKey||n.metaKey||n.altKey?!1:n.keyCode>=31&&n.keyCode<=56||n.keyCode>=21&&n.keyCode<=30||n.keyCode>=98&&n.keyCode<=107||n.keyCode>=85&&n.keyCode<=95}};class yke{constructor(e,t,i,s,o){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.keyboardNavigationEventFilter=s,this.delegate=o,this.enabled=!1,this.state=np.Idle,this.mode=Ra.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new pe,this.disposables=new pe,this.updateOptions(e.options)}updateOptions(e){var t,i;!((t=e.typeNavigationEnabled)!==null&&t!==void 0)||t?this.enable():this.disable(),this.mode=(i=e.typeNavigationMode)!==null&&i!==void 0?i:Ra.Automatic}enable(){if(this.enabled)return;let e=!1;const t=ue.chain(this.enabledDisposables.add(new ot(this.view.domNode,"keydown")).event,o=>o.filter(r=>!Pd(r.target)).filter(()=>this.mode===Ra.Automatic||this.triggered).map(r=>new zt(r)).filter(r=>e||this.keyboardNavigationEventFilter(r)).filter(r=>this.delegate.mightProducePrintableCharacter(r)).forEach(r=>$e.stop(r,!0)).map(r=>r.browserEvent.key)),i=ue.debounce(t,()=>null,800,void 0,void 0,void 0,this.enabledDisposables);ue.reduce(ue.any(t,i),(o,r)=>r===null?null:(o||"")+r,void 0,this.enabledDisposables)(this.onInput,this,this.enabledDisposables),i(this.onClear,this,this.enabledDisposables),t(()=>e=!0,void 0,this.enabledDisposables),i(()=>e=!1,void 0,this.enabledDisposables),this.enabled=!0,this.triggered=!1}disable(){this.enabled&&(this.enabledDisposables.clear(),this.enabled=!1,this.triggered=!1)}onClear(){var e;const t=this.list.getFocus();if(t.length>0&&t[0]===this.previouslyFocused){const i=(e=this.list.options.accessibilityProvider)===null||e===void 0?void 0:e.getAriaLabel(this.list.element(t[0]));i&&Q1(i)}this.previouslyFocused=-1}onInput(e){if(!e){this.state=np.Idle,this.triggered=!1;return}const t=this.list.getFocus(),i=t.length>0?t[0]:0,s=this.state===np.Idle?1:0;this.state=np.Typing;for(let o=0;o1&&c.length===1){this.previouslyFocused=i,this.list.setFocus([r]),this.list.reveal(r);return}}}else if(typeof l>"u"||ax(e,l)){this.previouslyFocused=i,this.list.setFocus([r]),this.list.reveal(r);return}}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class wke{constructor(e,t){this.list=e,this.view=t,this.disposables=new pe;const i=ue.chain(this.disposables.add(new ot(t.domNode,"keydown")).event,o=>o.filter(r=>!Pd(r.target)).map(r=>new zt(r)));ue.chain(i,o=>o.filter(r=>r.keyCode===2&&!r.ctrlKey&&!r.metaKey&&!r.shiftKey&&!r.altKey))(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;const t=this.list.getFocus();if(t.length===0)return;const i=this.view.domElement(t[0]);if(!i)return;const s=i.querySelector("[tabIndex]");if(!s||!(s instanceof HTMLElement)||s.tabIndex===-1)return;const o=window.getComputedStyle(s);o.visibility==="hidden"||o.display==="none"||(e.preventDefault(),e.stopPropagation(),s.focus())}dispose(){this.disposables.dispose()}}function IG(n){return pt?n.browserEvent.metaKey:n.browserEvent.ctrlKey}function TG(n){return n.browserEvent.shiftKey}function Cke(n){return n instanceof MouseEvent&&n.button===2}const J6={isSelectionSingleChangeEvent:IG,isSelectionRangeChangeEvent:TG};class NG{constructor(e){this.list=e,this.disposables=new pe,this._onPointer=new B,this.onPointer=this._onPointer.event,e.options.multipleSelectionSupport!==!1&&(this.multipleSelectionController=this.list.options.multipleSelectionController||J6),this.mouseSupport=typeof e.options.mouseSupport>"u"||!!e.options.mouseSupport,this.mouseSupport&&(e.onMouseDown(this.onMouseDown,this,this.disposables),e.onContextMenu(this.onContextMenu,this,this.disposables),e.onMouseDblClick(this.onDoubleClick,this,this.disposables),e.onTouchStart(this.onMouseDown,this,this.disposables),this.disposables.add(Rt.addTarget(e.getHTMLElement()))),ue.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}updateOptions(e){e.multipleSelectionSupport!==void 0&&(this.multipleSelectionController=void 0,e.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||J6))}isSelectionSingleChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionSingleChangeEvent(e):!1}isSelectionRangeChangeEvent(e){return this.multipleSelectionController?this.multipleSelectionController.isSelectionRangeChangeEvent(e):!1}isSelectionChangeEvent(e){return this.isSelectionSingleChangeEvent(e)||this.isSelectionRangeChangeEvent(e)}onMouseDown(e){ip(e.browserEvent.target)||document.activeElement!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(Pd(e.browserEvent.target)||ip(e.browserEvent.target))return;const t=typeof e.index>"u"?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport||Pd(e.browserEvent.target)||ip(e.browserEvent.target)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=e.index;if(typeof t>"u"){this.list.setFocus([],e.browserEvent),this.list.setSelection([],e.browserEvent),this.list.setAnchor(void 0);return}if(this.isSelectionChangeEvent(e))return this.changeSelection(e);this.list.setFocus([t],e.browserEvent),this.list.setAnchor(t),Cke(e.browserEvent)||this.list.setSelection([t],e.browserEvent),this._onPointer.fire(e)}onDoubleClick(e){if(Pd(e.browserEvent.target)||ip(e.browserEvent.target)||this.isSelectionChangeEvent(e)||e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=this.list.getFocus();this.list.setSelection(t,e.browserEvent)}changeSelection(e){const t=e.index;let i=this.list.getAnchor();if(this.isSelectionRangeChangeEvent(e)){if(typeof i>"u"){const d=this.list.getFocus()[0];i=d??t,this.list.setAnchor(i)}const s=Math.min(i,t),o=Math.max(i,t),r=es(s,o+1),a=this.list.getSelection(),l=Lke(_N(a,[i]),i);if(l.length===0)return;const c=_N(r,Dke(a,l));this.list.setSelection(c,e.browserEvent),this.list.setFocus([t],e.browserEvent)}else if(this.isSelectionSingleChangeEvent(e)){const s=this.list.getSelection(),o=s.filter(r=>r!==t);this.list.setFocus([t]),this.list.setAnchor(t),s.length===o.length?this.list.setSelection([...o,t],e.browserEvent):this.list.setSelection(o,e.browserEvent)}}dispose(){this.disposables.dispose()}}class RG{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){var t,i;const s=this.selectorSuffix&&`.${this.selectorSuffix}`,o=[];e.listBackground&&o.push(`.monaco-list${s} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(o.push(`.monaco-list${s}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),o.push(`.monaco-list${s}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&o.push(`.monaco-list${s}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(o.push(`.monaco-list${s}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),o.push(`.monaco-list${s}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&o.push(`.monaco-list${s}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&o.push(`.monaco-list${s}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&o.push(` .monaco-drag-image, .monaco-list${s}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; } `),e.listFocusAndSelectionForeground&&o.push(` .monaco-drag-image, .monaco-list${s}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; } - `),e.listInactiveFocusForeground&&(o.push(`.monaco-list${s} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),o.push(`.monaco-list${s} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&o.push(`.monaco-list${s} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(o.push(`.monaco-list${s} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),o.push(`.monaco-list${s} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(o.push(`.monaco-list${s} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),o.push(`.monaco-list${s} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&o.push(`.monaco-list${s} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&o.push(`.monaco-list${s}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&o.push(`.monaco-list${s}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`);const r=Yh(e.listFocusAndSelectionOutline,Yh(e.listSelectionOutline,(t=e.listFocusOutline)!==null&&t!==void 0?t:""));r&&o.push(`.monaco-list${s}:focus .monaco-list-row.focused.selected { outline: 1px solid ${r}; outline-offset: -1px;}`),e.listFocusOutline&&o.push(` + `),e.listInactiveFocusForeground&&(o.push(`.monaco-list${s} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),o.push(`.monaco-list${s} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&o.push(`.monaco-list${s} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(o.push(`.monaco-list${s} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),o.push(`.monaco-list${s} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(o.push(`.monaco-list${s} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),o.push(`.monaco-list${s} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&o.push(`.monaco-list${s} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&o.push(`.monaco-list${s}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&o.push(`.monaco-list${s}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`);const r=Qh(e.listFocusAndSelectionOutline,Qh(e.listSelectionOutline,(t=e.listFocusOutline)!==null&&t!==void 0?t:""));r&&o.push(`.monaco-list${s}:focus .monaco-list-row.focused.selected { outline: 1px solid ${r}; outline-offset: -1px;}`),e.listFocusOutline&&o.push(` .monaco-drag-image, .monaco-list${s}:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; } .monaco-workbench.context-menu-visible .monaco-list${s}.last-focused .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; } - `);const a=Yh(e.listSelectionOutline,(i=e.listInactiveFocusOutline)!==null&&i!==void 0?i:"");a&&o.push(`.monaco-list${s} .monaco-list-row.focused.selected { outline: 1px dotted ${a}; outline-offset: -1px; }`),e.listSelectionOutline&&o.push(`.monaco-list${s} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listInactiveFocusOutline&&o.push(`.monaco-list${s} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&o.push(`.monaco-list${s} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropBackground&&o.push(` + `);const a=Qh(e.listSelectionOutline,(i=e.listInactiveFocusOutline)!==null&&i!==void 0?i:"");a&&o.push(`.monaco-list${s} .monaco-list-row.focused.selected { outline: 1px dotted ${a}; outline-offset: -1px; }`),e.listSelectionOutline&&o.push(`.monaco-list${s} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listInactiveFocusOutline&&o.push(`.monaco-list${s} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&o.push(`.monaco-list${s} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropBackground&&o.push(` .monaco-list${s}.drop-target, .monaco-list${s} .monaco-list-rows.drop-target, .monaco-list${s} .monaco-list-row.drop-target { background-color: ${e.listDropBackground} !important; color: inherit !important; } @@ -3099,17 +2900,17 @@ Please report this to https://github.com/markedjs/marked.`,q.silent)return"

An background-color: ${e.tableOddRowsBackgroundColor}; } `),this.styleElement.textContent=o.join(` -`)}}const nke={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackground:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropBackground:"#383B3D",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:H.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:H.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:H.fromHex("#cccccc").transparent(.04).toString(),listBackground:void 0,listFocusForeground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusForeground:void 0,listInactiveFocusBackground:void 0,listHoverForeground:void 0,listFocusOutline:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listHoverOutline:void 0},ske={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function oke(n,e){const t=n.indexOf(e);if(t===-1)return[];const i=[];let s=t-1;for(;s>=0&&n[s]===e-(t-s);)i.push(n[s--]);for(i.reverse(),s=t;s=n.length)t.push(e[s++]);else if(s>=e.length)t.push(n[i++]);else if(n[i]===e[s]){t.push(n[i]),i++,s++;continue}else n[i]=n.length)t.push(e[s++]);else if(s>=e.length)t.push(n[i++]);else if(n[i]===e[s]){i++,s++;continue}else n[i]n-e;class ake{constructor(e,t){this._templateId=e,this.renderers=t}get templateId(){return this._templateId}renderTemplate(e){return this.renderers.map(t=>t.renderTemplate(e))}renderElement(e,t,i,s){let o=0;for(const r of this.renderers)r.renderElement(e,t,i[o++],s)}disposeElement(e,t,i,s){var o;let r=0;for(const a of this.renderers)(o=a.disposeElement)===null||o===void 0||o.call(a,e,t,i[r],s),r+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class lke{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return e}renderElement(e,t,i){const s=this.accessibilityProvider.getAriaLabel(e);s?i.setAttribute("aria-label",s):i.removeAttribute("aria-label");const o=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof o=="number"?i.setAttribute("aria-level",`${o}`):i.removeAttribute("aria-level")}disposeTemplate(e){}}class cke{constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){const t=this.list.getSelectedElements();return t.indexOf(e)>-1?t:[e]}getDragURI(e){return this.dnd.getDragURI(e)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e,t)}onDragStart(e,t){var i,s;(s=(i=this.dnd).onDragStart)===null||s===void 0||s.call(i,e,t)}onDragOver(e,t,i,s){return this.dnd.onDragOver(e,t,i,s)}onDragLeave(e,t,i,s){var o,r;(r=(o=this.dnd).onDragLeave)===null||r===void 0||r.call(o,e,t,i,s)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}drop(e,t,i,s){this.dnd.drop(e,t,i,s)}dispose(){this.dnd.dispose()}}class ga{get onDidChangeFocus(){return ue.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return ue.map(this.eventBufferer.wrapEvent(this.selection.onChange),e=>this.toListEvent(e),this.disposables)}get domId(){return this.view.domId}get onDidScroll(){return this.view.onDidScroll}get onMouseClick(){return this.view.onMouseClick}get onMouseDblClick(){return this.view.onMouseDblClick}get onMouseMiddleClick(){return this.view.onMouseMiddleClick}get onPointer(){return this.mouseController.onPointer}get onMouseDown(){return this.view.onMouseDown}get onMouseOver(){return this.view.onMouseOver}get onMouseOut(){return this.view.onMouseOut}get onTouchStart(){return this.view.onTouchStart}get onTap(){return this.view.onTap}get onContextMenu(){let e=!1;const t=ue.chain(this.disposables.add(new rt(this.view.domNode,"keydown")).event,o=>o.map(r=>new Ht(r)).filter(r=>e=r.keyCode===58||r.shiftKey&&r.keyCode===68).map(r=>Ue.stop(r,!0)).filter(()=>!1)),i=ue.chain(this.disposables.add(new rt(this.view.domNode,"keyup")).event,o=>o.forEach(()=>e=!1).map(r=>new Ht(r)).filter(r=>r.keyCode===58||r.shiftKey&&r.keyCode===68).map(r=>Ue.stop(r,!0)).map(({browserEvent:r})=>{const a=this.getFocus(),l=a.length?a[0]:void 0,c=typeof l<"u"?this.view.element(l):void 0,d=typeof l<"u"?this.view.domElement(l):this.view.domNode;return{index:l,element:c,anchor:d,browserEvent:r}})),s=ue.chain(this.view.onContextMenu,o=>o.filter(r=>!e).map(({element:r,index:a,browserEvent:l})=>({element:r,index:a,anchor:new ur(l),browserEvent:l})));return ue.any(t,i,s)}get onKeyDown(){return this.disposables.add(new rt(this.view.domNode,"keydown")).event}get onDidFocus(){return ue.signal(this.disposables.add(new rt(this.view.domNode,"focus",!0)).event)}constructor(e,t,i,s,o=ske){var r,a,l,c;this.user=e,this._options=o,this.focus=new px("focused"),this.anchor=new px("anchor"),this.eventBufferer=new R4,this._ariaLabel="",this.disposables=new pe,this._onDidDispose=new B,this.onDidDispose=this._onDidDispose.event;const d=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?(r=this._options.accessibilityProvider)===null||r===void 0?void 0:r.getWidgetRole():"list";this.selection=new QDe(d!=="listbox");const u=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=o.accessibilityProvider,this.accessibilityProvider&&(u.push(new lke(this.accessibilityProvider)),(l=(a=this.accessibilityProvider).onDidChangeActiveDescendant)===null||l===void 0||l.call(a,this.onDidChangeActiveDescendant,this,this.disposables)),s=s.map(f=>new ake(f.templateId,[...u,f]));const h=Object.assign(Object.assign({},o),{dnd:o.dnd&&new cke(this,o.dnd)});if(this.view=this.createListView(t,i,s,h),this.view.domNode.setAttribute("role",d),o.styleController)this.styleController=o.styleController(this.view.domId);else{const f=kr(this.view.domNode);this.styleController=new MG(f,this.view.domId)}if(this.spliceable=new HDe([new oE(this.focus,this.view,o.identityProvider),new oE(this.selection,this.view,o.identityProvider),new oE(this.anchor,this.view,o.identityProvider),this.view]),this.disposables.add(this.focus),this.disposables.add(this.selection),this.disposables.add(this.anchor),this.disposables.add(this.view),this.disposables.add(this._onDidDispose),this.disposables.add(new tke(this,this.view)),(typeof o.keyboardSupport!="boolean"||o.keyboardSupport)&&(this.keyboardController=new IG(this,this.view,o),this.disposables.add(this.keyboardController)),o.keyboardNavigationLabelProvider){const f=o.keyboardNavigationDelegate||JDe;this.typeNavigationController=new eke(this,this.view,o.keyboardNavigationLabelProvider,(c=o.keyboardNavigationEventFilter)!==null&&c!==void 0?c:()=>!0,f),this.disposables.add(this.typeNavigationController)}this.mouseController=this.createMouseController(o),this.disposables.add(this.mouseController),this.onDidChangeFocus(this._onFocusChange,this,this.disposables),this.onDidChangeSelection(this._onSelectionChange,this,this.disposables),this.accessibilityProvider&&(this.ariaLabel=this.accessibilityProvider.getWidgetAriaLabel()),this._options.multipleSelectionSupport!==!1&&this.view.domNode.setAttribute("aria-multiselectable","true")}createListView(e,t,i,s){return new Qo(e,t,i,s)}createMouseController(e){return new RG(this)}updateOptions(e={}){var t,i;this._options=Object.assign(Object.assign({},this._options),e),(t=this.typeNavigationController)===null||t===void 0||t.updateOptions(this._options),this._options.multipleSelectionController!==void 0&&(this._options.multipleSelectionSupport?this.view.domNode.setAttribute("aria-multiselectable","true"):this.view.domNode.removeAttribute("aria-multiselectable")),this.mouseController.updateOptions(e),(i=this.keyboardController)===null||i===void 0||i.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,i=[]){if(e<0||e>this.view.length)throw new yg(this.user,`Invalid start index: ${e}`);if(t<0)throw new yg(this.user,`Invalid delete count: ${t}`);t===0&&i.length===0||this.eventBufferer.bufferEvents(()=>this.spliceable.splice(e,t,i))}rerender(){this.view.rerender()}element(e){return this.view.element(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get firstVisibleIndex(){return this.view.firstVisibleIndex}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.view.domNode.setAttribute("aria-label",e)}domFocus(){this.view.domNode.focus({preventScroll:!0})}layout(e,t){this.view.layout(e,t)}setSelection(e,t){for(const i of e)if(i<0||i>=this.length)throw new yg(this.user,`Invalid index ${i}`);this.selection.set(e,t)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map(e=>this.view.element(e))}setAnchor(e){if(typeof e>"u"){this.anchor.set([]);return}if(e<0||e>=this.length)throw new yg(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return Q$(this.anchor.get(),void 0)}getAnchorElement(){const e=this.getAnchor();return typeof e>"u"?void 0:this.element(e)}setFocus(e,t){for(const i of e)if(i<0||i>=this.length)throw new yg(this.user,`Invalid index ${i}`);this.focus.set(e,t)}focusNext(e=1,t=!1,i,s){if(this.length===0)return;const o=this.focus.get(),r=this.findNextIndex(o.length>0?o[0]+e:0,t,s);r>-1&&this.setFocus([r],i)}focusPrevious(e=1,t=!1,i,s){if(this.length===0)return;const o=this.focus.get(),r=this.findPreviousIndex(o.length>0?o[0]-e:0,t,s);r>-1&&this.setFocus([r],i)}focusNextPage(e,t){return i8(this,void 0,void 0,function*(){let i=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);i=i===0?0:i-1;const s=this.getFocus()[0];if(s!==i&&(s===void 0||i>s)){const o=this.findPreviousIndex(i,!1,t);o>-1&&s!==o?this.setFocus([o],e):this.setFocus([i],e)}else{const o=this.view.getScrollTop();let r=o+this.view.renderHeight;i>s&&(r-=this.view.elementHeight(i)),this.view.setScrollTop(r),this.view.getScrollTop()!==o&&(this.setFocus([]),yield jb(0),yield this.focusNextPage(e,t))}})}focusPreviousPage(e,t){return i8(this,void 0,void 0,function*(){let i;const s=this.view.getScrollTop();s===0?i=this.view.indexAt(s):i=this.view.indexAfter(s-1);const o=this.getFocus()[0];if(o!==i&&(o===void 0||o>=i)){const r=this.findNextIndex(i,!1,t);r>-1&&o!==r?this.setFocus([r],e):this.setFocus([i],e)}else{const r=s;this.view.setScrollTop(s-this.view.renderHeight),this.view.getScrollTop()!==r&&(this.setFocus([]),yield jb(0),yield this.focusPreviousPage(e,t))}})}focusLast(e,t){if(this.length===0)return;const i=this.findPreviousIndex(this.length-1,!1,t);i>-1&&this.setFocus([i],e)}focusFirst(e,t){this.focusNth(0,e,t)}focusNth(e,t,i){if(this.length===0)return;const s=this.findNextIndex(e,!1,i);s>-1&&this.setFocus([s],t)}findNextIndex(e,t=!1,i){for(let s=0;s=this.length&&!t)return-1;if(e=e%this.length,!i||i(this.element(e)))return e;e++}return-1}findPreviousIndex(e,t=!1,i){for(let s=0;sthis.view.element(e))}reveal(e,t){if(e<0||e>=this.length)throw new yg(this.user,`Invalid index ${e}`);const i=this.view.getScrollTop(),s=this.view.elementTop(e),o=this.view.elementHeight(e);if(Qd(t)){const r=o-this.view.renderHeight;this.view.setScrollTop(r*go(t,0,1)+s)}else{const r=s+o,a=i+this.view.renderHeight;s=a||(s=a&&o>=this.view.renderHeight?this.view.setScrollTop(s):r>=a&&this.view.setScrollTop(r-this.view.renderHeight))}}getHTMLElement(){return this.view.domNode}getElementID(e){return this.view.getElementDomId(e)}style(e){this.styleController.style(e)}toListEvent({indexes:e,browserEvent:t}){return{indexes:e,elements:e.map(i=>this.view.element(i)),browserEvent:t}}_onFocusChange(){const e=this.focus.get();this.view.domNode.classList.toggle("element-focused",e.length>0),this.onDidChangeActiveDescendant()}onDidChangeActiveDescendant(){var e;const t=this.focus.get();if(t.length>0){let i;!((e=this.accessibilityProvider)===null||e===void 0)&&e.getActiveDescendantId&&(i=this.accessibilityProvider.getActiveDescendantId(this.view.element(t[0]))),this.view.domNode.setAttribute("aria-activedescendant",i||this.view.getElementDomId(t[0]))}else this.view.domNode.removeAttribute("aria-activedescendant")}_onSelectionChange(){const e=this.selection.get();this.view.domNode.classList.toggle("selection-none",e.length===0),this.view.domNode.classList.toggle("selection-single",e.length===1),this.view.domNode.classList.toggle("selection-multiple",e.length>1)}dispose(){this._onDidDispose.fire(),this.disposables.dispose(),this._onDidDispose.dispose()}}Xf([ki],ga.prototype,"onDidChangeFocus",null);Xf([ki],ga.prototype,"onDidChangeSelection",null);Xf([ki],ga.prototype,"onContextMenu",null);Xf([ki],ga.prototype,"onKeyDown",null);Xf([ki],ga.prototype,"onDidFocus",null);const Ih=ye,PG="selectOption.entry.template";class dke{get templateId(){return PG}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=le(e,Ih(".option-text")),t.detail=le(e,Ih(".option-detail")),t.decoratorRight=le(e,Ih(".option-decorator-right")),t}renderElement(e,t,i){const s=i,o=e.text,r=e.detail,a=e.decoratorRight,l=e.isDisabled;s.text.textContent=o,s.detail.textContent=r||"",s.decoratorRight.innerText=a||"",l?s.root.classList.add("option-disabled"):s.root.classList.remove("option-disabled")}disposeTemplate(e){}}class Oa extends Y{constructor(e,t,i,s,o){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=s,this.selectBoxOptions=o||Object.create(null),typeof this.selectBoxOptions.minBottomMargin!="number"?this.selectBoxOptions.minBottomMargin=Oa.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN:this.selectBoxOptions.minBottomMargin<0&&(this.selectBoxOptions.minBottomMargin=0),this.selectElement=document.createElement("select"),this.selectElement.className="monaco-select-box monaco-select-box-dropdown-padding",typeof this.selectBoxOptions.ariaLabel=="string"&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),typeof this.selectBoxOptions.ariaDescription=="string"&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._onDidSelect=new B,this._register(this._onDidSelect),this.registerListeners(),this.constructSelectDropDown(i),this.selected=t||0,e&&this.setOptions(e,t),this.initStyleSheet()}getHeight(){return 22}getTemplateId(){return PG}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=ye(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=le(this.selectDropDownContainer,Ih(".select-box-details-pane"));const t=le(this.selectDropDownContainer,Ih(".select-box-dropdown-container-width-control")),i=le(t,Ih(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",le(i,this.widthControlElement),this._dropDownPosition=0,this.styleElement=kr(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(K(this.selectDropDownContainer,de.DRAG_START,s=>{Ue.stop(s,!0)}))}registerListeners(){this._register(ji(this.selectElement,"change",t=>{this.selected=t.target.selectedIndex,this._onDidSelect.fire({index:t.target.selectedIndex,selected:t.target.value}),this.options[this.selected]&&this.options[this.selected].text&&(this.selectElement.title=this.options[this.selected].text)})),this._register(K(this.selectElement,de.CLICK,t=>{Ue.stop(t),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(K(this.selectElement,de.MOUSE_DOWN,t=>{Ue.stop(t)}));let e;this._register(K(this.selectElement,"touchstart",t=>{e=this._isVisible})),this._register(K(this.selectElement,"touchend",t=>{Ue.stop(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(K(this.selectElement,de.KEY_DOWN,t=>{const i=new Ht(t);let s=!1;mt?(i.keyCode===18||i.keyCode===16||i.keyCode===10||i.keyCode===3)&&(s=!0):(i.keyCode===18&&i.altKey||i.keyCode===16&&i.altKey||i.keyCode===10||i.keyCode===3)&&(s=!0),s&&(this.showSelectDropDown(),Ue.stop(t,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){Zi(this.options,e)||(this.options=e,this.selectElement.options.length=0,this._hasDetails=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach((i,s)=>{this.selectElement.add(this.createOption(i.text,s,i.isDisabled)),typeof i.description=="string"&&(this._hasDetails=!0)})),t!==void 0&&(this.select(t),this._currentSelection=this.selected)}setOptionsList(){var e;(e=this.selectList)===null||e===void 0||e.splice(0,this.selectList.length,this.options)}select(e){e>=0&&ethis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.options[this.selected]&&this.options[this.selected].text&&(this.selectElement.title=this.options[this.selected].text)}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){this.container=e,e.classList.add("select-container"),e.appendChild(this.selectElement),this.styleSelectElement()}initStyleSheet(){const e=[];this.styles.listFocusBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { background-color: ${this.styles.listFocusBackground} !important; }`),this.styles.listFocusForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { color: ${this.styles.listFocusForeground} !important; }`),this.styles.decoratorRightForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.focused) .option-decorator-right { color: ${this.styles.decoratorRightForeground}; }`),this.styles.selectBackground&&this.styles.selectBorder&&this.styles.selectBorder!==this.styles.selectBackground?(e.push(`.monaco-select-box-dropdown-container { border: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectBorder} } `)):this.styles.selectListBorder&&(e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectListBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectListBorder} } `)),this.styles.listHoverForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { color: ${this.styles.listHoverForeground} !important; }`),this.styles.listHoverBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { background-color: ${this.styles.listHoverBackground} !important; }`),this.styles.listFocusOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { outline: 1.6px dotted ${this.styles.listFocusOutline} !important; outline-offset: -1.6px !important; }`),this.styles.listHoverOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { outline: 1.6px dashed ${this.styles.listHoverOutline} !important; outline-offset: -1.6px !important; }`),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled.focused { background-color: transparent !important; color: inherit !important; outline: none !important; }"),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled:hover { background-color: transparent !important; color: inherit !important; outline: none !important; }"),this.styleElement.textContent=e.join(` -`)}styleSelectElement(){var e,t,i;const s=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",o=(t=this.styles.selectForeground)!==null&&t!==void 0?t:"",r=(i=this.styles.selectBorder)!==null&&i!==void 0?i:"";this.selectElement.style.backgroundColor=s,this.selectElement.style.color=o,this.selectElement.style.borderColor=r}styleList(){var e,t;const i=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",s=Yh(this.styles.selectListBackground,i);this.selectDropDownListContainer.style.backgroundColor=s,this.selectionDetailsPane.style.backgroundColor=s;const o=(t=this.styles.focusBorder)!==null&&t!==void 0?t:"";this.selectDropDownContainer.style.outlineColor=o,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,t,i){const s=document.createElement("option");return s.value=e,s.text=e,s.disabled=!!i,s}showSelectDropDown(){this.selectionDetailsPane.innerText="",!(!this.contextViewProvider||this._isVisible)&&(this.createSelectList(this.selectDropDownContainer),this.setOptionsList(),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e,!0),layout:()=>{this.layoutSelectDropDown()},onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._isVisible=!0,this.hideSelectDropDown(!1),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e),layout:()=>this.layoutSelectDropDown(),onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._currentSelection=this.selected,this._isVisible=!0,this.selectElement.setAttribute("aria-expanded","true"))}hideSelectDropDown(e){!this.contextViewProvider||!this._isVisible||(this._isVisible=!1,this.selectElement.setAttribute("aria-expanded","false"),e&&this.selectElement.focus(),this.contextViewProvider.hideContextView())}renderSelectDropDown(e,t){return e.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(t),{dispose:()=>{try{e.removeChild(this.selectDropDownContainer)}catch{}}}}measureMaxDetailsHeight(){let e=0;return this.options.forEach((t,i)=>{this.updateDetail(i),this.selectionDetailsPane.offsetHeight>e&&(e=this.selectionDetailsPane.offsetHeight)}),e}layoutSelectDropDown(e){if(this._skipLayout)return!1;if(this.selectList){this.selectDropDownContainer.classList.add("visible");const t=Rn(this.selectElement),i=getComputedStyle(this.selectElement),s=parseFloat(i.getPropertyValue("--dropdown-padding-top"))+parseFloat(i.getPropertyValue("--dropdown-padding-bottom")),o=window.innerHeight-t.top-t.height-(this.selectBoxOptions.minBottomMargin||0),r=t.top-Oa.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,a=this.selectElement.offsetWidth,l=this.setWidthControlElement(this.widthControlElement),c=Math.max(l,Math.round(a)).toString()+"px";this.selectDropDownContainer.style.width=c,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let d=this.selectList.contentHeight;this._hasDetails&&this._cachedMaxDetailsHeight===void 0&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());const u=this._hasDetails?this._cachedMaxDetailsHeight:0,h=d+s+u,f=Math.floor((o-s-u)/this.getHeight()),g=Math.floor((r-s-u)/this.getHeight());if(e)return t.top+t.height>window.innerHeight-22||t.topf&&this.options.length>f?(this._dropDownPosition=1,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selectionDetailsPane.classList.add("border-bottom")):(this._dropDownPosition=0,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectionDetailsPane.classList.remove("border-bottom"),this.selectionDetailsPane.classList.add("border-top")),!0);if(t.top+t.height>window.innerHeight-22||t.topo&&(d=f*this.getHeight())}else h>r&&(d=g*this.getHeight());return this.selectList.layout(d),this.selectList.domFocus(),this.selectList.length>0&&(this.selectList.setFocus([this.selected||0]),this.selectList.reveal(this.selectList.getFocus()[0]||0)),this._hasDetails?(this.selectList.getHTMLElement().style.height=d+s+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=d+s+"px",this.updateDetail(this.selected),this.selectDropDownContainer.style.width=c,this.selectDropDownListContainer.setAttribute("tabindex","0"),this.selectElement.classList.add("synthetic-focus"),this.selectDropDownContainer.classList.add("synthetic-focus"),!0}else return!1}setWidthControlElement(e){let t=0;if(e){let i=0,s=0;this.options.forEach((o,r)=>{const a=o.detail?o.detail.length:0,l=o.decoratorRight?o.decoratorRight.length:0,c=o.text.length+a+l;c>s&&(i=r,s=c)}),e.textContent=this.options[i].text+(this.options[i].decoratorRight?this.options[i].decoratorRight+" ":""),t=ws(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=le(e,Ih(".select-box-dropdown-list-container")),this.listRenderer=new dke,this.selectList=new ga("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:3,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:s=>{let o=s.text;return s.detail&&(o+=`. ${s.detail}`),s.decoratorRight&&(o+=`. ${s.decoratorRight}`),s.description&&(o+=`. ${s.description}`),o},getWidgetAriaLabel:()=>m({key:"selectBox",comment:["Behave like native select dropdown element."]},"Select Box"),getRole:()=>mt?"":"option",getWidgetRole:()=>"listbox"}}),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new rt(this.selectDropDownListContainer,"keydown")),i=ue.chain(t.event,s=>s.filter(()=>this.selectList.length>0).map(o=>new Ht(o)));this._register(ue.chain(i,s=>s.filter(o=>o.keyCode===3))(this.onEnter,this)),this._register(ue.chain(i,s=>s.filter(o=>o.keyCode===2))(this.onEnter,this)),this._register(ue.chain(i,s=>s.filter(o=>o.keyCode===9))(this.onEscape,this)),this._register(ue.chain(i,s=>s.filter(o=>o.keyCode===16))(this.onUpArrow,this)),this._register(ue.chain(i,s=>s.filter(o=>o.keyCode===18))(this.onDownArrow,this)),this._register(ue.chain(i,s=>s.filter(o=>o.keyCode===12))(this.onPageDown,this)),this._register(ue.chain(i,s=>s.filter(o=>o.keyCode===11))(this.onPageUp,this)),this._register(ue.chain(i,s=>s.filter(o=>o.keyCode===14))(this.onHome,this)),this._register(ue.chain(i,s=>s.filter(o=>o.keyCode===13))(this.onEnd,this)),this._register(ue.chain(i,s=>s.filter(o=>o.keyCode>=21&&o.keyCode<=56||o.keyCode>=85&&o.keyCode<=113))(this.onCharacter,this)),this._register(K(this.selectList.getHTMLElement(),de.POINTER_UP,s=>this.onPointerUp(s))),this._register(this.selectList.onMouseOver(s=>typeof s.index<"u"&&this.selectList.setFocus([s.index]))),this._register(this.selectList.onDidChangeFocus(s=>this.onListFocus(s))),this._register(K(this.selectDropDownContainer,de.FOCUS_OUT,s=>{!this._isVisible||Sn(s.relatedTarget,this.selectDropDownContainer)||this.onListBlur()})),this.selectList.getHTMLElement().setAttribute("aria-label",this.selectBoxOptions.ariaLabel||""),this.selectList.getHTMLElement().setAttribute("aria-expanded","true"),this.styleList()}onPointerUp(e){if(!this.selectList.length)return;Ue.stop(e);const t=e.target;if(!t||t.classList.contains("slider"))return;const i=t.closest(".monaco-list-row");if(!i)return;const s=Number(i.getAttribute("data-index")),o=i.classList.contains("option-disabled");s>=0&&s{for(let r=0;rthis.selected+2)this.selected+=2;else{if(t)return;this.selected++}this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0])}}onUpArrow(e){this.selected>0&&(Ue.stop(e,!0),this.options[this.selected-1].isDisabled&&this.selected>1?this.selected-=2:this.selected--,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]))}onPageUp(e){Ue.stop(e),this.selectList.focusPreviousPage(),setTimeout(()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected>0&&(this.selected--,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)},1)}onHome(e){Ue.stop(e),!(this.options.length<2)&&(this.selected=0,this.options[this.selected].isDisabled&&this.selected>1&&this.selected++,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onEnd(e){Ue.stop(e),!(this.options.length<2)&&(this.selected=this.options.length-1,this.options[this.selected].isDisabled&&this.selected>1&&this.selected--,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onCharacter(e){const t=Vl.toString(e.keyCode);let i=-1;for(let s=0;s{this._register(K(this.selectElement,e,t=>{this.selectElement.focus()}))}),this._register(ji(this.selectElement,"click",e=>{Ue.stop(e,!0)})),this._register(ji(this.selectElement,"change",e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register(ji(this.selectElement,"keydown",e=>{let t=!1;mt?(e.keyCode===18||e.keyCode===16||e.keyCode===10)&&(t=!0):(e.keyCode===18&&e.altKey||e.keyCode===10||e.keyCode===3)&&(t=!0),t&&e.stopPropagation()}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){(!this.options||!Zi(this.options,e))&&(this.options=e,this.selectElement.options.length=0,this.options.forEach((i,s)=>{this.selectElement.add(this.createOption(i.text,s,i.isDisabled))})),t!==void 0&&this.select(t)}select(e){this.options.length===0?this.selected=0:e>=0&&ethis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.selected{this.element&&this.handleActionChangeEvent(s)}))}handleActionChangeEvent(e){e.enabled!==void 0&&this.updateEnabled(),e.checked!==void 0&&this.updateChecked(),e.class!==void 0&&this.updateClass(),e.label!==void 0&&(this.updateLabel(),this.updateTooltip()),e.tooltip!==void 0&&this.updateTooltip()}get actionRunner(){return this._actionRunner||(this._actionRunner=this._register(new _m)),this._actionRunner}set actionRunner(e){this._actionRunner=e}isEnabled(){return this._action.enabled}setActionContext(e){this._context=e}render(e){const t=this.element=e;this._register(Mt.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,Lr&&this._register(K(e,de.DRAG_START,s=>{var o;return(o=s.dataTransfer)===null||o===void 0?void 0:o.setData(pG.TEXT,this._action.label)}))),this._register(K(t,Ot.Tap,s=>this.onClick(s,!0))),this._register(K(t,de.MOUSE_DOWN,s=>{i||Ue.stop(s,!0),this._action.enabled&&s.button===0&&t.classList.add("active")})),mt&&this._register(K(t,de.CONTEXT_MENU,s=>{s.button===0&&s.ctrlKey===!0&&this.onClick(s)})),this._register(K(t,de.CLICK,s=>{Ue.stop(s,!0),this.options&&this.options.isMenu||this.onClick(s)})),this._register(K(t,de.DBLCLICK,s=>{Ue.stop(s,!0)})),[de.MOUSE_UP,de.MOUSE_OUT].forEach(s=>{this._register(K(t,s,o=>{Ue.stop(o),t.classList.remove("active")}))})}onClick(e,t=!1){var i;Ue.stop(e,!0);const s=bo(this._context)?!((i=this.options)===null||i===void 0)&&i.useEventAsContext?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,s)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add("focused"))}blur(){this.element&&(this.element.blur(),this.element.tabIndex=-1,this.element.classList.remove("focused"))}setFocusable(e){this.element&&(this.element.tabIndex=e?0:-1)}get trapsArrowNavigation(){return!1}updateEnabled(){}updateLabel(){}getTooltip(){return this.action.tooltip}updateTooltip(){var e;if(!this.element)return;const t=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.updateAriaLabel(),this.options.hoverDelegate?(this.element.title="",this.customHover?this.customHover.update(t):(this.customHover=kG(this.options.hoverDelegate,this.element,t),this._store.add(this.customHover))):this.element.title=t}updateAriaLabel(){var e;if(this.element){const t=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.element.setAttribute("aria-label",t)}}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),this._context=void 0,super.dispose()}}class ND extends Zr{constructor(e,t,i){super(e,t,i),this.options=i,this.options.icon=i.icon!==void 0?i.icon:!1,this.options.label=i.label!==void 0?i.label:!0,this.cssClass=""}render(e){super.render(e),this.element&&(this.label=le(this.element,ye("a.action-label"))),this.label&&this.label.setAttribute("role",this.getDefaultAriaRole()),this.options.label&&this.options.keybinding&&this.element&&(le(this.element,ye("span.keybinding")).textContent=this.options.keybinding),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===Pn.ID?"presentation":this.options.isMenu?"menuitem":"button"}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}blur(){this.label&&(this.label.tabIndex=-1)}setFocusable(e){this.label&&(this.label.tabIndex=e?0:-1)}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this.action.label)}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:!this.options.label&&this.action.label&&this.options.icon&&(e=this.action.label,this.options.keybinding&&(e=m({key:"titleLabel",comment:["action title","action keybinding"]},"{0} ({1})",e,this.options.keybinding))),e??void 0}updateClass(){var e;this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.action.class,this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):(e=this.label)===null||e===void 0||e.classList.remove("codicon")}updateEnabled(){var e,t;this.action.enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),(e=this.element)===null||e===void 0||e.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),(t=this.element)===null||t===void 0||t.classList.add("disabled"))}updateAriaLabel(){var e;if(this.label){const t=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.label.setAttribute("aria-label",t)}}updateChecked(){this.label&&(this.action.checked!==void 0?(this.label.classList.toggle("checked",this.action.checked),this.label.setAttribute("aria-checked",this.action.checked?"true":"false"),this.label.setAttribute("role","checkbox")):(this.label.classList.remove("checked"),this.label.setAttribute("aria-checked",""),this.label.setAttribute("role",this.getDefaultAriaRole())))}}class fke extends Zr{constructor(e,t,i,s,o,r,a){super(e,t),this.selectBox=new hke(i,s,o,r,a),this.selectBox.setFocusable(!1),this._register(this.selectBox),this.registerListeners()}select(e){this.selectBox.select(e)}registerListeners(){this._register(this.selectBox.onDidSelect(e=>this.runAction(e.selected,e.index)))}runAction(e,t){this.actionRunner.run(this._action,this.getActionContext(e,t))}getActionContext(e,t){return e}setFocusable(e){this.selectBox.setFocusable(e)}focus(){var e;(e=this.selectBox)===null||e===void 0||e.focus()}blur(){var e;(e=this.selectBox)===null||e===void 0||e.blur()}render(e){this.selectBox.render(e)}}class gke extends _m{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new B),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=le(e,ye(".monaco-dropdown")),this._label=le(this._element,ye(".dropdown-label"));let i=t.labelRenderer;i||(i=o=>(o.textContent=t.label||"",null));for(const o of[de.CLICK,de.MOUSE_DOWN,Ot.Tap])this._register(K(this.element,o,r=>Ue.stop(r,!0)));for(const o of[de.MOUSE_DOWN,Ot.Tap])this._register(K(this._label,o,r=>{r instanceof MouseEvent&&(r.detail>1||r.button!==0)||(this.visible?this.hide():this.show())}));this._register(K(this._label,de.KEY_UP,o=>{const r=new Ht(o);(r.equals(3)||r.equals(10))&&(Ue.stop(o,!0),this.visible?this.hide():this.show())}));const s=i(this._label);s&&this._register(s),this._register(Mt.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 pke extends gke{constructor(e,t){super(e,t),this._options=t,this._actions=[],this.actions=t.actions||[]}set menuOptions(e){this._menuOptions=e}get menuOptions(){return this._menuOptions}get actions(){return this._options.actionProvider?this._options.actionProvider.getActions():this._actions}set actions(e){this._actions=e}show(){super.show(),this.element.classList.add("active"),this._options.contextMenuProvider.showContextMenu({getAnchor:()=>this.element,getActions:()=>this.actions,getActionsContext:()=>this.menuOptions?this.menuOptions.context:null,getActionViewItem:(e,t)=>this.menuOptions&&this.menuOptions.actionViewItemProvider?this.menuOptions.actionViewItemProvider(e,t):void 0,getKeyBinding:e=>this.menuOptions&&this.menuOptions.getKeyBinding?this.menuOptions.getKeyBinding(e):void 0,getMenuClassName:()=>this._options.menuClassName||"",onHide:()=>this.onHide(),actionRunner:this.menuOptions?this.menuOptions.actionRunner:void 0,anchorAlignment:this.menuOptions?this.menuOptions.anchorAlignment:0,domForShadowRoot:this._options.menuAsChild?this.element:void 0,skipTelemetry:this._options.skipTelemetry})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}}class mx extends Zr{constructor(e,t,i,s=Object.create(null)){super(null,e,s),this.actionItem=null,this._onDidChangeVisibility=this._register(new B),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.menuActionsOrProvider=t,this.contextMenuProvider=i,this.options=s,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=o=>{this.element=le(o,ye("a.action-label"));let r=[];return typeof this.options.classNames=="string"?r=this.options.classNames.split(/\s+/g).filter(a=>!!a):this.options.classNames&&(r=this.options.classNames),r.find(a=>a==="icon")||r.push("codicon"),this.element.classList.add(...r),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),s={contextMenuProvider:this.contextMenuProvider,labelRenderer:t,menuAsChild:this.options.menuAsChild,actions:i?this.menuActionsOrProvider:void 0,actionProvider:i?void 0:this.menuActionsOrProvider,skipTelemetry:this.options.skipTelemetry};if(this.dropdownMenu=this._register(new pke(e,s)),this._register(this.dropdownMenu.onDidChangeVisibility(o=>{var r;(r=this.element)===null||r===void 0||r.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.action.tooltip?e=this.action.tooltip:this.action.label&&(e=this.action.label),e??void 0}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}show(){var e;(e=this.dropdownMenu)===null||e===void 0||e.show()}updateEnabled(){var e,t;const i=!this.action.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)}}function mke(n){return n?n.condition!==void 0:!1}var b_=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},Ep;(function(n){n[n.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",n[n.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"})(Ep||(Ep={}));var ip;(function(n){n[n.None=0]="None",n[n.Initialized=1]="Initialized",n[n.Closed=2]="Closed"})(ip||(ip={}));class Ap extends Y{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new Ob),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=ip.None,this.cache=new Map,this.flushDelayer=this._register(new hj(Ap.DEFAULT_FLUSH_DELAY)),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal(e=>this.onDidChangeItemsExternal(e)))}onDidChangeItemsExternal(e){var t,i;this._onDidChangeStorage.pause();try{(t=e.changed)===null||t===void 0||t.forEach((s,o)=>this.acceptExternal(o,s)),(i=e.deleted)===null||i===void 0||i.forEach(s=>this.acceptExternal(s,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===ip.Closed)return;let i=!1;bo(t)?i=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),i=!0),i&&this._onDidChangeStorage.fire({key:e,external:!0})}get(e,t){const i=this.cache.get(e);return bo(i)?t:i}getBoolean(e,t){const i=this.get(e);return bo(i)?t:i==="true"}getNumber(e,t){const i=this.get(e);return bo(i)?t:parseInt(i,10)}set(e,t,i=!1){return b_(this,void 0,void 0,function*(){if(this.state===ip.Closed)return;if(bo(t))return this.delete(e,i);const s=Ds(t)||Array.isArray(t)?SDe(t):String(t);if(this.cache.get(e)!==s)return this.cache.set(e,s),this.pendingInserts.set(e,s),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:i}),this.doFlush()})}delete(e,t=!1){return b_(this,void 0,void 0,function*(){if(!(this.state===ip.Closed||!this.cache.delete(e)))return this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire({key:e,external:t}),this.doFlush()})}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}flushPending(){return b_(this,void 0,void 0,function*(){if(!this.hasPending)return;const e={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(e).finally(()=>{var t;if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)(t=this.whenFlushedCallbacks.pop())===null||t===void 0||t()})})}doFlush(e){return b_(this,void 0,void 0,function*(){return this.options.hint===Ep.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)})}}Ap.DEFAULT_FLUSH_DELAY=100;class rE{constructor(){this.onDidChangeItemsExternal=ue.None,this.items=new Map}updateItems(e){var t,i;return b_(this,void 0,void 0,function*(){(t=e.insert)===null||t===void 0||t.forEach((s,o)=>this.items.set(o,s)),(i=e.delete)===null||i===void 0||i.forEach(s=>this.items.delete(s))})}}const AC="__$__targetStorageMarker",Qf=at("storageService");var o8;(function(n){n[n.NONE=0]="NONE",n[n.SHUTDOWN=1]="SHUTDOWN"})(o8||(o8={}));function _ke(n){const e=n.get(AC);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}class RD extends Y{constructor(e={flushInterval:RD.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new Ob),this._onDidChangeTarget=this._register(new Ob),this._onWillSaveState=this._register(new B),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0}onDidChangeValue(e,t,i){return ue.filter(this._onDidChangeValue.event,s=>s.scope===e&&(t===void 0||s.key===t),i)}emitDidChangeValue(e,t){const{key:i,external:s}=t;if(i===AC){switch(e){case-1:this._applicationKeyTargets=void 0;break;case 0:this._profileKeyTargets=void 0;break;case 1:this._workspaceKeyTargets=void 0;break}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:i,target:this.getKeyTargets(e)[i],external:s})}get(e,t,i){var s;return(s=this.getStorage(t))===null||s===void 0?void 0:s.get(e,i)}getBoolean(e,t,i){var s;return(s=this.getStorage(t))===null||s===void 0?void 0:s.getBoolean(e,i)}getNumber(e,t,i){var s;return(s=this.getStorage(t))===null||s===void 0?void 0:s.getNumber(e,i)}store(e,t,i,s,o=!1){if(bo(t)){this.remove(e,i,o);return}this.withPausedEmitters(()=>{var r;this.updateKeyTarget(e,i,s),(r=this.getStorage(i))===null||r===void 0||r.set(e,t,o)})}remove(e,t,i=!1){this.withPausedEmitters(()=>{var s;this.updateKeyTarget(e,t,void 0),(s=this.getStorage(t))===null||s===void 0||s.delete(e,i)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,i,s=!1){var o,r;const a=this.getKeyTargets(t);typeof i=="number"?a[e]!==i&&(a[e]=i,(o=this.getStorage(t))===null||o===void 0||o.set(AC,JSON.stringify(a),s)):typeof a[e]=="number"&&(delete a[e],(r=this.getStorage(t))===null||r===void 0||r.set(AC,JSON.stringify(a),s))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(0)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(-1)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case-1:return this.applicationKeyTargets;case 0:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){const t=this.getStorage(e);return t?_ke(t):Object.create(null)}}RD.DEFAULT_FLUSH_INTERVAL=60*1e3;class bke extends RD{constructor(){super(),this.applicationStorage=this._register(new Ap(new rE,{hint:Ep.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new Ap(new rE,{hint:Ep.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new Ap(new rE,{hint:Ep.STORAGE_IN_MEMORY})),this._register(this.workspaceStorage.onDidChangeStorage(e=>this.emitDidChangeValue(1,e))),this._register(this.profileStorage.onDidChangeStorage(e=>this.emitDidChangeValue(0,e))),this._register(this.applicationStorage.onDidChangeStorage(e=>this.emitDidChangeValue(-1,e)))}getStorage(e){switch(e){case-1:return this.applicationStorage;case 0:return this.profileStorage;default:return this.workspaceStorage}}}function vke(n,e){const t=Object.assign({},e);for(const i in n){const s=n[i];t[i]=s!==void 0?re(s):void 0}return t}const yke={keybindingLabelBackground:re(ove),keybindingLabelForeground:re(rve),keybindingLabelBorder:re(ave),keybindingLabelBottomBorder:re(lve),keybindingLabelShadow:re(Ql)},wke={buttonForeground:re(o_),buttonSeparator:re(jbe),buttonBackground:re(r_),buttonHoverBackground:re(qbe),buttonSecondaryForeground:re(Kbe),buttonSecondaryBackground:re(kT),buttonSecondaryHoverBackground:re(Ybe),buttonBorder:re(Gbe)},Cke={progressBarBackground:re(Qbe)},_x={inputActiveOptionBorder:re(gP),inputActiveOptionForeground:re(pP),inputActiveOptionBackground:re(kh)};re(Ove),re(Bve),re(Fve);re(Ui),re(Ha),re(Ql),re(Je),re(e1e),re(t1e),re(i1e),re(Tbe);const bx={inputBackground:re(Nbe),inputForeground:re(Rbe),inputBorder:re(Mbe),inputValidationInfoBorder:re(Fbe),inputValidationInfoBackground:re(Pbe),inputValidationInfoForeground:re(Obe),inputValidationWarningBorder:re(Vbe),inputValidationWarningBackground:re(Bbe),inputValidationWarningForeground:re(Wbe),inputValidationErrorBorder:re($be),inputValidationErrorBackground:re(zbe),inputValidationErrorForeground:re(Hbe)},Ske={listFilterWidgetBackground:re(Ave),listFilterWidgetOutline:re(Ive),listFilterWidgetNoMatchesOutline:re(Tve),listFilterWidgetShadow:re(Nve),inputBoxStyles:bx,toggleStyles:_x},OG={badgeBackground:re(yC),badgeForeground:re(Zbe),badgeBorder:re(Je)};re(Gve),re(qve),re(u7),re(u7),re(Kve);const Jf={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:re(vve),listFocusForeground:re(yve),listFocusOutline:re(wve),listActiveSelectionBackground:re(ec),listActiveSelectionForeground:re(Ua),listActiveSelectionIconForeground:re(d_),listFocusAndSelectionOutline:re(Cve),listFocusAndSelectionBackground:re(ec),listFocusAndSelectionForeground:re(Ua),listInactiveSelectionBackground:re(Sve),listInactiveSelectionIconForeground:re(Lve),listInactiveSelectionForeground:re(xve),listInactiveFocusBackground:re(Dve),listInactiveFocusOutline:re(kve),listHoverBackground:re(Yj),listHoverForeground:re(Zj),listDropBackground:re(Eve),listSelectionOutline:re(Gt),listHoverOutline:re(Gt),treeIndentGuidesStroke:re(u_),treeInactiveIndentGuidesStroke:re(Rve),tableColumnsBorder:re(Mve),tableOddRowsBackgroundColor:re(Pve)};function oy(n){return vke(n,Jf)}const xke={selectBackground:re(Va),selectListBackground:re(Ube),selectForeground:re(Jl),decoratorRightForeground:re(Gj),selectBorder:re($g),focusBorder:re(Co),listFocusBackground:re(TT),listInactiveSelectionIconForeground:re(Xj),listFocusForeground:re(IT),listFocusOutline:Ebe(Gt,H.transparent.toString()),listHoverBackground:re(Yj),listHoverForeground:re(Zj),listHoverOutline:re(Gt),selectListBorder:re(Ug),listBackground:void 0,listActiveSelectionBackground:void 0,listActiveSelectionForeground:void 0,listActiveSelectionIconForeground:void 0,listFocusAndSelectionBackground:void 0,listDropBackground:void 0,listInactiveSelectionBackground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusBackground:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listFocusAndSelectionForeground:void 0,listFocusAndSelectionOutline:void 0,listInactiveFocusForeground:void 0,tableColumnsBorder:void 0,tableOddRowsBackgroundColor:void 0,treeIndentGuidesStroke:void 0,treeInactiveIndentGuidesStroke:void 0},Lke={shadowColor:re(Ql),borderColor:re(Wve),foregroundColor:re(Vve),backgroundColor:re(zve),selectionForegroundColor:re(Hve),selectionBackgroundColor:re($ve),selectionBorderColor:re(Uve),separatorColor:re(jve),scrollbarShadow:re(Xbe),scrollbarSliderBackground:re(a_),scrollbarSliderHoverBackground:re(l_),scrollbarSliderActiveBackground:re(c_)};var MD=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},xs=function(n,e){return function(t,i){e(t,i,n)}},FG=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function Dke(n,e,t,i){const s=n.getActions(e),o=cd.getInstance(),r=o.keyStatus.altKey||(Fs||Jn)&&o.keyStatus.shiftKey;WG(s,t,r,a=>a==="navigation")}function BG(n,e,t,i,s,o){const r=n.getActions(e);WG(r,t,!1,typeof i=="string"?l=>l===i:i,s,o)}function WG(n,e,t,i=r=>r==="navigation",s=()=>!1,o=!1){let r,a;Array.isArray(e)?(r=e,a=e):(r=e.primary,a=e.secondary);const l=new Set;for(const[c,d]of n){let u;i(c)?(u=r,u.length>0&&o&&u.push(new Pn)):(u=a,u.length>0&&u.push(new Pn));for(let h of d){t&&(h=h instanceof il&&h.alt?h.alt:h);const f=u.push(h);h instanceof qL&&l.add({group:c,action:h,index:f-1})}}for(const{group:c,action:d,index:u}of l){const h=i(c)?r:a,f=d.actions;s(d,c,h.length)&&h.splice(u,1,...f)}}let Pm=class extends ND{constructor(e,t,i,s,o,r,a,l){super(void 0,e,{icon:!!(e.class||e.item.icon),label:!e.class&&!e.item.icon,draggable:t==null?void 0:t.draggable,keybinding:t==null?void 0:t.keybinding,hoverDelegate:t==null?void 0:t.hoverDelegate}),this._keybindingService=i,this._notificationService=s,this._contextKeyService=o,this._themeService=r,this._contextMenuService=a,this._accessibilityService=l,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new ra),this._altKey=cd.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}onClick(e){return FG(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){if(super.render(e),e.classList.add("menu-entry"),this.options.icon&&this._updateItemClass(this._menuItemAction.item),this._menuItemAction.alt){let t=!1;const i=()=>{var s;const o=!!(!((s=this._menuItemAction.alt)===null||s===void 0)&&s.enabled)&&(!this._accessibilityService.isMotionReduced()||t)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&t);o!==this._wantsAltCommand&&(this._wantsAltCommand=o,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(i)),this._register(K(e,"mouseleave",s=>{t=!1,i()})),this._register(K(e,"mouseenter",s=>{t=!0,i()})),i()}}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(),s=this._commandAction.tooltip||this._commandAction.label;let o=i?m("titleAndKb","{0} ({1})",s,i):s;if(!this._wantsAltCommand&&(!((e=this._menuItemAction.alt)===null||e===void 0)&&e.enabled)){const r=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,a=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),l=a&&a.getLabel(),c=l?m("titleAndKb","{0} ({1})",r,l):r;o=m("titleAndKbAndAlt",`{0} -[{1}] {2}`,o,GP.modifierLabels[wo].altKey,c)}return o}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){this._itemClassDispose.value=void 0;const{element:t,label:i}=this;if(!t||!i)return;const s=this._commandAction.checked&&mke(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(s)if(Te.isThemeIcon(s)){const o=Te.asClassNameArray(s);i.classList.add(...o),this._itemClassDispose.value=Ze(()=>{i.classList.remove(...o)})}else{const o=yD(this._themeService.getColorTheme().type)?iu(s.dark):iu(s.light),r=ye("span");r.style.webkitMask=r.style.mask=`${o} no-repeat 50% 50%`,r.style.background="var(--vscode-icon-foreground)",r.style.display="inline-block",r.style.width="100%",r.style.height="100%",i.appendChild(r),i.classList.add("icon"),this._itemClassDispose.value=br(Ze(()=>{i.classList.remove("icon"),ds(i)}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}}};Pm=MD([xs(2,vi),xs(3,Dn),xs(4,tt),xs(5,co),xs(6,Tu),xs(7,Eu)],Pm);let yN=class extends mx{constructor(e,t,i,s,o){var r,a,l;const c=Object.assign(Object.assign({},t),{menuAsChild:(r=t==null?void 0:t.menuAsChild)!==null&&r!==void 0?r:!1,classNames:(a=t==null?void 0:t.classNames)!==null&&a!==void 0?a:Te.isThemeIcon(e.item.icon)?Te.asClassName(e.item.icon):void 0,keybindingProvider:(l=t==null?void 0:t.keybindingProvider)!==null&&l!==void 0?l:d=>i.lookupKeybinding(d.id)});super(e,{getActions:()=>e.actions},s,c),this._keybindingService=i,this._contextMenuService=s,this._themeService=o}render(e){super.render(e),Ls(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!Te.isThemeIcon(i)){this.element.classList.add("icon");const s=()=>{this.element&&(this.element.style.backgroundImage=yD(this._themeService.getColorTheme().type)?iu(i.dark):iu(i.light))};s(),this._register(this._themeService.onDidColorThemeChange(()=>{s()}))}}};yN=MD([xs(2,vi),xs(3,Tu),xs(4,co)],yN);let wN=class extends Zr{constructor(e,t,i,s,o,r,a,l){var c,d,u;super(null,e),this._keybindingService=i,this._notificationService=s,this._contextMenuService=o,this._menuService=r,this._instaService=a,this._storageService=l,this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;let h;const f=t!=null&&t.persistLastActionId?l.get(this._storageKey,1):void 0;f&&(h=e.actions.find(p=>f===p.id)),h||(h=e.actions[0]),this._defaultAction=this._instaService.createInstance(Pm,h,{keybinding:this._getDefaultActionKeybindingLabel(h)});const g=Object.assign(Object.assign({keybindingProvider:p=>this._keybindingService.lookupKeybinding(p.id)},t),{menuAsChild:(c=t==null?void 0:t.menuAsChild)!==null&&c!==void 0?c:!0,classNames:(d=t==null?void 0:t.classNames)!==null&&d!==void 0?d:["codicon","codicon-chevron-down"],actionRunner:(u=t==null?void 0:t.actionRunner)!==null&&u!==void 0?u:new _m});this._dropdown=new mx(e,e.actions,this._contextMenuService,g),this._dropdown.actionRunner.onDidRun(p=>{p.action instanceof il&&this.update(p.action)})}update(e){var t;!((t=this._options)===null||t===void 0)&&t.persistLastActionId&&this._storageService.store(this._storageKey,e.id,1,1),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(Pm,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends _m{runAction(i,s){return FG(this,void 0,void 0,function*(){yield i.run(void 0)})}},this._container&&this._defaultAction.render(nj(this._container,ye(".action-container")))}_getDefaultActionKeybindingLabel(e){var t;let i;if(!((t=this._options)===null||t===void 0)&&t.renderKeybindingWithDefaultActionLabel){const s=this._keybindingService.lookupKeybinding(e.id);s&&(i=`(${s.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=ye(".action-container");this._defaultAction.render(le(this._container,t)),this._register(K(t,de.KEY_DOWN,s=>{const o=new Ht(s);o.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),o.stopPropagation())}));const i=ye(".dropdown-action-container");this._dropdown.render(le(this._container,i)),this._register(K(i,de.KEY_DOWN,s=>{var o;const r=new Ht(s);r.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),(o=this._defaultAction.element)===null||o===void 0||o.focus(),r.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()}};wN=MD([xs(2,vi),xs(3,Dn),xs(4,Tu),xs(5,Lu),xs(6,yt),xs(7,Qf)],wN);let CN=class extends fke{constructor(e,t){super(null,e,e.actions.map(i=>({text:i.id===Pn.ID?"─────────":i.label,isDisabled:!i.enabled})),0,t,xke,{ariaLabel:e.tooltip,optionsAsChildren:!0}),this.select(Math.max(0,e.actions.findIndex(i=>i.checked)))}render(e){super.render(e),e.style.borderColor=re($g)}runAction(e,t){const i=this.action.actions[t];i&&this.actionRunner.run(i)}};CN=MD([xs(1,Iu)],CN);function kke(n,e,t){return e instanceof il?n.createInstance(Pm,e,t):e instanceof NS?e.item.isSelection?n.createInstance(CN,e):e.item.rememberDefaultAction?n.createInstance(wN,e,Object.assign(Object.assign({},t),{persistLastActionId:!0})):n.createInstance(yN,e,t):void 0}var Eke=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class al extends Y{constructor(e,t={}){var i,s,o,r,a,l;super(),this._actionRunnerDisposables=this._register(new pe),this.viewItemDisposables=this._register(new T4),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new B),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new B({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new B),this.onDidRun=this._onDidRun.event,this._onWillRun=this._register(new B),this.onWillRun=this._onWillRun.event,this.options=t,this._context=(i=t.context)!==null&&i!==void 0?i:null,this._orientation=(s=this.options.orientation)!==null&&s!==void 0?s:0,this._triggerKeys={keyDown:(r=(o=this.options.triggerKeys)===null||o===void 0?void 0:o.keyDown)!==null&&r!==void 0?r:!1,keys:(l=(a=this.options.triggerKeys)===null||a===void 0?void 0:a.keys)!==null&&l!==void 0?l:[3,10]},this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new _m,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(u=>this._onDidRun.fire(u))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(u=>this._onWillRun.fire(u))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar",t.animated!==!1&&this.domNode.classList.add("animated");let c,d;switch(this._orientation){case 0:c=[15],d=[17];break;case 1:c=[16],d=[18],this.domNode.className+=" vertical";break}this._register(K(this.domNode,de.KEY_DOWN,u=>{const h=new Ht(u);let f=!0;const g=typeof this.focusedItem=="number"?this.viewItems[this.focusedItem]:void 0;c&&(h.equals(c[0])||h.equals(c[1]))?f=this.focusPrevious():d&&(h.equals(d[0])||h.equals(d[1]))?f=this.focusNext():h.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():h.equals(14)?f=this.focusFirst():h.equals(13)?f=this.focusLast():h.equals(2)&&g instanceof Zr&&g.trapsArrowNavigation?f=this.focusNext():this.isTriggerKeyEvent(h)?this._triggerKeys.keyDown?this.doTrigger(h):this.triggerKeyDown=!0:f=!1,f&&(h.preventDefault(),h.stopPropagation())})),this._register(K(this.domNode,de.KEY_UP,u=>{const h=new Ht(u);this.isTriggerKeyEvent(h)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(h)),h.preventDefault(),h.stopPropagation()):(h.equals(2)||h.equals(1026))&&this.updateFocusedItem()})),this.focusTracker=this._register(tu(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(ia()===this.domNode||!Sn(ia(),this.domNode))&&(this._onDidBlur.fire(),this.previouslyFocusedItem=this.focusedItem,this.focusedItem=void 0,this.triggerKeyDown=!1)})),this._register(this.focusTracker.onDidFocus(()=>this.updateFocusedItem())),this.actionsList=document.createElement("ul"),this.actionsList.className="actions-container",this.options.highlightToggledItems&&this.actionsList.classList.add("highlight-toggled"),this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"),this.options.ariaLabel&&this.actionsList.setAttribute("aria-label",this.options.ariaLabel),this.domNode.appendChild(this.actionsList),e.appendChild(this.domNode)}refreshRole(){this.length()>=2?this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"):this.actionsList.setAttribute("role","presentation")}setFocusable(e){if(this.focusable=e,this.focusable){const t=this.viewItems.find(i=>i instanceof Zr&&i.isEnabled());t instanceof Zr&&t.setFocusable(!0)}else this.viewItems.forEach(t=>{t instanceof Zr&&t.setFocusable(!1)})}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach(i=>{t=t||e.equals(i)}),t}updateFocusedItem(){for(let e=0;et.setActionContext(e))}get actionRunner(){return this._actionRunner}set actionRunner(e){this._actionRunner=e,this._actionRunnerDisposables.clear(),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(t=>this._onDidRun.fire(t))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(t=>this._onWillRun.fire(t))),this.viewItems.forEach(t=>t.actionRunner=e)}getContainer(){return this.domNode}getAction(e){var t;if(typeof e=="number")return(t=this.viewItems[e])===null||t===void 0?void 0:t.action;if(e instanceof HTMLElement){for(;e.parentElement!==this.actionsList;){if(!e.parentElement)return;e=e.parentElement}for(let i=0;i{const r=document.createElement("li");r.className="action-item",r.setAttribute("role","presentation");let a;const l=Object.assign({hoverDelegate:this.options.hoverDelegate},t);this.options.actionViewItemProvider&&(a=this.options.actionViewItemProvider(o,l)),a||(a=new ND(this.context,o,l)),this.options.allowContextMenu||this.viewItemDisposables.set(a,K(r,de.CONTEXT_MENU,c=>{Ue.stop(c,!0)})),a.actionRunner=this._actionRunner,a.setActionContext(this.context),a.render(r),this.focusable&&a instanceof Zr&&this.viewItems.length===0&&a.setFocusable(!0),s===null||s<0||s>=this.actionsList.children.length?(this.actionsList.appendChild(r),this.viewItems.push(a)):(this.actionsList.insertBefore(r,this.actionsList.children[s]),this.viewItems.splice(s,0,a),s++)}),typeof this.focusedItem=="number"&&this.focus(this.focusedItem),this.refreshRole()}clear(){this.isEmpty()||(this.viewItems=Bt(this.viewItems),this.viewItemDisposables.clearAndDisposeAll(),ko(this.actionsList),this.refreshRole())}length(){return this.viewItems.length}isEmpty(){return this.viewItems.length===0}focus(e){let t=!1,i;if(e===void 0?t=!0:typeof e=="number"?i=e:typeof e=="boolean"&&(t=e),t&&typeof this.focusedItem>"u"){const s=this.viewItems.findIndex(o=>o.isEnabled());this.focusedItem=s===-1?void 0:s,this.updateFocus(void 0,void 0,!0)}else i!==void 0&&(this.focusedItem=i),this.updateFocus(void 0,void 0,!0)}focusFirst(){return this.focusedItem=this.length()-1,this.focusNext(!0)}focusLast(){return this.focusedItem=0,this.focusPrevious(!0)}focusNext(e){if(typeof this.focusedItem>"u")this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let i;do{if(!e&&this.options.preventLoopNavigation&&this.focusedItem+1>=this.viewItems.length)return this.focusedItem=t,!1;this.focusedItem=(this.focusedItem+1)%this.viewItems.length,i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===Pn.ID));return this.updateFocus(),!0}focusPrevious(e){if(typeof this.focusedItem>"u")this.focusedItem=0;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let i;do{if(this.focusedItem=this.focusedItem-1,this.focusedItem<0){if(!e&&this.options.preventLoopNavigation)return this.focusedItem=t,!1;this.focusedItem=this.viewItems.length-1}i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===Pn.ID));return this.updateFocus(!0),!0}updateFocus(e,t,i=!1){var s;typeof this.focusedItem>"u"&&this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem!==void 0&&this.previouslyFocusedItem!==this.focusedItem&&((s=this.viewItems[this.previouslyFocusedItem])===null||s===void 0||s.blur());const o=this.focusedItem!==void 0&&this.viewItems[this.focusedItem];if(o){let r=!0;vS(o.focus)||(r=!1),this.options.focusOnlyEnabledItems&&vS(o.isEnabled)&&!o.isEnabled()&&(r=!1),o.action.id===Pn.ID&&(r=!1),r?(i||this.previouslyFocusedItem!==this.focusedItem)&&(o.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0)}}doTrigger(e){if(typeof this.focusedItem>"u")return;const t=this.viewItems[this.focusedItem];if(t instanceof Zr){const i=t._context===null||t._context===void 0?e:t._context;this.run(t._action,i)}}run(e,t){return Eke(this,void 0,void 0,function*(){yield this._actionRunner.run(e,t)})}dispose(){this._context=void 0,this.viewItems=Bt(this.viewItems),this.getContainer().remove(),super.dispose()}}const SN=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,aE=/(&)?(&)([^\s&])/g;var vx;(function(n){n[n.Right=0]="Right",n[n.Left=1]="Left"})(vx||(vx={}));class Ip extends al{constructor(e,t,i,s){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const o=document.createElement("div");o.classList.add("monaco-menu"),o.setAttribute("role","presentation"),super(o,{orientation:1,actionViewItemProvider:l=>this.doGetActionViewItem(l,i,r),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...mt||Jn?[10]:[]],keyDown:!0}}),this.menuStyles=s,this.menuElement=o,this.actionsList.tabIndex=0,this.menuDisposables=this._register(new pe),this.initializeOrUpdateStyleSheet(e,s),this._register(Mt.addTarget(o)),K(o,de.KEY_DOWN,l=>{new Ht(l).equals(2)&&l.preventDefault()}),i.enableMnemonics&&this.menuDisposables.add(K(o,de.KEY_DOWN,l=>{const c=l.key.toLocaleLowerCase();if(this.mnemonics.has(c)){Ue.stop(l,!0);const d=this.mnemonics.get(c);if(d.length===1&&(d[0]instanceof r8&&d[0].container&&this.focusItemByElement(d[0].container),d[0].onClick(l)),d.length>1){const u=d.shift();u&&u.container&&(this.focusItemByElement(u.container),d.push(u)),this.mnemonics.set(c,d)}}})),Jn&&this._register(K(o,de.KEY_DOWN,l=>{const c=new Ht(l);c.equals(14)||c.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),Ue.stop(l,!0)):(c.equals(13)||c.equals(12))&&(this.focusedItem=0,this.focusPrevious(),Ue.stop(l,!0))})),this._register(K(this.domNode,de.MOUSE_OUT,l=>{const c=l.relatedTarget;Sn(c,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),l.stopPropagation())})),this._register(K(this.actionsList,de.MOUSE_OVER,l=>{let c=l.target;if(!(!c||!Sn(c,this.actionsList)||c===this.actionsList)){for(;c.parentElement!==this.actionsList&&c.parentElement!==null;)c=c.parentElement;if(c.classList.contains("action-item")){const d=this.focusedItem;this.setFocusedItem(c),d!==this.focusedItem&&this.updateFocus()}}})),this._register(Mt.addTarget(this.actionsList)),this._register(K(this.actionsList,Ot.Tap,l=>{let c=l.initialTarget;if(!(!c||!Sn(c,this.actionsList)||c===this.actionsList)){for(;c.parentElement!==this.actionsList&&c.parentElement!==null;)c=c.parentElement;if(c.classList.contains("action-item")){const d=this.focusedItem;this.setFocusedItem(c),d!==this.focusedItem&&this.updateFocus()}}}));const r={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new SP(o,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const a=this.scrollableElement.getDomNode();a.style.position="",this.styleScrollElement(a,s),this._register(K(o,Ot.Change,l=>{Ue.stop(l,!0);const c=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:c-l.translationY})})),this._register(K(a,de.MOUSE_UP,l=>{l.preventDefault()})),o.style.maxHeight=`${Math.max(10,window.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter(l=>{var c;return!((c=i.submenuIds)===null||c===void 0)&&c.has(l.id)?(console.warn(`Found submenu cycle: ${l.id}`),!1):!0}),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(l=>!(l instanceof a8)).forEach((l,c,d)=>{l.updatePositionInSet(c+1,d.length)})}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(aT(e)?this.styleSheet=kr(e):(Ip.globalStyleSheet||(Ip.globalStyleSheet=kr()),this.styleSheet=Ip.globalStyleSheet)),this.styleSheet.textContent=Ike(t,aT(e))}styleScrollElement(e,t){var i,s;const o=(i=t.foregroundColor)!==null&&i!==void 0?i:"",r=(s=t.backgroundColor)!==null&&s!==void 0?s:"",a=t.borderColor?`1px solid ${t.borderColor}`:"",l="5px",c=t.shadowColor?`0 2px 8px ${t.shadowColor}`:"";e.style.outline=a,e.style.borderRadius=l,e.style.color=o,e.style.backgroundColor=r,e.style.boxShadow=c}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}focusItemByElement(e){const t=this.focusedItem;this.setFocusedItem(e),t!==this.focusedItem&&this.updateFocus()}setFocusedItem(e){for(let t=0;t{this.element&&(this._register(K(this.element,de.MOUSE_UP,o=>{if(Ue.stop(o,!0),Lr){if(new ur(o).rightButton)return;this.onClick(o)}else setTimeout(()=>{this.onClick(o)},0)})),this._register(K(this.element,de.CONTEXT_MENU,o=>{Ue.stop(o,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=le(this.element,ye("a.action-menu-item")),this._action.id===Pn.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=le(this.item,ye("span.menu-item-check"+Te.asCSSSelector(se.menuSelection))),this.check.setAttribute("role","none"),this.label=le(this.item,ye("span.action-label")),this.options.label&&this.options.keybinding&&(le(this.item,ye("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked(),this.applyStyle())}blur(){super.blur(),this.applyStyle()}focus(){var e;super.focus(),(e=this.item)===null||e===void 0||e.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){var e;if(this.label&&this.options.label){ko(this.label);let t=DG(this.action.label);if(t){const i=Ake(t);this.options.enableMnemonics||(t=i),this.label.setAttribute("aria-label",i.replace(/&&/g,"&"));const s=SN.exec(t);if(s){t=kS(t),aE.lastIndex=0;let o=aE.exec(t);for(;o&&o[1];)o=aE.exec(t);const r=a=>a.replace(/&&/g,"&");o?this.label.append(jL(r(t.substr(0,o.index))," "),ye("u",{"aria-hidden":"true"},o[3]),Oge(r(t.substr(o.index+o[0].length))," ")):this.label.innerText=r(t).trim(),(e=this.item)===null||e===void 0||e.setAttribute("aria-keyshortcuts",(s[1]?s[1]:s[3]).toLocaleLowerCase())}else this.label.innerText=t.replace(/&&/g,"&").trim()}}}updateTooltip(){}updateClass(){this.cssClass&&this.item&&this.item.classList.remove(...this.cssClass.split(" ")),this.options.icon&&this.label?(this.cssClass=this.action.class||"",this.label.classList.add("icon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" ")),this.updateEnabled()):this.label&&this.label.classList.remove("icon")}updateEnabled(){this.action.enabled?(this.element&&(this.element.classList.remove("disabled"),this.element.removeAttribute("aria-disabled")),this.item&&(this.item.classList.remove("disabled"),this.item.removeAttribute("aria-disabled"),this.item.tabIndex=0)):(this.element&&(this.element.classList.add("disabled"),this.element.setAttribute("aria-disabled","true")),this.item&&(this.item.classList.add("disabled"),this.item.setAttribute("aria-disabled","true")))}updateChecked(){if(!this.item)return;const e=this.action.checked;this.item.classList.toggle("checked",!!e),e!==void 0?(this.item.setAttribute("role","menuitemcheckbox"),this.item.setAttribute("aria-checked",e?"true":"false")):(this.item.setAttribute("role","menuitem"),this.item.setAttribute("aria-checked",""))}getMnemonic(){return this.mnemonic}applyStyle(){const e=this.element&&this.element.classList.contains("focused"),t=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor,i=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,s=e&&this.menuStyle.selectionBorderColor?`1px solid ${this.menuStyle.selectionBorderColor}`:"",o=e&&this.menuStyle.selectionBorderColor?"-1px":"";this.item&&(this.item.style.color=t??"",this.item.style.backgroundColor=i??"",this.item.style.outline=s,this.item.style.outlineOffset=o),this.check&&(this.check.style.color=t??"")}}class r8 extends VG{constructor(e,t,i,s,o){super(e,e,s,o),this.submenuActions=t,this.parentData=i,this.submenuOptions=s,this.mysubmenu=null,this.submenuDisposables=this._register(new pe),this.mouseOver=!1,this.expandDirection=s&&s.expandDirection!==void 0?s.expandDirection:vx.Right,this.showScheduler=new Di(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new Di(()=>{this.element&&!Sn(ia(),this.element)&&this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))},750)}render(e){super.render(e),this.element&&(this.item&&(this.item.classList.add("monaco-submenu-item"),this.item.tabIndex=0,this.item.setAttribute("aria-haspopup","true"),this.updateAriaExpanded("false"),this.submenuIndicator=le(this.item,ye("span.submenu-indicator"+Te.asCSSSelector(se.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(K(this.element,de.KEY_UP,t=>{const i=new Ht(t);(i.equals(17)||i.equals(3))&&(Ue.stop(t,!0),this.createSubmenu(!0))})),this._register(K(this.element,de.KEY_DOWN,t=>{const i=new Ht(t);ia()===this.item&&(i.equals(17)||i.equals(3))&&Ue.stop(t,!0)})),this._register(K(this.element,de.MOUSE_OVER,t=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(K(this.element,de.MOUSE_LEAVE,t=>{this.mouseOver=!1})),this._register(K(this.element,de.FOCUS_OUT,t=>{this.element&&!Sn(ia(),this.element)&&this.hideScheduler.schedule()})),this._register(this.parentData.parent.onScroll(()=>{this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))})))}updateEnabled(){}onClick(e){Ue.stop(e,!0),this.cleanupExistingSubmenu(!1),this.createSubmenu(!0)}cleanupExistingSubmenu(e){if(this.parentData.submenu&&(e||this.parentData.submenu!==this.mysubmenu)){try{this.parentData.submenu.dispose()}catch{}this.parentData.submenu=void 0,this.updateAriaExpanded("false"),this.submenuContainer&&(this.submenuDisposables.clear(),this.submenuContainer=void 0)}}calculateSubmenuMenuLayout(e,t,i,s){const o={top:0,left:0};return o.left=Jg(e.width,t.width,{position:s===vx.Right?0:1,offset:i.left,size:i.width}),o.left>=i.left&&o.left{new Ht(c).equals(15)&&(Ue.stop(c,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(K(this.submenuContainer,de.KEY_DOWN,c=>{new Ht(c).equals(15)&&Ue.stop(c,!0)})),this.submenuDisposables.add(this.parentData.submenu.onDidCancel(()=>{this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0)})),this.parentData.submenu.focus(e),this.mysubmenu=this.parentData.submenu}}updateAriaExpanded(e){var t;this.item&&((t=this.item)===null||t===void 0||t.setAttribute("aria-expanded",e))}applyStyle(){super.applyStyle();const t=this.element&&this.element.classList.contains("focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=t??"")}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class a8 extends ND{constructor(e,t,i,s){super(e,t,i),this.menuStyles=s}render(e){super.render(e),this.label&&(this.label.style.borderBottomColor=this.menuStyles.separatorColor?`${this.menuStyles.separatorColor}`:"")}}function Ake(n){const e=SN,t=e.exec(n);if(!t)return n;const i=!t[1];return n.replace(e,i?"$2$3":"").trim()}function l8(n){const e=kU()[n.id];return`.codicon-${n.id}:before { content: '\\${e.toString(16)}'; }`}function Ike(n,e){let t=` +`)}}const Ske={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackground:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropBackground:"#383B3D",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:H.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:H.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:H.fromHex("#cccccc").transparent(.04).toString(),listBackground:void 0,listFocusForeground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusForeground:void 0,listInactiveFocusBackground:void 0,listHoverForeground:void 0,listFocusOutline:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listHoverOutline:void 0},xke={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI(){return null},onDragStart(){},onDragOver(){return!1},drop(){},dispose(){}}};function Lke(n,e){const t=n.indexOf(e);if(t===-1)return[];const i=[];let s=t-1;for(;s>=0&&n[s]===e-(t-s);)i.push(n[s--]);for(i.reverse(),s=t;s=n.length)t.push(e[s++]);else if(s>=e.length)t.push(n[i++]);else if(n[i]===e[s]){t.push(n[i]),i++,s++;continue}else n[i]=n.length)t.push(e[s++]);else if(s>=e.length)t.push(n[i++]);else if(n[i]===e[s]){i++,s++;continue}else n[i]n-e;class kke{constructor(e,t){this._templateId=e,this.renderers=t}get templateId(){return this._templateId}renderTemplate(e){return this.renderers.map(t=>t.renderTemplate(e))}renderElement(e,t,i,s){let o=0;for(const r of this.renderers)r.renderElement(e,t,i[o++],s)}disposeElement(e,t,i,s){var o;let r=0;for(const a of this.renderers)(o=a.disposeElement)===null||o===void 0||o.call(a,e,t,i[r],s),r+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class Eke{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return e}renderElement(e,t,i){const s=this.accessibilityProvider.getAriaLabel(e);s?i.setAttribute("aria-label",s):i.removeAttribute("aria-label");const o=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);typeof o=="number"?i.setAttribute("aria-level",`${o}`):i.removeAttribute("aria-level")}disposeTemplate(e){}}class Ake{constructor(e,t){this.list=e,this.dnd=t}getDragElements(e){const t=this.list.getSelectedElements();return t.indexOf(e)>-1?t:[e]}getDragURI(e){return this.dnd.getDragURI(e)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e,t)}onDragStart(e,t){var i,s;(s=(i=this.dnd).onDragStart)===null||s===void 0||s.call(i,e,t)}onDragOver(e,t,i,s){return this.dnd.onDragOver(e,t,i,s)}onDragLeave(e,t,i,s){var o,r;(r=(o=this.dnd).onDragLeave)===null||r===void 0||r.call(o,e,t,i,s)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}drop(e,t,i,s){this.dnd.drop(e,t,i,s)}dispose(){this.dnd.dispose()}}class ha{get onDidChangeFocus(){return ue.map(this.eventBufferer.wrapEvent(this.focus.onChange),e=>this.toListEvent(e),this.disposables)}get onDidChangeSelection(){return ue.map(this.eventBufferer.wrapEvent(this.selection.onChange),e=>this.toListEvent(e),this.disposables)}get domId(){return this.view.domId}get onDidScroll(){return this.view.onDidScroll}get onMouseClick(){return this.view.onMouseClick}get onMouseDblClick(){return this.view.onMouseDblClick}get onMouseMiddleClick(){return this.view.onMouseMiddleClick}get onPointer(){return this.mouseController.onPointer}get onMouseDown(){return this.view.onMouseDown}get onMouseOver(){return this.view.onMouseOver}get onMouseOut(){return this.view.onMouseOut}get onTouchStart(){return this.view.onTouchStart}get onTap(){return this.view.onTap}get onContextMenu(){let e=!1;const t=ue.chain(this.disposables.add(new ot(this.view.domNode,"keydown")).event,o=>o.map(r=>new zt(r)).filter(r=>e=r.keyCode===58||r.shiftKey&&r.keyCode===68).map(r=>$e.stop(r,!0)).filter(()=>!1)),i=ue.chain(this.disposables.add(new ot(this.view.domNode,"keyup")).event,o=>o.forEach(()=>e=!1).map(r=>new zt(r)).filter(r=>r.keyCode===58||r.shiftKey&&r.keyCode===68).map(r=>$e.stop(r,!0)).map(({browserEvent:r})=>{const a=this.getFocus(),l=a.length?a[0]:void 0,c=typeof l<"u"?this.view.element(l):void 0,d=typeof l<"u"?this.view.domElement(l):this.view.domNode;return{index:l,element:c,anchor:d,browserEvent:r}})),s=ue.chain(this.view.onContextMenu,o=>o.filter(r=>!e).map(({element:r,index:a,browserEvent:l})=>({element:r,index:a,anchor:new dr(l),browserEvent:l})));return ue.any(t,i,s)}get onKeyDown(){return this.disposables.add(new ot(this.view.domNode,"keydown")).event}get onDidFocus(){return ue.signal(this.disposables.add(new ot(this.view.domNode,"focus",!0)).event)}constructor(e,t,i,s,o=xke){var r,a,l,c;this.user=e,this._options=o,this.focus=new lx("focused"),this.anchor=new lx("anchor"),this.eventBufferer=new T4,this._ariaLabel="",this.disposables=new pe,this._onDidDispose=new B,this.onDidDispose=this._onDidDispose.event;const d=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?(r=this._options.accessibilityProvider)===null||r===void 0?void 0:r.getWidgetRole():"list";this.selection=new bke(d!=="listbox");const u=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=o.accessibilityProvider,this.accessibilityProvider&&(u.push(new Eke(this.accessibilityProvider)),(l=(a=this.accessibilityProvider).onDidChangeActiveDescendant)===null||l===void 0||l.call(a,this.onDidChangeActiveDescendant,this,this.disposables)),s=s.map(f=>new kke(f.templateId,[...u,f]));const h=Object.assign(Object.assign({},o),{dnd:o.dnd&&new Ake(this,o.dnd)});if(this.view=this.createListView(t,i,s,h),this.view.domNode.setAttribute("role",d),o.styleController)this.styleController=o.styleController(this.view.domId);else{const f=Dr(this.view.domNode);this.styleController=new RG(f,this.view.domId)}if(this.spliceable=new lke([new eE(this.focus,this.view,o.identityProvider),new eE(this.selection,this.view,o.identityProvider),new eE(this.anchor,this.view,o.identityProvider),this.view]),this.disposables.add(this.focus),this.disposables.add(this.selection),this.disposables.add(this.anchor),this.disposables.add(this.view),this.disposables.add(this._onDidDispose),this.disposables.add(new wke(this,this.view)),(typeof o.keyboardSupport!="boolean"||o.keyboardSupport)&&(this.keyboardController=new AG(this,this.view,o),this.disposables.add(this.keyboardController)),o.keyboardNavigationLabelProvider){const f=o.keyboardNavigationDelegate||vke;this.typeNavigationController=new yke(this,this.view,o.keyboardNavigationLabelProvider,(c=o.keyboardNavigationEventFilter)!==null&&c!==void 0?c:()=>!0,f),this.disposables.add(this.typeNavigationController)}this.mouseController=this.createMouseController(o),this.disposables.add(this.mouseController),this.onDidChangeFocus(this._onFocusChange,this,this.disposables),this.onDidChangeSelection(this._onSelectionChange,this,this.disposables),this.accessibilityProvider&&(this.ariaLabel=this.accessibilityProvider.getWidgetAriaLabel()),this._options.multipleSelectionSupport!==!1&&this.view.domNode.setAttribute("aria-multiselectable","true")}createListView(e,t,i,s){return new Xo(e,t,i,s)}createMouseController(e){return new NG(this)}updateOptions(e={}){var t,i;this._options=Object.assign(Object.assign({},this._options),e),(t=this.typeNavigationController)===null||t===void 0||t.updateOptions(this._options),this._options.multipleSelectionController!==void 0&&(this._options.multipleSelectionSupport?this.view.domNode.setAttribute("aria-multiselectable","true"):this.view.domNode.removeAttribute("aria-multiselectable")),this.mouseController.updateOptions(e),(i=this.keyboardController)===null||i===void 0||i.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,i=[]){if(e<0||e>this.view.length)throw new Sg(this.user,`Invalid start index: ${e}`);if(t<0)throw new Sg(this.user,`Invalid delete count: ${t}`);t===0&&i.length===0||this.eventBufferer.bufferEvents(()=>this.spliceable.splice(e,t,i))}rerender(){this.view.rerender()}element(e){return this.view.element(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get firstVisibleIndex(){return this.view.firstVisibleIndex}get ariaLabel(){return this._ariaLabel}set ariaLabel(e){this._ariaLabel=e,this.view.domNode.setAttribute("aria-label",e)}domFocus(){this.view.domNode.focus({preventScroll:!0})}layout(e,t){this.view.layout(e,t)}setSelection(e,t){for(const i of e)if(i<0||i>=this.length)throw new Sg(this.user,`Invalid index ${i}`);this.selection.set(e,t)}getSelection(){return this.selection.get()}getSelectedElements(){return this.getSelection().map(e=>this.view.element(e))}setAnchor(e){if(typeof e>"u"){this.anchor.set([]);return}if(e<0||e>=this.length)throw new Sg(this.user,`Invalid index ${e}`);this.anchor.set([e])}getAnchor(){return X$(this.anchor.get(),void 0)}getAnchorElement(){const e=this.getAnchor();return typeof e>"u"?void 0:this.element(e)}setFocus(e,t){for(const i of e)if(i<0||i>=this.length)throw new Sg(this.user,`Invalid index ${i}`);this.focus.set(e,t)}focusNext(e=1,t=!1,i,s){if(this.length===0)return;const o=this.focus.get(),r=this.findNextIndex(o.length>0?o[0]+e:0,t,s);r>-1&&this.setFocus([r],i)}focusPrevious(e=1,t=!1,i,s){if(this.length===0)return;const o=this.focus.get(),r=this.findPreviousIndex(o.length>0?o[0]-e:0,t,s);r>-1&&this.setFocus([r],i)}focusNextPage(e,t){return Q6(this,void 0,void 0,function*(){let i=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);i=i===0?0:i-1;const s=this.getFocus()[0];if(s!==i&&(s===void 0||i>s)){const o=this.findPreviousIndex(i,!1,t);o>-1&&s!==o?this.setFocus([o],e):this.setFocus([i],e)}else{const o=this.view.getScrollTop();let r=o+this.view.renderHeight;i>s&&(r-=this.view.elementHeight(i)),this.view.setScrollTop(r),this.view.getScrollTop()!==o&&(this.setFocus([]),yield Gb(0),yield this.focusNextPage(e,t))}})}focusPreviousPage(e,t){return Q6(this,void 0,void 0,function*(){let i;const s=this.view.getScrollTop();s===0?i=this.view.indexAt(s):i=this.view.indexAfter(s-1);const o=this.getFocus()[0];if(o!==i&&(o===void 0||o>=i)){const r=this.findNextIndex(i,!1,t);r>-1&&o!==r?this.setFocus([r],e):this.setFocus([i],e)}else{const r=s;this.view.setScrollTop(s-this.view.renderHeight),this.view.getScrollTop()!==r&&(this.setFocus([]),yield Gb(0),yield this.focusPreviousPage(e,t))}})}focusLast(e,t){if(this.length===0)return;const i=this.findPreviousIndex(this.length-1,!1,t);i>-1&&this.setFocus([i],e)}focusFirst(e,t){this.focusNth(0,e,t)}focusNth(e,t,i){if(this.length===0)return;const s=this.findNextIndex(e,!1,i);s>-1&&this.setFocus([s],t)}findNextIndex(e,t=!1,i){for(let s=0;s=this.length&&!t)return-1;if(e=e%this.length,!i||i(this.element(e)))return e;e++}return-1}findPreviousIndex(e,t=!1,i){for(let s=0;sthis.view.element(e))}reveal(e,t){if(e<0||e>=this.length)throw new Sg(this.user,`Invalid index ${e}`);const i=this.view.getScrollTop(),s=this.view.elementTop(e),o=this.view.elementHeight(e);if(Jd(t)){const r=o-this.view.renderHeight;this.view.setScrollTop(r*uo(t,0,1)+s)}else{const r=s+o,a=i+this.view.renderHeight;s=a||(s=a&&o>=this.view.renderHeight?this.view.setScrollTop(s):r>=a&&this.view.setScrollTop(r-this.view.renderHeight))}}getHTMLElement(){return this.view.domNode}getElementID(e){return this.view.getElementDomId(e)}style(e){this.styleController.style(e)}toListEvent({indexes:e,browserEvent:t}){return{indexes:e,elements:e.map(i=>this.view.element(i)),browserEvent:t}}_onFocusChange(){const e=this.focus.get();this.view.domNode.classList.toggle("element-focused",e.length>0),this.onDidChangeActiveDescendant()}onDidChangeActiveDescendant(){var e;const t=this.focus.get();if(t.length>0){let i;!((e=this.accessibilityProvider)===null||e===void 0)&&e.getActiveDescendantId&&(i=this.accessibilityProvider.getActiveDescendantId(this.view.element(t[0]))),this.view.domNode.setAttribute("aria-activedescendant",i||this.view.getElementDomId(t[0]))}else this.view.domNode.removeAttribute("aria-activedescendant")}_onSelectionChange(){const e=this.selection.get();this.view.domNode.classList.toggle("selection-none",e.length===0),this.view.domNode.classList.toggle("selection-single",e.length===1),this.view.domNode.classList.toggle("selection-multiple",e.length>1)}dispose(){this._onDidDispose.fire(),this.disposables.dispose(),this._onDidDispose.dispose()}}eg([Di],ha.prototype,"onDidChangeFocus",null);eg([Di],ha.prototype,"onDidChangeSelection",null);eg([Di],ha.prototype,"onContextMenu",null);eg([Di],ha.prototype,"onKeyDown",null);eg([Di],ha.prototype,"onDidFocus",null);const Ih=ye,MG="selectOption.entry.template";class Ike{get templateId(){return MG}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=le(e,Ih(".option-text")),t.detail=le(e,Ih(".option-detail")),t.decoratorRight=le(e,Ih(".option-decorator-right")),t}renderElement(e,t,i){const s=i,o=e.text,r=e.detail,a=e.decoratorRight,l=e.isDisabled;s.text.textContent=o,s.detail.textContent=r||"",s.decoratorRight.innerText=a||"",l?s.root.classList.add("option-disabled"):s.root.classList.remove("option-disabled")}disposeTemplate(e){}}class Ma extends Y{constructor(e,t,i,s,o){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=s,this.selectBoxOptions=o||Object.create(null),typeof this.selectBoxOptions.minBottomMargin!="number"?this.selectBoxOptions.minBottomMargin=Ma.DEFAULT_DROPDOWN_MINIMUM_BOTTOM_MARGIN:this.selectBoxOptions.minBottomMargin<0&&(this.selectBoxOptions.minBottomMargin=0),this.selectElement=document.createElement("select"),this.selectElement.className="monaco-select-box monaco-select-box-dropdown-padding",typeof this.selectBoxOptions.ariaLabel=="string"&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),typeof this.selectBoxOptions.ariaDescription=="string"&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._onDidSelect=new B,this._register(this._onDidSelect),this.registerListeners(),this.constructSelectDropDown(i),this.selected=t||0,e&&this.setOptions(e,t),this.initStyleSheet()}getHeight(){return 22}getTemplateId(){return MG}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=ye(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=le(this.selectDropDownContainer,Ih(".select-box-details-pane"));const t=le(this.selectDropDownContainer,Ih(".select-box-dropdown-container-width-control")),i=le(t,Ih(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",le(i,this.widthControlElement),this._dropDownPosition=0,this.styleElement=Dr(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(K(this.selectDropDownContainer,de.DRAG_START,s=>{$e.stop(s,!0)}))}registerListeners(){this._register(Ui(this.selectElement,"change",t=>{this.selected=t.target.selectedIndex,this._onDidSelect.fire({index:t.target.selectedIndex,selected:t.target.value}),this.options[this.selected]&&this.options[this.selected].text&&(this.selectElement.title=this.options[this.selected].text)})),this._register(K(this.selectElement,de.CLICK,t=>{$e.stop(t),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(K(this.selectElement,de.MOUSE_DOWN,t=>{$e.stop(t)}));let e;this._register(K(this.selectElement,"touchstart",t=>{e=this._isVisible})),this._register(K(this.selectElement,"touchend",t=>{$e.stop(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()})),this._register(K(this.selectElement,de.KEY_DOWN,t=>{const i=new zt(t);let s=!1;pt?(i.keyCode===18||i.keyCode===16||i.keyCode===10||i.keyCode===3)&&(s=!0):(i.keyCode===18&&i.altKey||i.keyCode===16&&i.altKey||i.keyCode===10||i.keyCode===3)&&(s=!0),s&&(this.showSelectDropDown(),$e.stop(t,!0))}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){Yi(this.options,e)||(this.options=e,this.selectElement.options.length=0,this._hasDetails=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach((i,s)=>{this.selectElement.add(this.createOption(i.text,s,i.isDisabled)),typeof i.description=="string"&&(this._hasDetails=!0)})),t!==void 0&&(this.select(t),this._currentSelection=this.selected)}setOptionsList(){var e;(e=this.selectList)===null||e===void 0||e.splice(0,this.selectList.length,this.options)}select(e){e>=0&&ethis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.options[this.selected]&&this.options[this.selected].text&&(this.selectElement.title=this.options[this.selected].text)}focus(){this.selectElement&&(this.selectElement.tabIndex=0,this.selectElement.focus())}blur(){this.selectElement&&(this.selectElement.tabIndex=-1,this.selectElement.blur())}setFocusable(e){this.selectElement.tabIndex=e?0:-1}render(e){this.container=e,e.classList.add("select-container"),e.appendChild(this.selectElement),this.styleSelectElement()}initStyleSheet(){const e=[];this.styles.listFocusBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { background-color: ${this.styles.listFocusBackground} !important; }`),this.styles.listFocusForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { color: ${this.styles.listFocusForeground} !important; }`),this.styles.decoratorRightForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.focused) .option-decorator-right { color: ${this.styles.decoratorRightForeground}; }`),this.styles.selectBackground&&this.styles.selectBorder&&this.styles.selectBorder!==this.styles.selectBackground?(e.push(`.monaco-select-box-dropdown-container { border: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectBorder} } `)):this.styles.selectListBorder&&(e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-top { border-top: 1px solid ${this.styles.selectListBorder} } `),e.push(`.monaco-select-box-dropdown-container > .select-box-details-pane.border-bottom { border-bottom: 1px solid ${this.styles.selectListBorder} } `)),this.styles.listHoverForeground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { color: ${this.styles.listHoverForeground} !important; }`),this.styles.listHoverBackground&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { background-color: ${this.styles.listHoverBackground} !important; }`),this.styles.listFocusOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.focused { outline: 1.6px dotted ${this.styles.listFocusOutline} !important; outline-offset: -1.6px !important; }`),this.styles.listHoverOutline&&e.push(`.monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row:not(.option-disabled):not(.focused):hover { outline: 1.6px dashed ${this.styles.listHoverOutline} !important; outline-offset: -1.6px !important; }`),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled.focused { background-color: transparent !important; color: inherit !important; outline: none !important; }"),e.push(".monaco-select-box-dropdown-container > .select-box-dropdown-list-container .monaco-list .monaco-list-row.option-disabled:hover { background-color: transparent !important; color: inherit !important; outline: none !important; }"),this.styleElement.textContent=e.join(` +`)}styleSelectElement(){var e,t,i;const s=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",o=(t=this.styles.selectForeground)!==null&&t!==void 0?t:"",r=(i=this.styles.selectBorder)!==null&&i!==void 0?i:"";this.selectElement.style.backgroundColor=s,this.selectElement.style.color=o,this.selectElement.style.borderColor=r}styleList(){var e,t;const i=(e=this.styles.selectBackground)!==null&&e!==void 0?e:"",s=Qh(this.styles.selectListBackground,i);this.selectDropDownListContainer.style.backgroundColor=s,this.selectionDetailsPane.style.backgroundColor=s;const o=(t=this.styles.focusBorder)!==null&&t!==void 0?t:"";this.selectDropDownContainer.style.outlineColor=o,this.selectDropDownContainer.style.outlineOffset="-1px",this.selectList.style(this.styles)}createOption(e,t,i){const s=document.createElement("option");return s.value=e,s.text=e,s.disabled=!!i,s}showSelectDropDown(){this.selectionDetailsPane.innerText="",!(!this.contextViewProvider||this._isVisible)&&(this.createSelectList(this.selectDropDownContainer),this.setOptionsList(),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e,!0),layout:()=>{this.layoutSelectDropDown()},onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._isVisible=!0,this.hideSelectDropDown(!1),this.contextViewProvider.showContextView({getAnchor:()=>this.selectElement,render:e=>this.renderSelectDropDown(e),layout:()=>this.layoutSelectDropDown(),onHide:()=>{this.selectDropDownContainer.classList.remove("visible"),this.selectElement.classList.remove("synthetic-focus")},anchorPosition:this._dropDownPosition},this.selectBoxOptions.optionsAsChildren?this.container:void 0),this._currentSelection=this.selected,this._isVisible=!0,this.selectElement.setAttribute("aria-expanded","true"))}hideSelectDropDown(e){!this.contextViewProvider||!this._isVisible||(this._isVisible=!1,this.selectElement.setAttribute("aria-expanded","false"),e&&this.selectElement.focus(),this.contextViewProvider.hideContextView())}renderSelectDropDown(e,t){return e.appendChild(this.selectDropDownContainer),this.layoutSelectDropDown(t),{dispose:()=>{try{e.removeChild(this.selectDropDownContainer)}catch{}}}}measureMaxDetailsHeight(){let e=0;return this.options.forEach((t,i)=>{this.updateDetail(i),this.selectionDetailsPane.offsetHeight>e&&(e=this.selectionDetailsPane.offsetHeight)}),e}layoutSelectDropDown(e){if(this._skipLayout)return!1;if(this.selectList){this.selectDropDownContainer.classList.add("visible");const t=Tn(this.selectElement),i=getComputedStyle(this.selectElement),s=parseFloat(i.getPropertyValue("--dropdown-padding-top"))+parseFloat(i.getPropertyValue("--dropdown-padding-bottom")),o=window.innerHeight-t.top-t.height-(this.selectBoxOptions.minBottomMargin||0),r=t.top-Ma.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,a=this.selectElement.offsetWidth,l=this.setWidthControlElement(this.widthControlElement),c=Math.max(l,Math.round(a)).toString()+"px";this.selectDropDownContainer.style.width=c,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let d=this.selectList.contentHeight;this._hasDetails&&this._cachedMaxDetailsHeight===void 0&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());const u=this._hasDetails?this._cachedMaxDetailsHeight:0,h=d+s+u,f=Math.floor((o-s-u)/this.getHeight()),g=Math.floor((r-s-u)/this.getHeight());if(e)return t.top+t.height>window.innerHeight-22||t.topf&&this.options.length>f?(this._dropDownPosition=1,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selectionDetailsPane.classList.add("border-bottom")):(this._dropDownPosition=0,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectionDetailsPane.classList.remove("border-bottom"),this.selectionDetailsPane.classList.add("border-top")),!0);if(t.top+t.height>window.innerHeight-22||t.topo&&(d=f*this.getHeight())}else h>r&&(d=g*this.getHeight());return this.selectList.layout(d),this.selectList.domFocus(),this.selectList.length>0&&(this.selectList.setFocus([this.selected||0]),this.selectList.reveal(this.selectList.getFocus()[0]||0)),this._hasDetails?(this.selectList.getHTMLElement().style.height=d+s+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=d+s+"px",this.updateDetail(this.selected),this.selectDropDownContainer.style.width=c,this.selectDropDownListContainer.setAttribute("tabindex","0"),this.selectElement.classList.add("synthetic-focus"),this.selectDropDownContainer.classList.add("synthetic-focus"),!0}else return!1}setWidthControlElement(e){let t=0;if(e){let i=0,s=0;this.options.forEach((o,r)=>{const a=o.detail?o.detail.length:0,l=o.decoratorRight?o.decoratorRight.length:0,c=o.text.length+a+l;c>s&&(i=r,s=c)}),e.textContent=this.options[i].text+(this.options[i].decoratorRight?this.options[i].decoratorRight+" ":""),t=ys(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=le(e,Ih(".select-box-dropdown-list-container")),this.listRenderer=new Ike,this.selectList=new ha("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:3,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:s=>{let o=s.text;return s.detail&&(o+=`. ${s.detail}`),s.decoratorRight&&(o+=`. ${s.decoratorRight}`),s.description&&(o+=`. ${s.description}`),o},getWidgetAriaLabel:()=>m({key:"selectBox",comment:["Behave like native select dropdown element."]},"Select Box"),getRole:()=>pt?"":"option",getWidgetRole:()=>"listbox"}}),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new ot(this.selectDropDownListContainer,"keydown")),i=ue.chain(t.event,s=>s.filter(()=>this.selectList.length>0).map(o=>new zt(o)));this._register(ue.chain(i,s=>s.filter(o=>o.keyCode===3))(this.onEnter,this)),this._register(ue.chain(i,s=>s.filter(o=>o.keyCode===2))(this.onEnter,this)),this._register(ue.chain(i,s=>s.filter(o=>o.keyCode===9))(this.onEscape,this)),this._register(ue.chain(i,s=>s.filter(o=>o.keyCode===16))(this.onUpArrow,this)),this._register(ue.chain(i,s=>s.filter(o=>o.keyCode===18))(this.onDownArrow,this)),this._register(ue.chain(i,s=>s.filter(o=>o.keyCode===12))(this.onPageDown,this)),this._register(ue.chain(i,s=>s.filter(o=>o.keyCode===11))(this.onPageUp,this)),this._register(ue.chain(i,s=>s.filter(o=>o.keyCode===14))(this.onHome,this)),this._register(ue.chain(i,s=>s.filter(o=>o.keyCode===13))(this.onEnd,this)),this._register(ue.chain(i,s=>s.filter(o=>o.keyCode>=21&&o.keyCode<=56||o.keyCode>=85&&o.keyCode<=113))(this.onCharacter,this)),this._register(K(this.selectList.getHTMLElement(),de.POINTER_UP,s=>this.onPointerUp(s))),this._register(this.selectList.onMouseOver(s=>typeof s.index<"u"&&this.selectList.setFocus([s.index]))),this._register(this.selectList.onDidChangeFocus(s=>this.onListFocus(s))),this._register(K(this.selectDropDownContainer,de.FOCUS_OUT,s=>{!this._isVisible||wn(s.relatedTarget,this.selectDropDownContainer)||this.onListBlur()})),this.selectList.getHTMLElement().setAttribute("aria-label",this.selectBoxOptions.ariaLabel||""),this.selectList.getHTMLElement().setAttribute("aria-expanded","true"),this.styleList()}onPointerUp(e){if(!this.selectList.length)return;$e.stop(e);const t=e.target;if(!t||t.classList.contains("slider"))return;const i=t.closest(".monaco-list-row");if(!i)return;const s=Number(i.getAttribute("data-index")),o=i.classList.contains("option-disabled");s>=0&&s{for(let r=0;rthis.selected+2)this.selected+=2;else{if(t)return;this.selected++}this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0])}}onUpArrow(e){this.selected>0&&($e.stop(e,!0),this.options[this.selected-1].isDisabled&&this.selected>1?this.selected-=2:this.selected--,this.select(this.selected),this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selectList.getFocus()[0]))}onPageUp(e){$e.stop(e),this.selectList.focusPreviousPage(),setTimeout(()=>{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected{this.selected=this.selectList.getFocus()[0],this.options[this.selected].isDisabled&&this.selected>0&&(this.selected--,this.selectList.setFocus([this.selected])),this.selectList.reveal(this.selected),this.select(this.selected)},1)}onHome(e){$e.stop(e),!(this.options.length<2)&&(this.selected=0,this.options[this.selected].isDisabled&&this.selected>1&&this.selected++,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onEnd(e){$e.stop(e),!(this.options.length<2)&&(this.selected=this.options.length-1,this.options[this.selected].isDisabled&&this.selected>1&&this.selected--,this.selectList.setFocus([this.selected]),this.selectList.reveal(this.selected),this.select(this.selected))}onCharacter(e){const t=zl.toString(e.keyCode);let i=-1;for(let s=0;s{this._register(K(this.selectElement,e,t=>{this.selectElement.focus()}))}),this._register(Ui(this.selectElement,"click",e=>{$e.stop(e,!0)})),this._register(Ui(this.selectElement,"change",e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})})),this._register(Ui(this.selectElement,"keydown",e=>{let t=!1;pt?(e.keyCode===18||e.keyCode===16||e.keyCode===10)&&(t=!0):(e.keyCode===18&&e.altKey||e.keyCode===10||e.keyCode===3)&&(t=!0),t&&e.stopPropagation()}))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){(!this.options||!Yi(this.options,e))&&(this.options=e,this.selectElement.options.length=0,this.options.forEach((i,s)=>{this.selectElement.add(this.createOption(i.text,s,i.isDisabled))})),t!==void 0&&this.select(t)}select(e){this.options.length===0?this.selected=0:e>=0&&ethis.options.length-1?this.select(this.options.length-1):this.selected<0&&(this.selected=0),this.selectElement.selectedIndex=this.selected,this.selected{this.element&&this.handleActionChangeEvent(s)}))}handleActionChangeEvent(e){e.enabled!==void 0&&this.updateEnabled(),e.checked!==void 0&&this.updateChecked(),e.class!==void 0&&this.updateClass(),e.label!==void 0&&(this.updateLabel(),this.updateTooltip()),e.tooltip!==void 0&&this.updateTooltip()}get actionRunner(){return this._actionRunner||(this._actionRunner=this._register(new ym)),this._actionRunner}set actionRunner(e){this._actionRunner=e}isEnabled(){return this._action.enabled}setActionContext(e){this._context=e}render(e){const t=this.element=e;this._register(Rt.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,xr&&this._register(K(e,de.DRAG_START,s=>{var o;return(o=s.dataTransfer)===null||o===void 0?void 0:o.setData(gG.TEXT,this._action.label)}))),this._register(K(t,Pt.Tap,s=>this.onClick(s,!0))),this._register(K(t,de.MOUSE_DOWN,s=>{i||$e.stop(s,!0),this._action.enabled&&s.button===0&&t.classList.add("active")})),pt&&this._register(K(t,de.CONTEXT_MENU,s=>{s.button===0&&s.ctrlKey===!0&&this.onClick(s)})),this._register(K(t,de.CLICK,s=>{$e.stop(s,!0),this.options&&this.options.isMenu||this.onClick(s)})),this._register(K(t,de.DBLCLICK,s=>{$e.stop(s,!0)})),[de.MOUSE_UP,de.MOUSE_OUT].forEach(s=>{this._register(K(t,s,o=>{$e.stop(o),t.classList.remove("active")}))})}onClick(e,t=!1){var i;$e.stop(e,!0);const s=po(this._context)?!((i=this.options)===null||i===void 0)&&i.useEventAsContext?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,s)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add("focused"))}blur(){this.element&&(this.element.blur(),this.element.tabIndex=-1,this.element.classList.remove("focused"))}setFocusable(e){this.element&&(this.element.tabIndex=e?0:-1)}get trapsArrowNavigation(){return!1}updateEnabled(){}updateLabel(){}getTooltip(){return this.action.tooltip}updateTooltip(){var e;if(!this.element)return;const t=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.updateAriaLabel(),this.options.hoverDelegate?(this.element.title="",this.customHover?this.customHover.update(t):(this.customHover=DG(this.options.hoverDelegate,this.element,t),this._store.add(this.customHover))):this.element.title=t}updateAriaLabel(){var e;if(this.element){const t=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.element.setAttribute("aria-label",t)}}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),this._context=void 0,super.dispose()}}class LD extends Yr{constructor(e,t,i){super(e,t,i),this.options=i,this.options.icon=i.icon!==void 0?i.icon:!1,this.options.label=i.label!==void 0?i.label:!0,this.cssClass=""}render(e){super.render(e),this.element&&(this.label=le(this.element,ye("a.action-label"))),this.label&&this.label.setAttribute("role",this.getDefaultAriaRole()),this.options.label&&this.options.keybinding&&this.element&&(le(this.element,ye("span.keybinding")).textContent=this.options.keybinding),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===Rn.ID?"presentation":this.options.isMenu?"menuitem":"button"}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}blur(){this.label&&(this.label.tabIndex=-1)}setFocusable(e){this.label&&(this.label.tabIndex=e?0:-1)}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this.action.label)}getTooltip(){let e=null;return this.action.tooltip?e=this.action.tooltip:!this.options.label&&this.action.label&&this.options.icon&&(e=this.action.label,this.options.keybinding&&(e=m({key:"titleLabel",comment:["action title","action keybinding"]},"{0} ({1})",e,this.options.keybinding))),e??void 0}updateClass(){var e;this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.action.class,this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):(e=this.label)===null||e===void 0||e.classList.remove("codicon")}updateEnabled(){var e,t;this.action.enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),(e=this.element)===null||e===void 0||e.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),(t=this.element)===null||t===void 0||t.classList.add("disabled"))}updateAriaLabel(){var e;if(this.label){const t=(e=this.getTooltip())!==null&&e!==void 0?e:"";this.label.setAttribute("aria-label",t)}}updateChecked(){this.label&&(this.action.checked!==void 0?(this.label.classList.toggle("checked",this.action.checked),this.label.setAttribute("aria-checked",this.action.checked?"true":"false"),this.label.setAttribute("role","checkbox")):(this.label.classList.remove("checked"),this.label.setAttribute("aria-checked",""),this.label.setAttribute("role",this.getDefaultAriaRole())))}}class Rke extends Yr{constructor(e,t,i,s,o,r,a){super(e,t),this.selectBox=new Nke(i,s,o,r,a),this.selectBox.setFocusable(!1),this._register(this.selectBox),this.registerListeners()}select(e){this.selectBox.select(e)}registerListeners(){this._register(this.selectBox.onDidSelect(e=>this.runAction(e.selected,e.index)))}runAction(e,t){this.actionRunner.run(this._action,this.getActionContext(e,t))}getActionContext(e,t){return e}setFocusable(e){this.selectBox.setFocusable(e)}focus(){var e;(e=this.selectBox)===null||e===void 0||e.focus()}blur(){var e;(e=this.selectBox)===null||e===void 0||e.blur()}render(e){this.selectBox.render(e)}}class Mke extends ym{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new B),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=le(e,ye(".monaco-dropdown")),this._label=le(this._element,ye(".dropdown-label"));let i=t.labelRenderer;i||(i=o=>(o.textContent=t.label||"",null));for(const o of[de.CLICK,de.MOUSE_DOWN,Pt.Tap])this._register(K(this.element,o,r=>$e.stop(r,!0)));for(const o of[de.MOUSE_DOWN,Pt.Tap])this._register(K(this._label,o,r=>{r instanceof MouseEvent&&(r.detail>1||r.button!==0)||(this.visible?this.hide():this.show())}));this._register(K(this._label,de.KEY_UP,o=>{const r=new zt(o);(r.equals(3)||r.equals(10))&&($e.stop(o,!0),this.visible?this.hide():this.show())}));const s=i(this._label);s&&this._register(s),this._register(Rt.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 Pke extends Mke{constructor(e,t){super(e,t),this._options=t,this._actions=[],this.actions=t.actions||[]}set menuOptions(e){this._menuOptions=e}get menuOptions(){return this._menuOptions}get actions(){return this._options.actionProvider?this._options.actionProvider.getActions():this._actions}set actions(e){this._actions=e}show(){super.show(),this.element.classList.add("active"),this._options.contextMenuProvider.showContextMenu({getAnchor:()=>this.element,getActions:()=>this.actions,getActionsContext:()=>this.menuOptions?this.menuOptions.context:null,getActionViewItem:(e,t)=>this.menuOptions&&this.menuOptions.actionViewItemProvider?this.menuOptions.actionViewItemProvider(e,t):void 0,getKeyBinding:e=>this.menuOptions&&this.menuOptions.getKeyBinding?this.menuOptions.getKeyBinding(e):void 0,getMenuClassName:()=>this._options.menuClassName||"",onHide:()=>this.onHide(),actionRunner:this.menuOptions?this.menuOptions.actionRunner:void 0,anchorAlignment:this.menuOptions?this.menuOptions.anchorAlignment:0,domForShadowRoot:this._options.menuAsChild?this.element:void 0,skipTelemetry:this._options.skipTelemetry})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}}class cx extends Yr{constructor(e,t,i,s=Object.create(null)){super(null,e,s),this.actionItem=null,this._onDidChangeVisibility=this._register(new B),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this.menuActionsOrProvider=t,this.contextMenuProvider=i,this.options=s,this.options.actionRunner&&(this.actionRunner=this.options.actionRunner)}render(e){this.actionItem=e;const t=o=>{this.element=le(o,ye("a.action-label"));let r=[];return typeof this.options.classNames=="string"?r=this.options.classNames.split(/\s+/g).filter(a=>!!a):this.options.classNames&&(r=this.options.classNames),r.find(a=>a==="icon")||r.push("codicon"),this.element.classList.add(...r),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),s={contextMenuProvider:this.contextMenuProvider,labelRenderer:t,menuAsChild:this.options.menuAsChild,actions:i?this.menuActionsOrProvider:void 0,actionProvider:i?void 0:this.menuActionsOrProvider,skipTelemetry:this.options.skipTelemetry};if(this.dropdownMenu=this._register(new Pke(e,s)),this._register(this.dropdownMenu.onDidChangeVisibility(o=>{var r;(r=this.element)===null||r===void 0||r.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.action.tooltip?e=this.action.tooltip:this.action.label&&(e=this.action.label),e??void 0}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}show(){var e;(e=this.dropdownMenu)===null||e===void 0||e.show()}updateEnabled(){var e,t;const i=!this.action.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)}}function Oke(n){return n?n.condition!==void 0:!1}var S_=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},Ip;(function(n){n[n.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",n[n.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"})(Ip||(Ip={}));var sp;(function(n){n[n.None=0]="None",n[n.Initialized=1]="Initialized",n[n.Closed=2]="Closed"})(sp||(sp={}));class Tp extends Y{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new Bb),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=sp.None,this.cache=new Map,this.flushDelayer=this._register(new uj(Tp.DEFAULT_FLUSH_DELAY)),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal(e=>this.onDidChangeItemsExternal(e)))}onDidChangeItemsExternal(e){var t,i;this._onDidChangeStorage.pause();try{(t=e.changed)===null||t===void 0||t.forEach((s,o)=>this.acceptExternal(o,s)),(i=e.deleted)===null||i===void 0||i.forEach(s=>this.acceptExternal(s,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===sp.Closed)return;let i=!1;po(t)?i=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),i=!0),i&&this._onDidChangeStorage.fire({key:e,external:!0})}get(e,t){const i=this.cache.get(e);return po(i)?t:i}getBoolean(e,t){const i=this.get(e);return po(i)?t:i==="true"}getNumber(e,t){const i=this.get(e);return po(i)?t:parseInt(i,10)}set(e,t,i=!1){return S_(this,void 0,void 0,function*(){if(this.state===sp.Closed)return;if(po(t))return this.delete(e,i);const s=Ls(t)||Array.isArray(t)?$De(t):String(t);if(this.cache.get(e)!==s)return this.cache.set(e,s),this.pendingInserts.set(e,s),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:i}),this.doFlush()})}delete(e,t=!1){return S_(this,void 0,void 0,function*(){if(!(this.state===sp.Closed||!this.cache.delete(e)))return this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire({key:e,external:t}),this.doFlush()})}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}flushPending(){return S_(this,void 0,void 0,function*(){if(!this.hasPending)return;const e={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(e).finally(()=>{var t;if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)(t=this.whenFlushedCallbacks.pop())===null||t===void 0||t()})})}doFlush(e){return S_(this,void 0,void 0,function*(){return this.options.hint===Ip.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)})}}Tp.DEFAULT_FLUSH_DELAY=100;class tE{constructor(){this.onDidChangeItemsExternal=ue.None,this.items=new Map}updateItems(e){var t,i;return S_(this,void 0,void 0,function*(){(t=e.insert)===null||t===void 0||t.forEach((s,o)=>this.items.set(o,s)),(i=e.delete)===null||i===void 0||i.forEach(s=>this.items.delete(s))})}}const SC="__$__targetStorageMarker",tg=rt("storageService");var t8;(function(n){n[n.NONE=0]="NONE",n[n.SHUTDOWN=1]="SHUTDOWN"})(t8||(t8={}));function Fke(n){const e=n.get(SC);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}class DD extends Y{constructor(e={flushInterval:DD.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new Bb),this._onDidChangeTarget=this._register(new Bb),this._onWillSaveState=this._register(new B),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0}onDidChangeValue(e,t,i){return ue.filter(this._onDidChangeValue.event,s=>s.scope===e&&(t===void 0||s.key===t),i)}emitDidChangeValue(e,t){const{key:i,external:s}=t;if(i===SC){switch(e){case-1:this._applicationKeyTargets=void 0;break;case 0:this._profileKeyTargets=void 0;break;case 1:this._workspaceKeyTargets=void 0;break}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:i,target:this.getKeyTargets(e)[i],external:s})}get(e,t,i){var s;return(s=this.getStorage(t))===null||s===void 0?void 0:s.get(e,i)}getBoolean(e,t,i){var s;return(s=this.getStorage(t))===null||s===void 0?void 0:s.getBoolean(e,i)}getNumber(e,t,i){var s;return(s=this.getStorage(t))===null||s===void 0?void 0:s.getNumber(e,i)}store(e,t,i,s,o=!1){if(po(t)){this.remove(e,i,o);return}this.withPausedEmitters(()=>{var r;this.updateKeyTarget(e,i,s),(r=this.getStorage(i))===null||r===void 0||r.set(e,t,o)})}remove(e,t,i=!1){this.withPausedEmitters(()=>{var s;this.updateKeyTarget(e,t,void 0),(s=this.getStorage(t))===null||s===void 0||s.delete(e,i)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,i,s=!1){var o,r;const a=this.getKeyTargets(t);typeof i=="number"?a[e]!==i&&(a[e]=i,(o=this.getStorage(t))===null||o===void 0||o.set(SC,JSON.stringify(a),s)):typeof a[e]=="number"&&(delete a[e],(r=this.getStorage(t))===null||r===void 0||r.set(SC,JSON.stringify(a),s))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(0)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(-1)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case-1:return this.applicationKeyTargets;case 0:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){const t=this.getStorage(e);return t?Fke(t):Object.create(null)}}DD.DEFAULT_FLUSH_INTERVAL=60*1e3;class Bke extends DD{constructor(){super(),this.applicationStorage=this._register(new Tp(new tE,{hint:Ip.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new Tp(new tE,{hint:Ip.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new Tp(new tE,{hint:Ip.STORAGE_IN_MEMORY})),this._register(this.workspaceStorage.onDidChangeStorage(e=>this.emitDidChangeValue(1,e))),this._register(this.profileStorage.onDidChangeStorage(e=>this.emitDidChangeValue(0,e))),this._register(this.applicationStorage.onDidChangeStorage(e=>this.emitDidChangeValue(-1,e)))}getStorage(e){switch(e){case-1:return this.applicationStorage;case 0:return this.profileStorage;default:return this.workspaceStorage}}}function Wke(n,e){const t=Object.assign({},e);for(const i in n){const s=n[i];t[i]=s!==void 0?re(s):void 0}return t}const Vke={keybindingLabelBackground:re(Lve),keybindingLabelForeground:re(Dve),keybindingLabelBorder:re(kve),keybindingLabelBottomBorder:re(Eve),keybindingLabelShadow:re(Jl)},zke={buttonForeground:re(d_),buttonSeparator:re(uve),buttonBackground:re(u_),buttonHoverBackground:re(hve),buttonSecondaryForeground:re(gve),buttonSecondaryBackground:re(LT),buttonSecondaryHoverBackground:re(pve),buttonBorder:re(fve)},Hke={progressBarBackground:re(bve)},dx={inputActiveOptionBorder:re(h3),inputActiveOptionForeground:re(f3),inputActiveOptionBackground:re(kh)};re(i1e),re(s1e),re(n1e);re(Hi),re(za),re(Jl),re(Qe),re(y1e),re(w1e),re(C1e),re(Xbe);const ux={inputBackground:re(Qbe),inputForeground:re(Jbe),inputBorder:re(eve),inputValidationInfoBorder:re(nve),inputValidationInfoBackground:re(tve),inputValidationInfoForeground:re(ive),inputValidationWarningBorder:re(rve),inputValidationWarningBackground:re(sve),inputValidationWarningForeground:re(ove),inputValidationErrorBorder:re(cve),inputValidationErrorBackground:re(ave),inputValidationErrorForeground:re(lve)},$ke={listFilterWidgetBackground:re(Yve),listFilterWidgetOutline:re(Zve),listFilterWidgetNoMatchesOutline:re(Xve),listFilterWidgetShadow:re(Qve),inputBoxStyles:ux,toggleStyles:dx},PG={badgeBackground:re(gC),badgeForeground:re(mve),badgeBorder:re(Qe)};re(f1e),re(h1e),re(a7),re(a7),re(g1e);const ig={listBackground:void 0,listInactiveFocusForeground:void 0,listFocusBackground:re(Wve),listFocusForeground:re(Vve),listFocusOutline:re(zve),listActiveSelectionBackground:re(tc),listActiveSelectionForeground:re($a),listActiveSelectionIconForeground:re(p_),listFocusAndSelectionOutline:re(Hve),listFocusAndSelectionBackground:re(tc),listFocusAndSelectionForeground:re($a),listInactiveSelectionBackground:re($ve),listInactiveSelectionIconForeground:re(jve),listInactiveSelectionForeground:re(Uve),listInactiveFocusBackground:re(qve),listInactiveFocusOutline:re(Gve),listHoverBackground:re(Kj),listHoverForeground:re(Yj),listDropBackground:re(Kve),listSelectionOutline:re(qt),listHoverOutline:re(qt),treeIndentGuidesStroke:re(m_),treeInactiveIndentGuidesStroke:re(Jve),tableColumnsBorder:re(e1e),tableOddRowsBackgroundColor:re(t1e)};function ay(n){return Wke(n,ig)}const Uke={selectBackground:re(Wa),selectListBackground:re(dve),selectForeground:re(ec),decoratorRightForeground:re(qj),selectBorder:re(jg),focusBorder:re(vo),listFocusBackground:re(AT),listInactiveSelectionIconForeground:re(Zj),listFocusForeground:re(ET),listFocusOutline:Kbe(qt,H.transparent.toString()),listHoverBackground:re(Kj),listHoverForeground:re(Yj),listHoverOutline:re(qt),selectListBorder:re(qg),listBackground:void 0,listActiveSelectionBackground:void 0,listActiveSelectionForeground:void 0,listActiveSelectionIconForeground:void 0,listFocusAndSelectionBackground:void 0,listDropBackground:void 0,listInactiveSelectionBackground:void 0,listInactiveSelectionForeground:void 0,listInactiveFocusBackground:void 0,listInactiveFocusOutline:void 0,listSelectionOutline:void 0,listFocusAndSelectionForeground:void 0,listFocusAndSelectionOutline:void 0,listInactiveFocusForeground:void 0,tableColumnsBorder:void 0,tableOddRowsBackgroundColor:void 0,treeIndentGuidesStroke:void 0,treeInactiveIndentGuidesStroke:void 0},jke={shadowColor:re(Jl),borderColor:re(o1e),foregroundColor:re(r1e),backgroundColor:re(a1e),selectionForegroundColor:re(l1e),selectionBackgroundColor:re(c1e),selectionBorderColor:re(d1e),separatorColor:re(u1e),scrollbarShadow:re(_ve),scrollbarSliderBackground:re(h_),scrollbarSliderHoverBackground:re(f_),scrollbarSliderActiveBackground:re(g_)};var kD=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Ss=function(n,e){return function(t,i){e(t,i,n)}},OG=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function qke(n,e,t,i){const s=n.getActions(e),o=dd.getInstance(),r=o.keyStatus.altKey||(Ps||Xn)&&o.keyStatus.shiftKey;BG(s,t,r,a=>a==="navigation")}function FG(n,e,t,i,s,o){const r=n.getActions(e);BG(r,t,!1,typeof i=="string"?l=>l===i:i,s,o)}function BG(n,e,t,i=r=>r==="navigation",s=()=>!1,o=!1){let r,a;Array.isArray(e)?(r=e,a=e):(r=e.primary,a=e.secondary);const l=new Set;for(const[c,d]of n){let u;i(c)?(u=r,u.length>0&&o&&u.push(new Rn)):(u=a,u.length>0&&u.push(new Rn));for(let h of d){t&&(h=h instanceof il&&h.alt?h.alt:h);const f=u.push(h);h instanceof WL&&l.add({group:c,action:h,index:f-1})}}for(const{group:c,action:d,index:u}of l){const h=i(c)?r:a,f=d.actions;s(d,c,h.length)&&h.splice(u,1,...f)}}let Bm=class extends LD{constructor(e,t,i,s,o,r,a,l){super(void 0,e,{icon:!!(e.class||e.item.icon),label:!e.class&&!e.item.icon,draggable:t==null?void 0:t.draggable,keybinding:t==null?void 0:t.keybinding,hoverDelegate:t==null?void 0:t.hoverDelegate}),this._keybindingService=i,this._notificationService=s,this._contextKeyService=o,this._themeService=r,this._contextMenuService=a,this._accessibilityService=l,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new sa),this._altKey=dd.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}onClick(e){return OG(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){if(super.render(e),e.classList.add("menu-entry"),this.options.icon&&this._updateItemClass(this._menuItemAction.item),this._menuItemAction.alt){let t=!1;const i=()=>{var s;const o=!!(!((s=this._menuItemAction.alt)===null||s===void 0)&&s.enabled)&&(!this._accessibilityService.isMotionReduced()||t)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&t);o!==this._wantsAltCommand&&(this._wantsAltCommand=o,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(i)),this._register(K(e,"mouseleave",s=>{t=!1,i()})),this._register(K(e,"mouseenter",s=>{t=!0,i()})),i()}}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(),s=this._commandAction.tooltip||this._commandAction.label;let o=i?m("titleAndKb","{0} ({1})",s,i):s;if(!this._wantsAltCommand&&(!((e=this._menuItemAction.alt)===null||e===void 0)&&e.enabled)){const r=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,a=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),l=a&&a.getLabel(),c=l?m("titleAndKb","{0} ({1})",r,l):r;o=m("titleAndKbAndAlt",`{0} +[{1}] {2}`,o,j3.modifierLabels[bo].altKey,c)}return o}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){this._itemClassDispose.value=void 0;const{element:t,label:i}=this;if(!t||!i)return;const s=this._commandAction.checked&&Oke(e.toggled)&&e.toggled.icon?e.toggled.icon:e.icon;if(s)if(Te.isThemeIcon(s)){const o=Te.asClassNameArray(s);i.classList.add(...o),this._itemClassDispose.value=Ye(()=>{i.classList.remove(...o)})}else{const o=fD(this._themeService.getColorTheme().type)?nu(s.dark):nu(s.light),r=ye("span");r.style.webkitMask=r.style.mask=`${o} no-repeat 50% 50%`,r.style.background="var(--vscode-icon-foreground)",r.style.display="inline-block",r.style.width="100%",r.style.height="100%",i.appendChild(r),i.classList.add("icon"),this._itemClassDispose.value=_r(Ye(()=>{i.classList.remove("icon"),ls(i)}),this._themeService.onDidColorThemeChange(()=>{this.updateClass()}))}}};Bm=kD([Ss(2,bi),Ss(3,xn),Ss(4,et),Ss(5,ro),Ss(6,Nu),Ss(7,Au)],Bm);let bN=class extends cx{constructor(e,t,i,s,o){var r,a,l;const c=Object.assign(Object.assign({},t),{menuAsChild:(r=t==null?void 0:t.menuAsChild)!==null&&r!==void 0?r:!1,classNames:(a=t==null?void 0:t.classNames)!==null&&a!==void 0?a:Te.isThemeIcon(e.item.icon)?Te.asClassName(e.item.icon):void 0,keybindingProvider:(l=t==null?void 0:t.keybindingProvider)!==null&&l!==void 0?l:d=>i.lookupKeybinding(d.id)});super(e,{getActions:()=>e.actions},s,c),this._keybindingService=i,this._contextMenuService=s,this._themeService=o}render(e){super.render(e),xs(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!Te.isThemeIcon(i)){this.element.classList.add("icon");const s=()=>{this.element&&(this.element.style.backgroundImage=fD(this._themeService.getColorTheme().type)?nu(i.dark):nu(i.light))};s(),this._register(this._themeService.onDidColorThemeChange(()=>{s()}))}}};bN=kD([Ss(2,bi),Ss(3,Nu),Ss(4,ro)],bN);let vN=class extends Yr{constructor(e,t,i,s,o,r,a,l){var c,d,u;super(null,e),this._keybindingService=i,this._notificationService=s,this._contextMenuService=o,this._menuService=r,this._instaService=a,this._storageService=l,this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;let h;const f=t!=null&&t.persistLastActionId?l.get(this._storageKey,1):void 0;f&&(h=e.actions.find(p=>f===p.id)),h||(h=e.actions[0]),this._defaultAction=this._instaService.createInstance(Bm,h,{keybinding:this._getDefaultActionKeybindingLabel(h)});const g=Object.assign(Object.assign({keybindingProvider:p=>this._keybindingService.lookupKeybinding(p.id)},t),{menuAsChild:(c=t==null?void 0:t.menuAsChild)!==null&&c!==void 0?c:!0,classNames:(d=t==null?void 0:t.classNames)!==null&&d!==void 0?d:["codicon","codicon-chevron-down"],actionRunner:(u=t==null?void 0:t.actionRunner)!==null&&u!==void 0?u:new ym});this._dropdown=new cx(e,e.actions,this._contextMenuService,g),this._dropdown.actionRunner.onDidRun(p=>{p.action instanceof il&&this.update(p.action)})}update(e){var t;!((t=this._options)===null||t===void 0)&&t.persistLastActionId&&this._storageService.store(this._storageKey,e.id,1,1),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(Bm,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends ym{runAction(i,s){return OG(this,void 0,void 0,function*(){yield i.run(void 0)})}},this._container&&this._defaultAction.render(ij(this._container,ye(".action-container")))}_getDefaultActionKeybindingLabel(e){var t;let i;if(!((t=this._options)===null||t===void 0)&&t.renderKeybindingWithDefaultActionLabel){const s=this._keybindingService.lookupKeybinding(e.id);s&&(i=`(${s.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=ye(".action-container");this._defaultAction.render(le(this._container,t)),this._register(K(t,de.KEY_DOWN,s=>{const o=new zt(s);o.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),o.stopPropagation())}));const i=ye(".dropdown-action-container");this._dropdown.render(le(this._container,i)),this._register(K(i,de.KEY_DOWN,s=>{var o;const r=new zt(s);r.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),(o=this._defaultAction.element)===null||o===void 0||o.focus(),r.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()}};vN=kD([Ss(2,bi),Ss(3,xn),Ss(4,Nu),Ss(5,Du),Ss(6,vt),Ss(7,tg)],vN);let yN=class extends Rke{constructor(e,t){super(null,e,e.actions.map(i=>({text:i.id===Rn.ID?"─────────":i.label,isDisabled:!i.enabled})),0,t,Uke,{ariaLabel:e.tooltip,optionsAsChildren:!0}),this.select(Math.max(0,e.actions.findIndex(i=>i.checked)))}render(e){super.render(e),e.style.borderColor=re(jg)}runAction(e,t){const i=this.action.actions[t];i&&this.actionRunner.run(i)}};yN=kD([Ss(1,Tu)],yN);function Gke(n,e,t){return e instanceof il?n.createInstance(Bm,e,t):e instanceof LS?e.item.isSelection?n.createInstance(yN,e):e.item.rememberDefaultAction?n.createInstance(vN,e,Object.assign(Object.assign({},t),{persistLastActionId:!0})):n.createInstance(bN,e,t):void 0}var Kke=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class al extends Y{constructor(e,t={}){var i,s,o,r,a,l;super(),this._actionRunnerDisposables=this._register(new pe),this.viewItemDisposables=this._register(new A4),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new B),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new B({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new B),this.onDidRun=this._onDidRun.event,this._onWillRun=this._register(new B),this.onWillRun=this._onWillRun.event,this.options=t,this._context=(i=t.context)!==null&&i!==void 0?i:null,this._orientation=(s=this.options.orientation)!==null&&s!==void 0?s:0,this._triggerKeys={keyDown:(r=(o=this.options.triggerKeys)===null||o===void 0?void 0:o.keyDown)!==null&&r!==void 0?r:!1,keys:(l=(a=this.options.triggerKeys)===null||a===void 0?void 0:a.keys)!==null&&l!==void 0?l:[3,10]},this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new ym,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(u=>this._onDidRun.fire(u))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(u=>this._onWillRun.fire(u))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar",t.animated!==!1&&this.domNode.classList.add("animated");let c,d;switch(this._orientation){case 0:c=[15],d=[17];break;case 1:c=[16],d=[18],this.domNode.className+=" vertical";break}this._register(K(this.domNode,de.KEY_DOWN,u=>{const h=new zt(u);let f=!0;const g=typeof this.focusedItem=="number"?this.viewItems[this.focusedItem]:void 0;c&&(h.equals(c[0])||h.equals(c[1]))?f=this.focusPrevious():d&&(h.equals(d[0])||h.equals(d[1]))?f=this.focusNext():h.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():h.equals(14)?f=this.focusFirst():h.equals(13)?f=this.focusLast():h.equals(2)&&g instanceof Yr&&g.trapsArrowNavigation?f=this.focusNext():this.isTriggerKeyEvent(h)?this._triggerKeys.keyDown?this.doTrigger(h):this.triggerKeyDown=!0:f=!1,f&&(h.preventDefault(),h.stopPropagation())})),this._register(K(this.domNode,de.KEY_UP,u=>{const h=new zt(u);this.isTriggerKeyEvent(h)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(h)),h.preventDefault(),h.stopPropagation()):(h.equals(2)||h.equals(1026))&&this.updateFocusedItem()})),this.focusTracker=this._register(iu(this.domNode)),this._register(this.focusTracker.onDidBlur(()=>{(ea()===this.domNode||!wn(ea(),this.domNode))&&(this._onDidBlur.fire(),this.previouslyFocusedItem=this.focusedItem,this.focusedItem=void 0,this.triggerKeyDown=!1)})),this._register(this.focusTracker.onDidFocus(()=>this.updateFocusedItem())),this.actionsList=document.createElement("ul"),this.actionsList.className="actions-container",this.options.highlightToggledItems&&this.actionsList.classList.add("highlight-toggled"),this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"),this.options.ariaLabel&&this.actionsList.setAttribute("aria-label",this.options.ariaLabel),this.domNode.appendChild(this.actionsList),e.appendChild(this.domNode)}refreshRole(){this.length()>=2?this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"):this.actionsList.setAttribute("role","presentation")}setFocusable(e){if(this.focusable=e,this.focusable){const t=this.viewItems.find(i=>i instanceof Yr&&i.isEnabled());t instanceof Yr&&t.setFocusable(!0)}else this.viewItems.forEach(t=>{t instanceof Yr&&t.setFocusable(!1)})}isTriggerKeyEvent(e){let t=!1;return this._triggerKeys.keys.forEach(i=>{t=t||e.equals(i)}),t}updateFocusedItem(){for(let e=0;et.setActionContext(e))}get actionRunner(){return this._actionRunner}set actionRunner(e){this._actionRunner=e,this._actionRunnerDisposables.clear(),this._actionRunnerDisposables.add(this._actionRunner.onDidRun(t=>this._onDidRun.fire(t))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun(t=>this._onWillRun.fire(t))),this.viewItems.forEach(t=>t.actionRunner=e)}getContainer(){return this.domNode}getAction(e){var t;if(typeof e=="number")return(t=this.viewItems[e])===null||t===void 0?void 0:t.action;if(e instanceof HTMLElement){for(;e.parentElement!==this.actionsList;){if(!e.parentElement)return;e=e.parentElement}for(let i=0;i{const r=document.createElement("li");r.className="action-item",r.setAttribute("role","presentation");let a;const l=Object.assign({hoverDelegate:this.options.hoverDelegate},t);this.options.actionViewItemProvider&&(a=this.options.actionViewItemProvider(o,l)),a||(a=new LD(this.context,o,l)),this.options.allowContextMenu||this.viewItemDisposables.set(a,K(r,de.CONTEXT_MENU,c=>{$e.stop(c,!0)})),a.actionRunner=this._actionRunner,a.setActionContext(this.context),a.render(r),this.focusable&&a instanceof Yr&&this.viewItems.length===0&&a.setFocusable(!0),s===null||s<0||s>=this.actionsList.children.length?(this.actionsList.appendChild(r),this.viewItems.push(a)):(this.actionsList.insertBefore(r,this.actionsList.children[s]),this.viewItems.splice(s,0,a),s++)}),typeof this.focusedItem=="number"&&this.focus(this.focusedItem),this.refreshRole()}clear(){this.isEmpty()||(this.viewItems=Ft(this.viewItems),this.viewItemDisposables.clearAndDisposeAll(),xo(this.actionsList),this.refreshRole())}length(){return this.viewItems.length}isEmpty(){return this.viewItems.length===0}focus(e){let t=!1,i;if(e===void 0?t=!0:typeof e=="number"?i=e:typeof e=="boolean"&&(t=e),t&&typeof this.focusedItem>"u"){const s=this.viewItems.findIndex(o=>o.isEnabled());this.focusedItem=s===-1?void 0:s,this.updateFocus(void 0,void 0,!0)}else i!==void 0&&(this.focusedItem=i),this.updateFocus(void 0,void 0,!0)}focusFirst(){return this.focusedItem=this.length()-1,this.focusNext(!0)}focusLast(){return this.focusedItem=0,this.focusPrevious(!0)}focusNext(e){if(typeof this.focusedItem>"u")this.focusedItem=this.viewItems.length-1;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let i;do{if(!e&&this.options.preventLoopNavigation&&this.focusedItem+1>=this.viewItems.length)return this.focusedItem=t,!1;this.focusedItem=(this.focusedItem+1)%this.viewItems.length,i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===Rn.ID));return this.updateFocus(),!0}focusPrevious(e){if(typeof this.focusedItem>"u")this.focusedItem=0;else if(this.viewItems.length<=1)return!1;const t=this.focusedItem;let i;do{if(this.focusedItem=this.focusedItem-1,this.focusedItem<0){if(!e&&this.options.preventLoopNavigation)return this.focusedItem=t,!1;this.focusedItem=this.viewItems.length-1}i=this.viewItems[this.focusedItem]}while(this.focusedItem!==t&&(this.options.focusOnlyEnabledItems&&!i.isEnabled()||i.action.id===Rn.ID));return this.updateFocus(!0),!0}updateFocus(e,t,i=!1){var s;typeof this.focusedItem>"u"&&this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem!==void 0&&this.previouslyFocusedItem!==this.focusedItem&&((s=this.viewItems[this.previouslyFocusedItem])===null||s===void 0||s.blur());const o=this.focusedItem!==void 0&&this.viewItems[this.focusedItem];if(o){let r=!0;hS(o.focus)||(r=!1),this.options.focusOnlyEnabledItems&&hS(o.isEnabled)&&!o.isEnabled()&&(r=!1),o.action.id===Rn.ID&&(r=!1),r?(i||this.previouslyFocusedItem!==this.focusedItem)&&(o.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0)}}doTrigger(e){if(typeof this.focusedItem>"u")return;const t=this.viewItems[this.focusedItem];if(t instanceof Yr){const i=t._context===null||t._context===void 0?e:t._context;this.run(t._action,i)}}run(e,t){return Kke(this,void 0,void 0,function*(){yield this._actionRunner.run(e,t)})}dispose(){this._context=void 0,this.viewItems=Ft(this.viewItems),this.getContainer().remove(),super.dispose()}}const wN=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,iE=/(&)?(&)([^\s&])/g;var hx;(function(n){n[n.Right=0]="Right",n[n.Left=1]="Left"})(hx||(hx={}));class Np extends al{constructor(e,t,i,s){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const o=document.createElement("div");o.classList.add("monaco-menu"),o.setAttribute("role","presentation"),super(o,{orientation:1,actionViewItemProvider:l=>this.doGetActionViewItem(l,i,r),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...pt||Xn?[10]:[]],keyDown:!0}}),this.menuStyles=s,this.menuElement=o,this.actionsList.tabIndex=0,this.menuDisposables=this._register(new pe),this.initializeOrUpdateStyleSheet(e,s),this._register(Rt.addTarget(o)),K(o,de.KEY_DOWN,l=>{new zt(l).equals(2)&&l.preventDefault()}),i.enableMnemonics&&this.menuDisposables.add(K(o,de.KEY_DOWN,l=>{const c=l.key.toLocaleLowerCase();if(this.mnemonics.has(c)){$e.stop(l,!0);const d=this.mnemonics.get(c);if(d.length===1&&(d[0]instanceof i8&&d[0].container&&this.focusItemByElement(d[0].container),d[0].onClick(l)),d.length>1){const u=d.shift();u&&u.container&&(this.focusItemByElement(u.container),d.push(u)),this.mnemonics.set(c,d)}}})),Xn&&this._register(K(o,de.KEY_DOWN,l=>{const c=new zt(l);c.equals(14)||c.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),$e.stop(l,!0)):(c.equals(13)||c.equals(12))&&(this.focusedItem=0,this.focusPrevious(),$e.stop(l,!0))})),this._register(K(this.domNode,de.MOUSE_OUT,l=>{const c=l.relatedTarget;wn(c,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),l.stopPropagation())})),this._register(K(this.actionsList,de.MOUSE_OVER,l=>{let c=l.target;if(!(!c||!wn(c,this.actionsList)||c===this.actionsList)){for(;c.parentElement!==this.actionsList&&c.parentElement!==null;)c=c.parentElement;if(c.classList.contains("action-item")){const d=this.focusedItem;this.setFocusedItem(c),d!==this.focusedItem&&this.updateFocus()}}})),this._register(Rt.addTarget(this.actionsList)),this._register(K(this.actionsList,Pt.Tap,l=>{let c=l.initialTarget;if(!(!c||!wn(c,this.actionsList)||c===this.actionsList)){for(;c.parentElement!==this.actionsList&&c.parentElement!==null;)c=c.parentElement;if(c.classList.contains("action-item")){const d=this.focusedItem;this.setFocusedItem(c),d!==this.focusedItem&&this.updateFocus()}}}));const r={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new w3(o,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const a=this.scrollableElement.getDomNode();a.style.position="",this.styleScrollElement(a,s),this._register(K(o,Pt.Change,l=>{$e.stop(l,!0);const c=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:c-l.translationY})})),this._register(K(a,de.MOUSE_UP,l=>{l.preventDefault()})),o.style.maxHeight=`${Math.max(10,window.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter(l=>{var c;return!((c=i.submenuIds)===null||c===void 0)&&c.has(l.id)?(console.warn(`Found submenu cycle: ${l.id}`),!1):!0}),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter(l=>!(l instanceof n8)).forEach((l,c,d)=>{l.updatePositionInSet(c+1,d.length)})}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(oT(e)?this.styleSheet=Dr(e):(Np.globalStyleSheet||(Np.globalStyleSheet=Dr()),this.styleSheet=Np.globalStyleSheet)),this.styleSheet.textContent=Zke(t,oT(e))}styleScrollElement(e,t){var i,s;const o=(i=t.foregroundColor)!==null&&i!==void 0?i:"",r=(s=t.backgroundColor)!==null&&s!==void 0?s:"",a=t.borderColor?`1px solid ${t.borderColor}`:"",l="5px",c=t.shadowColor?`0 2px 8px ${t.shadowColor}`:"";e.style.outline=a,e.style.borderRadius=l,e.style.color=o,e.style.backgroundColor=r,e.style.boxShadow=c}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}focusItemByElement(e){const t=this.focusedItem;this.setFocusedItem(e),t!==this.focusedItem&&this.updateFocus()}setFocusedItem(e){for(let t=0;t{this.element&&(this._register(K(this.element,de.MOUSE_UP,o=>{if($e.stop(o,!0),xr){if(new dr(o).rightButton)return;this.onClick(o)}else setTimeout(()=>{this.onClick(o)},0)})),this._register(K(this.element,de.CONTEXT_MENU,o=>{$e.stop(o,!0)})))},100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=le(this.element,ye("a.action-menu-item")),this._action.id===Rn.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=le(this.item,ye("span.menu-item-check"+Te.asCSSSelector(se.menuSelection))),this.check.setAttribute("role","none"),this.label=le(this.item,ye("span.action-label")),this.options.label&&this.options.keybinding&&(le(this.item,ye("span.keybinding")).textContent=this.options.keybinding),this.runOnceToEnableMouseUp.schedule(),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked(),this.applyStyle())}blur(){super.blur(),this.applyStyle()}focus(){var e;super.focus(),(e=this.item)===null||e===void 0||e.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){var e;if(this.label&&this.options.label){xo(this.label);let t=LG(this.action.label);if(t){const i=Yke(t);this.options.enableMnemonics||(t=i),this.label.setAttribute("aria-label",i.replace(/&&/g,"&"));const s=wN.exec(t);if(s){t=yS(t),iE.lastIndex=0;let o=iE.exec(t);for(;o&&o[1];)o=iE.exec(t);const r=a=>a.replace(/&&/g,"&");o?this.label.append(BL(r(t.substr(0,o.index))," "),ye("u",{"aria-hidden":"true"},o[3]),ipe(r(t.substr(o.index+o[0].length))," ")):this.label.innerText=r(t).trim(),(e=this.item)===null||e===void 0||e.setAttribute("aria-keyshortcuts",(s[1]?s[1]:s[3]).toLocaleLowerCase())}else this.label.innerText=t.replace(/&&/g,"&").trim()}}}updateTooltip(){}updateClass(){this.cssClass&&this.item&&this.item.classList.remove(...this.cssClass.split(" ")),this.options.icon&&this.label?(this.cssClass=this.action.class||"",this.label.classList.add("icon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" ")),this.updateEnabled()):this.label&&this.label.classList.remove("icon")}updateEnabled(){this.action.enabled?(this.element&&(this.element.classList.remove("disabled"),this.element.removeAttribute("aria-disabled")),this.item&&(this.item.classList.remove("disabled"),this.item.removeAttribute("aria-disabled"),this.item.tabIndex=0)):(this.element&&(this.element.classList.add("disabled"),this.element.setAttribute("aria-disabled","true")),this.item&&(this.item.classList.add("disabled"),this.item.setAttribute("aria-disabled","true")))}updateChecked(){if(!this.item)return;const e=this.action.checked;this.item.classList.toggle("checked",!!e),e!==void 0?(this.item.setAttribute("role","menuitemcheckbox"),this.item.setAttribute("aria-checked",e?"true":"false")):(this.item.setAttribute("role","menuitem"),this.item.setAttribute("aria-checked",""))}getMnemonic(){return this.mnemonic}applyStyle(){const e=this.element&&this.element.classList.contains("focused"),t=e&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor,i=e&&this.menuStyle.selectionBackgroundColor?this.menuStyle.selectionBackgroundColor:void 0,s=e&&this.menuStyle.selectionBorderColor?`1px solid ${this.menuStyle.selectionBorderColor}`:"",o=e&&this.menuStyle.selectionBorderColor?"-1px":"";this.item&&(this.item.style.color=t??"",this.item.style.backgroundColor=i??"",this.item.style.outline=s,this.item.style.outlineOffset=o),this.check&&(this.check.style.color=t??"")}}class i8 extends WG{constructor(e,t,i,s,o){super(e,e,s,o),this.submenuActions=t,this.parentData=i,this.submenuOptions=s,this.mysubmenu=null,this.submenuDisposables=this._register(new pe),this.mouseOver=!1,this.expandDirection=s&&s.expandDirection!==void 0?s.expandDirection:hx.Right,this.showScheduler=new Li(()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))},250),this.hideScheduler=new Li(()=>{this.element&&!wn(ea(),this.element)&&this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))},750)}render(e){super.render(e),this.element&&(this.item&&(this.item.classList.add("monaco-submenu-item"),this.item.tabIndex=0,this.item.setAttribute("aria-haspopup","true"),this.updateAriaExpanded("false"),this.submenuIndicator=le(this.item,ye("span.submenu-indicator"+Te.asCSSSelector(se.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(K(this.element,de.KEY_UP,t=>{const i=new zt(t);(i.equals(17)||i.equals(3))&&($e.stop(t,!0),this.createSubmenu(!0))})),this._register(K(this.element,de.KEY_DOWN,t=>{const i=new zt(t);ea()===this.item&&(i.equals(17)||i.equals(3))&&$e.stop(t,!0)})),this._register(K(this.element,de.MOUSE_OVER,t=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())})),this._register(K(this.element,de.MOUSE_LEAVE,t=>{this.mouseOver=!1})),this._register(K(this.element,de.FOCUS_OUT,t=>{this.element&&!wn(ea(),this.element)&&this.hideScheduler.schedule()})),this._register(this.parentData.parent.onScroll(()=>{this.parentData.submenu===this.mysubmenu&&(this.parentData.parent.focus(!1),this.cleanupExistingSubmenu(!0))})))}updateEnabled(){}onClick(e){$e.stop(e,!0),this.cleanupExistingSubmenu(!1),this.createSubmenu(!0)}cleanupExistingSubmenu(e){if(this.parentData.submenu&&(e||this.parentData.submenu!==this.mysubmenu)){try{this.parentData.submenu.dispose()}catch{}this.parentData.submenu=void 0,this.updateAriaExpanded("false"),this.submenuContainer&&(this.submenuDisposables.clear(),this.submenuContainer=void 0)}}calculateSubmenuMenuLayout(e,t,i,s){const o={top:0,left:0};return o.left=tp(e.width,t.width,{position:s===hx.Right?0:1,offset:i.left,size:i.width}),o.left>=i.left&&o.left{new zt(c).equals(15)&&($e.stop(c,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))})),this.submenuDisposables.add(K(this.submenuContainer,de.KEY_DOWN,c=>{new zt(c).equals(15)&&$e.stop(c,!0)})),this.submenuDisposables.add(this.parentData.submenu.onDidCancel(()=>{this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0)})),this.parentData.submenu.focus(e),this.mysubmenu=this.parentData.submenu}}updateAriaExpanded(e){var t;this.item&&((t=this.item)===null||t===void 0||t.setAttribute("aria-expanded",e))}applyStyle(){super.applyStyle();const t=this.element&&this.element.classList.contains("focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=t??"")}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class n8 extends LD{constructor(e,t,i,s){super(e,t,i),this.menuStyles=s}render(e){super.render(e),this.label&&(this.label.style.borderBottomColor=this.menuStyles.separatorColor?`${this.menuStyles.separatorColor}`:"")}}function Yke(n){const e=wN,t=e.exec(n);if(!t)return n;const i=!t[1];return n.replace(e,i?"$2$3":"").trim()}function s8(n){const e=DU()[n.id];return`.codicon-${n.id}:before { content: '\\${e.toString(16)}'; }`}function Zke(n,e){let t=` .monaco-menu { font-size: 13px; border-radius: 5px; min-width: 160px; } -${l8(se.menuSelection)} -${l8(se.menuSubmenu)} +${s8(se.menuSelection)} +${s8(se.menuSubmenu)} .monaco-menu .monaco-action-bar { text-align: right; @@ -3469,42 +3270,42 @@ ${l8(se.menuSubmenu)} .monaco-scrollable-element > .scrollbar > .slider.active { background: ${r}; } - `)}return t}class Tke{constructor(e,t,i,s){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=s,this.focusToReturn=null,this.lastContainer=null,this.block=null,this.blockDisposable=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;this.focusToReturn=document.activeElement;let i;const s=Q4(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:o=>{var r;this.lastContainer=o;const a=e.getMenuClassName?e.getMenuClassName():"";a&&(o.className+=" "+a),this.options.blockMouse&&(this.block=o.appendChild(ye(".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",(r=this.blockDisposable)===null||r===void 0||r.dispose(),this.blockDisposable=K(this.block,de.MOUSE_DOWN,d=>d.stopPropagation()));const l=new pe,c=e.actionRunner||new _m;return c.onWillRun(d=>this.onActionRun(d,!e.skipTelemetry),this,l),c.onDidRun(this.onDidActionRun,this,l),i=new Ip(o,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:c,getKeyBinding:e.getKeyBinding?e.getKeyBinding:d=>this.keybindingService.lookupKeybinding(d.id)},Lke),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,l),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,l),l.add(K(window,de.BLUR,()=>this.contextViewService.hideContextView(!0))),l.add(K(window,de.MOUSE_DOWN,d=>{if(d.defaultPrevented)return;const u=new ur(d);let h=u.target;if(!u.rightButton){for(;h;){if(h===o)return;h=h.parentElement}this.contextViewService.hideContextView(!0)}})),br(l,i)},focus:()=>{i==null||i.focus(!!e.autoSelectFirstItem)},onHide:o=>{var r,a,l;(r=e.onHide)===null||r===void 0||r.call(e,!!o),this.block&&(this.block.remove(),this.block=null),(a=this.blockDisposable)===null||a===void 0||a.dispose(),this.blockDisposable=null,this.lastContainer&&(ia()===this.lastContainer||Sn(ia(),this.lastContainer))&&((l=this.focusToReturn)===null||l===void 0||l.focus()),this.lastContainer=null}},s,!!s)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!Bf(e.error)&&this.notificationService.error(e.error)}}var Nke=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},wg=function(n,e){return function(t,i){e(t,i,n)}};let xN=class extends Y{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new Tke(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,s,o,r){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=s,this.menuService=o,this.contextKeyService=r,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new B),this._onDidHideContextMenu=this._store.add(new B)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=LN.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu(Object.assign(Object.assign({},e),{onHide:t=>{var i;(i=e.onHide)===null||i===void 0||i.call(e,t),this._onDidHideContextMenu.fire()}})),cd.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};xN=Nke([wg(0,Cc),wg(1,Dn),wg(2,Iu),wg(3,vi),wg(4,Lu),wg(5,tt)],xN);var LN;(function(n){function e(i){return i&&i.menuId instanceof I}function t(i,s,o){if(!e(i))return i;const{menuId:r,menuActionOptions:a,contextKeyService:l}=i;return Object.assign(Object.assign({},i),{getActions:()=>{const c=[];if(r){const d=s.createMenu(r,l??o);Dke(d,a,c),d.dispose()}return i.getActions?Pn.join(i.getActions(),c):c}})}n.transform=t})(LN||(LN={}));var yx;(function(n){n[n.API=0]="API",n[n.USER=1]="USER"})(yx||(yx={}));var n3=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},wx=function(n,e){return function(t,i){e(t,i,n)}},ph=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let DN=class{constructor(e){this._commandService=e}open(e,t){return ph(this,void 0,void 0,function*(){if(!UP(e,it.command))return!1;if(!(t!=null&&t.allowCommands)||(typeof e=="string"&&(e=je.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path)))return!0;let i=[];try{i=pN(decodeURIComponent(e.query))}catch{try{i=pN(e.query)}catch{}}return Array.isArray(i)||(i=[i]),yield this._commandService.executeCommand(e.path,...i),!0})}};DN=n3([wx(0,gs)],DN);let kN=class{constructor(e){this._editorService=e}open(e,t){return ph(this,void 0,void 0,function*(){typeof e=="string"&&(e=je.parse(e));const{selection:i,uri:s}=Oxe(e);return e=s,e.scheme===it.file&&(e=mCe(e)),yield this._editorService.openCodeEditor({resource:e,options:Object.assign({selection:i,source:t!=null&&t.fromUserGesture?yx.USER:yx.API},t==null?void 0:t.editorOptions)},this._editorService.getFocusedCodeEditor(),t==null?void 0:t.openToSide),!0})}};kN=n3([wx(0,qt)],kN);let EN=class{constructor(e,t){this._openers=new ks,this._validators=new ks,this._resolvers=new ks,this._resolvedUriTargets=new Tn(i=>i.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new ks,this._defaultExternalOpener={openExternal:i=>ph(this,void 0,void 0,function*(){return k6(i,it.http,it.https)?oj(i):window.location.href=i,!0})},this._openers.push({open:(i,s)=>ph(this,void 0,void 0,function*(){return s!=null&&s.openExternal||k6(i,it.mailto,it.http,it.https,it.vsls)?(yield this._doOpenExternal(i,s),!0):!1})}),this._openers.push(new DN(t)),this._openers.push(new kN(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}open(e,t){var i;return ph(this,void 0,void 0,function*(){const s=typeof e=="string"?je.parse(e):e,o=(i=this._resolvedUriTargets.get(s))!==null&&i!==void 0?i:e;for(const r of this._validators)if(!(yield r.shouldOpen(o,t)))return!1;for(const r of this._openers)if(yield r.open(e,t))return!0;return!1})}resolveExternalUri(e,t){return ph(this,void 0,void 0,function*(){for(const i of this._resolvers)try{const s=yield i.resolveExternalUri(e,t);if(s)return this._resolvedUriTargets.has(s.resolved)||this._resolvedUriTargets.set(s.resolved,e),s}catch{}throw new Error("Could not resolve external URI: "+e.toString())})}_doOpenExternal(e,t){return ph(this,void 0,void 0,function*(){const i=typeof e=="string"?je.parse(e):e;let s;try{s=(yield this.resolveExternalUri(i,t)).resolved}catch{s=i}let o;if(typeof e=="string"&&i.toString()===s.toString()?o=e:o=encodeURI(s.toString(!0)),t!=null&&t.allowContributedOpeners){const r=typeof(t==null?void 0:t.allowContributedOpeners)=="string"?t==null?void 0:t.allowContributedOpeners:void 0;for(const a of this._externalOpeners)if(yield a.openExternal(o,{sourceUri:i,preferredOpenerId:r},ln.None))return!0}return this._defaultExternalOpener.openExternal(o,{sourceUri:i},ln.None)})}dispose(){this._validators.clear()}};EN=n3([wx(0,qt),wx(1,gs)],EN);const ry=at("editorWorkerService");var ti;(function(n){n[n.Hint=1]="Hint",n[n.Info=2]="Info",n[n.Warning=4]="Warning",n[n.Error=8]="Error"})(ti||(ti={}));(function(n){function e(r,a){return a-r}n.compare=e;const t=Object.create(null);t[n.Error]=m("sev.error","Error"),t[n.Warning]=m("sev.warning","Warning"),t[n.Info]=m("sev.info","Info");function i(r){return t[r]||""}n.toString=i;function s(r){switch(r){case bi.Error:return n.Error;case bi.Warning:return n.Warning;case bi.Info:return n.Info;case bi.Ignore:return n.Hint}}n.fromSeverity=s;function o(r){switch(r){case n.Error:return bi.Error;case n.Warning:return bi.Warning;case n.Info:return bi.Info;case n.Hint:return bi.Ignore}}n.toSeverity=o})(ti||(ti={}));var Cx;(function(n){const e="";function t(s){return i(s,!0)}n.makeKey=t;function i(s,o){const r=[e];return s.source?r.push(s.source.replace("¦","\\¦")):r.push(e),s.code?typeof s.code=="string"?r.push(s.code.replace("¦","\\¦")):r.push(s.code.value.replace("¦","\\¦")):r.push(e),s.severity!==void 0&&s.severity!==null?r.push(ti.toString(s.severity)):r.push(e),s.message&&o?r.push(s.message.replace("¦","\\¦")):r.push(e),s.startLineNumber!==void 0&&s.startLineNumber!==null?r.push(s.startLineNumber.toString()):r.push(e),s.startColumn!==void 0&&s.startColumn!==null?r.push(s.startColumn.toString()):r.push(e),s.endLineNumber!==void 0&&s.endLineNumber!==null?r.push(s.endLineNumber.toString()):r.push(e),s.endColumn!==void 0&&s.endColumn!==null?r.push(s.endColumn.toString()):r.push(e),r.push(e),r.join("¦")}n.makeKeyOptionalMessage=i})(Cx||(Cx={}));const pl=at("markerService");function Rke(n,e){const t=[],i=[];for(const s of n)e.has(s)||t.push(s);for(const s of e)n.has(s)||i.push(s);return{removed:t,added:i}}function Mke(n,e){const t=new Set;for(const i of e)n.has(i)&&t.add(i);return t}var Pke=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},c8=function(n,e){return function(t,i){e(t,i,n)}};let AN=class extends Y{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new B),this._markerDecorations=new Tn,e.getModels().forEach(i=>this._onModelAdded(i)),this._register(e.onModelAdded(this._onModelAdded,this)),this._register(e.onModelRemoved(this._onModelRemoved,this)),this._register(this._markerService.onMarkerChanged(this._handleMarkerChange,this))}dispose(){super.dispose(),this._markerDecorations.forEach(e=>e.dispose()),this._markerDecorations.clear()}getMarker(e,t){const i=this._markerDecorations.get(e);return i&&i.getMarker(t)||null}_handleMarkerChange(e){e.forEach(t=>{const i=this._markerDecorations.get(t);i&&this._updateDecorations(i)})}_onModelAdded(e){const t=new Oke(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){var t;const i=this._markerDecorations.get(e.uri);i&&(i.dispose(),this._markerDecorations.delete(e.uri)),(e.uri.scheme===it.inMemory||e.uri.scheme===it.internal||e.uri.scheme===it.vscode)&&((t=this._markerService)===null||t===void 0||t.read({resource:e.uri}).map(s=>s.owner).forEach(s=>this._markerService.remove(s,[e.uri])))}_updateDecorations(e){const t=this._markerService.read({resource:e.model.uri,take:500});e.update(t)&&this._onDidChangeMarker.fire(e.model)}};AN=Pke([c8(0,fs),c8(1,pl)],AN);class Oke extends Y{constructor(e){super(),this.model=e,this._map=new b_e,this._register(Ze(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:i}=Rke(new Set(this._map.keys()),new Set(e));if(t.length===0&&i.length===0)return!1;const s=i.map(a=>this._map.get(a)),o=t.map(a=>({range:this._createDecorationRange(this.model,a),options:this._createDecorationOption(a)})),r=this.model.deltaDecorations(s,o);for(const a of i)this._map.delete(a);for(let a=0;a=s)return i;const o=e.getWordAtPosition(i.getStartPosition());o&&(i=new N(i.startLineNumber,o.startColumn,i.endLineNumber,o.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&t.startColumn===1&&i.startLineNumber===i.endLineNumber){const s=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);s=0:!1}}var Fke=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},O0=function(n,e){return function(t,i){e(t,i,n)}},Eg;function Gu(n){return n.toString()}class Bke{constructor(e,t,i){this.model=e,this._modelEventListeners=new pe,this.model=e,this._modelEventListeners.add(e.onWillDispose(()=>t(e))),this._modelEventListeners.add(e.onDidChangeLanguage(s=>i(e,s)))}dispose(){this._modelEventListeners.dispose()}}const Wke=Jn||mt?1:2;class Vke{constructor(e,t,i,s,o,r,a,l){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=i,this.sharesUndoRedoStack=s,this.heapSize=o,this.sha1=r,this.versionId=a,this.alternativeVersionId=l}}let Sx=Eg=class extends Y{constructor(e,t,i,s,o){super(),this._configurationService=e,this._resourcePropertiesService=t,this._undoRedoService=i,this._languageService=s,this._languageConfigurationService=o,this._onModelAdded=this._register(new B),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new B),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new B),this.onModelLanguageChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._register(this._configurationService.onDidChangeConfiguration(r=>this._updateModelOptions(r))),this._updateModelOptions(void 0)}static _readModelOptions(e,t){var i;let s=In.tabSize;if(e.editor&&typeof e.editor.tabSize<"u"){const f=parseInt(e.editor.tabSize,10);isNaN(f)||(s=f),s<1&&(s=1)}let o="tabSize";if(e.editor&&typeof e.editor.indentSize<"u"&&e.editor.indentSize!=="tabSize"){const f=parseInt(e.editor.indentSize,10);isNaN(f)||(o=Math.max(f,1))}let r=In.insertSpaces;e.editor&&typeof e.editor.insertSpaces<"u"&&(r=e.editor.insertSpaces==="false"?!1:!!e.editor.insertSpaces);let a=Wke;const l=e.eol;l===`\r + `)}return t}class Xke{constructor(e,t,i,s){this.contextViewService=e,this.telemetryService=t,this.notificationService=i,this.keybindingService=s,this.focusToReturn=null,this.lastContainer=null,this.block=null,this.blockDisposable=null,this.options={blockMouse:!0}}configure(e){this.options=e}showContextMenu(e){const t=e.getActions();if(!t.length)return;this.focusToReturn=document.activeElement;let i;const s=Z4(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:o=>{var r;this.lastContainer=o;const a=e.getMenuClassName?e.getMenuClassName():"";a&&(o.className+=" "+a),this.options.blockMouse&&(this.block=o.appendChild(ye(".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",(r=this.blockDisposable)===null||r===void 0||r.dispose(),this.blockDisposable=K(this.block,de.MOUSE_DOWN,d=>d.stopPropagation()));const l=new pe,c=e.actionRunner||new ym;return c.onWillRun(d=>this.onActionRun(d,!e.skipTelemetry),this,l),c.onDidRun(this.onDidActionRun,this,l),i=new Np(o,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:c,getKeyBinding:e.getKeyBinding?e.getKeyBinding:d=>this.keybindingService.lookupKeybinding(d.id)},jke),i.onDidCancel(()=>this.contextViewService.hideContextView(!0),null,l),i.onDidBlur(()=>this.contextViewService.hideContextView(!0),null,l),l.add(K(window,de.BLUR,()=>this.contextViewService.hideContextView(!0))),l.add(K(window,de.MOUSE_DOWN,d=>{if(d.defaultPrevented)return;const u=new dr(d);let h=u.target;if(!u.rightButton){for(;h;){if(h===o)return;h=h.parentElement}this.contextViewService.hideContextView(!0)}})),_r(l,i)},focus:()=>{i==null||i.focus(!!e.autoSelectFirstItem)},onHide:o=>{var r,a,l;(r=e.onHide)===null||r===void 0||r.call(e,!!o),this.block&&(this.block.remove(),this.block=null),(a=this.blockDisposable)===null||a===void 0||a.dispose(),this.blockDisposable=null,this.lastContainer&&(ea()===this.lastContainer||wn(ea(),this.lastContainer))&&((l=this.focusToReturn)===null||l===void 0||l.focus()),this.lastContainer=null}},s,!!s)}onActionRun(e,t){t&&this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.action.id,from:"contextMenu"}),this.contextViewService.hideContextView(!1)}onDidActionRun(e){e.error&&!zf(e.error)&&this.notificationService.error(e.error)}}var Qke=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},xg=function(n,e){return function(t,i){e(t,i,n)}};let CN=class extends Y{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new Xke(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,s,o,r){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=s,this.menuService=o,this.contextKeyService=r,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new B),this._onDidHideContextMenu=this._store.add(new B)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=SN.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu(Object.assign(Object.assign({},e),{onHide:t=>{var i;(i=e.onHide)===null||i===void 0||i.call(e,t),this._onDidHideContextMenu.fire()}})),dd.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};CN=Qke([xg(0,Cc),xg(1,xn),xg(2,Tu),xg(3,bi),xg(4,Du),xg(5,et)],CN);var SN;(function(n){function e(i){return i&&i.menuId instanceof I}function t(i,s,o){if(!e(i))return i;const{menuId:r,menuActionOptions:a,contextKeyService:l}=i;return Object.assign(Object.assign({},i),{getActions:()=>{const c=[];if(r){const d=s.createMenu(r,l??o);qke(d,a,c),d.dispose()}return i.getActions?Rn.join(i.getActions(),c):c}})}n.transform=t})(SN||(SN={}));var fx;(function(n){n[n.API=0]="API",n[n.USER=1]="USER"})(fx||(fx={}));var tP=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},gx=function(n,e){return function(t,i){e(t,i,n)}},_h=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let xN=class{constructor(e){this._commandService=e}open(e,t){return _h(this,void 0,void 0,function*(){if(!H3(e,tt.command))return!1;if(!(t!=null&&t.allowCommands)||(typeof e=="string"&&(e=Ue.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path)))return!0;let i=[];try{i=fN(decodeURIComponent(e.query))}catch{try{i=fN(e.query)}catch{}}return Array.isArray(i)||(i=[i]),yield this._commandService.executeCommand(e.path,...i),!0})}};xN=tP([gx(0,fs)],xN);let LN=class{constructor(e){this._editorService=e}open(e,t){return _h(this,void 0,void 0,function*(){typeof e=="string"&&(e=Ue.parse(e));const{selection:i,uri:s}=iLe(e);return e=s,e.scheme===tt.file&&(e=OCe(e)),yield this._editorService.openCodeEditor({resource:e,options:Object.assign({selection:i,source:t!=null&&t.fromUserGesture?fx.USER:fx.API},t==null?void 0:t.editorOptions)},this._editorService.getFocusedCodeEditor(),t==null?void 0:t.openToSide),!0})}};LN=tP([gx(0,jt)],LN);let DN=class{constructor(e,t){this._openers=new Ds,this._validators=new Ds,this._resolvers=new Ds,this._resolvedUriTargets=new An(i=>i.with({path:null,fragment:null,query:null}).toString()),this._externalOpeners=new Ds,this._defaultExternalOpener={openExternal:i=>_h(this,void 0,void 0,function*(){return S6(i,tt.http,tt.https)?sj(i):window.location.href=i,!0})},this._openers.push({open:(i,s)=>_h(this,void 0,void 0,function*(){return s!=null&&s.openExternal||S6(i,tt.mailto,tt.http,tt.https,tt.vsls)?(yield this._doOpenExternal(i,s),!0):!1})}),this._openers.push(new xN(t)),this._openers.push(new LN(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}open(e,t){var i;return _h(this,void 0,void 0,function*(){const s=typeof e=="string"?Ue.parse(e):e,o=(i=this._resolvedUriTargets.get(s))!==null&&i!==void 0?i:e;for(const r of this._validators)if(!(yield r.shouldOpen(o,t)))return!1;for(const r of this._openers)if(yield r.open(e,t))return!0;return!1})}resolveExternalUri(e,t){return _h(this,void 0,void 0,function*(){for(const i of this._resolvers)try{const s=yield i.resolveExternalUri(e,t);if(s)return this._resolvedUriTargets.has(s.resolved)||this._resolvedUriTargets.set(s.resolved,e),s}catch{}throw new Error("Could not resolve external URI: "+e.toString())})}_doOpenExternal(e,t){return _h(this,void 0,void 0,function*(){const i=typeof e=="string"?Ue.parse(e):e;let s;try{s=(yield this.resolveExternalUri(i,t)).resolved}catch{s=i}let o;if(typeof e=="string"&&i.toString()===s.toString()?o=e:o=encodeURI(s.toString(!0)),t!=null&&t.allowContributedOpeners){const r=typeof(t==null?void 0:t.allowContributedOpeners)=="string"?t==null?void 0:t.allowContributedOpeners:void 0;for(const a of this._externalOpeners)if(yield a.openExternal(o,{sourceUri:i,preferredOpenerId:r},rn.None))return!0}return this._defaultExternalOpener.openExternal(o,{sourceUri:i},rn.None)})}dispose(){this._validators.clear()}};DN=tP([gx(0,jt),gx(1,fs)],DN);const ly=rt("editorWorkerService");var ei;(function(n){n[n.Hint=1]="Hint",n[n.Info=2]="Info",n[n.Warning=4]="Warning",n[n.Error=8]="Error"})(ei||(ei={}));(function(n){function e(r,a){return a-r}n.compare=e;const t=Object.create(null);t[n.Error]=m("sev.error","Error"),t[n.Warning]=m("sev.warning","Warning"),t[n.Info]=m("sev.info","Info");function i(r){return t[r]||""}n.toString=i;function s(r){switch(r){case _i.Error:return n.Error;case _i.Warning:return n.Warning;case _i.Info:return n.Info;case _i.Ignore:return n.Hint}}n.fromSeverity=s;function o(r){switch(r){case n.Error:return _i.Error;case n.Warning:return _i.Warning;case n.Info:return _i.Info;case n.Hint:return _i.Ignore}}n.toSeverity=o})(ei||(ei={}));var px;(function(n){const e="";function t(s){return i(s,!0)}n.makeKey=t;function i(s,o){const r=[e];return s.source?r.push(s.source.replace("¦","\\¦")):r.push(e),s.code?typeof s.code=="string"?r.push(s.code.replace("¦","\\¦")):r.push(s.code.value.replace("¦","\\¦")):r.push(e),s.severity!==void 0&&s.severity!==null?r.push(ei.toString(s.severity)):r.push(e),s.message&&o?r.push(s.message.replace("¦","\\¦")):r.push(e),s.startLineNumber!==void 0&&s.startLineNumber!==null?r.push(s.startLineNumber.toString()):r.push(e),s.startColumn!==void 0&&s.startColumn!==null?r.push(s.startColumn.toString()):r.push(e),s.endLineNumber!==void 0&&s.endLineNumber!==null?r.push(s.endLineNumber.toString()):r.push(e),s.endColumn!==void 0&&s.endColumn!==null?r.push(s.endColumn.toString()):r.push(e),r.push(e),r.join("¦")}n.makeKeyOptionalMessage=i})(px||(px={}));const ml=rt("markerService");function Jke(n,e){const t=[],i=[];for(const s of n)e.has(s)||t.push(s);for(const s of e)n.has(s)||i.push(s);return{removed:t,added:i}}function e2e(n,e){const t=new Set;for(const i of e)n.has(i)&&t.add(i);return t}var t2e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},o8=function(n,e){return function(t,i){e(t,i,n)}};let kN=class extends Y{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new B),this._markerDecorations=new An,e.getModels().forEach(i=>this._onModelAdded(i)),this._register(e.onModelAdded(this._onModelAdded,this)),this._register(e.onModelRemoved(this._onModelRemoved,this)),this._register(this._markerService.onMarkerChanged(this._handleMarkerChange,this))}dispose(){super.dispose(),this._markerDecorations.forEach(e=>e.dispose()),this._markerDecorations.clear()}getMarker(e,t){const i=this._markerDecorations.get(e);return i&&i.getMarker(t)||null}_handleMarkerChange(e){e.forEach(t=>{const i=this._markerDecorations.get(t);i&&this._updateDecorations(i)})}_onModelAdded(e){const t=new i2e(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){var t;const i=this._markerDecorations.get(e.uri);i&&(i.dispose(),this._markerDecorations.delete(e.uri)),(e.uri.scheme===tt.inMemory||e.uri.scheme===tt.internal||e.uri.scheme===tt.vscode)&&((t=this._markerService)===null||t===void 0||t.read({resource:e.uri}).map(s=>s.owner).forEach(s=>this._markerService.remove(s,[e.uri])))}_updateDecorations(e){const t=this._markerService.read({resource:e.model.uri,take:500});e.update(t)&&this._onDidChangeMarker.fire(e.model)}};kN=t2e([o8(0,hs),o8(1,ml)],kN);class i2e extends Y{constructor(e){super(),this.model=e,this._map=new B_e,this._register(Ye(()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()}))}update(e){const{added:t,removed:i}=Jke(new Set(this._map.keys()),new Set(e));if(t.length===0&&i.length===0)return!1;const s=i.map(a=>this._map.get(a)),o=t.map(a=>({range:this._createDecorationRange(this.model,a),options:this._createDecorationOption(a)})),r=this.model.deltaDecorations(s,o);for(const a of i)this._map.delete(a);for(let a=0;a=s)return i;const o=e.getWordAtPosition(i.getStartPosition());o&&(i=new N(i.startLineNumber,o.startColumn,i.endLineNumber,o.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&t.startColumn===1&&i.startLineNumber===i.endLineNumber){const s=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);s=0:!1}}var n2e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},V0=function(n,e){return function(t,i){e(t,i,n)}},Tg;function Ku(n){return n.toString()}class s2e{constructor(e,t,i){this.model=e,this._modelEventListeners=new pe,this.model=e,this._modelEventListeners.add(e.onWillDispose(()=>t(e))),this._modelEventListeners.add(e.onDidChangeLanguage(s=>i(e,s)))}dispose(){this._modelEventListeners.dispose()}}const o2e=Xn||pt?1:2;class r2e{constructor(e,t,i,s,o,r,a,l){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=i,this.sharesUndoRedoStack=s,this.heapSize=o,this.sha1=r,this.versionId=a,this.alternativeVersionId=l}}let mx=Tg=class extends Y{constructor(e,t,i,s,o){super(),this._configurationService=e,this._resourcePropertiesService=t,this._undoRedoService=i,this._languageService=s,this._languageConfigurationService=o,this._onModelAdded=this._register(new B),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new B),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new B),this.onModelLanguageChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._register(this._configurationService.onDidChangeConfiguration(r=>this._updateModelOptions(r))),this._updateModelOptions(void 0)}static _readModelOptions(e,t){var i;let s=En.tabSize;if(e.editor&&typeof e.editor.tabSize<"u"){const f=parseInt(e.editor.tabSize,10);isNaN(f)||(s=f),s<1&&(s=1)}let o="tabSize";if(e.editor&&typeof e.editor.indentSize<"u"&&e.editor.indentSize!=="tabSize"){const f=parseInt(e.editor.indentSize,10);isNaN(f)||(o=Math.max(f,1))}let r=En.insertSpaces;e.editor&&typeof e.editor.insertSpaces<"u"&&(r=e.editor.insertSpaces==="false"?!1:!!e.editor.insertSpaces);let a=o2e;const l=e.eol;l===`\r `?a=2:l===` -`&&(a=1);let c=In.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace<"u"&&(c=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let d=In.detectIndentation;e.editor&&typeof e.editor.detectIndentation<"u"&&(d=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let u=In.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations<"u"&&(u=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations);let h=In.bracketPairColorizationOptions;return!((i=e.editor)===null||i===void 0)&&i.bracketPairColorization&&typeof e.editor.bracketPairColorization=="object"&&(h={enabled:!!e.editor.bracketPairColorization.enabled,independentColorPoolPerBracketType:!!e.editor.bracketPairColorization.independentColorPoolPerBracketType}),{isForSimpleWidget:t,tabSize:s,indentSize:o,insertSpaces:r,detectIndentation:d,defaultEOL:a,trimAutoWhitespace:c,largeFileOptimizations:u,bracketPairColorizationOptions:h}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const i=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return i&&typeof i=="string"&&i!=="auto"?i:wo===3||wo===2?` +`&&(a=1);let c=En.trimAutoWhitespace;e.editor&&typeof e.editor.trimAutoWhitespace<"u"&&(c=e.editor.trimAutoWhitespace==="false"?!1:!!e.editor.trimAutoWhitespace);let d=En.detectIndentation;e.editor&&typeof e.editor.detectIndentation<"u"&&(d=e.editor.detectIndentation==="false"?!1:!!e.editor.detectIndentation);let u=En.largeFileOptimizations;e.editor&&typeof e.editor.largeFileOptimizations<"u"&&(u=e.editor.largeFileOptimizations==="false"?!1:!!e.editor.largeFileOptimizations);let h=En.bracketPairColorizationOptions;return!((i=e.editor)===null||i===void 0)&&i.bracketPairColorization&&typeof e.editor.bracketPairColorization=="object"&&(h={enabled:!!e.editor.bracketPairColorization.enabled,independentColorPoolPerBracketType:!!e.editor.bracketPairColorization.independentColorPoolPerBracketType}),{isForSimpleWidget:t,tabSize:s,indentSize:o,insertSpaces:r,detectIndentation:d,defaultEOL:a,trimAutoWhitespace:c,largeFileOptimizations:u,bracketPairColorizationOptions:h}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const i=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return i&&typeof i=="string"&&i!=="auto"?i:bo===3||bo===2?` `:`\r -`}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return typeof e=="boolean"?e:!0}getCreationOptions(e,t,i){const s=typeof e=="string"?e:e.languageId;let o=this._modelCreationOptionsByLanguageAndResource[s+t];if(!o){const r=this._configurationService.getValue("editor",{overrideIdentifier:s,resource:t}),a=this._getEOL(t,s);o=Eg._readModelOptions({editor:r,eol:a},i),this._modelCreationOptionsByLanguageAndResource[s+t]=o}return o}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const i=Object.keys(this._models);for(let s=0,o=i.length;se){const t=[];for(this._disposedModels.forEach(i=>{i.sharesUndoRedoStack||t.push(i)}),t.sort((i,s)=>i.time-s.time);t.length>0&&this._disposedModelsHeapSize>e;){const i=t.shift();this._removeDisposedModel(i.uri),i.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(i.initialUndoRedoSnapshot)}}}_createModelData(e,t,i,s){const o=this.getCreationOptions(t,i,s),r=new rl(e,t,o,i,this._undoRedoService,this._languageService,this._languageConfigurationService);if(i&&this._disposedModels.has(Gu(i))){const c=this._removeDisposedModel(i),d=this._undoRedoService.getElements(i),u=this._getSHA1Computer(),h=u.canComputeSHA1(r)?u.computeSHA1(r)===c.sha1:!1;if(h||c.sharesUndoRedoStack){for(const f of d.past)Ml(f)&&f.matchesResource(i)&&f.setModel(r);for(const f of d.future)Ml(f)&&f.matchesResource(i)&&f.setModel(r);this._undoRedoService.setElementsValidFlag(i,!0,f=>Ml(f)&&f.matchesResource(i)),h&&(r._overwriteVersionId(c.versionId),r._overwriteAlternativeVersionId(c.alternativeVersionId),r._overwriteInitialUndoRedoSnapshot(c.initialUndoRedoSnapshot))}else c.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(c.initialUndoRedoSnapshot)}const a=Gu(r.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const l=new Bke(r,c=>this._onWillDispose(c),(c,d)=>this._onDidChangeLanguage(c,d));return this._models[a]=l,l}createModel(e,t,i,s=!1){let o;return t?o=this._createModelData(e,t,i,s):o=this._createModelData(e,$o,i,s),this._onModelAdded.fire(o.model),o.model}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,s=t.length;i0||c.future.length>0){for(const d of c.past)Ml(d)&&d.matchesResource(e.uri)&&(o=!0,r+=d.heapSize(e.uri),d.setModel(e.uri));for(const d of c.future)Ml(d)&&d.matchesResource(e.uri)&&(o=!0,r+=d.heapSize(e.uri),d.setModel(e.uri))}}const a=Eg.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,l=this._getSHA1Computer();if(o)if(!s&&(r>a||!l.canComputeSHA1(e))){const c=i.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}else this._ensureDisposedModelsHeapSize(a-r),this._undoRedoService.setElementsValidFlag(e.uri,!1,c=>Ml(c)&&c.matchesResource(e.uri)),this._insertDisposedModel(new Vke(e.uri,i.model.getInitialUndoRedoSnapshot(),Date.now(),s,r,l.computeSHA1(e),e.getVersionId(),e.getAlternativeVersionId()));else if(!s){const c=i.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}delete this._models[t],i.dispose(),delete this._modelCreationOptionsByLanguageAndResource[e.getLanguageId()+e.uri],this._onModelRemoved.fire(e)}_onDidChangeLanguage(e,t){const i=t.oldLanguage,s=e.getLanguageId(),o=this.getCreationOptions(i,e.uri,e.isForSimpleWidget),r=this.getCreationOptions(s,e.uri,e.isForSimpleWidget);Eg._setModelOptionsForModel(e,r,o),this._onModelModeChanged.fire({model:e,oldLanguageId:i})}_getSHA1Computer(){return new PD}};Sx.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20*1024*1024;Sx=Eg=Fke([O0(0,ni),O0(1,Pj),O0(2,LD),O0(3,Ni),O0(4,ao)],Sx);class PD{canComputeSHA1(e){return e.getValueLength()<=PD.MAX_MODEL_SIZE}computeSHA1(e){const t=new hD,i=e.createSnapshot();let s;for(;s=i.read();)t.update(s);return t.digest()}}PD.MAX_MODEL_SIZE=10*1024*1024;class zke{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:Y.None}}renderElement(e,t,i,s){var o;if((o=i.disposable)===null||o===void 0||o.dispose(),!i.data)return;const r=this.modelProvider();if(r.isResolved(e))return this.renderer.renderElement(r.get(e),e,i.data,s);const a=new Ir,l=r.resolve(e,a.token);i.disposable={dispose:()=>a.cancel()},this.renderer.renderPlaceholder(e,i.data),l.then(c=>this.renderer.renderElement(c,e,i.data,s))}disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}}class Hke{constructor(e,t){this.modelProvider=e,this.accessibilityProvider=t}getWidgetAriaLabel(){return this.accessibilityProvider.getWidgetAriaLabel()}getAriaLabel(e){const t=this.modelProvider();return t.isResolved(e)?this.accessibilityProvider.getAriaLabel(t.get(e)):null}}function $ke(n,e){return Object.assign(Object.assign({},e),{accessibilityProvider:e.accessibilityProvider&&new Hke(n,e.accessibilityProvider)})}class Uke{constructor(e,t,i,s,o={}){const r=()=>this.model,a=s.map(l=>new zke(l,r));this.list=new ga(e,t,i,a,$ke(r,o))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get widget(){return this.list}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return ue.map(this.list.onMouseDblClick,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onPointer(){return ue.map(this.list.onPointer,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onDidChangeSelection(){return ue.map(this.list.onDidChangeSelection,({elements:e,indexes:t,browserEvent:i})=>({elements:e.map(s=>this._model.get(s)),indexes:t,browserEvent:i}))}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,is(e.length))}getFocus(){return this.list.getFocus()}getSelection(){return this.list.getSelection()}getSelectedElements(){return this.getSelection().map(e=>this.model.get(e))}style(e){this.list.style(e)}dispose(){this.list.dispose()}}var a0=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};const jke=!1;var xx;(function(n){n.North="north",n.South="south",n.East="east",n.West="west"})(xx||(xx={}));let qke=4;const Gke=new B;let Kke=300;const Yke=new B;class s3{constructor(){this.disposables=new pe}get onPointerMove(){return this.disposables.add(new rt(window,"mousemove")).event}get onPointerUp(){return this.disposables.add(new rt(window,"mouseup")).event}dispose(){this.disposables.dispose()}}a0([ki],s3.prototype,"onPointerMove",null);a0([ki],s3.prototype,"onPointerUp",null);class o3{get onPointerMove(){return this.disposables.add(new rt(this.el,Ot.Change)).event}get onPointerUp(){return this.disposables.add(new rt(this.el,Ot.End)).event}constructor(e){this.el=e,this.disposables=new pe}dispose(){this.disposables.dispose()}}a0([ki],o3.prototype,"onPointerMove",null);a0([ki],o3.prototype,"onPointerUp",null);class Lx{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}a0([ki],Lx.prototype,"onPointerMove",null);a0([ki],Lx.prototype,"onPointerUp",null);const d8="pointer-events-disabled";class En extends Y{get state(){return this._state}get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}set state(e){this._state!==e&&(this.el.classList.toggle("disabled",e===0),this.el.classList.toggle("minimum",e===1),this.el.classList.toggle("maximum",e===2),this._state=e,this.onDidEnablementChange.fire(e))}set orthogonalStartSash(e){if(this._orthogonalStartSash!==e){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),e){const t=i=>{this.orthogonalStartDragHandleDisposables.clear(),i!==0&&(this._orthogonalStartDragHandle=le(this.el,ye(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(Ze(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(new rt(this._orthogonalStartDragHandle,"mouseenter")).event(()=>En.onMouseEnter(e),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new rt(this._orthogonalStartDragHandle,"mouseleave")).event(()=>En.onMouseLeave(e),void 0,this.orthogonalStartDragHandleDisposables))};this.orthogonalStartSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalStartSash=e}}set orthogonalEndSash(e){if(this._orthogonalEndSash!==e){if(this.orthogonalEndDragHandleDisposables.clear(),this.orthogonalEndSashDisposables.clear(),e){const t=i=>{this.orthogonalEndDragHandleDisposables.clear(),i!==0&&(this._orthogonalEndDragHandle=le(this.el,ye(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(Ze(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(new rt(this._orthogonalEndDragHandle,"mouseenter")).event(()=>En.onMouseEnter(e),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new rt(this._orthogonalEndDragHandle,"mouseleave")).event(()=>En.onMouseLeave(e),void 0,this.orthogonalEndDragHandleDisposables))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalEndSash=e}}constructor(e,t,i){super(),this.hoverDelay=Kke,this.hoverDelayer=this._register(new Du(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new B),this._onDidStart=this._register(new B),this._onDidChange=this._register(new B),this._onDidReset=this._register(new B),this._onDidEnd=this._register(new B),this.orthogonalStartSashDisposables=this._register(new pe),this.orthogonalStartDragHandleDisposables=this._register(new pe),this.orthogonalEndSashDisposables=this._register(new pe),this.orthogonalEndDragHandleDisposables=this._register(new pe),this.onDidStart=this._onDidStart.event,this.onDidChange=this._onDidChange.event,this.onDidReset=this._onDidReset.event,this.onDidEnd=this._onDidEnd.event,this.linkedSash=void 0,this.el=le(e,ye(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${i.orthogonalEdge}`),mt&&this.el.classList.add("mac");const s=this._register(new rt(this.el,"mousedown")).event;this._register(s(u=>this.onPointerStart(u,new s3),this));const o=this._register(new rt(this.el,"dblclick")).event;this._register(o(this.onPointerDoublePress,this));const r=this._register(new rt(this.el,"mouseenter")).event;this._register(r(()=>En.onMouseEnter(this)));const a=this._register(new rt(this.el,"mouseleave")).event;this._register(a(()=>En.onMouseLeave(this))),this._register(Mt.addTarget(this.el));const l=this._register(new rt(this.el,Ot.Start)).event;this._register(l(u=>this.onPointerStart(u,new o3(this.el)),this));const c=this._register(new rt(this.el,Ot.Tap)).event;let d;this._register(c(u=>{if(d){clearTimeout(d),d=void 0,this.onPointerDoublePress(u);return}clearTimeout(d),d=setTimeout(()=>d=void 0,250)},this)),typeof i.size=="number"?(this.size=i.size,i.orientation===0?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=qke,this._register(Gke.event(u=>{this.size=u,this.layout()}))),this._register(Yke.event(u=>this.hoverDelay=u)),this.layoutProvider=t,this.orthogonalStartSash=i.orthogonalStartSash,this.orthogonalEndSash=i.orthogonalEndSash,this.orientation=i.orientation||0,this.orientation===1?(this.el.classList.add("horizontal"),this.el.classList.remove("vertical")):(this.el.classList.remove("horizontal"),this.el.classList.add("vertical")),this.el.classList.toggle("debug",jke),this.layout()}onPointerStart(e,t){Ue.stop(e);let i=!1;if(!e.__orthogonalSashEvent){const g=this.getOrthogonalSash(e);g&&(i=!0,e.__orthogonalSashEvent=!0,g.onPointerStart(e,new Lx(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new Lx(t))),!this.state)return;const s=document.getElementsByTagName("iframe");for(const g of s)g.classList.add(d8);const o=e.pageX,r=e.pageY,a=e.altKey,l={startX:o,currentX:o,startY:r,currentY:r,altKey:a};this.el.classList.add("active"),this._onDidStart.fire(l);const c=kr(this.el),d=()=>{let g="";i?g="all-scroll":this.orientation===1?this.state===1?g="s-resize":this.state===2?g="n-resize":g=mt?"row-resize":"ns-resize":this.state===1?g="e-resize":this.state===2?g="w-resize":g=mt?"col-resize":"ew-resize",c.textContent=`* { cursor: ${g} !important; }`},u=new pe;d(),i||this.onDidEnablementChange.event(d,null,u);const h=g=>{Ue.stop(g,!1);const p={startX:o,currentX:g.pageX,startY:r,currentY:g.pageY,altKey:a};this._onDidChange.fire(p)},f=g=>{Ue.stop(g,!1),this.el.removeChild(c),this.el.classList.remove("active"),this._onDidEnd.fire(),u.dispose();for(const p of s)p.classList.remove(d8)};t.onPointerMove(h,null,u),t.onPointerUp(f,null,u),u.add(t)}onPointerDoublePress(e){const t=this.getOrthogonalSash(e);t&&t._onDidReset.fire(),this.linkedSash&&this.linkedSash._onDidReset.fire(),this._onDidReset.fire()}static onMouseEnter(e,t=!1){e.el.classList.contains("active")?(e.hoverDelayer.cancel(),e.el.classList.add("hover")):e.hoverDelayer.trigger(()=>e.el.classList.add("hover"),e.hoverDelay).then(void 0,()=>{}),!t&&e.linkedSash&&En.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&En.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){En.onMouseLeave(this)}layout(){if(this.orientation===0){const e=this.layoutProvider;this.el.style.left=e.getVerticalSashLeft(this)-this.size/2+"px",e.getVerticalSashTop&&(this.el.style.top=e.getVerticalSashTop(this)+"px"),e.getVerticalSashHeight&&(this.el.style.height=e.getVerticalSashHeight(this)+"px")}else{const e=this.layoutProvider;this.el.style.top=e.getHorizontalSashTop(this)-this.size/2+"px",e.getHorizontalSashLeft&&(this.el.style.left=e.getHorizontalSashLeft(this)+"px"),e.getHorizontalSashWidth&&(this.el.style.width=e.getHorizontalSashWidth(this)+"px")}}getOrthogonalSash(e){var t;const i=(t=e.initialTarget)!==null&&t!==void 0?t:e.target;if(!(!i||!(i instanceof HTMLElement))&&i.classList.contains("orthogonal-drag-handle"))return i.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash}dispose(){super.dispose(),this.el.remove()}}const Zke={separatorBorder:H.transparent};class zG{set size(e){this._size=e}get size(){return this._size}get visible(){return typeof this._cachedVisibleSize>"u"}setVisible(e,t){var i,s;e!==this.visible&&(e?(this.size=go(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize=typeof t=="number"?t:this.size,this.size=0),this.container.classList.toggle("visible",e),(s=(i=this.view).setVisible)===null||s===void 0||s.call(i,e))}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get proportionalLayout(){var e;return(e=this.view.proportionalLayout)!==null&&e!==void 0?e:!0}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}constructor(e,t,i,s){this.container=e,this.view=t,this.disposable=s,this._cachedVisibleSize=void 0,typeof i=="number"?(this._size=i,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=i.cachedVisibleSize)}layout(e,t){this.layoutContainer(e),this.view.layout(this.size,e,t)}dispose(){this.disposable.dispose()}}class Xke extends zG{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class Qke extends zG{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var Il;(function(n){n[n.Idle=0]="Idle",n[n.Busy=1]="Busy"})(Il||(Il={}));var Dx;(function(n){n.Distribute={type:"distribute"};function e(s){return{type:"split",index:s}}n.Split=e;function t(s){return{type:"auto",index:s}}n.Auto=t;function i(s){return{type:"invisible",cachedVisibleSize:s}}n.Invisible=i})(Dx||(Dx={}));class HG extends Y{get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}get startSnappingEnabled(){return this._startSnappingEnabled}get endSnappingEnabled(){return this._endSnappingEnabled}set orthogonalStartSash(e){for(const t of this.sashItems)t.sash.orthogonalStartSash=e;this._orthogonalStartSash=e}set orthogonalEndSash(e){for(const t of this.sashItems)t.sash.orthogonalEndSash=e;this._orthogonalEndSash=e}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}constructor(e,t={}){var i,s,o,r,a;super(),this.size=0,this.contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=Il.Idle,this._onDidSashChange=this._register(new B),this._onDidSashReset=this._register(new B),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=(i=t.orientation)!==null&&i!==void 0?i:0,this.inverseAltBehavior=(s=t.inverseAltBehavior)!==null&&s!==void 0?s:!1,this.proportionalLayout=(o=t.proportionalLayout)!==null&&o!==void 0?o:!0,this.getSashOrthogonalSize=t.getSashOrthogonalSize,this.el=document.createElement("div"),this.el.classList.add("monaco-split-view2"),this.el.classList.add(this.orientation===0?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=le(this.el,ye(".sash-container")),this.viewContainer=ye(".split-view-container"),this.scrollable=this._register(new Q1({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:qo})),this.scrollableElement=this._register(new CP(this.viewContainer,{vertical:this.orientation===0?(r=t.scrollbarVisibility)!==null&&r!==void 0?r:1:2,horizontal:this.orientation===1?(a=t.scrollbarVisibility)!==null&&a!==void 0?a:1:2},this.scrollable));const l=this._register(new rt(this.viewContainer,"scroll")).event;this._register(l(c=>{const d=this.scrollableElement.getScrollPosition(),u=Math.abs(this.viewContainer.scrollLeft-d.scrollLeft)<=1?void 0:this.viewContainer.scrollLeft,h=Math.abs(this.viewContainer.scrollTop-d.scrollTop)<=1?void 0:this.viewContainer.scrollTop;(u!==void 0||h!==void 0)&&this.scrollableElement.setScrollPosition({scrollLeft:u,scrollTop:h})})),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll(c=>{c.scrollTopChanged&&(this.viewContainer.scrollTop=c.scrollTop),c.scrollLeftChanged&&(this.viewContainer.scrollLeft=c.scrollLeft)})),le(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||Zke),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((c,d)=>{const u=Ks(c.visible)||c.visible?c.size:{type:"invisible",cachedVisibleSize:c.size},h=c.view;this.doAddView(h,u,d,!0)}),this.contentSize=this.viewItems.reduce((c,d)=>c+d.size,0),this.saveProportions())}style(e){e.separatorBorder.isTransparent()?(this.el.classList.remove("separator-border"),this.el.style.removeProperty("--separator-border")):(this.el.classList.add("separator-border"),this.el.style.setProperty("--separator-border",e.separatorBorder.toString()))}addView(e,t,i=this.viewItems.length,s){this.doAddView(e,t,i,s)}layout(e,t){const i=Math.max(this.size,this.contentSize);if(this.size=e,this.layoutContext=t,this.proportions){let s=0;for(let o=0;othis.viewItems[a].priority===1),r=s.filter(a=>this.viewItems[a].priority===2);this.resize(this.viewItems.length-1,e-i,void 0,o,r)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this.contentSize>0&&(this.proportions=this.viewItems.map(e=>e.proportionalLayout?e.size/this.contentSize:void 0))}onSashStart({sash:e,start:t,alt:i}){for(const a of this.viewItems)a.enabled=!1;const s=this.sashItems.findIndex(a=>a.sash===e),o=br(K(document.body,"keydown",a=>r(this.sashDragState.current,a.altKey)),K(document.body,"keyup",()=>r(this.sashDragState.current,!1))),r=(a,l)=>{const c=this.viewItems.map(g=>g.size);let d=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(l=!l),l)if(s===this.sashItems.length-1){const p=this.viewItems[s];d=(p.minimumSize-p.size)/2,u=(p.maximumSize-p.size)/2}else{const p=this.viewItems[s+1];d=(p.size-p.maximumSize)/2,u=(p.size-p.minimumSize)/2}let h,f;if(!l){const g=is(s,-1),p=is(s+1,this.viewItems.length),_=g.reduce((D,k)=>D+(this.viewItems[k].minimumSize-c[k]),0),v=g.reduce((D,k)=>D+(this.viewItems[k].viewMaximumSize-c[k]),0),b=p.length===0?Number.POSITIVE_INFINITY:p.reduce((D,k)=>D+(c[k]-this.viewItems[k].minimumSize),0),y=p.length===0?Number.NEGATIVE_INFINITY:p.reduce((D,k)=>D+(c[k]-this.viewItems[k].viewMaximumSize),0),w=Math.max(_,y),C=Math.min(b,v),L=this.findFirstSnapIndex(g),x=this.findFirstSnapIndex(p);if(typeof L=="number"){const D=this.viewItems[L],k=Math.floor(D.viewMinimumSize/2);h={index:L,limitDelta:D.visible?w-k:w+k,size:D.size}}if(typeof x=="number"){const D=this.viewItems[x],k=Math.floor(D.viewMinimumSize/2);f={index:x,limitDelta:D.visible?C+k:C-k,size:D.size}}}this.sashDragState={start:a,current:a,index:s,sizes:c,minDelta:d,maxDelta:u,alt:l,snapBefore:h,snapAfter:f,disposable:o}};r(t,i)}onSashChange({current:e}){const{index:t,start:i,sizes:s,alt:o,minDelta:r,maxDelta:a,snapBefore:l,snapAfter:c}=this.sashDragState;this.sashDragState.current=e;const d=e-i,u=this.resize(t,d,s,void 0,void 0,r,a,l,c);if(o){const h=t===this.sashItems.length-1,f=this.viewItems.map(y=>y.size),g=h?t:t+1,p=this.viewItems[g],_=p.size-p.maximumSize,v=p.size-p.minimumSize,b=h?t-1:t+1;this.resize(b,-u,f,void 0,void 0,_,v)}this.distributeEmptySpace(),this.layoutViews()}onSashEnd(e){this._onDidSashChange.fire(e),this.sashDragState.disposable.dispose(),this.saveProportions();for(const t of this.viewItems)t.enabled=!0}onViewChange(e,t){const i=this.viewItems.indexOf(e);i<0||i>=this.viewItems.length||(t=typeof t=="number"?t:e.size,t=go(t,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&i>0?(this.resize(i-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([i],void 0)))}resizeView(e,t){if(this.state!==Il.Idle)throw new Error("Cant modify splitview");if(this.state=Il.Busy,e<0||e>=this.viewItems.length)return;const i=is(this.viewItems.length).filter(a=>a!==e),s=[...i.filter(a=>this.viewItems[a].priority===1),e],o=i.filter(a=>this.viewItems[a].priority===2),r=this.viewItems[e];t=Math.round(t),t=go(t,r.minimumSize,Math.min(r.maximumSize,this.size)),r.size=t,this.relayout(s,o),this.state=Il.Idle}distributeViewSizes(){const e=[];let t=0;for(const a of this.viewItems)a.maximumSize-a.minimumSize>0&&(e.push(a),t+=a.size);const i=Math.floor(t/e.length);for(const a of e)a.size=go(i,a.minimumSize,a.maximumSize);const s=is(this.viewItems.length),o=s.filter(a=>this.viewItems[a].priority===1),r=s.filter(a=>this.viewItems[a].priority===2);this.relayout(o,r)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,i=this.viewItems.length,s){if(this.state!==Il.Idle)throw new Error("Cant modify splitview");this.state=Il.Busy;const o=ye(".split-view-view");i===this.viewItems.length?this.viewContainer.appendChild(o):this.viewContainer.insertBefore(o,this.viewContainer.children.item(i));const r=e.onDidChange(h=>this.onViewChange(d,h)),a=Ze(()=>this.viewContainer.removeChild(o)),l=br(r,a);let c;typeof t=="number"?c=t:(t.type==="auto"&&(this.areViewsDistributed()?t={type:"distribute"}:t={type:"split",index:t.index}),t.type==="split"?c=this.getViewSize(t.index)/2:t.type==="invisible"?c={cachedVisibleSize:t.cachedVisibleSize}:c=e.minimumSize);const d=this.orientation===0?new Xke(o,e,c,l):new Qke(o,e,c,l);if(this.viewItems.splice(i,0,d),this.viewItems.length>1){const h={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},f=this.orientation===0?new En(this.sashContainer,{getHorizontalSashTop:D=>this.getSashPosition(D),getHorizontalSashWidth:this.getSashOrthogonalSize},Object.assign(Object.assign({},h),{orientation:1})):new En(this.sashContainer,{getVerticalSashLeft:D=>this.getSashPosition(D),getVerticalSashHeight:this.getSashOrthogonalSize},Object.assign(Object.assign({},h),{orientation:0})),g=this.orientation===0?D=>({sash:f,start:D.startY,current:D.currentY,alt:D.altKey}):D=>({sash:f,start:D.startX,current:D.currentX,alt:D.altKey}),_=ue.map(f.onDidStart,g)(this.onSashStart,this),b=ue.map(f.onDidChange,g)(this.onSashChange,this),w=ue.map(f.onDidEnd,()=>this.sashItems.findIndex(D=>D.sash===f))(this.onSashEnd,this),C=f.onDidReset(()=>{const D=this.sashItems.findIndex(R=>R.sash===f),k=is(D,-1),P=is(D+1,this.viewItems.length),O=this.findFirstSnapIndex(k),M=this.findFirstSnapIndex(P);typeof O=="number"&&!this.viewItems[O].visible||typeof M=="number"&&!this.viewItems[M].visible||this._onDidSashReset.fire(D)}),L=br(_,b,w,C,f),x={sash:f,disposable:L};this.sashItems.splice(i-1,0,x)}o.appendChild(e.element);let u;typeof t!="number"&&t.type==="split"&&(u=[t.index]),s||this.relayout([i],u),this.state=Il.Idle,!s&&typeof t!="number"&&t.type==="distribute"&&this.distributeViewSizes()}relayout(e,t){const i=this.viewItems.reduce((s,o)=>s+o.size,0);this.resize(this.viewItems.length-1,this.size-i,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(e,t,i=this.viewItems.map(d=>d.size),s,o,r=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,l,c){if(e<0||e>=this.viewItems.length)return 0;const d=is(e,-1),u=is(e+1,this.viewItems.length);if(o)for(const x of o)Yk(d,x),Yk(u,x);if(s)for(const x of s)zy(d,x),zy(u,x);const h=d.map(x=>this.viewItems[x]),f=d.map(x=>i[x]),g=u.map(x=>this.viewItems[x]),p=u.map(x=>i[x]),_=d.reduce((x,D)=>x+(this.viewItems[D].minimumSize-i[D]),0),v=d.reduce((x,D)=>x+(this.viewItems[D].maximumSize-i[D]),0),b=u.length===0?Number.POSITIVE_INFINITY:u.reduce((x,D)=>x+(i[D]-this.viewItems[D].minimumSize),0),y=u.length===0?Number.NEGATIVE_INFINITY:u.reduce((x,D)=>x+(i[D]-this.viewItems[D].maximumSize),0),w=Math.max(_,y,r),C=Math.min(b,v,a);let L=!1;if(l){const x=this.viewItems[l.index],D=t>=l.limitDelta;L=D!==x.visible,x.setVisible(D,l.size)}if(!L&&c){const x=this.viewItems[c.index],D=ta+l.size,0);let i=this.size-t;const s=is(this.viewItems.length-1,-1),o=s.filter(a=>this.viewItems[a].priority===1),r=s.filter(a=>this.viewItems[a].priority===2);for(const a of r)Yk(s,a);for(const a of o)zy(s,a);typeof e=="number"&&zy(s,e);for(let a=0;i!==0&&at+i.size,0);let e=0;for(const t of this.viewItems)t.layout(e,this.layoutContext),e+=t.size;this.sashItems.forEach(t=>t.sash.layout()),this.updateSashEnablement(),this.updateScrollableElement()}updateScrollableElement(){this.orientation===0?this.scrollableElement.setScrollDimensions({height:this.size,scrollHeight:this.contentSize}):this.scrollableElement.setScrollDimensions({width:this.size,scrollWidth:this.contentSize})}updateSashEnablement(){let e=!1;const t=this.viewItems.map(l=>e=l.size-l.minimumSize>0||e);e=!1;const i=this.viewItems.map(l=>e=l.maximumSize-l.size>0||e),s=[...this.viewItems].reverse();e=!1;const o=s.map(l=>e=l.size-l.minimumSize>0||e).reverse();e=!1;const r=s.map(l=>e=l.maximumSize-l.size>0||e).reverse();let a=0;for(let l=0;l0||this.startSnappingEnabled)?c.state=1:b&&t[l]&&(a0)return;if(!i.visible&&i.snap)return t}}areViewsDistributed(){let e,t;for(const i of this.viewItems)if(e=e===void 0?i.size:Math.min(e,i.size),t=t===void 0?i.size:Math.max(t,i.size),t-e>2)return!1;return!0}dispose(){var e;(e=this.sashDragState)===null||e===void 0||e.disposable.dispose(),Bt(this.viewItems),this.viewItems=[],this.sashItems.forEach(t=>t.disposable.dispose()),this.sashItems=[],super.dispose()}}class ay{constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=ay.TemplateId,this.renderedTemplates=new Set;const s=new Map(t.map(o=>[o.templateId,o]));this.renderers=[];for(const o of e){const r=s.get(o.templateId);if(!r)throw new Error(`Table cell renderer for template id ${o.templateId} not found.`);this.renderers.push(r)}}renderTemplate(e){const t=le(e,ye(".monaco-table-tr")),i=[],s=[];for(let r=0;rnew e2e(d,u)),l={size:a.reduce((d,u)=>d+u.column.weight,0),views:a.map(d=>({size:d.column.weight,view:d}))};this.splitview=this.disposables.add(new HG(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:l})),this.splitview.el.style.height=`${i.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${i.headerRowHeight}px`;const c=new ay(s,o,d=>this.splitview.getViewSize(d));this.list=this.disposables.add(new ga(e,this.domNode,Jke(i),[c],r)),ue.any(...a.map(d=>d.onDidLayout))(([d,u])=>c.layoutColumn(d,u),null,this.disposables),this.splitview.onDidSashReset(d=>{const u=s.reduce((f,g)=>f+g.weight,0),h=s[d].weight/u*this.cachedWidth;this.splitview.resizeView(d,h)},null,this.disposables),this.styleElement=kr(this.domNode),this.style(nke)}updateOptions(e){this.list.updateOptions(e)}splice(e,t,i=[]){this.list.splice(e,t,i)}getHTMLElement(){return this.domNode}style(e){const t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before { +`}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return typeof e=="boolean"?e:!0}getCreationOptions(e,t,i){const s=typeof e=="string"?e:e.languageId;let o=this._modelCreationOptionsByLanguageAndResource[s+t];if(!o){const r=this._configurationService.getValue("editor",{overrideIdentifier:s,resource:t}),a=this._getEOL(t,s);o=Tg._readModelOptions({editor:r,eol:a},i),this._modelCreationOptionsByLanguageAndResource[s+t]=o}return o}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const i=Object.keys(this._models);for(let s=0,o=i.length;se){const t=[];for(this._disposedModels.forEach(i=>{i.sharesUndoRedoStack||t.push(i)}),t.sort((i,s)=>i.time-s.time);t.length>0&&this._disposedModelsHeapSize>e;){const i=t.shift();this._removeDisposedModel(i.uri),i.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(i.initialUndoRedoSnapshot)}}}_createModelData(e,t,i,s){const o=this.getCreationOptions(t,i,s),r=new rl(e,t,o,i,this._undoRedoService,this._languageService,this._languageConfigurationService);if(i&&this._disposedModels.has(Ku(i))){const c=this._removeDisposedModel(i),d=this._undoRedoService.getElements(i),u=this._getSHA1Computer(),h=u.canComputeSHA1(r)?u.computeSHA1(r)===c.sha1:!1;if(h||c.sharesUndoRedoStack){for(const f of d.past)Pl(f)&&f.matchesResource(i)&&f.setModel(r);for(const f of d.future)Pl(f)&&f.matchesResource(i)&&f.setModel(r);this._undoRedoService.setElementsValidFlag(i,!0,f=>Pl(f)&&f.matchesResource(i)),h&&(r._overwriteVersionId(c.versionId),r._overwriteAlternativeVersionId(c.alternativeVersionId),r._overwriteInitialUndoRedoSnapshot(c.initialUndoRedoSnapshot))}else c.initialUndoRedoSnapshot!==null&&this._undoRedoService.restoreSnapshot(c.initialUndoRedoSnapshot)}const a=Ku(r.uri);if(this._models[a])throw new Error("ModelService: Cannot add model because it already exists!");const l=new s2e(r,c=>this._onWillDispose(c),(c,d)=>this._onDidChangeLanguage(c,d));return this._models[a]=l,l}createModel(e,t,i,s=!1){let o;return t?o=this._createModelData(e,t,i,s):o=this._createModelData(e,Ho,i,s),this._onModelAdded.fire(o.model),o.model}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,s=t.length;i0||c.future.length>0){for(const d of c.past)Pl(d)&&d.matchesResource(e.uri)&&(o=!0,r+=d.heapSize(e.uri),d.setModel(e.uri));for(const d of c.future)Pl(d)&&d.matchesResource(e.uri)&&(o=!0,r+=d.heapSize(e.uri),d.setModel(e.uri))}}const a=Tg.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,l=this._getSHA1Computer();if(o)if(!s&&(r>a||!l.canComputeSHA1(e))){const c=i.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}else this._ensureDisposedModelsHeapSize(a-r),this._undoRedoService.setElementsValidFlag(e.uri,!1,c=>Pl(c)&&c.matchesResource(e.uri)),this._insertDisposedModel(new r2e(e.uri,i.model.getInitialUndoRedoSnapshot(),Date.now(),s,r,l.computeSHA1(e),e.getVersionId(),e.getAlternativeVersionId()));else if(!s){const c=i.model.getInitialUndoRedoSnapshot();c!==null&&this._undoRedoService.restoreSnapshot(c)}delete this._models[t],i.dispose(),delete this._modelCreationOptionsByLanguageAndResource[e.getLanguageId()+e.uri],this._onModelRemoved.fire(e)}_onDidChangeLanguage(e,t){const i=t.oldLanguage,s=e.getLanguageId(),o=this.getCreationOptions(i,e.uri,e.isForSimpleWidget),r=this.getCreationOptions(s,e.uri,e.isForSimpleWidget);Tg._setModelOptionsForModel(e,r,o),this._onModelModeChanged.fire({model:e,oldLanguageId:i})}_getSHA1Computer(){return new ED}};mx.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20*1024*1024;mx=Tg=n2e([V0(0,ii),V0(1,Mj),V0(2,bD),V0(3,Ni),V0(4,so)],mx);class ED{canComputeSHA1(e){return e.getValueLength()<=ED.MAX_MODEL_SIZE}computeSHA1(e){const t=new oD,i=e.createSnapshot();let s;for(;s=i.read();)t.update(s);return t.digest()}}ED.MAX_MODEL_SIZE=10*1024*1024;class a2e{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:Y.None}}renderElement(e,t,i,s){var o;if((o=i.disposable)===null||o===void 0||o.dispose(),!i.data)return;const r=this.modelProvider();if(r.isResolved(e))return this.renderer.renderElement(r.get(e),e,i.data,s);const a=new Ar,l=r.resolve(e,a.token);i.disposable={dispose:()=>a.cancel()},this.renderer.renderPlaceholder(e,i.data),l.then(c=>this.renderer.renderElement(c,e,i.data,s))}disposeTemplate(e){e.disposable&&(e.disposable.dispose(),e.disposable=void 0),e.data&&(this.renderer.disposeTemplate(e.data),e.data=void 0)}}class l2e{constructor(e,t){this.modelProvider=e,this.accessibilityProvider=t}getWidgetAriaLabel(){return this.accessibilityProvider.getWidgetAriaLabel()}getAriaLabel(e){const t=this.modelProvider();return t.isResolved(e)?this.accessibilityProvider.getAriaLabel(t.get(e)):null}}function c2e(n,e){return Object.assign(Object.assign({},e),{accessibilityProvider:e.accessibilityProvider&&new l2e(n,e.accessibilityProvider)})}class d2e{constructor(e,t,i,s,o={}){const r=()=>this.model,a=s.map(l=>new a2e(l,r));this.list=new ha(e,t,i,a,c2e(r,o))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get widget(){return this.list}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return ue.map(this.list.onMouseDblClick,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onPointer(){return ue.map(this.list.onPointer,({element:e,index:t,browserEvent:i})=>({element:e===void 0?void 0:this._model.get(e),index:t,browserEvent:i}))}get onDidChangeSelection(){return ue.map(this.list.onDidChangeSelection,({elements:e,indexes:t,browserEvent:i})=>({elements:e.map(s=>this._model.get(s)),indexes:t,browserEvent:i}))}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,es(e.length))}getFocus(){return this.list.getFocus()}getSelection(){return this.list.getSelection()}getSelectedElements(){return this.getSelection().map(e=>this.model.get(e))}style(e){this.list.style(e)}dispose(){this.list.dispose()}}var u0=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};const u2e=!1;var _x;(function(n){n.North="north",n.South="south",n.East="east",n.West="west"})(_x||(_x={}));let h2e=4;const f2e=new B;let g2e=300;const p2e=new B;class iP{constructor(){this.disposables=new pe}get onPointerMove(){return this.disposables.add(new ot(window,"mousemove")).event}get onPointerUp(){return this.disposables.add(new ot(window,"mouseup")).event}dispose(){this.disposables.dispose()}}u0([Di],iP.prototype,"onPointerMove",null);u0([Di],iP.prototype,"onPointerUp",null);class nP{get onPointerMove(){return this.disposables.add(new ot(this.el,Pt.Change)).event}get onPointerUp(){return this.disposables.add(new ot(this.el,Pt.End)).event}constructor(e){this.el=e,this.disposables=new pe}dispose(){this.disposables.dispose()}}u0([Di],nP.prototype,"onPointerMove",null);u0([Di],nP.prototype,"onPointerUp",null);class bx{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}u0([Di],bx.prototype,"onPointerMove",null);u0([Di],bx.prototype,"onPointerUp",null);const r8="pointer-events-disabled";class Dn extends Y{get state(){return this._state}get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}set state(e){this._state!==e&&(this.el.classList.toggle("disabled",e===0),this.el.classList.toggle("minimum",e===1),this.el.classList.toggle("maximum",e===2),this._state=e,this.onDidEnablementChange.fire(e))}set orthogonalStartSash(e){if(this._orthogonalStartSash!==e){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),e){const t=i=>{this.orthogonalStartDragHandleDisposables.clear(),i!==0&&(this._orthogonalStartDragHandle=le(this.el,ye(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(Ye(()=>this._orthogonalStartDragHandle.remove())),this.orthogonalStartDragHandleDisposables.add(new ot(this._orthogonalStartDragHandle,"mouseenter")).event(()=>Dn.onMouseEnter(e),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new ot(this._orthogonalStartDragHandle,"mouseleave")).event(()=>Dn.onMouseLeave(e),void 0,this.orthogonalStartDragHandleDisposables))};this.orthogonalStartSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalStartSash=e}}set orthogonalEndSash(e){if(this._orthogonalEndSash!==e){if(this.orthogonalEndDragHandleDisposables.clear(),this.orthogonalEndSashDisposables.clear(),e){const t=i=>{this.orthogonalEndDragHandleDisposables.clear(),i!==0&&(this._orthogonalEndDragHandle=le(this.el,ye(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(Ye(()=>this._orthogonalEndDragHandle.remove())),this.orthogonalEndDragHandleDisposables.add(new ot(this._orthogonalEndDragHandle,"mouseenter")).event(()=>Dn.onMouseEnter(e),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new ot(this._orthogonalEndDragHandle,"mouseleave")).event(()=>Dn.onMouseLeave(e),void 0,this.orthogonalEndDragHandleDisposables))};this.orthogonalEndSashDisposables.add(e.onDidEnablementChange.event(t,this)),t(e.state)}this._orthogonalEndSash=e}}constructor(e,t,i){super(),this.hoverDelay=g2e,this.hoverDelayer=this._register(new ku(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new B),this._onDidStart=this._register(new B),this._onDidChange=this._register(new B),this._onDidReset=this._register(new B),this._onDidEnd=this._register(new B),this.orthogonalStartSashDisposables=this._register(new pe),this.orthogonalStartDragHandleDisposables=this._register(new pe),this.orthogonalEndSashDisposables=this._register(new pe),this.orthogonalEndDragHandleDisposables=this._register(new pe),this.onDidStart=this._onDidStart.event,this.onDidChange=this._onDidChange.event,this.onDidReset=this._onDidReset.event,this.onDidEnd=this._onDidEnd.event,this.linkedSash=void 0,this.el=le(e,ye(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${i.orthogonalEdge}`),pt&&this.el.classList.add("mac");const s=this._register(new ot(this.el,"mousedown")).event;this._register(s(u=>this.onPointerStart(u,new iP),this));const o=this._register(new ot(this.el,"dblclick")).event;this._register(o(this.onPointerDoublePress,this));const r=this._register(new ot(this.el,"mouseenter")).event;this._register(r(()=>Dn.onMouseEnter(this)));const a=this._register(new ot(this.el,"mouseleave")).event;this._register(a(()=>Dn.onMouseLeave(this))),this._register(Rt.addTarget(this.el));const l=this._register(new ot(this.el,Pt.Start)).event;this._register(l(u=>this.onPointerStart(u,new nP(this.el)),this));const c=this._register(new ot(this.el,Pt.Tap)).event;let d;this._register(c(u=>{if(d){clearTimeout(d),d=void 0,this.onPointerDoublePress(u);return}clearTimeout(d),d=setTimeout(()=>d=void 0,250)},this)),typeof i.size=="number"?(this.size=i.size,i.orientation===0?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=h2e,this._register(f2e.event(u=>{this.size=u,this.layout()}))),this._register(p2e.event(u=>this.hoverDelay=u)),this.layoutProvider=t,this.orthogonalStartSash=i.orthogonalStartSash,this.orthogonalEndSash=i.orthogonalEndSash,this.orientation=i.orientation||0,this.orientation===1?(this.el.classList.add("horizontal"),this.el.classList.remove("vertical")):(this.el.classList.remove("horizontal"),this.el.classList.add("vertical")),this.el.classList.toggle("debug",u2e),this.layout()}onPointerStart(e,t){$e.stop(e);let i=!1;if(!e.__orthogonalSashEvent){const g=this.getOrthogonalSash(e);g&&(i=!0,e.__orthogonalSashEvent=!0,g.onPointerStart(e,new bx(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new bx(t))),!this.state)return;const s=document.getElementsByTagName("iframe");for(const g of s)g.classList.add(r8);const o=e.pageX,r=e.pageY,a=e.altKey,l={startX:o,currentX:o,startY:r,currentY:r,altKey:a};this.el.classList.add("active"),this._onDidStart.fire(l);const c=Dr(this.el),d=()=>{let g="";i?g="all-scroll":this.orientation===1?this.state===1?g="s-resize":this.state===2?g="n-resize":g=pt?"row-resize":"ns-resize":this.state===1?g="e-resize":this.state===2?g="w-resize":g=pt?"col-resize":"ew-resize",c.textContent=`* { cursor: ${g} !important; }`},u=new pe;d(),i||this.onDidEnablementChange.event(d,null,u);const h=g=>{$e.stop(g,!1);const p={startX:o,currentX:g.pageX,startY:r,currentY:g.pageY,altKey:a};this._onDidChange.fire(p)},f=g=>{$e.stop(g,!1),this.el.removeChild(c),this.el.classList.remove("active"),this._onDidEnd.fire(),u.dispose();for(const p of s)p.classList.remove(r8)};t.onPointerMove(h,null,u),t.onPointerUp(f,null,u),u.add(t)}onPointerDoublePress(e){const t=this.getOrthogonalSash(e);t&&t._onDidReset.fire(),this.linkedSash&&this.linkedSash._onDidReset.fire(),this._onDidReset.fire()}static onMouseEnter(e,t=!1){e.el.classList.contains("active")?(e.hoverDelayer.cancel(),e.el.classList.add("hover")):e.hoverDelayer.trigger(()=>e.el.classList.add("hover"),e.hoverDelay).then(void 0,()=>{}),!t&&e.linkedSash&&Dn.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&Dn.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){Dn.onMouseLeave(this)}layout(){if(this.orientation===0){const e=this.layoutProvider;this.el.style.left=e.getVerticalSashLeft(this)-this.size/2+"px",e.getVerticalSashTop&&(this.el.style.top=e.getVerticalSashTop(this)+"px"),e.getVerticalSashHeight&&(this.el.style.height=e.getVerticalSashHeight(this)+"px")}else{const e=this.layoutProvider;this.el.style.top=e.getHorizontalSashTop(this)-this.size/2+"px",e.getHorizontalSashLeft&&(this.el.style.left=e.getHorizontalSashLeft(this)+"px"),e.getHorizontalSashWidth&&(this.el.style.width=e.getHorizontalSashWidth(this)+"px")}}getOrthogonalSash(e){var t;const i=(t=e.initialTarget)!==null&&t!==void 0?t:e.target;if(!(!i||!(i instanceof HTMLElement))&&i.classList.contains("orthogonal-drag-handle"))return i.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash}dispose(){super.dispose(),this.el.remove()}}const m2e={separatorBorder:H.transparent};class VG{set size(e){this._size=e}get size(){return this._size}get visible(){return typeof this._cachedVisibleSize>"u"}setVisible(e,t){var i,s;e!==this.visible&&(e?(this.size=uo(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize=typeof t=="number"?t:this.size,this.size=0),this.container.classList.toggle("visible",e),(s=(i=this.view).setVisible)===null||s===void 0||s.call(i,e))}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get proportionalLayout(){var e;return(e=this.view.proportionalLayout)!==null&&e!==void 0?e:!0}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}constructor(e,t,i,s){this.container=e,this.view=t,this.disposable=s,this._cachedVisibleSize=void 0,typeof i=="number"?(this._size=i,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=i.cachedVisibleSize)}layout(e,t){this.layoutContainer(e),this.view.layout(this.size,e,t)}dispose(){this.disposable.dispose()}}class _2e extends VG{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class b2e extends VG{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var Tl;(function(n){n[n.Idle=0]="Idle",n[n.Busy=1]="Busy"})(Tl||(Tl={}));var vx;(function(n){n.Distribute={type:"distribute"};function e(s){return{type:"split",index:s}}n.Split=e;function t(s){return{type:"auto",index:s}}n.Auto=t;function i(s){return{type:"invisible",cachedVisibleSize:s}}n.Invisible=i})(vx||(vx={}));class zG extends Y{get orthogonalStartSash(){return this._orthogonalStartSash}get orthogonalEndSash(){return this._orthogonalEndSash}get startSnappingEnabled(){return this._startSnappingEnabled}get endSnappingEnabled(){return this._endSnappingEnabled}set orthogonalStartSash(e){for(const t of this.sashItems)t.sash.orthogonalStartSash=e;this._orthogonalStartSash=e}set orthogonalEndSash(e){for(const t of this.sashItems)t.sash.orthogonalEndSash=e;this._orthogonalEndSash=e}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}constructor(e,t={}){var i,s,o,r,a;super(),this.size=0,this.contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=Tl.Idle,this._onDidSashChange=this._register(new B),this._onDidSashReset=this._register(new B),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=(i=t.orientation)!==null&&i!==void 0?i:0,this.inverseAltBehavior=(s=t.inverseAltBehavior)!==null&&s!==void 0?s:!1,this.proportionalLayout=(o=t.proportionalLayout)!==null&&o!==void 0?o:!0,this.getSashOrthogonalSize=t.getSashOrthogonalSize,this.el=document.createElement("div"),this.el.classList.add("monaco-split-view2"),this.el.classList.add(this.orientation===0?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=le(this.el,ye(".sash-container")),this.viewContainer=ye(".split-view-container"),this.scrollable=this._register(new ey({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:jo})),this.scrollableElement=this._register(new y3(this.viewContainer,{vertical:this.orientation===0?(r=t.scrollbarVisibility)!==null&&r!==void 0?r:1:2,horizontal:this.orientation===1?(a=t.scrollbarVisibility)!==null&&a!==void 0?a:1:2},this.scrollable));const l=this._register(new ot(this.viewContainer,"scroll")).event;this._register(l(c=>{const d=this.scrollableElement.getScrollPosition(),u=Math.abs(this.viewContainer.scrollLeft-d.scrollLeft)<=1?void 0:this.viewContainer.scrollLeft,h=Math.abs(this.viewContainer.scrollTop-d.scrollTop)<=1?void 0:this.viewContainer.scrollTop;(u!==void 0||h!==void 0)&&this.scrollableElement.setScrollPosition({scrollLeft:u,scrollTop:h})})),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll(c=>{c.scrollTopChanged&&(this.viewContainer.scrollTop=c.scrollTop),c.scrollLeftChanged&&(this.viewContainer.scrollLeft=c.scrollLeft)})),le(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||m2e),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach((c,d)=>{const u=qs(c.visible)||c.visible?c.size:{type:"invisible",cachedVisibleSize:c.size},h=c.view;this.doAddView(h,u,d,!0)}),this.contentSize=this.viewItems.reduce((c,d)=>c+d.size,0),this.saveProportions())}style(e){e.separatorBorder.isTransparent()?(this.el.classList.remove("separator-border"),this.el.style.removeProperty("--separator-border")):(this.el.classList.add("separator-border"),this.el.style.setProperty("--separator-border",e.separatorBorder.toString()))}addView(e,t,i=this.viewItems.length,s){this.doAddView(e,t,i,s)}layout(e,t){const i=Math.max(this.size,this.contentSize);if(this.size=e,this.layoutContext=t,this.proportions){let s=0;for(let o=0;othis.viewItems[a].priority===1),r=s.filter(a=>this.viewItems[a].priority===2);this.resize(this.viewItems.length-1,e-i,void 0,o,r)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this.contentSize>0&&(this.proportions=this.viewItems.map(e=>e.proportionalLayout?e.size/this.contentSize:void 0))}onSashStart({sash:e,start:t,alt:i}){for(const a of this.viewItems)a.enabled=!1;const s=this.sashItems.findIndex(a=>a.sash===e),o=_r(K(document.body,"keydown",a=>r(this.sashDragState.current,a.altKey)),K(document.body,"keyup",()=>r(this.sashDragState.current,!1))),r=(a,l)=>{const c=this.viewItems.map(g=>g.size);let d=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(l=!l),l)if(s===this.sashItems.length-1){const p=this.viewItems[s];d=(p.minimumSize-p.size)/2,u=(p.maximumSize-p.size)/2}else{const p=this.viewItems[s+1];d=(p.size-p.maximumSize)/2,u=(p.size-p.minimumSize)/2}let h,f;if(!l){const g=es(s,-1),p=es(s+1,this.viewItems.length),_=g.reduce((D,k)=>D+(this.viewItems[k].minimumSize-c[k]),0),v=g.reduce((D,k)=>D+(this.viewItems[k].viewMaximumSize-c[k]),0),b=p.length===0?Number.POSITIVE_INFINITY:p.reduce((D,k)=>D+(c[k]-this.viewItems[k].minimumSize),0),y=p.length===0?Number.NEGATIVE_INFINITY:p.reduce((D,k)=>D+(c[k]-this.viewItems[k].viewMaximumSize),0),w=Math.max(_,y),S=Math.min(b,v),L=this.findFirstSnapIndex(g),x=this.findFirstSnapIndex(p);if(typeof L=="number"){const D=this.viewItems[L],k=Math.floor(D.viewMinimumSize/2);h={index:L,limitDelta:D.visible?w-k:w+k,size:D.size}}if(typeof x=="number"){const D=this.viewItems[x],k=Math.floor(D.viewMinimumSize/2);f={index:x,limitDelta:D.visible?S+k:S-k,size:D.size}}}this.sashDragState={start:a,current:a,index:s,sizes:c,minDelta:d,maxDelta:u,alt:l,snapBefore:h,snapAfter:f,disposable:o}};r(t,i)}onSashChange({current:e}){const{index:t,start:i,sizes:s,alt:o,minDelta:r,maxDelta:a,snapBefore:l,snapAfter:c}=this.sashDragState;this.sashDragState.current=e;const d=e-i,u=this.resize(t,d,s,void 0,void 0,r,a,l,c);if(o){const h=t===this.sashItems.length-1,f=this.viewItems.map(y=>y.size),g=h?t:t+1,p=this.viewItems[g],_=p.size-p.maximumSize,v=p.size-p.minimumSize,b=h?t-1:t+1;this.resize(b,-u,f,void 0,void 0,_,v)}this.distributeEmptySpace(),this.layoutViews()}onSashEnd(e){this._onDidSashChange.fire(e),this.sashDragState.disposable.dispose(),this.saveProportions();for(const t of this.viewItems)t.enabled=!0}onViewChange(e,t){const i=this.viewItems.indexOf(e);i<0||i>=this.viewItems.length||(t=typeof t=="number"?t:e.size,t=uo(t,e.minimumSize,e.maximumSize),this.inverseAltBehavior&&i>0?(this.resize(i-1,Math.floor((e.size-t)/2)),this.distributeEmptySpace(),this.layoutViews()):(e.size=t,this.relayout([i],void 0)))}resizeView(e,t){if(this.state!==Tl.Idle)throw new Error("Cant modify splitview");if(this.state=Tl.Busy,e<0||e>=this.viewItems.length)return;const i=es(this.viewItems.length).filter(a=>a!==e),s=[...i.filter(a=>this.viewItems[a].priority===1),e],o=i.filter(a=>this.viewItems[a].priority===2),r=this.viewItems[e];t=Math.round(t),t=uo(t,r.minimumSize,Math.min(r.maximumSize,this.size)),r.size=t,this.relayout(s,o),this.state=Tl.Idle}distributeViewSizes(){const e=[];let t=0;for(const a of this.viewItems)a.maximumSize-a.minimumSize>0&&(e.push(a),t+=a.size);const i=Math.floor(t/e.length);for(const a of e)a.size=uo(i,a.minimumSize,a.maximumSize);const s=es(this.viewItems.length),o=s.filter(a=>this.viewItems[a].priority===1),r=s.filter(a=>this.viewItems[a].priority===2);this.relayout(o,r)}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}doAddView(e,t,i=this.viewItems.length,s){if(this.state!==Tl.Idle)throw new Error("Cant modify splitview");this.state=Tl.Busy;const o=ye(".split-view-view");i===this.viewItems.length?this.viewContainer.appendChild(o):this.viewContainer.insertBefore(o,this.viewContainer.children.item(i));const r=e.onDidChange(h=>this.onViewChange(d,h)),a=Ye(()=>this.viewContainer.removeChild(o)),l=_r(r,a);let c;typeof t=="number"?c=t:(t.type==="auto"&&(this.areViewsDistributed()?t={type:"distribute"}:t={type:"split",index:t.index}),t.type==="split"?c=this.getViewSize(t.index)/2:t.type==="invisible"?c={cachedVisibleSize:t.cachedVisibleSize}:c=e.minimumSize);const d=this.orientation===0?new _2e(o,e,c,l):new b2e(o,e,c,l);if(this.viewItems.splice(i,0,d),this.viewItems.length>1){const h={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},f=this.orientation===0?new Dn(this.sashContainer,{getHorizontalSashTop:D=>this.getSashPosition(D),getHorizontalSashWidth:this.getSashOrthogonalSize},Object.assign(Object.assign({},h),{orientation:1})):new Dn(this.sashContainer,{getVerticalSashLeft:D=>this.getSashPosition(D),getVerticalSashHeight:this.getSashOrthogonalSize},Object.assign(Object.assign({},h),{orientation:0})),g=this.orientation===0?D=>({sash:f,start:D.startY,current:D.currentY,alt:D.altKey}):D=>({sash:f,start:D.startX,current:D.currentX,alt:D.altKey}),_=ue.map(f.onDidStart,g)(this.onSashStart,this),b=ue.map(f.onDidChange,g)(this.onSashChange,this),w=ue.map(f.onDidEnd,()=>this.sashItems.findIndex(D=>D.sash===f))(this.onSashEnd,this),S=f.onDidReset(()=>{const D=this.sashItems.findIndex(R=>R.sash===f),k=es(D,-1),P=es(D+1,this.viewItems.length),O=this.findFirstSnapIndex(k),M=this.findFirstSnapIndex(P);typeof O=="number"&&!this.viewItems[O].visible||typeof M=="number"&&!this.viewItems[M].visible||this._onDidSashReset.fire(D)}),L=_r(_,b,w,S,f),x={sash:f,disposable:L};this.sashItems.splice(i-1,0,x)}o.appendChild(e.element);let u;typeof t!="number"&&t.type==="split"&&(u=[t.index]),s||this.relayout([i],u),this.state=Tl.Idle,!s&&typeof t!="number"&&t.type==="distribute"&&this.distributeViewSizes()}relayout(e,t){const i=this.viewItems.reduce((s,o)=>s+o.size,0);this.resize(this.viewItems.length-1,this.size-i,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}resize(e,t,i=this.viewItems.map(d=>d.size),s,o,r=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY,l,c){if(e<0||e>=this.viewItems.length)return 0;const d=es(e,-1),u=es(e+1,this.viewItems.length);if(o)for(const x of o)Uk(d,x),Uk(u,x);if(s)for(const x of s)Py(d,x),Py(u,x);const h=d.map(x=>this.viewItems[x]),f=d.map(x=>i[x]),g=u.map(x=>this.viewItems[x]),p=u.map(x=>i[x]),_=d.reduce((x,D)=>x+(this.viewItems[D].minimumSize-i[D]),0),v=d.reduce((x,D)=>x+(this.viewItems[D].maximumSize-i[D]),0),b=u.length===0?Number.POSITIVE_INFINITY:u.reduce((x,D)=>x+(i[D]-this.viewItems[D].minimumSize),0),y=u.length===0?Number.NEGATIVE_INFINITY:u.reduce((x,D)=>x+(i[D]-this.viewItems[D].maximumSize),0),w=Math.max(_,y,r),S=Math.min(b,v,a);let L=!1;if(l){const x=this.viewItems[l.index],D=t>=l.limitDelta;L=D!==x.visible,x.setVisible(D,l.size)}if(!L&&c){const x=this.viewItems[c.index],D=ta+l.size,0);let i=this.size-t;const s=es(this.viewItems.length-1,-1),o=s.filter(a=>this.viewItems[a].priority===1),r=s.filter(a=>this.viewItems[a].priority===2);for(const a of r)Uk(s,a);for(const a of o)Py(s,a);typeof e=="number"&&Py(s,e);for(let a=0;i!==0&&at+i.size,0);let e=0;for(const t of this.viewItems)t.layout(e,this.layoutContext),e+=t.size;this.sashItems.forEach(t=>t.sash.layout()),this.updateSashEnablement(),this.updateScrollableElement()}updateScrollableElement(){this.orientation===0?this.scrollableElement.setScrollDimensions({height:this.size,scrollHeight:this.contentSize}):this.scrollableElement.setScrollDimensions({width:this.size,scrollWidth:this.contentSize})}updateSashEnablement(){let e=!1;const t=this.viewItems.map(l=>e=l.size-l.minimumSize>0||e);e=!1;const i=this.viewItems.map(l=>e=l.maximumSize-l.size>0||e),s=[...this.viewItems].reverse();e=!1;const o=s.map(l=>e=l.size-l.minimumSize>0||e).reverse();e=!1;const r=s.map(l=>e=l.maximumSize-l.size>0||e).reverse();let a=0;for(let l=0;l0||this.startSnappingEnabled)?c.state=1:b&&t[l]&&(a0)return;if(!i.visible&&i.snap)return t}}areViewsDistributed(){let e,t;for(const i of this.viewItems)if(e=e===void 0?i.size:Math.min(e,i.size),t=t===void 0?i.size:Math.max(t,i.size),t-e>2)return!1;return!0}dispose(){var e;(e=this.sashDragState)===null||e===void 0||e.disposable.dispose(),Ft(this.viewItems),this.viewItems=[],this.sashItems.forEach(t=>t.disposable.dispose()),this.sashItems=[],super.dispose()}}class cy{constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=cy.TemplateId,this.renderedTemplates=new Set;const s=new Map(t.map(o=>[o.templateId,o]));this.renderers=[];for(const o of e){const r=s.get(o.templateId);if(!r)throw new Error(`Table cell renderer for template id ${o.templateId} not found.`);this.renderers.push(r)}}renderTemplate(e){const t=le(e,ye(".monaco-table-tr")),i=[],s=[];for(let r=0;rnew y2e(d,u)),l={size:a.reduce((d,u)=>d+u.column.weight,0),views:a.map(d=>({size:d.column.weight,view:d}))};this.splitview=this.disposables.add(new zG(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:l})),this.splitview.el.style.height=`${i.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${i.headerRowHeight}px`;const c=new cy(s,o,d=>this.splitview.getViewSize(d));this.list=this.disposables.add(new ha(e,this.domNode,v2e(i),[c],r)),ue.any(...a.map(d=>d.onDidLayout))(([d,u])=>c.layoutColumn(d,u),null,this.disposables),this.splitview.onDidSashReset(d=>{const u=s.reduce((f,g)=>f+g.weight,0),h=s[d].weight/u*this.cachedWidth;this.splitview.resizeView(d,h)},null,this.disposables),this.styleElement=Dr(this.domNode),this.style(Ske)}updateOptions(e){this.list.updateOptions(e)}splice(e,t,i=[]){this.list.splice(e,t,i)}getHTMLElement(){return this.domNode}style(e){const t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before { top: ${this.virtualDelegate.headerRowHeight+1}px; height: calc(100% - ${this.virtualDelegate.headerRowHeight}px); }`),this.styleElement.textContent=t.join(` -`),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}}OD.InstanceCount=0;class l0 extends fa{constructor(e){super(),this._onChange=this._register(new B),this.onChange=this._onChange.event,this._onKeyDown=this._register(new B),this.onKeyDown=this._onKeyDown.event,this._opts=e,this._checked=this._opts.isChecked;const t=["monaco-custom-toggle"];this._opts.icon&&(this._icon=this._opts.icon,t.push(...Te.asClassNameArray(this._icon))),this._opts.actionClassName&&t.push(...this._opts.actionClassName.split(" ")),this._checked&&t.push("checked"),this.domNode=document.createElement("div"),this.domNode.title=this._opts.title,this.domNode.classList.add(...t),this._opts.notFocusable||(this.domNode.tabIndex=0),this.domNode.setAttribute("role","checkbox"),this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.setAttribute("aria-label",this._opts.title),this.applyStyles(),this.onclick(this.domNode,i=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),i.preventDefault())}),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,i=>{if(i.keyCode===10||i.keyCode===3){this.checked=!this._checked,this._onChange.fire(!0),i.preventDefault(),i.stopPropagation();return}this._onKeyDown.fire(i)})}get enabled(){return this.domNode.getAttribute("aria-disabled")!=="true"}focus(){this.domNode.focus()}get checked(){return this._checked}set checked(e){this._checked=e,this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.classList.toggle("checked",this._checked),this.applyStyles()}width(){return 22}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder||"",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground||"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground||"")}enable(){this.domNode.setAttribute("aria-disabled",String(!1))}disable(){this.domNode.setAttribute("aria-disabled",String(!0))}}const t2e=m("caseDescription","Match Case"),i2e=m("wordsDescription","Match Whole Word"),n2e=m("regexDescription","Use Regular Expression");class $G extends l0{constructor(e){super({icon:se.caseSensitive,title:t2e+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class UG extends l0{constructor(e){super({icon:se.wholeWord,title:i2e+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class jG extends l0{constructor(e){super({icon:se.regex,title:n2e+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class s2e{constructor(e,t=0,i=e.length,s=t-1){this.items=e,this.start=t,this.end=i,this.index=s}current(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]}next(){return this.index=Math.min(this.index+1,this.end),this.current()}previous(){return this.index=Math.max(this.index-1,this.start-1),this.current()}first(){return this.index=this.start,this.current()}last(){return this.index=this.end-1,this.current()}}class o2e{constructor(e=[],t=10){this._initialize(e),this._limit=t,this._onChange()}getHistory(){return this._elements}add(e){this._history.delete(e),this._history.add(e),this._onChange()}next(){return this._navigator.next()}previous(){return this._currentPosition()!==0?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}isLast(){return this._currentPosition()>=this._elements.length-1}isNowhere(){return this._navigator.current()===null}has(e){return this._history.has(e)}_onChange(){this._reduceToLimit();const e=this._elements;this._navigator=new s2e(e,0,e.length,e.length)}_reduceToLimit(){const e=this._elements;e.length>this._limit&&this._initialize(e.slice(e.length-this._limit))}_currentPosition(){const e=this._navigator.current();return e?this._elements.indexOf(e):-1}_initialize(e){this._history=new Set;for(const t of e)this._history.add(t)}get _elements(){const e=[];return this._history.forEach(t=>e.push(t)),e}}const F0=ye;let r2e=class extends fa{constructor(e,t,i){var s;super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new B),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=i,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=(s=this.options.tooltip)!==null&&s!==void 0?s:this.placeholder||"",this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=le(e,F0(".monaco-inputbox.idle"));const o=this.options.flexibleHeight?"textarea":"input",r=le(this.element,F0(".ibwrapper"));if(this.input=le(r,F0(o+".input.empty")),this.input.setAttribute("autocorrect","off"),this.input.setAttribute("autocapitalize","off"),this.input.setAttribute("spellcheck","false"),this.onfocus(this.input,()=>this.element.classList.add("synthetic-focus")),this.onblur(this.input,()=>this.element.classList.remove("synthetic-focus")),this.options.flexibleHeight){this.maxHeight=typeof this.options.flexibleMaxHeight=="number"?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=le(r,F0("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new aq(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),le(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(c=>this.input.scrollTop=c.scrollTop));const a=this._register(new rt(document,"selectionchange")),l=ue.filter(a.event,()=>{const c=document.getSelection();return(c==null?void 0:c.anchorNode)===r});this._register(l(this.updateScrollDimensions,this)),this._register(this.onDidHeightChange(this.updateScrollDimensions,this))}else this.input.type=this.options.type||"text",this.input.setAttribute("wrap","off");this.ariaLabel&&this.input.setAttribute("aria-label",this.ariaLabel),this.placeholder&&!this.options.showPlaceholderOnFocus&&this.setPlaceHolder(this.placeholder),this.tooltip&&this.setTooltip(this.tooltip),this.oninput(this.input,()=>this.onValueChange()),this.onblur(this.input,()=>this.onBlur()),this.onfocus(this.input,()=>this.onFocus()),this._register(this.ignoreGesture(this.input)),setTimeout(()=>this.updateMirror(),0),this.options.actions&&(this.actionbar=this._register(new al(this.element)),this.actionbar.push(this.options.actions,{icon:!0,label:!1})),this.applyStyles()}onBlur(){this._hideMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder","")}onFocus(){this._showMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder",this.placeholder||"")}setPlaceHolder(e){this.placeholder=e,this.input.setAttribute("placeholder",e)}setTooltip(e){this.tooltip=e,this.input.title=e}get inputElement(){return this.input}get value(){return this.input.value}set value(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())}get height(){return typeof this.cachedHeight=="number"?this.cachedHeight:Dh(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return document.activeElement===this.input}select(e=null){this.input.select(),e&&(this.input.setSelectionRange(e.start,e.end),e.end===this.input.value.length&&(this.input.scrollLeft=this.input.scrollWidth))}isSelectionAtEnd(){return this.input.selectionEnd===this.input.value.length&&this.input.selectionStart===this.input.selectionEnd}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}set paddingRight(e){this.input.style.width=`calc(100% - ${e}px)`,this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){if(typeof this.cachedContentHeight!="number"||typeof this.cachedHeight!="number"||!this.scrollableElement)return;const e=this.cachedContentHeight,t=this.cachedHeight,i=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:i})}showMessage(e,t){if(this.state==="open"&&Lo(this.message,e))return;this.message=e,this.element.classList.remove("idle"),this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add(this.classForType(e.type));const i=this.stylesForType(this.message.type);this.element.style.border=`1px solid ${Yh(i.border,"transparent")}`,this.message.content&&(this.hasFocus()||t)&&this._showMessage()}hideMessage(){this.message=null,this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add("idle"),this._hideMessage(),this.applyStyles()}validate(){let e=null;return this.validation&&(e=this.validation(this.value),e?(this.inputElement.setAttribute("aria-invalid","true"),this.showMessage(e)):this.inputElement.hasAttribute("aria-invalid")&&(this.inputElement.removeAttribute("aria-invalid"),this.hideMessage())),e==null?void 0:e.type}stylesForType(e){const t=this.options.inputBoxStyles;switch(e){case 1:return{border:t.inputValidationInfoBorder,background:t.inputValidationInfoBackground,foreground:t.inputValidationInfoForeground};case 2:return{border:t.inputValidationWarningBorder,background:t.inputValidationWarningBackground,foreground:t.inputValidationWarningForeground};default:return{border:t.inputValidationErrorBorder,background:t.inputValidationErrorBackground,foreground:t.inputValidationErrorForeground}}}classForType(e){switch(e){case 1:return"info";case 2:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e;const t=()=>e.style.width=ws(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:s=>{var o,r;if(!this.message)return null;e=le(s,F0(".monaco-inputbox-container")),t();const a={inline:!0,className:"monaco-inputbox-message"},l=this.message.formatContent?bDe(this.message.content,a):_De(this.message.content,a);l.classList.add(this.classForType(this.message.type));const c=this.stylesForType(this.message.type);return l.style.backgroundColor=(o=c.background)!==null&&o!==void 0?o:"",l.style.color=(r=c.foreground)!==null&&r!==void 0?r:"",l.style.border=c.border?`1px solid ${c.border}`:"",le(e,l),null},onHide:()=>{this.state="closed"},layout:t});let i;this.message.type===3?i=m("alertErrorMessage","Error: {0}",this.message.content):this.message.type===2?i=m("alertWarningMessage","Warning: {0}",this.message.content):i=m("alertInfoMessage","Info: {0}",this.message.content),Z1(i),this.state="open"}_hideMessage(){this.contextViewProvider&&(this.state==="open"&&this.contextViewProvider.hideContextView(),this.state="idle")}onValueChange(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),this.input.classList.toggle("empty",!this.value),this.state==="open"&&this.contextViewProvider&&this.contextViewProvider.layout()}updateMirror(){if(!this.mirror)return;const e=this.value,i=e.charCodeAt(e.length-1)===10?" ":"";(e+i).replace(/\u000c/g,"")?this.mirror.textContent=e+i:this.mirror.innerText=" ",this.layout()}applyStyles(){var e,t,i;const s=this.options.inputBoxStyles,o=(e=s.inputBackground)!==null&&e!==void 0?e:"",r=(t=s.inputForeground)!==null&&t!==void 0?t:"",a=(i=s.inputBorder)!==null&&i!==void 0?i:"";this.element.style.backgroundColor=o,this.element.style.color=r,this.input.style.backgroundColor="inherit",this.input.style.color=r,this.element.style.border=`1px solid ${Yh(a,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=Dh(this.mirror),e!==this.cachedContentHeight&&(this.cachedHeight=Math.min(this.cachedContentHeight,this.maxHeight),this.input.style.height=this.cachedHeight+"px",this._onDidHeightChange.fire(this.cachedContentHeight))}insertAtCursor(e){const t=this.inputElement,i=t.selectionStart,s=t.selectionEnd,o=t.value;i!==null&&s!==null&&(this.value=o.substr(0,i)+e+o.substr(s),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){var e;this._hideMessage(),this.message=null,(e=this.actionbar)===null||e===void 0||e.dispose(),super.dispose()}};class qG extends r2e{constructor(e,t,i){const s=m({key:"history.inputbox.hint",comment:["Text will be prefixed with ⇅ plus a single space, then used as a hint where input field keeps history"]},"for history"),o=` or ⇅ ${s}`,r=` (⇅ ${s})`;super(e,t,i),this._onDidFocus=this._register(new B),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new B),this.onDidBlur=this._onDidBlur.event,this.history=new o2e(i.history,100);const a=()=>{if(i.showHistoryHint&&i.showHistoryHint()&&!this.placeholder.endsWith(o)&&!this.placeholder.endsWith(r)&&this.history.getHistory().length){const l=this.placeholder.endsWith(")")?o:r,c=this.placeholder+l;i.showPlaceholderOnFocus&&document.activeElement!==this.input?this.placeholder=c:this.setPlaceHolder(c)}};this.observer=new MutationObserver((l,c)=>{l.forEach(d=>{d.target.textContent||a()})}),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,()=>a()),this.onblur(this.input,()=>{const l=c=>{if(this.placeholder.endsWith(c)){const d=this.placeholder.slice(0,this.placeholder.length-c.length);return i.showPlaceholderOnFocus?this.placeholder=d:this.setPlaceHolder(d),!0}else return!1};l(r)||l(o)})}dispose(){super.dispose(),this.observer&&(this.observer.disconnect(),this.observer=void 0)}addToHistory(e){this.value&&(e||this.value!==this.getCurrentValue())&&this.history.add(this.value)}isAtLastInHistory(){return this.history.isLast()}isNowhereInHistory(){return this.history.isNowhere()}showNextValue(){this.history.has(this.value)||this.addToHistory();let e=this.getNextValue();e&&(e=e===this.value?this.getNextValue():e),this.value=e??"",tv(this.value?this.value:m("clearedInput","Cleared Input"))}showPreviousValue(){this.history.has(this.value)||this.addToHistory();let e=this.getPreviousValue();e&&(e=e===this.value?this.getPreviousValue():e),e&&(this.value=e,tv(this.value))}onBlur(){super.onBlur(),this._onDidBlur.fire()}onFocus(){super.onFocus(),this._onDidFocus.fire()}getCurrentValue(){let e=this.history.current();return e||(e=this.history.last(),this.history.next()),e}getPreviousValue(){return this.history.previous()||this.history.first()}getNextValue(){return this.history.next()}}const a2e=m("defaultLabel","input");class GG extends fa{constructor(e,t,i){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new ra),this.additionalToggles=[],this._onDidOptionChange=this._register(new B),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new B),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new B),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new B),this._onKeyUp=this._register(new B),this._onCaseSensitiveKeyDown=this._register(new B),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new B),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.placeholder=i.placeholder||"",this.validation=i.validation,this.label=i.label||a2e,this.showCommonFindToggles=!!i.showCommonFindToggles;const s=i.appendCaseSensitiveLabel||"",o=i.appendWholeWordsLabel||"",r=i.appendRegexLabel||"",a=i.history||[],l=!!i.flexibleHeight,c=!!i.flexibleWidth,d=i.flexibleMaxHeight;if(this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new qG(this.domNode,t,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},history:a,showHistoryHint:i.showHistoryHint,flexibleHeight:l,flexibleWidth:c,flexibleMaxHeight:d,inputBoxStyles:i.inputBoxStyles})),this.showCommonFindToggles){this.regex=this._register(new jG(Object.assign({appendTitle:r,isChecked:!1},i.toggleStyles))),this._register(this.regex.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.regex.onKeyDown(h=>{this._onRegexKeyDown.fire(h)})),this.wholeWords=this._register(new UG(Object.assign({appendTitle:o,isChecked:!1},i.toggleStyles))),this._register(this.wholeWords.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this.caseSensitive=this._register(new $G(Object.assign({appendTitle:s,isChecked:!1},i.toggleStyles))),this._register(this.caseSensitive.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.caseSensitive.onKeyDown(h=>{this._onCaseSensitiveKeyDown.fire(h)}));const u=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,h=>{if(h.equals(15)||h.equals(17)||h.equals(9)){const f=u.indexOf(document.activeElement);if(f>=0){let g=-1;h.equals(17)?g=(f+1)%u.length:h.equals(15)&&(f===0?g=u.length-1:g=f-1),h.equals(9)?(u[f].blur(),this.inputBox.focus()):g>=0&&u[g].focus(),Ue.stop(h,!0)}}})}this.controls=document.createElement("div"),this.controls.className="controls",this.controls.style.display=this.showCommonFindToggles?"":"none",this.caseSensitive&&this.controls.append(this.caseSensitive.domNode),this.wholeWords&&this.controls.appendChild(this.wholeWords.domNode),this.regex&&this.controls.appendChild(this.regex.domNode),this.setAdditionalToggles(i==null?void 0:i.additionalToggles),this.controls&&this.domNode.appendChild(this.controls),e==null||e.appendChild(this.domNode),this._register(K(this.inputBox.inputElement,"compositionstart",u=>{this.imeSessionInProgress=!0})),this._register(K(this.inputBox.inputElement,"compositionend",u=>{this.imeSessionInProgress=!1,this._onInput.fire()})),this.onkeydown(this.inputBox.inputElement,u=>this._onKeyDown.fire(u)),this.onkeyup(this.inputBox.inputElement,u=>this._onKeyUp.fire(u)),this.oninput(this.inputBox.inputElement,u=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,u=>this._onMouseDown.fire(u))}get onDidChange(){return this.inputBox.onDidChange}layout(e){this.inputBox.layout(),this.updateInputBoxPadding(e.collapsedFindWidget)}enable(){var e,t,i;this.domNode.classList.remove("disabled"),this.inputBox.enable(),(e=this.regex)===null||e===void 0||e.enable(),(t=this.wholeWords)===null||t===void 0||t.enable(),(i=this.caseSensitive)===null||i===void 0||i.enable();for(const s of this.additionalToggles)s.enable()}disable(){var e,t,i;this.domNode.classList.add("disabled"),this.inputBox.disable(),(e=this.regex)===null||e===void 0||e.disable(),(t=this.wholeWords)===null||t===void 0||t.disable(),(i=this.caseSensitive)===null||i===void 0||i.disable();for(const s of this.additionalToggles)s.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}setAdditionalToggles(e){for(const t of this.additionalToggles)t.domNode.remove();this.additionalToggles=[],this.additionalTogglesDisposables.value=new pe;for(const t of e??[])this.additionalTogglesDisposables.value.add(t),this.controls.appendChild(t.domNode),this.additionalTogglesDisposables.value.add(t.onChange(i=>{this._onDidOptionChange.fire(i),!i&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus()})),this.additionalToggles.push(t);this.additionalToggles.length>0&&(this.controls.style.display=""),this.updateInputBoxPadding()}updateInputBoxPadding(e=!1){var t,i,s,o,r,a;e?this.inputBox.paddingRight=0:this.inputBox.paddingRight=((i=(t=this.caseSensitive)===null||t===void 0?void 0:t.width())!==null&&i!==void 0?i:0)+((o=(s=this.wholeWords)===null||s===void 0?void 0:s.width())!==null&&o!==void 0?o:0)+((a=(r=this.regex)===null||r===void 0?void 0:r.width())!==null&&a!==void 0?a:0)+this.additionalToggles.reduce((l,c)=>l+c.width(),0)}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){var e,t;return(t=(e=this.caseSensitive)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setCaseSensitive(e){this.caseSensitive&&(this.caseSensitive.checked=e)}getWholeWords(){var e,t;return(t=(e=this.wholeWords)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setWholeWords(e){this.wholeWords&&(this.wholeWords.checked=e)}getRegex(){var e,t;return(t=(e=this.regex)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setRegex(e){this.regex&&(this.regex.checked=e,this.validate())}focusOnCaseSensitive(){var e;(e=this.caseSensitive)===null||e===void 0||e.focus()}highlightFindOptions(){this.domNode.classList.remove("highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,this.domNode.classList.add("highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox.validate()}showMessage(e){this.inputBox.showMessage(e)}clearMessage(){this.inputBox.hideMessage()}}var Sa;(function(n){n[n.Expanded=0]="Expanded",n[n.Collapsed=1]="Collapsed",n[n.PreserveOrExpanded=2]="PreserveOrExpanded",n[n.PreserveOrCollapsed=3]="PreserveOrCollapsed"})(Sa||(Sa={}));var Th;(function(n){n[n.Unknown=0]="Unknown",n[n.Twistie=1]="Twistie",n[n.Element=2]="Element",n[n.Filter=3]="Filter"})(Th||(Th={}));class vo extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class r3{constructor(e){this.fn=e,this._map=new WeakMap}map(e){let t=this._map.get(e);return t||(t=this.fn(e),this._map.set(e,t)),t}}function a3(n){return typeof n=="object"&&"visibility"in n&&"data"in n}function Cv(n){switch(n){case!0:return 1;case!1:return 0;default:return n}}function lE(n){return typeof n.collapsible=="boolean"}class l2e{constructor(e,t,i,s={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new R4,this._onDidChangeCollapseState=new B,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new B,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new B,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new Du(uj),this.collapseByDefault=typeof s.collapseByDefault>"u"?!1:s.collapseByDefault,this.filter=s.filter,this.autoExpandSingleChildren=typeof s.autoExpandSingleChildren>"u"?!1:s.autoExpandSingleChildren,this.root={parent:void 0,element:i,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(e,t,i=ht.empty(),s={}){if(e.length===0)throw new vo(this.user,"Invalid tree location");s.diffIdentityProvider?this.spliceSmart(s.diffIdentityProvider,e,t,i,s):this.spliceSimple(e,t,i,s)}spliceSmart(e,t,i,s,o,r){var a;s===void 0&&(s=ht.empty()),r===void 0&&(r=(a=o.diffDepth)!==null&&a!==void 0?a:0);const{parentNode:l}=this.getParentNodeWithListIndex(t);if(!l.lastDiffIds)return this.spliceSimple(t,i,s,o);const c=[...s],d=t[t.length-1],u=new Ul({getElements:()=>l.lastDiffIds},{getElements:()=>[...l.children.slice(0,d),...c,...l.children.slice(d+i)].map(_=>e.getId(_.element).toString())}).ComputeDiff(!1);if(u.quitEarly)return l.lastDiffIds=void 0,this.spliceSimple(t,i,c,o);const h=t.slice(0,-1),f=(_,v,b)=>{if(r>0)for(let y=0;yb.originalStart-v.originalStart))f(g,p,g-(_.originalStart+_.originalLength)),g=_.originalStart,p=_.modifiedStart-d,this.spliceSimple([...h,g],_.originalLength,ht.slice(c,p,p+_.modifiedLength),o);f(g,p,g)}spliceSimple(e,t,i=ht.empty(),{onDidCreateNode:s,onDidDeleteNode:o,diffIdentityProvider:r}){const{parentNode:a,listIndex:l,revealed:c,visible:d}=this.getParentNodeWithListIndex(e),u=[],h=ht.map(i,x=>this.createTreeNode(x,a,a.visible?1:0,c,u,s)),f=e[e.length-1],g=a.children.length>0;let p=0;for(let x=f;x>=0&&xr.getId(x.element).toString())):a.lastDiffIds=a.children.map(x=>r.getId(x.element).toString()):a.lastDiffIds=void 0;let w=0;for(const x of y)x.visible&&w++;if(w!==0)for(let x=f+_.length;xD+(k.visible?k.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,b-x),this.list.splice(l,x,u)}if(y.length>0&&o){const x=D=>{o(D),D.children.forEach(x)};y.forEach(x)}this._onDidSplice.fire({insertedNodes:_,deletedNodes:y});const C=a.children.length>0;g!==C&&this.setCollapsible(e.slice(0,-1),C);let L=a;for(;L;){if(L.visibility===2){this.refilterDelayer.trigger(()=>this.refilter());break}L=L.parent}}rerender(e){if(e.length===0)throw new vo(this.user,"Invalid tree location");const{node:t,listIndex:i,revealed:s}=this.getTreeNodeWithListIndex(e);t.visible&&s&&this.list.splice(i,1,[t])}has(e){return this.hasTreeNode(e)}getListIndex(e){const{listIndex:t,visible:i,revealed:s}=this.getTreeNodeWithListIndex(e);return i&&s?t:-1}getListRenderCount(e){return this.getTreeNode(e).renderNodeCount}isCollapsible(e){return this.getTreeNode(e).collapsible}setCollapsible(e,t){const i=this.getTreeNode(e);typeof t>"u"&&(t=!i.collapsible);const s={collapsible:t};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,s))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,i){const s=this.getTreeNode(e);typeof t>"u"&&(t=!s.collapsed);const o={collapsed:t,recursive:i||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,o))}_setCollapseState(e,t){const{node:i,listIndex:s,revealed:o}=this.getTreeNodeWithListIndex(e),r=this._setListNodeCollapseState(i,s,o,t);if(i!==this.root&&this.autoExpandSingleChildren&&r&&!lE(t)&&i.collapsible&&!i.collapsed&&!t.recursive){let a=-1;for(let l=0;l-1){a=-1;break}else a=l;a>-1&&this._setCollapseState([...e,a],t)}return r}_setListNodeCollapseState(e,t,i,s){const o=this._setNodeCollapseState(e,s,!1);if(!i||!e.visible||!o)return o;const r=e.renderNodeCount,a=this.updateNodeAfterCollapseChange(e),l=r-(t===-1?0:1);return this.list.splice(t+1,l,a.slice(1)),o}_setNodeCollapseState(e,t,i){let s;if(e===this.root?s=!1:(lE(t)?(s=e.collapsible!==t.collapsible,e.collapsible=t.collapsible):e.collapsible?(s=e.collapsed!==t.collapsed,e.collapsed=t.collapsed):s=!1,s&&this._onDidChangeCollapseState.fire({node:e,deep:i})),!lE(t)&&t.recursive)for(const o of e.children)s=this._setNodeCollapseState(o,t,!0)||s;return s}expandTo(e){this.eventBufferer.bufferEvents(()=>{let t=this.getTreeNode(e);for(;t.parent;)t=t.parent,e=e.slice(0,e.length-1),t.collapsed&&this._setCollapseState(e,{collapsed:!1,recursive:!1})})}refilter(){const e=this.root.renderNodeCount,t=this.updateNodeAfterFilterChange(this.root);this.list.splice(0,e,t),this.refilterDelayer.cancel()}createTreeNode(e,t,i,s,o,r){const a={parent:t,element:e.element,children:[],depth:t.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:typeof e.collapsible=="boolean"?e.collapsible:typeof e.collapsed<"u",collapsed:typeof e.collapsed>"u"?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},l=this._filterNode(a,i);a.visibility=l,s&&o.push(a);const c=e.children||ht.empty(),d=s&&l!==0&&!a.collapsed;let u=0,h=1;for(const f of c){const g=this.createTreeNode(f,a,l,d,o,r);a.children.push(g),h+=g.renderNodeCount,g.visible&&(g.visibleChildIndex=u++)}return a.collapsible=a.collapsible||a.children.length>0,a.visibleChildrenCount=u,a.visible=l===2?u>0:l===1,a.visible?a.collapsed||(a.renderNodeCount=h):(a.renderNodeCount=0,s&&o.pop()),r==null||r(a),a}updateNodeAfterCollapseChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterCollapseChange(e,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterCollapseChange(e,t){if(e.visible===!1)return 0;if(t.push(e),e.renderNodeCount=1,!e.collapsed)for(const i of e.children)e.renderNodeCount+=this._updateNodeAfterCollapseChange(i,t);return this._onDidChangeRenderNodeCount.fire(e),e.renderNodeCount}updateNodeAfterFilterChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterFilterChange(e,e.visible?1:0,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterFilterChange(e,t,i,s=!0){let o;if(e!==this.root){if(o=this._filterNode(e,t),o===0)return e.visible=!1,e.renderNodeCount=0,!1;s&&i.push(e)}const r=i.length;e.renderNodeCount=e===this.root?0:1;let a=!1;if(!e.collapsed||o!==0){let l=0;for(const c of e.children)a=this._updateNodeAfterFilterChange(c,o,i,s&&!e.collapsed)||a,c.visible&&(c.visibleChildIndex=l++);e.visibleChildrenCount=l}else e.visibleChildrenCount=0;return e!==this.root&&(e.visible=o===2?a:o===1,e.visibility=o),e.visible?e.collapsed||(e.renderNodeCount+=i.length-r):(e.renderNodeCount=0,s&&i.pop()),this._onDidChangeRenderNodeCount.fire(e),e.visible}_updateAncestorsRenderNodeCount(e,t){if(t!==0)for(;e;)e.renderNodeCount+=t,this._onDidChangeRenderNodeCount.fire(e),e=e.parent}_filterNode(e,t){const i=this.filter?this.filter.filter(e.element,t):1;return typeof i=="boolean"?(e.filterData=void 0,i?1:0):a3(i)?(e.filterData=i.data,Cv(i.visibility)):(e.filterData=void 0,Cv(i))}hasTreeNode(e,t=this.root){if(!e||e.length===0)return!0;const[i,...s]=e;return i<0||i>t.children.length?!1:this.hasTreeNode(s,t.children[i])}getTreeNode(e,t=this.root){if(!e||e.length===0)return t;const[i,...s]=e;if(i<0||i>t.children.length)throw new vo(this.user,"Invalid tree location");return this.getTreeNode(s,t.children[i])}getTreeNodeWithListIndex(e){if(e.length===0)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:t,listIndex:i,revealed:s,visible:o}=this.getParentNodeWithListIndex(e),r=e[e.length-1];if(r<0||r>t.children.length)throw new vo(this.user,"Invalid tree location");const a=t.children[r];return{node:a,listIndex:i,revealed:s,visible:o&&a.visible}}getParentNodeWithListIndex(e,t=this.root,i=0,s=!0,o=!0){const[r,...a]=e;if(r<0||r>t.children.length)throw new vo(this.user,"Invalid tree location");for(let l=0;lt.element)),this.data=e}}function cE(n){return n instanceof sy?new c2e(n):n}class d2e{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=Y.None,this.disposables=new pe}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(i=>i.element),t)}onDragStart(e,t){var i,s;(s=(i=this.dnd).onDragStart)===null||s===void 0||s.call(i,cE(e),t)}onDragOver(e,t,i,s,o=!0){const r=this.dnd.onDragOver(cE(e),t&&t.element,i,s),a=this.autoExpandNode!==t;if(a&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),typeof t>"u")return r;if(a&&typeof r!="boolean"&&r.autoExpand&&(this.autoExpandDisposable=MS(()=>{const h=this.modelProvider(),f=h.getNodeLocation(t);h.isCollapsed(f)&&h.setCollapsed(f,!1),this.autoExpandNode=void 0},500,this.disposables)),typeof r=="boolean"||!r.accept||typeof r.bubble>"u"||r.feedback){if(!o){const h=typeof r=="boolean"?r:r.accept,f=typeof r=="boolean"?void 0:r.effect;return{accept:h,effect:f,feedback:[i]}}return r}if(r.bubble===1){const h=this.modelProvider(),f=h.getNodeLocation(t),g=h.getParentNodeLocation(f),p=h.getNode(g),_=g&&h.getListIndex(g);return this.onDragOver(e,p,_,s,!1)}const l=this.modelProvider(),c=l.getNodeLocation(t),d=l.getListIndex(c),u=l.getListRenderCount(c);return Object.assign(Object.assign({},r),{feedback:is(d,d+u)})}drop(e,t,i,s){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(cE(e),t&&t.element,i,s)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}}function u2e(n,e){return e&&Object.assign(Object.assign({},e),{identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new d2e(n,e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent(t){return e.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},t),{element:t.element}))},isSelectionRangeChangeEvent(t){return e.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},t),{element:t.element}))}},accessibilityProvider:e.accessibilityProvider&&Object.assign(Object.assign({},e.accessibilityProvider),{getSetSize(t){const i=n(),s=i.getNodeLocation(t),o=i.getParentNodeLocation(s);return i.getNode(o).visibleChildrenCount},getPosInSet(t){return t.visibleChildIndex+1},isChecked:e.accessibilityProvider&&e.accessibilityProvider.isChecked?t=>e.accessibilityProvider.isChecked(t.element):void 0,getRole:e.accessibilityProvider&&e.accessibilityProvider.getRole?t=>e.accessibilityProvider.getRole(t.element):()=>"treeitem",getAriaLabel(t){return e.accessibilityProvider.getAriaLabel(t.element)},getWidgetAriaLabel(){return e.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:e.accessibilityProvider&&e.accessibilityProvider.getWidgetRole?()=>e.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:e.accessibilityProvider&&e.accessibilityProvider.getAriaLevel?t=>e.accessibilityProvider.getAriaLevel(t.element):t=>t.depth,getActiveDescendantId:e.accessibilityProvider.getActiveDescendantId&&(t=>e.accessibilityProvider.getActiveDescendantId(t.element))}),keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},e.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel(t){return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)}})})}class l3{constructor(e){this.delegate=e}getHeight(e){return this.delegate.getHeight(e.element)}getTemplateId(e){return this.delegate.getTemplateId(e.element)}hasDynamicHeight(e){return!!this.delegate.hasDynamicHeight&&this.delegate.hasDynamicHeight(e.element)}setDynamicHeight(e,t){var i,s;(s=(i=this.delegate).setDynamicHeight)===null||s===void 0||s.call(i,e.element,t)}}var Sv;(function(n){n.None="none",n.OnHover="onHover",n.Always="always"})(Sv||(Sv={}));class h2e{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new pe,this.onDidChange=ue.forEach(e,i=>this._elements=i,this.disposables)}dispose(){this.disposables.dispose()}}class xv{constructor(e,t,i,s,o,r={}){var a;this.renderer=e,this.modelProvider=t,this.activeNodes=s,this.renderedIndentGuides=o,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=xv.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=Y.None,this.disposables=new pe,this.templateId=e.templateId,this.updateOptions(r),ue.map(i,l=>l.node)(this.onDidChangeNodeTwistieState,this,this.disposables),(a=e.onDidChangeTwistieState)===null||a===void 0||a.call(e,this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(typeof e.indent<"u"){const t=go(e.indent,0,40);if(t!==this.indent){this.indent=t;for(const[i,s]of this.renderedNodes)this.renderTreeElement(i,s)}}if(typeof e.renderIndentGuides<"u"){const t=e.renderIndentGuides!==Sv.None;if(t!==this.shouldRenderIndentGuides){this.shouldRenderIndentGuides=t;for(const[i,s]of this.renderedNodes)this._renderIndentGuides(i,s);if(this.indentGuidesDisposable.dispose(),t){const i=new pe;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,i),this.indentGuidesDisposable=i,this._onDidChangeActiveNodes(this.activeNodes.elements)}}}typeof e.hideTwistiesOfChildlessElements<"u"&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=le(e,ye(".monaco-tl-row")),i=le(t,ye(".monaco-tl-indent")),s=le(t,ye(".monaco-tl-twistie")),o=le(t,ye(".monaco-tl-contents")),r=this.renderer.renderTemplate(o);return{container:e,indent:i,twistie:s,indentGuidesDisposable:Y.None,templateData:r}}renderElement(e,t,i,s){this.renderedNodes.set(e,i),this.renderedElements.set(e.element,e),this.renderTreeElement(e,i),this.renderer.renderElement(e,t,i.templateData,s)}disposeElement(e,t,i,s){var o,r;i.indentGuidesDisposable.dispose(),(r=(o=this.renderer).disposeElement)===null||r===void 0||r.call(o,e,t,i.templateData,s),typeof s=="number"&&(this.renderedNodes.delete(e),this.renderedElements.delete(e.element))}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}onDidChangeTwistieState(e){const t=this.renderedElements.get(e);t&&this.onDidChangeNodeTwistieState(t)}onDidChangeNodeTwistieState(e){const t=this.renderedNodes.get(e);t&&(this._onDidChangeActiveNodes(this.activeNodes.elements),this.renderTreeElement(e,t))}renderTreeElement(e,t){const i=xv.DefaultIndent+(e.depth-1)*this.indent;t.twistie.style.paddingLeft=`${i}px`,t.indent.style.width=`${i+this.indent-16}px`,e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded"),t.twistie.classList.remove(...Te.asClassNameArray(se.treeItemExpanded));let s=!1;this.renderer.renderTwistie&&(s=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(s||t.twistie.classList.add(...Te.asClassNameArray(se.treeItemExpanded)),t.twistie.classList.add("collapsible"),t.twistie.classList.toggle("collapsed",e.collapsed)):t.twistie.classList.remove("collapsible","collapsed"),this._renderIndentGuides(e,t)}_renderIndentGuides(e,t){if(ko(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new pe,s=this.modelProvider();for(;;){const o=s.getNodeLocation(e),r=s.getParentNodeLocation(o);if(!r)break;const a=s.getNode(r),l=ye(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(a)&&l.classList.add("active"),t.indent.childElementCount===0?t.indent.appendChild(l):t.indent.insertBefore(l,t.indent.firstElementChild),this.renderedIndentGuides.add(a,l),i.add(Ze(()=>this.renderedIndentGuides.delete(a,l))),e=a}t.indentGuidesDisposable=i}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set,i=this.modelProvider();e.forEach(s=>{const o=i.getNodeLocation(s);try{const r=i.getParentNodeLocation(o);s.collapsible&&s.children.length>0&&!s.collapsed?t.add(s):r&&t.add(i.getNode(r))}catch{}}),this.activeIndentNodes.forEach(s=>{t.has(s)||this.renderedIndentGuides.forEach(s,o=>o.classList.remove("active"))}),t.forEach(s=>{this.activeIndentNodes.has(s)||this.renderedIndentGuides.forEach(s,o=>o.classList.add("active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),Bt(this.disposables)}}xv.DefaultIndent=8;class f2e{get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}constructor(e,t,i){this.tree=e,this.keyboardNavigationLabelProvider=t,this._filter=i,this._totalCount=0,this._matchCount=0,this._pattern="",this._lowercasePattern="",this.disposables=new pe,e.onWillRefilter(this.reset,this,this.disposables)}filter(e,t){let i=1;if(this._filter){const r=this._filter.filter(e,t);if(typeof r=="boolean"?i=r?1:0:a3(r)?i=Cv(r.visibility):i=r,i===0)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:tf.Default,visibility:i};const s=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),o=Array.isArray(s)?s:[s];for(const r of o){const a=r&&r.toString();if(typeof a>"u")return{data:tf.Default,visibility:i};let l;if(this.tree.findMatchType===Sf.Contiguous){const c=a.toLowerCase().indexOf(this._lowercasePattern);if(c>-1){l=[Number.MAX_SAFE_INTEGER,0];for(let d=this._lowercasePattern.length;d>0;d--)l.push(c+d-1)}}else l=LG(this._pattern,this._lowercasePattern,0,a,a.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(l)return this._matchCount++,o.length===1?{data:l,visibility:i}:{data:{label:a,score:l},visibility:i}}return this.tree.findMode===ja.Filter?typeof this.tree.options.defaultFindVisibility=="number"?this.tree.options.defaultFindVisibility:this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility(e):2:{data:tf.Default,visibility:i}}reset(){this._totalCount=0,this._matchCount=0}dispose(){Bt(this.disposables)}}var ja;(function(n){n[n.Highlight=0]="Highlight",n[n.Filter=1]="Filter"})(ja||(ja={}));var Sf;(function(n){n[n.Fuzzy=0]="Fuzzy",n[n.Contiguous=1]="Contiguous"})(Sf||(Sf={}));let g2e=class{get pattern(){return this._pattern}get mode(){return this._mode}set mode(e){e!==this._mode&&(this._mode=e,this.widget&&(this.widget.mode=this._mode),this.tree.refilter(),this.render(),this._onDidChangeMode.fire(e))}get matchType(){return this._matchType}set matchType(e){e!==this._matchType&&(this._matchType=e,this.widget&&(this.widget.matchType=this._matchType),this.tree.refilter(),this.render(),this._onDidChangeMatchType.fire(e))}constructor(e,t,i,s,o,r={}){var a,l;this.tree=e,this.view=i,this.filter=s,this.contextViewProvider=o,this.options=r,this._pattern="",this.width=0,this._onDidChangeMode=new B,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new B,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this._onDidChangePattern=new B,this._onDidChangeOpenState=new B,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new pe,this.disposables=new pe,this._mode=(a=e.options.defaultFindMode)!==null&&a!==void 0?a:ja.Highlight,this._matchType=(l=e.options.defaultFindMatchType)!==null&&l!==void 0?l:Sf.Fuzzy,t.onDidSplice(this.onDidSpliceModel,this,this.disposables)}updateOptions(e={}){e.defaultFindMode!==void 0&&(this.mode=e.defaultFindMode),e.defaultFindMatchType!==void 0&&(this.matchType=e.defaultFindMatchType)}onDidSpliceModel(){!this.widget||this.pattern.length===0||(this.tree.refilter(),this.render())}render(){var e,t,i,s;const o=this.filter.totalCount>0&&this.filter.matchCount===0;this.pattern&&o?!((e=this.tree.options.showNotFoundMessage)!==null&&e!==void 0)||e?(t=this.widget)===null||t===void 0||t.showMessage({type:2,content:m("not found","No elements found.")}):(i=this.widget)===null||i===void 0||i.showMessage({type:2}):(s=this.widget)===null||s===void 0||s.clearMessage()}shouldAllowFocus(e){return!this.widget||!this.pattern||this._mode===ja.Filter||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!tf.isDefault(e.filterData)}layout(e){var t;this.width=e,(t=this.widget)===null||t===void 0||t.layout(e)}dispose(){this._history=void 0,this._onDidChangePattern.dispose(),this.enabledDisposables.dispose(),this.disposables.dispose()}};function u8(n){let e=Th.Unknown;return u2(n.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=Th.Twistie:u2(n.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?e=Th.Element:u2(n.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(e=Th.Filter),{browserEvent:n.browserEvent,element:n.element?n.element.element:null,target:e}}function IC(n,e){e(n),n.children.forEach(t=>IC(t,e))}class dE{get nodeSet(){return this._nodeSet||(this._nodeSet=this.createNodeSet()),this._nodeSet}constructor(e,t){this.getFirstViewElementWithTrait=e,this.identityProvider=t,this.nodes=[],this._onDidChange=new B,this.onDidChange=this._onDidChange.event}set(e,t){!(t!=null&&t.__forceEvent)&&Zi(this.nodes,e)||this._set(e,!1,t)}_set(e,t,i){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){const s=this;this._onDidChange.fire({get elements(){return s.get()},browserEvent:i})}}get(){return this.elements||(this.elements=this.nodes.map(e=>e.element)),[...this.elements]}getNodes(){return this.nodes}has(e){return this.nodeSet.has(e)}onDidModelSplice({insertedNodes:e,deletedNodes:t}){if(!this.identityProvider){const l=this.createNodeSet(),c=d=>l.delete(d);t.forEach(d=>IC(d,c)),this.set([...l.values()]);return}const i=new Set,s=l=>i.add(this.identityProvider.getId(l.element).toString());t.forEach(l=>IC(l,s));const o=new Map,r=l=>o.set(this.identityProvider.getId(l.element).toString(),l);e.forEach(l=>IC(l,r));const a=[];for(const l of this.nodes){const c=this.identityProvider.getId(l.element).toString();if(!i.has(c))a.push(l);else{const u=o.get(c);u&&u.visible&&a.push(u)}}if(this.nodes.length>0&&a.length===0){const l=this.getFirstViewElementWithTrait();l&&a.push(l)}this._set(a,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}}class p2e extends RG{constructor(e,t){super(e),this.tree=t}onViewPointer(e){if(AG(e.browserEvent.target)||Md(e.browserEvent.target)||ep(e.browserEvent.target)||e.browserEvent.isHandledByList)return;const t=e.element;if(!t)return super.onViewPointer(e);if(this.isSelectionRangeChangeEvent(e)||this.isSelectionSingleChangeEvent(e))return super.onViewPointer(e);const i=e.browserEvent.target,s=i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&e.browserEvent.offsetX<16;let o=!1;if(typeof this.tree.expandOnlyOnTwistieClick=="function"?o=this.tree.expandOnlyOnTwistieClick(t.element):o=!!this.tree.expandOnlyOnTwistieClick,o&&!s&&e.browserEvent.detail!==2)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&e.browserEvent.detail===2)return super.onViewPointer(e);if(t.collapsible){const r=this.tree.getNodeLocation(t),a=e.browserEvent.altKey;if(this.tree.setFocus([r]),this.tree.toggleCollapsed(r,a),o&&s){e.browserEvent.isHandledByList=!0;return}}super.onViewPointer(e)}onDoubleClick(e){e.browserEvent.target.classList.contains("monaco-tl-twistie")||!this.tree.expandOnDoubleClick||e.browserEvent.isHandledByList||super.onDoubleClick(e)}}class m2e extends ga{constructor(e,t,i,s,o,r,a,l){super(e,t,i,s,l),this.focusTrait=o,this.selectionTrait=r,this.anchorTrait=a}createMouseController(e){return new p2e(this,e.tree)}splice(e,t,i=[]){if(super.splice(e,t,i),i.length===0)return;const s=[],o=[];let r;i.forEach((a,l)=>{this.focusTrait.has(a)&&s.push(e+l),this.selectionTrait.has(a)&&o.push(e+l),this.anchorTrait.has(a)&&(r=e+l)}),s.length>0&&super.setFocus(mf([...super.getFocus(),...s])),o.length>0&&super.setSelection(mf([...super.getSelection(),...o])),typeof r=="number"&&super.setAnchor(r)}setFocus(e,t,i=!1){super.setFocus(e,t),i||this.focusTrait.set(e.map(s=>this.element(s)),t)}setSelection(e,t,i=!1){super.setSelection(e,t),i||this.selectionTrait.set(e.map(s=>this.element(s)),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(typeof e>"u"?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}class KG{get onDidScroll(){return this.view.onDidScroll}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseDblClick(){return ue.filter(ue.map(this.view.onMouseDblClick,u8),e=>e.target!==Th.Filter)}get onPointer(){return ue.map(this.view.onPointer,u8)}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return ue.signal(this.model.onDidSplice)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get findMode(){var e,t;return(t=(e=this.findController)===null||e===void 0?void 0:e.mode)!==null&&t!==void 0?t:ja.Highlight}set findMode(e){this.findController&&(this.findController.mode=e)}get findMatchType(){var e,t;return(t=(e=this.findController)===null||e===void 0?void 0:e.matchType)!==null&&t!==void 0?t:Sf.Fuzzy}set findMatchType(e){this.findController&&(this.findController.matchType=e)}get expandOnDoubleClick(){return typeof this._options.expandOnDoubleClick>"u"?!0:this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return typeof this._options.expandOnlyOnTwistieClick>"u"?!0:this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}constructor(e,t,i,s,o={}){var r;this._user=e,this._options=o,this.eventBufferer=new R4,this.onDidChangeFindOpenState=ue.None,this.disposables=new pe,this._onWillRefilter=new B,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new B;const a=new l3(i),l=new WF,c=new WF,d=this.disposables.add(new h2e(c.event)),u=new Tj;this.renderers=s.map(_=>new xv(_,()=>this.model,l.event,d,u,o));for(const _ of this.renderers)this.disposables.add(_);let h;o.keyboardNavigationLabelProvider&&(h=new f2e(this,o.keyboardNavigationLabelProvider,o.filter),o=Object.assign(Object.assign({},o),{filter:h}),this.disposables.add(h)),this.focus=new dE(()=>this.view.getFocusedElements()[0],o.identityProvider),this.selection=new dE(()=>this.view.getSelectedElements()[0],o.identityProvider),this.anchor=new dE(()=>this.view.getAnchorElement(),o.identityProvider),this.view=new m2e(e,t,a,this.renderers,this.focus,this.selection,this.anchor,Object.assign(Object.assign({},u2e(()=>this.model,o)),{tree:this})),this.model=this.createModel(e,this.view,o),l.input=this.model.onDidChangeCollapseState;const f=ue.forEach(this.model.onDidSplice,_=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(_),this.selection.onDidModelSplice(_)})},this.disposables);f(()=>null,null,this.disposables);const g=this.disposables.add(new B),p=this.disposables.add(new Du(0));if(this.disposables.add(ue.any(f,this.focus.onDidChange,this.selection.onDidChange)(()=>{p.trigger(()=>{const _=new Set;for(const v of this.focus.getNodes())_.add(v);for(const v of this.selection.getNodes())_.add(v);g.fire([..._.values()])})})),c.input=g.event,o.keyboardSupport!==!1){const _=ue.chain(this.view.onKeyDown,v=>v.filter(b=>!Md(b.target)).map(b=>new Ht(b)));ue.chain(_,v=>v.filter(b=>b.keyCode===15))(this.onLeftArrow,this,this.disposables),ue.chain(_,v=>v.filter(b=>b.keyCode===17))(this.onRightArrow,this,this.disposables),ue.chain(_,v=>v.filter(b=>b.keyCode===10))(this.onSpace,this,this.disposables)}if((!((r=o.findWidgetEnabled)!==null&&r!==void 0)||r)&&o.keyboardNavigationLabelProvider&&o.contextViewProvider){const _=this.options.findWidgetStyles?{styles:this.options.findWidgetStyles}:void 0;this.findController=new g2e(this,this.model,this.view,h,o.contextViewProvider,_),this.focusNavigationFilter=v=>this.findController.shouldAllowFocus(v),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.disposables.add(this.findController),this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindMode=ue.None,this.onDidChangeFindMatchType=ue.None;this.styleElement=kr(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===Sv.Always)}updateOptions(e={}){var t;this._options=Object.assign(Object.assign({},this._options),e);for(const i of this.renderers)i.updateOptions(e);this.view.updateOptions(this._options),(t=this.findController)===null||t===void 0||t.updateOptions(e),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===Sv.Always)}get options(){return this._options}getHTMLElement(){return this.view.getHTMLElement()}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}domFocus(){this.view.domFocus()}layout(e,t){var i;this.view.layout(e,t),Qd(t)&&((i=this.findController)===null||i===void 0||i.layout(t))}style(e){const t=`.${this.view.domId}`,i=[];e.treeIndentGuidesStroke&&(i.push(`.monaco-list${t}:hover .monaco-tl-indent > .indent-guide, .monaco-list${t}.always .monaco-tl-indent > .indent-guide { border-color: ${e.treeInactiveIndentGuidesStroke}; }`),i.push(`.monaco-list${t} .monaco-tl-indent > .indent-guide.active { border-color: ${e.treeIndentGuidesStroke}; }`)),this.styleElement.textContent=i.join(` -`),this.view.style(e)}getParentElement(e){const t=this.model.getParentNodeLocation(e);return this.model.getNode(t).element}getFirstElementChild(e){return this.model.getFirstElementChild(e)}getNode(e){return this.model.getNode(e)}getNodeLocation(e){return this.model.getNodeLocation(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}toggleCollapsed(e,t=!1){return this.model.setCollapsed(e,void 0,t)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){const i=e.map(o=>this.model.getNode(o));this.selection.set(i,t);const s=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setSelection(s,t,!0)}getSelection(){return this.selection.get()}setFocus(e,t){const i=e.map(o=>this.model.getNode(o));this.focus.set(i,t);const s=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setFocus(s,t,!0)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);i!==-1&&this.view.reveal(i,t)}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],s=this.model.getNodeLocation(i);if(!this.model.setCollapsed(s,!0)){const r=this.model.getParentNodeLocation(s);if(!r)return;const a=this.model.getListIndex(r);this.view.reveal(a),this.view.setFocus([a])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],s=this.model.getNodeLocation(i);if(!this.model.setCollapsed(s,!1)){if(!i.children.some(l=>l.visible))return;const[r]=this.view.getFocus(),a=r+1;this.view.reveal(a),this.view.setFocus([a])}}onSpace(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],s=this.model.getNodeLocation(i),o=e.browserEvent.altKey;this.model.setCollapsed(s,void 0,o)}dispose(){Bt(this.disposables),this.view.dispose()}}class c3{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new l2e(e,t,null,i),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,i.sorter&&(this.sorter={compare(s,o){return i.sorter.compare(s.element,o.element)}}),this.identityProvider=i.identityProvider}setChildren(e,t=ht.empty(),i={}){const s=this.getElementLocation(e);this._setChildren(s,this.preserveCollapseState(t),i)}_setChildren(e,t=ht.empty(),i){const s=new Set,o=new Set,r=l=>{var c;if(l.element===null)return;const d=l;if(s.add(d.element),this.nodes.set(d.element,d),this.identityProvider){const u=this.identityProvider.getId(d.element).toString();o.add(u),this.nodesByIdentity.set(u,d)}(c=i.onDidCreateNode)===null||c===void 0||c.call(i,d)},a=l=>{var c;if(l.element===null)return;const d=l;if(s.has(d.element)||this.nodes.delete(d.element),this.identityProvider){const u=this.identityProvider.getId(d.element).toString();o.has(u)||this.nodesByIdentity.delete(u)}(c=i.onDidDeleteNode)===null||c===void 0||c.call(i,d)};this.model.splice([...e,0],Number.MAX_VALUE,t,Object.assign(Object.assign({},i),{onDidCreateNode:r,onDidDeleteNode:a}))}preserveCollapseState(e=ht.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),ht.map(e,t=>{let i=this.nodes.get(t.element);if(!i&&this.identityProvider){const r=this.identityProvider.getId(t.element).toString();i=this.nodesByIdentity.get(r)}if(!i){let r;return typeof t.collapsed>"u"?r=void 0:t.collapsed===Sa.Collapsed||t.collapsed===Sa.PreserveOrCollapsed?r=!0:t.collapsed===Sa.Expanded||t.collapsed===Sa.PreserveOrExpanded?r=!1:r=!!t.collapsed,Object.assign(Object.assign({},t),{children:this.preserveCollapseState(t.children),collapsed:r})}const s=typeof t.collapsible=="boolean"?t.collapsible:i.collapsible;let o;return typeof t.collapsed>"u"||t.collapsed===Sa.PreserveOrCollapsed||t.collapsed===Sa.PreserveOrExpanded?o=i.collapsed:t.collapsed===Sa.Collapsed?o=!0:t.collapsed===Sa.Expanded?o=!1:o=!!t.collapsed,Object.assign(Object.assign({},t),{collapsible:s,collapsed:o,children:this.preserveCollapseState(t.children)})})}rerender(e){const t=this.getElementLocation(e);this.model.rerender(t)}getFirstElementChild(e=null){const t=this.getElementLocation(e);return this.model.getFirstElementChild(t)}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getElementLocation(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getElementLocation(e);return this.model.getListRenderCount(t)}isCollapsible(e){const t=this.getElementLocation(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getElementLocation(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getElementLocation(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const s=this.getElementLocation(e);return this.model.setCollapsed(s,t,i)}expandTo(e){const t=this.getElementLocation(e);this.model.expandTo(t)}refilter(){this.model.refilter()}getNode(e=null){if(e===null)return this.model.getNode(this.model.rootRef);const t=this.nodes.get(e);if(!t)throw new vo(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(e===null)throw new vo(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new vo(this.user,`Tree element not found: ${e}`);const i=this.model.getNodeLocation(t),s=this.model.getParentNodeLocation(i);return this.model.getNode(s).element}getElementLocation(e){if(e===null)return[];const t=this.nodes.get(e);if(!t)throw new vo(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function TC(n){const e=[n.element],t=n.incompressible||!1;return{element:{elements:e,incompressible:t},children:ht.map(ht.from(n.children),TC),collapsible:n.collapsible,collapsed:n.collapsed}}function NC(n){const e=[n.element],t=n.incompressible||!1;let i,s;for(;[s,i]=ht.consume(ht.from(n.children),2),!(s.length!==1||s[0].incompressible);)n=s[0],e.push(n.element);return{element:{elements:e,incompressible:t},children:ht.map(ht.concat(s,i),NC),collapsible:n.collapsible,collapsed:n.collapsed}}function IN(n,e=0){let t;return eIN(i,0)),e===0&&n.element.incompressible?{element:n.element.elements[e],children:t,incompressible:!0,collapsible:n.collapsible,collapsed:n.collapsed}:{element:n.element.elements[e],children:t,collapsible:n.collapsible,collapsed:n.collapsed}}function h8(n){return IN(n,0)}function YG(n,e,t){return n.element===e?Object.assign(Object.assign({},n),{children:t}):Object.assign(Object.assign({},n),{children:ht.map(ht.from(n.children),i=>YG(i,e,t))})}const _2e=n=>({getId(e){return e.elements.map(t=>n.getId(t).toString()).join("\0")}});class b2e{get onDidSplice(){return this.model.onDidSplice}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new c3(e,t,i),this.enabled=typeof i.compressionEnabled>"u"?!0:i.compressionEnabled,this.identityProvider=i.identityProvider}setChildren(e,t=ht.empty(),i){const s=i.diffIdentityProvider&&_2e(i.diffIdentityProvider);if(e===null){const g=ht.map(t,this.enabled?NC:TC);this._setChildren(null,g,{diffIdentityProvider:s,diffDepth:1/0});return}const o=this.nodes.get(e);if(!o)throw new vo(this.user,"Unknown compressed tree node");const r=this.model.getNode(o),a=this.model.getParentNodeLocation(o),l=this.model.getNode(a),c=h8(r),d=YG(c,e,t),u=(this.enabled?NC:TC)(d),h=i.diffIdentityProvider?(g,p)=>i.diffIdentityProvider.getId(g)===i.diffIdentityProvider.getId(p):void 0;if(Zi(u.element.elements,r.element.elements,h)){this._setChildren(o,u.children||ht.empty(),{diffIdentityProvider:s,diffDepth:1});return}const f=l.children.map(g=>g===r?u:g);this._setChildren(l.element,f,{diffIdentityProvider:s,diffDepth:r.depth-l.depth})}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const i=this.model.getNode().children,s=ht.map(i,h8),o=ht.map(s,e?NC:TC);this._setChildren(null,o,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,i){const s=new Set,o=a=>{for(const l of a.element.elements)s.add(l),this.nodes.set(l,a.element)},r=a=>{for(const l of a.element.elements)s.has(l)||this.nodes.delete(l)};this.model.setChildren(e,t,Object.assign(Object.assign({},i),{onDidCreateNode:o,onDidDeleteNode:r}))}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getCompressedNode(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getCompressedNode(e);return this.model.getListRenderCount(t)}getNode(e){if(typeof e>"u")return this.model.getNode();const t=this.getCompressedNode(e);return this.model.getNode(t)}getNodeLocation(e){const t=this.model.getNodeLocation(e);return t===null?null:t.elements[t.elements.length-1]}getParentNodeLocation(e){const t=this.getCompressedNode(e),i=this.model.getParentNodeLocation(t);return i===null?null:i.elements[i.elements.length-1]}getFirstElementChild(e){const t=this.getCompressedNode(e);return this.model.getFirstElementChild(t)}isCollapsible(e){const t=this.getCompressedNode(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getCompressedNode(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getCompressedNode(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const s=this.getCompressedNode(e);return this.model.setCollapsed(s,t,i)}expandTo(e){const t=this.getCompressedNode(e);this.model.expandTo(t)}rerender(e){const t=this.getCompressedNode(e);this.model.rerender(t)}refilter(){this.model.refilter()}getCompressedNode(e){if(e===null)return null;const t=this.nodes.get(e);if(!t)throw new vo(this.user,`Tree element not found: ${e}`);return t}}const v2e=n=>n[n.length-1];class d3{get element(){return this.node.element===null?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new d3(this.unwrapper,e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e,t){this.unwrapper=e,this.node=t}}function y2e(n,e){return{splice(t,i,s){e.splice(t,i,s.map(o=>n.map(o)))},updateElementHeight(t,i){e.updateElementHeight(t,i)}}}function w2e(n,e){return Object.assign(Object.assign({},e),{identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(n(t))}},sorter:e.sorter&&{compare(t,i){return e.sorter.compare(t.elements[0],i.elements[0])}},filter:e.filter&&{filter(t,i){return e.filter.filter(n(t),i)}}})}class C2e{get onDidSplice(){return ue.map(this.model.onDidSplice,({insertedNodes:e,deletedNodes:t})=>({insertedNodes:e.map(i=>this.nodeMapper.map(i)),deletedNodes:t.map(i=>this.nodeMapper.map(i))}))}get onDidChangeCollapseState(){return ue.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return ue.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}constructor(e,t,i={}){this.rootRef=null,this.elementMapper=i.elementMapper||v2e;const s=o=>this.elementMapper(o.elements);this.nodeMapper=new r3(o=>new d3(s,o)),this.model=new b2e(e,y2e(this.nodeMapper,t),w2e(s,i))}setChildren(e,t=ht.empty(),i={}){this.model.setChildren(e,t,i)}setCompressionEnabled(e){this.model.setCompressionEnabled(e)}has(e){return this.model.has(e)}getListIndex(e){return this.model.getListIndex(e)}getListRenderCount(e){return this.model.getListRenderCount(e)}getNode(e){return this.nodeMapper.map(this.model.getNode(e))}getNodeLocation(e){return e.element}getParentNodeLocation(e){return this.model.getParentNodeLocation(e)}getFirstElementChild(e){const t=this.model.getFirstElementChild(e);return t===null||typeof t>"u"?t:this.elementMapper(t.elements)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}setCollapsed(e,t,i){return this.model.setCollapsed(e,t,i)}expandTo(e){return this.model.expandTo(e)}rerender(e){return this.model.rerender(e)}refilter(){return this.model.refilter()}getCompressedTreeNode(e=null){return this.model.getNode(e)}}var S2e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class u3 extends KG{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,i,s,o={}){super(e,t,i,s,o),this.user=e}setChildren(e,t=ht.empty(),i){this.model.setChildren(e,t,i)}rerender(e){if(e===void 0){this.view.rerender();return}this.model.rerender(e)}hasElement(e){return this.model.has(e)}createModel(e,t,i){return new c3(e,t,i)}}class ZG{get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}constructor(e,t){this._compressedTreeNodeProvider=e,this.renderer=t,this.templateId=t.templateId,t.onDidChangeTwistieState&&(this.onDidChangeTwistieState=t.onDidChangeTwistieState)}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,i,s){const o=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element);o.element.elements.length===1?(i.compressedTreeNode=void 0,this.renderer.renderElement(e,t,i.data,s)):(i.compressedTreeNode=o,this.renderer.renderCompressedElements(o,t,i.data,s))}disposeElement(e,t,i,s){var o,r,a,l;i.compressedTreeNode?(r=(o=this.renderer).disposeCompressedElements)===null||r===void 0||r.call(o,i.compressedTreeNode,t,i.data,s):(l=(a=this.renderer).disposeElement)===null||l===void 0||l.call(a,e,t,i.data,s)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return this.renderer.renderTwistie?this.renderer.renderTwistie(e,t):!1}}S2e([ki],ZG.prototype,"compressedTreeNodeProvider",null);function x2e(n,e){return e&&Object.assign(Object.assign({},e),{keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{getKeyboardNavigationLabel(t){let i;try{i=n().getCompressedTreeNode(t)}catch{return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t)}return i.element.elements.length===1?e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t):e.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(i.element.elements)}}})}class XG extends u3{constructor(e,t,i,s,o={}){const r=()=>this,a=s.map(l=>new ZG(r,l));super(e,t,i,a,x2e(r,o))}setChildren(e,t=ht.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t,i){return new C2e(e,t,i)}updateOptions(e={}){super.updateOptions(e),typeof e.compressionEnabled<"u"&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}var Fc=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function uE(n){return Object.assign(Object.assign({},n),{children:[],refreshPromise:void 0,stale:!0,slow:!1,collapsedByDefault:void 0})}function TN(n,e){return e.parent?e.parent===n?!0:TN(n,e.parent):!1}function L2e(n,e){return n===e||TN(n,e)||TN(e,n)}class h3{get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new h3(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class D2e{constructor(e,t,i){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=i,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,s){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,s)}renderTwistie(e,t){return e.slow?(t.classList.add(...Te.asClassNameArray(se.treeItemLoading)),!0):(t.classList.remove(...Te.asClassNameArray(se.treeItemLoading)),!1)}disposeElement(e,t,i,s){var o,r;(r=(o=this.renderer).disposeElement)===null||r===void 0||r.call(o,this.nodeMapper.map(e),t,i.templateData,s)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function f8(n){return{browserEvent:n.browserEvent,elements:n.elements.map(e=>e.element)}}function g8(n){return{browserEvent:n.browserEvent,element:n.element&&n.element.element,target:n.target}}class k2e extends sy{constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function hE(n){return n instanceof sy?new k2e(n):n}class E2e{constructor(e){this.dnd=e}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(i=>i.element),t)}onDragStart(e,t){var i,s;(s=(i=this.dnd).onDragStart)===null||s===void 0||s.call(i,hE(e),t)}onDragOver(e,t,i,s,o=!0){return this.dnd.onDragOver(hE(e),t&&t.element,i,s)}drop(e,t,i,s){this.dnd.drop(hE(e),t&&t.element,i,s)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}dispose(){this.dnd.dispose()}}function QG(n){return n&&Object.assign(Object.assign({},n),{collapseByDefault:!0,identityProvider:n.identityProvider&&{getId(e){return n.identityProvider.getId(e.element)}},dnd:n.dnd&&new E2e(n.dnd),multipleSelectionController:n.multipleSelectionController&&{isSelectionSingleChangeEvent(e){return n.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))},isSelectionRangeChangeEvent(e){return n.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))}},accessibilityProvider:n.accessibilityProvider&&Object.assign(Object.assign({},n.accessibilityProvider),{getPosInSet:void 0,getSetSize:void 0,getRole:n.accessibilityProvider.getRole?e=>n.accessibilityProvider.getRole(e.element):()=>"treeitem",isChecked:n.accessibilityProvider.isChecked?e=>{var t;return!!(!((t=n.accessibilityProvider)===null||t===void 0)&&t.isChecked(e.element))}:void 0,getAriaLabel(e){return n.accessibilityProvider.getAriaLabel(e.element)},getWidgetAriaLabel(){return n.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:n.accessibilityProvider.getWidgetRole?()=>n.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:n.accessibilityProvider.getAriaLevel&&(e=>n.accessibilityProvider.getAriaLevel(e.element)),getActiveDescendantId:n.accessibilityProvider.getActiveDescendantId&&(e=>n.accessibilityProvider.getActiveDescendantId(e.element))}),filter:n.filter&&{filter(e,t){return n.filter.filter(e.element,t)}},keyboardNavigationLabelProvider:n.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},n.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel(e){return n.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}}),sorter:void 0,expandOnlyOnTwistieClick:typeof n.expandOnlyOnTwistieClick>"u"?void 0:typeof n.expandOnlyOnTwistieClick!="function"?n.expandOnlyOnTwistieClick:e=>n.expandOnlyOnTwistieClick(e.element),defaultFindVisibility:e=>e.hasChildren&&e.stale?1:typeof n.defaultFindVisibility=="number"?n.defaultFindVisibility:typeof n.defaultFindVisibility>"u"?2:n.defaultFindVisibility(e.element)})}function NN(n,e){e(n),n.children.forEach(t=>NN(t,e))}class JG{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return ue.map(this.tree.onDidChangeFocus,f8)}get onDidChangeSelection(){return ue.map(this.tree.onDidChangeSelection,f8)}get onMouseDblClick(){return ue.map(this.tree.onMouseDblClick,g8)}get onPointer(){return ue.map(this.tree.onPointer,g8)}get onDidFocus(){return this.tree.onDidFocus}get onDidChangeModel(){return this.tree.onDidChangeModel}get onDidChangeCollapseState(){return this.tree.onDidChangeCollapseState}get onDidChangeFindOpenState(){return this.tree.onDidChangeFindOpenState}get onDidDispose(){return this.tree.onDidDispose}constructor(e,t,i,s,o,r={}){this.user=e,this.dataSource=o,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new B,this._onDidChangeNodeSlowState=new B,this.nodeMapper=new r3(a=>new h3(a)),this.disposables=new pe,this.identityProvider=r.identityProvider,this.autoExpandSingleChildren=typeof r.autoExpandSingleChildren>"u"?!1:r.autoExpandSingleChildren,this.sorter=r.sorter,this.collapseByDefault=r.collapseByDefault,this.tree=this.createTree(e,t,i,s,r),this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.root=uE({element:void 0,parent:null,hasChildren:!0}),this.identityProvider&&(this.root=Object.assign(Object.assign({},this.root),{id:null})),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables)}createTree(e,t,i,s,o){const r=new l3(i),a=s.map(c=>new D2e(c,this.nodeMapper,this._onDidChangeNodeSlowState.event)),l=QG(o)||{};return new u3(e,t,r,a,l)}updateOptions(e={}){this.tree.updateOptions(e)}getHTMLElement(){return this.tree.getHTMLElement()}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}get scrollHeight(){return this.tree.scrollHeight}get renderHeight(){return this.tree.renderHeight}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}setInput(e,t){return Fc(this,void 0,void 0,function*(){this.refreshPromises.forEach(s=>s.cancel()),this.refreshPromises.clear(),this.root.element=e;const i=t&&{viewState:t,focus:[],selection:[]};yield this._updateChildren(e,!0,!1,i),i&&(this.tree.setFocus(i.focus),this.tree.setSelection(i.selection)),t&&typeof t.scrollTop=="number"&&(this.scrollTop=t.scrollTop)})}_updateChildren(e=this.root.element,t=!0,i=!1,s,o){return Fc(this,void 0,void 0,function*(){if(typeof this.root.element>"u")throw new vo(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield ue.toPromise(this._onDidRender.event));const r=this.getDataNode(e);if(yield this.refreshAndRenderNode(r,t,s,o),i)try{this.tree.rerender(r)}catch{}})}rerender(e){if(e===void 0||e===this.root.element){this.tree.rerender();return}const t=this.getDataNode(e);this.tree.rerender(t)}getNode(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getNode(t===this.root?null:t);return this.nodeMapper.map(i)}collapse(e,t=!1){const i=this.getDataNode(e);return this.tree.collapse(i===this.root?null:i,t)}expand(e,t=!1){return Fc(this,void 0,void 0,function*(){if(typeof this.root.element>"u")throw new vo(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield ue.toPromise(this._onDidRender.event));const i=this.getDataNode(e);if(this.tree.hasElement(i)&&!this.tree.isCollapsible(i)||(i.refreshPromise&&(yield this.root.refreshPromise,yield ue.toPromise(this._onDidRender.event)),i!==this.root&&!i.refreshPromise&&!this.tree.isCollapsed(i)))return!1;const s=this.tree.expand(i===this.root?null:i,t);return i.refreshPromise&&(yield this.root.refreshPromise,yield ue.toPromise(this._onDidRender.event)),s})}setSelection(e,t){const i=e.map(s=>this.getDataNode(s));this.tree.setSelection(i,t)}getSelection(){return this.tree.getSelection().map(t=>t.element)}setFocus(e,t){const i=e.map(s=>this.getDataNode(s));this.tree.setFocus(i,t)}getFocus(){return this.tree.getFocus().map(t=>t.element)}reveal(e,t){this.tree.reveal(this.getDataNode(e),t)}getParentElement(e){const t=this.tree.getParentElement(this.getDataNode(e));return t&&t.element}getFirstElementChild(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getFirstElementChild(t===this.root?null:t);return i&&i.element}getDataNode(e){const t=this.nodes.get(e===this.root.element?null:e);if(!t)throw new vo(this.user,`Data tree node not found: ${e}`);return t}refreshAndRenderNode(e,t,i,s){return Fc(this,void 0,void 0,function*(){yield this.refreshNode(e,t,i),this.render(e,i,s)})}refreshNode(e,t,i){return Fc(this,void 0,void 0,function*(){let s;if(this.subTreeRefreshPromises.forEach((o,r)=>{!s&&L2e(r,e)&&(s=o.then(()=>this.refreshNode(e,t,i)))}),s)return s;if(e!==this.root&&this.tree.getNode(e).collapsed){e.hasChildren=!!this.dataSource.hasChildren(e.element),e.stale=!0;return}return this.doRefreshSubTree(e,t,i)})}doRefreshSubTree(e,t,i){return Fc(this,void 0,void 0,function*(){let s;e.refreshPromise=new Promise(o=>s=o),this.subTreeRefreshPromises.set(e,e.refreshPromise),e.refreshPromise.finally(()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)});try{const o=yield this.doRefreshNode(e,t,i);e.stale=!1,yield dT.settled(o.map(r=>this.doRefreshSubTree(r,t,i)))}finally{s()}})}doRefreshNode(e,t,i){return Fc(this,void 0,void 0,function*(){e.hasChildren=!!this.dataSource.hasChildren(e.element);let s;if(!e.hasChildren)s=Promise.resolve(ht.empty());else{const o=this.doGetChildren(e);if(RF(o))s=Promise.resolve(o);else{const r=jb(800);r.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},a=>null),s=o.finally(()=>r.cancel())}}try{const o=yield s;return this.setChildren(e,o,t,i)}catch(o){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),Bf(o))return[];throw o}finally{e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e))}})}doGetChildren(e){let t=this.refreshPromises.get(e);if(t)return t;const i=this.dataSource.getChildren(e.element);return RF(i)?this.processChildren(i):(t=xc(()=>Fc(this,void 0,void 0,function*(){return this.processChildren(yield i)})),this.refreshPromises.set(e,t),t.finally(()=>{this.refreshPromises.delete(e)}))}_onDidChangeCollapseState({node:e,deep:t}){e.element!==null&&!e.collapsed&&e.element.stale&&(t?this.collapse(e.element.element):this.refreshAndRenderNode(e.element,!1).catch(_t))}setChildren(e,t,i,s){const o=[...t];if(e.children.length===0&&o.length===0)return[];const r=new Map,a=new Map;for(const d of e.children)if(r.set(d.element,d),this.identityProvider){const u=this.tree.isCollapsed(d);a.set(d.id,{node:d,collapsed:u})}const l=[],c=o.map(d=>{const u=!!this.dataSource.hasChildren(d);if(!this.identityProvider){const p=uE({element:d,parent:e,hasChildren:u});return u&&this.collapseByDefault&&!this.collapseByDefault(d)&&(p.collapsedByDefault=!1,l.push(p)),p}const h=this.identityProvider.getId(d).toString(),f=a.get(h);if(f){const p=f.node;return r.delete(p.element),this.nodes.delete(p.element),this.nodes.set(d,p),p.element=d,p.hasChildren=u,i?f.collapsed?(p.children.forEach(_=>NN(_,v=>this.nodes.delete(v.element))),p.children.splice(0,p.children.length),p.stale=!0):l.push(p):u&&this.collapseByDefault&&!this.collapseByDefault(d)&&(p.collapsedByDefault=!1,l.push(p)),p}const g=uE({element:d,parent:e,id:h,hasChildren:u});return s&&s.viewState.focus&&s.viewState.focus.indexOf(h)>-1&&s.focus.push(g),s&&s.viewState.selection&&s.viewState.selection.indexOf(h)>-1&&s.selection.push(g),s&&s.viewState.expanded&&s.viewState.expanded.indexOf(h)>-1?l.push(g):u&&this.collapseByDefault&&!this.collapseByDefault(d)&&(g.collapsedByDefault=!1,l.push(g)),g});for(const d of r.values())NN(d,u=>this.nodes.delete(u.element));for(const d of c)this.nodes.set(d.element,d);return e.children.splice(0,e.children.length,...c),e!==this.root&&this.autoExpandSingleChildren&&c.length===1&&l.length===0&&(c[0].collapsedByDefault=!1,l.push(c[0])),l}render(e,t,i){const s=e.children.map(r=>this.asTreeElement(r,t)),o=i&&Object.assign(Object.assign({},i),{diffIdentityProvider:i.diffIdentityProvider&&{getId(r){return i.diffIdentityProvider.getId(r.element)}}});this.tree.setChildren(e===this.root?null:e,s,o),e!==this.root&&this.tree.setCollapsible(e,e.hasChildren),this._onDidRender.fire()}asTreeElement(e,t){if(e.stale)return{element:e,collapsible:e.hasChildren,collapsed:!0};let i;return t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1?i=!1:i=e.collapsedByDefault,e.collapsedByDefault=void 0,{element:e,children:e.hasChildren?ht.map(e.children,s=>this.asTreeElement(s,t)):[],collapsible:e.hasChildren,collapsed:i}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose(),this.tree.dispose()}}class f3{get element(){return{elements:this.node.element.elements.map(e=>e.element),incompressible:this.node.element.incompressible}}get children(){return this.node.children.map(e=>new f3(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class A2e{constructor(e,t,i,s){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=i,this.onDidChangeTwistieState=s,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,s){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,s)}renderCompressedElements(e,t,i,s){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,s)}renderTwistie(e,t){return e.slow?(t.classList.add(...Te.asClassNameArray(se.treeItemLoading)),!0):(t.classList.remove(...Te.asClassNameArray(se.treeItemLoading)),!1)}disposeElement(e,t,i,s){var o,r;(r=(o=this.renderer).disposeElement)===null||r===void 0||r.call(o,this.nodeMapper.map(e),t,i.templateData,s)}disposeCompressedElements(e,t,i,s){var o,r;(r=(o=this.renderer).disposeCompressedElements)===null||r===void 0||r.call(o,this.compressibleNodeMapperProvider().map(e),t,i.templateData,s)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=Bt(this.disposables)}}function I2e(n){const e=n&&QG(n);return e&&Object.assign(Object.assign({},e),{keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},e.keyboardNavigationLabelProvider),{getCompressedNodeKeyboardNavigationLabel(t){return n.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(i=>i.element))}})})}class T2e extends JG{constructor(e,t,i,s,o,r,a={}){super(e,t,i,o,r,a),this.compressionDelegate=s,this.compressibleNodeMapper=new r3(l=>new f3(l)),this.filter=a.filter}createTree(e,t,i,s,o){const r=new l3(i),a=s.map(c=>new A2e(c,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),l=I2e(o)||{};return new XG(e,t,r,a,l)}asTreeElement(e,t){return Object.assign({incompressible:this.compressionDelegate.isIncompressible(e.element)},super.asTreeElement(e,t))}updateOptions(e={}){this.tree.updateOptions(e)}render(e,t){if(!this.identityProvider)return super.render(e,t);const i=h=>this.identityProvider.getId(h).toString(),s=h=>{const f=new Set;for(const g of h){const p=this.tree.getCompressedTreeNode(g===this.root?null:g);if(p.element)for(const _ of p.element.elements)f.add(i(_.element))}return f},o=s(this.tree.getSelection()),r=s(this.tree.getFocus());super.render(e,t);const a=this.getSelection();let l=!1;const c=this.getFocus();let d=!1;const u=h=>{const f=h.element;if(f)for(let g=0;g{const i=this.filter.filter(t,1),s=N2e(i);if(s===2)throw new Error("Recursive tree visibility not supported in async data compressed trees");return s===1})),super.processChildren(e)}}function N2e(n){return typeof n=="boolean"?n?1:0:a3(n)?Cv(n.visibility):Cv(n)}class R2e extends KG{constructor(e,t,i,s,o,r={}){super(e,t,i,s,r),this.user=e,this.dataSource=o,this.identityProvider=r.identityProvider}createModel(e,t,i){return new c3(e,t,i)}}new _e("isMac",mt,m("isMac","Whether the operating system is macOS"));new _e("isLinux",Jn,m("isLinux","Whether the operating system is Linux"));new _e("isWindows",Fs,m("isWindows","Whether the operating system is Windows"));const eK=new _e("isWeb",Qm,m("isWeb","Whether the platform is a web browser"));new _e("isMacNative",mt&&!Qm,m("isMacNative","Whether the operating system is macOS on a non-browser platform"));new _e("isIOS",Jd,m("isIOS","Whether the operating system is iOS"));new _e("isMobile",Qhe,m("isMobile","Whether the platform is a mobile web browser"));new _e("isDevelopment",!1,!0);new _e("productQualityType","",m("productQualityType","Quality type of VS Code"));const tK="inputFocus";new _e(tK,!1,m("inputFocus","Whether keyboard focus is inside an input box"));var Ec=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Wt=function(n,e){return function(t,i){e(t,i,n)}};const Jo=at("listService");class M2e{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new pe,this.lists=[],this._lastFocusedWidget=void 0,this._hasCreatedStyleController=!1}setLastFocusedList(e){var t,i;e!==this._lastFocusedWidget&&((t=this._lastFocusedWidget)===null||t===void 0||t.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=e,(i=this._lastFocusedWidget)===null||i===void 0||i.getHTMLElement().classList.add("last-focused"))}register(e,t){if(this._hasCreatedStyleController||(this._hasCreatedStyleController=!0,new MG(kr(),"").style(Jf)),this.lists.some(s=>s.widget===e))throw new Error("Cannot register the same widget multiple times");const i={widget:e,extraContextKeys:t};return this.lists.push(i),e.getHTMLElement()===document.activeElement&&this.setLastFocusedList(e),br(e.onDidFocus(()=>this.setLastFocusedList(e)),Ze(()=>this.lists.splice(this.lists.indexOf(i),1)),e.onDidDispose(()=>{this.lists=this.lists.filter(s=>s!==i),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)}))}dispose(){this.disposables.dispose()}}const Lv=new _e("listScrollAtBoundary","none");xe.or(Lv.isEqualTo("top"),Lv.isEqualTo("both"));xe.or(Lv.isEqualTo("bottom"),Lv.isEqualTo("both"));const iK=new _e("listFocus",!0),FD=new _e("listSupportsMultiselect",!0),nK=xe.and(iK,xe.not(tK)),g3=new _e("listHasSelectionOrFocus",!1),p3=new _e("listDoubleSelection",!1),m3=new _e("listMultiSelection",!1),BD=new _e("listSelectionNavigation",!1),P2e=new _e("listSupportsFind",!0),_3=new _e("treeElementCanCollapse",!1),O2e=new _e("treeElementHasParent",!1),b3=new _e("treeElementCanExpand",!1),F2e=new _e("treeElementHasChild",!1),B2e=new _e("treeFindOpen",!1),sK="listTypeNavigationMode",oK="listAutomaticKeyboardNavigation";function WD(n,e){const t=n.createScoped(e.getHTMLElement());return iK.bindTo(t),t}function VD(n,e){const t=Lv.bindTo(n),i=()=>{const s=e.scrollTop===0,o=e.scrollHeight-e.renderHeight-e.scrollTop<1;s&&o?t.set("both"):s?t.set("top"):o?t.set("bottom"):t.set("none")};return i(),e.onDidScroll(i)}const eg="workbench.list.multiSelectModifier",RC="workbench.list.openMode",jo="workbench.list.horizontalScrolling",v3="workbench.list.defaultFindMode",y3="workbench.list.typeNavigationMode",kx="workbench.list.keyboardNavigation",da="workbench.list.scrollByPage",w3="workbench.list.defaultFindMatchType",Dv="workbench.tree.indent",Ex="workbench.tree.renderIndentGuides",ua="workbench.list.smoothScrolling",ll="workbench.list.mouseWheelScrollSensitivity",cl="workbench.list.fastScrollSensitivity",Ax="workbench.tree.expandMode";function dl(n){return n.getValue(eg)==="alt"}class W2e extends Y{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=dl(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(eg)&&(this.useAltAsMultipleSelectionModifier=dl(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:TG(e)}isSelectionRangeChangeEvent(e){return NG(e)}}function zD(n,e){var t;const i=n.get(ni),s=n.get(vi),o=new pe;return[Object.assign(Object.assign({},e),{keyboardNavigationDelegate:{mightProducePrintableCharacter(a){return s.mightProducePrintableCharacter(a)}},smoothScrolling:!!i.getValue(ua),mouseWheelScrollSensitivity:i.getValue(ll),fastScrollSensitivity:i.getValue(cl),multipleSelectionController:(t=e.multipleSelectionController)!==null&&t!==void 0?t:o.add(new W2e(i)),keyboardNavigationEventFilter:H2e(s),scrollByPage:!!i.getValue(da)}),o]}let RN=class extends ga{constructor(e,t,i,s,o,r,a,l,c){const d=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!l.getValue(jo),[u,h]=c.invokeFunction(zD,o);super(e,t,i,s,Object.assign(Object.assign({keyboardSupport:!1},u),{horizontalScrolling:d})),this.disposables.add(h),this.contextKeyService=WD(r,this),this.disposables.add(VD(this.contextKeyService,this)),this.listSupportsMultiSelect=FD.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),BD.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this.listHasSelectionOrFocus=g3.bindTo(this.contextKeyService),this.listDoubleSelection=p3.bindTo(this.contextKeyService),this.listMultiSelection=m3.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=dl(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const g=this.getSelection(),p=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(g.length>0||p.length>0),this.listMultiSelection.set(g.length>1),this.listDoubleSelection.set(g.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const g=this.getSelection(),p=this.getFocus();this.listHasSelectionOrFocus.set(g.length>0||p.length>0)})),this.disposables.add(l.onDidChangeConfiguration(g=>{g.affectsConfiguration(eg)&&(this._useAltAsMultipleSelectionModifier=dl(l));let p={};if(g.affectsConfiguration(jo)&&this.horizontalScrolling===void 0){const _=!!l.getValue(jo);p=Object.assign(Object.assign({},p),{horizontalScrolling:_})}if(g.affectsConfiguration(da)){const _=!!l.getValue(da);p=Object.assign(Object.assign({},p),{scrollByPage:_})}if(g.affectsConfiguration(ua)){const _=!!l.getValue(ua);p=Object.assign(Object.assign({},p),{smoothScrolling:_})}if(g.affectsConfiguration(ll)){const _=l.getValue(ll);p=Object.assign(Object.assign({},p),{mouseWheelScrollSensitivity:_})}if(g.affectsConfiguration(cl)){const _=l.getValue(cl);p=Object.assign(Object.assign({},p),{fastScrollSensitivity:_})}Object.keys(p).length>0&&this.updateOptions(p)})),this.navigator=new rK(this,Object.assign({configurationService:l},o)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?oy(e):Jf)}};RN=Ec([Wt(5,tt),Wt(6,Jo),Wt(7,ni),Wt(8,yt)],RN);let p8=class extends Uke{constructor(e,t,i,s,o,r,a,l,c){const d=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!l.getValue(jo),[u,h]=c.invokeFunction(zD,o);super(e,t,i,s,Object.assign(Object.assign({keyboardSupport:!1},u),{horizontalScrolling:d})),this.disposables=new pe,this.disposables.add(h),this.contextKeyService=WD(r,this),this.disposables.add(VD(this.contextKeyService,this.widget)),this.horizontalScrolling=o.horizontalScrolling,this.listSupportsMultiSelect=FD.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),BD.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this._useAltAsMultipleSelectionModifier=dl(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(l.onDidChangeConfiguration(g=>{g.affectsConfiguration(eg)&&(this._useAltAsMultipleSelectionModifier=dl(l));let p={};if(g.affectsConfiguration(jo)&&this.horizontalScrolling===void 0){const _=!!l.getValue(jo);p=Object.assign(Object.assign({},p),{horizontalScrolling:_})}if(g.affectsConfiguration(da)){const _=!!l.getValue(da);p=Object.assign(Object.assign({},p),{scrollByPage:_})}if(g.affectsConfiguration(ua)){const _=!!l.getValue(ua);p=Object.assign(Object.assign({},p),{smoothScrolling:_})}if(g.affectsConfiguration(ll)){const _=l.getValue(ll);p=Object.assign(Object.assign({},p),{mouseWheelScrollSensitivity:_})}if(g.affectsConfiguration(cl)){const _=l.getValue(cl);p=Object.assign(Object.assign({},p),{fastScrollSensitivity:_})}Object.keys(p).length>0&&this.updateOptions(p)})),this.navigator=new rK(this,Object.assign({configurationService:l},o)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?oy(e):Jf)}dispose(){this.disposables.dispose(),super.dispose()}};p8=Ec([Wt(5,tt),Wt(6,Jo),Wt(7,ni),Wt(8,yt)],p8);let m8=class extends OD{constructor(e,t,i,s,o,r,a,l,c,d){const u=typeof r.horizontalScrolling<"u"?r.horizontalScrolling:!!c.getValue(jo),[h,f]=d.invokeFunction(zD,r);super(e,t,i,s,o,Object.assign(Object.assign({keyboardSupport:!1},h),{horizontalScrolling:u})),this.disposables.add(f),this.contextKeyService=WD(a,this),this.disposables.add(VD(this.contextKeyService,this)),this.listSupportsMultiSelect=FD.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(r.multipleSelectionSupport!==!1),BD.bindTo(this.contextKeyService).set(!!r.selectionNavigation),this.listHasSelectionOrFocus=g3.bindTo(this.contextKeyService),this.listDoubleSelection=p3.bindTo(this.contextKeyService),this.listMultiSelection=m3.bindTo(this.contextKeyService),this.horizontalScrolling=r.horizontalScrolling,this._useAltAsMultipleSelectionModifier=dl(c),this.disposables.add(this.contextKeyService),this.disposables.add(l.register(this)),this.updateStyles(r.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const p=this.getSelection(),_=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(p.length>0||_.length>0),this.listMultiSelection.set(p.length>1),this.listDoubleSelection.set(p.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const p=this.getSelection(),_=this.getFocus();this.listHasSelectionOrFocus.set(p.length>0||_.length>0)})),this.disposables.add(c.onDidChangeConfiguration(p=>{p.affectsConfiguration(eg)&&(this._useAltAsMultipleSelectionModifier=dl(c));let _={};if(p.affectsConfiguration(jo)&&this.horizontalScrolling===void 0){const v=!!c.getValue(jo);_=Object.assign(Object.assign({},_),{horizontalScrolling:v})}if(p.affectsConfiguration(da)){const v=!!c.getValue(da);_=Object.assign(Object.assign({},_),{scrollByPage:v})}if(p.affectsConfiguration(ua)){const v=!!c.getValue(ua);_=Object.assign(Object.assign({},_),{smoothScrolling:v})}if(p.affectsConfiguration(ll)){const v=c.getValue(ll);_=Object.assign(Object.assign({},_),{mouseWheelScrollSensitivity:v})}if(p.affectsConfiguration(cl)){const v=c.getValue(cl);_=Object.assign(Object.assign({},_),{fastScrollSensitivity:v})}Object.keys(_).length>0&&this.updateOptions(_)})),this.navigator=new V2e(this,Object.assign({configurationService:c},r)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?oy(e):Jf)}dispose(){this.disposables.dispose(),super.dispose()}};m8=Ec([Wt(6,tt),Wt(7,Jo),Wt(8,ni),Wt(9,yt)],m8);class C3 extends Y{constructor(e,t){var i;super(),this.widget=e,this._onDidOpen=this._register(new B),this.onDidOpen=this._onDidOpen.event,this._register(ue.filter(this.widget.onDidChangeSelection,s=>s.browserEvent instanceof KeyboardEvent)(s=>this.onSelectionFromKeyboard(s))),this._register(this.widget.onPointer(s=>this.onPointer(s.element,s.browserEvent))),this._register(this.widget.onMouseDblClick(s=>this.onMouseDblClick(s.element,s.browserEvent))),typeof(t==null?void 0:t.openOnSingleClick)!="boolean"&&(t!=null&&t.configurationService)?(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(RC))!=="doubleClick",this._register(t==null?void 0:t.configurationService.onDidChangeConfiguration(s=>{s.affectsConfiguration(RC)&&(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(RC))!=="doubleClick")}))):this.openOnSingleClick=(i=t==null?void 0:t.openOnSingleClick)!==null&&i!==void 0?i:!0}onSelectionFromKeyboard(e){if(e.elements.length!==1)return;const t=e.browserEvent,i=typeof t.preserveFocus=="boolean"?t.preserveFocus:!0,s=typeof t.pinned=="boolean"?t.pinned:!i;this._open(this.getSelectedElement(),i,s,!1,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick||t.detail===2)return;const s=t.button===1,o=!0,r=s,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,r,a,t)}onMouseDblClick(e,t){if(!t)return;const i=t.target;if(i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&t.offsetX<16)return;const o=!1,r=!0,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,r,a,t)}_open(e,t,i,s,o){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:i,revealIfVisible:!0},sideBySide:s,element:e,browserEvent:o})}}class rK extends C3{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class V2e extends C3{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class z2e extends C3{constructor(e,t){super(e,t)}getSelectedElement(){var e;return(e=this.widget.getSelection()[0])!==null&&e!==void 0?e:void 0}}function H2e(n){let e=!1;return t=>{if(t.toKeyCodeChord().isModifierKey())return!1;if(e)return e=!1,!1;const i=n.softDispatch(t,t.target);return i.kind===1?(e=!0,!1):(e=!1,i.kind===0)}}let _8=class extends u3{constructor(e,t,i,s,o,r,a,l,c){const{options:d,getTypeNavigationMode:u,disposable:h}=r.invokeFunction(ly,o);super(e,t,i,s,d),this.disposables.add(h),this.internals=new xf(this,o,u,o.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};_8=Ec([Wt(5,yt),Wt(6,tt),Wt(7,Jo),Wt(8,ni)],_8);let b8=class extends XG{constructor(e,t,i,s,o,r,a,l,c){const{options:d,getTypeNavigationMode:u,disposable:h}=r.invokeFunction(ly,o);super(e,t,i,s,d),this.disposables.add(h),this.internals=new xf(this,o,u,o.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};b8=Ec([Wt(5,yt),Wt(6,tt),Wt(7,Jo),Wt(8,ni)],b8);let v8=class extends R2e{constructor(e,t,i,s,o,r,a,l,c,d){const{options:u,getTypeNavigationMode:h,disposable:f}=a.invokeFunction(ly,r);super(e,t,i,s,o,u),this.disposables.add(f),this.internals=new xf(this,r,h,r.overrideStyles,l,c,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles!==void 0&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};v8=Ec([Wt(6,yt),Wt(7,tt),Wt(8,Jo),Wt(9,ni)],v8);let MN=class extends JG{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,s,o,r,a,l,c,d){const{options:u,getTypeNavigationMode:h,disposable:f}=a.invokeFunction(ly,r);super(e,t,i,s,o,u),this.disposables.add(f),this.internals=new xf(this,r,h,r.overrideStyles,l,c,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};MN=Ec([Wt(6,yt),Wt(7,tt),Wt(8,Jo),Wt(9,ni)],MN);let y8=class extends T2e{constructor(e,t,i,s,o,r,a,l,c,d,u){const{options:h,getTypeNavigationMode:f,disposable:g}=l.invokeFunction(ly,a);super(e,t,i,s,o,r,h),this.disposables.add(g),this.internals=new xf(this,a,f,a.overrideStyles,c,d,u),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};y8=Ec([Wt(7,yt),Wt(8,tt),Wt(9,Jo),Wt(10,ni)],y8);function aK(n){const e=n.getValue(v3);if(e==="highlight")return ja.Highlight;if(e==="filter")return ja.Filter;const t=n.getValue(kx);if(t==="simple"||t==="highlight")return ja.Highlight;if(t==="filter")return ja.Filter}function lK(n){const e=n.getValue(w3);if(e==="fuzzy")return Sf.Fuzzy;if(e==="contiguous")return Sf.Contiguous}function ly(n,e){var t;const i=n.get(ni),s=n.get(Iu),o=n.get(tt),r=n.get(yt),a=()=>{const f=o.getContextKeyValue(sK);if(f==="automatic")return Pa.Automatic;if(f==="trigger"||o.getContextKeyValue(oK)===!1)return Pa.Trigger;const p=i.getValue(y3);if(p==="automatic")return Pa.Automatic;if(p==="trigger")return Pa.Trigger},l=e.horizontalScrolling!==void 0?e.horizontalScrolling:!!i.getValue(jo),[c,d]=r.invokeFunction(zD,e),u=e.paddingBottom,h=e.renderIndentGuides!==void 0?e.renderIndentGuides:i.getValue(Ex);return{getTypeNavigationMode:a,disposable:d,options:Object.assign(Object.assign({keyboardSupport:!1},c),{indent:typeof i.getValue(Dv)=="number"?i.getValue(Dv):void 0,renderIndentGuides:h,smoothScrolling:!!i.getValue(ua),defaultFindMode:aK(i),defaultFindMatchType:lK(i),horizontalScrolling:l,scrollByPage:!!i.getValue(da),paddingBottom:u,hideTwistiesOfChildlessElements:e.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:(t=e.expandOnlyOnTwistieClick)!==null&&t!==void 0?t:i.getValue(Ax)==="doubleClick",contextViewProvider:s,findWidgetStyles:Ske})}}let xf=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,s,o,r,a){var l;this.tree=e,this.disposables=[],this.contextKeyService=WD(o,e),this.disposables.push(VD(this.contextKeyService,e)),this.listSupportsMultiSelect=FD.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(t.multipleSelectionSupport!==!1),BD.bindTo(this.contextKeyService).set(!!t.selectionNavigation),this.listSupportFindWidget=P2e.bindTo(this.contextKeyService),this.listSupportFindWidget.set((l=t.findWidgetEnabled)!==null&&l!==void 0?l:!0),this.hasSelectionOrFocus=g3.bindTo(this.contextKeyService),this.hasDoubleSelection=p3.bindTo(this.contextKeyService),this.hasMultiSelection=m3.bindTo(this.contextKeyService),this.treeElementCanCollapse=_3.bindTo(this.contextKeyService),this.treeElementHasParent=O2e.bindTo(this.contextKeyService),this.treeElementCanExpand=b3.bindTo(this.contextKeyService),this.treeElementHasChild=F2e.bindTo(this.contextKeyService),this.treeFindOpen=B2e.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=dl(a),this.updateStyleOverrides(s);const d=()=>{const h=e.getFocus()[0];if(!h)return;const f=e.getNode(h);this.treeElementCanCollapse.set(f.collapsible&&!f.collapsed),this.treeElementHasParent.set(!!e.getParentElement(h)),this.treeElementCanExpand.set(f.collapsible&&f.collapsed),this.treeElementHasChild.set(!!e.getFirstElementChild(h))},u=new Set;u.add(sK),u.add(oK),this.disposables.push(this.contextKeyService,r.register(e),e.onDidChangeSelection(()=>{const h=e.getSelection(),f=e.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.hasSelectionOrFocus.set(h.length>0||f.length>0),this.hasMultiSelection.set(h.length>1),this.hasDoubleSelection.set(h.length===2)})}),e.onDidChangeFocus(()=>{const h=e.getSelection(),f=e.getFocus();this.hasSelectionOrFocus.set(h.length>0||f.length>0),d()}),e.onDidChangeCollapseState(d),e.onDidChangeModel(d),e.onDidChangeFindOpenState(h=>this.treeFindOpen.set(h)),a.onDidChangeConfiguration(h=>{let f={};if(h.affectsConfiguration(eg)&&(this._useAltAsMultipleSelectionModifier=dl(a)),h.affectsConfiguration(Dv)){const g=a.getValue(Dv);f=Object.assign(Object.assign({},f),{indent:g})}if(h.affectsConfiguration(Ex)&&t.renderIndentGuides===void 0){const g=a.getValue(Ex);f=Object.assign(Object.assign({},f),{renderIndentGuides:g})}if(h.affectsConfiguration(ua)){const g=!!a.getValue(ua);f=Object.assign(Object.assign({},f),{smoothScrolling:g})}if(h.affectsConfiguration(v3)||h.affectsConfiguration(kx)){const g=aK(a);f=Object.assign(Object.assign({},f),{defaultFindMode:g})}if(h.affectsConfiguration(y3)||h.affectsConfiguration(kx)){const g=i();f=Object.assign(Object.assign({},f),{typeNavigationMode:g})}if(h.affectsConfiguration(w3)){const g=lK(a);f=Object.assign(Object.assign({},f),{defaultFindMatchType:g})}if(h.affectsConfiguration(jo)&&t.horizontalScrolling===void 0){const g=!!a.getValue(jo);f=Object.assign(Object.assign({},f),{horizontalScrolling:g})}if(h.affectsConfiguration(da)){const g=!!a.getValue(da);f=Object.assign(Object.assign({},f),{scrollByPage:g})}if(h.affectsConfiguration(Ax)&&t.expandOnlyOnTwistieClick===void 0&&(f=Object.assign(Object.assign({},f),{expandOnlyOnTwistieClick:a.getValue(Ax)==="doubleClick"})),h.affectsConfiguration(ll)){const g=a.getValue(ll);f=Object.assign(Object.assign({},f),{mouseWheelScrollSensitivity:g})}if(h.affectsConfiguration(cl)){const g=a.getValue(cl);f=Object.assign(Object.assign({},f),{fastScrollSensitivity:g})}Object.keys(f).length>0&&e.updateOptions(f)}),this.contextKeyService.onDidChangeContext(h=>{h.affectsSome(u)&&e.updateOptions({typeNavigationMode:i()})})),this.navigator=new z2e(e,Object.assign({configurationService:a},t)),this.disposables.push(this.navigator)}updateOptions(e){e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyleOverrides(e){this.tree.style(e?oy(e):Jf)}dispose(){this.disposables=Bt(this.disposables)}};xf=Ec([Wt(4,tt),Wt(5,Jo),Wt(6,ni)],xf);const $2e=_n.as(qf.Configuration);$2e.registerConfiguration({id:"workbench",order:7,title:m("workbenchConfigurationTitle","Workbench"),type:"object",properties:{[eg]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[m("multiSelectModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),m("multiSelectModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:m({key:"multiSelectModifier",comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},"The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.")},[RC]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:m({key:"openModeModifier",comment:["`singleClick` and `doubleClick` refers to a value the setting can take and should not be localized."]},"Controls how to open items in trees and lists using the mouse (if supported). Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[jo]:{type:"boolean",default:!1,description:m("horizontalScrolling setting","Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[da]:{type:"boolean",default:!1,description:m("list.scrollByPage","Controls whether clicks in the scrollbar scroll page by page.")},[Dv]:{type:"number",default:8,minimum:4,maximum:40,description:m("tree indent setting","Controls tree indentation in pixels.")},[Ex]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:m("render tree indent guides","Controls whether the tree should render indent guides.")},[ua]:{type:"boolean",default:!1,description:m("list smoothScrolling setting","Controls whether lists and trees have smooth scrolling.")},[ll]:{type:"number",default:1,markdownDescription:m("Mouse Wheel Scroll Sensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[cl]:{type:"number",default:5,markdownDescription:m("Fast Scroll Sensitivity","Scrolling speed multiplier when pressing `Alt`.")},[v3]:{type:"string",enum:["highlight","filter"],enumDescriptions:[m("defaultFindModeSettingKey.highlight","Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),m("defaultFindModeSettingKey.filter","Filter elements when searching.")],default:"highlight",description:m("defaultFindModeSettingKey","Controls the default find mode for lists and trees in the workbench.")},[kx]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[m("keyboardNavigationSettingKey.simple","Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),m("keyboardNavigationSettingKey.highlight","Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),m("keyboardNavigationSettingKey.filter","Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:m("keyboardNavigationSettingKey","Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:m("keyboardNavigationSettingKeyDeprecated","Please use 'workbench.list.defaultFindMode' and 'workbench.list.typeNavigationMode' instead.")},[w3]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[m("defaultFindMatchTypeSettingKey.fuzzy","Use fuzzy matching when searching."),m("defaultFindMatchTypeSettingKey.contiguous","Use contiguous matching when searching.")],default:"fuzzy",description:m("defaultFindMatchTypeSettingKey","Controls the type of matching used when searching lists and trees in the workbench.")},[Ax]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:m("expand mode","Controls how tree folders are expanded when clicking the folder names. Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[y3]:{type:"string",enum:["automatic","trigger"],default:"automatic",markdownDescription:m("typeNavigationMode2","Controls how type navigation works in lists and trees in the workbench. When set to `trigger`, type navigation begins once the `list.triggerTypeNavigation` command is run.")}}});var PN;(function(n){n[n.PRESERVE=0]="PRESERVE",n[n.LAST=1]="LAST"})(PN||(PN={}));const cK={Quickaccess:"workbench.contributions.quickaccess"};class U2e{constructor(){this.providers=[],this.defaultProvider=void 0}registerQuickAccessProvider(e){return e.prefix.length===0?this.defaultProvider=e:this.providers.push(e),this.providers.sort((t,i)=>i.prefix.length-t.prefix.length),Ze(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return VL([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find(i=>e.startsWith(i.prefix))||void 0||this.defaultProvider}}_n.add(cK.Quickaccess,new U2e);const j2e={ctrlCmd:!1,alt:!1};var kv;(function(n){n[n.Blur=1]="Blur",n[n.Gesture=2]="Gesture",n[n.Other=3]="Other"})(kv||(kv={}));var La;(function(n){n[n.NONE=0]="NONE",n[n.FIRST=1]="FIRST",n[n.SECOND=2]="SECOND",n[n.LAST=3]="LAST"})(La||(La={}));const S3=at("quickInputService");var q2e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},w8=function(n,e){return function(t,i){e(t,i,n)}};let ON=class extends Y{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=_n.as(cK.Quickaccess),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,i){var s;const[o,r]=this.getOrInstantiateProvider(e),a=this.visibleQuickAccess,l=a==null?void 0:a.descriptor;if(a&&r&&l===r){e!==r.prefix&&!(i!=null&&i.preserveValue)&&(a.picker.value=e),this.adjustValueSelection(a.picker,r,i);return}if(r&&!(i!=null&&i.preserveValue)){let f;if(a&&l&&l!==r){const g=a.value.substr(l.prefix.length);g&&(f=`${r.prefix}${g}`)}if(!f){const g=o==null?void 0:o.defaultFilterValue;g===PN.LAST?f=this.lastAcceptedPickerValues.get(r):typeof g=="string"&&(f=`${r.prefix}${g}`)}typeof f=="string"&&(e=f)}const c=new pe,d=c.add(this.quickInputService.createQuickPick());d.value=e,this.adjustValueSelection(d,r,i),d.placeholder=r==null?void 0:r.placeholder,d.quickNavigate=i==null?void 0:i.quickNavigateConfiguration,d.hideInput=!!d.quickNavigate&&!a,(typeof(i==null?void 0:i.itemActivation)=="number"||i!=null&&i.quickNavigateConfiguration)&&(d.itemActivation=(s=i==null?void 0:i.itemActivation)!==null&&s!==void 0?s:La.SECOND),d.contextKey=r==null?void 0:r.contextKey,d.filterValue=f=>f.substring(r?r.prefix.length:0);let u;t&&(u=new fj,c.add(ue.once(d.onWillAccept)(f=>{f.veto(),d.hide()}))),c.add(this.registerPickerListeners(d,o,r,e,i==null?void 0:i.providerOptions));const h=c.add(new Ir);if(o&&c.add(o.provide(d,h.token,i==null?void 0:i.providerOptions)),ue.once(d.onDidHide)(()=>{d.selectedItems.length===0&&h.cancel(),c.dispose(),u==null||u.complete(d.selectedItems.slice(0))}),d.show(),t)return u==null?void 0:u.p}adjustValueSelection(e,t,i){var s;let o;i!=null&&i.preserveValue?o=[e.value.length,e.value.length]:o=[(s=t==null?void 0:t.prefix.length)!==null&&s!==void 0?s:0,e.value.length],e.valueSelection=o}registerPickerListeners(e,t,i,s,o){const r=new pe,a=this.visibleQuickAccess={picker:e,descriptor:i,value:s};return r.add(Ze(()=>{a===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),r.add(e.onDidChangeValue(l=>{const[c]=this.getOrInstantiateProvider(l);c!==t?this.show(l,{preserveValue:!0,providerOptions:o}):a.value=l})),i&&r.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(i,e.value)})),r}getOrInstantiateProvider(e){const t=this.registry.getQuickAccessProvider(e);if(!t)return[void 0,void 0];let i=this.mapProviderToDescriptor.get(t);return i||(i=this.instantiationService.createInstance(t.ctor),this.mapProviderToDescriptor.set(t,i)),[i,t]}};ON=q2e([w8(0,S3),w8(1,yt)],ON);H.white.toString(),H.white.toString();class C8 extends Y{get onDidClick(){return this._onDidClick.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new B),this.options=t,this._element=document.createElement("a"),this._element.classList.add("monaco-button"),this._element.tabIndex=0,this._element.setAttribute("role","button"),this._element.classList.toggle("secondary",!!t.secondary);const i=t.secondary?t.buttonSecondaryBackground:t.buttonBackground,s=t.secondary?t.buttonSecondaryForeground:t.buttonForeground;this._element.style.color=s||"",this._element.style.backgroundColor=i||"",t.supportShortLabel&&(this._labelShortElement=document.createElement("div"),this._labelShortElement.classList.add("monaco-button-label-short"),this._element.appendChild(this._labelShortElement),this._labelElement=document.createElement("div"),this._labelElement.classList.add("monaco-button-label"),this._element.appendChild(this._labelElement),this._element.classList.add("monaco-text-button-with-short-label")),e.appendChild(this._element),this._register(Mt.addTarget(this._element)),[de.CLICK,Ot.Tap].forEach(o=>{this._register(K(this._element,o,r=>{if(!this.enabled){Ue.stop(r);return}this._onDidClick.fire(r)}))}),this._register(K(this._element,de.KEY_DOWN,o=>{const r=new Ht(o);let a=!1;this.enabled&&(r.equals(3)||r.equals(10))?(this._onDidClick.fire(o),a=!0):r.equals(9)&&(this._element.blur(),a=!0),a&&Ue.stop(r,!0)})),this._register(K(this._element,de.MOUSE_OVER,o=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(K(this._element,de.MOUSE_OUT,o=>{this.updateBackground(!1)})),this.focusTracker=this._register(tu(this._element)),this._register(this.focusTracker.onDidFocus(()=>{this.enabled&&this.updateBackground(!0)})),this._register(this.focusTracker.onDidBlur(()=>{this.enabled&&this.updateBackground(!1)}))}dispose(){super.dispose(),this._element.remove()}getContentElements(e){const t=[];for(let i of nf(e))if(typeof i=="string"){if(i=i.trim(),i==="")continue;const s=document.createElement("span");s.textContent=i,t.push(s)}else t.push(i);return t}updateBackground(e){let t;this.options.secondary?t=e?this.options.buttonSecondaryHoverBackground:this.options.buttonSecondaryBackground:t=e?this.options.buttonHoverBackground:this.options.buttonBackground,t&&(this._element.style.backgroundColor=t)}get element(){return this._element}set label(e){var t;if(this._label===e||Rd(this._label)&&Rd(e)&&hDe(this._label,e))return;this._element.classList.add("monaco-text-button");const i=this.options.supportShortLabel?this._labelElement:this._element;if(Rd(e)){const s=TD(e,{inline:!0});s.dispose();const o=(t=s.element.querySelector("p"))===null||t===void 0?void 0:t.innerHTML;if(o){const r=GU(o,{ADD_TAGS:["b","i","u","code","span"],ALLOWED_ATTR:["class"],RETURN_TRUSTED_TYPE:!0});i.innerHTML=r}else ds(i)}else this.options.supportIcons?ds(i,...this.getContentElements(e)):i.textContent=e;typeof this.options.title=="string"?this._element.title=this.options.title:this.options.title&&(this._element.title=kDe(e)),this._label=e}get label(){return this._label}set enabled(e){e?(this._element.classList.remove("disabled"),this._element.setAttribute("aria-disabled",String(!1)),this._element.tabIndex=0):(this._element.classList.add("disabled"),this._element.setAttribute("aria-disabled",String(!0)))}get enabled(){return!this._element.classList.contains("disabled")}}class FN{constructor(e,t,i){this.options=t,this.styles=i,this.count=0,this.element=le(e,ye(".monaco-count-badge")),this.countFormat=this.options.countFormat||"{0}",this.titleFormat=this.options.titleFormat||"",this.setCount(this.options.count||0)}setCount(e){this.count=e,this.render()}setTitleFormat(e){this.titleFormat=e,this.render()}render(){var e,t;this.element.textContent=Bb(this.countFormat,this.count),this.element.title=Bb(this.titleFormat,this.count),this.element.style.backgroundColor=(e=this.styles.badgeBackground)!==null&&e!==void 0?e:"",this.element.style.color=(t=this.styles.badgeForeground)!==null&&t!==void 0?t:"",this.styles.badgeBorder&&(this.element.style.border=`1px solid ${this.styles.badgeBorder}`)}}const S8="done",x8="active",fE="infinite",gE="infinite-long-running",L8="discrete";class HD extends Y{constructor(e,t){super(),this.workedVal=0,this.showDelayedScheduler=this._register(new Di(()=>Kh(this.element),0)),this.longRunningScheduler=this._register(new Di(()=>this.infiniteLongRunning(),HD.LONG_RUNNING_INFINITE_THRESHOLD)),this.create(e,t)}create(e,t){this.element=document.createElement("div"),this.element.classList.add("monaco-progress-container"),this.element.setAttribute("role","progressbar"),this.element.setAttribute("aria-valuemin","0"),e.appendChild(this.element),this.bit=document.createElement("div"),this.bit.classList.add("progress-bit"),this.bit.style.backgroundColor=(t==null?void 0:t.progressBarBackground)||"#0E70C0",this.element.appendChild(this.bit)}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(x8,fE,gE,L8),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(S8),this.element.classList.contains(fE)?(this.bit.style.opacity="0",e?setTimeout(()=>this.off(),200):this.off()):(this.bit.style.width="inherit",e?setTimeout(()=>this.off(),200):this.off()),this}infinite(){return this.bit.style.width="2%",this.bit.style.opacity="1",this.element.classList.remove(L8,S8,gE),this.element.classList.add(x8,fE),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(gE)}getContainer(){return this.element}}HD.LONG_RUNNING_INFINITE_THRESHOLD=1e4;const G2e=ye;class K2e extends Y{constructor(e,t,i){super(),this.parent=e,this.onKeyDown=o=>K(this.findInput.inputBox.inputElement,de.KEY_DOWN,r=>{o(new Ht(r))}),this.onMouseDown=o=>K(this.findInput.inputBox.inputElement,de.MOUSE_DOWN,r=>{o(new ur(r))}),this.onDidChange=o=>this.findInput.onDidChange(o),this.container=le(this.parent,G2e(".quick-input-box")),this.findInput=this._register(new GG(this.container,void 0,{label:"",inputBoxStyles:t,toggleStyles:i}));const s=this.findInput.inputBox.inputElement;s.role="combobox",s.ariaHasPopup="menu",s.ariaAutoComplete="list",s.ariaExpanded="true"}get value(){return this.findInput.getValue()}set value(e){this.findInput.setValue(e)}select(e=null){this.findInput.inputBox.select(e)}isSelectionAtEnd(){return this.findInput.inputBox.isSelectionAtEnd()}get placeholder(){return this.findInput.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.findInput.inputBox.setPlaceHolder(e)}get password(){return this.findInput.inputBox.inputElement.type==="password"}set password(e){this.findInput.inputBox.inputElement.type=e?"password":"text"}set enabled(e){this.findInput.inputBox.inputElement.toggleAttribute("readonly",!e)}set toggles(e){this.findInput.setAdditionalToggles(e)}setAttribute(e,t){this.findInput.inputBox.inputElement.setAttribute(e,t)}showDecoration(e){e===bi.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===bi.Info?1:e===bi.Warning?2:3,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===bi.Info?1:e===bi.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}class Pd{constructor(e,t){var i;this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.supportIcons=(i=t==null?void 0:t.supportIcons)!==null&&i!==void 0?i:!1,this.domNode=le(e,ye("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],i="",s){e||(e=""),s&&(e=Pd.escapeNewLines(e,t)),!(this.didEverRender&&this.text===e&&this.title===i&&Lo(this.highlights,t))&&(this.text=e,this.title=i,this.highlights=t,this.render())}render(){const e=[];let t=0;for(const i of this.highlights){if(i.end===i.start)continue;if(t{s=o===`\r -`?-1:0,r+=i;for(const a of t)a.end<=r||(a.start>=r&&(a.start+=s),a.end>=r&&(a.end+=s));return i+=s,"⏎"})}}class pE{constructor(e){this._element=e}get element(){return this._element}set textContent(e){this.disposed||e===this._textContent||(this._textContent=e,this._element.textContent=e)}set className(e){this.disposed||e===this._className||(this._className=e,this._element.className=e)}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}}class BN extends Y{constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new pE(le(e,ye(".monaco-icon-label")))),this.labelContainer=le(this.domNode.element,ye(".monaco-icon-label-container"));const i=le(this.labelContainer,ye("span.monaco-icon-name-container"));t!=null&&t.supportHighlights||t!=null&&t.supportIcons?this.nameNode=new X2e(i,!!t.supportIcons):this.nameNode=new Y2e(i),this.hoverDelegate=t==null?void 0:t.hoverDelegate}get element(){return this.domNode.element}setLabel(e,t,i){const s=["monaco-icon-label"],o=["monaco-icon-label-container"];let r="";if(i&&(i.extraClasses&&s.push(...i.extraClasses),i.italic&&s.push("italic"),i.strikethrough&&s.push("strikethrough"),i.disabledCommand&&o.push("disabled"),i.title&&(r+=i.title)),this.domNode.className=s.join(" "),this.domNode.element.setAttribute("aria-label",r),this.labelContainer.className=o.join(" "),this.setupHover(i!=null&&i.descriptionTitle?this.labelContainer:this.element,i==null?void 0:i.title),this.nameNode.setLabel(e,i),t||this.descriptionNode){const a=this.getOrCreateDescriptionNode();a instanceof Pd?(a.set(t||"",i?i.descriptionMatches:void 0,void 0,i==null?void 0:i.labelEscapeNewLines),this.setupHover(a.element,i==null?void 0:i.descriptionTitle)):(a.textContent=t&&(i!=null&&i.labelEscapeNewLines)?Pd.escapeNewLines(t,[]):t||"",this.setupHover(a.element,(i==null?void 0:i.descriptionTitle)||""),a.empty=!t)}}setupHover(e,t){const i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),!t){e.removeAttribute("title");return}if(!this.hoverDelegate)pDe(e,t);else{const s=kG(this.hoverDelegate,e,t);s&&this.customHovers.set(e,s)}}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}getOrCreateDescriptionNode(){var e;if(!this.descriptionNode){const t=this._register(new pE(le(this.labelContainer,ye("span.monaco-icon-description-container"))));!((e=this.creationOptions)===null||e===void 0)&&e.supportDescriptionHighlights?this.descriptionNode=new Pd(le(t.element,ye("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons}):this.descriptionNode=this._register(new pE(le(t.element,ye("span.label-description"))))}return this.descriptionNode}}class Y2e{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&Lo(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=le(this.container,ye("a.label-name",{id:t==null?void 0:t.domId}))),this.singleLabel.textContent=e;else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;for(let i=0;i{const o={start:i,end:i+s.length},r=t.map(a=>kn.intersect(o,a)).filter(a=>!kn.isEmpty(a)).map(({start:a,end:l})=>({start:a-i,end:l-i}));return i=o.end+e.length,r})}class X2e{constructor(e,t){this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&Lo(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=new Pd(le(this.container,ye("a.label-name",{id:t==null?void 0:t.domId})),{supportIcons:this.supportIcons})),this.singleLabel.set(e,t==null?void 0:t.matches,void 0,t==null?void 0:t.labelEscapeNewLines);else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;const i=(t==null?void 0:t.separator)||"/",s=Z2e(e,i,t==null?void 0:t.matches);for(let o=0;o{const n=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:n,collatorIsNumeric:n.resolvedOptions().numeric}});function J2e(n,e,t=!1){const i=n||"",s=e||"",o=D8.value.collator.compare(i,s);return D8.value.collatorIsNumeric&&o===0&&i!==s?is.length)return 1}return 0}var iEe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class dK{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>typeof e=="string"?e:e.label).join("")}}iEe([ki],dK.prototype,"toString",null);const nEe=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;function sEe(n){const e=[];let t=0,i;for(;i=nEe.exec(n);){i.index-t>0&&e.push(n.substring(t,i.index));const[,s,o,,r]=i;r?e.push({label:s,href:o,title:r}):e.push({label:s,href:o}),t=i.index+i[0].length}return t{gme(f)&&Ue.stop(f,!0),t.callback(o.href)},c=t.disposables.add(new rt(a,de.CLICK)).event,d=t.disposables.add(new rt(a,de.KEY_DOWN)).event,u=ue.chain(d,f=>f.filter(g=>{const p=new Ht(g);return p.equals(10)||p.equals(3)}));t.disposables.add(Mt.addTarget(a));const h=t.disposables.add(new rt(a,Ot.Tap)).event;ue.any(c,h,u)(l,null,t.disposables),e.appendChild(a)}}var uK=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},k8=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const zr=ye;class aEe{constructor(e,t,i,s,o,r,a){var l,c,d;this._checked=!1,this._hidden=!1,this.hasCheckbox=s,this.index=i,this.fireButtonTriggered=o,this.fireSeparatorButtonTriggered=r,this._onChecked=a,this.onChecked=s?ue.map(ue.filter(this._onChecked.event,u=>u.listElement===this),u=>u.checked):ue.None,e.type==="separator"?this._separator=e:(this.item=e,t&&t.type==="separator"&&!t.buttons&&(this._separator=t),this.saneDescription=this.item.description,this.saneDetail=this.item.detail,this._labelHighlights=(l=this.item.highlights)===null||l===void 0?void 0:l.label,this._descriptionHighlights=(c=this.item.highlights)===null||c===void 0?void 0:c.description,this._detailHighlights=(d=this.item.highlights)===null||d===void 0?void 0:d.detail,this.saneTooltip=this.item.tooltip),this._init=new Wf(()=>{var u;const h=(u=e.label)!==null&&u!==void 0?u:"",f=__(h).text.trim(),g=e.ariaLabel||[h,this.saneDescription,this.saneDetail].map(p=>uDe(p)).filter(p=>!!p).join(", ");return{saneLabel:h,saneSortLabel:f,saneAriaLabel:g}})}get saneLabel(){return this._init.value.saneLabel}get saneSortLabel(){return this._init.value.saneSortLabel}get saneAriaLabel(){return this._init.value.saneAriaLabel}get element(){return this._element}set element(e){this._element=e}get hidden(){return this._hidden}set hidden(e){this._hidden=e}get checked(){return this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire({listElement:this,checked:e}))}get separator(){return this._separator}set separator(e){this._separator=e}get labelHighlights(){return this._labelHighlights}set labelHighlights(e){this._labelHighlights=e}get descriptionHighlights(){return this._descriptionHighlights}set descriptionHighlights(e){this._descriptionHighlights=e}get detailHighlights(){return this._detailHighlights}set detailHighlights(e){this._detailHighlights=e}}class dy{constructor(e){this.themeService=e}get templateId(){return dy.ID}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=[],t.toDisposeTemplate=[],t.entry=le(e,zr(".quick-input-list-entry"));const i=le(t.entry,zr("label.quick-input-list-label"));t.toDisposeTemplate.push(ji(i,de.CLICK,c=>{t.checkbox.offsetParent||c.preventDefault()})),t.checkbox=le(i,zr("input.quick-input-list-checkbox")),t.checkbox.type="checkbox",t.toDisposeTemplate.push(ji(t.checkbox,de.CHANGE,c=>{t.element.checked=t.checkbox.checked}));const s=le(i,zr(".quick-input-list-rows")),o=le(s,zr(".quick-input-list-row")),r=le(s,zr(".quick-input-list-row"));t.label=new BN(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0}),t.toDisposeTemplate.push(t.label),t.icon=nj(t.label.element,zr(".quick-input-list-icon"));const a=le(o,zr(".quick-input-list-entry-keybinding"));t.keybinding=new cy(a,wo);const l=le(r,zr(".quick-input-list-label-meta"));return t.detail=new BN(l,{supportHighlights:!0,supportIcons:!0}),t.toDisposeTemplate.push(t.detail),t.separator=le(t.entry,zr(".quick-input-list-separator")),t.actionBar=new al(t.entry),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.push(t.actionBar),t}renderElement(e,t,i){var s,o,r,a;i.element=e,e.element=(s=i.entry)!==null&&s!==void 0?s:void 0;const l=e.item?e.item:e.separator;i.checkbox.checked=e.checked,i.toDisposeElement.push(e.onChecked(g=>i.checkbox.checked=g));const{labelHighlights:c,descriptionHighlights:d,detailHighlights:u}=e;if(!((o=e.item)===null||o===void 0)&&o.iconPath){const g=yD(this.themeService.getColorTheme().type)?e.item.iconPath.dark:(r=e.item.iconPath.light)!==null&&r!==void 0?r:e.item.iconPath.dark,p=je.revive(g);i.icon.className="quick-input-list-icon",i.icon.style.backgroundImage=iu(p)}else i.icon.style.backgroundImage="",i.icon.className=!((a=e.item)===null||a===void 0)&&a.iconClass?`quick-input-list-icon ${e.item.iconClass}`:"";const h={matches:c||[],descriptionTitle:e.saneDescription,descriptionMatches:d||[],labelEscapeNewLines:!0};l.type!=="separator"?(h.extraClasses=l.iconClasses,h.italic=l.italic,h.strikethrough=l.strikethrough,i.entry.classList.remove("quick-input-list-separator-as-item")):i.entry.classList.add("quick-input-list-separator-as-item"),i.label.setLabel(e.saneLabel,e.saneDescription,h),i.keybinding.set(l.type==="separator"?void 0:l.keybinding),e.saneDetail?(i.detail.element.style.display="",i.detail.setLabel(e.saneDetail,void 0,{matches:u,title:e.saneDetail,labelEscapeNewLines:!0})):i.detail.element.style.display="none",e.item&&e.separator&&e.separator.label?(i.separator.textContent=e.separator.label,i.separator.style.display=""):i.separator.style.display="none",i.entry.classList.toggle("quick-input-list-separator-border",!!e.separator);const f=l.buttons;f&&f.length?(i.actionBar.push(f.map((g,p)=>{let _=g.iconClass||(g.iconPath?WN(g.iconPath):void 0);return g.alwaysVisible&&(_=_?`${_} always-visible`:"always-visible"),{id:`id-${p}`,class:_,enabled:!0,label:"",tooltip:g.tooltip||"",run:()=>{l.type!=="separator"?e.fireButtonTriggered({button:g,item:l}):e.fireSeparatorButtonTriggered({button:g,separator:l})}}}),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i){i.toDisposeElement=Bt(i.toDisposeElement),i.actionBar.clear()}disposeTemplate(e){e.toDisposeElement=Bt(e.toDisposeElement),e.toDisposeTemplate=Bt(e.toDisposeTemplate)}}dy.ID="listelement";class lEe{getHeight(e){return e.item?e.saneDetail?44:22:24}getTemplateId(e){return dy.ID}}var tn;(function(n){n[n.First=1]="First",n[n.Second=2]="Second",n[n.Last=3]="Last",n[n.Next=4]="Next",n[n.Previous=5]="Previous",n[n.NextPage=6]="NextPage",n[n.PreviousPage=7]="PreviousPage"})(tn||(tn={}));class x3{constructor(e,t,i,s){this.parent=e,this.options=i,this.inputElements=[],this.elements=[],this.elementsToIndexes=new Map,this.matchOnDescription=!1,this.matchOnDetail=!1,this.matchOnLabel=!0,this.matchOnLabelMode="fuzzy",this.sortByLabel=!0,this._onChangedAllVisibleChecked=new B,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new B,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new B,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new B,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new B,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new B,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._onKeyDown=new B,this.onKeyDown=this._onKeyDown.event,this._onLeave=new B,this.onLeave=this._onLeave.event,this._listElementChecked=new B,this._fireCheckedEvents=!0,this.elementDisposables=[],this.disposables=[],this.id=t,this.container=le(this.parent,zr(".quick-input-list"));const o=new lEe,r=new uEe;if(this.list=i.createList("QuickInput",this.container,o,[new dy(s)],{identityProvider:{getId:a=>{var l,c,d,u,h,f,g,p;return(p=(f=(u=(c=(l=a.item)===null||l===void 0?void 0:l.id)!==null&&c!==void 0?c:(d=a.item)===null||d===void 0?void 0:d.label)!==null&&u!==void 0?u:(h=a.separator)===null||h===void 0?void 0:h.id)!==null&&f!==void 0?f:(g=a.separator)===null||g===void 0?void 0:g.label)!==null&&p!==void 0?p:""}},setRowLineHeight:!1,multipleSelectionSupport:!1,horizontalScrolling:!1,accessibilityProvider:r}),this.list.getHTMLElement().id=t,this.disposables.push(this.list),this.disposables.push(this.list.onKeyDown(a=>{const l=new Ht(a);switch(l.keyCode){case 10:this.toggleCheckbox();break;case 31:(mt?a.metaKey:a.ctrlKey)&&this.list.setFocus(is(this.list.length));break;case 16:{const c=this.list.getFocus();c.length===1&&c[0]===0&&this._onLeave.fire();break}case 18:{const c=this.list.getFocus();c.length===1&&c[0]===this.list.length-1&&this._onLeave.fire();break}}this._onKeyDown.fire(l)})),this.disposables.push(this.list.onMouseDown(a=>{a.browserEvent.button!==2&&a.browserEvent.preventDefault()})),this.disposables.push(K(this.container,de.CLICK,a=>{(a.x||a.y)&&this._onLeave.fire()})),this.disposables.push(this.list.onMouseMiddleClick(a=>{this._onLeave.fire()})),this.disposables.push(this.list.onContextMenu(a=>{typeof a.index=="number"&&(a.browserEvent.preventDefault(),this.list.setSelection([a.index]))})),i.hoverDelegate){const a=new hj(i.hoverDelegate.delay);this.disposables.push(this.list.onMouseOver(l=>k8(this,void 0,void 0,function*(){var c;if(l.browserEvent.target instanceof HTMLAnchorElement){a.cancel();return}if(!(!(l.browserEvent.relatedTarget instanceof HTMLAnchorElement)&&Sn(l.browserEvent.relatedTarget,(c=l.element)===null||c===void 0?void 0:c.element)))try{yield a.trigger(()=>k8(this,void 0,void 0,function*(){l.element&&this.showHover(l.element)}))}catch(d){if(!Bf(d))throw d}}))),this.disposables.push(this.list.onMouseOut(l=>{var c;Sn(l.browserEvent.relatedTarget,(c=l.element)===null||c===void 0?void 0:c.element)||a.cancel()})),this.disposables.push(a)}this.disposables.push(this._listElementChecked.event(a=>this.fireCheckedEvents())),this.disposables.push(this._onChangedAllVisibleChecked,this._onChangedCheckedCount,this._onChangedVisibleCount,this._onChangedCheckedElements,this._onButtonTriggered,this._onSeparatorButtonTriggered,this._onLeave,this._onKeyDown)}get onDidChangeFocus(){return ue.map(this.list.onDidChangeFocus,e=>e.elements.map(t=>t.item))}get onDidChangeSelection(){return ue.map(this.list.onDidChangeSelection,e=>({items:e.elements.map(t=>t.item),event:e.browserEvent}))}get scrollTop(){return this.list.scrollTop}set scrollTop(e){this.list.scrollTop=e}get ariaLabel(){return this.list.getHTMLElement().ariaLabel}set ariaLabel(e){this.list.getHTMLElement().ariaLabel=e}getAllVisibleChecked(){return this.allVisibleChecked(this.elements,!1)}allVisibleChecked(e,t=!0){for(let i=0,s=e.length;i{t.hidden||(t.checked=e)})}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}setElements(e){this.elementDisposables=Bt(this.elementDisposables);const t=r=>this.fireButtonTriggered(r),i=r=>this.fireSeparatorButtonTriggered(r);this.inputElements=e;const s=new Map,o=this.parent.classList.contains("show-checkboxes");this.elements=e.reduce((r,a,l)=>{var c;const d=l>0?e[l-1]:void 0;if(a.type==="separator"&&!a.buttons)return r;const u=new aEe(a,d,l,o,t,i,this._listElementChecked),h=r.length;return r.push(u),s.set((c=u.item)!==null&&c!==void 0?c:u.separator,h),r},[]),this.elementsToIndexes=s,this.list.splice(0,this.list.length),this.list.splice(0,this.list.length,this.elements),this._onChangedVisibleCount.fire(this.elements.length)}getFocusedElements(){return this.list.getFocusedElements().map(e=>e.item)}setFocusedElements(e){if(this.list.setFocus(e.filter(t=>this.elementsToIndexes.has(t)).map(t=>this.elementsToIndexes.get(t))),e.length>0){const t=this.list.getFocus()[0];typeof t=="number"&&this.list.reveal(t)}}getActiveDescendant(){return this.list.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){this.list.setSelection(e.filter(t=>this.elementsToIndexes.has(t)).map(t=>this.elementsToIndexes.get(t)))}getCheckedElements(){return this.elements.filter(e=>e.checked).map(e=>e.item).filter(e=>!!e)}setCheckedElements(e){try{this._fireCheckedEvents=!1;const t=new Set;for(const i of e)t.add(i);for(const i of this.elements)i.checked=t.has(i.item)}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}set enabled(e){this.list.getHTMLElement().style.pointerEvents=e?"":"none"}focus(e){if(!this.list.length)return;switch(e===tn.Second&&this.list.length<2&&(e=tn.First),e){case tn.First:this.list.scrollTop=0,this.list.focusFirst(void 0,i=>!!i.item);break;case tn.Second:this.list.scrollTop=0,this.list.focusNth(1,void 0,i=>!!i.item);break;case tn.Last:this.list.scrollTop=this.list.scrollHeight,this.list.focusLast(void 0,i=>!!i.item);break;case tn.Next:{this.list.focusNext(void 0,!0,void 0,s=>!!s.item);const i=this.list.getFocus()[0];i!==0&&!this.elements[i-1].item&&this.list.firstVisibleIndex>i-1&&this.list.reveal(i-1);break}case tn.Previous:{this.list.focusPrevious(void 0,!0,void 0,s=>!!s.item);const i=this.list.getFocus()[0];i!==0&&!this.elements[i-1].item&&this.list.firstVisibleIndex>i-1&&this.list.reveal(i-1);break}case tn.NextPage:this.list.focusNextPage(void 0,i=>!!i.item);break;case tn.PreviousPage:this.list.focusPreviousPage(void 0,i=>!!i.item);break}const t=this.list.getFocus()[0];typeof t=="number"&&this.list.reveal(t)}clearFocus(){this.list.setFocus([])}domFocus(){this.list.domFocus()}showHover(e){var t,i,s;this.options.hoverDelegate!==void 0&&(this._lastHover&&!this._lastHover.isDisposed&&((i=(t=this.options.hoverDelegate).onDidHideHover)===null||i===void 0||i.call(t),(s=this._lastHover)===null||s===void 0||s.dispose()),!(!e.element||!e.saneTooltip)&&(this._lastHover=this.options.hoverDelegate.showHover({content:e.saneTooltip,target:e.element,linkHandler:o=>{this.options.linkOpenerDelegate(o)},showPointer:!0,container:this.container,hoverPosition:1},!1)))}layout(e){this.list.getHTMLElement().style.maxHeight=e?`${Math.floor(e/44)*44+6}px`:"",this.list.layout()}filter(e){if(!(this.sortByLabel||this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))return this.list.layout(),!1;const t=e;if(e=e.trim(),!e||!(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))this.elements.forEach(s=>{s.labelHighlights=void 0,s.descriptionHighlights=void 0,s.detailHighlights=void 0,s.hidden=!1;const o=s.index&&this.inputElements[s.index-1];s.item&&(s.separator=o&&o.type==="separator"&&!o.buttons?o:void 0)});else{let s;this.elements.forEach(o=>{var r,a,l,c;let d;this.matchOnLabelMode==="fuzzy"?d=this.matchOnLabel&&(r=tE(e,__(o.saneLabel)))!==null&&r!==void 0?r:void 0:d=this.matchOnLabel&&(a=cEe(t,__(o.saneLabel)))!==null&&a!==void 0?a:void 0;const u=this.matchOnDescription&&(l=tE(e,__(o.saneDescription||"")))!==null&&l!==void 0?l:void 0,h=this.matchOnDetail&&(c=tE(e,__(o.saneDetail||"")))!==null&&c!==void 0?c:void 0;if(d||u||h?(o.labelHighlights=d,o.descriptionHighlights=u,o.detailHighlights=h,o.hidden=!1):(o.labelHighlights=void 0,o.descriptionHighlights=void 0,o.detailHighlights=void 0,o.hidden=o.item?!o.item.alwaysShow:!0),o.item?o.separator=void 0:o.separator&&(o.hidden=!0),!this.sortByLabel){const f=o.index&&this.inputElements[o.index-1];s=f&&f.type==="separator"?f:s,s&&!o.hidden&&(o.separator=s,s=void 0)}})}const i=this.elements.filter(s=>!s.hidden);if(this.sortByLabel&&e){const s=e.toLowerCase();i.sort((o,r)=>dEe(o,r,s))}return this.elementsToIndexes=i.reduce((s,o,r)=>{var a;return s.set((a=o.item)!==null&&a!==void 0?a:o.separator,r),s},new Map),this.list.splice(0,this.list.length,i),this.list.setFocus([]),this.list.layout(),this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedVisibleCount.fire(i.length),!0}toggleCheckbox(){try{this._fireCheckedEvents=!1;const e=this.list.getFocusedElements(),t=this.allVisibleChecked(e);for(const i of e)i.checked=!t}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}display(e){this.container.style.display=e?"":"none"}isDisplayed(){return this.container.style.display!=="none"}dispose(){this.elementDisposables=Bt(this.elementDisposables),this.disposables=Bt(this.disposables)}fireCheckedEvents(){this._fireCheckedEvents&&(this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedCheckedCount.fire(this.getCheckedCount()),this._onChangedCheckedElements.fire(this.getCheckedElements()))}fireButtonTriggered(e){this._onButtonTriggered.fire(e)}fireSeparatorButtonTriggered(e){this._onSeparatorButtonTriggered.fire(e)}style(e){this.list.style(e)}toggleHover(){const e=this.list.getFocusedElements()[0];if(!(e!=null&&e.saneTooltip))return;if(this._lastHover&&!this._lastHover.isDisposed){this._lastHover.dispose();return}const t=this.list.getFocusedElements()[0];if(!t)return;this.showHover(t);const i=new pe;i.add(this.list.onDidChangeFocus(s=>{s.indexes.length&&this.showHover(s.elements[0])})),this._lastHover&&i.add(this._lastHover),this._toggleHover=i,this.elementDisposables.push(this._toggleHover)}}uK([ki],x3.prototype,"onDidChangeFocus",null);uK([ki],x3.prototype,"onDidChangeSelection",null);function cEe(n,e){const{text:t,iconOffsets:i}=e;if(!i||i.length===0)return E8(n,t);const s=jL(t," "),o=t.length-s.length,r=E8(n,s);if(r)for(const a of r){const l=i[a.start+o]+o;a.start+=l,a.end+=l}return r}function E8(n,e){const t=e.toLowerCase().indexOf(n.toLowerCase());return t!==-1?[{start:t,end:t+n.length}]:null}function dEe(n,e,t){const i=n.labelHighlights||[],s=e.labelHighlights||[];return i.length&&!s.length?-1:!i.length&&s.length?1:i.length===0&&s.length===0?0:eEe(n.saneSortLabel,e.saneSortLabel,t)}class uEe{getWidgetAriaLabel(){return m("quickInput","Quick Input")}getAriaLabel(e){var t;return!((t=e.separator)===null||t===void 0)&&t.label?`${e.saneAriaLabel}, ${e.separator.label}`:e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(e){return e.hasCheckbox?"checkbox":"option"}isChecked(e){if(e.hasCheckbox)return{value:e.checked,onDidChange:e.onChecked}}}var A8=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const VN={iconClass:Te.asClassName(se.quickInputBack),tooltip:m("quickInput.back","Back"),handle:-1};class uy extends Y{constructor(e){super(),this.ui=e,this._widgetUpdated=!1,this.visible=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._buttons=[],this.buttonsUpdated=!1,this._toggles=[],this.togglesUpdated=!1,this.noValidationMessage=uy.noPromptMessage,this._severity=bi.Ignore,this.onDidTriggerButtonEmitter=this._register(new B),this.onDidHideEmitter=this._register(new B),this.onDisposeEmitter=this._register(new B),this.visibleDisposables=this._register(new pe),this.onDidHide=this.onDidHideEmitter.event}get title(){return this._title}set title(e){this._title=e,this.update()}get description(){return this._description}set description(e){this._description=e,this.update()}get step(){return this._steps}set step(e){this._steps=e,this.update()}get totalSteps(){return this._totalSteps}set totalSteps(e){this._totalSteps=e,this.update()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.update()}get contextKey(){return this._contextKey}set contextKey(e){this._contextKey=e,this.update()}get busy(){return this._busy}set busy(e){this._busy=e,this.update()}get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(e){const t=this._ignoreFocusOut!==e&&!Jd;this._ignoreFocusOut=e&&!Jd,t&&this.update()}get buttons(){return this._buttons}set buttons(e){this._buttons=e,this.buttonsUpdated=!0,this.update()}get toggles(){return this._toggles}set toggles(e){this._toggles=e??[],this.togglesUpdated=!0,this.update()}get validationMessage(){return this._validationMessage}set validationMessage(e){this._validationMessage=e,this.update()}get severity(){return this._severity}set severity(e){this._severity=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.onDidTriggerButton(e=>{this.buttons.indexOf(e)!==-1&&this.onDidTriggerButtonEmitter.fire(e)})),this.ui.show(this),this.visible=!0,this._lastValidationMessage=void 0,this._lastSeverity=void 0,this.buttons.length&&(this.buttonsUpdated=!0),this.toggles.length&&(this.togglesUpdated=!0),this.update())}hide(){this.visible&&this.ui.hide()}didHide(e=kv.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}update(){var e,t;if(!this.visible)return;const i=this.getTitle();i&&this.ui.title.textContent!==i?this.ui.title.textContent=i:!i&&this.ui.title.innerHTML!==" "&&(this.ui.title.innerText=" ");const s=this.getDescription();if(this.ui.description1.textContent!==s&&(this.ui.description1.textContent=s),this.ui.description2.textContent!==s&&(this.ui.description2.textContent=s),this._widgetUpdated&&(this._widgetUpdated=!1,this._widget?ds(this.ui.widget,this._widget):ds(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new Lc,this.busyDelay.setIfNotSet(()=>{this.visible&&this.ui.progressBar.infinite()},800)),!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();const r=this.buttons.filter(l=>l===VN);this.ui.leftActionBar.push(r.map((l,c)=>{const d=new Do(`id-${c}`,"",l.iconClass||WN(l.iconPath),!0,()=>A8(this,void 0,void 0,function*(){this.onDidTriggerButtonEmitter.fire(l)}));return d.tooltip=l.tooltip||"",d}),{icon:!0,label:!1}),this.ui.rightActionBar.clear();const a=this.buttons.filter(l=>l!==VN);this.ui.rightActionBar.push(a.map((l,c)=>{const d=new Do(`id-${c}`,"",l.iconClass||WN(l.iconPath),!0,()=>A8(this,void 0,void 0,function*(){this.onDidTriggerButtonEmitter.fire(l)}));return d.tooltip=l.tooltip||"",d}),{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;const r=(t=(e=this.toggles)===null||e===void 0?void 0:e.filter(a=>a instanceof l0))!==null&&t!==void 0?t:[];this.ui.inputBox.toggles=r}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const o=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==o&&(this._lastValidationMessage=o,ds(this.ui.message),rEe(o,this.ui.message,{callback:r=>{this.ui.linkOpenerDelegate(r)},disposables:this.visibleDisposables})),this._lastSeverity!==this.severity&&(this._lastSeverity=this.severity,this.showMessageDecoration(this.severity))}getTitle(){return this.title&&this.step?`${this.title} (${this.getSteps()})`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?m("quickInput.steps","{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==bi.Ignore){const t=this.ui.inputBox.stylesForType(e);this.ui.message.style.color=t.foreground?`${t.foreground}`:"",this.ui.message.style.backgroundColor=t.background?`${t.background}`:"",this.ui.message.style.border=t.border?`1px solid ${t.border}`:"",this.ui.message.style.marginBottom="-2px"}else this.ui.message.style.color="",this.ui.message.style.backgroundColor="",this.ui.message.style.border="",this.ui.message.style.marginBottom=""}dispose(){this.hide(),this.onDisposeEmitter.fire(),super.dispose()}}uy.noPromptMessage=m("inputModeEntry","Press 'Enter' to confirm your input or 'Escape' to cancel");class Ev extends uy{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new B),this.onWillAcceptEmitter=this._register(new B),this.onDidAcceptEmitter=this._register(new B),this.onDidCustomEmitter=this._register(new B),this._items=[],this.itemsUpdated=!1,this._canSelectMany=!1,this._canAcceptInBackground=!1,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._autoFocusOnList=!0,this._keepScrollPosition=!1,this._itemActivation=La.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new B),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new B),this.onDidTriggerItemButtonEmitter=this._register(new B),this.onDidTriggerSeparatorButtonEmitter=this._register(new B),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this.filterValue=e=>e,this.onDidChangeValue=this.onDidChangeValueEmitter.event,this.onWillAccept=this.onWillAcceptEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event,this.onDidChangeActive=this.onDidChangeActiveEmitter.event,this.onDidChangeSelection=this.onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this.onDidTriggerItemButtonEmitter.event,this.onDidTriggerSeparatorButton=this.onDidTriggerSeparatorButtonEmitter.event}get quickNavigate(){return this._quickNavigate}set quickNavigate(e){this._quickNavigate=e,this.update()}get value(){return this._value}set value(e){this.doSetValue(e)}doSetValue(e,t){this._value!==e&&(this._value=e,t||this.update(),this.visible&&this.ui.list.filter(this.filterValue(this._value))&&this.trySelectFirst(),this.onDidChangeValueEmitter.fire(this._value))}set ariaLabel(e){this._ariaLabel=e,this.update()}get ariaLabel(){return this._ariaLabel}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get items(){return this._items}get scrollTop(){return this.ui.list.scrollTop}set scrollTop(e){this.ui.list.scrollTop=e}set items(e){this._items=e,this.itemsUpdated=!0,this.update()}get canSelectMany(){return this._canSelectMany}set canSelectMany(e){this._canSelectMany=e,this.update()}get canAcceptInBackground(){return this._canAcceptInBackground}set canAcceptInBackground(e){this._canAcceptInBackground=e}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e,this.update()}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e,this.update()}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e,this.update()}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e,this.update()}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update()}get autoFocusOnList(){return this._autoFocusOnList}set autoFocusOnList(e){this._autoFocusOnList=e,this.update()}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(e){this._keepScrollPosition=e}get itemActivation(){return this._itemActivation}set itemActivation(e){this._itemActivation=e}get activeItems(){return this._activeItems}set activeItems(e){this._activeItems=e,this.activeItemsUpdated=!0,this.update()}get selectedItems(){return this._selectedItems}set selectedItems(e){this._selectedItems=e,this.selectedItemsUpdated=!0,this.update()}get keyMods(){return this._quickNavigate?j2e:this.ui.keyMods}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get customButton(){return this._customButton}set customButton(e){this._customButton=e,this.update()}get customLabel(){return this._customButtonLabel}set customLabel(e){this._customButtonLabel=e,this.update()}get customHover(){return this._customButtonHover}set customHover(e){this._customButtonHover=e,this.update()}get ok(){return this._ok}set ok(e){this._ok=e,this.update()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}trySelectFirst(){this.autoFocusOnList&&(this.canSelectMany||this.ui.list.focus(tn.First))}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{this.doSetValue(e,!0)})),this.visibleDisposables.add(this.ui.inputBox.onMouseDown(e=>{this.autoFocusOnList||this.ui.list.clearFocus()})),this.visibleDisposables.add((this._hideInput?this.ui.list:this.ui.inputBox).onKeyDown(e=>{switch(e.keyCode){case 18:this.ui.list.focus(tn.Next),this.canSelectMany&&this.ui.list.domFocus(),Ue.stop(e,!0);break;case 16:this.ui.list.getFocusedElements().length?this.ui.list.focus(tn.Previous):this.ui.list.focus(tn.Last),this.canSelectMany&&this.ui.list.domFocus(),Ue.stop(e,!0);break;case 12:this.ui.list.focus(tn.NextPage),this.canSelectMany&&this.ui.list.domFocus(),Ue.stop(e,!0);break;case 11:this.ui.list.focus(tn.PreviousPage),this.canSelectMany&&this.ui.list.domFocus(),Ue.stop(e,!0);break;case 17:if(!this._canAcceptInBackground||!this.ui.inputBox.isSelectionAtEnd())return;this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!0));break;case 14:(e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey&&(this.ui.list.focus(tn.First),Ue.stop(e,!0));break;case 13:(e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey&&(this.ui.list.focus(tn.Last),Ue.stop(e,!0));break}})),this.visibleDisposables.add(this.ui.onDidAccept(()=>{this.canSelectMany?this.ui.list.getCheckedElements().length||(this._selectedItems=[],this.onDidChangeSelectionEmitter.fire(this.selectedItems)):this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(!1)})),this.visibleDisposables.add(this.ui.onDidCustom(()=>{this.onDidCustomEmitter.fire()})),this.visibleDisposables.add(this.ui.list.onDidChangeFocus(e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&Zi(e,this._activeItems,(t,i)=>t===i)||(this._activeItems=e,this.onDidChangeActiveEmitter.fire(e))})),this.visibleDisposables.add(this.ui.list.onDidChangeSelection(({items:e,event:t})=>{if(this.canSelectMany){e.length&&this.ui.list.setSelectedElements([]);return}this.selectedItemsToConfirm!==this._selectedItems&&Zi(e,this._selectedItems,(i,s)=>i===s)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(t instanceof MouseEvent&&t.button===1))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{this.canSelectMany&&(this.selectedItemsToConfirm!==this._selectedItems&&Zi(e,this._selectedItems,(t,i)=>t===i)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e)))})),this.visibleDisposables.add(this.ui.list.onButtonTriggered(e=>this.onDidTriggerItemButtonEmitter.fire(e))),this.visibleDisposables.add(this.ui.list.onSeparatorButtonTriggered(e=>this.onDidTriggerSeparatorButtonEmitter.fire(e))),this.visibleDisposables.add(this.registerQuickNavigation()),this.valueSelectionUpdated=!0),super.show()}handleAccept(e){let t=!1;this.onWillAcceptEmitter.fire({veto:()=>t=!0}),t||this.onDidAcceptEmitter.fire({inBackground:e})}registerQuickNavigation(){return K(this.ui.container,de.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new Ht(e),i=t.keyCode;this._quickNavigate.keybindings.some(r=>{const a=r.getChords();return a.length>1?!1:a[0].shiftKey&&i===4?!(t.ctrlKey||t.altKey||t.metaKey):!!(a[0].altKey&&i===6||a[0].ctrlKey&&i===5||a[0].metaKey&&i===57)})&&(this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!1)),this._quickNavigate=void 0)})}update(){if(!this.visible)return;const e=this.keepScrollPosition?this.scrollTop:0,t=!!this.description,i={title:!!this.title||!!this.step||!!this.buttons.length,description:t,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!this._hideInput,progressBar:!this._hideInput||t,visibleCount:!0,count:this.canSelectMany&&!this._hideCountBadge,ok:this.ok==="default"?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage,customButton:this.customButton};this.ui.setVisibilities(i),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||"");let s=this.ariaLabel;if(!s&&i.inputBox&&(s=this.placeholder||Ev.DEFAULT_ARIA_LABEL,this.title&&(s+=` - ${this.title}`)),this.ui.list.ariaLabel!==s&&(this.ui.list.ariaLabel=s??null),this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,this.ui.list.matchOnLabelMode=this.matchOnLabelMode,this.ui.list.sortByLabel=this.sortByLabel,this.itemsUpdated)switch(this.itemsUpdated=!1,this.ui.list.setElements(this.items),this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this.ui.checkAll.checked=this.ui.list.getAllVisibleChecked(),this.ui.visibleCount.setCount(this.ui.list.getVisibleCount()),this.ui.count.setCount(this.ui.list.getCheckedCount()),this._itemActivation){case La.NONE:this._itemActivation=La.FIRST;break;case La.SECOND:this.ui.list.focus(tn.Second),this._itemActivation=La.FIRST;break;case La.LAST:this.ui.list.focus(tn.Last),this._itemActivation=La.FIRST;break;default:this.trySelectFirst();break}this.ui.container.classList.contains("show-checkboxes")!==!!this.canSelectMany&&(this.canSelectMany?this.ui.list.clearFocus():this.trySelectFirst()),this.activeItemsUpdated&&(this.activeItemsUpdated=!1,this.activeItemsToConfirm=this._activeItems,this.ui.list.setFocusedElements(this.activeItems),this.activeItemsToConfirm===this._activeItems&&(this.activeItemsToConfirm=null)),this.selectedItemsUpdated&&(this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=this._selectedItems,this.canSelectMany?this.ui.list.setCheckedElements(this.selectedItems):this.ui.list.setSelectedElements(this.selectedItems),this.selectedItemsToConfirm===this._selectedItems&&(this.selectedItemsToConfirm=null)),this.ui.customButton.label=this.customLabel||"",this.ui.customButton.element.title=this.customHover||"",i.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(tn.First)),this.keepScrollPosition&&(this.scrollTop=e)}}Ev.DEFAULT_ARIA_LABEL=m("quickInputBox.ariaLabel","Type to narrow down results.");class hEe extends uy{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new B),this.onDidAcceptEmitter=this._register(new B),this.onDidChangeValue=this.onDidValueChangeEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event}get value(){return this._value}set value(e){this._value=e||"",this.update()}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get password(){return this._password}set password(e){this._password=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{e!==this.value&&(this._value=e,this.onDidValueChangeEmitter.fire(e))})),this.visibleDisposables.add(this.ui.onDidAccept(()=>this.onDidAcceptEmitter.fire())),this.valueSelectionUpdated=!0),super.show()}update(){if(!this.visible)return;this.ui.container.classList.remove("hidden-input");const e={title:!!this.title||!!this.step||!!this.buttons.length,description:!!this.description||!!this.step,inputBox:!0,message:!0,progressBar:!0};this.ui.setVisibilities(e),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||""),this.ui.inputBox.password!==this.password&&(this.ui.inputBox.password=this.password)}}const Hs=ye;class $D extends Y{constructor(e,t){super(),this.options=e,this.themeService=t,this.enabled=!0,this.onDidAcceptEmitter=this._register(new B),this.onDidCustomEmitter=this._register(new B),this.onDidTriggerButtonEmitter=this._register(new B),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new B),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new B),this.onHide=this.onHideEmitter.event,this.idPrefix=e.idPrefix,this.parentElement=e.container,this.styles=e.styles,this.registerKeyModsListeners()}registerKeyModsListeners(){const e=t=>{this.keyMods.ctrlCmd=t.ctrlKey||t.metaKey,this.keyMods.alt=t.altKey};this._register(K(window,de.KEY_DOWN,e,!0)),this._register(K(window,de.KEY_UP,e,!0)),this._register(K(window,de.MOUSE_DOWN,e,!0))}getUI(){if(this.ui)return this.ui;const e=le(this.parentElement,Hs(".quick-input-widget.show-file-icons"));e.tabIndex=-1,e.style.display="none";const t=kr(e),i=le(e,Hs(".quick-input-titlebar")),s=this.options.hoverDelegate?{hoverDelegate:this.options.hoverDelegate}:void 0,o=this._register(new al(i,s));o.domNode.classList.add("quick-input-left-action-bar");const r=le(i,Hs(".quick-input-title")),a=this._register(new al(i,s));a.domNode.classList.add("quick-input-right-action-bar");const l=le(e,Hs(".quick-input-header")),c=le(l,Hs("input.quick-input-check-all"));c.type="checkbox",c.setAttribute("aria-label",m("quickInput.checkAll","Toggle all checkboxes")),this._register(ji(c,de.CHANGE,R=>{const z=c.checked;O.setAllVisibleChecked(z)})),this._register(K(c,de.CLICK,R=>{(R.x||R.y)&&f.setFocus()}));const d=le(l,Hs(".quick-input-description")),u=le(l,Hs(".quick-input-and-message")),h=le(u,Hs(".quick-input-filter")),f=this._register(new K2e(h,this.styles.inputBox,this.styles.toggle));f.setAttribute("aria-describedby",`${this.idPrefix}message`);const g=le(h,Hs(".quick-input-visible-count"));g.setAttribute("aria-live","polite"),g.setAttribute("aria-atomic","true");const p=new FN(g,{countFormat:m({key:"quickInput.visibleCount",comment:["This tells the user how many items are shown in a list of items to select from. The items can be anything. Currently not visible, but read by screen readers."]},"{0} Results")},this.styles.countBadge),_=le(h,Hs(".quick-input-count"));_.setAttribute("aria-live","polite");const v=new FN(_,{countFormat:m({key:"quickInput.countSelected",comment:["This tells the user how many items are selected in a list of items to select from. The items can be anything."]},"{0} Selected")},this.styles.countBadge),b=le(l,Hs(".quick-input-action")),y=this._register(new C8(b,this.styles.button));y.label=m("ok","OK"),this._register(y.onDidClick(R=>{this.onDidAcceptEmitter.fire()}));const w=le(l,Hs(".quick-input-action")),C=this._register(new C8(w,this.styles.button));C.label=m("custom","Custom"),this._register(C.onDidClick(R=>{this.onDidCustomEmitter.fire()}));const L=le(u,Hs(`#${this.idPrefix}message.quick-input-message`)),x=this._register(new HD(e,this.styles.progressBar));x.getContainer().classList.add("quick-input-progress");const D=le(e,Hs(".quick-input-html-widget"));D.tabIndex=-1;const k=le(e,Hs(".quick-input-description")),P=this.idPrefix+"list",O=this._register(new x3(e,P,this.options,this.themeService));f.setAttribute("aria-controls",P),this._register(O.onDidChangeFocus(()=>{var R;f.setAttribute("aria-activedescendant",(R=O.getActiveDescendant())!==null&&R!==void 0?R:"")})),this._register(O.onChangedAllVisibleChecked(R=>{c.checked=R})),this._register(O.onChangedVisibleCount(R=>{p.setCount(R)})),this._register(O.onChangedCheckedCount(R=>{v.setCount(R)})),this._register(O.onLeave(()=>{setTimeout(()=>{f.setFocus(),this.controller instanceof Ev&&this.controller.canSelectMany&&O.clearFocus()},0)}));const M=tu(e);return this._register(M),this._register(K(e,de.FOCUS,R=>{Sn(R.relatedTarget,e)||(this.previousFocusElement=R.relatedTarget instanceof HTMLElement?R.relatedTarget:void 0)},!0)),this._register(M.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(kv.Blur),this.previousFocusElement=void 0})),this._register(K(e,de.FOCUS,R=>{f.setFocus()})),this._register(ji(e,de.KEY_DOWN,R=>{if(!Sn(R.target,D))switch(R.keyCode){case 3:Ue.stop(R,!0),this.enabled&&this.onDidAcceptEmitter.fire();break;case 9:Ue.stop(R,!0),this.hide(kv.Gesture);break;case 2:if(!R.altKey&&!R.ctrlKey&&!R.metaKey){const z=[".quick-input-list .monaco-action-bar .always-visible",".quick-input-list-entry:hover .monaco-action-bar",".monaco-list-row.focused .monaco-action-bar"];if(e.classList.contains("show-checkboxes")?z.push("input"):z.push("input[type=text]"),this.getUI().list.isDisplayed()&&z.push(".monaco-list"),this.getUI().message&&z.push(".quick-input-message a"),this.getUI().widget){if(Sn(R.target,this.getUI().widget))break;z.push(".quick-input-html-widget")}const G=e.querySelectorAll(z.join(", "));R.shiftKey&&R.target===G[0]?(Ue.stop(R,!0),O.clearFocus()):!R.shiftKey&&Sn(R.target,G[G.length-1])&&(Ue.stop(R,!0),G[0].focus())}break;case 10:R.ctrlKey&&(Ue.stop(R,!0),this.getUI().list.toggleHover());break}})),this.ui={container:e,styleSheet:t,leftActionBar:o,titleBar:i,title:r,description1:k,description2:d,widget:D,rightActionBar:a,checkAll:c,inputContainer:u,filterContainer:h,inputBox:f,visibleCountContainer:g,visibleCount:p,countContainer:_,count:v,okContainer:b,ok:y,message:L,customButtonContainer:w,customButton:C,list:O,progressBar:x,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:R=>this.show(R),hide:()=>this.hide(),setVisibilities:R=>this.setVisibilities(R),setEnabled:R=>this.setEnabled(R),setContextKey:R=>this.options.setContextKey(R),linkOpenerDelegate:R=>this.options.linkOpenerDelegate(R)},this.updateStyles(),this.ui}pick(e,t={},i=ln.None){return new Promise((s,o)=>{let r=d=>{var u;r=s,(u=t.onKeyMods)===null||u===void 0||u.call(t,a.keyMods),s(d)};if(i.isCancellationRequested){r(void 0);return}const a=this.createQuickPick();let l;const c=[a,a.onDidAccept(()=>{if(a.canSelectMany)r(a.selectedItems.slice()),a.hide();else{const d=a.activeItems[0];d&&(r(d),a.hide())}}),a.onDidChangeActive(d=>{const u=d[0];u&&t.onDidFocus&&t.onDidFocus(u)}),a.onDidChangeSelection(d=>{if(!a.canSelectMany){const u=d[0];u&&(r(u),a.hide())}}),a.onDidTriggerItemButton(d=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton(Object.assign(Object.assign({},d),{removeItem:()=>{const u=a.items.indexOf(d.item);if(u!==-1){const h=a.items.slice(),f=h.splice(u,1),g=a.activeItems.filter(_=>_!==f[0]),p=a.keepScrollPosition;a.keepScrollPosition=!0,a.items=h,g&&(a.activeItems=g),a.keepScrollPosition=p}}}))),a.onDidTriggerSeparatorButton(d=>{var u;return(u=t.onDidTriggerSeparatorButton)===null||u===void 0?void 0:u.call(t,d)}),a.onDidChangeValue(d=>{l&&!d&&(a.activeItems.length!==1||a.activeItems[0]!==l)&&(a.activeItems=[l])}),i.onCancellationRequested(()=>{a.hide()}),a.onDidHide(()=>{Bt(c),r(void 0)})];a.title=t.title,a.canSelectMany=!!t.canPickMany,a.placeholder=t.placeHolder,a.ignoreFocusOut=!!t.ignoreFocusLost,a.matchOnDescription=!!t.matchOnDescription,a.matchOnDetail=!!t.matchOnDetail,a.matchOnLabel=t.matchOnLabel===void 0||t.matchOnLabel,a.autoFocusOnList=t.autoFocusOnList===void 0||t.autoFocusOnList,a.quickNavigate=t.quickNavigate,a.hideInput=!!t.hideInput,a.contextKey=t.contextKey,a.busy=!0,Promise.all([e,t.activeItem]).then(([d,u])=>{l=u,a.busy=!1,a.items=d,a.canSelectMany&&(a.selectedItems=d.filter(h=>h.type!=="separator"&&h.picked)),l&&(a.activeItems=[l])}),a.show(),Promise.resolve(e).then(void 0,d=>{o(d),a.hide()})})}createQuickPick(){const e=this.getUI();return new Ev(e)}createInputBox(){const e=this.getUI();return new hEe(e)}show(e){const t=this.getUI();this.onShowEmitter.fire();const i=this.controller;this.controller=e,i==null||i.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",ds(t.widget),t.rightActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(bi.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),ds(t.message),t.progressBar.stop(),t.list.setElements([]),t.list.matchOnDescription=!1,t.list.matchOnDetail=!1,t.list.matchOnLabel=!0,t.list.sortByLabel=!0,t.ignoreFocusOut=!1,t.inputBox.toggles=void 0;const s=this.options.backKeybindingLabel();VN.tooltip=s?m("quickInput.backWithKeybinding","Back ({0})",s):m("quickInput.back","Back"),t.container.style.display="",this.updateLayout(),t.inputBox.setFocus()}setVisibilities(e){const t=this.getUI();t.title.style.display=e.title?"":"none",t.description1.style.display=e.description&&(e.inputBox||e.checkAll)?"":"none",t.description2.style.display=e.description&&!(e.inputBox||e.checkAll)?"":"none",t.checkAll.style.display=e.checkAll?"":"none",t.inputContainer.style.display=e.inputBox?"":"none",t.filterContainer.style.display=e.inputBox?"":"none",t.visibleCountContainer.style.display=e.visibleCount?"":"none",t.countContainer.style.display=e.count?"":"none",t.okContainer.style.display=e.ok?"":"none",t.customButtonContainer.style.display=e.customButton?"":"none",t.message.style.display=e.message?"":"none",t.progressBar.getContainer().style.display=e.progressBar?"":"none",t.list.display(!!e.list),t.container.classList.toggle("show-checkboxes",!!e.checkBox),t.container.classList.toggle("hidden-input",!e.inputBox&&!e.description),this.updateLayout()}setEnabled(e){if(e!==this.enabled){this.enabled=e;for(const t of this.getUI().leftActionBar.viewItems)t.action.enabled=e;for(const t of this.getUI().rightActionBar.viewItems)t.action.enabled=e;this.getUI().checkAll.disabled=!e,this.getUI().inputBox.enabled=e,this.getUI().ok.enabled=e,this.getUI().list.enabled=e}}hide(e){var t,i,s;const o=this.controller;if(!o)return;const r=!Sn(document.activeElement,(i=(t=this.ui)===null||t===void 0?void 0:t.container)!==null&&i!==void 0?i:null);if(this.controller=null,this.onHideEmitter.fire(),this.getUI().container.style.display="none",!r){let a=this.previousFocusElement;for(;a&&!a.offsetParent;)a=(s=a.parentElement)!==null&&s!==void 0?s:void 0;a!=null&&a.offsetParent?(a.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}o.didHide(e)}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui&&this.isDisplayed()){this.ui.container.style.top=`${this.titleBarOffset}px`;const e=this.ui.container.style,t=Math.min(this.dimension.width*.62,$D.MAX_WIDTH);e.width=t+"px",e.marginLeft="-"+t/2+"px",this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&this.dimension.height*.4)}}applyStyles(e){this.styles=e,this.updateStyles()}updateStyles(){if(this.ui){const{quickInputTitleBackground:e,quickInputBackground:t,quickInputForeground:i,widgetBorder:s,widgetShadow:o}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e??"",this.ui.container.style.backgroundColor=t??"",this.ui.container.style.color=i??"",this.ui.container.style.border=s?`1px solid ${s}`:"",this.ui.container.style.boxShadow=o?`0 0 8px 2px ${o}`:"",this.ui.list.style(this.styles.list);const r=[];this.styles.pickerGroup.pickerGroupBorder&&r.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&r.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&r.push(".quick-input-list .quick-input-list-separator-as-item { color: var(--vscode-descriptionForeground); }"),(this.styles.keybindingLabel.keybindingLabelBackground||this.styles.keybindingLabel.keybindingLabelBorder||this.styles.keybindingLabel.keybindingLabelBottomBorder||this.styles.keybindingLabel.keybindingLabelShadow||this.styles.keybindingLabel.keybindingLabelForeground)&&(r.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&r.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&r.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&r.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&r.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&r.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),r.push("}"));const a=r.join(` -`);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}isDisplayed(){return this.ui&&this.ui.container.style.display!=="none"}}$D.MAX_WIDTH=600;var fEe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},kw=function(n,e){return function(t,i){e(t,i,n)}};let zN=class extends $1e{get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(ON))),this._quickAccess}constructor(e,t,i,s){super(i),this.instantiationService=e,this.contextKeyService=t,this.layoutService=s,this._onShow=this._register(new B),this._onHide=this._register(new B),this.contexts=new Map}createController(e=this.layoutService,t){const i={idPrefix:"quickInput_",container:e.container,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:o=>this.setContextKey(o),linkOpenerDelegate:o=>{this.instantiationService.invokeFunction(r=>{r.get(Dc).open(o,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),createList:(o,r,a,l,c)=>this.instantiationService.createInstance(RN,o,r,a,l,c),styles:this.computeStyles()},s=this._register(new $D(Object.assign(Object.assign({},i),t),this.themeService));return s.layout(e.dimension,e.offset.quickPickTop),this._register(e.onDidLayout(o=>s.layout(o,e.offset.quickPickTop))),this._register(s.onShow(()=>{this.resetContextKeys(),this._onShow.fire()})),this._register(s.onHide(()=>{this.resetContextKeys(),this._onHide.fire()})),s}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new _e(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),!(t&&t.get())&&(this.resetContextKeys(),t==null||t.set(!0))}resetContextKeys(){this.contexts.forEach(e=>{e.get()&&e.reset()})}pick(e,t={},i=ln.None){return this.controller.pick(e,t,i)}createQuickPick(){return this.controller.createQuickPick()}createInputBox(){return this.controller.createInputBox()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:re(l7),quickInputForeground:re(ive),quickInputTitleBackground:re(nve),widgetBorder:re(qj),widgetShadow:re(Ql)},inputBox:bx,toggle:_x,countBadge:OG,button:wke,progressBar:Cke,keybindingLabel:yke,list:oy({listBackground:l7,listFocusBackground:TT,listFocusForeground:IT,listInactiveFocusForeground:IT,listInactiveSelectionIconForeground:Xj,listInactiveFocusBackground:TT,listFocusOutline:Gt,listInactiveFocusOutline:Gt}),pickerGroup:{pickerGroupBorder:re(sve),pickerGroupForeground:re(Gj)}}}};zN=fEe([kw(0,yt),kw(1,tt),kw(2,co),kw(3,r0)],zN);var hK=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},np=function(n,e){return function(t,i){e(t,i,n)}};let HN=class extends zN{constructor(e,t,i,s,o){super(t,i,s,new eN(e.getContainerDomNode(),o)),this.host=void 0;const r=Om.get(e);if(r){const a=r.widget;this.host={_serviceBrand:void 0,get hasContainer(){return!0},get container(){return a.getDomNode()},get dimension(){return e.getLayoutInfo()},get onDidLayout(){return e.onDidLayoutChange},focus:()=>e.focus(),offset:{top:0,quickPickTop:0}}}else this.host=void 0}createController(){return super.createController(this.host)}};HN=hK([np(1,yt),np(2,tt),np(3,co),np(4,qt)],HN);let $N=class{get activeService(){const e=this.codeEditorService.getFocusedCodeEditor();if(!e)throw new Error("Quick input service needs a focused editor to work.");let t=this.mapEditorToService.get(e);if(!t){const i=t=this.instantiationService.createInstance(HN,e);this.mapEditorToService.set(e,t),hm(e.onDidDispose)(()=>{i.dispose(),this.mapEditorToService.delete(e)})}return t}get quickAccess(){return this.activeService.quickAccess}constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}pick(e,t={},i=ln.None){return this.activeService.pick(e,t,i)}createQuickPick(){return this.activeService.createQuickPick()}createInputBox(){return this.activeService.createInputBox()}};$N=hK([np(0,yt),np(1,qt)],$N);class Om{static get(e){return e.getContribution(Om.ID)}constructor(e){this.editor=e,this.widget=new UD(this.editor)}dispose(){this.widget.dispose()}}Om.ID="editor.controller.quickInput";class UD{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return UD.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}}UD.ID="editor.contrib.quickInputWidget";Tr(Om.ID,Om,4);class gEe{constructor(e,t,i,s,o){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=i,this.foreground=s,this.background=o}}function pEe(n){if(!n||!Array.isArray(n))return[];const e=[];let t=0;for(let i=0,s=n.length;i{const h=wEe(d.token,u.token);return h!==0?h:d.index-u.index});let t=0,i="000000",s="ffffff";for(;n.length>=1&&n[0].token==="";){const d=n.shift();d.fontStyle!==-1&&(t=d.fontStyle),d.foreground!==null&&(i=d.foreground),d.background!==null&&(s=d.background)}const o=new bEe;for(const d of e)o.getId(d);const r=o.getId(i),a=o.getId(s),l=new L3(t,r,a),c=new D3(l);for(let d=0,u=n.length;d"u"){const s=this._match(t),o=yEe(t);i=(s.metadata|o<<8)>>>0,this._cache.set(t,i)}return(i|e<<0)>>>0}}const vEe=/\b(comment|string|regex|regexp)\b/;function yEe(n){const e=n.match(vEe);if(!e)return 0;switch(e[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"regexp":return 3}throw new Error("Unexpected match for standard token type!")}function wEe(n,e){return ne?1:0}class L3{constructor(e,t,i){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=i,this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}clone(){return new L3(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,i){e!==-1&&(this._fontStyle=e),t!==0&&(this._foreground=t),i!==0&&(this._background=i),this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}}class D3{constructor(e){this._themeTrieElementBrand=void 0,this._mainRule=e,this._children=new Map}match(e){if(e==="")return this._mainRule;const t=e.indexOf(".");let i,s;t===-1?(i=e,s=""):(i=e.substring(0,t),s=e.substring(t+1));const o=this._children.get(i);return typeof o<"u"?o.match(s):this._mainRule}insert(e,t,i,s){if(e===""){this._mainRule.acceptOverwrite(t,i,s);return}const o=e.indexOf(".");let r,a;o===-1?(r=e,a=""):(r=e.substring(0,o),a=e.substring(o+1));let l=this._children.get(r);typeof l>"u"&&(l=new D3(this._mainRule.clone()),this._children.set(r,l)),l.insert(a,t,i,s)}}function CEe(n){const e=[];for(let t=1,i=n.length;t({format:s.format,location:s.location.toString()}))}}n.toJSONObject=e;function t(i){const s=o=>Ms(o)?o:void 0;if(i&&Array.isArray(i.src)&&i.src.every(o=>Ms(o.format)&&Ms(o.location)))return{weight:s(i.weight),style:s(i.style),src:i.src.map(o=>({format:o.format,location:je.parse(o.location)}))}}n.fromJSONObject=t})(T8||(T8={}));class EEe{constructor(){this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:m("iconDefinition.fontId","The id of the font to use. If not set, the font that is defined first is used.")},fontCharacter:{type:"string",description:m("iconDefinition.fontCharacter","The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${Te.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,i,s){const o=this.iconsById[e];if(o){if(i&&!o.description){o.description=i,this.iconSchema.properties[e].markdownDescription=`${i} $(${e})`;const l=this.iconReferenceSchema.enum.indexOf(e);l!==-1&&(this.iconReferenceSchema.enumDescriptions[l]=i),this._onDidChange.fire()}return o}const r={id:e,description:i,defaults:t,deprecationMessage:s};this.iconsById[e]=r;const a={$ref:"#/definitions/icons"};return s&&(a.deprecationMessage=s),i&&(a.markdownDescription=`${i}: $(${e})`),this.iconSchema.properties[e]=a,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(i||""),this._onDidChange.fire(),{id:e}}getIcons(){return Object.keys(this.iconsById).map(e=>this.iconsById[e])}getIcon(e){return this.iconsById[e]}getIconSchema(){return this.iconSchema}toString(){const e=(o,r)=>o.id.localeCompare(r.id),t=o=>{for(;Te.isThemeIcon(o.defaults);)o=this.iconsById[o.defaults.id];return`codicon codicon-${o?o.id:""}`},i=[];i.push("| preview | identifier | default codicon ID | description"),i.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const s=Object.keys(this.iconsById).map(o=>this.iconsById[o]);for(const o of s.filter(r=>!!r.description).sort(e))i.push(`||${o.id}|${Te.isThemeIcon(o.defaults)?o.defaults.id:o.id}|${o.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const o of s.filter(r=>!Te.isThemeIcon(r.defaults)).sort(e))i.push(`||${o.id}|`);return i.join(` -`)}}const tg=new EEe;_n.add(kEe.IconContribution,tg);function Xi(n,e,t,i){return tg.registerIcon(n,e,t,i)}function gK(){return tg}function AEe(){const n=kU();for(const e in n){const t="\\"+n[e].toString(16);tg.registerIcon(e,{fontCharacter:t})}}AEe();const pK="vscode://schemas/icons",mK=_n.as(dD.JSONContribution);mK.registerSchema(pK,tg.getIconSchema());const N8=new Di(()=>mK.notifySchemaChanged(pK),200);tg.onDidChange(()=>{N8.isScheduled()||N8.schedule()});const IEe=Xi("widget-close",se.close,m("widgetClose","Icon for the close action in widgets."));Xi("goto-previous-location",se.arrowUp,m("previousChangeIcon","Icon for goto previous editor location."));Xi("goto-next-location",se.arrowDown,m("nextChangeIcon","Icon for goto next editor location."));Te.modify(se.sync,"spin");Te.modify(se.loading,"spin");function TEe(n){const e=new pe,t=e.add(new B),i=gK();return e.add(i.onDidChange(()=>t.fire())),n&&e.add(n.onDidProductIconThemeChange(()=>t.fire())),{dispose:()=>e.dispose(),onDidChange:t.event,getCSS(){const s=n?n.getProductIconTheme():new _K,o={},r=l=>{const c=s.getIcon(l);if(!c)return;const d=c.font;return d?(o[d.id]=d.definition,`.codicon-${l.id}:before { content: '${c.fontCharacter}'; font-family: ${g9(d.id)}; }`):`.codicon-${l.id}:before { content: '${c.fontCharacter}'; }`},a=[];for(const l of i.getIcons()){const c=r(l);c&&a.push(c)}for(const l in o){const c=o[l],d=c.weight?`font-weight: ${c.weight};`:"",u=c.style?`font-style: ${c.style};`:"",h=c.src.map(f=>`${iu(f.location)} format('${f.format}')`).join(", ");a.push(`@font-face { src: ${h}; font-family: ${g9(l)};${d}${u} font-display: block; }`)}return a.join(` -`)}}}class _K{getIcon(e){const t=gK();let i=e.defaults;for(;Te.isThemeIcon(i);){const s=t.getIcon(i.id);if(!s)return;i=s.defaults}return i}}const id="vs",Z_="vs-dark",Tp="hc-black",Np="hc-light",bK=_n.as(jj.ColorContribution),NEe=_n.as(lq.ThemingContribution);class vK{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(MC(e)?this.id=e:this.id=i+" "+e,this.themeName=e):(this.id=i,this.themeName=i),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}get base(){return this.themeData.base}notifyBaseUpdated(){this.themeData.inherit&&(this.colors=null,this._tokenTheme=null)}getColors(){if(!this.colors){const e=new Map;for(const t in this.themeData.colors)e.set(t,H.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=UN(this.themeData.base);for(const i in t.colors)e.has(i)||e.set(i,H.fromHex(t.colors[i]))}this.colors=e}return this.colors}getColor(e,t){const i=this.getColors().get(e);if(i)return i;if(t!==!1)return this.getDefault(e)}getDefault(e){let t=this.defaultColors[e];return t||(t=bK.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case id:return Wo.LIGHT;case Tp:return Wo.HIGH_CONTRAST_DARK;case Np:return Wo.HIGH_CONTRAST_LIGHT;default:return Wo.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const o=UN(this.themeData.base);e=o.rules,o.encodedTokensColors&&(t=o.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],s=this.themeData.colors["editor.background"];if(i||s){const o={token:""};i&&(o.foreground=i),s&&(o.background=s),e.push(o)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=fK.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const o=this.tokenTheme._match([e].concat(t).join(".")).metadata,r=qs.getForeground(o),a=qs.getFontStyle(o);return{foreground:r,italic:!!(a&1),bold:!!(a&2),underline:!!(a&4),strikethrough:!!(a&8)}}}function MC(n){return n===id||n===Z_||n===Tp||n===Np}function UN(n){switch(n){case id:return SEe;case Z_:return xEe;case Tp:return LEe;case Np:return DEe}}function Ew(n){const e=UN(n);return new vK(n,e)}class REe extends Y{constructor(){super(),this._onColorThemeChange=this._register(new B),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new B),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new _K,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(id,Ew(id)),this._knownThemes.set(Z_,Ew(Z_)),this._knownThemes.set(Tp,Ew(Tp)),this._knownThemes.set(Np,Ew(Np));const e=this._register(TEe(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS} -${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(id),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),MU("(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return aT(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=kr(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),Y.None}_registerShadowDomContainer(e){const t=kr(e,i=>{i.className="monaco-colors",i.textContent=this._allCSS});return this._styleElements.push(t),{dispose:()=>{for(let i=0;i{i.base===e&&i.notifyBaseUpdated()}),this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setColorMapOverride(e){this._colorMapOverride=e,this._updateThemeOrColorMap()}setTheme(e){let t;this._knownThemes.has(e)?t=this._knownThemes.get(e):t=this._knownThemes.get(id),this._updateActualTheme(t)}_updateActualTheme(e){!e||this._theme===e||(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=window.matchMedia("(forced-colors: active)").matches;if(e!==ac(this._theme.type)){let t;yD(this._theme.type)?t=e?Tp:Z_:t=e?Np:id,this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],t={},i={addRule:r=>{t[r]||(e.push(r),t[r]=!0)}};NEe.getThemingParticipants().forEach(r=>r(this._theme,i,this._environment));const s=[];for(const r of bK.getColors()){const a=this._theme.getColor(r.id,!0);a&&s.push(`${fP(r.id)}: ${a.toString()};`)}i.addRule(`.monaco-editor, .monaco-diff-editor { ${s.join(` -`)} }`);const o=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(CEe(o)),this._themeCSS=e.join(` -`),this._updateCSS(),xi.setColorMap(o),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS} -${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}}const Rr=at("themeService");var MEe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},_E=function(n,e){return function(t,i){e(t,i,n)}};let jN=class extends Y{constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new B,this._onDidChangeReducedMotion=new B,this._accessibilityModeEnabledContext=ybe.bindTo(this._contextKeyService);const s=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(r=>{r.affectsConfiguration("editor.accessibilitySupport")&&(s(),this._onDidChangeScreenReaderOptimized.fire()),r.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())})),s(),this._register(this.onDidChangeScreenReaderOptimized(()=>s()));const o=window.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=o.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this.initReducedMotionListeners(o)}initReducedMotionListeners(e){if(!this._layoutService.hasContainer)return;this._register(K(e,"change",()=>{this._systemMotionReduced=e.matches,this._configMotionReduced==="auto"&&this._onDidChangeReducedMotion.fire()}));const t=()=>{const i=this.isMotionReduced();this._layoutService.container.classList.toggle("reduce-motion",i),this._layoutService.container.classList.toggle("enable-motion",!i)};t(),this._register(this.onDidChangeReducedMotion(()=>t()))}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return e==="on"||e==="auto"&&this._accessibilitySupport===2}get onDidChangeReducedMotion(){return this._onDidChangeReducedMotion.event}isMotionReduced(){const e=this._configMotionReduced;return e==="on"||e==="auto"&&this._systemMotionReduced}getAccessibilitySupport(){return this._accessibilitySupport}};jN=MEe([_E(0,tt),_E(1,r0),_E(2,ni)],jN);var jD=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Lf=function(n,e){return function(t,i){e(t,i,n)}},Ag,jc;let qN=class{constructor(e,t){this._commandService=e,this._hiddenStates=new Ix(t)}createMenu(e,t,i){return new KN(e,this._hiddenStates,Object.assign({emitEventsForSubmenuChanges:!1,eventDebounceDelay:50},i),this._commandService,t)}resetHiddenStates(e){this._hiddenStates.reset(e)}};qN=jD([Lf(0,gs),Lf(1,Qf)],qN);let Ix=Ag=class{constructor(e){this._storageService=e,this._disposables=new pe,this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const t=e.get(Ag._key,0,"{}");this._data=JSON.parse(t)}catch{this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(0,Ag._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{const t=e.get(Ag._key,0,"{}");this._data=JSON.parse(t)}catch(t){console.log("FAILED to read storage after UPDATE",t)}this._onDidChange.fire()}))}dispose(){this._onDidChange.dispose(),this._disposables.dispose()}_isHiddenByDefault(e,t){var i;return(i=this._hiddenByDefaultCache.get(`${e.id}/${t}`))!==null&&i!==void 0?i:!1}setDefaultState(e,t,i){this._hiddenByDefaultCache.set(`${e.id}/${t}`,i)}isHidden(e,t){var i,s;const o=this._isHiddenByDefault(e,t),r=(s=(i=this._data[e.id])===null||i===void 0?void 0:i.includes(t))!==null&&s!==void 0?s:!1;return o?!r:r}updateHidden(e,t,i){this._isHiddenByDefault(e,t)&&(i=!i);const o=this._data[e.id];if(i)o?o.indexOf(t)<0&&o.push(t):this._data[e.id]=[t];else if(o){const r=o.indexOf(t);r>=0&&Rhe(o,r),o.length===0&&delete this._data[e.id]}this._persist()}reset(e){if(e===void 0)this._data=Object.create(null),this._persist();else{for(const{id:t}of e)this._data[t]&&delete this._data[t];this._persist()}}_persist(){try{this._ignoreChangeEvent=!0;const e=JSON.stringify(this._data);this._storageService.store(Ag._key,e,0,0)}finally{this._ignoreChangeEvent=!1}}};Ix._key="menu.hiddenCommands";Ix=Ag=jD([Lf(0,Qf)],Ix);let GN=jc=class{constructor(e,t,i,s,o){this._id=e,this._hiddenStates=t,this._collectContextKeysForSubmenus=i,this._commandService=s,this._contextKeyService=o,this._menuGroups=[],this._structureContextKeys=new Set,this._preconditionContextKeys=new Set,this._toggledContextKeys=new Set,this.refresh()}get structureContextKeys(){return this._structureContextKeys}get preconditionContextKeys(){return this._preconditionContextKeys}get toggledContextKeys(){return this._toggledContextKeys}refresh(){this._menuGroups.length=0,this._structureContextKeys.clear(),this._preconditionContextKeys.clear(),this._toggledContextKeys.clear();const e=dr.getMenuItems(this._id);let t;e.sort(jc._compareMenuItems);for(const i of e){const s=i.group||"";(!t||t[0]!==s)&&(t=[s,[]],this._menuGroups.push(t)),t[1].push(i),this._collectContextKeys(i)}}_collectContextKeys(e){if(jc._fillInKbExprKeys(e.when,this._structureContextKeys),n_(e)){if(e.command.precondition&&jc._fillInKbExprKeys(e.command.precondition,this._preconditionContextKeys),e.command.toggled){const t=e.command.toggled.condition||e.command.toggled;jc._fillInKbExprKeys(t,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&dr.getMenuItems(e.submenu).forEach(this._collectContextKeys,this)}createActionGroups(e){const t=[];for(const i of this._menuGroups){const[s,o]=i,r=[];for(const a of o)if(this._contextKeyService.contextMatchesRules(a.when)){const l=n_(a);l&&this._hiddenStates.setDefaultState(this._id,a.command.id,!!a.isHiddenByDefault);const c=PEe(this._id,l?a.command:a,this._hiddenStates);if(l)r.push(new il(a.command,a.alt,e,c,this._contextKeyService,this._commandService));else{const d=new jc(a.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._contextKeyService).createActionGroups(e),u=Pn.join(...d.map(h=>h[1]));u.length>0&&r.push(new NS(a,c,u))}}r.length>0&&t.push([s,r])}return t}static _fillInKbExprKeys(e,t){if(e)for(const i of e.keys())t.add(i)}static _compareMenuItems(e,t){const i=e.group,s=t.group;if(i!==s){if(i){if(!s)return-1}else return 1;if(i==="navigation")return-1;if(s==="navigation")return 1;const a=i.localeCompare(s);if(a!==0)return a}const o=e.order||0,r=t.order||0;return or?1:jc._compareTitles(n_(e)?e.command.title:e.title,n_(t)?t.command.title:t.title)}static _compareTitles(e,t){const i=typeof e=="string"?e:e.original,s=typeof t=="string"?t:t.original;return i.localeCompare(s)}};GN=jc=jD([Lf(3,gs),Lf(4,tt)],GN);let KN=class{constructor(e,t,i,s,o){this._disposables=new pe,this._menuInfo=new GN(e,t,i.emitEventsForSubmenuChanges,s,o);const r=new Di(()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})},i.eventDebounceDelay);this._disposables.add(r),this._disposables.add(dr.onDidChangeMenu(d=>{d.has(e)&&r.schedule()}));const a=this._disposables.add(new pe),l=d=>{let u=!1,h=!1,f=!1;for(const g of d)if(u=u||g.isStructuralChange,h=h||g.isEnablementChange,f=f||g.isToggleChange,u&&h&&f)break;return{menu:this,isStructuralChange:u,isEnablementChange:h,isToggleChange:f}},c=()=>{a.add(o.onDidChangeContext(d=>{const u=d.affectsSome(this._menuInfo.structureContextKeys),h=d.affectsSome(this._menuInfo.preconditionContextKeys),f=d.affectsSome(this._menuInfo.toggledContextKeys);(u||h||f)&&this._onDidChange.fire({menu:this,isStructuralChange:u,isEnablementChange:h,isToggleChange:f})})),a.add(t.onDidChange(d=>{this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!1,isToggleChange:!1})}))};this._onDidChange=new mU({onWillAddFirstListener:c,onDidRemoveLastListener:a.clear.bind(a),delay:i.eventDebounceDelay,merge:l}),this.onDidChange=this._onDidChange.event}getActions(e){return this._menuInfo.createActionGroups(e)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}};KN=jD([Lf(3,gs),Lf(4,tt)],KN);function PEe(n,e,t){const i=Lpe(e)?e.submenu.id:e.id,s=typeof e.title=="string"?e.title:e.title.value,o=T_({id:`hide/${n.id}/${i}`,label:m("hide.label","Hide '{0}'",s),run(){t.updateHidden(n,i,!0)}}),r=T_({id:`toggle/${n.id}/${i}`,label:s,get checked(){return!t.isHidden(n,i)},run(){t.updateHidden(n,i,!!this.checked)}});return{hide:o,toggle:r,get isHidden(){return!r.checked}}}var OEe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},R8=function(n,e){return function(t,i){e(t,i,n)}},Ku=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let YN=class extends Y{constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],(bc||PU)&&this.installWebKitWriteTextWorkaround()}installWebKitWriteTextWorkaround(){const e=()=>{const t=new fj;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=t,navigator.clipboard.write([new ClipboardItem({"text/plain":t.p})]).catch(i=>Ku(this,void 0,void 0,function*(){(!(i instanceof Error)||i.name!=="NotAllowedError"||!t.isRejected)&&this.logService.error(i)}))};this.layoutService.hasContainer&&(this._register(K(this.layoutService.container,"click",e)),this._register(K(this.layoutService.container,"keydown",e)))}writeText(e,t){return Ku(this,void 0,void 0,function*(){if(t){this.mapTextToType.set(t,e);return}if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(e);try{return yield navigator.clipboard.writeText(e)}catch(o){console.error(o)}const i=document.activeElement,s=document.body.appendChild(ye("textarea",{"aria-hidden":!0}));s.style.height="1px",s.style.width="1px",s.style.position="absolute",s.value=e,s.focus(),s.select(),document.execCommand("copy"),i instanceof HTMLElement&&i.focus(),document.body.removeChild(s)})}readText(e){return Ku(this,void 0,void 0,function*(){if(e)return this.mapTextToType.get(e)||"";try{return yield navigator.clipboard.readText()}catch(t){return console.error(t),""}})}readFindText(){return Ku(this,void 0,void 0,function*(){return this.findText})}writeFindText(e){return Ku(this,void 0,void 0,function*(){this.findText=e})}writeResources(e){return Ku(this,void 0,void 0,function*(){this.resources=e})}readResources(){return Ku(this,void 0,void 0,function*(){return this.resources})}};YN=OEe([R8(0,r0),R8(1,Sc)],YN);const hy=at("clipboardService");var FEe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},BEe=function(n,e){return function(t,i){e(t,i,n)}};const X_="data-keybinding-context";class k3{constructor(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}get value(){return Object.assign({},this._value)}setValue(e,t){return this._value[e]!==t?(this._value[e]=t,!0):!1}removeValue(e){return e in this._value?(delete this._value[e],!0):!1}getValue(e){const t=this._value[e];return typeof t>"u"&&this._parent?this._parent.getValue(e):t}}class Fm extends k3{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}Fm.INSTANCE=new Fm;class Av extends k3{constructor(e,t,i){super(e,null),this._configurationService=t,this._values=Y_.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(s=>{if(s.source===7){const o=Array.from(this._values,([r])=>r);this._values.clear(),i.fire(new P8(o))}else{const o=[];for(const r of s.affectedKeys){const a=`config.${r}`,l=this._values.findSuperstr(a);l!==void 0&&(o.push(...ht.map(l,([c])=>c)),this._values.deleteSuperstr(a)),this._values.has(a)&&(o.push(a),this._values.delete(a))}i.fire(new P8(o))}})}dispose(){this._listener.dispose()}getValue(e){if(e.indexOf(Av._keyPrefix)!==0)return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(Av._keyPrefix.length),i=this._configurationService.getValue(t);let s;switch(typeof i){case"number":case"boolean":case"string":s=i;break;default:Array.isArray(i)?s=JSON.stringify(i):s=i}return this._values.set(e,s),s}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}}Av._keyPrefix="config.";class WEe{constructor(e,t,i){this._service=e,this._key=t,this._defaultValue=i,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){typeof this._defaultValue>"u"?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class M8{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class P8{constructor(e){this.keys=e}affectsSome(e){for(const t of this.keys)if(e.has(t))return!0;return!1}allKeysContainedIn(e){return this.keys.every(t=>e.has(t))}}class VEe{constructor(e){this.events=e}affectsSome(e){for(const t of this.events)if(t.affectsSome(e))return!0;return!1}allKeysContainedIn(e){return this.events.every(t=>t.allKeysContainedIn(e))}}function zEe(n,e){return n.allKeysContainedIn(new Set(Object.keys(e)))}class yK extends Y{constructor(e){super(),this._onDidChangeContext=this._register(new Ob({merge:t=>new VEe(t)})),this.onDidChangeContext=this._onDidChangeContext.event,this._isDisposed=!1,this._myContextId=e}createKey(e,t){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new WEe(this,e,t)}bufferChangeEvents(e){this._onDidChangeContext.pause();try{e()}finally{this._onDidChangeContext.resume()}}createScoped(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new HEe(this,e)}contextMatchesRules(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");const t=this.getContextValuesContainer(this._myContextId);return e?e.evaluate(t):!0}getContextKeyValue(e){if(!this._isDisposed)return this.getContextValuesContainer(this._myContextId).getValue(e)}setContext(e,t){if(this._isDisposed)return;const i=this.getContextValuesContainer(this._myContextId);i&&i.setValue(e,t)&&this._onDidChangeContext.fire(new M8(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new M8(e))}getContext(e){return this._isDisposed?Fm.INSTANCE:this.getContextValuesContainer($Ee(e))}dispose(){super.dispose(),this._isDisposed=!0}}let ZN=class extends yK{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0;const t=this._register(new Av(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t)}getContextValuesContainer(e){return this._isDisposed?Fm.INSTANCE:this._contexts.get(e)||Fm.INSTANCE}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ContextKeyService has been disposed");const t=++this._lastContextId;return this._contexts.set(t,new k3(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};ZN=FEe([BEe(0,ni)],ZN);class HEe extends yK{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new ra),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(X_)){let i="";this._domNode.classList&&(i=Array.from(this._domNode.classList.values()).join(", ")),console.error(`Element already has context attribute${i?": "+i:""}`)}this._domNode.setAttribute(X_,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(e=>{const i=this._parent.getContextValuesContainer(this._myContextId).value;zEe(e,i)||this._onDidChangeContext.fire(e)})}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(X_),super.dispose())}getContextValuesContainer(e){return this._isDisposed?Fm.INSTANCE:this._parent.getContextValuesContainer(e)}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ScopedContextKeyService has been disposed");return this._parent.createChildContext(e)}disposeContext(e){this._isDisposed||this._parent.disposeContext(e)}}function $Ee(n){for(;n;){if(n.hasAttribute(X_)){const e=n.getAttribute(X_);return e?parseInt(e,10):NaN}n=n.parentElement}return 0}function UEe(n,e,t){n.get(tt).createKey(String(e),jEe(t))}function jEe(n){return sU(n,e=>{if(typeof e=="object"&&e.$mid===1)return je.revive(e).toString();if(e instanceof je)return e.toString()})}Zt.registerCommand("_setContext",UEe);Zt.registerCommand({id:"getContextKeyInfo",handler(){return[..._e.all()].sort((n,e)=>n.key.localeCompare(e.key))},description:{description:m("getContextKeyInfo","A command that returns information about context keys"),args:[]}});Zt.registerCommand("_generateContextKeyInfo",function(){const n=[],e=new Set;for(const t of _e.all())e.has(t.key)||(e.add(t.key),n.push(t));n.sort((t,i)=>t.key.localeCompare(i.key)),console.log(JSON.stringify(n,void 0,2))});let qEe=class{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}};class O8{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){const e=[];for(const t of this._nodes.values())t.outgoing.size===0&&e.push(t);return e}insertEdge(e,t){const i=this.lookupOrInsertNode(e),s=this.lookupOrInsertNode(t);i.outgoing.set(s.key,s),s.incoming.set(i.key,i)}removeNode(e){const t=this._hashFn(e);this._nodes.delete(t);for(const i of this._nodes.values())i.outgoing.delete(t),i.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let i=this._nodes.get(t);return i||(i=new qEe(t,e),this._nodes.set(t,i)),i}isEmpty(){return this._nodes.size===0}toString(){const e=[];for(const[t,i]of this._nodes)e.push(`${t} +`),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}}AD.InstanceCount=0;class h0 extends ua{constructor(e){super(),this._onChange=this._register(new B),this.onChange=this._onChange.event,this._onKeyDown=this._register(new B),this.onKeyDown=this._onKeyDown.event,this._opts=e,this._checked=this._opts.isChecked;const t=["monaco-custom-toggle"];this._opts.icon&&(this._icon=this._opts.icon,t.push(...Te.asClassNameArray(this._icon))),this._opts.actionClassName&&t.push(...this._opts.actionClassName.split(" ")),this._checked&&t.push("checked"),this.domNode=document.createElement("div"),this.domNode.title=this._opts.title,this.domNode.classList.add(...t),this._opts.notFocusable||(this.domNode.tabIndex=0),this.domNode.setAttribute("role","checkbox"),this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.setAttribute("aria-label",this._opts.title),this.applyStyles(),this.onclick(this.domNode,i=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),i.preventDefault())}),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,i=>{if(i.keyCode===10||i.keyCode===3){this.checked=!this._checked,this._onChange.fire(!0),i.preventDefault(),i.stopPropagation();return}this._onKeyDown.fire(i)})}get enabled(){return this.domNode.getAttribute("aria-disabled")!=="true"}focus(){this.domNode.focus()}get checked(){return this._checked}set checked(e){this._checked=e,this.domNode.setAttribute("aria-checked",String(this._checked)),this.domNode.classList.toggle("checked",this._checked),this.applyStyles()}width(){return 22}applyStyles(){this.domNode&&(this.domNode.style.borderColor=this._checked&&this._opts.inputActiveOptionBorder||"",this.domNode.style.color=this._checked&&this._opts.inputActiveOptionForeground||"inherit",this.domNode.style.backgroundColor=this._checked&&this._opts.inputActiveOptionBackground||"")}enable(){this.domNode.setAttribute("aria-disabled",String(!1))}disable(){this.domNode.setAttribute("aria-disabled",String(!0))}}const w2e=m("caseDescription","Match Case"),C2e=m("wordsDescription","Match Whole Word"),S2e=m("regexDescription","Use Regular Expression");class HG extends h0{constructor(e){super({icon:se.caseSensitive,title:w2e+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class $G extends h0{constructor(e){super({icon:se.wholeWord,title:C2e+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class UG extends h0{constructor(e){super({icon:se.regex,title:S2e+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class x2e{constructor(e,t=0,i=e.length,s=t-1){this.items=e,this.start=t,this.end=i,this.index=s}current(){return this.index===this.start-1||this.index===this.end?null:this.items[this.index]}next(){return this.index=Math.min(this.index+1,this.end),this.current()}previous(){return this.index=Math.max(this.index-1,this.start-1),this.current()}first(){return this.index=this.start,this.current()}last(){return this.index=this.end-1,this.current()}}class L2e{constructor(e=[],t=10){this._initialize(e),this._limit=t,this._onChange()}getHistory(){return this._elements}add(e){this._history.delete(e),this._history.add(e),this._onChange()}next(){return this._navigator.next()}previous(){return this._currentPosition()!==0?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}isLast(){return this._currentPosition()>=this._elements.length-1}isNowhere(){return this._navigator.current()===null}has(e){return this._history.has(e)}_onChange(){this._reduceToLimit();const e=this._elements;this._navigator=new x2e(e,0,e.length,e.length)}_reduceToLimit(){const e=this._elements;e.length>this._limit&&this._initialize(e.slice(e.length-this._limit))}_currentPosition(){const e=this._navigator.current();return e?this._elements.indexOf(e):-1}_initialize(e){this._history=new Set;for(const t of e)this._history.add(t)}get _elements(){const e=[];return this._history.forEach(t=>e.push(t)),e}}const z0=ye;let D2e=class extends ua{constructor(e,t,i){var s;super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new B),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new B),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=i,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=(s=this.options.tooltip)!==null&&s!==void 0?s:this.placeholder||"",this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=le(e,z0(".monaco-inputbox.idle"));const o=this.options.flexibleHeight?"textarea":"input",r=le(this.element,z0(".ibwrapper"));if(this.input=le(r,z0(o+".input.empty")),this.input.setAttribute("autocorrect","off"),this.input.setAttribute("autocapitalize","off"),this.input.setAttribute("spellcheck","false"),this.onfocus(this.input,()=>this.element.classList.add("synthetic-focus")),this.onblur(this.input,()=>this.element.classList.remove("synthetic-focus")),this.options.flexibleHeight){this.maxHeight=typeof this.options.flexibleMaxHeight=="number"?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=le(r,z0("div.mirror")),this.mirror.innerText=" ",this.scrollableElement=new rq(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),le(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll(c=>this.input.scrollTop=c.scrollTop));const a=this._register(new ot(document,"selectionchange")),l=ue.filter(a.event,()=>{const c=document.getSelection();return(c==null?void 0:c.anchorNode)===r});this._register(l(this.updateScrollDimensions,this)),this._register(this.onDidHeightChange(this.updateScrollDimensions,this))}else this.input.type=this.options.type||"text",this.input.setAttribute("wrap","off");this.ariaLabel&&this.input.setAttribute("aria-label",this.ariaLabel),this.placeholder&&!this.options.showPlaceholderOnFocus&&this.setPlaceHolder(this.placeholder),this.tooltip&&this.setTooltip(this.tooltip),this.oninput(this.input,()=>this.onValueChange()),this.onblur(this.input,()=>this.onBlur()),this.onfocus(this.input,()=>this.onFocus()),this._register(this.ignoreGesture(this.input)),setTimeout(()=>this.updateMirror(),0),this.options.actions&&(this.actionbar=this._register(new al(this.element)),this.actionbar.push(this.options.actions,{icon:!0,label:!1})),this.applyStyles()}onBlur(){this._hideMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder","")}onFocus(){this._showMessage(),this.options.showPlaceholderOnFocus&&this.input.setAttribute("placeholder",this.placeholder||"")}setPlaceHolder(e){this.placeholder=e,this.input.setAttribute("placeholder",e)}setTooltip(e){this.tooltip=e,this.input.title=e}get inputElement(){return this.input}get value(){return this.input.value}set value(e){this.input.value!==e&&(this.input.value=e,this.onValueChange())}get height(){return typeof this.cachedHeight=="number"?this.cachedHeight:Dh(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return document.activeElement===this.input}select(e=null){this.input.select(),e&&(this.input.setSelectionRange(e.start,e.end),e.end===this.input.value.length&&(this.input.scrollLeft=this.input.scrollWidth))}isSelectionAtEnd(){return this.input.selectionEnd===this.input.value.length&&this.input.selectionStart===this.input.selectionEnd}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}set paddingRight(e){this.input.style.width=`calc(100% - ${e}px)`,this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){if(typeof this.cachedContentHeight!="number"||typeof this.cachedHeight!="number"||!this.scrollableElement)return;const e=this.cachedContentHeight,t=this.cachedHeight,i=this.input.scrollTop;this.scrollableElement.setScrollDimensions({scrollHeight:e,height:t}),this.scrollableElement.setScrollPosition({scrollTop:i})}showMessage(e,t){if(this.state==="open"&&Co(this.message,e))return;this.message=e,this.element.classList.remove("idle"),this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add(this.classForType(e.type));const i=this.stylesForType(this.message.type);this.element.style.border=`1px solid ${Qh(i.border,"transparent")}`,this.message.content&&(this.hasFocus()||t)&&this._showMessage()}hideMessage(){this.message=null,this.element.classList.remove("info"),this.element.classList.remove("warning"),this.element.classList.remove("error"),this.element.classList.add("idle"),this._hideMessage(),this.applyStyles()}validate(){let e=null;return this.validation&&(e=this.validation(this.value),e?(this.inputElement.setAttribute("aria-invalid","true"),this.showMessage(e)):this.inputElement.hasAttribute("aria-invalid")&&(this.inputElement.removeAttribute("aria-invalid"),this.hideMessage())),e==null?void 0:e.type}stylesForType(e){const t=this.options.inputBoxStyles;switch(e){case 1:return{border:t.inputValidationInfoBorder,background:t.inputValidationInfoBackground,foreground:t.inputValidationInfoForeground};case 2:return{border:t.inputValidationWarningBorder,background:t.inputValidationWarningBackground,foreground:t.inputValidationWarningForeground};default:return{border:t.inputValidationErrorBorder,background:t.inputValidationErrorBackground,foreground:t.inputValidationErrorForeground}}}classForType(e){switch(e){case 1:return"info";case 2:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e;const t=()=>e.style.width=ys(this.element)+"px";this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:s=>{var o,r;if(!this.message)return null;e=le(s,z0(".monaco-inputbox-container")),t();const a={inline:!0,className:"monaco-inputbox-message"},l=this.message.formatContent?BDe(this.message.content,a):FDe(this.message.content,a);l.classList.add(this.classForType(this.message.type));const c=this.stylesForType(this.message.type);return l.style.backgroundColor=(o=c.background)!==null&&o!==void 0?o:"",l.style.color=(r=c.foreground)!==null&&r!==void 0?r:"",l.style.border=c.border?`1px solid ${c.border}`:"",le(e,l),null},onHide:()=>{this.state="closed"},layout:t});let i;this.message.type===3?i=m("alertErrorMessage","Error: {0}",this.message.content):this.message.type===2?i=m("alertWarningMessage","Warning: {0}",this.message.content):i=m("alertInfoMessage","Info: {0}",this.message.content),Q1(i),this.state="open"}_hideMessage(){this.contextViewProvider&&(this.state==="open"&&this.contextViewProvider.hideContextView(),this.state="idle")}onValueChange(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),this.input.classList.toggle("empty",!this.value),this.state==="open"&&this.contextViewProvider&&this.contextViewProvider.layout()}updateMirror(){if(!this.mirror)return;const e=this.value,i=e.charCodeAt(e.length-1)===10?" ":"";(e+i).replace(/\u000c/g,"")?this.mirror.textContent=e+i:this.mirror.innerText=" ",this.layout()}applyStyles(){var e,t,i;const s=this.options.inputBoxStyles,o=(e=s.inputBackground)!==null&&e!==void 0?e:"",r=(t=s.inputForeground)!==null&&t!==void 0?t:"",a=(i=s.inputBorder)!==null&&i!==void 0?i:"";this.element.style.backgroundColor=o,this.element.style.color=r,this.input.style.backgroundColor="inherit",this.input.style.color=r,this.element.style.border=`1px solid ${Qh(a,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=Dh(this.mirror),e!==this.cachedContentHeight&&(this.cachedHeight=Math.min(this.cachedContentHeight,this.maxHeight),this.input.style.height=this.cachedHeight+"px",this._onDidHeightChange.fire(this.cachedContentHeight))}insertAtCursor(e){const t=this.inputElement,i=t.selectionStart,s=t.selectionEnd,o=t.value;i!==null&&s!==null&&(this.value=o.substr(0,i)+e+o.substr(s),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){var e;this._hideMessage(),this.message=null,(e=this.actionbar)===null||e===void 0||e.dispose(),super.dispose()}};class jG extends D2e{constructor(e,t,i){const s=m({key:"history.inputbox.hint",comment:["Text will be prefixed with ⇅ plus a single space, then used as a hint where input field keeps history"]},"for history"),o=` or ⇅ ${s}`,r=` (⇅ ${s})`;super(e,t,i),this._onDidFocus=this._register(new B),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new B),this.onDidBlur=this._onDidBlur.event,this.history=new L2e(i.history,100);const a=()=>{if(i.showHistoryHint&&i.showHistoryHint()&&!this.placeholder.endsWith(o)&&!this.placeholder.endsWith(r)&&this.history.getHistory().length){const l=this.placeholder.endsWith(")")?o:r,c=this.placeholder+l;i.showPlaceholderOnFocus&&document.activeElement!==this.input?this.placeholder=c:this.setPlaceHolder(c)}};this.observer=new MutationObserver((l,c)=>{l.forEach(d=>{d.target.textContent||a()})}),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,()=>a()),this.onblur(this.input,()=>{const l=c=>{if(this.placeholder.endsWith(c)){const d=this.placeholder.slice(0,this.placeholder.length-c.length);return i.showPlaceholderOnFocus?this.placeholder=d:this.setPlaceHolder(d),!0}else return!1};l(r)||l(o)})}dispose(){super.dispose(),this.observer&&(this.observer.disconnect(),this.observer=void 0)}addToHistory(e){this.value&&(e||this.value!==this.getCurrentValue())&&this.history.add(this.value)}isAtLastInHistory(){return this.history.isLast()}isNowhereInHistory(){return this.history.isNowhere()}showNextValue(){this.history.has(this.value)||this.addToHistory();let e=this.getNextValue();e&&(e=e===this.value?this.getNextValue():e),this.value=e??"",nv(this.value?this.value:m("clearedInput","Cleared Input"))}showPreviousValue(){this.history.has(this.value)||this.addToHistory();let e=this.getPreviousValue();e&&(e=e===this.value?this.getPreviousValue():e),e&&(this.value=e,nv(this.value))}onBlur(){super.onBlur(),this._onDidBlur.fire()}onFocus(){super.onFocus(),this._onDidFocus.fire()}getCurrentValue(){let e=this.history.current();return e||(e=this.history.last(),this.history.next()),e}getPreviousValue(){return this.history.previous()||this.history.first()}getNextValue(){return this.history.next()}}const k2e=m("defaultLabel","input");class qG extends ua{constructor(e,t,i){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new sa),this.additionalToggles=[],this._onDidOptionChange=this._register(new B),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new B),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new B),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new B),this._onKeyUp=this._register(new B),this._onCaseSensitiveKeyDown=this._register(new B),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new B),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.placeholder=i.placeholder||"",this.validation=i.validation,this.label=i.label||k2e,this.showCommonFindToggles=!!i.showCommonFindToggles;const s=i.appendCaseSensitiveLabel||"",o=i.appendWholeWordsLabel||"",r=i.appendRegexLabel||"",a=i.history||[],l=!!i.flexibleHeight,c=!!i.flexibleWidth,d=i.flexibleMaxHeight;if(this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new jG(this.domNode,t,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},history:a,showHistoryHint:i.showHistoryHint,flexibleHeight:l,flexibleWidth:c,flexibleMaxHeight:d,inputBoxStyles:i.inputBoxStyles})),this.showCommonFindToggles){this.regex=this._register(new UG(Object.assign({appendTitle:r,isChecked:!1},i.toggleStyles))),this._register(this.regex.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.regex.onKeyDown(h=>{this._onRegexKeyDown.fire(h)})),this.wholeWords=this._register(new $G(Object.assign({appendTitle:o,isChecked:!1},i.toggleStyles))),this._register(this.wholeWords.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this.caseSensitive=this._register(new HG(Object.assign({appendTitle:s,isChecked:!1},i.toggleStyles))),this._register(this.caseSensitive.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.caseSensitive.onKeyDown(h=>{this._onCaseSensitiveKeyDown.fire(h)}));const u=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,h=>{if(h.equals(15)||h.equals(17)||h.equals(9)){const f=u.indexOf(document.activeElement);if(f>=0){let g=-1;h.equals(17)?g=(f+1)%u.length:h.equals(15)&&(f===0?g=u.length-1:g=f-1),h.equals(9)?(u[f].blur(),this.inputBox.focus()):g>=0&&u[g].focus(),$e.stop(h,!0)}}})}this.controls=document.createElement("div"),this.controls.className="controls",this.controls.style.display=this.showCommonFindToggles?"":"none",this.caseSensitive&&this.controls.append(this.caseSensitive.domNode),this.wholeWords&&this.controls.appendChild(this.wholeWords.domNode),this.regex&&this.controls.appendChild(this.regex.domNode),this.setAdditionalToggles(i==null?void 0:i.additionalToggles),this.controls&&this.domNode.appendChild(this.controls),e==null||e.appendChild(this.domNode),this._register(K(this.inputBox.inputElement,"compositionstart",u=>{this.imeSessionInProgress=!0})),this._register(K(this.inputBox.inputElement,"compositionend",u=>{this.imeSessionInProgress=!1,this._onInput.fire()})),this.onkeydown(this.inputBox.inputElement,u=>this._onKeyDown.fire(u)),this.onkeyup(this.inputBox.inputElement,u=>this._onKeyUp.fire(u)),this.oninput(this.inputBox.inputElement,u=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,u=>this._onMouseDown.fire(u))}get onDidChange(){return this.inputBox.onDidChange}layout(e){this.inputBox.layout(),this.updateInputBoxPadding(e.collapsedFindWidget)}enable(){var e,t,i;this.domNode.classList.remove("disabled"),this.inputBox.enable(),(e=this.regex)===null||e===void 0||e.enable(),(t=this.wholeWords)===null||t===void 0||t.enable(),(i=this.caseSensitive)===null||i===void 0||i.enable();for(const s of this.additionalToggles)s.enable()}disable(){var e,t,i;this.domNode.classList.add("disabled"),this.inputBox.disable(),(e=this.regex)===null||e===void 0||e.disable(),(t=this.wholeWords)===null||t===void 0||t.disable(),(i=this.caseSensitive)===null||i===void 0||i.disable();for(const s of this.additionalToggles)s.disable()}setFocusInputOnOptionClick(e){this.fixFocusOnOptionClickEnabled=e}setEnabled(e){e?this.enable():this.disable()}setAdditionalToggles(e){for(const t of this.additionalToggles)t.domNode.remove();this.additionalToggles=[],this.additionalTogglesDisposables.value=new pe;for(const t of e??[])this.additionalTogglesDisposables.value.add(t),this.controls.appendChild(t.domNode),this.additionalTogglesDisposables.value.add(t.onChange(i=>{this._onDidOptionChange.fire(i),!i&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus()})),this.additionalToggles.push(t);this.additionalToggles.length>0&&(this.controls.style.display=""),this.updateInputBoxPadding()}updateInputBoxPadding(e=!1){var t,i,s,o,r,a;e?this.inputBox.paddingRight=0:this.inputBox.paddingRight=((i=(t=this.caseSensitive)===null||t===void 0?void 0:t.width())!==null&&i!==void 0?i:0)+((o=(s=this.wholeWords)===null||s===void 0?void 0:s.width())!==null&&o!==void 0?o:0)+((a=(r=this.regex)===null||r===void 0?void 0:r.width())!==null&&a!==void 0?a:0)+this.additionalToggles.reduce((l,c)=>l+c.width(),0)}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){var e,t;return(t=(e=this.caseSensitive)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setCaseSensitive(e){this.caseSensitive&&(this.caseSensitive.checked=e)}getWholeWords(){var e,t;return(t=(e=this.wholeWords)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setWholeWords(e){this.wholeWords&&(this.wholeWords.checked=e)}getRegex(){var e,t;return(t=(e=this.regex)===null||e===void 0?void 0:e.checked)!==null&&t!==void 0?t:!1}setRegex(e){this.regex&&(this.regex.checked=e,this.validate())}focusOnCaseSensitive(){var e;(e=this.caseSensitive)===null||e===void 0||e.focus()}highlightFindOptions(){this.domNode.classList.remove("highlight-"+this._lastHighlightFindOptions),this._lastHighlightFindOptions=1-this._lastHighlightFindOptions,this.domNode.classList.add("highlight-"+this._lastHighlightFindOptions)}validate(){this.inputBox.validate()}showMessage(e){this.inputBox.showMessage(e)}clearMessage(){this.inputBox.hideMessage()}}var wa;(function(n){n[n.Expanded=0]="Expanded",n[n.Collapsed=1]="Collapsed",n[n.PreserveOrExpanded=2]="PreserveOrExpanded",n[n.PreserveOrCollapsed=3]="PreserveOrCollapsed"})(wa||(wa={}));var Th;(function(n){n[n.Unknown=0]="Unknown",n[n.Twistie=1]="Twistie",n[n.Element=2]="Element",n[n.Filter=3]="Filter"})(Th||(Th={}));class mo extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class sP{constructor(e){this.fn=e,this._map=new WeakMap}map(e){let t=this._map.get(e);return t||(t=this.fn(e),this._map.set(e,t)),t}}function oP(n){return typeof n=="object"&&"visibility"in n&&"data"in n}function xv(n){switch(n){case!0:return 1;case!1:return 0;default:return n}}function nE(n){return typeof n.collapsible=="boolean"}class E2e{constructor(e,t,i,s={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new T4,this._onDidChangeCollapseState=new B,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new B,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new B,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new ku(dj),this.collapseByDefault=typeof s.collapseByDefault>"u"?!1:s.collapseByDefault,this.filter=s.filter,this.autoExpandSingleChildren=typeof s.autoExpandSingleChildren>"u"?!1:s.autoExpandSingleChildren,this.root={parent:void 0,element:i,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(e,t,i=ut.empty(),s={}){if(e.length===0)throw new mo(this.user,"Invalid tree location");s.diffIdentityProvider?this.spliceSmart(s.diffIdentityProvider,e,t,i,s):this.spliceSimple(e,t,i,s)}spliceSmart(e,t,i,s,o,r){var a;s===void 0&&(s=ut.empty()),r===void 0&&(r=(a=o.diffDepth)!==null&&a!==void 0?a:0);const{parentNode:l}=this.getParentNodeWithListIndex(t);if(!l.lastDiffIds)return this.spliceSimple(t,i,s,o);const c=[...s],d=t[t.length-1],u=new jl({getElements:()=>l.lastDiffIds},{getElements:()=>[...l.children.slice(0,d),...c,...l.children.slice(d+i)].map(_=>e.getId(_.element).toString())}).ComputeDiff(!1);if(u.quitEarly)return l.lastDiffIds=void 0,this.spliceSimple(t,i,c,o);const h=t.slice(0,-1),f=(_,v,b)=>{if(r>0)for(let y=0;yb.originalStart-v.originalStart))f(g,p,g-(_.originalStart+_.originalLength)),g=_.originalStart,p=_.modifiedStart-d,this.spliceSimple([...h,g],_.originalLength,ut.slice(c,p,p+_.modifiedLength),o);f(g,p,g)}spliceSimple(e,t,i=ut.empty(),{onDidCreateNode:s,onDidDeleteNode:o,diffIdentityProvider:r}){const{parentNode:a,listIndex:l,revealed:c,visible:d}=this.getParentNodeWithListIndex(e),u=[],h=ut.map(i,x=>this.createTreeNode(x,a,a.visible?1:0,c,u,s)),f=e[e.length-1],g=a.children.length>0;let p=0;for(let x=f;x>=0&&xr.getId(x.element).toString())):a.lastDiffIds=a.children.map(x=>r.getId(x.element).toString()):a.lastDiffIds=void 0;let w=0;for(const x of y)x.visible&&w++;if(w!==0)for(let x=f+_.length;xD+(k.visible?k.renderNodeCount:0),0);this._updateAncestorsRenderNodeCount(a,b-x),this.list.splice(l,x,u)}if(y.length>0&&o){const x=D=>{o(D),D.children.forEach(x)};y.forEach(x)}this._onDidSplice.fire({insertedNodes:_,deletedNodes:y});const S=a.children.length>0;g!==S&&this.setCollapsible(e.slice(0,-1),S);let L=a;for(;L;){if(L.visibility===2){this.refilterDelayer.trigger(()=>this.refilter());break}L=L.parent}}rerender(e){if(e.length===0)throw new mo(this.user,"Invalid tree location");const{node:t,listIndex:i,revealed:s}=this.getTreeNodeWithListIndex(e);t.visible&&s&&this.list.splice(i,1,[t])}has(e){return this.hasTreeNode(e)}getListIndex(e){const{listIndex:t,visible:i,revealed:s}=this.getTreeNodeWithListIndex(e);return i&&s?t:-1}getListRenderCount(e){return this.getTreeNode(e).renderNodeCount}isCollapsible(e){return this.getTreeNode(e).collapsible}setCollapsible(e,t){const i=this.getTreeNode(e);typeof t>"u"&&(t=!i.collapsible);const s={collapsible:t};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,s))}isCollapsed(e){return this.getTreeNode(e).collapsed}setCollapsed(e,t,i){const s=this.getTreeNode(e);typeof t>"u"&&(t=!s.collapsed);const o={collapsed:t,recursive:i||!1};return this.eventBufferer.bufferEvents(()=>this._setCollapseState(e,o))}_setCollapseState(e,t){const{node:i,listIndex:s,revealed:o}=this.getTreeNodeWithListIndex(e),r=this._setListNodeCollapseState(i,s,o,t);if(i!==this.root&&this.autoExpandSingleChildren&&r&&!nE(t)&&i.collapsible&&!i.collapsed&&!t.recursive){let a=-1;for(let l=0;l-1){a=-1;break}else a=l;a>-1&&this._setCollapseState([...e,a],t)}return r}_setListNodeCollapseState(e,t,i,s){const o=this._setNodeCollapseState(e,s,!1);if(!i||!e.visible||!o)return o;const r=e.renderNodeCount,a=this.updateNodeAfterCollapseChange(e),l=r-(t===-1?0:1);return this.list.splice(t+1,l,a.slice(1)),o}_setNodeCollapseState(e,t,i){let s;if(e===this.root?s=!1:(nE(t)?(s=e.collapsible!==t.collapsible,e.collapsible=t.collapsible):e.collapsible?(s=e.collapsed!==t.collapsed,e.collapsed=t.collapsed):s=!1,s&&this._onDidChangeCollapseState.fire({node:e,deep:i})),!nE(t)&&t.recursive)for(const o of e.children)s=this._setNodeCollapseState(o,t,!0)||s;return s}expandTo(e){this.eventBufferer.bufferEvents(()=>{let t=this.getTreeNode(e);for(;t.parent;)t=t.parent,e=e.slice(0,e.length-1),t.collapsed&&this._setCollapseState(e,{collapsed:!1,recursive:!1})})}refilter(){const e=this.root.renderNodeCount,t=this.updateNodeAfterFilterChange(this.root);this.list.splice(0,e,t),this.refilterDelayer.cancel()}createTreeNode(e,t,i,s,o,r){const a={parent:t,element:e.element,children:[],depth:t.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:typeof e.collapsible=="boolean"?e.collapsible:typeof e.collapsed<"u",collapsed:typeof e.collapsed>"u"?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},l=this._filterNode(a,i);a.visibility=l,s&&o.push(a);const c=e.children||ut.empty(),d=s&&l!==0&&!a.collapsed;let u=0,h=1;for(const f of c){const g=this.createTreeNode(f,a,l,d,o,r);a.children.push(g),h+=g.renderNodeCount,g.visible&&(g.visibleChildIndex=u++)}return a.collapsible=a.collapsible||a.children.length>0,a.visibleChildrenCount=u,a.visible=l===2?u>0:l===1,a.visible?a.collapsed||(a.renderNodeCount=h):(a.renderNodeCount=0,s&&o.pop()),r==null||r(a),a}updateNodeAfterCollapseChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterCollapseChange(e,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterCollapseChange(e,t){if(e.visible===!1)return 0;if(t.push(e),e.renderNodeCount=1,!e.collapsed)for(const i of e.children)e.renderNodeCount+=this._updateNodeAfterCollapseChange(i,t);return this._onDidChangeRenderNodeCount.fire(e),e.renderNodeCount}updateNodeAfterFilterChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterFilterChange(e,e.visible?1:0,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterFilterChange(e,t,i,s=!0){let o;if(e!==this.root){if(o=this._filterNode(e,t),o===0)return e.visible=!1,e.renderNodeCount=0,!1;s&&i.push(e)}const r=i.length;e.renderNodeCount=e===this.root?0:1;let a=!1;if(!e.collapsed||o!==0){let l=0;for(const c of e.children)a=this._updateNodeAfterFilterChange(c,o,i,s&&!e.collapsed)||a,c.visible&&(c.visibleChildIndex=l++);e.visibleChildrenCount=l}else e.visibleChildrenCount=0;return e!==this.root&&(e.visible=o===2?a:o===1,e.visibility=o),e.visible?e.collapsed||(e.renderNodeCount+=i.length-r):(e.renderNodeCount=0,s&&i.pop()),this._onDidChangeRenderNodeCount.fire(e),e.visible}_updateAncestorsRenderNodeCount(e,t){if(t!==0)for(;e;)e.renderNodeCount+=t,this._onDidChangeRenderNodeCount.fire(e),e=e.parent}_filterNode(e,t){const i=this.filter?this.filter.filter(e.element,t):1;return typeof i=="boolean"?(e.filterData=void 0,i?1:0):oP(i)?(e.filterData=i.data,xv(i.visibility)):(e.filterData=void 0,xv(i))}hasTreeNode(e,t=this.root){if(!e||e.length===0)return!0;const[i,...s]=e;return i<0||i>t.children.length?!1:this.hasTreeNode(s,t.children[i])}getTreeNode(e,t=this.root){if(!e||e.length===0)return t;const[i,...s]=e;if(i<0||i>t.children.length)throw new mo(this.user,"Invalid tree location");return this.getTreeNode(s,t.children[i])}getTreeNodeWithListIndex(e){if(e.length===0)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:t,listIndex:i,revealed:s,visible:o}=this.getParentNodeWithListIndex(e),r=e[e.length-1];if(r<0||r>t.children.length)throw new mo(this.user,"Invalid tree location");const a=t.children[r];return{node:a,listIndex:i,revealed:s,visible:o&&a.visible}}getParentNodeWithListIndex(e,t=this.root,i=0,s=!0,o=!0){const[r,...a]=e;if(r<0||r>t.children.length)throw new mo(this.user,"Invalid tree location");for(let l=0;lt.element)),this.data=e}}function sE(n){return n instanceof ry?new A2e(n):n}class I2e{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=Y.None,this.disposables=new pe}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(i=>i.element),t)}onDragStart(e,t){var i,s;(s=(i=this.dnd).onDragStart)===null||s===void 0||s.call(i,sE(e),t)}onDragOver(e,t,i,s,o=!0){const r=this.dnd.onDragOver(sE(e),t&&t.element,i,s),a=this.autoExpandNode!==t;if(a&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),typeof t>"u")return r;if(a&&typeof r!="boolean"&&r.autoExpand&&(this.autoExpandDisposable=kS(()=>{const h=this.modelProvider(),f=h.getNodeLocation(t);h.isCollapsed(f)&&h.setCollapsed(f,!1),this.autoExpandNode=void 0},500,this.disposables)),typeof r=="boolean"||!r.accept||typeof r.bubble>"u"||r.feedback){if(!o){const h=typeof r=="boolean"?r:r.accept,f=typeof r=="boolean"?void 0:r.effect;return{accept:h,effect:f,feedback:[i]}}return r}if(r.bubble===1){const h=this.modelProvider(),f=h.getNodeLocation(t),g=h.getParentNodeLocation(f),p=h.getNode(g),_=g&&h.getListIndex(g);return this.onDragOver(e,p,_,s,!1)}const l=this.modelProvider(),c=l.getNodeLocation(t),d=l.getListIndex(c),u=l.getListRenderCount(c);return Object.assign(Object.assign({},r),{feedback:es(d,d+u)})}drop(e,t,i,s){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(sE(e),t&&t.element,i,s)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}}function T2e(n,e){return e&&Object.assign(Object.assign({},e),{identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(t.element)}},dnd:e.dnd&&new I2e(n,e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent(t){return e.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},t),{element:t.element}))},isSelectionRangeChangeEvent(t){return e.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},t),{element:t.element}))}},accessibilityProvider:e.accessibilityProvider&&Object.assign(Object.assign({},e.accessibilityProvider),{getSetSize(t){const i=n(),s=i.getNodeLocation(t),o=i.getParentNodeLocation(s);return i.getNode(o).visibleChildrenCount},getPosInSet(t){return t.visibleChildIndex+1},isChecked:e.accessibilityProvider&&e.accessibilityProvider.isChecked?t=>e.accessibilityProvider.isChecked(t.element):void 0,getRole:e.accessibilityProvider&&e.accessibilityProvider.getRole?t=>e.accessibilityProvider.getRole(t.element):()=>"treeitem",getAriaLabel(t){return e.accessibilityProvider.getAriaLabel(t.element)},getWidgetAriaLabel(){return e.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:e.accessibilityProvider&&e.accessibilityProvider.getWidgetRole?()=>e.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:e.accessibilityProvider&&e.accessibilityProvider.getAriaLevel?t=>e.accessibilityProvider.getAriaLevel(t.element):t=>t.depth,getActiveDescendantId:e.accessibilityProvider.getActiveDescendantId&&(t=>e.accessibilityProvider.getActiveDescendantId(t.element))}),keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},e.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel(t){return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)}})})}class rP{constructor(e){this.delegate=e}getHeight(e){return this.delegate.getHeight(e.element)}getTemplateId(e){return this.delegate.getTemplateId(e.element)}hasDynamicHeight(e){return!!this.delegate.hasDynamicHeight&&this.delegate.hasDynamicHeight(e.element)}setDynamicHeight(e,t){var i,s;(s=(i=this.delegate).setDynamicHeight)===null||s===void 0||s.call(i,e.element,t)}}var Lv;(function(n){n.None="none",n.OnHover="onHover",n.Always="always"})(Lv||(Lv={}));class N2e{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new pe,this.onDidChange=ue.forEach(e,i=>this._elements=i,this.disposables)}dispose(){this.disposables.dispose()}}class Dv{constructor(e,t,i,s,o,r={}){var a;this.renderer=e,this.modelProvider=t,this.activeNodes=s,this.renderedIndentGuides=o,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=Dv.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=Y.None,this.disposables=new pe,this.templateId=e.templateId,this.updateOptions(r),ue.map(i,l=>l.node)(this.onDidChangeNodeTwistieState,this,this.disposables),(a=e.onDidChangeTwistieState)===null||a===void 0||a.call(e,this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(typeof e.indent<"u"){const t=uo(e.indent,0,40);if(t!==this.indent){this.indent=t;for(const[i,s]of this.renderedNodes)this.renderTreeElement(i,s)}}if(typeof e.renderIndentGuides<"u"){const t=e.renderIndentGuides!==Lv.None;if(t!==this.shouldRenderIndentGuides){this.shouldRenderIndentGuides=t;for(const[i,s]of this.renderedNodes)this._renderIndentGuides(i,s);if(this.indentGuidesDisposable.dispose(),t){const i=new pe;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,i),this.indentGuidesDisposable=i,this._onDidChangeActiveNodes(this.activeNodes.elements)}}}typeof e.hideTwistiesOfChildlessElements<"u"&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=le(e,ye(".monaco-tl-row")),i=le(t,ye(".monaco-tl-indent")),s=le(t,ye(".monaco-tl-twistie")),o=le(t,ye(".monaco-tl-contents")),r=this.renderer.renderTemplate(o);return{container:e,indent:i,twistie:s,indentGuidesDisposable:Y.None,templateData:r}}renderElement(e,t,i,s){this.renderedNodes.set(e,i),this.renderedElements.set(e.element,e),this.renderTreeElement(e,i),this.renderer.renderElement(e,t,i.templateData,s)}disposeElement(e,t,i,s){var o,r;i.indentGuidesDisposable.dispose(),(r=(o=this.renderer).disposeElement)===null||r===void 0||r.call(o,e,t,i.templateData,s),typeof s=="number"&&(this.renderedNodes.delete(e),this.renderedElements.delete(e.element))}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}onDidChangeTwistieState(e){const t=this.renderedElements.get(e);t&&this.onDidChangeNodeTwistieState(t)}onDidChangeNodeTwistieState(e){const t=this.renderedNodes.get(e);t&&(this._onDidChangeActiveNodes(this.activeNodes.elements),this.renderTreeElement(e,t))}renderTreeElement(e,t){const i=Dv.DefaultIndent+(e.depth-1)*this.indent;t.twistie.style.paddingLeft=`${i}px`,t.indent.style.width=`${i+this.indent-16}px`,e.collapsible?t.container.setAttribute("aria-expanded",String(!e.collapsed)):t.container.removeAttribute("aria-expanded"),t.twistie.classList.remove(...Te.asClassNameArray(se.treeItemExpanded));let s=!1;this.renderer.renderTwistie&&(s=this.renderer.renderTwistie(e.element,t.twistie)),e.collapsible&&(!this.hideTwistiesOfChildlessElements||e.visibleChildrenCount>0)?(s||t.twistie.classList.add(...Te.asClassNameArray(se.treeItemExpanded)),t.twistie.classList.add("collapsible"),t.twistie.classList.toggle("collapsed",e.collapsed)):t.twistie.classList.remove("collapsible","collapsed"),this._renderIndentGuides(e,t)}_renderIndentGuides(e,t){if(xo(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new pe,s=this.modelProvider();for(;;){const o=s.getNodeLocation(e),r=s.getParentNodeLocation(o);if(!r)break;const a=s.getNode(r),l=ye(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(a)&&l.classList.add("active"),t.indent.childElementCount===0?t.indent.appendChild(l):t.indent.insertBefore(l,t.indent.firstElementChild),this.renderedIndentGuides.add(a,l),i.add(Ye(()=>this.renderedIndentGuides.delete(a,l))),e=a}t.indentGuidesDisposable=i}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set,i=this.modelProvider();e.forEach(s=>{const o=i.getNodeLocation(s);try{const r=i.getParentNodeLocation(o);s.collapsible&&s.children.length>0&&!s.collapsed?t.add(s):r&&t.add(i.getNode(r))}catch{}}),this.activeIndentNodes.forEach(s=>{t.has(s)||this.renderedIndentGuides.forEach(s,o=>o.classList.remove("active"))}),t.forEach(s=>{this.activeIndentNodes.has(s)||this.renderedIndentGuides.forEach(s,o=>o.classList.add("active"))}),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),Ft(this.disposables)}}Dv.DefaultIndent=8;class R2e{get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}constructor(e,t,i){this.tree=e,this.keyboardNavigationLabelProvider=t,this._filter=i,this._totalCount=0,this._matchCount=0,this._pattern="",this._lowercasePattern="",this.disposables=new pe,e.onWillRefilter(this.reset,this,this.disposables)}filter(e,t){let i=1;if(this._filter){const r=this._filter.filter(e,t);if(typeof r=="boolean"?i=r?1:0:oP(r)?i=xv(r.visibility):i=r,i===0)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:of.Default,visibility:i};const s=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),o=Array.isArray(s)?s:[s];for(const r of o){const a=r&&r.toString();if(typeof a>"u")return{data:of.Default,visibility:i};let l;if(this.tree.findMatchType===Df.Contiguous){const c=a.toLowerCase().indexOf(this._lowercasePattern);if(c>-1){l=[Number.MAX_SAFE_INTEGER,0];for(let d=this._lowercasePattern.length;d>0;d--)l.push(c+d-1)}}else l=xG(this._pattern,this._lowercasePattern,0,a,a.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(l)return this._matchCount++,o.length===1?{data:l,visibility:i}:{data:{label:a,score:l},visibility:i}}return this.tree.findMode===Ua.Filter?typeof this.tree.options.defaultFindVisibility=="number"?this.tree.options.defaultFindVisibility:this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility(e):2:{data:of.Default,visibility:i}}reset(){this._totalCount=0,this._matchCount=0}dispose(){Ft(this.disposables)}}var Ua;(function(n){n[n.Highlight=0]="Highlight",n[n.Filter=1]="Filter"})(Ua||(Ua={}));var Df;(function(n){n[n.Fuzzy=0]="Fuzzy",n[n.Contiguous=1]="Contiguous"})(Df||(Df={}));let M2e=class{get pattern(){return this._pattern}get mode(){return this._mode}set mode(e){e!==this._mode&&(this._mode=e,this.widget&&(this.widget.mode=this._mode),this.tree.refilter(),this.render(),this._onDidChangeMode.fire(e))}get matchType(){return this._matchType}set matchType(e){e!==this._matchType&&(this._matchType=e,this.widget&&(this.widget.matchType=this._matchType),this.tree.refilter(),this.render(),this._onDidChangeMatchType.fire(e))}constructor(e,t,i,s,o,r={}){var a,l;this.tree=e,this.view=i,this.filter=s,this.contextViewProvider=o,this.options=r,this._pattern="",this.width=0,this._onDidChangeMode=new B,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new B,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this._onDidChangePattern=new B,this._onDidChangeOpenState=new B,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new pe,this.disposables=new pe,this._mode=(a=e.options.defaultFindMode)!==null&&a!==void 0?a:Ua.Highlight,this._matchType=(l=e.options.defaultFindMatchType)!==null&&l!==void 0?l:Df.Fuzzy,t.onDidSplice(this.onDidSpliceModel,this,this.disposables)}updateOptions(e={}){e.defaultFindMode!==void 0&&(this.mode=e.defaultFindMode),e.defaultFindMatchType!==void 0&&(this.matchType=e.defaultFindMatchType)}onDidSpliceModel(){!this.widget||this.pattern.length===0||(this.tree.refilter(),this.render())}render(){var e,t,i,s;const o=this.filter.totalCount>0&&this.filter.matchCount===0;this.pattern&&o?!((e=this.tree.options.showNotFoundMessage)!==null&&e!==void 0)||e?(t=this.widget)===null||t===void 0||t.showMessage({type:2,content:m("not found","No elements found.")}):(i=this.widget)===null||i===void 0||i.showMessage({type:2}):(s=this.widget)===null||s===void 0||s.clearMessage()}shouldAllowFocus(e){return!this.widget||!this.pattern||this._mode===Ua.Filter||this.filter.totalCount>0&&this.filter.matchCount<=1?!0:!of.isDefault(e.filterData)}layout(e){var t;this.width=e,(t=this.widget)===null||t===void 0||t.layout(e)}dispose(){this._history=void 0,this._onDidChangePattern.dispose(),this.enabledDisposables.dispose(),this.disposables.dispose()}};function a8(n){let e=Th.Unknown;return r2(n.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?e=Th.Twistie:r2(n.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?e=Th.Element:r2(n.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(e=Th.Filter),{browserEvent:n.browserEvent,element:n.element?n.element.element:null,target:e}}function xC(n,e){e(n),n.children.forEach(t=>xC(t,e))}class oE{get nodeSet(){return this._nodeSet||(this._nodeSet=this.createNodeSet()),this._nodeSet}constructor(e,t){this.getFirstViewElementWithTrait=e,this.identityProvider=t,this.nodes=[],this._onDidChange=new B,this.onDidChange=this._onDidChange.event}set(e,t){!(t!=null&&t.__forceEvent)&&Yi(this.nodes,e)||this._set(e,!1,t)}_set(e,t,i){if(this.nodes=[...e],this.elements=void 0,this._nodeSet=void 0,!t){const s=this;this._onDidChange.fire({get elements(){return s.get()},browserEvent:i})}}get(){return this.elements||(this.elements=this.nodes.map(e=>e.element)),[...this.elements]}getNodes(){return this.nodes}has(e){return this.nodeSet.has(e)}onDidModelSplice({insertedNodes:e,deletedNodes:t}){if(!this.identityProvider){const l=this.createNodeSet(),c=d=>l.delete(d);t.forEach(d=>xC(d,c)),this.set([...l.values()]);return}const i=new Set,s=l=>i.add(this.identityProvider.getId(l.element).toString());t.forEach(l=>xC(l,s));const o=new Map,r=l=>o.set(this.identityProvider.getId(l.element).toString(),l);e.forEach(l=>xC(l,r));const a=[];for(const l of this.nodes){const c=this.identityProvider.getId(l.element).toString();if(!i.has(c))a.push(l);else{const u=o.get(c);u&&u.visible&&a.push(u)}}if(this.nodes.length>0&&a.length===0){const l=this.getFirstViewElementWithTrait();l&&a.push(l)}this._set(a,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}}class P2e extends NG{constructor(e,t){super(e),this.tree=t}onViewPointer(e){if(EG(e.browserEvent.target)||Pd(e.browserEvent.target)||ip(e.browserEvent.target)||e.browserEvent.isHandledByList)return;const t=e.element;if(!t)return super.onViewPointer(e);if(this.isSelectionRangeChangeEvent(e)||this.isSelectionSingleChangeEvent(e))return super.onViewPointer(e);const i=e.browserEvent.target,s=i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&e.browserEvent.offsetX<16;let o=!1;if(typeof this.tree.expandOnlyOnTwistieClick=="function"?o=this.tree.expandOnlyOnTwistieClick(t.element):o=!!this.tree.expandOnlyOnTwistieClick,o&&!s&&e.browserEvent.detail!==2)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&e.browserEvent.detail===2)return super.onViewPointer(e);if(t.collapsible){const r=this.tree.getNodeLocation(t),a=e.browserEvent.altKey;if(this.tree.setFocus([r]),this.tree.toggleCollapsed(r,a),o&&s){e.browserEvent.isHandledByList=!0;return}}super.onViewPointer(e)}onDoubleClick(e){e.browserEvent.target.classList.contains("monaco-tl-twistie")||!this.tree.expandOnDoubleClick||e.browserEvent.isHandledByList||super.onDoubleClick(e)}}class O2e extends ha{constructor(e,t,i,s,o,r,a,l){super(e,t,i,s,l),this.focusTrait=o,this.selectionTrait=r,this.anchorTrait=a}createMouseController(e){return new P2e(this,e.tree)}splice(e,t,i=[]){if(super.splice(e,t,i),i.length===0)return;const s=[],o=[];let r;i.forEach((a,l)=>{this.focusTrait.has(a)&&s.push(e+l),this.selectionTrait.has(a)&&o.push(e+l),this.anchorTrait.has(a)&&(r=e+l)}),s.length>0&&super.setFocus(vf([...super.getFocus(),...s])),o.length>0&&super.setSelection(vf([...super.getSelection(),...o])),typeof r=="number"&&super.setAnchor(r)}setFocus(e,t,i=!1){super.setFocus(e,t),i||this.focusTrait.set(e.map(s=>this.element(s)),t)}setSelection(e,t,i=!1){super.setSelection(e,t),i||this.selectionTrait.set(e.map(s=>this.element(s)),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(typeof e>"u"?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}class GG{get onDidScroll(){return this.view.onDidScroll}get onDidChangeFocus(){return this.eventBufferer.wrapEvent(this.focus.onDidChange)}get onDidChangeSelection(){return this.eventBufferer.wrapEvent(this.selection.onDidChange)}get onMouseDblClick(){return ue.filter(ue.map(this.view.onMouseDblClick,a8),e=>e.target!==Th.Filter)}get onPointer(){return ue.map(this.view.onPointer,a8)}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return ue.signal(this.model.onDidSplice)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get findMode(){var e,t;return(t=(e=this.findController)===null||e===void 0?void 0:e.mode)!==null&&t!==void 0?t:Ua.Highlight}set findMode(e){this.findController&&(this.findController.mode=e)}get findMatchType(){var e,t;return(t=(e=this.findController)===null||e===void 0?void 0:e.matchType)!==null&&t!==void 0?t:Df.Fuzzy}set findMatchType(e){this.findController&&(this.findController.matchType=e)}get expandOnDoubleClick(){return typeof this._options.expandOnDoubleClick>"u"?!0:this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return typeof this._options.expandOnlyOnTwistieClick>"u"?!0:this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}constructor(e,t,i,s,o={}){var r;this._user=e,this._options=o,this.eventBufferer=new T4,this.onDidChangeFindOpenState=ue.None,this.disposables=new pe,this._onWillRefilter=new B,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new B;const a=new rP(i),l=new PF,c=new PF,d=this.disposables.add(new N2e(c.event)),u=new Ij;this.renderers=s.map(_=>new Dv(_,()=>this.model,l.event,d,u,o));for(const _ of this.renderers)this.disposables.add(_);let h;o.keyboardNavigationLabelProvider&&(h=new R2e(this,o.keyboardNavigationLabelProvider,o.filter),o=Object.assign(Object.assign({},o),{filter:h}),this.disposables.add(h)),this.focus=new oE(()=>this.view.getFocusedElements()[0],o.identityProvider),this.selection=new oE(()=>this.view.getSelectedElements()[0],o.identityProvider),this.anchor=new oE(()=>this.view.getAnchorElement(),o.identityProvider),this.view=new O2e(e,t,a,this.renderers,this.focus,this.selection,this.anchor,Object.assign(Object.assign({},T2e(()=>this.model,o)),{tree:this})),this.model=this.createModel(e,this.view,o),l.input=this.model.onDidChangeCollapseState;const f=ue.forEach(this.model.onDidSplice,_=>{this.eventBufferer.bufferEvents(()=>{this.focus.onDidModelSplice(_),this.selection.onDidModelSplice(_)})},this.disposables);f(()=>null,null,this.disposables);const g=this.disposables.add(new B),p=this.disposables.add(new ku(0));if(this.disposables.add(ue.any(f,this.focus.onDidChange,this.selection.onDidChange)(()=>{p.trigger(()=>{const _=new Set;for(const v of this.focus.getNodes())_.add(v);for(const v of this.selection.getNodes())_.add(v);g.fire([..._.values()])})})),c.input=g.event,o.keyboardSupport!==!1){const _=ue.chain(this.view.onKeyDown,v=>v.filter(b=>!Pd(b.target)).map(b=>new zt(b)));ue.chain(_,v=>v.filter(b=>b.keyCode===15))(this.onLeftArrow,this,this.disposables),ue.chain(_,v=>v.filter(b=>b.keyCode===17))(this.onRightArrow,this,this.disposables),ue.chain(_,v=>v.filter(b=>b.keyCode===10))(this.onSpace,this,this.disposables)}if((!((r=o.findWidgetEnabled)!==null&&r!==void 0)||r)&&o.keyboardNavigationLabelProvider&&o.contextViewProvider){const _=this.options.findWidgetStyles?{styles:this.options.findWidgetStyles}:void 0;this.findController=new M2e(this,this.model,this.view,h,o.contextViewProvider,_),this.focusNavigationFilter=v=>this.findController.shouldAllowFocus(v),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.disposables.add(this.findController),this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindMode=ue.None,this.onDidChangeFindMatchType=ue.None;this.styleElement=Dr(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===Lv.Always)}updateOptions(e={}){var t;this._options=Object.assign(Object.assign({},this._options),e);for(const i of this.renderers)i.updateOptions(e);this.view.updateOptions(this._options),(t=this.findController)===null||t===void 0||t.updateOptions(e),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===Lv.Always)}get options(){return this._options}getHTMLElement(){return this.view.getHTMLElement()}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}domFocus(){this.view.domFocus()}layout(e,t){var i;this.view.layout(e,t),Jd(t)&&((i=this.findController)===null||i===void 0||i.layout(t))}style(e){const t=`.${this.view.domId}`,i=[];e.treeIndentGuidesStroke&&(i.push(`.monaco-list${t}:hover .monaco-tl-indent > .indent-guide, .monaco-list${t}.always .monaco-tl-indent > .indent-guide { border-color: ${e.treeInactiveIndentGuidesStroke}; }`),i.push(`.monaco-list${t} .monaco-tl-indent > .indent-guide.active { border-color: ${e.treeIndentGuidesStroke}; }`)),this.styleElement.textContent=i.join(` +`),this.view.style(e)}getParentElement(e){const t=this.model.getParentNodeLocation(e);return this.model.getNode(t).element}getFirstElementChild(e){return this.model.getFirstElementChild(e)}getNode(e){return this.model.getNode(e)}getNodeLocation(e){return this.model.getNodeLocation(e)}collapse(e,t=!1){return this.model.setCollapsed(e,!0,t)}expand(e,t=!1){return this.model.setCollapsed(e,!1,t)}toggleCollapsed(e,t=!1){return this.model.setCollapsed(e,void 0,t)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){const i=e.map(o=>this.model.getNode(o));this.selection.set(i,t);const s=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setSelection(s,t,!0)}getSelection(){return this.selection.get()}setFocus(e,t){const i=e.map(o=>this.model.getNode(o));this.focus.set(i,t);const s=e.map(o=>this.model.getListIndex(o)).filter(o=>o>-1);this.view.setFocus(s,t,!0)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);i!==-1&&this.view.reveal(i,t)}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],s=this.model.getNodeLocation(i);if(!this.model.setCollapsed(s,!0)){const r=this.model.getParentNodeLocation(s);if(!r)return;const a=this.model.getListIndex(r);this.view.reveal(a),this.view.setFocus([a])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],s=this.model.getNodeLocation(i);if(!this.model.setCollapsed(s,!1)){if(!i.children.some(l=>l.visible))return;const[r]=this.view.getFocus(),a=r+1;this.view.reveal(a),this.view.setFocus([a])}}onSpace(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(t.length===0)return;const i=t[0],s=this.model.getNodeLocation(i),o=e.browserEvent.altKey;this.model.setCollapsed(s,void 0,o)}dispose(){Ft(this.disposables),this.view.dispose()}}class aP{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new E2e(e,t,null,i),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,i.sorter&&(this.sorter={compare(s,o){return i.sorter.compare(s.element,o.element)}}),this.identityProvider=i.identityProvider}setChildren(e,t=ut.empty(),i={}){const s=this.getElementLocation(e);this._setChildren(s,this.preserveCollapseState(t),i)}_setChildren(e,t=ut.empty(),i){const s=new Set,o=new Set,r=l=>{var c;if(l.element===null)return;const d=l;if(s.add(d.element),this.nodes.set(d.element,d),this.identityProvider){const u=this.identityProvider.getId(d.element).toString();o.add(u),this.nodesByIdentity.set(u,d)}(c=i.onDidCreateNode)===null||c===void 0||c.call(i,d)},a=l=>{var c;if(l.element===null)return;const d=l;if(s.has(d.element)||this.nodes.delete(d.element),this.identityProvider){const u=this.identityProvider.getId(d.element).toString();o.has(u)||this.nodesByIdentity.delete(u)}(c=i.onDidDeleteNode)===null||c===void 0||c.call(i,d)};this.model.splice([...e,0],Number.MAX_VALUE,t,Object.assign(Object.assign({},i),{onDidCreateNode:r,onDidDeleteNode:a}))}preserveCollapseState(e=ut.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),ut.map(e,t=>{let i=this.nodes.get(t.element);if(!i&&this.identityProvider){const r=this.identityProvider.getId(t.element).toString();i=this.nodesByIdentity.get(r)}if(!i){let r;return typeof t.collapsed>"u"?r=void 0:t.collapsed===wa.Collapsed||t.collapsed===wa.PreserveOrCollapsed?r=!0:t.collapsed===wa.Expanded||t.collapsed===wa.PreserveOrExpanded?r=!1:r=!!t.collapsed,Object.assign(Object.assign({},t),{children:this.preserveCollapseState(t.children),collapsed:r})}const s=typeof t.collapsible=="boolean"?t.collapsible:i.collapsible;let o;return typeof t.collapsed>"u"||t.collapsed===wa.PreserveOrCollapsed||t.collapsed===wa.PreserveOrExpanded?o=i.collapsed:t.collapsed===wa.Collapsed?o=!0:t.collapsed===wa.Expanded?o=!1:o=!!t.collapsed,Object.assign(Object.assign({},t),{collapsible:s,collapsed:o,children:this.preserveCollapseState(t.children)})})}rerender(e){const t=this.getElementLocation(e);this.model.rerender(t)}getFirstElementChild(e=null){const t=this.getElementLocation(e);return this.model.getFirstElementChild(t)}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getElementLocation(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getElementLocation(e);return this.model.getListRenderCount(t)}isCollapsible(e){const t=this.getElementLocation(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getElementLocation(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getElementLocation(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const s=this.getElementLocation(e);return this.model.setCollapsed(s,t,i)}expandTo(e){const t=this.getElementLocation(e);this.model.expandTo(t)}refilter(){this.model.refilter()}getNode(e=null){if(e===null)return this.model.getNode(this.model.rootRef);const t=this.nodes.get(e);if(!t)throw new mo(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(e===null)throw new mo(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new mo(this.user,`Tree element not found: ${e}`);const i=this.model.getNodeLocation(t),s=this.model.getParentNodeLocation(i);return this.model.getNode(s).element}getElementLocation(e){if(e===null)return[];const t=this.nodes.get(e);if(!t)throw new mo(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function LC(n){const e=[n.element],t=n.incompressible||!1;return{element:{elements:e,incompressible:t},children:ut.map(ut.from(n.children),LC),collapsible:n.collapsible,collapsed:n.collapsed}}function DC(n){const e=[n.element],t=n.incompressible||!1;let i,s;for(;[s,i]=ut.consume(ut.from(n.children),2),!(s.length!==1||s[0].incompressible);)n=s[0],e.push(n.element);return{element:{elements:e,incompressible:t},children:ut.map(ut.concat(s,i),DC),collapsible:n.collapsible,collapsed:n.collapsed}}function EN(n,e=0){let t;return eEN(i,0)),e===0&&n.element.incompressible?{element:n.element.elements[e],children:t,incompressible:!0,collapsible:n.collapsible,collapsed:n.collapsed}:{element:n.element.elements[e],children:t,collapsible:n.collapsible,collapsed:n.collapsed}}function l8(n){return EN(n,0)}function KG(n,e,t){return n.element===e?Object.assign(Object.assign({},n),{children:t}):Object.assign(Object.assign({},n),{children:ut.map(ut.from(n.children),i=>KG(i,e,t))})}const F2e=n=>({getId(e){return e.elements.map(t=>n.getId(t).toString()).join("\0")}});class B2e{get onDidSplice(){return this.model.onDidSplice}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new aP(e,t,i),this.enabled=typeof i.compressionEnabled>"u"?!0:i.compressionEnabled,this.identityProvider=i.identityProvider}setChildren(e,t=ut.empty(),i){const s=i.diffIdentityProvider&&F2e(i.diffIdentityProvider);if(e===null){const g=ut.map(t,this.enabled?DC:LC);this._setChildren(null,g,{diffIdentityProvider:s,diffDepth:1/0});return}const o=this.nodes.get(e);if(!o)throw new mo(this.user,"Unknown compressed tree node");const r=this.model.getNode(o),a=this.model.getParentNodeLocation(o),l=this.model.getNode(a),c=l8(r),d=KG(c,e,t),u=(this.enabled?DC:LC)(d),h=i.diffIdentityProvider?(g,p)=>i.diffIdentityProvider.getId(g)===i.diffIdentityProvider.getId(p):void 0;if(Yi(u.element.elements,r.element.elements,h)){this._setChildren(o,u.children||ut.empty(),{diffIdentityProvider:s,diffDepth:1});return}const f=l.children.map(g=>g===r?u:g);this._setChildren(l.element,f,{diffIdentityProvider:s,diffDepth:r.depth-l.depth})}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const i=this.model.getNode().children,s=ut.map(i,l8),o=ut.map(s,e?DC:LC);this._setChildren(null,o,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,i){const s=new Set,o=a=>{for(const l of a.element.elements)s.add(l),this.nodes.set(l,a.element)},r=a=>{for(const l of a.element.elements)s.has(l)||this.nodes.delete(l)};this.model.setChildren(e,t,Object.assign(Object.assign({},i),{onDidCreateNode:o,onDidDeleteNode:r}))}has(e){return this.nodes.has(e)}getListIndex(e){const t=this.getCompressedNode(e);return this.model.getListIndex(t)}getListRenderCount(e){const t=this.getCompressedNode(e);return this.model.getListRenderCount(t)}getNode(e){if(typeof e>"u")return this.model.getNode();const t=this.getCompressedNode(e);return this.model.getNode(t)}getNodeLocation(e){const t=this.model.getNodeLocation(e);return t===null?null:t.elements[t.elements.length-1]}getParentNodeLocation(e){const t=this.getCompressedNode(e),i=this.model.getParentNodeLocation(t);return i===null?null:i.elements[i.elements.length-1]}getFirstElementChild(e){const t=this.getCompressedNode(e);return this.model.getFirstElementChild(t)}isCollapsible(e){const t=this.getCompressedNode(e);return this.model.isCollapsible(t)}setCollapsible(e,t){const i=this.getCompressedNode(e);return this.model.setCollapsible(i,t)}isCollapsed(e){const t=this.getCompressedNode(e);return this.model.isCollapsed(t)}setCollapsed(e,t,i){const s=this.getCompressedNode(e);return this.model.setCollapsed(s,t,i)}expandTo(e){const t=this.getCompressedNode(e);this.model.expandTo(t)}rerender(e){const t=this.getCompressedNode(e);this.model.rerender(t)}refilter(){this.model.refilter()}getCompressedNode(e){if(e===null)return null;const t=this.nodes.get(e);if(!t)throw new mo(this.user,`Tree element not found: ${e}`);return t}}const W2e=n=>n[n.length-1];class lP{get element(){return this.node.element===null?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map(e=>new lP(this.unwrapper,e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e,t){this.unwrapper=e,this.node=t}}function V2e(n,e){return{splice(t,i,s){e.splice(t,i,s.map(o=>n.map(o)))},updateElementHeight(t,i){e.updateElementHeight(t,i)}}}function z2e(n,e){return Object.assign(Object.assign({},e),{identityProvider:e.identityProvider&&{getId(t){return e.identityProvider.getId(n(t))}},sorter:e.sorter&&{compare(t,i){return e.sorter.compare(t.elements[0],i.elements[0])}},filter:e.filter&&{filter(t,i){return e.filter.filter(n(t),i)}}})}class H2e{get onDidSplice(){return ue.map(this.model.onDidSplice,({insertedNodes:e,deletedNodes:t})=>({insertedNodes:e.map(i=>this.nodeMapper.map(i)),deletedNodes:t.map(i=>this.nodeMapper.map(i))}))}get onDidChangeCollapseState(){return ue.map(this.model.onDidChangeCollapseState,({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t}))}get onDidChangeRenderNodeCount(){return ue.map(this.model.onDidChangeRenderNodeCount,e=>this.nodeMapper.map(e))}constructor(e,t,i={}){this.rootRef=null,this.elementMapper=i.elementMapper||W2e;const s=o=>this.elementMapper(o.elements);this.nodeMapper=new sP(o=>new lP(s,o)),this.model=new B2e(e,V2e(this.nodeMapper,t),z2e(s,i))}setChildren(e,t=ut.empty(),i={}){this.model.setChildren(e,t,i)}setCompressionEnabled(e){this.model.setCompressionEnabled(e)}has(e){return this.model.has(e)}getListIndex(e){return this.model.getListIndex(e)}getListRenderCount(e){return this.model.getListRenderCount(e)}getNode(e){return this.nodeMapper.map(this.model.getNode(e))}getNodeLocation(e){return e.element}getParentNodeLocation(e){return this.model.getParentNodeLocation(e)}getFirstElementChild(e){const t=this.model.getFirstElementChild(e);return t===null||typeof t>"u"?t:this.elementMapper(t.elements)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}setCollapsed(e,t,i){return this.model.setCollapsed(e,t,i)}expandTo(e){return this.model.expandTo(e)}rerender(e){return this.model.rerender(e)}refilter(){return this.model.refilter()}getCompressedTreeNode(e=null){return this.model.getNode(e)}}var $2e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class cP extends GG{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,i,s,o={}){super(e,t,i,s,o),this.user=e}setChildren(e,t=ut.empty(),i){this.model.setChildren(e,t,i)}rerender(e){if(e===void 0){this.view.rerender();return}this.model.rerender(e)}hasElement(e){return this.model.has(e)}createModel(e,t,i){return new aP(e,t,i)}}class YG{get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}constructor(e,t){this._compressedTreeNodeProvider=e,this.renderer=t,this.templateId=t.templateId,t.onDidChangeTwistieState&&(this.onDidChangeTwistieState=t.onDidChangeTwistieState)}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,i,s){const o=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element);o.element.elements.length===1?(i.compressedTreeNode=void 0,this.renderer.renderElement(e,t,i.data,s)):(i.compressedTreeNode=o,this.renderer.renderCompressedElements(o,t,i.data,s))}disposeElement(e,t,i,s){var o,r,a,l;i.compressedTreeNode?(r=(o=this.renderer).disposeCompressedElements)===null||r===void 0||r.call(o,i.compressedTreeNode,t,i.data,s):(l=(a=this.renderer).disposeElement)===null||l===void 0||l.call(a,e,t,i.data,s)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return this.renderer.renderTwistie?this.renderer.renderTwistie(e,t):!1}}$2e([Di],YG.prototype,"compressedTreeNodeProvider",null);function U2e(n,e){return e&&Object.assign(Object.assign({},e),{keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&{getKeyboardNavigationLabel(t){let i;try{i=n().getCompressedTreeNode(t)}catch{return e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t)}return i.element.elements.length===1?e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t):e.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(i.element.elements)}}})}class ZG extends cP{constructor(e,t,i,s,o={}){const r=()=>this,a=s.map(l=>new YG(r,l));super(e,t,i,a,U2e(r,o))}setChildren(e,t=ut.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t,i){return new H2e(e,t,i)}updateOptions(e={}){super.updateOptions(e),typeof e.compressionEnabled<"u"&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}var Fc=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function rE(n){return Object.assign(Object.assign({},n),{children:[],refreshPromise:void 0,stale:!0,slow:!1,collapsedByDefault:void 0})}function AN(n,e){return e.parent?e.parent===n?!0:AN(n,e.parent):!1}function j2e(n,e){return n===e||AN(n,e)||AN(e,n)}class dP{get element(){return this.node.element.element}get children(){return this.node.children.map(e=>new dP(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class q2e{constructor(e,t,i){this.renderer=e,this.nodeMapper=t,this.onDidChangeTwistieState=i,this.renderedNodes=new Map,this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,s){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,s)}renderTwistie(e,t){return e.slow?(t.classList.add(...Te.asClassNameArray(se.treeItemLoading)),!0):(t.classList.remove(...Te.asClassNameArray(se.treeItemLoading)),!1)}disposeElement(e,t,i,s){var o,r;(r=(o=this.renderer).disposeElement)===null||r===void 0||r.call(o,this.nodeMapper.map(e),t,i.templateData,s)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function c8(n){return{browserEvent:n.browserEvent,elements:n.elements.map(e=>e.element)}}function d8(n){return{browserEvent:n.browserEvent,element:n.element&&n.element.element,target:n.target}}class G2e extends ry{constructor(e){super(e.elements.map(t=>t.element)),this.data=e}}function aE(n){return n instanceof ry?new G2e(n):n}class K2e{constructor(e){this.dnd=e}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map(i=>i.element),t)}onDragStart(e,t){var i,s;(s=(i=this.dnd).onDragStart)===null||s===void 0||s.call(i,aE(e),t)}onDragOver(e,t,i,s,o=!0){return this.dnd.onDragOver(aE(e),t&&t.element,i,s)}drop(e,t,i,s){this.dnd.drop(aE(e),t&&t.element,i,s)}onDragEnd(e){var t,i;(i=(t=this.dnd).onDragEnd)===null||i===void 0||i.call(t,e)}dispose(){this.dnd.dispose()}}function XG(n){return n&&Object.assign(Object.assign({},n),{collapseByDefault:!0,identityProvider:n.identityProvider&&{getId(e){return n.identityProvider.getId(e.element)}},dnd:n.dnd&&new K2e(n.dnd),multipleSelectionController:n.multipleSelectionController&&{isSelectionSingleChangeEvent(e){return n.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))},isSelectionRangeChangeEvent(e){return n.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))}},accessibilityProvider:n.accessibilityProvider&&Object.assign(Object.assign({},n.accessibilityProvider),{getPosInSet:void 0,getSetSize:void 0,getRole:n.accessibilityProvider.getRole?e=>n.accessibilityProvider.getRole(e.element):()=>"treeitem",isChecked:n.accessibilityProvider.isChecked?e=>{var t;return!!(!((t=n.accessibilityProvider)===null||t===void 0)&&t.isChecked(e.element))}:void 0,getAriaLabel(e){return n.accessibilityProvider.getAriaLabel(e.element)},getWidgetAriaLabel(){return n.accessibilityProvider.getWidgetAriaLabel()},getWidgetRole:n.accessibilityProvider.getWidgetRole?()=>n.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:n.accessibilityProvider.getAriaLevel&&(e=>n.accessibilityProvider.getAriaLevel(e.element)),getActiveDescendantId:n.accessibilityProvider.getActiveDescendantId&&(e=>n.accessibilityProvider.getActiveDescendantId(e.element))}),filter:n.filter&&{filter(e,t){return n.filter.filter(e.element,t)}},keyboardNavigationLabelProvider:n.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},n.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel(e){return n.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)}}),sorter:void 0,expandOnlyOnTwistieClick:typeof n.expandOnlyOnTwistieClick>"u"?void 0:typeof n.expandOnlyOnTwistieClick!="function"?n.expandOnlyOnTwistieClick:e=>n.expandOnlyOnTwistieClick(e.element),defaultFindVisibility:e=>e.hasChildren&&e.stale?1:typeof n.defaultFindVisibility=="number"?n.defaultFindVisibility:typeof n.defaultFindVisibility>"u"?2:n.defaultFindVisibility(e.element)})}function IN(n,e){e(n),n.children.forEach(t=>IN(t,e))}class QG{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return ue.map(this.tree.onDidChangeFocus,c8)}get onDidChangeSelection(){return ue.map(this.tree.onDidChangeSelection,c8)}get onMouseDblClick(){return ue.map(this.tree.onMouseDblClick,d8)}get onPointer(){return ue.map(this.tree.onPointer,d8)}get onDidFocus(){return this.tree.onDidFocus}get onDidChangeModel(){return this.tree.onDidChangeModel}get onDidChangeCollapseState(){return this.tree.onDidChangeCollapseState}get onDidChangeFindOpenState(){return this.tree.onDidChangeFindOpenState}get onDidDispose(){return this.tree.onDidDispose}constructor(e,t,i,s,o,r={}){this.user=e,this.dataSource=o,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new B,this._onDidChangeNodeSlowState=new B,this.nodeMapper=new sP(a=>new dP(a)),this.disposables=new pe,this.identityProvider=r.identityProvider,this.autoExpandSingleChildren=typeof r.autoExpandSingleChildren>"u"?!1:r.autoExpandSingleChildren,this.sorter=r.sorter,this.collapseByDefault=r.collapseByDefault,this.tree=this.createTree(e,t,i,s,r),this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.root=rE({element:void 0,parent:null,hasChildren:!0}),this.identityProvider&&(this.root=Object.assign(Object.assign({},this.root),{id:null})),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables)}createTree(e,t,i,s,o){const r=new rP(i),a=s.map(c=>new q2e(c,this.nodeMapper,this._onDidChangeNodeSlowState.event)),l=XG(o)||{};return new cP(e,t,r,a,l)}updateOptions(e={}){this.tree.updateOptions(e)}getHTMLElement(){return this.tree.getHTMLElement()}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}get scrollHeight(){return this.tree.scrollHeight}get renderHeight(){return this.tree.renderHeight}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}setInput(e,t){return Fc(this,void 0,void 0,function*(){this.refreshPromises.forEach(s=>s.cancel()),this.refreshPromises.clear(),this.root.element=e;const i=t&&{viewState:t,focus:[],selection:[]};yield this._updateChildren(e,!0,!1,i),i&&(this.tree.setFocus(i.focus),this.tree.setSelection(i.selection)),t&&typeof t.scrollTop=="number"&&(this.scrollTop=t.scrollTop)})}_updateChildren(e=this.root.element,t=!0,i=!1,s,o){return Fc(this,void 0,void 0,function*(){if(typeof this.root.element>"u")throw new mo(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield ue.toPromise(this._onDidRender.event));const r=this.getDataNode(e);if(yield this.refreshAndRenderNode(r,t,s,o),i)try{this.tree.rerender(r)}catch{}})}rerender(e){if(e===void 0||e===this.root.element){this.tree.rerender();return}const t=this.getDataNode(e);this.tree.rerender(t)}getNode(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getNode(t===this.root?null:t);return this.nodeMapper.map(i)}collapse(e,t=!1){const i=this.getDataNode(e);return this.tree.collapse(i===this.root?null:i,t)}expand(e,t=!1){return Fc(this,void 0,void 0,function*(){if(typeof this.root.element>"u")throw new mo(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield ue.toPromise(this._onDidRender.event));const i=this.getDataNode(e);if(this.tree.hasElement(i)&&!this.tree.isCollapsible(i)||(i.refreshPromise&&(yield this.root.refreshPromise,yield ue.toPromise(this._onDidRender.event)),i!==this.root&&!i.refreshPromise&&!this.tree.isCollapsed(i)))return!1;const s=this.tree.expand(i===this.root?null:i,t);return i.refreshPromise&&(yield this.root.refreshPromise,yield ue.toPromise(this._onDidRender.event)),s})}setSelection(e,t){const i=e.map(s=>this.getDataNode(s));this.tree.setSelection(i,t)}getSelection(){return this.tree.getSelection().map(t=>t.element)}setFocus(e,t){const i=e.map(s=>this.getDataNode(s));this.tree.setFocus(i,t)}getFocus(){return this.tree.getFocus().map(t=>t.element)}reveal(e,t){this.tree.reveal(this.getDataNode(e),t)}getParentElement(e){const t=this.tree.getParentElement(this.getDataNode(e));return t&&t.element}getFirstElementChild(e=this.root.element){const t=this.getDataNode(e),i=this.tree.getFirstElementChild(t===this.root?null:t);return i&&i.element}getDataNode(e){const t=this.nodes.get(e===this.root.element?null:e);if(!t)throw new mo(this.user,`Data tree node not found: ${e}`);return t}refreshAndRenderNode(e,t,i,s){return Fc(this,void 0,void 0,function*(){yield this.refreshNode(e,t,i),this.render(e,i,s)})}refreshNode(e,t,i){return Fc(this,void 0,void 0,function*(){let s;if(this.subTreeRefreshPromises.forEach((o,r)=>{!s&&j2e(r,e)&&(s=o.then(()=>this.refreshNode(e,t,i)))}),s)return s;if(e!==this.root&&this.tree.getNode(e).collapsed){e.hasChildren=!!this.dataSource.hasChildren(e.element),e.stale=!0;return}return this.doRefreshSubTree(e,t,i)})}doRefreshSubTree(e,t,i){return Fc(this,void 0,void 0,function*(){let s;e.refreshPromise=new Promise(o=>s=o),this.subTreeRefreshPromises.set(e,e.refreshPromise),e.refreshPromise.finally(()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)});try{const o=yield this.doRefreshNode(e,t,i);e.stale=!1,yield lT.settled(o.map(r=>this.doRefreshSubTree(r,t,i)))}finally{s()}})}doRefreshNode(e,t,i){return Fc(this,void 0,void 0,function*(){e.hasChildren=!!this.dataSource.hasChildren(e.element);let s;if(!e.hasChildren)s=Promise.resolve(ut.empty());else{const o=this.doGetChildren(e);if(AF(o))s=Promise.resolve(o);else{const r=Gb(800);r.then(()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)},a=>null),s=o.finally(()=>r.cancel())}}try{const o=yield s;return this.setChildren(e,o,t,i)}catch(o){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),zf(o))return[];throw o}finally{e.slow&&(e.slow=!1,this._onDidChangeNodeSlowState.fire(e))}})}doGetChildren(e){let t=this.refreshPromises.get(e);if(t)return t;const i=this.dataSource.getChildren(e.element);return AF(i)?this.processChildren(i):(t=xc(()=>Fc(this,void 0,void 0,function*(){return this.processChildren(yield i)})),this.refreshPromises.set(e,t),t.finally(()=>{this.refreshPromises.delete(e)}))}_onDidChangeCollapseState({node:e,deep:t}){e.element!==null&&!e.collapsed&&e.element.stale&&(t?this.collapse(e.element.element):this.refreshAndRenderNode(e.element,!1).catch(mt))}setChildren(e,t,i,s){const o=[...t];if(e.children.length===0&&o.length===0)return[];const r=new Map,a=new Map;for(const d of e.children)if(r.set(d.element,d),this.identityProvider){const u=this.tree.isCollapsed(d);a.set(d.id,{node:d,collapsed:u})}const l=[],c=o.map(d=>{const u=!!this.dataSource.hasChildren(d);if(!this.identityProvider){const p=rE({element:d,parent:e,hasChildren:u});return u&&this.collapseByDefault&&!this.collapseByDefault(d)&&(p.collapsedByDefault=!1,l.push(p)),p}const h=this.identityProvider.getId(d).toString(),f=a.get(h);if(f){const p=f.node;return r.delete(p.element),this.nodes.delete(p.element),this.nodes.set(d,p),p.element=d,p.hasChildren=u,i?f.collapsed?(p.children.forEach(_=>IN(_,v=>this.nodes.delete(v.element))),p.children.splice(0,p.children.length),p.stale=!0):l.push(p):u&&this.collapseByDefault&&!this.collapseByDefault(d)&&(p.collapsedByDefault=!1,l.push(p)),p}const g=rE({element:d,parent:e,id:h,hasChildren:u});return s&&s.viewState.focus&&s.viewState.focus.indexOf(h)>-1&&s.focus.push(g),s&&s.viewState.selection&&s.viewState.selection.indexOf(h)>-1&&s.selection.push(g),s&&s.viewState.expanded&&s.viewState.expanded.indexOf(h)>-1?l.push(g):u&&this.collapseByDefault&&!this.collapseByDefault(d)&&(g.collapsedByDefault=!1,l.push(g)),g});for(const d of r.values())IN(d,u=>this.nodes.delete(u.element));for(const d of c)this.nodes.set(d.element,d);return e.children.splice(0,e.children.length,...c),e!==this.root&&this.autoExpandSingleChildren&&c.length===1&&l.length===0&&(c[0].collapsedByDefault=!1,l.push(c[0])),l}render(e,t,i){const s=e.children.map(r=>this.asTreeElement(r,t)),o=i&&Object.assign(Object.assign({},i),{diffIdentityProvider:i.diffIdentityProvider&&{getId(r){return i.diffIdentityProvider.getId(r.element)}}});this.tree.setChildren(e===this.root?null:e,s,o),e!==this.root&&this.tree.setCollapsible(e,e.hasChildren),this._onDidRender.fire()}asTreeElement(e,t){if(e.stale)return{element:e,collapsible:e.hasChildren,collapsed:!0};let i;return t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1?i=!1:i=e.collapsedByDefault,e.collapsedByDefault=void 0,{element:e,children:e.hasChildren?ut.map(e.children,s=>this.asTreeElement(s,t)):[],collapsible:e.hasChildren,collapsed:i}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose(),this.tree.dispose()}}class uP{get element(){return{elements:this.node.element.elements.map(e=>e.element),incompressible:this.node.element.incompressible}}get children(){return this.node.children.map(e=>new uP(e))}get depth(){return this.node.depth}get visibleChildrenCount(){return this.node.visibleChildrenCount}get visibleChildIndex(){return this.node.visibleChildIndex}get collapsible(){return this.node.collapsible}get collapsed(){return this.node.collapsed}get visible(){return this.node.visible}get filterData(){return this.node.filterData}constructor(e){this.node=e}}class Y2e{constructor(e,t,i,s){this.renderer=e,this.nodeMapper=t,this.compressibleNodeMapperProvider=i,this.onDidChangeTwistieState=s,this.renderedNodes=new Map,this.disposables=[],this.templateId=e.templateId}renderTemplate(e){return{templateData:this.renderer.renderTemplate(e)}}renderElement(e,t,i,s){this.renderer.renderElement(this.nodeMapper.map(e),t,i.templateData,s)}renderCompressedElements(e,t,i,s){this.renderer.renderCompressedElements(this.compressibleNodeMapperProvider().map(e),t,i.templateData,s)}renderTwistie(e,t){return e.slow?(t.classList.add(...Te.asClassNameArray(se.treeItemLoading)),!0):(t.classList.remove(...Te.asClassNameArray(se.treeItemLoading)),!1)}disposeElement(e,t,i,s){var o,r;(r=(o=this.renderer).disposeElement)===null||r===void 0||r.call(o,this.nodeMapper.map(e),t,i.templateData,s)}disposeCompressedElements(e,t,i,s){var o,r;(r=(o=this.renderer).disposeCompressedElements)===null||r===void 0||r.call(o,this.compressibleNodeMapperProvider().map(e),t,i.templateData,s)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=Ft(this.disposables)}}function Z2e(n){const e=n&&XG(n);return e&&Object.assign(Object.assign({},e),{keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},e.keyboardNavigationLabelProvider),{getCompressedNodeKeyboardNavigationLabel(t){return n.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map(i=>i.element))}})})}class X2e extends QG{constructor(e,t,i,s,o,r,a={}){super(e,t,i,o,r,a),this.compressionDelegate=s,this.compressibleNodeMapper=new sP(l=>new uP(l)),this.filter=a.filter}createTree(e,t,i,s,o){const r=new rP(i),a=s.map(c=>new Y2e(c,this.nodeMapper,()=>this.compressibleNodeMapper,this._onDidChangeNodeSlowState.event)),l=Z2e(o)||{};return new ZG(e,t,r,a,l)}asTreeElement(e,t){return Object.assign({incompressible:this.compressionDelegate.isIncompressible(e.element)},super.asTreeElement(e,t))}updateOptions(e={}){this.tree.updateOptions(e)}render(e,t){if(!this.identityProvider)return super.render(e,t);const i=h=>this.identityProvider.getId(h).toString(),s=h=>{const f=new Set;for(const g of h){const p=this.tree.getCompressedTreeNode(g===this.root?null:g);if(p.element)for(const _ of p.element.elements)f.add(i(_.element))}return f},o=s(this.tree.getSelection()),r=s(this.tree.getFocus());super.render(e,t);const a=this.getSelection();let l=!1;const c=this.getFocus();let d=!1;const u=h=>{const f=h.element;if(f)for(let g=0;g{const i=this.filter.filter(t,1),s=Q2e(i);if(s===2)throw new Error("Recursive tree visibility not supported in async data compressed trees");return s===1})),super.processChildren(e)}}function Q2e(n){return typeof n=="boolean"?n?1:0:oP(n)?xv(n.visibility):xv(n)}class J2e extends GG{constructor(e,t,i,s,o,r={}){super(e,t,i,s,r),this.user=e,this.dataSource=o,this.identityProvider=r.identityProvider}createModel(e,t,i){return new aP(e,t,i)}}new _e("isMac",pt,m("isMac","Whether the operating system is macOS"));new _e("isLinux",Xn,m("isLinux","Whether the operating system is Linux"));new _e("isWindows",Ps,m("isWindows","Whether the operating system is Windows"));const JG=new _e("isWeb",i0,m("isWeb","Whether the platform is a web browser"));new _e("isMacNative",pt&&!i0,m("isMacNative","Whether the operating system is macOS on a non-browser platform"));new _e("isIOS",eu,m("isIOS","Whether the operating system is iOS"));new _e("isMobile",bfe,m("isMobile","Whether the platform is a mobile web browser"));new _e("isDevelopment",!1,!0);new _e("productQualityType","",m("productQualityType","Quality type of VS Code"));const eK="inputFocus";new _e(eK,!1,m("inputFocus","Whether keyboard focus is inside an input box"));var Ec=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Bt=function(n,e){return function(t,i){e(t,i,n)}};const Qo=rt("listService");class eEe{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new pe,this.lists=[],this._lastFocusedWidget=void 0,this._hasCreatedStyleController=!1}setLastFocusedList(e){var t,i;e!==this._lastFocusedWidget&&((t=this._lastFocusedWidget)===null||t===void 0||t.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=e,(i=this._lastFocusedWidget)===null||i===void 0||i.getHTMLElement().classList.add("last-focused"))}register(e,t){if(this._hasCreatedStyleController||(this._hasCreatedStyleController=!0,new RG(Dr(),"").style(ig)),this.lists.some(s=>s.widget===e))throw new Error("Cannot register the same widget multiple times");const i={widget:e,extraContextKeys:t};return this.lists.push(i),e.getHTMLElement()===document.activeElement&&this.setLastFocusedList(e),_r(e.onDidFocus(()=>this.setLastFocusedList(e)),Ye(()=>this.lists.splice(this.lists.indexOf(i),1)),e.onDidDispose(()=>{this.lists=this.lists.filter(s=>s!==i),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)}))}dispose(){this.disposables.dispose()}}const kv=new _e("listScrollAtBoundary","none");Le.or(kv.isEqualTo("top"),kv.isEqualTo("both"));Le.or(kv.isEqualTo("bottom"),kv.isEqualTo("both"));const tK=new _e("listFocus",!0),ID=new _e("listSupportsMultiselect",!0),iK=Le.and(tK,Le.not(eK)),hP=new _e("listHasSelectionOrFocus",!1),fP=new _e("listDoubleSelection",!1),gP=new _e("listMultiSelection",!1),TD=new _e("listSelectionNavigation",!1),tEe=new _e("listSupportsFind",!0),pP=new _e("treeElementCanCollapse",!1),iEe=new _e("treeElementHasParent",!1),mP=new _e("treeElementCanExpand",!1),nEe=new _e("treeElementHasChild",!1),sEe=new _e("treeFindOpen",!1),nK="listTypeNavigationMode",sK="listAutomaticKeyboardNavigation";function ND(n,e){const t=n.createScoped(e.getHTMLElement());return tK.bindTo(t),t}function RD(n,e){const t=kv.bindTo(n),i=()=>{const s=e.scrollTop===0,o=e.scrollHeight-e.renderHeight-e.scrollTop<1;s&&o?t.set("both"):s?t.set("top"):o?t.set("bottom"):t.set("none")};return i(),e.onDidScroll(i)}const ng="workbench.list.multiSelectModifier",kC="workbench.list.openMode",Uo="workbench.list.horizontalScrolling",_P="workbench.list.defaultFindMode",bP="workbench.list.typeNavigationMode",yx="workbench.list.keyboardNavigation",la="workbench.list.scrollByPage",vP="workbench.list.defaultFindMatchType",Ev="workbench.tree.indent",wx="workbench.tree.renderIndentGuides",ca="workbench.list.smoothScrolling",ll="workbench.list.mouseWheelScrollSensitivity",cl="workbench.list.fastScrollSensitivity",Cx="workbench.tree.expandMode";function dl(n){return n.getValue(ng)==="alt"}class oEe extends Y{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=dl(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(ng)&&(this.useAltAsMultipleSelectionModifier=dl(this.configurationService))}))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:IG(e)}isSelectionRangeChangeEvent(e){return TG(e)}}function MD(n,e){var t;const i=n.get(ii),s=n.get(bi),o=new pe;return[Object.assign(Object.assign({},e),{keyboardNavigationDelegate:{mightProducePrintableCharacter(a){return s.mightProducePrintableCharacter(a)}},smoothScrolling:!!i.getValue(ca),mouseWheelScrollSensitivity:i.getValue(ll),fastScrollSensitivity:i.getValue(cl),multipleSelectionController:(t=e.multipleSelectionController)!==null&&t!==void 0?t:o.add(new oEe(i)),keyboardNavigationEventFilter:lEe(s),scrollByPage:!!i.getValue(la)}),o]}let TN=class extends ha{constructor(e,t,i,s,o,r,a,l,c){const d=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!l.getValue(Uo),[u,h]=c.invokeFunction(MD,o);super(e,t,i,s,Object.assign(Object.assign({keyboardSupport:!1},u),{horizontalScrolling:d})),this.disposables.add(h),this.contextKeyService=ND(r,this),this.disposables.add(RD(this.contextKeyService,this)),this.listSupportsMultiSelect=ID.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),TD.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this.listHasSelectionOrFocus=hP.bindTo(this.contextKeyService),this.listDoubleSelection=fP.bindTo(this.contextKeyService),this.listMultiSelection=gP.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=dl(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const g=this.getSelection(),p=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(g.length>0||p.length>0),this.listMultiSelection.set(g.length>1),this.listDoubleSelection.set(g.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const g=this.getSelection(),p=this.getFocus();this.listHasSelectionOrFocus.set(g.length>0||p.length>0)})),this.disposables.add(l.onDidChangeConfiguration(g=>{g.affectsConfiguration(ng)&&(this._useAltAsMultipleSelectionModifier=dl(l));let p={};if(g.affectsConfiguration(Uo)&&this.horizontalScrolling===void 0){const _=!!l.getValue(Uo);p=Object.assign(Object.assign({},p),{horizontalScrolling:_})}if(g.affectsConfiguration(la)){const _=!!l.getValue(la);p=Object.assign(Object.assign({},p),{scrollByPage:_})}if(g.affectsConfiguration(ca)){const _=!!l.getValue(ca);p=Object.assign(Object.assign({},p),{smoothScrolling:_})}if(g.affectsConfiguration(ll)){const _=l.getValue(ll);p=Object.assign(Object.assign({},p),{mouseWheelScrollSensitivity:_})}if(g.affectsConfiguration(cl)){const _=l.getValue(cl);p=Object.assign(Object.assign({},p),{fastScrollSensitivity:_})}Object.keys(p).length>0&&this.updateOptions(p)})),this.navigator=new oK(this,Object.assign({configurationService:l},o)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?ay(e):ig)}};TN=Ec([Bt(5,et),Bt(6,Qo),Bt(7,ii),Bt(8,vt)],TN);let u8=class extends d2e{constructor(e,t,i,s,o,r,a,l,c){const d=typeof o.horizontalScrolling<"u"?o.horizontalScrolling:!!l.getValue(Uo),[u,h]=c.invokeFunction(MD,o);super(e,t,i,s,Object.assign(Object.assign({keyboardSupport:!1},u),{horizontalScrolling:d})),this.disposables=new pe,this.disposables.add(h),this.contextKeyService=ND(r,this),this.disposables.add(RD(this.contextKeyService,this.widget)),this.horizontalScrolling=o.horizontalScrolling,this.listSupportsMultiSelect=ID.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(o.multipleSelectionSupport!==!1),TD.bindTo(this.contextKeyService).set(!!o.selectionNavigation),this._useAltAsMultipleSelectionModifier=dl(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(l.onDidChangeConfiguration(g=>{g.affectsConfiguration(ng)&&(this._useAltAsMultipleSelectionModifier=dl(l));let p={};if(g.affectsConfiguration(Uo)&&this.horizontalScrolling===void 0){const _=!!l.getValue(Uo);p=Object.assign(Object.assign({},p),{horizontalScrolling:_})}if(g.affectsConfiguration(la)){const _=!!l.getValue(la);p=Object.assign(Object.assign({},p),{scrollByPage:_})}if(g.affectsConfiguration(ca)){const _=!!l.getValue(ca);p=Object.assign(Object.assign({},p),{smoothScrolling:_})}if(g.affectsConfiguration(ll)){const _=l.getValue(ll);p=Object.assign(Object.assign({},p),{mouseWheelScrollSensitivity:_})}if(g.affectsConfiguration(cl)){const _=l.getValue(cl);p=Object.assign(Object.assign({},p),{fastScrollSensitivity:_})}Object.keys(p).length>0&&this.updateOptions(p)})),this.navigator=new oK(this,Object.assign({configurationService:l},o)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?ay(e):ig)}dispose(){this.disposables.dispose(),super.dispose()}};u8=Ec([Bt(5,et),Bt(6,Qo),Bt(7,ii),Bt(8,vt)],u8);let h8=class extends AD{constructor(e,t,i,s,o,r,a,l,c,d){const u=typeof r.horizontalScrolling<"u"?r.horizontalScrolling:!!c.getValue(Uo),[h,f]=d.invokeFunction(MD,r);super(e,t,i,s,o,Object.assign(Object.assign({keyboardSupport:!1},h),{horizontalScrolling:u})),this.disposables.add(f),this.contextKeyService=ND(a,this),this.disposables.add(RD(this.contextKeyService,this)),this.listSupportsMultiSelect=ID.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(r.multipleSelectionSupport!==!1),TD.bindTo(this.contextKeyService).set(!!r.selectionNavigation),this.listHasSelectionOrFocus=hP.bindTo(this.contextKeyService),this.listDoubleSelection=fP.bindTo(this.contextKeyService),this.listMultiSelection=gP.bindTo(this.contextKeyService),this.horizontalScrolling=r.horizontalScrolling,this._useAltAsMultipleSelectionModifier=dl(c),this.disposables.add(this.contextKeyService),this.disposables.add(l.register(this)),this.updateStyles(r.overrideStyles),this.disposables.add(this.onDidChangeSelection(()=>{const p=this.getSelection(),_=this.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.listHasSelectionOrFocus.set(p.length>0||_.length>0),this.listMultiSelection.set(p.length>1),this.listDoubleSelection.set(p.length===2)})})),this.disposables.add(this.onDidChangeFocus(()=>{const p=this.getSelection(),_=this.getFocus();this.listHasSelectionOrFocus.set(p.length>0||_.length>0)})),this.disposables.add(c.onDidChangeConfiguration(p=>{p.affectsConfiguration(ng)&&(this._useAltAsMultipleSelectionModifier=dl(c));let _={};if(p.affectsConfiguration(Uo)&&this.horizontalScrolling===void 0){const v=!!c.getValue(Uo);_=Object.assign(Object.assign({},_),{horizontalScrolling:v})}if(p.affectsConfiguration(la)){const v=!!c.getValue(la);_=Object.assign(Object.assign({},_),{scrollByPage:v})}if(p.affectsConfiguration(ca)){const v=!!c.getValue(ca);_=Object.assign(Object.assign({},_),{smoothScrolling:v})}if(p.affectsConfiguration(ll)){const v=c.getValue(ll);_=Object.assign(Object.assign({},_),{mouseWheelScrollSensitivity:v})}if(p.affectsConfiguration(cl)){const v=c.getValue(cl);_=Object.assign(Object.assign({},_),{fastScrollSensitivity:v})}Object.keys(_).length>0&&this.updateOptions(_)})),this.navigator=new rEe(this,Object.assign({configurationService:c},r)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),e.overrideStyles!==void 0&&this.updateStyles(e.overrideStyles),e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?ay(e):ig)}dispose(){this.disposables.dispose(),super.dispose()}};h8=Ec([Bt(6,et),Bt(7,Qo),Bt(8,ii),Bt(9,vt)],h8);class yP extends Y{constructor(e,t){var i;super(),this.widget=e,this._onDidOpen=this._register(new B),this.onDidOpen=this._onDidOpen.event,this._register(ue.filter(this.widget.onDidChangeSelection,s=>s.browserEvent instanceof KeyboardEvent)(s=>this.onSelectionFromKeyboard(s))),this._register(this.widget.onPointer(s=>this.onPointer(s.element,s.browserEvent))),this._register(this.widget.onMouseDblClick(s=>this.onMouseDblClick(s.element,s.browserEvent))),typeof(t==null?void 0:t.openOnSingleClick)!="boolean"&&(t!=null&&t.configurationService)?(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(kC))!=="doubleClick",this._register(t==null?void 0:t.configurationService.onDidChangeConfiguration(s=>{s.affectsConfiguration(kC)&&(this.openOnSingleClick=(t==null?void 0:t.configurationService.getValue(kC))!=="doubleClick")}))):this.openOnSingleClick=(i=t==null?void 0:t.openOnSingleClick)!==null&&i!==void 0?i:!0}onSelectionFromKeyboard(e){if(e.elements.length!==1)return;const t=e.browserEvent,i=typeof t.preserveFocus=="boolean"?t.preserveFocus:!0,s=typeof t.pinned=="boolean"?t.pinned:!i;this._open(this.getSelectedElement(),i,s,!1,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick||t.detail===2)return;const s=t.button===1,o=!0,r=s,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,r,a,t)}onMouseDblClick(e,t){if(!t)return;const i=t.target;if(i.classList.contains("monaco-tl-twistie")||i.classList.contains("monaco-icon-label")&&i.classList.contains("folder-icon")&&t.offsetX<16)return;const o=!1,r=!0,a=t.ctrlKey||t.metaKey||t.altKey;this._open(e,o,r,a,t)}_open(e,t,i,s,o){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:i,revealIfVisible:!0},sideBySide:s,element:e,browserEvent:o})}}class oK extends yP{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class rEe extends yP{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class aEe extends yP{constructor(e,t){super(e,t)}getSelectedElement(){var e;return(e=this.widget.getSelection()[0])!==null&&e!==void 0?e:void 0}}function lEe(n){let e=!1;return t=>{if(t.toKeyCodeChord().isModifierKey())return!1;if(e)return e=!1,!1;const i=n.softDispatch(t,t.target);return i.kind===1?(e=!0,!1):(e=!1,i.kind===0)}}let f8=class extends cP{constructor(e,t,i,s,o,r,a,l,c){const{options:d,getTypeNavigationMode:u,disposable:h}=r.invokeFunction(dy,o);super(e,t,i,s,d),this.disposables.add(h),this.internals=new kf(this,o,u,o.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};f8=Ec([Bt(5,vt),Bt(6,et),Bt(7,Qo),Bt(8,ii)],f8);let g8=class extends ZG{constructor(e,t,i,s,o,r,a,l,c){const{options:d,getTypeNavigationMode:u,disposable:h}=r.invokeFunction(dy,o);super(e,t,i,s,d),this.disposables.add(h),this.internals=new kf(this,o,u,o.overrideStyles,a,l,c),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};g8=Ec([Bt(5,vt),Bt(6,et),Bt(7,Qo),Bt(8,ii)],g8);let p8=class extends J2e{constructor(e,t,i,s,o,r,a,l,c,d){const{options:u,getTypeNavigationMode:h,disposable:f}=a.invokeFunction(dy,r);super(e,t,i,s,o,u),this.disposables.add(f),this.internals=new kf(this,r,h,r.overrideStyles,l,c,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles!==void 0&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};p8=Ec([Bt(6,vt),Bt(7,et),Bt(8,Qo),Bt(9,ii)],p8);let NN=class extends QG{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,s,o,r,a,l,c,d){const{options:u,getTypeNavigationMode:h,disposable:f}=a.invokeFunction(dy,r);super(e,t,i,s,o,u),this.disposables.add(f),this.internals=new kf(this,r,h,r.overrideStyles,l,c,d),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};NN=Ec([Bt(6,vt),Bt(7,et),Bt(8,Qo),Bt(9,ii)],NN);let m8=class extends X2e{constructor(e,t,i,s,o,r,a,l,c,d,u){const{options:h,getTypeNavigationMode:f,disposable:g}=l.invokeFunction(dy,a);super(e,t,i,s,o,r,h),this.disposables.add(g),this.internals=new kf(this,a,f,a.overrideStyles,c,d,u),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};m8=Ec([Bt(7,vt),Bt(8,et),Bt(9,Qo),Bt(10,ii)],m8);function rK(n){const e=n.getValue(_P);if(e==="highlight")return Ua.Highlight;if(e==="filter")return Ua.Filter;const t=n.getValue(yx);if(t==="simple"||t==="highlight")return Ua.Highlight;if(t==="filter")return Ua.Filter}function aK(n){const e=n.getValue(vP);if(e==="fuzzy")return Df.Fuzzy;if(e==="contiguous")return Df.Contiguous}function dy(n,e){var t;const i=n.get(ii),s=n.get(Tu),o=n.get(et),r=n.get(vt),a=()=>{const f=o.getContextKeyValue(nK);if(f==="automatic")return Ra.Automatic;if(f==="trigger"||o.getContextKeyValue(sK)===!1)return Ra.Trigger;const p=i.getValue(bP);if(p==="automatic")return Ra.Automatic;if(p==="trigger")return Ra.Trigger},l=e.horizontalScrolling!==void 0?e.horizontalScrolling:!!i.getValue(Uo),[c,d]=r.invokeFunction(MD,e),u=e.paddingBottom,h=e.renderIndentGuides!==void 0?e.renderIndentGuides:i.getValue(wx);return{getTypeNavigationMode:a,disposable:d,options:Object.assign(Object.assign({keyboardSupport:!1},c),{indent:typeof i.getValue(Ev)=="number"?i.getValue(Ev):void 0,renderIndentGuides:h,smoothScrolling:!!i.getValue(ca),defaultFindMode:rK(i),defaultFindMatchType:aK(i),horizontalScrolling:l,scrollByPage:!!i.getValue(la),paddingBottom:u,hideTwistiesOfChildlessElements:e.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:(t=e.expandOnlyOnTwistieClick)!==null&&t!==void 0?t:i.getValue(Cx)==="doubleClick",contextViewProvider:s,findWidgetStyles:$ke})}}let kf=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,s,o,r,a){var l;this.tree=e,this.disposables=[],this.contextKeyService=ND(o,e),this.disposables.push(RD(this.contextKeyService,e)),this.listSupportsMultiSelect=ID.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(t.multipleSelectionSupport!==!1),TD.bindTo(this.contextKeyService).set(!!t.selectionNavigation),this.listSupportFindWidget=tEe.bindTo(this.contextKeyService),this.listSupportFindWidget.set((l=t.findWidgetEnabled)!==null&&l!==void 0?l:!0),this.hasSelectionOrFocus=hP.bindTo(this.contextKeyService),this.hasDoubleSelection=fP.bindTo(this.contextKeyService),this.hasMultiSelection=gP.bindTo(this.contextKeyService),this.treeElementCanCollapse=pP.bindTo(this.contextKeyService),this.treeElementHasParent=iEe.bindTo(this.contextKeyService),this.treeElementCanExpand=mP.bindTo(this.contextKeyService),this.treeElementHasChild=nEe.bindTo(this.contextKeyService),this.treeFindOpen=sEe.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=dl(a),this.updateStyleOverrides(s);const d=()=>{const h=e.getFocus()[0];if(!h)return;const f=e.getNode(h);this.treeElementCanCollapse.set(f.collapsible&&!f.collapsed),this.treeElementHasParent.set(!!e.getParentElement(h)),this.treeElementCanExpand.set(f.collapsible&&f.collapsed),this.treeElementHasChild.set(!!e.getFirstElementChild(h))},u=new Set;u.add(nK),u.add(sK),this.disposables.push(this.contextKeyService,r.register(e),e.onDidChangeSelection(()=>{const h=e.getSelection(),f=e.getFocus();this.contextKeyService.bufferChangeEvents(()=>{this.hasSelectionOrFocus.set(h.length>0||f.length>0),this.hasMultiSelection.set(h.length>1),this.hasDoubleSelection.set(h.length===2)})}),e.onDidChangeFocus(()=>{const h=e.getSelection(),f=e.getFocus();this.hasSelectionOrFocus.set(h.length>0||f.length>0),d()}),e.onDidChangeCollapseState(d),e.onDidChangeModel(d),e.onDidChangeFindOpenState(h=>this.treeFindOpen.set(h)),a.onDidChangeConfiguration(h=>{let f={};if(h.affectsConfiguration(ng)&&(this._useAltAsMultipleSelectionModifier=dl(a)),h.affectsConfiguration(Ev)){const g=a.getValue(Ev);f=Object.assign(Object.assign({},f),{indent:g})}if(h.affectsConfiguration(wx)&&t.renderIndentGuides===void 0){const g=a.getValue(wx);f=Object.assign(Object.assign({},f),{renderIndentGuides:g})}if(h.affectsConfiguration(ca)){const g=!!a.getValue(ca);f=Object.assign(Object.assign({},f),{smoothScrolling:g})}if(h.affectsConfiguration(_P)||h.affectsConfiguration(yx)){const g=rK(a);f=Object.assign(Object.assign({},f),{defaultFindMode:g})}if(h.affectsConfiguration(bP)||h.affectsConfiguration(yx)){const g=i();f=Object.assign(Object.assign({},f),{typeNavigationMode:g})}if(h.affectsConfiguration(vP)){const g=aK(a);f=Object.assign(Object.assign({},f),{defaultFindMatchType:g})}if(h.affectsConfiguration(Uo)&&t.horizontalScrolling===void 0){const g=!!a.getValue(Uo);f=Object.assign(Object.assign({},f),{horizontalScrolling:g})}if(h.affectsConfiguration(la)){const g=!!a.getValue(la);f=Object.assign(Object.assign({},f),{scrollByPage:g})}if(h.affectsConfiguration(Cx)&&t.expandOnlyOnTwistieClick===void 0&&(f=Object.assign(Object.assign({},f),{expandOnlyOnTwistieClick:a.getValue(Cx)==="doubleClick"})),h.affectsConfiguration(ll)){const g=a.getValue(ll);f=Object.assign(Object.assign({},f),{mouseWheelScrollSensitivity:g})}if(h.affectsConfiguration(cl)){const g=a.getValue(cl);f=Object.assign(Object.assign({},f),{fastScrollSensitivity:g})}Object.keys(f).length>0&&e.updateOptions(f)}),this.contextKeyService.onDidChangeContext(h=>{h.affectsSome(u)&&e.updateOptions({typeNavigationMode:i()})})),this.navigator=new aEe(e,Object.assign({configurationService:a},t)),this.disposables.push(this.navigator)}updateOptions(e){e.multipleSelectionSupport!==void 0&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyleOverrides(e){this.tree.style(e?ay(e):ig)}dispose(){this.disposables=Ft(this.disposables)}};kf=Ec([Bt(4,et),Bt(5,Qo),Bt(6,ii)],kf);const cEe=pn.as(Yf.Configuration);cEe.registerConfiguration({id:"workbench",order:7,title:m("workbenchConfigurationTitle","Workbench"),type:"object",properties:{[ng]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[m("multiSelectModifier.ctrlCmd","Maps to `Control` on Windows and Linux and to `Command` on macOS."),m("multiSelectModifier.alt","Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:m({key:"multiSelectModifier",comment:["- `ctrlCmd` refers to a value the setting can take and should not be localized.","- `Control` and `Command` refer to the modifier keys Ctrl or Cmd on the keyboard and can be localized."]},"The modifier to be used to add an item in trees and lists to a multi-selection with the mouse (for example in the explorer, open editors and scm view). The 'Open to Side' mouse gestures - if supported - will adapt such that they do not conflict with the multiselect modifier.")},[kC]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:m({key:"openModeModifier",comment:["`singleClick` and `doubleClick` refers to a value the setting can take and should not be localized."]},"Controls how to open items in trees and lists using the mouse (if supported). Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[Uo]:{type:"boolean",default:!1,description:m("horizontalScrolling setting","Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[la]:{type:"boolean",default:!1,description:m("list.scrollByPage","Controls whether clicks in the scrollbar scroll page by page.")},[Ev]:{type:"number",default:8,minimum:4,maximum:40,description:m("tree indent setting","Controls tree indentation in pixels.")},[wx]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:m("render tree indent guides","Controls whether the tree should render indent guides.")},[ca]:{type:"boolean",default:!1,description:m("list smoothScrolling setting","Controls whether lists and trees have smooth scrolling.")},[ll]:{type:"number",default:1,markdownDescription:m("Mouse Wheel Scroll Sensitivity","A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[cl]:{type:"number",default:5,markdownDescription:m("Fast Scroll Sensitivity","Scrolling speed multiplier when pressing `Alt`.")},[_P]:{type:"string",enum:["highlight","filter"],enumDescriptions:[m("defaultFindModeSettingKey.highlight","Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),m("defaultFindModeSettingKey.filter","Filter elements when searching.")],default:"highlight",description:m("defaultFindModeSettingKey","Controls the default find mode for lists and trees in the workbench.")},[yx]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[m("keyboardNavigationSettingKey.simple","Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),m("keyboardNavigationSettingKey.highlight","Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),m("keyboardNavigationSettingKey.filter","Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:m("keyboardNavigationSettingKey","Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:m("keyboardNavigationSettingKeyDeprecated","Please use 'workbench.list.defaultFindMode' and 'workbench.list.typeNavigationMode' instead.")},[vP]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[m("defaultFindMatchTypeSettingKey.fuzzy","Use fuzzy matching when searching."),m("defaultFindMatchTypeSettingKey.contiguous","Use contiguous matching when searching.")],default:"fuzzy",description:m("defaultFindMatchTypeSettingKey","Controls the type of matching used when searching lists and trees in the workbench.")},[Cx]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:m("expand mode","Controls how tree folders are expanded when clicking the folder names. Note that some trees and lists might choose to ignore this setting if it is not applicable.")},[bP]:{type:"string",enum:["automatic","trigger"],default:"automatic",markdownDescription:m("typeNavigationMode2","Controls how type navigation works in lists and trees in the workbench. When set to `trigger`, type navigation begins once the `list.triggerTypeNavigation` command is run.")}}});var RN;(function(n){n[n.PRESERVE=0]="PRESERVE",n[n.LAST=1]="LAST"})(RN||(RN={}));const lK={Quickaccess:"workbench.contributions.quickaccess"};class dEe{constructor(){this.providers=[],this.defaultProvider=void 0}registerQuickAccessProvider(e){return e.prefix.length===0?this.defaultProvider=e:this.providers.push(e),this.providers.sort((t,i)=>i.prefix.length-t.prefix.length),Ye(()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)})}getQuickAccessProviders(){return RL([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find(i=>e.startsWith(i.prefix))||void 0||this.defaultProvider}}pn.add(lK.Quickaccess,new dEe);const uEe={ctrlCmd:!1,alt:!1};var Av;(function(n){n[n.Blur=1]="Blur",n[n.Gesture=2]="Gesture",n[n.Other=3]="Other"})(Av||(Av={}));var Sa;(function(n){n[n.NONE=0]="NONE",n[n.FIRST=1]="FIRST",n[n.SECOND=2]="SECOND",n[n.LAST=3]="LAST"})(Sa||(Sa={}));const wP=rt("quickInputService");var hEe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},_8=function(n,e){return function(t,i){e(t,i,n)}};let MN=class extends Y{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=pn.as(lK.Quickaccess),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,i){var s;const[o,r]=this.getOrInstantiateProvider(e),a=this.visibleQuickAccess,l=a==null?void 0:a.descriptor;if(a&&r&&l===r){e!==r.prefix&&!(i!=null&&i.preserveValue)&&(a.picker.value=e),this.adjustValueSelection(a.picker,r,i);return}if(r&&!(i!=null&&i.preserveValue)){let f;if(a&&l&&l!==r){const g=a.value.substr(l.prefix.length);g&&(f=`${r.prefix}${g}`)}if(!f){const g=o==null?void 0:o.defaultFilterValue;g===RN.LAST?f=this.lastAcceptedPickerValues.get(r):typeof g=="string"&&(f=`${r.prefix}${g}`)}typeof f=="string"&&(e=f)}const c=new pe,d=c.add(this.quickInputService.createQuickPick());d.value=e,this.adjustValueSelection(d,r,i),d.placeholder=r==null?void 0:r.placeholder,d.quickNavigate=i==null?void 0:i.quickNavigateConfiguration,d.hideInput=!!d.quickNavigate&&!a,(typeof(i==null?void 0:i.itemActivation)=="number"||i!=null&&i.quickNavigateConfiguration)&&(d.itemActivation=(s=i==null?void 0:i.itemActivation)!==null&&s!==void 0?s:Sa.SECOND),d.contextKey=r==null?void 0:r.contextKey,d.filterValue=f=>f.substring(r?r.prefix.length:0);let u;t&&(u=new hj,c.add(ue.once(d.onWillAccept)(f=>{f.veto(),d.hide()}))),c.add(this.registerPickerListeners(d,o,r,e,i==null?void 0:i.providerOptions));const h=c.add(new Ar);if(o&&c.add(o.provide(d,h.token,i==null?void 0:i.providerOptions)),ue.once(d.onDidHide)(()=>{d.selectedItems.length===0&&h.cancel(),c.dispose(),u==null||u.complete(d.selectedItems.slice(0))}),d.show(),t)return u==null?void 0:u.p}adjustValueSelection(e,t,i){var s;let o;i!=null&&i.preserveValue?o=[e.value.length,e.value.length]:o=[(s=t==null?void 0:t.prefix.length)!==null&&s!==void 0?s:0,e.value.length],e.valueSelection=o}registerPickerListeners(e,t,i,s,o){const r=new pe,a=this.visibleQuickAccess={picker:e,descriptor:i,value:s};return r.add(Ye(()=>{a===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)})),r.add(e.onDidChangeValue(l=>{const[c]=this.getOrInstantiateProvider(l);c!==t?this.show(l,{preserveValue:!0,providerOptions:o}):a.value=l})),i&&r.add(e.onDidAccept(()=>{this.lastAcceptedPickerValues.set(i,e.value)})),r}getOrInstantiateProvider(e){const t=this.registry.getQuickAccessProvider(e);if(!t)return[void 0,void 0];let i=this.mapProviderToDescriptor.get(t);return i||(i=this.instantiationService.createInstance(t.ctor),this.mapProviderToDescriptor.set(t,i)),[i,t]}};MN=hEe([_8(0,wP),_8(1,vt)],MN);H.white.toString(),H.white.toString();class b8 extends Y{get onDidClick(){return this._onDidClick.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new B),this.options=t,this._element=document.createElement("a"),this._element.classList.add("monaco-button"),this._element.tabIndex=0,this._element.setAttribute("role","button"),this._element.classList.toggle("secondary",!!t.secondary);const i=t.secondary?t.buttonSecondaryBackground:t.buttonBackground,s=t.secondary?t.buttonSecondaryForeground:t.buttonForeground;this._element.style.color=s||"",this._element.style.backgroundColor=i||"",t.supportShortLabel&&(this._labelShortElement=document.createElement("div"),this._labelShortElement.classList.add("monaco-button-label-short"),this._element.appendChild(this._labelShortElement),this._labelElement=document.createElement("div"),this._labelElement.classList.add("monaco-button-label"),this._element.appendChild(this._labelElement),this._element.classList.add("monaco-text-button-with-short-label")),e.appendChild(this._element),this._register(Rt.addTarget(this._element)),[de.CLICK,Pt.Tap].forEach(o=>{this._register(K(this._element,o,r=>{if(!this.enabled){$e.stop(r);return}this._onDidClick.fire(r)}))}),this._register(K(this._element,de.KEY_DOWN,o=>{const r=new zt(o);let a=!1;this.enabled&&(r.equals(3)||r.equals(10))?(this._onDidClick.fire(o),a=!0):r.equals(9)&&(this._element.blur(),a=!0),a&&$e.stop(r,!0)})),this._register(K(this._element,de.MOUSE_OVER,o=>{this._element.classList.contains("disabled")||this.updateBackground(!0)})),this._register(K(this._element,de.MOUSE_OUT,o=>{this.updateBackground(!1)})),this.focusTracker=this._register(iu(this._element)),this._register(this.focusTracker.onDidFocus(()=>{this.enabled&&this.updateBackground(!0)})),this._register(this.focusTracker.onDidBlur(()=>{this.enabled&&this.updateBackground(!1)}))}dispose(){super.dispose(),this._element.remove()}getContentElements(e){const t=[];for(let i of rf(e))if(typeof i=="string"){if(i=i.trim(),i==="")continue;const s=document.createElement("span");s.textContent=i,t.push(s)}else t.push(i);return t}updateBackground(e){let t;this.options.secondary?t=e?this.options.buttonSecondaryHoverBackground:this.options.buttonSecondaryBackground:t=e?this.options.buttonHoverBackground:this.options.buttonBackground,t&&(this._element.style.backgroundColor=t)}get element(){return this._element}set label(e){var t;if(this._label===e||Md(this._label)&&Md(e)&&NDe(this._label,e))return;this._element.classList.add("monaco-text-button");const i=this.options.supportShortLabel?this._labelElement:this._element;if(Md(e)){const s=xD(e,{inline:!0});s.dispose();const o=(t=s.element.querySelector("p"))===null||t===void 0?void 0:t.innerHTML;if(o){const r=qU(o,{ADD_TAGS:["b","i","u","code","span"],ALLOWED_ATTR:["class"],RETURN_TRUSTED_TYPE:!0});i.innerHTML=r}else ls(i)}else this.options.supportIcons?ls(i,...this.getContentElements(e)):i.textContent=e;typeof this.options.title=="string"?this._element.title=this.options.title:this.options.title&&(this._element.title=GDe(e)),this._label=e}get label(){return this._label}set enabled(e){e?(this._element.classList.remove("disabled"),this._element.setAttribute("aria-disabled",String(!1)),this._element.tabIndex=0):(this._element.classList.add("disabled"),this._element.setAttribute("aria-disabled",String(!0)))}get enabled(){return!this._element.classList.contains("disabled")}}class PN{constructor(e,t,i){this.options=t,this.styles=i,this.count=0,this.element=le(e,ye(".monaco-count-badge")),this.countFormat=this.options.countFormat||"{0}",this.titleFormat=this.options.titleFormat||"",this.setCount(this.options.count||0)}setCount(e){this.count=e,this.render()}setTitleFormat(e){this.titleFormat=e,this.render()}render(){var e,t;this.element.textContent=Vb(this.countFormat,this.count),this.element.title=Vb(this.titleFormat,this.count),this.element.style.backgroundColor=(e=this.styles.badgeBackground)!==null&&e!==void 0?e:"",this.element.style.color=(t=this.styles.badgeForeground)!==null&&t!==void 0?t:"",this.styles.badgeBorder&&(this.element.style.border=`1px solid ${this.styles.badgeBorder}`)}}const v8="done",y8="active",lE="infinite",cE="infinite-long-running",w8="discrete";class PD extends Y{constructor(e,t){super(),this.workedVal=0,this.showDelayedScheduler=this._register(new Li(()=>Xh(this.element),0)),this.longRunningScheduler=this._register(new Li(()=>this.infiniteLongRunning(),PD.LONG_RUNNING_INFINITE_THRESHOLD)),this.create(e,t)}create(e,t){this.element=document.createElement("div"),this.element.classList.add("monaco-progress-container"),this.element.setAttribute("role","progressbar"),this.element.setAttribute("aria-valuemin","0"),e.appendChild(this.element),this.bit=document.createElement("div"),this.bit.classList.add("progress-bit"),this.bit.style.backgroundColor=(t==null?void 0:t.progressBarBackground)||"#0E70C0",this.element.appendChild(this.bit)}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(y8,lE,cE,w8),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(v8),this.element.classList.contains(lE)?(this.bit.style.opacity="0",e?setTimeout(()=>this.off(),200):this.off()):(this.bit.style.width="inherit",e?setTimeout(()=>this.off(),200):this.off()),this}infinite(){return this.bit.style.width="2%",this.bit.style.opacity="1",this.element.classList.remove(w8,v8,cE),this.element.classList.add(y8,lE),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(cE)}getContainer(){return this.element}}PD.LONG_RUNNING_INFINITE_THRESHOLD=1e4;const fEe=ye;class gEe extends Y{constructor(e,t,i){super(),this.parent=e,this.onKeyDown=o=>K(this.findInput.inputBox.inputElement,de.KEY_DOWN,r=>{o(new zt(r))}),this.onMouseDown=o=>K(this.findInput.inputBox.inputElement,de.MOUSE_DOWN,r=>{o(new dr(r))}),this.onDidChange=o=>this.findInput.onDidChange(o),this.container=le(this.parent,fEe(".quick-input-box")),this.findInput=this._register(new qG(this.container,void 0,{label:"",inputBoxStyles:t,toggleStyles:i}));const s=this.findInput.inputBox.inputElement;s.role="combobox",s.ariaHasPopup="menu",s.ariaAutoComplete="list",s.ariaExpanded="true"}get value(){return this.findInput.getValue()}set value(e){this.findInput.setValue(e)}select(e=null){this.findInput.inputBox.select(e)}isSelectionAtEnd(){return this.findInput.inputBox.isSelectionAtEnd()}get placeholder(){return this.findInput.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.findInput.inputBox.setPlaceHolder(e)}get password(){return this.findInput.inputBox.inputElement.type==="password"}set password(e){this.findInput.inputBox.inputElement.type=e?"password":"text"}set enabled(e){this.findInput.inputBox.inputElement.toggleAttribute("readonly",!e)}set toggles(e){this.findInput.setAdditionalToggles(e)}setAttribute(e,t){this.findInput.inputBox.inputElement.setAttribute(e,t)}showDecoration(e){e===_i.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===_i.Info?1:e===_i.Warning?2:3,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===_i.Info?1:e===_i.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}class Od{constructor(e,t){var i;this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.supportIcons=(i=t==null?void 0:t.supportIcons)!==null&&i!==void 0?i:!1,this.domNode=le(e,ye("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],i="",s){e||(e=""),s&&(e=Od.escapeNewLines(e,t)),!(this.didEverRender&&this.text===e&&this.title===i&&Co(this.highlights,t))&&(this.text=e,this.title=i,this.highlights=t,this.render())}render(){const e=[];let t=0;for(const i of this.highlights){if(i.end===i.start)continue;if(t{s=o===`\r +`?-1:0,r+=i;for(const a of t)a.end<=r||(a.start>=r&&(a.start+=s),a.end>=r&&(a.end+=s));return i+=s,"⏎"})}}class dE{constructor(e){this._element=e}get element(){return this._element}set textContent(e){this.disposed||e===this._textContent||(this._textContent=e,this._element.textContent=e)}set className(e){this.disposed||e===this._className||(this._className=e,this._element.className=e)}set empty(e){this.disposed||e===this._empty||(this._empty=e,this._element.style.marginLeft=e?"0":"")}dispose(){this.disposed=!0}}class ON extends Y{constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new dE(le(e,ye(".monaco-icon-label")))),this.labelContainer=le(this.domNode.element,ye(".monaco-icon-label-container"));const i=le(this.labelContainer,ye("span.monaco-icon-name-container"));t!=null&&t.supportHighlights||t!=null&&t.supportIcons?this.nameNode=new _Ee(i,!!t.supportIcons):this.nameNode=new pEe(i),this.hoverDelegate=t==null?void 0:t.hoverDelegate}get element(){return this.domNode.element}setLabel(e,t,i){const s=["monaco-icon-label"],o=["monaco-icon-label-container"];let r="";if(i&&(i.extraClasses&&s.push(...i.extraClasses),i.italic&&s.push("italic"),i.strikethrough&&s.push("strikethrough"),i.disabledCommand&&o.push("disabled"),i.title&&(r+=i.title)),this.domNode.className=s.join(" "),this.domNode.element.setAttribute("aria-label",r),this.labelContainer.className=o.join(" "),this.setupHover(i!=null&&i.descriptionTitle?this.labelContainer:this.element,i==null?void 0:i.title),this.nameNode.setLabel(e,i),t||this.descriptionNode){const a=this.getOrCreateDescriptionNode();a instanceof Od?(a.set(t||"",i?i.descriptionMatches:void 0,void 0,i==null?void 0:i.labelEscapeNewLines),this.setupHover(a.element,i==null?void 0:i.descriptionTitle)):(a.textContent=t&&(i!=null&&i.labelEscapeNewLines)?Od.escapeNewLines(t,[]):t||"",this.setupHover(a.element,(i==null?void 0:i.descriptionTitle)||""),a.empty=!t)}}setupHover(e,t){const i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),!t){e.removeAttribute("title");return}if(!this.hoverDelegate)PDe(e,t);else{const s=DG(this.hoverDelegate,e,t);s&&this.customHovers.set(e,s)}}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}getOrCreateDescriptionNode(){var e;if(!this.descriptionNode){const t=this._register(new dE(le(this.labelContainer,ye("span.monaco-icon-description-container"))));!((e=this.creationOptions)===null||e===void 0)&&e.supportDescriptionHighlights?this.descriptionNode=new Od(le(t.element,ye("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons}):this.descriptionNode=this._register(new dE(le(t.element,ye("span.label-description"))))}return this.descriptionNode}}class pEe{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&Co(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=le(this.container,ye("a.label-name",{id:t==null?void 0:t.domId}))),this.singleLabel.textContent=e;else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;for(let i=0;i{const o={start:i,end:i+s.length},r=t.map(a=>Ln.intersect(o,a)).filter(a=>!Ln.isEmpty(a)).map(({start:a,end:l})=>({start:a-i,end:l-i}));return i=o.end+e.length,r})}class _Ee{constructor(e,t){this.container=e,this.supportIcons=t,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(!(this.label===e&&Co(this.options,t)))if(this.label=e,this.options=t,typeof e=="string")this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=new Od(le(this.container,ye("a.label-name",{id:t==null?void 0:t.domId})),{supportIcons:this.supportIcons})),this.singleLabel.set(e,t==null?void 0:t.matches,void 0,t==null?void 0:t.labelEscapeNewLines);else{this.container.innerText="",this.container.classList.add("multiple"),this.singleLabel=void 0;const i=(t==null?void 0:t.separator)||"/",s=mEe(e,i,t==null?void 0:t.matches);for(let o=0;o{const n=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:n,collatorIsNumeric:n.resolvedOptions().numeric}});function vEe(n,e,t=!1){const i=n||"",s=e||"",o=C8.value.collator.compare(i,s);return C8.value.collatorIsNumeric&&o===0&&i!==s?is.length)return 1}return 0}var CEe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o};class cK{constructor(e){this.nodes=e}toString(){return this.nodes.map(e=>typeof e=="string"?e:e.label).join("")}}CEe([Di],cK.prototype,"toString",null);const SEe=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;function xEe(n){const e=[];let t=0,i;for(;i=SEe.exec(n);){i.index-t>0&&e.push(n.substring(t,i.index));const[,s,o,,r]=i;r?e.push({label:s,href:o,title:r}):e.push({label:s,href:o}),t=i.index+i[0].length}return t{Mme(f)&&$e.stop(f,!0),t.callback(o.href)},c=t.disposables.add(new ot(a,de.CLICK)).event,d=t.disposables.add(new ot(a,de.KEY_DOWN)).event,u=ue.chain(d,f=>f.filter(g=>{const p=new zt(g);return p.equals(10)||p.equals(3)}));t.disposables.add(Rt.addTarget(a));const h=t.disposables.add(new ot(a,Pt.Tap)).event;ue.any(c,h,u)(l,null,t.disposables),e.appendChild(a)}}var dK=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},S8=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const Vr=ye;class kEe{constructor(e,t,i,s,o,r,a){var l,c,d;this._checked=!1,this._hidden=!1,this.hasCheckbox=s,this.index=i,this.fireButtonTriggered=o,this.fireSeparatorButtonTriggered=r,this._onChecked=a,this.onChecked=s?ue.map(ue.filter(this._onChecked.event,u=>u.listElement===this),u=>u.checked):ue.None,e.type==="separator"?this._separator=e:(this.item=e,t&&t.type==="separator"&&!t.buttons&&(this._separator=t),this.saneDescription=this.item.description,this.saneDetail=this.item.detail,this._labelHighlights=(l=this.item.highlights)===null||l===void 0?void 0:l.label,this._descriptionHighlights=(c=this.item.highlights)===null||c===void 0?void 0:c.description,this._detailHighlights=(d=this.item.highlights)===null||d===void 0?void 0:d.detail,this.saneTooltip=this.item.tooltip),this._init=new Hf(()=>{var u;const h=(u=e.label)!==null&&u!==void 0?u:"",f=C_(h).text.trim(),g=e.ariaLabel||[h,this.saneDescription,this.saneDetail].map(p=>TDe(p)).filter(p=>!!p).join(", ");return{saneLabel:h,saneSortLabel:f,saneAriaLabel:g}})}get saneLabel(){return this._init.value.saneLabel}get saneSortLabel(){return this._init.value.saneSortLabel}get saneAriaLabel(){return this._init.value.saneAriaLabel}get element(){return this._element}set element(e){this._element=e}get hidden(){return this._hidden}set hidden(e){this._hidden=e}get checked(){return this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire({listElement:this,checked:e}))}get separator(){return this._separator}set separator(e){this._separator=e}get labelHighlights(){return this._labelHighlights}set labelHighlights(e){this._labelHighlights=e}get descriptionHighlights(){return this._descriptionHighlights}set descriptionHighlights(e){this._descriptionHighlights=e}get detailHighlights(){return this._detailHighlights}set detailHighlights(e){this._detailHighlights=e}}class hy{constructor(e){this.themeService=e}get templateId(){return hy.ID}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=[],t.toDisposeTemplate=[],t.entry=le(e,Vr(".quick-input-list-entry"));const i=le(t.entry,Vr("label.quick-input-list-label"));t.toDisposeTemplate.push(Ui(i,de.CLICK,c=>{t.checkbox.offsetParent||c.preventDefault()})),t.checkbox=le(i,Vr("input.quick-input-list-checkbox")),t.checkbox.type="checkbox",t.toDisposeTemplate.push(Ui(t.checkbox,de.CHANGE,c=>{t.element.checked=t.checkbox.checked}));const s=le(i,Vr(".quick-input-list-rows")),o=le(s,Vr(".quick-input-list-row")),r=le(s,Vr(".quick-input-list-row"));t.label=new ON(o,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0}),t.toDisposeTemplate.push(t.label),t.icon=ij(t.label.element,Vr(".quick-input-list-icon"));const a=le(o,Vr(".quick-input-list-entry-keybinding"));t.keybinding=new uy(a,bo);const l=le(r,Vr(".quick-input-list-label-meta"));return t.detail=new ON(l,{supportHighlights:!0,supportIcons:!0}),t.toDisposeTemplate.push(t.detail),t.separator=le(t.entry,Vr(".quick-input-list-separator")),t.actionBar=new al(t.entry),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.push(t.actionBar),t}renderElement(e,t,i){var s,o,r,a;i.element=e,e.element=(s=i.entry)!==null&&s!==void 0?s:void 0;const l=e.item?e.item:e.separator;i.checkbox.checked=e.checked,i.toDisposeElement.push(e.onChecked(g=>i.checkbox.checked=g));const{labelHighlights:c,descriptionHighlights:d,detailHighlights:u}=e;if(!((o=e.item)===null||o===void 0)&&o.iconPath){const g=fD(this.themeService.getColorTheme().type)?e.item.iconPath.dark:(r=e.item.iconPath.light)!==null&&r!==void 0?r:e.item.iconPath.dark,p=Ue.revive(g);i.icon.className="quick-input-list-icon",i.icon.style.backgroundImage=nu(p)}else i.icon.style.backgroundImage="",i.icon.className=!((a=e.item)===null||a===void 0)&&a.iconClass?`quick-input-list-icon ${e.item.iconClass}`:"";const h={matches:c||[],descriptionTitle:e.saneDescription,descriptionMatches:d||[],labelEscapeNewLines:!0};l.type!=="separator"?(h.extraClasses=l.iconClasses,h.italic=l.italic,h.strikethrough=l.strikethrough,i.entry.classList.remove("quick-input-list-separator-as-item")):i.entry.classList.add("quick-input-list-separator-as-item"),i.label.setLabel(e.saneLabel,e.saneDescription,h),i.keybinding.set(l.type==="separator"?void 0:l.keybinding),e.saneDetail?(i.detail.element.style.display="",i.detail.setLabel(e.saneDetail,void 0,{matches:u,title:e.saneDetail,labelEscapeNewLines:!0})):i.detail.element.style.display="none",e.item&&e.separator&&e.separator.label?(i.separator.textContent=e.separator.label,i.separator.style.display=""):i.separator.style.display="none",i.entry.classList.toggle("quick-input-list-separator-border",!!e.separator);const f=l.buttons;f&&f.length?(i.actionBar.push(f.map((g,p)=>{let _=g.iconClass||(g.iconPath?FN(g.iconPath):void 0);return g.alwaysVisible&&(_=_?`${_} always-visible`:"always-visible"),{id:`id-${p}`,class:_,enabled:!0,label:"",tooltip:g.tooltip||"",run:()=>{l.type!=="separator"?e.fireButtonTriggered({button:g,item:l}):e.fireSeparatorButtonTriggered({button:g,separator:l})}}}),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i){i.toDisposeElement=Ft(i.toDisposeElement),i.actionBar.clear()}disposeTemplate(e){e.toDisposeElement=Ft(e.toDisposeElement),e.toDisposeTemplate=Ft(e.toDisposeTemplate)}}hy.ID="listelement";class EEe{getHeight(e){return e.item?e.saneDetail?44:22:24}getTemplateId(e){return hy.ID}}var en;(function(n){n[n.First=1]="First",n[n.Second=2]="Second",n[n.Last=3]="Last",n[n.Next=4]="Next",n[n.Previous=5]="Previous",n[n.NextPage=6]="NextPage",n[n.PreviousPage=7]="PreviousPage"})(en||(en={}));class CP{constructor(e,t,i,s){this.parent=e,this.options=i,this.inputElements=[],this.elements=[],this.elementsToIndexes=new Map,this.matchOnDescription=!1,this.matchOnDetail=!1,this.matchOnLabel=!0,this.matchOnLabelMode="fuzzy",this.sortByLabel=!0,this._onChangedAllVisibleChecked=new B,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new B,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new B,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new B,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new B,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new B,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._onKeyDown=new B,this.onKeyDown=this._onKeyDown.event,this._onLeave=new B,this.onLeave=this._onLeave.event,this._listElementChecked=new B,this._fireCheckedEvents=!0,this.elementDisposables=[],this.disposables=[],this.id=t,this.container=le(this.parent,Vr(".quick-input-list"));const o=new EEe,r=new TEe;if(this.list=i.createList("QuickInput",this.container,o,[new hy(s)],{identityProvider:{getId:a=>{var l,c,d,u,h,f,g,p;return(p=(f=(u=(c=(l=a.item)===null||l===void 0?void 0:l.id)!==null&&c!==void 0?c:(d=a.item)===null||d===void 0?void 0:d.label)!==null&&u!==void 0?u:(h=a.separator)===null||h===void 0?void 0:h.id)!==null&&f!==void 0?f:(g=a.separator)===null||g===void 0?void 0:g.label)!==null&&p!==void 0?p:""}},setRowLineHeight:!1,multipleSelectionSupport:!1,horizontalScrolling:!1,accessibilityProvider:r}),this.list.getHTMLElement().id=t,this.disposables.push(this.list),this.disposables.push(this.list.onKeyDown(a=>{const l=new zt(a);switch(l.keyCode){case 10:this.toggleCheckbox();break;case 31:(pt?a.metaKey:a.ctrlKey)&&this.list.setFocus(es(this.list.length));break;case 16:{const c=this.list.getFocus();c.length===1&&c[0]===0&&this._onLeave.fire();break}case 18:{const c=this.list.getFocus();c.length===1&&c[0]===this.list.length-1&&this._onLeave.fire();break}}this._onKeyDown.fire(l)})),this.disposables.push(this.list.onMouseDown(a=>{a.browserEvent.button!==2&&a.browserEvent.preventDefault()})),this.disposables.push(K(this.container,de.CLICK,a=>{(a.x||a.y)&&this._onLeave.fire()})),this.disposables.push(this.list.onMouseMiddleClick(a=>{this._onLeave.fire()})),this.disposables.push(this.list.onContextMenu(a=>{typeof a.index=="number"&&(a.browserEvent.preventDefault(),this.list.setSelection([a.index]))})),i.hoverDelegate){const a=new uj(i.hoverDelegate.delay);this.disposables.push(this.list.onMouseOver(l=>S8(this,void 0,void 0,function*(){var c;if(l.browserEvent.target instanceof HTMLAnchorElement){a.cancel();return}if(!(!(l.browserEvent.relatedTarget instanceof HTMLAnchorElement)&&wn(l.browserEvent.relatedTarget,(c=l.element)===null||c===void 0?void 0:c.element)))try{yield a.trigger(()=>S8(this,void 0,void 0,function*(){l.element&&this.showHover(l.element)}))}catch(d){if(!zf(d))throw d}}))),this.disposables.push(this.list.onMouseOut(l=>{var c;wn(l.browserEvent.relatedTarget,(c=l.element)===null||c===void 0?void 0:c.element)||a.cancel()})),this.disposables.push(a)}this.disposables.push(this._listElementChecked.event(a=>this.fireCheckedEvents())),this.disposables.push(this._onChangedAllVisibleChecked,this._onChangedCheckedCount,this._onChangedVisibleCount,this._onChangedCheckedElements,this._onButtonTriggered,this._onSeparatorButtonTriggered,this._onLeave,this._onKeyDown)}get onDidChangeFocus(){return ue.map(this.list.onDidChangeFocus,e=>e.elements.map(t=>t.item))}get onDidChangeSelection(){return ue.map(this.list.onDidChangeSelection,e=>({items:e.elements.map(t=>t.item),event:e.browserEvent}))}get scrollTop(){return this.list.scrollTop}set scrollTop(e){this.list.scrollTop=e}get ariaLabel(){return this.list.getHTMLElement().ariaLabel}set ariaLabel(e){this.list.getHTMLElement().ariaLabel=e}getAllVisibleChecked(){return this.allVisibleChecked(this.elements,!1)}allVisibleChecked(e,t=!0){for(let i=0,s=e.length;i{t.hidden||(t.checked=e)})}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}setElements(e){this.elementDisposables=Ft(this.elementDisposables);const t=r=>this.fireButtonTriggered(r),i=r=>this.fireSeparatorButtonTriggered(r);this.inputElements=e;const s=new Map,o=this.parent.classList.contains("show-checkboxes");this.elements=e.reduce((r,a,l)=>{var c;const d=l>0?e[l-1]:void 0;if(a.type==="separator"&&!a.buttons)return r;const u=new kEe(a,d,l,o,t,i,this._listElementChecked),h=r.length;return r.push(u),s.set((c=u.item)!==null&&c!==void 0?c:u.separator,h),r},[]),this.elementsToIndexes=s,this.list.splice(0,this.list.length),this.list.splice(0,this.list.length,this.elements),this._onChangedVisibleCount.fire(this.elements.length)}getFocusedElements(){return this.list.getFocusedElements().map(e=>e.item)}setFocusedElements(e){if(this.list.setFocus(e.filter(t=>this.elementsToIndexes.has(t)).map(t=>this.elementsToIndexes.get(t))),e.length>0){const t=this.list.getFocus()[0];typeof t=="number"&&this.list.reveal(t)}}getActiveDescendant(){return this.list.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){this.list.setSelection(e.filter(t=>this.elementsToIndexes.has(t)).map(t=>this.elementsToIndexes.get(t)))}getCheckedElements(){return this.elements.filter(e=>e.checked).map(e=>e.item).filter(e=>!!e)}setCheckedElements(e){try{this._fireCheckedEvents=!1;const t=new Set;for(const i of e)t.add(i);for(const i of this.elements)i.checked=t.has(i.item)}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}set enabled(e){this.list.getHTMLElement().style.pointerEvents=e?"":"none"}focus(e){if(!this.list.length)return;switch(e===en.Second&&this.list.length<2&&(e=en.First),e){case en.First:this.list.scrollTop=0,this.list.focusFirst(void 0,i=>!!i.item);break;case en.Second:this.list.scrollTop=0,this.list.focusNth(1,void 0,i=>!!i.item);break;case en.Last:this.list.scrollTop=this.list.scrollHeight,this.list.focusLast(void 0,i=>!!i.item);break;case en.Next:{this.list.focusNext(void 0,!0,void 0,s=>!!s.item);const i=this.list.getFocus()[0];i!==0&&!this.elements[i-1].item&&this.list.firstVisibleIndex>i-1&&this.list.reveal(i-1);break}case en.Previous:{this.list.focusPrevious(void 0,!0,void 0,s=>!!s.item);const i=this.list.getFocus()[0];i!==0&&!this.elements[i-1].item&&this.list.firstVisibleIndex>i-1&&this.list.reveal(i-1);break}case en.NextPage:this.list.focusNextPage(void 0,i=>!!i.item);break;case en.PreviousPage:this.list.focusPreviousPage(void 0,i=>!!i.item);break}const t=this.list.getFocus()[0];typeof t=="number"&&this.list.reveal(t)}clearFocus(){this.list.setFocus([])}domFocus(){this.list.domFocus()}showHover(e){var t,i,s;this.options.hoverDelegate!==void 0&&(this._lastHover&&!this._lastHover.isDisposed&&((i=(t=this.options.hoverDelegate).onDidHideHover)===null||i===void 0||i.call(t),(s=this._lastHover)===null||s===void 0||s.dispose()),!(!e.element||!e.saneTooltip)&&(this._lastHover=this.options.hoverDelegate.showHover({content:e.saneTooltip,target:e.element,linkHandler:o=>{this.options.linkOpenerDelegate(o)},showPointer:!0,container:this.container,hoverPosition:1},!1)))}layout(e){this.list.getHTMLElement().style.maxHeight=e?`${Math.floor(e/44)*44+6}px`:"",this.list.layout()}filter(e){if(!(this.sortByLabel||this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))return this.list.layout(),!1;const t=e;if(e=e.trim(),!e||!(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))this.elements.forEach(s=>{s.labelHighlights=void 0,s.descriptionHighlights=void 0,s.detailHighlights=void 0,s.hidden=!1;const o=s.index&&this.inputElements[s.index-1];s.item&&(s.separator=o&&o.type==="separator"&&!o.buttons?o:void 0)});else{let s;this.elements.forEach(o=>{var r,a,l,c;let d;this.matchOnLabelMode==="fuzzy"?d=this.matchOnLabel&&(r=Z2(e,C_(o.saneLabel)))!==null&&r!==void 0?r:void 0:d=this.matchOnLabel&&(a=AEe(t,C_(o.saneLabel)))!==null&&a!==void 0?a:void 0;const u=this.matchOnDescription&&(l=Z2(e,C_(o.saneDescription||"")))!==null&&l!==void 0?l:void 0,h=this.matchOnDetail&&(c=Z2(e,C_(o.saneDetail||"")))!==null&&c!==void 0?c:void 0;if(d||u||h?(o.labelHighlights=d,o.descriptionHighlights=u,o.detailHighlights=h,o.hidden=!1):(o.labelHighlights=void 0,o.descriptionHighlights=void 0,o.detailHighlights=void 0,o.hidden=o.item?!o.item.alwaysShow:!0),o.item?o.separator=void 0:o.separator&&(o.hidden=!0),!this.sortByLabel){const f=o.index&&this.inputElements[o.index-1];s=f&&f.type==="separator"?f:s,s&&!o.hidden&&(o.separator=s,s=void 0)}})}const i=this.elements.filter(s=>!s.hidden);if(this.sortByLabel&&e){const s=e.toLowerCase();i.sort((o,r)=>IEe(o,r,s))}return this.elementsToIndexes=i.reduce((s,o,r)=>{var a;return s.set((a=o.item)!==null&&a!==void 0?a:o.separator,r),s},new Map),this.list.splice(0,this.list.length,i),this.list.setFocus([]),this.list.layout(),this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedVisibleCount.fire(i.length),!0}toggleCheckbox(){try{this._fireCheckedEvents=!1;const e=this.list.getFocusedElements(),t=this.allVisibleChecked(e);for(const i of e)i.checked=!t}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}display(e){this.container.style.display=e?"":"none"}isDisplayed(){return this.container.style.display!=="none"}dispose(){this.elementDisposables=Ft(this.elementDisposables),this.disposables=Ft(this.disposables)}fireCheckedEvents(){this._fireCheckedEvents&&(this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedCheckedCount.fire(this.getCheckedCount()),this._onChangedCheckedElements.fire(this.getCheckedElements()))}fireButtonTriggered(e){this._onButtonTriggered.fire(e)}fireSeparatorButtonTriggered(e){this._onSeparatorButtonTriggered.fire(e)}style(e){this.list.style(e)}toggleHover(){const e=this.list.getFocusedElements()[0];if(!(e!=null&&e.saneTooltip))return;if(this._lastHover&&!this._lastHover.isDisposed){this._lastHover.dispose();return}const t=this.list.getFocusedElements()[0];if(!t)return;this.showHover(t);const i=new pe;i.add(this.list.onDidChangeFocus(s=>{s.indexes.length&&this.showHover(s.elements[0])})),this._lastHover&&i.add(this._lastHover),this._toggleHover=i,this.elementDisposables.push(this._toggleHover)}}dK([Di],CP.prototype,"onDidChangeFocus",null);dK([Di],CP.prototype,"onDidChangeSelection",null);function AEe(n,e){const{text:t,iconOffsets:i}=e;if(!i||i.length===0)return x8(n,t);const s=BL(t," "),o=t.length-s.length,r=x8(n,s);if(r)for(const a of r){const l=i[a.start+o]+o;a.start+=l,a.end+=l}return r}function x8(n,e){const t=e.toLowerCase().indexOf(n.toLowerCase());return t!==-1?[{start:t,end:t+n.length}]:null}function IEe(n,e,t){const i=n.labelHighlights||[],s=e.labelHighlights||[];return i.length&&!s.length?-1:!i.length&&s.length?1:i.length===0&&s.length===0?0:yEe(n.saneSortLabel,e.saneSortLabel,t)}class TEe{getWidgetAriaLabel(){return m("quickInput","Quick Input")}getAriaLabel(e){var t;return!((t=e.separator)===null||t===void 0)&&t.label?`${e.saneAriaLabel}, ${e.separator.label}`:e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(e){return e.hasCheckbox?"checkbox":"option"}isChecked(e){if(e.hasCheckbox)return{value:e.checked,onDidChange:e.onChecked}}}var L8=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const BN={iconClass:Te.asClassName(se.quickInputBack),tooltip:m("quickInput.back","Back"),handle:-1};class fy extends Y{constructor(e){super(),this.ui=e,this._widgetUpdated=!1,this.visible=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._buttons=[],this.buttonsUpdated=!1,this._toggles=[],this.togglesUpdated=!1,this.noValidationMessage=fy.noPromptMessage,this._severity=_i.Ignore,this.onDidTriggerButtonEmitter=this._register(new B),this.onDidHideEmitter=this._register(new B),this.onDisposeEmitter=this._register(new B),this.visibleDisposables=this._register(new pe),this.onDidHide=this.onDidHideEmitter.event}get title(){return this._title}set title(e){this._title=e,this.update()}get description(){return this._description}set description(e){this._description=e,this.update()}get step(){return this._steps}set step(e){this._steps=e,this.update()}get totalSteps(){return this._totalSteps}set totalSteps(e){this._totalSteps=e,this.update()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.update()}get contextKey(){return this._contextKey}set contextKey(e){this._contextKey=e,this.update()}get busy(){return this._busy}set busy(e){this._busy=e,this.update()}get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(e){const t=this._ignoreFocusOut!==e&&!eu;this._ignoreFocusOut=e&&!eu,t&&this.update()}get buttons(){return this._buttons}set buttons(e){this._buttons=e,this.buttonsUpdated=!0,this.update()}get toggles(){return this._toggles}set toggles(e){this._toggles=e??[],this.togglesUpdated=!0,this.update()}get validationMessage(){return this._validationMessage}set validationMessage(e){this._validationMessage=e,this.update()}get severity(){return this._severity}set severity(e){this._severity=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.onDidTriggerButton(e=>{this.buttons.indexOf(e)!==-1&&this.onDidTriggerButtonEmitter.fire(e)})),this.ui.show(this),this.visible=!0,this._lastValidationMessage=void 0,this._lastSeverity=void 0,this.buttons.length&&(this.buttonsUpdated=!0),this.toggles.length&&(this.togglesUpdated=!0),this.update())}hide(){this.visible&&this.ui.hide()}didHide(e=Av.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}update(){var e,t;if(!this.visible)return;const i=this.getTitle();i&&this.ui.title.textContent!==i?this.ui.title.textContent=i:!i&&this.ui.title.innerHTML!==" "&&(this.ui.title.innerText=" ");const s=this.getDescription();if(this.ui.description1.textContent!==s&&(this.ui.description1.textContent=s),this.ui.description2.textContent!==s&&(this.ui.description2.textContent=s),this._widgetUpdated&&(this._widgetUpdated=!1,this._widget?ls(this.ui.widget,this._widget):ls(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new Lc,this.busyDelay.setIfNotSet(()=>{this.visible&&this.ui.progressBar.infinite()},800)),!this.busy&&this.busyDelay&&(this.ui.progressBar.stop(),this.busyDelay.cancel(),this.busyDelay=void 0),this.buttonsUpdated){this.buttonsUpdated=!1,this.ui.leftActionBar.clear();const r=this.buttons.filter(l=>l===BN);this.ui.leftActionBar.push(r.map((l,c)=>{const d=new So(`id-${c}`,"",l.iconClass||FN(l.iconPath),!0,()=>L8(this,void 0,void 0,function*(){this.onDidTriggerButtonEmitter.fire(l)}));return d.tooltip=l.tooltip||"",d}),{icon:!0,label:!1}),this.ui.rightActionBar.clear();const a=this.buttons.filter(l=>l!==BN);this.ui.rightActionBar.push(a.map((l,c)=>{const d=new So(`id-${c}`,"",l.iconClass||FN(l.iconPath),!0,()=>L8(this,void 0,void 0,function*(){this.onDidTriggerButtonEmitter.fire(l)}));return d.tooltip=l.tooltip||"",d}),{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;const r=(t=(e=this.toggles)===null||e===void 0?void 0:e.filter(a=>a instanceof h0))!==null&&t!==void 0?t:[];this.ui.inputBox.toggles=r}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const o=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==o&&(this._lastValidationMessage=o,ls(this.ui.message),DEe(o,this.ui.message,{callback:r=>{this.ui.linkOpenerDelegate(r)},disposables:this.visibleDisposables})),this._lastSeverity!==this.severity&&(this._lastSeverity=this.severity,this.showMessageDecoration(this.severity))}getTitle(){return this.title&&this.step?`${this.title} (${this.getSteps()})`:this.title?this.title:this.step?this.getSteps():""}getDescription(){return this.description||""}getSteps(){return this.step&&this.totalSteps?m("quickInput.steps","{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==_i.Ignore){const t=this.ui.inputBox.stylesForType(e);this.ui.message.style.color=t.foreground?`${t.foreground}`:"",this.ui.message.style.backgroundColor=t.background?`${t.background}`:"",this.ui.message.style.border=t.border?`1px solid ${t.border}`:"",this.ui.message.style.marginBottom="-2px"}else this.ui.message.style.color="",this.ui.message.style.backgroundColor="",this.ui.message.style.border="",this.ui.message.style.marginBottom=""}dispose(){this.hide(),this.onDisposeEmitter.fire(),super.dispose()}}fy.noPromptMessage=m("inputModeEntry","Press 'Enter' to confirm your input or 'Escape' to cancel");class Iv extends fy{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new B),this.onWillAcceptEmitter=this._register(new B),this.onDidAcceptEmitter=this._register(new B),this.onDidCustomEmitter=this._register(new B),this._items=[],this.itemsUpdated=!1,this._canSelectMany=!1,this._canAcceptInBackground=!1,this._matchOnDescription=!1,this._matchOnDetail=!1,this._matchOnLabel=!0,this._matchOnLabelMode="fuzzy",this._sortByLabel=!0,this._autoFocusOnList=!0,this._keepScrollPosition=!1,this._itemActivation=Sa.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new B),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new B),this.onDidTriggerItemButtonEmitter=this._register(new B),this.onDidTriggerSeparatorButtonEmitter=this._register(new B),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this.filterValue=e=>e,this.onDidChangeValue=this.onDidChangeValueEmitter.event,this.onWillAccept=this.onWillAcceptEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event,this.onDidChangeActive=this.onDidChangeActiveEmitter.event,this.onDidChangeSelection=this.onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this.onDidTriggerItemButtonEmitter.event,this.onDidTriggerSeparatorButton=this.onDidTriggerSeparatorButtonEmitter.event}get quickNavigate(){return this._quickNavigate}set quickNavigate(e){this._quickNavigate=e,this.update()}get value(){return this._value}set value(e){this.doSetValue(e)}doSetValue(e,t){this._value!==e&&(this._value=e,t||this.update(),this.visible&&this.ui.list.filter(this.filterValue(this._value))&&this.trySelectFirst(),this.onDidChangeValueEmitter.fire(this._value))}set ariaLabel(e){this._ariaLabel=e,this.update()}get ariaLabel(){return this._ariaLabel}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get items(){return this._items}get scrollTop(){return this.ui.list.scrollTop}set scrollTop(e){this.ui.list.scrollTop=e}set items(e){this._items=e,this.itemsUpdated=!0,this.update()}get canSelectMany(){return this._canSelectMany}set canSelectMany(e){this._canSelectMany=e,this.update()}get canAcceptInBackground(){return this._canAcceptInBackground}set canAcceptInBackground(e){this._canAcceptInBackground=e}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e,this.update()}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e,this.update()}get matchOnLabel(){return this._matchOnLabel}set matchOnLabel(e){this._matchOnLabel=e,this.update()}get matchOnLabelMode(){return this._matchOnLabelMode}set matchOnLabelMode(e){this._matchOnLabelMode=e,this.update()}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update()}get autoFocusOnList(){return this._autoFocusOnList}set autoFocusOnList(e){this._autoFocusOnList=e,this.update()}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(e){this._keepScrollPosition=e}get itemActivation(){return this._itemActivation}set itemActivation(e){this._itemActivation=e}get activeItems(){return this._activeItems}set activeItems(e){this._activeItems=e,this.activeItemsUpdated=!0,this.update()}get selectedItems(){return this._selectedItems}set selectedItems(e){this._selectedItems=e,this.selectedItemsUpdated=!0,this.update()}get keyMods(){return this._quickNavigate?uEe:this.ui.keyMods}set valueSelection(e){this._valueSelection=e,this.valueSelectionUpdated=!0,this.update()}get customButton(){return this._customButton}set customButton(e){this._customButton=e,this.update()}get customLabel(){return this._customButtonLabel}set customLabel(e){this._customButtonLabel=e,this.update()}get customHover(){return this._customButtonHover}set customHover(e){this._customButtonHover=e,this.update()}get ok(){return this._ok}set ok(e){this._ok=e,this.update()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}trySelectFirst(){this.autoFocusOnList&&(this.canSelectMany||this.ui.list.focus(en.First))}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{this.doSetValue(e,!0)})),this.visibleDisposables.add(this.ui.inputBox.onMouseDown(e=>{this.autoFocusOnList||this.ui.list.clearFocus()})),this.visibleDisposables.add((this._hideInput?this.ui.list:this.ui.inputBox).onKeyDown(e=>{switch(e.keyCode){case 18:this.ui.list.focus(en.Next),this.canSelectMany&&this.ui.list.domFocus(),$e.stop(e,!0);break;case 16:this.ui.list.getFocusedElements().length?this.ui.list.focus(en.Previous):this.ui.list.focus(en.Last),this.canSelectMany&&this.ui.list.domFocus(),$e.stop(e,!0);break;case 12:this.ui.list.focus(en.NextPage),this.canSelectMany&&this.ui.list.domFocus(),$e.stop(e,!0);break;case 11:this.ui.list.focus(en.PreviousPage),this.canSelectMany&&this.ui.list.domFocus(),$e.stop(e,!0);break;case 17:if(!this._canAcceptInBackground||!this.ui.inputBox.isSelectionAtEnd())return;this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!0));break;case 14:(e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey&&(this.ui.list.focus(en.First),$e.stop(e,!0));break;case 13:(e.ctrlKey||e.metaKey)&&!e.shiftKey&&!e.altKey&&(this.ui.list.focus(en.Last),$e.stop(e,!0));break}})),this.visibleDisposables.add(this.ui.onDidAccept(()=>{this.canSelectMany?this.ui.list.getCheckedElements().length||(this._selectedItems=[],this.onDidChangeSelectionEmitter.fire(this.selectedItems)):this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems)),this.handleAccept(!1)})),this.visibleDisposables.add(this.ui.onDidCustom(()=>{this.onDidCustomEmitter.fire()})),this.visibleDisposables.add(this.ui.list.onDidChangeFocus(e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&Yi(e,this._activeItems,(t,i)=>t===i)||(this._activeItems=e,this.onDidChangeActiveEmitter.fire(e))})),this.visibleDisposables.add(this.ui.list.onDidChangeSelection(({items:e,event:t})=>{if(this.canSelectMany){e.length&&this.ui.list.setSelectedElements([]);return}this.selectedItemsToConfirm!==this._selectedItems&&Yi(e,this._selectedItems,(i,s)=>i===s)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(t instanceof MouseEvent&&t.button===1))})),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements(e=>{this.canSelectMany&&(this.selectedItemsToConfirm!==this._selectedItems&&Yi(e,this._selectedItems,(t,i)=>t===i)||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e)))})),this.visibleDisposables.add(this.ui.list.onButtonTriggered(e=>this.onDidTriggerItemButtonEmitter.fire(e))),this.visibleDisposables.add(this.ui.list.onSeparatorButtonTriggered(e=>this.onDidTriggerSeparatorButtonEmitter.fire(e))),this.visibleDisposables.add(this.registerQuickNavigation()),this.valueSelectionUpdated=!0),super.show()}handleAccept(e){let t=!1;this.onWillAcceptEmitter.fire({veto:()=>t=!0}),t||this.onDidAcceptEmitter.fire({inBackground:e})}registerQuickNavigation(){return K(this.ui.container,de.KEY_UP,e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new zt(e),i=t.keyCode;this._quickNavigate.keybindings.some(r=>{const a=r.getChords();return a.length>1?!1:a[0].shiftKey&&i===4?!(t.ctrlKey||t.altKey||t.metaKey):!!(a[0].altKey&&i===6||a[0].ctrlKey&&i===5||a[0].metaKey&&i===57)})&&(this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!1)),this._quickNavigate=void 0)})}update(){if(!this.visible)return;const e=this.keepScrollPosition?this.scrollTop:0,t=!!this.description,i={title:!!this.title||!!this.step||!!this.buttons.length,description:t,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!this._hideInput,progressBar:!this._hideInput||t,visibleCount:!0,count:this.canSelectMany&&!this._hideCountBadge,ok:this.ok==="default"?this.canSelectMany:this.ok,list:!0,message:!!this.validationMessage,customButton:this.customButton};this.ui.setVisibilities(i),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||"");let s=this.ariaLabel;if(!s&&i.inputBox&&(s=this.placeholder||Iv.DEFAULT_ARIA_LABEL,this.title&&(s+=` - ${this.title}`)),this.ui.list.ariaLabel!==s&&(this.ui.list.ariaLabel=s??null),this.ui.list.matchOnDescription=this.matchOnDescription,this.ui.list.matchOnDetail=this.matchOnDetail,this.ui.list.matchOnLabel=this.matchOnLabel,this.ui.list.matchOnLabelMode=this.matchOnLabelMode,this.ui.list.sortByLabel=this.sortByLabel,this.itemsUpdated)switch(this.itemsUpdated=!1,this.ui.list.setElements(this.items),this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this.ui.checkAll.checked=this.ui.list.getAllVisibleChecked(),this.ui.visibleCount.setCount(this.ui.list.getVisibleCount()),this.ui.count.setCount(this.ui.list.getCheckedCount()),this._itemActivation){case Sa.NONE:this._itemActivation=Sa.FIRST;break;case Sa.SECOND:this.ui.list.focus(en.Second),this._itemActivation=Sa.FIRST;break;case Sa.LAST:this.ui.list.focus(en.Last),this._itemActivation=Sa.FIRST;break;default:this.trySelectFirst();break}this.ui.container.classList.contains("show-checkboxes")!==!!this.canSelectMany&&(this.canSelectMany?this.ui.list.clearFocus():this.trySelectFirst()),this.activeItemsUpdated&&(this.activeItemsUpdated=!1,this.activeItemsToConfirm=this._activeItems,this.ui.list.setFocusedElements(this.activeItems),this.activeItemsToConfirm===this._activeItems&&(this.activeItemsToConfirm=null)),this.selectedItemsUpdated&&(this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=this._selectedItems,this.canSelectMany?this.ui.list.setCheckedElements(this.selectedItems):this.ui.list.setSelectedElements(this.selectedItems),this.selectedItemsToConfirm===this._selectedItems&&(this.selectedItemsToConfirm=null)),this.ui.customButton.label=this.customLabel||"",this.ui.customButton.element.title=this.customHover||"",i.inputBox||(this.ui.list.domFocus(),this.canSelectMany&&this.ui.list.focus(en.First)),this.keepScrollPosition&&(this.scrollTop=e)}}Iv.DEFAULT_ARIA_LABEL=m("quickInputBox.ariaLabel","Type to narrow down results.");class NEe extends fy{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new B),this.onDidAcceptEmitter=this._register(new B),this.onDidChangeValue=this.onDidValueChangeEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event}get value(){return this._value}set value(e){this._value=e||"",this.update()}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update()}get password(){return this._password}set password(e){this._password=e,this.update()}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange(e=>{e!==this.value&&(this._value=e,this.onDidValueChangeEmitter.fire(e))})),this.visibleDisposables.add(this.ui.onDidAccept(()=>this.onDidAcceptEmitter.fire())),this.valueSelectionUpdated=!0),super.show()}update(){if(!this.visible)return;this.ui.container.classList.remove("hidden-input");const e={title:!!this.title||!!this.step||!!this.buttons.length,description:!!this.description||!!this.step,inputBox:!0,message:!0,progressBar:!0};this.ui.setVisibilities(e),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||""),this.ui.inputBox.password!==this.password&&(this.ui.inputBox.password=this.password)}}const Vs=ye;class OD extends Y{constructor(e,t){super(),this.options=e,this.themeService=t,this.enabled=!0,this.onDidAcceptEmitter=this._register(new B),this.onDidCustomEmitter=this._register(new B),this.onDidTriggerButtonEmitter=this._register(new B),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new B),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new B),this.onHide=this.onHideEmitter.event,this.idPrefix=e.idPrefix,this.parentElement=e.container,this.styles=e.styles,this.registerKeyModsListeners()}registerKeyModsListeners(){const e=t=>{this.keyMods.ctrlCmd=t.ctrlKey||t.metaKey,this.keyMods.alt=t.altKey};this._register(K(window,de.KEY_DOWN,e,!0)),this._register(K(window,de.KEY_UP,e,!0)),this._register(K(window,de.MOUSE_DOWN,e,!0))}getUI(){if(this.ui)return this.ui;const e=le(this.parentElement,Vs(".quick-input-widget.show-file-icons"));e.tabIndex=-1,e.style.display="none";const t=Dr(e),i=le(e,Vs(".quick-input-titlebar")),s=this.options.hoverDelegate?{hoverDelegate:this.options.hoverDelegate}:void 0,o=this._register(new al(i,s));o.domNode.classList.add("quick-input-left-action-bar");const r=le(i,Vs(".quick-input-title")),a=this._register(new al(i,s));a.domNode.classList.add("quick-input-right-action-bar");const l=le(e,Vs(".quick-input-header")),c=le(l,Vs("input.quick-input-check-all"));c.type="checkbox",c.setAttribute("aria-label",m("quickInput.checkAll","Toggle all checkboxes")),this._register(Ui(c,de.CHANGE,R=>{const z=c.checked;O.setAllVisibleChecked(z)})),this._register(K(c,de.CLICK,R=>{(R.x||R.y)&&f.setFocus()}));const d=le(l,Vs(".quick-input-description")),u=le(l,Vs(".quick-input-and-message")),h=le(u,Vs(".quick-input-filter")),f=this._register(new gEe(h,this.styles.inputBox,this.styles.toggle));f.setAttribute("aria-describedby",`${this.idPrefix}message`);const g=le(h,Vs(".quick-input-visible-count"));g.setAttribute("aria-live","polite"),g.setAttribute("aria-atomic","true");const p=new PN(g,{countFormat:m({key:"quickInput.visibleCount",comment:["This tells the user how many items are shown in a list of items to select from. The items can be anything. Currently not visible, but read by screen readers."]},"{0} Results")},this.styles.countBadge),_=le(h,Vs(".quick-input-count"));_.setAttribute("aria-live","polite");const v=new PN(_,{countFormat:m({key:"quickInput.countSelected",comment:["This tells the user how many items are selected in a list of items to select from. The items can be anything."]},"{0} Selected")},this.styles.countBadge),b=le(l,Vs(".quick-input-action")),y=this._register(new b8(b,this.styles.button));y.label=m("ok","OK"),this._register(y.onDidClick(R=>{this.onDidAcceptEmitter.fire()}));const w=le(l,Vs(".quick-input-action")),S=this._register(new b8(w,this.styles.button));S.label=m("custom","Custom"),this._register(S.onDidClick(R=>{this.onDidCustomEmitter.fire()}));const L=le(u,Vs(`#${this.idPrefix}message.quick-input-message`)),x=this._register(new PD(e,this.styles.progressBar));x.getContainer().classList.add("quick-input-progress");const D=le(e,Vs(".quick-input-html-widget"));D.tabIndex=-1;const k=le(e,Vs(".quick-input-description")),P=this.idPrefix+"list",O=this._register(new CP(e,P,this.options,this.themeService));f.setAttribute("aria-controls",P),this._register(O.onDidChangeFocus(()=>{var R;f.setAttribute("aria-activedescendant",(R=O.getActiveDescendant())!==null&&R!==void 0?R:"")})),this._register(O.onChangedAllVisibleChecked(R=>{c.checked=R})),this._register(O.onChangedVisibleCount(R=>{p.setCount(R)})),this._register(O.onChangedCheckedCount(R=>{v.setCount(R)})),this._register(O.onLeave(()=>{setTimeout(()=>{f.setFocus(),this.controller instanceof Iv&&this.controller.canSelectMany&&O.clearFocus()},0)}));const M=iu(e);return this._register(M),this._register(K(e,de.FOCUS,R=>{wn(R.relatedTarget,e)||(this.previousFocusElement=R.relatedTarget instanceof HTMLElement?R.relatedTarget:void 0)},!0)),this._register(M.onDidBlur(()=>{!this.getUI().ignoreFocusOut&&!this.options.ignoreFocusOut()&&this.hide(Av.Blur),this.previousFocusElement=void 0})),this._register(K(e,de.FOCUS,R=>{f.setFocus()})),this._register(Ui(e,de.KEY_DOWN,R=>{if(!wn(R.target,D))switch(R.keyCode){case 3:$e.stop(R,!0),this.enabled&&this.onDidAcceptEmitter.fire();break;case 9:$e.stop(R,!0),this.hide(Av.Gesture);break;case 2:if(!R.altKey&&!R.ctrlKey&&!R.metaKey){const z=[".quick-input-list .monaco-action-bar .always-visible",".quick-input-list-entry:hover .monaco-action-bar",".monaco-list-row.focused .monaco-action-bar"];if(e.classList.contains("show-checkboxes")?z.push("input"):z.push("input[type=text]"),this.getUI().list.isDisplayed()&&z.push(".monaco-list"),this.getUI().message&&z.push(".quick-input-message a"),this.getUI().widget){if(wn(R.target,this.getUI().widget))break;z.push(".quick-input-html-widget")}const G=e.querySelectorAll(z.join(", "));R.shiftKey&&R.target===G[0]?($e.stop(R,!0),O.clearFocus()):!R.shiftKey&&wn(R.target,G[G.length-1])&&($e.stop(R,!0),G[0].focus())}break;case 10:R.ctrlKey&&($e.stop(R,!0),this.getUI().list.toggleHover());break}})),this.ui={container:e,styleSheet:t,leftActionBar:o,titleBar:i,title:r,description1:k,description2:d,widget:D,rightActionBar:a,checkAll:c,inputContainer:u,filterContainer:h,inputBox:f,visibleCountContainer:g,visibleCount:p,countContainer:_,count:v,okContainer:b,ok:y,message:L,customButtonContainer:w,customButton:S,list:O,progressBar:x,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:R=>this.show(R),hide:()=>this.hide(),setVisibilities:R=>this.setVisibilities(R),setEnabled:R=>this.setEnabled(R),setContextKey:R=>this.options.setContextKey(R),linkOpenerDelegate:R=>this.options.linkOpenerDelegate(R)},this.updateStyles(),this.ui}pick(e,t={},i=rn.None){return new Promise((s,o)=>{let r=d=>{var u;r=s,(u=t.onKeyMods)===null||u===void 0||u.call(t,a.keyMods),s(d)};if(i.isCancellationRequested){r(void 0);return}const a=this.createQuickPick();let l;const c=[a,a.onDidAccept(()=>{if(a.canSelectMany)r(a.selectedItems.slice()),a.hide();else{const d=a.activeItems[0];d&&(r(d),a.hide())}}),a.onDidChangeActive(d=>{const u=d[0];u&&t.onDidFocus&&t.onDidFocus(u)}),a.onDidChangeSelection(d=>{if(!a.canSelectMany){const u=d[0];u&&(r(u),a.hide())}}),a.onDidTriggerItemButton(d=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton(Object.assign(Object.assign({},d),{removeItem:()=>{const u=a.items.indexOf(d.item);if(u!==-1){const h=a.items.slice(),f=h.splice(u,1),g=a.activeItems.filter(_=>_!==f[0]),p=a.keepScrollPosition;a.keepScrollPosition=!0,a.items=h,g&&(a.activeItems=g),a.keepScrollPosition=p}}}))),a.onDidTriggerSeparatorButton(d=>{var u;return(u=t.onDidTriggerSeparatorButton)===null||u===void 0?void 0:u.call(t,d)}),a.onDidChangeValue(d=>{l&&!d&&(a.activeItems.length!==1||a.activeItems[0]!==l)&&(a.activeItems=[l])}),i.onCancellationRequested(()=>{a.hide()}),a.onDidHide(()=>{Ft(c),r(void 0)})];a.title=t.title,a.canSelectMany=!!t.canPickMany,a.placeholder=t.placeHolder,a.ignoreFocusOut=!!t.ignoreFocusLost,a.matchOnDescription=!!t.matchOnDescription,a.matchOnDetail=!!t.matchOnDetail,a.matchOnLabel=t.matchOnLabel===void 0||t.matchOnLabel,a.autoFocusOnList=t.autoFocusOnList===void 0||t.autoFocusOnList,a.quickNavigate=t.quickNavigate,a.hideInput=!!t.hideInput,a.contextKey=t.contextKey,a.busy=!0,Promise.all([e,t.activeItem]).then(([d,u])=>{l=u,a.busy=!1,a.items=d,a.canSelectMany&&(a.selectedItems=d.filter(h=>h.type!=="separator"&&h.picked)),l&&(a.activeItems=[l])}),a.show(),Promise.resolve(e).then(void 0,d=>{o(d),a.hide()})})}createQuickPick(){const e=this.getUI();return new Iv(e)}createInputBox(){const e=this.getUI();return new NEe(e)}show(e){const t=this.getUI();this.onShowEmitter.fire();const i=this.controller;this.controller=e,i==null||i.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",ls(t.widget),t.rightActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(_i.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),ls(t.message),t.progressBar.stop(),t.list.setElements([]),t.list.matchOnDescription=!1,t.list.matchOnDetail=!1,t.list.matchOnLabel=!0,t.list.sortByLabel=!0,t.ignoreFocusOut=!1,t.inputBox.toggles=void 0;const s=this.options.backKeybindingLabel();BN.tooltip=s?m("quickInput.backWithKeybinding","Back ({0})",s):m("quickInput.back","Back"),t.container.style.display="",this.updateLayout(),t.inputBox.setFocus()}setVisibilities(e){const t=this.getUI();t.title.style.display=e.title?"":"none",t.description1.style.display=e.description&&(e.inputBox||e.checkAll)?"":"none",t.description2.style.display=e.description&&!(e.inputBox||e.checkAll)?"":"none",t.checkAll.style.display=e.checkAll?"":"none",t.inputContainer.style.display=e.inputBox?"":"none",t.filterContainer.style.display=e.inputBox?"":"none",t.visibleCountContainer.style.display=e.visibleCount?"":"none",t.countContainer.style.display=e.count?"":"none",t.okContainer.style.display=e.ok?"":"none",t.customButtonContainer.style.display=e.customButton?"":"none",t.message.style.display=e.message?"":"none",t.progressBar.getContainer().style.display=e.progressBar?"":"none",t.list.display(!!e.list),t.container.classList.toggle("show-checkboxes",!!e.checkBox),t.container.classList.toggle("hidden-input",!e.inputBox&&!e.description),this.updateLayout()}setEnabled(e){if(e!==this.enabled){this.enabled=e;for(const t of this.getUI().leftActionBar.viewItems)t.action.enabled=e;for(const t of this.getUI().rightActionBar.viewItems)t.action.enabled=e;this.getUI().checkAll.disabled=!e,this.getUI().inputBox.enabled=e,this.getUI().ok.enabled=e,this.getUI().list.enabled=e}}hide(e){var t,i,s;const o=this.controller;if(!o)return;const r=!wn(document.activeElement,(i=(t=this.ui)===null||t===void 0?void 0:t.container)!==null&&i!==void 0?i:null);if(this.controller=null,this.onHideEmitter.fire(),this.getUI().container.style.display="none",!r){let a=this.previousFocusElement;for(;a&&!a.offsetParent;)a=(s=a.parentElement)!==null&&s!==void 0?s:void 0;a!=null&&a.offsetParent?(a.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}o.didHide(e)}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui&&this.isDisplayed()){this.ui.container.style.top=`${this.titleBarOffset}px`;const e=this.ui.container.style,t=Math.min(this.dimension.width*.62,OD.MAX_WIDTH);e.width=t+"px",e.marginLeft="-"+t/2+"px",this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&this.dimension.height*.4)}}applyStyles(e){this.styles=e,this.updateStyles()}updateStyles(){if(this.ui){const{quickInputTitleBackground:e,quickInputBackground:t,quickInputForeground:i,widgetBorder:s,widgetShadow:o}=this.styles.widget;this.ui.titleBar.style.backgroundColor=e??"",this.ui.container.style.backgroundColor=t??"",this.ui.container.style.color=i??"",this.ui.container.style.border=s?`1px solid ${s}`:"",this.ui.container.style.boxShadow=o?`0 0 8px 2px ${o}`:"",this.ui.list.style(this.styles.list);const r=[];this.styles.pickerGroup.pickerGroupBorder&&r.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&r.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&r.push(".quick-input-list .quick-input-list-separator-as-item { color: var(--vscode-descriptionForeground); }"),(this.styles.keybindingLabel.keybindingLabelBackground||this.styles.keybindingLabel.keybindingLabelBorder||this.styles.keybindingLabel.keybindingLabelBottomBorder||this.styles.keybindingLabel.keybindingLabelShadow||this.styles.keybindingLabel.keybindingLabelForeground)&&(r.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&r.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&r.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&r.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&r.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&r.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),r.push("}"));const a=r.join(` +`);a!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=a)}}isDisplayed(){return this.ui&&this.ui.container.style.display!=="none"}}OD.MAX_WIDTH=600;var REe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},ww=function(n,e){return function(t,i){e(t,i,n)}};let WN=class extends cye{get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(MN))),this._quickAccess}constructor(e,t,i,s){super(i),this.instantiationService=e,this.contextKeyService=t,this.layoutService=s,this._onShow=this._register(new B),this._onHide=this._register(new B),this.contexts=new Map}createController(e=this.layoutService,t){const i={idPrefix:"quickInput_",container:e.container,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:o=>this.setContextKey(o),linkOpenerDelegate:o=>{this.instantiationService.invokeFunction(r=>{r.get(Dc).open(o,{allowCommands:!0,fromUserGesture:!0})})},returnFocus:()=>e.focus(),createList:(o,r,a,l,c)=>this.instantiationService.createInstance(TN,o,r,a,l,c),styles:this.computeStyles()},s=this._register(new OD(Object.assign(Object.assign({},i),t),this.themeService));return s.layout(e.dimension,e.offset.quickPickTop),this._register(e.onDidLayout(o=>s.layout(o,e.offset.quickPickTop))),this._register(s.onShow(()=>{this.resetContextKeys(),this._onShow.fire()})),this._register(s.onHide(()=>{this.resetContextKeys(),this._onHide.fire()})),s}setContextKey(e){let t;e&&(t=this.contexts.get(e),t||(t=new _e(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),!(t&&t.get())&&(this.resetContextKeys(),t==null||t.set(!0))}resetContextKeys(){this.contexts.forEach(e=>{e.get()&&e.reset()})}pick(e,t={},i=rn.None){return this.controller.pick(e,t,i)}createQuickPick(){return this.controller.createQuickPick()}createInputBox(){return this.controller.createInputBox()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:re(s7),quickInputForeground:re(Cve),quickInputTitleBackground:re(Sve),widgetBorder:re(jj),widgetShadow:re(Jl)},inputBox:ux,toggle:dx,countBadge:PG,button:zke,progressBar:Hke,keybindingLabel:Vke,list:ay({listBackground:s7,listFocusBackground:AT,listFocusForeground:ET,listInactiveFocusForeground:ET,listInactiveSelectionIconForeground:Zj,listInactiveFocusBackground:AT,listFocusOutline:qt,listInactiveFocusOutline:qt}),pickerGroup:{pickerGroupBorder:re(xve),pickerGroupForeground:re(qj)}}}};WN=REe([ww(0,vt),ww(1,et),ww(2,ro),ww(3,d0)],WN);var uK=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},op=function(n,e){return function(t,i){e(t,i,n)}};let VN=class extends WN{constructor(e,t,i,s,o){super(t,i,s,new QT(e.getContainerDomNode(),o)),this.host=void 0;const r=Wm.get(e);if(r){const a=r.widget;this.host={_serviceBrand:void 0,get hasContainer(){return!0},get container(){return a.getDomNode()},get dimension(){return e.getLayoutInfo()},get onDidLayout(){return e.onDidLayoutChange},focus:()=>e.focus(),offset:{top:0,quickPickTop:0}}}else this.host=void 0}createController(){return super.createController(this.host)}};VN=uK([op(1,vt),op(2,et),op(3,ro),op(4,jt)],VN);let zN=class{get activeService(){const e=this.codeEditorService.getFocusedCodeEditor();if(!e)throw new Error("Quick input service needs a focused editor to work.");let t=this.mapEditorToService.get(e);if(!t){const i=t=this.instantiationService.createInstance(VN,e);this.mapEditorToService.set(e,t),pm(e.onDidDispose)(()=>{i.dispose(),this.mapEditorToService.delete(e)})}return t}get quickAccess(){return this.activeService.quickAccess}constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}pick(e,t={},i=rn.None){return this.activeService.pick(e,t,i)}createQuickPick(){return this.activeService.createQuickPick()}createInputBox(){return this.activeService.createInputBox()}};zN=uK([op(0,vt),op(1,jt)],zN);class Wm{static get(e){return e.getContribution(Wm.ID)}constructor(e){this.editor=e,this.widget=new FD(this.editor)}dispose(){this.widget.dispose()}}Wm.ID="editor.controller.quickInput";class FD{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return FD.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}}FD.ID="editor.contrib.quickInputWidget";Ir(Wm.ID,Wm,4);class MEe{constructor(e,t,i,s,o){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=i,this.foreground=s,this.background=o}}function PEe(n){if(!n||!Array.isArray(n))return[];const e=[];let t=0;for(let i=0,s=n.length;i{const h=zEe(d.token,u.token);return h!==0?h:d.index-u.index});let t=0,i="000000",s="ffffff";for(;n.length>=1&&n[0].token==="";){const d=n.shift();d.fontStyle!==-1&&(t=d.fontStyle),d.foreground!==null&&(i=d.foreground),d.background!==null&&(s=d.background)}const o=new BEe;for(const d of e)o.getId(d);const r=o.getId(i),a=o.getId(s),l=new SP(t,r,a),c=new xP(l);for(let d=0,u=n.length;d"u"){const s=this._match(t),o=VEe(t);i=(s.metadata|o<<8)>>>0,this._cache.set(t,i)}return(i|e<<0)>>>0}}const WEe=/\b(comment|string|regex|regexp)\b/;function VEe(n){const e=n.match(WEe);if(!e)return 0;switch(e[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"regexp":return 3}throw new Error("Unexpected match for standard token type!")}function zEe(n,e){return ne?1:0}class SP{constructor(e,t,i){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=i,this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}clone(){return new SP(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,i){e!==-1&&(this._fontStyle=e),t!==0&&(this._foreground=t),i!==0&&(this._background=i),this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}}class xP{constructor(e){this._themeTrieElementBrand=void 0,this._mainRule=e,this._children=new Map}match(e){if(e==="")return this._mainRule;const t=e.indexOf(".");let i,s;t===-1?(i=e,s=""):(i=e.substring(0,t),s=e.substring(t+1));const o=this._children.get(i);return typeof o<"u"?o.match(s):this._mainRule}insert(e,t,i,s){if(e===""){this._mainRule.acceptOverwrite(t,i,s);return}const o=e.indexOf(".");let r,a;o===-1?(r=e,a=""):(r=e.substring(0,o),a=e.substring(o+1));let l=this._children.get(r);typeof l>"u"&&(l=new xP(this._mainRule.clone()),this._children.set(r,l)),l.insert(a,t,i,s)}}function HEe(n){const e=[];for(let t=1,i=n.length;t({format:s.format,location:s.location.toString()}))}}n.toJSONObject=e;function t(i){const s=o=>Rs(o)?o:void 0;if(i&&Array.isArray(i.src)&&i.src.every(o=>Rs(o.format)&&Rs(o.location)))return{weight:s(i.weight),style:s(i.style),src:i.src.map(o=>({format:o.format,location:Ue.parse(o.location)}))}}n.fromJSONObject=t})(k8||(k8={}));class KEe{constructor(){this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:m("iconDefinition.fontId","The id of the font to use. If not set, the font that is defined first is used.")},fontCharacter:{type:"string",description:m("iconDefinition.fontCharacter","The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${Te.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,i,s){const o=this.iconsById[e];if(o){if(i&&!o.description){o.description=i,this.iconSchema.properties[e].markdownDescription=`${i} $(${e})`;const l=this.iconReferenceSchema.enum.indexOf(e);l!==-1&&(this.iconReferenceSchema.enumDescriptions[l]=i),this._onDidChange.fire()}return o}const r={id:e,description:i,defaults:t,deprecationMessage:s};this.iconsById[e]=r;const a={$ref:"#/definitions/icons"};return s&&(a.deprecationMessage=s),i&&(a.markdownDescription=`${i}: $(${e})`),this.iconSchema.properties[e]=a,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(i||""),this._onDidChange.fire(),{id:e}}getIcons(){return Object.keys(this.iconsById).map(e=>this.iconsById[e])}getIcon(e){return this.iconsById[e]}getIconSchema(){return this.iconSchema}toString(){const e=(o,r)=>o.id.localeCompare(r.id),t=o=>{for(;Te.isThemeIcon(o.defaults);)o=this.iconsById[o.defaults.id];return`codicon codicon-${o?o.id:""}`},i=[];i.push("| preview | identifier | default codicon ID | description"),i.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const s=Object.keys(this.iconsById).map(o=>this.iconsById[o]);for(const o of s.filter(r=>!!r.description).sort(e))i.push(`||${o.id}|${Te.isThemeIcon(o.defaults)?o.defaults.id:o.id}|${o.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const o of s.filter(r=>!Te.isThemeIcon(r.defaults)).sort(e))i.push(`||${o.id}|`);return i.join(` +`)}}const sg=new KEe;pn.add(GEe.IconContribution,sg);function Zi(n,e,t,i){return sg.registerIcon(n,e,t,i)}function fK(){return sg}function YEe(){const n=DU();for(const e in n){const t="\\"+n[e].toString(16);sg.registerIcon(e,{fontCharacter:t})}}YEe();const gK="vscode://schemas/icons",pK=pn.as(nD.JSONContribution);pK.registerSchema(gK,sg.getIconSchema());const E8=new Li(()=>pK.notifySchemaChanged(gK),200);sg.onDidChange(()=>{E8.isScheduled()||E8.schedule()});const ZEe=Zi("widget-close",se.close,m("widgetClose","Icon for the close action in widgets."));Zi("goto-previous-location",se.arrowUp,m("previousChangeIcon","Icon for goto previous editor location."));Zi("goto-next-location",se.arrowDown,m("nextChangeIcon","Icon for goto next editor location."));Te.modify(se.sync,"spin");Te.modify(se.loading,"spin");function XEe(n){const e=new pe,t=e.add(new B),i=fK();return e.add(i.onDidChange(()=>t.fire())),n&&e.add(n.onDidProductIconThemeChange(()=>t.fire())),{dispose:()=>e.dispose(),onDidChange:t.event,getCSS(){const s=n?n.getProductIconTheme():new mK,o={},r=l=>{const c=s.getIcon(l);if(!c)return;const d=c.font;return d?(o[d.id]=d.definition,`.codicon-${l.id}:before { content: '${c.fontCharacter}'; font-family: ${d9(d.id)}; }`):`.codicon-${l.id}:before { content: '${c.fontCharacter}'; }`},a=[];for(const l of i.getIcons()){const c=r(l);c&&a.push(c)}for(const l in o){const c=o[l],d=c.weight?`font-weight: ${c.weight};`:"",u=c.style?`font-style: ${c.style};`:"",h=c.src.map(f=>`${nu(f.location)} format('${f.format}')`).join(", ");a.push(`@font-face { src: ${h}; font-family: ${d9(l)};${d}${u} font-display: block; }`)}return a.join(` +`)}}}class mK{getIcon(e){const t=fK();let i=e.defaults;for(;Te.isThemeIcon(i);){const s=t.getIcon(i.id);if(!s)return;i=s.defaults}return i}}const id="vs",tb="vs-dark",Rp="hc-black",Mp="hc-light",_K=pn.as(Uj.ColorContribution),QEe=pn.as(aq.ThemingContribution);class bK{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(EC(e)?this.id=e:this.id=i+" "+e,this.themeName=e):(this.id=i,this.themeName=i),this.colors=null,this.defaultColors=Object.create(null),this._tokenTheme=null}get base(){return this.themeData.base}notifyBaseUpdated(){this.themeData.inherit&&(this.colors=null,this._tokenTheme=null)}getColors(){if(!this.colors){const e=new Map;for(const t in this.themeData.colors)e.set(t,H.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=HN(this.themeData.base);for(const i in t.colors)e.has(i)||e.set(i,H.fromHex(t.colors[i]))}this.colors=e}return this.colors}getColor(e,t){const i=this.getColors().get(e);if(i)return i;if(t!==!1)return this.getDefault(e)}getDefault(e){let t=this.defaultColors[e];return t||(t=_K.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case id:return Oo.LIGHT;case Rp:return Oo.HIGH_CONTRAST_DARK;case Mp:return Oo.HIGH_CONTRAST_LIGHT;default:return Oo.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const o=HN(this.themeData.base);e=o.rules,o.encodedTokensColors&&(t=o.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],s=this.themeData.colors["editor.background"];if(i||s){const o={token:""};i&&(o.foreground=i),s&&(o.background=s),e.push(o)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=hK.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const o=this.tokenTheme._match([e].concat(t).join(".")).metadata,r=Us.getForeground(o),a=Us.getFontStyle(o);return{foreground:r,italic:!!(a&1),bold:!!(a&2),underline:!!(a&4),strikethrough:!!(a&8)}}}function EC(n){return n===id||n===tb||n===Rp||n===Mp}function HN(n){switch(n){case id:return $Ee;case tb:return UEe;case Rp:return jEe;case Mp:return qEe}}function Cw(n){const e=HN(n);return new bK(n,e)}class JEe extends Y{constructor(){super(),this._onColorThemeChange=this._register(new B),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new B),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new mK,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(id,Cw(id)),this._knownThemes.set(tb,Cw(tb)),this._knownThemes.set(Rp,Cw(Rp)),this._knownThemes.set(Mp,Cw(Mp));const e=this._register(XEe(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS} +${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(id),this._onOSSchemeChanged(),this._register(e.onDidChange(()=>{this._codiconCSS=e.getCSS(),this._updateCSS()})),RU("(forced-colors: active)",()=>{this._onOSSchemeChanged()})}registerEditorContainer(e){return oT(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=Dr(void 0,e=>{e.className="monaco-colors",e.textContent=this._allCSS}),this._styleElements.push(this._globalStyleElement)),Y.None}_registerShadowDomContainer(e){const t=Dr(e,i=>{i.className="monaco-colors",i.textContent=this._allCSS});return this._styleElements.push(t),{dispose:()=>{for(let i=0;i{i.base===e&&i.notifyBaseUpdated()}),this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setColorMapOverride(e){this._colorMapOverride=e,this._updateThemeOrColorMap()}setTheme(e){let t;this._knownThemes.has(e)?t=this._knownThemes.get(e):t=this._knownThemes.get(id),this._updateActualTheme(t)}_updateActualTheme(e){!e||this._theme===e||(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=window.matchMedia("(forced-colors: active)").matches;if(e!==lc(this._theme.type)){let t;fD(this._theme.type)?t=e?Rp:tb:t=e?Mp:id,this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],t={},i={addRule:r=>{t[r]||(e.push(r),t[r]=!0)}};QEe.getThemingParticipants().forEach(r=>r(this._theme,i,this._environment));const s=[];for(const r of _K.getColors()){const a=this._theme.getColor(r.id,!0);a&&s.push(`${u3(r.id)}: ${a.toString()};`)}i.addRule(`.monaco-editor, .monaco-diff-editor { ${s.join(` +`)} }`);const o=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(HEe(o)),this._themeCSS=e.join(` +`),this._updateCSS(),Si.setColorMap(o),this._onColorThemeChange.fire(this._theme)}_updateCSS(){this._allCSS=`${this._codiconCSS} +${this._themeCSS}`,this._styleElements.forEach(e=>e.textContent=this._allCSS)}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}}const Nr=rt("themeService");var eAe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},hE=function(n,e){return function(t,i){e(t,i,n)}};let $N=class extends Y{constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new B,this._onDidChangeReducedMotion=new B,this._accessibilityModeEnabledContext=Vbe.bindTo(this._contextKeyService);const s=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration(r=>{r.affectsConfiguration("editor.accessibilitySupport")&&(s(),this._onDidChangeScreenReaderOptimized.fire()),r.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())})),s(),this._register(this.onDidChangeScreenReaderOptimized(()=>s()));const o=window.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=o.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this.initReducedMotionListeners(o)}initReducedMotionListeners(e){if(!this._layoutService.hasContainer)return;this._register(K(e,"change",()=>{this._systemMotionReduced=e.matches,this._configMotionReduced==="auto"&&this._onDidChangeReducedMotion.fire()}));const t=()=>{const i=this.isMotionReduced();this._layoutService.container.classList.toggle("reduce-motion",i),this._layoutService.container.classList.toggle("enable-motion",!i)};t(),this._register(this.onDidChangeReducedMotion(()=>t()))}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return e==="on"||e==="auto"&&this._accessibilitySupport===2}get onDidChangeReducedMotion(){return this._onDidChangeReducedMotion.event}isMotionReduced(){const e=this._configMotionReduced;return e==="on"||e==="auto"&&this._systemMotionReduced}getAccessibilitySupport(){return this._accessibilitySupport}};$N=eAe([hE(0,et),hE(1,d0),hE(2,ii)],$N);var BD=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Ef=function(n,e){return function(t,i){e(t,i,n)}},Ng,jc;let UN=class{constructor(e,t){this._commandService=e,this._hiddenStates=new Sx(t)}createMenu(e,t,i){return new qN(e,this._hiddenStates,Object.assign({emitEventsForSubmenuChanges:!1,eventDebounceDelay:50},i),this._commandService,t)}resetHiddenStates(e){this._hiddenStates.reset(e)}};UN=BD([Ef(0,fs),Ef(1,tg)],UN);let Sx=Ng=class{constructor(e){this._storageService=e,this._disposables=new pe,this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const t=e.get(Ng._key,0,"{}");this._data=JSON.parse(t)}catch{this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(0,Ng._key,this._disposables)(()=>{if(!this._ignoreChangeEvent)try{const t=e.get(Ng._key,0,"{}");this._data=JSON.parse(t)}catch(t){console.log("FAILED to read storage after UPDATE",t)}this._onDidChange.fire()}))}dispose(){this._onDidChange.dispose(),this._disposables.dispose()}_isHiddenByDefault(e,t){var i;return(i=this._hiddenByDefaultCache.get(`${e.id}/${t}`))!==null&&i!==void 0?i:!1}setDefaultState(e,t,i){this._hiddenByDefaultCache.set(`${e.id}/${t}`,i)}isHidden(e,t){var i,s;const o=this._isHiddenByDefault(e,t),r=(s=(i=this._data[e.id])===null||i===void 0?void 0:i.includes(t))!==null&&s!==void 0?s:!1;return o?!r:r}updateHidden(e,t,i){this._isHiddenByDefault(e,t)&&(i=!i);const o=this._data[e.id];if(i)o?o.indexOf(t)<0&&o.push(t):this._data[e.id]=[t];else if(o){const r=o.indexOf(t);r>=0&&Jhe(o,r),o.length===0&&delete this._data[e.id]}this._persist()}reset(e){if(e===void 0)this._data=Object.create(null),this._persist();else{for(const{id:t}of e)this._data[t]&&delete this._data[t];this._persist()}}_persist(){try{this._ignoreChangeEvent=!0;const e=JSON.stringify(this._data);this._storageService.store(Ng._key,e,0,0)}finally{this._ignoreChangeEvent=!1}}};Sx._key="menu.hiddenCommands";Sx=Ng=BD([Ef(0,tg)],Sx);let jN=jc=class{constructor(e,t,i,s,o){this._id=e,this._hiddenStates=t,this._collectContextKeysForSubmenus=i,this._commandService=s,this._contextKeyService=o,this._menuGroups=[],this._structureContextKeys=new Set,this._preconditionContextKeys=new Set,this._toggledContextKeys=new Set,this.refresh()}get structureContextKeys(){return this._structureContextKeys}get preconditionContextKeys(){return this._preconditionContextKeys}get toggledContextKeys(){return this._toggledContextKeys}refresh(){this._menuGroups.length=0,this._structureContextKeys.clear(),this._preconditionContextKeys.clear(),this._toggledContextKeys.clear();const e=cr.getMenuItems(this._id);let t;e.sort(jc._compareMenuItems);for(const i of e){const s=i.group||"";(!t||t[0]!==s)&&(t=[s,[]],this._menuGroups.push(t)),t[1].push(i),this._collectContextKeys(i)}}_collectContextKeys(e){if(jc._fillInKbExprKeys(e.when,this._structureContextKeys),l_(e)){if(e.command.precondition&&jc._fillInKbExprKeys(e.command.precondition,this._preconditionContextKeys),e.command.toggled){const t=e.command.toggled.condition||e.command.toggled;jc._fillInKbExprKeys(t,this._toggledContextKeys)}}else this._collectContextKeysForSubmenus&&cr.getMenuItems(e.submenu).forEach(this._collectContextKeys,this)}createActionGroups(e){const t=[];for(const i of this._menuGroups){const[s,o]=i,r=[];for(const a of o)if(this._contextKeyService.contextMatchesRules(a.when)){const l=l_(a);l&&this._hiddenStates.setDefaultState(this._id,a.command.id,!!a.isHiddenByDefault);const c=tAe(this._id,l?a.command:a,this._hiddenStates);if(l)r.push(new il(a.command,a.alt,e,c,this._contextKeyService,this._commandService));else{const d=new jc(a.submenu,this._hiddenStates,this._collectContextKeysForSubmenus,this._commandService,this._contextKeyService).createActionGroups(e),u=Rn.join(...d.map(h=>h[1]));u.length>0&&r.push(new LS(a,c,u))}}r.length>0&&t.push([s,r])}return t}static _fillInKbExprKeys(e,t){if(e)for(const i of e.keys())t.add(i)}static _compareMenuItems(e,t){const i=e.group,s=t.group;if(i!==s){if(i){if(!s)return-1}else return 1;if(i==="navigation")return-1;if(s==="navigation")return 1;const a=i.localeCompare(s);if(a!==0)return a}const o=e.order||0,r=t.order||0;return or?1:jc._compareTitles(l_(e)?e.command.title:e.title,l_(t)?t.command.title:t.title)}static _compareTitles(e,t){const i=typeof e=="string"?e:e.original,s=typeof t=="string"?t:t.original;return i.localeCompare(s)}};jN=jc=BD([Ef(3,fs),Ef(4,et)],jN);let qN=class{constructor(e,t,i,s,o){this._disposables=new pe,this._menuInfo=new jN(e,t,i.emitEventsForSubmenuChanges,s,o);const r=new Li(()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})},i.eventDebounceDelay);this._disposables.add(r),this._disposables.add(cr.onDidChangeMenu(d=>{d.has(e)&&r.schedule()}));const a=this._disposables.add(new pe),l=d=>{let u=!1,h=!1,f=!1;for(const g of d)if(u=u||g.isStructuralChange,h=h||g.isEnablementChange,f=f||g.isToggleChange,u&&h&&f)break;return{menu:this,isStructuralChange:u,isEnablementChange:h,isToggleChange:f}},c=()=>{a.add(o.onDidChangeContext(d=>{const u=d.affectsSome(this._menuInfo.structureContextKeys),h=d.affectsSome(this._menuInfo.preconditionContextKeys),f=d.affectsSome(this._menuInfo.toggledContextKeys);(u||h||f)&&this._onDidChange.fire({menu:this,isStructuralChange:u,isEnablementChange:h,isToggleChange:f})})),a.add(t.onDidChange(d=>{this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!1,isToggleChange:!1})}))};this._onDidChange=new pU({onWillAddFirstListener:c,onDidRemoveLastListener:a.clear.bind(a),delay:i.eventDebounceDelay,merge:l}),this.onDidChange=this._onDidChange.event}getActions(e){return this._menuInfo.createActionGroups(e)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}};qN=BD([Ef(3,fs),Ef(4,et)],qN);function tAe(n,e,t){const i=jpe(e)?e.submenu.id:e.id,s=typeof e.title=="string"?e.title:e.title.value,o=O_({id:`hide/${n.id}/${i}`,label:m("hide.label","Hide '{0}'",s),run(){t.updateHidden(n,i,!0)}}),r=O_({id:`toggle/${n.id}/${i}`,label:s,get checked(){return!t.isHidden(n,i)},run(){t.updateHidden(n,i,!!this.checked)}});return{hide:o,toggle:r,get isHidden(){return!r.checked}}}var iAe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},A8=function(n,e){return function(t,i){e(t,i,n)}},Yu=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let GN=class extends Y{constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],(bc||MU)&&this.installWebKitWriteTextWorkaround()}installWebKitWriteTextWorkaround(){const e=()=>{const t=new hj;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=t,navigator.clipboard.write([new ClipboardItem({"text/plain":t.p})]).catch(i=>Yu(this,void 0,void 0,function*(){(!(i instanceof Error)||i.name!=="NotAllowedError"||!t.isRejected)&&this.logService.error(i)}))};this.layoutService.hasContainer&&(this._register(K(this.layoutService.container,"click",e)),this._register(K(this.layoutService.container,"keydown",e)))}writeText(e,t){return Yu(this,void 0,void 0,function*(){if(t){this.mapTextToType.set(t,e);return}if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(e);try{return yield navigator.clipboard.writeText(e)}catch(o){console.error(o)}const i=document.activeElement,s=document.body.appendChild(ye("textarea",{"aria-hidden":!0}));s.style.height="1px",s.style.width="1px",s.style.position="absolute",s.value=e,s.focus(),s.select(),document.execCommand("copy"),i instanceof HTMLElement&&i.focus(),document.body.removeChild(s)})}readText(e){return Yu(this,void 0,void 0,function*(){if(e)return this.mapTextToType.get(e)||"";try{return yield navigator.clipboard.readText()}catch(t){return console.error(t),""}})}readFindText(){return Yu(this,void 0,void 0,function*(){return this.findText})}writeFindText(e){return Yu(this,void 0,void 0,function*(){this.findText=e})}writeResources(e){return Yu(this,void 0,void 0,function*(){this.resources=e})}readResources(){return Yu(this,void 0,void 0,function*(){return this.resources})}};GN=iAe([A8(0,d0),A8(1,Sc)],GN);const gy=rt("clipboardService");var nAe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},sAe=function(n,e){return function(t,i){e(t,i,n)}};const ib="data-keybinding-context";class LP{constructor(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}get value(){return Object.assign({},this._value)}setValue(e,t){return this._value[e]!==t?(this._value[e]=t,!0):!1}removeValue(e){return e in this._value?(delete this._value[e],!0):!1}getValue(e){const t=this._value[e];return typeof t>"u"&&this._parent?this._parent.getValue(e):t}}class Vm extends LP{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}Vm.INSTANCE=new Vm;class Tv extends LP{constructor(e,t,i){super(e,null),this._configurationService=t,this._values=eb.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration(s=>{if(s.source===7){const o=Array.from(this._values,([r])=>r);this._values.clear(),i.fire(new T8(o))}else{const o=[];for(const r of s.affectedKeys){const a=`config.${r}`,l=this._values.findSuperstr(a);l!==void 0&&(o.push(...ut.map(l,([c])=>c)),this._values.deleteSuperstr(a)),this._values.has(a)&&(o.push(a),this._values.delete(a))}i.fire(new T8(o))}})}dispose(){this._listener.dispose()}getValue(e){if(e.indexOf(Tv._keyPrefix)!==0)return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(Tv._keyPrefix.length),i=this._configurationService.getValue(t);let s;switch(typeof i){case"number":case"boolean":case"string":s=i;break;default:Array.isArray(i)?s=JSON.stringify(i):s=i}return this._values.set(e,s),s}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}}Tv._keyPrefix="config.";class oAe{constructor(e,t,i){this._service=e,this._key=t,this._defaultValue=i,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){typeof this._defaultValue>"u"?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class I8{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class T8{constructor(e){this.keys=e}affectsSome(e){for(const t of this.keys)if(e.has(t))return!0;return!1}allKeysContainedIn(e){return this.keys.every(t=>e.has(t))}}class rAe{constructor(e){this.events=e}affectsSome(e){for(const t of this.events)if(t.affectsSome(e))return!0;return!1}allKeysContainedIn(e){return this.events.every(t=>t.allKeysContainedIn(e))}}function aAe(n,e){return n.allKeysContainedIn(new Set(Object.keys(e)))}class vK extends Y{constructor(e){super(),this._onDidChangeContext=this._register(new Bb({merge:t=>new rAe(t)})),this.onDidChangeContext=this._onDidChangeContext.event,this._isDisposed=!1,this._myContextId=e}createKey(e,t){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new oAe(this,e,t)}bufferChangeEvents(e){this._onDidChangeContext.pause();try{e()}finally{this._onDidChangeContext.resume()}}createScoped(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new lAe(this,e)}contextMatchesRules(e){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");const t=this.getContextValuesContainer(this._myContextId);return e?e.evaluate(t):!0}getContextKeyValue(e){if(!this._isDisposed)return this.getContextValuesContainer(this._myContextId).getValue(e)}setContext(e,t){if(this._isDisposed)return;const i=this.getContextValuesContainer(this._myContextId);i&&i.setValue(e,t)&&this._onDidChangeContext.fire(new I8(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new I8(e))}getContext(e){return this._isDisposed?Vm.INSTANCE:this.getContextValuesContainer(cAe(e))}dispose(){super.dispose(),this._isDisposed=!0}}let KN=class extends vK{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0;const t=this._register(new Tv(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t)}getContextValuesContainer(e){return this._isDisposed?Vm.INSTANCE:this._contexts.get(e)||Vm.INSTANCE}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ContextKeyService has been disposed");const t=++this._lastContextId;return this._contexts.set(t,new LP(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};KN=nAe([sAe(0,ii)],KN);class lAe extends vK{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new sa),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(ib)){let i="";this._domNode.classList&&(i=Array.from(this._domNode.classList.values()).join(", ")),console.error(`Element already has context attribute${i?": "+i:""}`)}this._domNode.setAttribute(ib,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext(e=>{const i=this._parent.getContextValuesContainer(this._myContextId).value;aAe(e,i)||this._onDidChangeContext.fire(e)})}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(ib),super.dispose())}getContextValuesContainer(e){return this._isDisposed?Vm.INSTANCE:this._parent.getContextValuesContainer(e)}createChildContext(e=this._myContextId){if(this._isDisposed)throw new Error("ScopedContextKeyService has been disposed");return this._parent.createChildContext(e)}disposeContext(e){this._isDisposed||this._parent.disposeContext(e)}}function cAe(n){for(;n;){if(n.hasAttribute(ib)){const e=n.getAttribute(ib);return e?parseInt(e,10):NaN}n=n.parentElement}return 0}function dAe(n,e,t){n.get(et).createKey(String(e),uAe(t))}function uAe(n){return nU(n,e=>{if(typeof e=="object"&&e.$mid===1)return Ue.revive(e).toString();if(e instanceof Ue)return e.toString()})}Yt.registerCommand("_setContext",dAe);Yt.registerCommand({id:"getContextKeyInfo",handler(){return[..._e.all()].sort((n,e)=>n.key.localeCompare(e.key))},description:{description:m("getContextKeyInfo","A command that returns information about context keys"),args:[]}});Yt.registerCommand("_generateContextKeyInfo",function(){const n=[],e=new Set;for(const t of _e.all())e.has(t.key)||(e.add(t.key),n.push(t));n.sort((t,i)=>t.key.localeCompare(i.key)),console.log(JSON.stringify(n,void 0,2))});let hAe=class{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}};class N8{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){const e=[];for(const t of this._nodes.values())t.outgoing.size===0&&e.push(t);return e}insertEdge(e,t){const i=this.lookupOrInsertNode(e),s=this.lookupOrInsertNode(t);i.outgoing.set(s.key,s),s.incoming.set(i.key,i)}removeNode(e){const t=this._hashFn(e);this._nodes.delete(t);for(const i of this._nodes.values())i.outgoing.delete(t),i.incoming.delete(t)}lookupOrInsertNode(e){const t=this._hashFn(e);let i=this._nodes.get(t);return i||(i=new hAe(t,e),this._nodes.set(t,i)),i}isEmpty(){return this._nodes.size===0}toString(){const e=[];for(const[t,i]of this._nodes)e.push(`${t} (-> incoming)[${[...i.incoming.keys()].join(", ")}] (outgoing ->)[${[...i.outgoing.keys()].join(",")}] `);return e.join(` -`)}findCycleSlow(){for(const[e,t]of this._nodes){const i=new Set([e]),s=this._findCycle(t,i);if(s)return s}}_findCycle(e,t){for(const[i,s]of e.outgoing){if(t.has(i))return[...t,i].join(" -> ");t.add(i);const o=this._findCycle(s,t);if(o)return o;t.delete(i)}}}const GEe=!1;class F8 extends Error{constructor(e){var t;super("cyclic dependency between services"),this.message=(t=e.findCycleSlow())!==null&&t!==void 0?t:`UNABLE to detect cycle, dumping graph: -${e.toString()}`}}class Tx{constructor(e=new DD,t=!1,i,s=GEe){var o;this._services=e,this._strict=t,this._parent=i,this._enableTracing=s,this._activeInstantiations=new Set,this._services.set(yt,this),this._globalGraph=s?(o=i==null?void 0:i._globalGraph)!==null&&o!==void 0?o:new O8(r=>r):void 0}createChild(e){return new Tx(e,this._strict,this,this._enableTracing)}invokeFunction(e,...t){const i=Ss.traceInvocation(this._enableTracing,e);let s=!1;try{return e({get:r=>{if(s)throw I4("service accessor is only valid during the invocation of its target method");const a=this._getOrCreateServiceInstance(r,i);if(!a)throw new Error(`[invokeFunction] unknown service '${r}'`);return a}},...t)}finally{s=!0,i.stop()}}createInstance(e,...t){let i,s;return e instanceof ka?(i=Ss.traceCreation(this._enableTracing,e.ctor),s=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=Ss.traceCreation(this._enableTracing,e),s=this._createInstance(e,t,i)),i.stop(),s}_createInstance(e,t=[],i){const s=ta.getServiceDependencies(e).sort((a,l)=>a.index-l.index),o=[];for(const a of s){const l=this._getOrCreateServiceInstance(a.id,i);l||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id}.`,!1),o.push(l)}const r=s.length>0?s[0].index:t.length;if(t.length!==r){console.trace(`[createInstance] First service dependency of ${e.name} at position ${r+1} conflicts with ${t.length} static arguments`);const a=r-t.length;a>0?t=t.concat(new Array(a)):t=t.slice(0,r)}return Reflect.construct(e,t.concat(o))}_setServiceInstance(e,t){if(this._services.get(e)instanceof ka)this._services.set(e,t);else if(this._parent)this._parent._setServiceInstance(e,t);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(e){const t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));const i=this._getServiceInstanceOrDescriptor(e);return i instanceof ka?this._safeCreateAndCacheServiceInstance(e,i,t.branch(e,!0)):(t.branch(e,!1),i)}_safeCreateAndCacheServiceInstance(e,t,i){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,t,i)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,t,i){var s;const o=new O8(l=>l.id.toString());let r=0;const a=[{id:e,desc:t,_trace:i}];for(;a.length;){const l=a.pop();if(o.lookupOrInsertNode(l),r++>1e3)throw new F8(o);for(const c of ta.getServiceDependencies(l.desc.ctor)){const d=this._getServiceInstanceOrDescriptor(c.id);if(d||this._throwIfStrict(`[createInstance] ${e} depends on ${c.id} which is NOT registered.`,!0),(s=this._globalGraph)===null||s===void 0||s.insertEdge(String(l.id),String(c.id)),d instanceof ka){const u={id:c.id,desc:d,_trace:l._trace.branch(c.id,!0)};o.insertEdge(l,u),a.push(u)}}}for(;;){const l=o.roots();if(l.length===0){if(!o.isEmpty())throw new F8(o);break}for(const{data:c}of l){if(this._getServiceInstanceOrDescriptor(c.id)instanceof ka){const u=this._createServiceInstanceWithOwner(c.id,c.desc.ctor,c.desc.staticArguments,c.desc.supportsDelayedInstantiation,c._trace);this._setServiceInstance(c.id,u)}o.removeNode(c)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],s,o){if(this._services.get(e)instanceof ka)return this._createServiceInstance(e,t,i,s,o);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,i,s,o);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t,i=[],s,o){if(s){const r=new Tx(void 0,this._strict,this,this._enableTracing);r._globalGraphImplicitDependency=String(e);const a=new Map,l=new Nme(()=>{const c=r._createInstance(t,i,o);for(const[d,u]of a){const h=c[d];if(typeof h=="function")for(const f of u)h.apply(c,f)}return a.clear(),c});return new Proxy(Object.create(null),{get(c,d){if(!l.isInitialized&&typeof d=="string"&&(d.startsWith("onDid")||d.startsWith("onWill"))){let f=a.get(d);return f||(f=new ks,a.set(d,f)),(p,_,v)=>{const b=f.push([p,_,v]);return Ze(b)}}if(d in c)return c[d];const u=l.value;let h=u[d];return typeof h!="function"||(h=h.bind(u),c[d]=h),h},set(c,d,u){return l.value[d]=u,!0},getPrototypeOf(c){return t.prototype}})}else return this._createInstance(t,i,o)}_throwIfStrict(e,t){if(t&&console.warn(e),this._strict)throw new Error(e)}}class Ss{static traceInvocation(e,t){return e?new Ss(2,t.name||new Error().stack.split(` +`)}findCycleSlow(){for(const[e,t]of this._nodes){const i=new Set([e]),s=this._findCycle(t,i);if(s)return s}}_findCycle(e,t){for(const[i,s]of e.outgoing){if(t.has(i))return[...t,i].join(" -> ");t.add(i);const o=this._findCycle(s,t);if(o)return o;t.delete(i)}}}const fAe=!1;class R8 extends Error{constructor(e){var t;super("cyclic dependency between services"),this.message=(t=e.findCycleSlow())!==null&&t!==void 0?t:`UNABLE to detect cycle, dumping graph: +${e.toString()}`}}class xx{constructor(e=new vD,t=!1,i,s=fAe){var o;this._services=e,this._strict=t,this._parent=i,this._enableTracing=s,this._activeInstantiations=new Set,this._services.set(vt,this),this._globalGraph=s?(o=i==null?void 0:i._globalGraph)!==null&&o!==void 0?o:new N8(r=>r):void 0}createChild(e){return new xx(e,this._strict,this,this._enableTracing)}invokeFunction(e,...t){const i=Cs.traceInvocation(this._enableTracing,e);let s=!1;try{return e({get:r=>{if(s)throw E4("service accessor is only valid during the invocation of its target method");const a=this._getOrCreateServiceInstance(r,i);if(!a)throw new Error(`[invokeFunction] unknown service '${r}'`);return a}},...t)}finally{s=!0,i.stop()}}createInstance(e,...t){let i,s;return e instanceof La?(i=Cs.traceCreation(this._enableTracing,e.ctor),s=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=Cs.traceCreation(this._enableTracing,e),s=this._createInstance(e,t,i)),i.stop(),s}_createInstance(e,t=[],i){const s=Jr.getServiceDependencies(e).sort((a,l)=>a.index-l.index),o=[];for(const a of s){const l=this._getOrCreateServiceInstance(a.id,i);l||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id}.`,!1),o.push(l)}const r=s.length>0?s[0].index:t.length;if(t.length!==r){console.trace(`[createInstance] First service dependency of ${e.name} at position ${r+1} conflicts with ${t.length} static arguments`);const a=r-t.length;a>0?t=t.concat(new Array(a)):t=t.slice(0,r)}return Reflect.construct(e,t.concat(o))}_setServiceInstance(e,t){if(this._services.get(e)instanceof La)this._services.set(e,t);else if(this._parent)this._parent._setServiceInstance(e,t);else throw new Error("illegalState - setting UNKNOWN service instance")}_getServiceInstanceOrDescriptor(e){const t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));const i=this._getServiceInstanceOrDescriptor(e);return i instanceof La?this._safeCreateAndCacheServiceInstance(e,i,t.branch(e,!0)):(t.branch(e,!1),i)}_safeCreateAndCacheServiceInstance(e,t,i){if(this._activeInstantiations.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,t,i)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,t,i){var s;const o=new N8(l=>l.id.toString());let r=0;const a=[{id:e,desc:t,_trace:i}];for(;a.length;){const l=a.pop();if(o.lookupOrInsertNode(l),r++>1e3)throw new R8(o);for(const c of Jr.getServiceDependencies(l.desc.ctor)){const d=this._getServiceInstanceOrDescriptor(c.id);if(d||this._throwIfStrict(`[createInstance] ${e} depends on ${c.id} which is NOT registered.`,!0),(s=this._globalGraph)===null||s===void 0||s.insertEdge(String(l.id),String(c.id)),d instanceof La){const u={id:c.id,desc:d,_trace:l._trace.branch(c.id,!0)};o.insertEdge(l,u),a.push(u)}}}for(;;){const l=o.roots();if(l.length===0){if(!o.isEmpty())throw new R8(o);break}for(const{data:c}of l){if(this._getServiceInstanceOrDescriptor(c.id)instanceof La){const u=this._createServiceInstanceWithOwner(c.id,c.desc.ctor,c.desc.staticArguments,c.desc.supportsDelayedInstantiation,c._trace);this._setServiceInstance(c.id,u)}o.removeNode(c)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],s,o){if(this._services.get(e)instanceof La)return this._createServiceInstance(e,t,i,s,o);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,i,s,o);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t,i=[],s,o){if(s){const r=new xx(void 0,this._strict,this,this._enableTracing);r._globalGraphImplicitDependency=String(e);const a=new Map,l=new Qme(()=>{const c=r._createInstance(t,i,o);for(const[d,u]of a){const h=c[d];if(typeof h=="function")for(const f of u)h.apply(c,f)}return a.clear(),c});return new Proxy(Object.create(null),{get(c,d){if(!l.isInitialized&&typeof d=="string"&&(d.startsWith("onDid")||d.startsWith("onWill"))){let f=a.get(d);return f||(f=new Ds,a.set(d,f)),(p,_,v)=>{const b=f.push([p,_,v]);return Ye(b)}}if(d in c)return c[d];const u=l.value;let h=u[d];return typeof h!="function"||(h=h.bind(u),c[d]=h),h},set(c,d,u){return l.value[d]=u,!0},getPrototypeOf(c){return t.prototype}})}else return this._createInstance(t,i,o)}_throwIfStrict(e,t){if(t&&console.warn(e),this._strict)throw new Error(e)}}class Cs{static traceInvocation(e,t){return e?new Cs(2,t.name||new Error().stack.split(` `).slice(3,4).join(` -`)):Ss._None}static traceCreation(e,t){return e?new Ss(1,t.name):Ss._None}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const i=new Ss(3,e.toString());return this._dep.push([e,t,i]),i}stop(){const e=Date.now()-this._start;Ss._totals+=e;let t=!1;function i(o,r){const a=[],l=new Array(o+1).join(" ");for(const[c,d,u]of r._dep)if(d&&u){t=!0,a.push(`${l}CREATES -> ${c}`);const h=i(o+1,u);h&&a.push(h)}else a.push(`${l}uses -> ${c}`);return a.join(` -`)}const s=[`${this.type===1?"CREATE":"CALL"} ${this.name}`,`${i(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${Ss._totals.toFixed(2)}ms)`];(e>2||t)&&Ss.all.add(s.join(` -`))}}Ss.all=new Set;Ss._None=new class extends Ss{constructor(){super(0,null)}stop(){}branch(){return this}};Ss._totals=0;const KEe=new Set([it.inMemory,it.vscodeSourceControl,it.walkThrough,it.walkThroughSnippet]);class YEe{constructor(){this._byResource=new Tn,this._byOwner=new Map}set(e,t,i){let s=this._byResource.get(e);s||(s=new Map,this._byResource.set(e,s)),s.set(t,i);let o=this._byOwner.get(t);o||(o=new Tn,this._byOwner.set(t,o)),o.set(e,i)}get(e,t){const i=this._byResource.get(e);return i==null?void 0:i.get(t)}delete(e,t){let i=!1,s=!1;const o=this._byResource.get(e);o&&(i=o.delete(t));const r=this._byOwner.get(t);if(r&&(s=r.delete(e)),i!==s)throw new Error("illegal state");return i&&s}values(e){var t,i,s,o;return typeof e=="string"?(i=(t=this._byOwner.get(e))===null||t===void 0?void 0:t.values())!==null&&i!==void 0?i:ht.empty():je.isUri(e)?(o=(s=this._byResource.get(e))===null||s===void 0?void 0:s.values())!==null&&o!==void 0?o:ht.empty():ht.map(ht.concat(...this._byOwner.values()),r=>r[1])}}class ZEe{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new Tn,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const i=this._data.get(t);i&&this._substract(i);const s=this._resourceStats(t);this._add(s),this._data.set(t,s)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(KEe.has(e.scheme))return t;for(const{severity:i}of this._service.read({resource:e}))i===ti.Error?t.errors+=1:i===ti.Warning?t.warnings+=1:i===ti.Info?t.infos+=1:t.unknowns+=1;return t}_substract(e){this.errors-=e.errors,this.warnings-=e.warnings,this.infos-=e.infos,this.unknowns-=e.unknowns}_add(e){this.errors+=e.errors,this.warnings+=e.warnings,this.infos+=e.infos,this.unknowns+=e.unknowns}}class Gc{constructor(){this._onMarkerChanged=new mU({delay:0,merge:Gc._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new YEe,this._stats=new ZEe(this)}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,t){for(const i of t||[])this.changeOne(e,i,[])}changeOne(e,t,i){if(Ohe(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const s=[];for(const o of i){const r=Gc._toMarker(e,t,o);r&&s.push(r)}this._data.set(t,e,s),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:s,severity:o,message:r,source:a,startLineNumber:l,startColumn:c,endLineNumber:d,endColumn:u,relatedInformation:h,tags:f}=i;if(r)return l=l>0?l:1,c=c>0?c:1,d=d>=l?d:l,u=u>0?u:c,{resource:t,owner:e,code:s,severity:o,message:r,source:a,startLineNumber:l,startColumn:c,endLineNumber:d,endColumn:u,relatedInformation:h,tags:f}}changeAll(e,t){const i=[],s=this._data.values(e);if(s)for(const o of s){const r=ht.first(o);r&&(i.push(r.resource),this._data.delete(r.resource,e))}if(sc(t)){const o=new Tn;for(const{resource:r,marker:a}of t){const l=Gc._toMarker(e,r,a);if(!l)continue;const c=o.get(r);c?c.push(l):(o.set(r,[l]),i.push(r))}for(const[r,a]of o)this._data.set(r,e,a)}i.length>0&&this._onMarkerChanged.fire(i)}read(e=Object.create(null)){let{owner:t,resource:i,severities:s,take:o}=e;if((!o||o<0)&&(o=-1),t&&i){const r=this._data.get(i,t);if(r){const a=[];for(const l of r)if(Gc._accept(l,s)){const c=a.push(l);if(o>0&&c===o)break}return a}else return[]}else if(!t&&!i){const r=[];for(const a of this._data.values())for(const l of a)if(Gc._accept(l,s)){const c=r.push(l);if(o>0&&c===o)return r}return r}else{const r=this._data.values(i??t),a=[];for(const l of r)for(const c of l)if(Gc._accept(c,s)){const d=a.push(c);if(o>0&&d===o)return a}return a}}static _accept(e,t){return t===void 0||(t&e.severity)===e.severity}static _merge(e){const t=new Tn;for(const i of e)for(const s of i)t.set(s,!0);return Array.from(t.keys())}}class XEe extends Y{constructor(){super(...arguments),this._configurationModel=new An}get configurationModel(){return this._configurationModel}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=new An;const e=_n.as(qf.Configuration).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){const i=this.getConfigurationDefaultOverrides();for(const s of e){const o=i[s],r=t[s];o!==void 0?this._configurationModel.addValue(s,o):r?this._configurationModel.addValue(s,r.default):this._configurationModel.removeValue(s)}}}const qD=at("audioCue");class $e{static register(e){return new $e(e.fileName)}constructor(e){this.fileName=e}}$e.error=$e.register({fileName:"error.mp3"});$e.warning=$e.register({fileName:"warning.mp3"});$e.foldedArea=$e.register({fileName:"foldedAreas.mp3"});$e.break=$e.register({fileName:"break.mp3"});$e.quickFixes=$e.register({fileName:"quickFixes.mp3"});$e.taskCompleted=$e.register({fileName:"taskCompleted.mp3"});$e.taskFailed=$e.register({fileName:"taskFailed.mp3"});$e.terminalBell=$e.register({fileName:"terminalBell.mp3"});$e.diffLineInserted=$e.register({fileName:"diffLineInserted.mp3"});$e.diffLineDeleted=$e.register({fileName:"diffLineDeleted.mp3"});$e.diffLineModified=$e.register({fileName:"diffLineModified.mp3"});$e.chatRequestSent=$e.register({fileName:"chatRequestSent.mp3"});$e.chatResponsePending=$e.register({fileName:"chatResponsePending.mp3"});$e.chatResponseReceived1=$e.register({fileName:"chatResponseReceived1.mp3"});$e.chatResponseReceived2=$e.register({fileName:"chatResponseReceived2.mp3"});$e.chatResponseReceived3=$e.register({fileName:"chatResponseReceived3.mp3"});$e.chatResponseReceived4=$e.register({fileName:"chatResponseReceived4.mp3"});class QEe{constructor(e){this.randomOneOf=e}}class dt{static register(e){const t=new QEe("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),i=new dt(t,e.name,e.settingsKey);return dt._audioCues.add(i),i}constructor(e,t,i){this.sound=e,this.name=t,this.settingsKey=i}}dt._audioCues=new Set;dt.error=dt.register({name:m("audioCues.lineHasError.name","Error on Line"),sound:$e.error,settingsKey:"audioCues.lineHasError"});dt.warning=dt.register({name:m("audioCues.lineHasWarning.name","Warning on Line"),sound:$e.warning,settingsKey:"audioCues.lineHasWarning"});dt.foldedArea=dt.register({name:m("audioCues.lineHasFoldedArea.name","Folded Area on Line"),sound:$e.foldedArea,settingsKey:"audioCues.lineHasFoldedArea"});dt.break=dt.register({name:m("audioCues.lineHasBreakpoint.name","Breakpoint on Line"),sound:$e.break,settingsKey:"audioCues.lineHasBreakpoint"});dt.inlineSuggestion=dt.register({name:m("audioCues.lineHasInlineSuggestion.name","Inline Suggestion on Line"),sound:$e.quickFixes,settingsKey:"audioCues.lineHasInlineSuggestion"});dt.terminalQuickFix=dt.register({name:m("audioCues.terminalQuickFix.name","Terminal Quick Fix"),sound:$e.quickFixes,settingsKey:"audioCues.terminalQuickFix"});dt.onDebugBreak=dt.register({name:m("audioCues.onDebugBreak.name","Debugger Stopped on Breakpoint"),sound:$e.break,settingsKey:"audioCues.onDebugBreak"});dt.noInlayHints=dt.register({name:m("audioCues.noInlayHints","No Inlay Hints on Line"),sound:$e.error,settingsKey:"audioCues.noInlayHints"});dt.taskCompleted=dt.register({name:m("audioCues.taskCompleted","Task Completed"),sound:$e.taskCompleted,settingsKey:"audioCues.taskCompleted"});dt.taskFailed=dt.register({name:m("audioCues.taskFailed","Task Failed"),sound:$e.taskFailed,settingsKey:"audioCues.taskFailed"});dt.terminalCommandFailed=dt.register({name:m("audioCues.terminalCommandFailed","Terminal Command Failed"),sound:$e.error,settingsKey:"audioCues.terminalCommandFailed"});dt.terminalBell=dt.register({name:m("audioCues.terminalBell","Terminal Bell"),sound:$e.terminalBell,settingsKey:"audioCues.terminalBell"});dt.notebookCellCompleted=dt.register({name:m("audioCues.notebookCellCompleted","Notebook Cell Completed"),sound:$e.taskCompleted,settingsKey:"audioCues.notebookCellCompleted"});dt.notebookCellFailed=dt.register({name:m("audioCues.notebookCellFailed","Notebook Cell Failed"),sound:$e.taskFailed,settingsKey:"audioCues.notebookCellFailed"});dt.diffLineInserted=dt.register({name:m("audioCues.diffLineInserted","Diff Line Inserted"),sound:$e.diffLineInserted,settingsKey:"audioCues.diffLineInserted"});dt.diffLineDeleted=dt.register({name:m("audioCues.diffLineDeleted","Diff Line Deleted"),sound:$e.diffLineDeleted,settingsKey:"audioCues.diffLineDeleted"});dt.diffLineModified=dt.register({name:m("audioCues.diffLineModified","Diff Line Modified"),sound:$e.diffLineModified,settingsKey:"audioCues.diffLineModified"});dt.chatRequestSent=dt.register({name:m("audioCues.chatRequestSent","Chat Request Sent"),sound:$e.chatRequestSent,settingsKey:"audioCues.chatRequestSent"});dt.chatResponseReceived=dt.register({name:m("audioCues.chatResponseReceived","Chat Response Received"),settingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[$e.chatResponseReceived1,$e.chatResponseReceived2,$e.chatResponseReceived3,$e.chatResponseReceived4]}});dt.chatResponsePending=dt.register({name:m("audioCues.chatResponsePending","Chat Response Pending"),sound:$e.chatResponsePending,settingsKey:"audioCues.chatResponsePending"});class JEe extends Y{constructor(e,t=[]){super(),this.logger=new kpe([e,...t]),this._register(e.onDidChangeLogLevel(i=>this.setLevel(i)))}get onDidChangeLogLevel(){return this.logger.onDidChangeLogLevel}setLevel(e){this.logger.setLevel(e)}getLevel(){return this.logger.getLevel()}trace(e,...t){this.logger.trace(e,...t)}debug(e,...t){this.logger.debug(e,...t)}info(e,...t){this.logger.info(e,...t)}warn(e,...t){this.logger.warn(e,...t)}error(e,...t){this.logger.error(e,...t)}}const eAe=[];function tAe(){return eAe.slice(0)}var Nu=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},mn=function(n,e){return function(t,i){e(t,i,n)}},Rp=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class iAe{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new B}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}let XN=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new Qfe(new iAe(t))):Promise.reject(new Error("Model not found"))}};XN=Nu([mn(0,fs)],XN);class GD{show(){return GD.NULL_PROGRESS_RUNNER}showWhile(e,t){return Rp(this,void 0,void 0,function*(){yield e})}}GD.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};class nAe{withProgress(e,t,i){return t({report:()=>{}})}}class sAe{constructor(){this.isExtensionDevelopment=!1,this.isBuilt=!1}}class oAe{confirm(e){return Rp(this,void 0,void 0,function*(){return{confirmed:this.doConfirm(e.message,e.detail),checkboxChecked:!1}})}doConfirm(e,t){let i=e;return t&&(i=i+` +`)):Cs._None}static traceCreation(e,t){return e?new Cs(1,t.name):Cs._None}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const i=new Cs(3,e.toString());return this._dep.push([e,t,i]),i}stop(){const e=Date.now()-this._start;Cs._totals+=e;let t=!1;function i(o,r){const a=[],l=new Array(o+1).join(" ");for(const[c,d,u]of r._dep)if(d&&u){t=!0,a.push(`${l}CREATES -> ${c}`);const h=i(o+1,u);h&&a.push(h)}else a.push(`${l}uses -> ${c}`);return a.join(` +`)}const s=[`${this.type===1?"CREATE":"CALL"} ${this.name}`,`${i(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${Cs._totals.toFixed(2)}ms)`];(e>2||t)&&Cs.all.add(s.join(` +`))}}Cs.all=new Set;Cs._None=new class extends Cs{constructor(){super(0,null)}stop(){}branch(){return this}};Cs._totals=0;const gAe=new Set([tt.inMemory,tt.vscodeSourceControl,tt.walkThrough,tt.walkThroughSnippet]);class pAe{constructor(){this._byResource=new An,this._byOwner=new Map}set(e,t,i){let s=this._byResource.get(e);s||(s=new Map,this._byResource.set(e,s)),s.set(t,i);let o=this._byOwner.get(t);o||(o=new An,this._byOwner.set(t,o)),o.set(e,i)}get(e,t){const i=this._byResource.get(e);return i==null?void 0:i.get(t)}delete(e,t){let i=!1,s=!1;const o=this._byResource.get(e);o&&(i=o.delete(t));const r=this._byOwner.get(t);if(r&&(s=r.delete(e)),i!==s)throw new Error("illegal state");return i&&s}values(e){var t,i,s,o;return typeof e=="string"?(i=(t=this._byOwner.get(e))===null||t===void 0?void 0:t.values())!==null&&i!==void 0?i:ut.empty():Ue.isUri(e)?(o=(s=this._byResource.get(e))===null||s===void 0?void 0:s.values())!==null&&o!==void 0?o:ut.empty():ut.map(ut.concat(...this._byOwner.values()),r=>r[1])}}class mAe{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new An,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const i=this._data.get(t);i&&this._substract(i);const s=this._resourceStats(t);this._add(s),this._data.set(t,s)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(gAe.has(e.scheme))return t;for(const{severity:i}of this._service.read({resource:e}))i===ei.Error?t.errors+=1:i===ei.Warning?t.warnings+=1:i===ei.Info?t.infos+=1:t.unknowns+=1;return t}_substract(e){this.errors-=e.errors,this.warnings-=e.warnings,this.infos-=e.infos,this.unknowns-=e.unknowns}_add(e){this.errors+=e.errors,this.warnings+=e.warnings,this.infos+=e.infos,this.unknowns+=e.unknowns}}class Gc{constructor(){this._onMarkerChanged=new pU({delay:0,merge:Gc._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new pAe,this._stats=new mAe(this)}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,t){for(const i of t||[])this.changeOne(e,i,[])}changeOne(e,t,i){if(ife(i))this._data.delete(t,e)&&this._onMarkerChanged.fire([t]);else{const s=[];for(const o of i){const r=Gc._toMarker(e,t,o);r&&s.push(r)}this._data.set(t,e,s),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:s,severity:o,message:r,source:a,startLineNumber:l,startColumn:c,endLineNumber:d,endColumn:u,relatedInformation:h,tags:f}=i;if(r)return l=l>0?l:1,c=c>0?c:1,d=d>=l?d:l,u=u>0?u:c,{resource:t,owner:e,code:s,severity:o,message:r,source:a,startLineNumber:l,startColumn:c,endLineNumber:d,endColumn:u,relatedInformation:h,tags:f}}changeAll(e,t){const i=[],s=this._data.values(e);if(s)for(const o of s){const r=ut.first(o);r&&(i.push(r.resource),this._data.delete(r.resource,e))}if(oc(t)){const o=new An;for(const{resource:r,marker:a}of t){const l=Gc._toMarker(e,r,a);if(!l)continue;const c=o.get(r);c?c.push(l):(o.set(r,[l]),i.push(r))}for(const[r,a]of o)this._data.set(r,e,a)}i.length>0&&this._onMarkerChanged.fire(i)}read(e=Object.create(null)){let{owner:t,resource:i,severities:s,take:o}=e;if((!o||o<0)&&(o=-1),t&&i){const r=this._data.get(i,t);if(r){const a=[];for(const l of r)if(Gc._accept(l,s)){const c=a.push(l);if(o>0&&c===o)break}return a}else return[]}else if(!t&&!i){const r=[];for(const a of this._data.values())for(const l of a)if(Gc._accept(l,s)){const c=r.push(l);if(o>0&&c===o)return r}return r}else{const r=this._data.values(i??t),a=[];for(const l of r)for(const c of l)if(Gc._accept(c,s)){const d=a.push(c);if(o>0&&d===o)return a}return a}}static _accept(e,t){return t===void 0||(t&e.severity)===e.severity}static _merge(e){const t=new An;for(const i of e)for(const s of i)t.set(s,!0);return Array.from(t.keys())}}class _Ae extends Y{constructor(){super(...arguments),this._configurationModel=new kn}get configurationModel(){return this._configurationModel}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=new kn;const e=pn.as(Yf.Configuration).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){const i=this.getConfigurationDefaultOverrides();for(const s of e){const o=i[s],r=t[s];o!==void 0?this._configurationModel.addValue(s,o):r?this._configurationModel.addValue(s,r.default):this._configurationModel.removeValue(s)}}}const WD=rt("audioCue");class He{static register(e){return new He(e.fileName)}constructor(e){this.fileName=e}}He.error=He.register({fileName:"error.mp3"});He.warning=He.register({fileName:"warning.mp3"});He.foldedArea=He.register({fileName:"foldedAreas.mp3"});He.break=He.register({fileName:"break.mp3"});He.quickFixes=He.register({fileName:"quickFixes.mp3"});He.taskCompleted=He.register({fileName:"taskCompleted.mp3"});He.taskFailed=He.register({fileName:"taskFailed.mp3"});He.terminalBell=He.register({fileName:"terminalBell.mp3"});He.diffLineInserted=He.register({fileName:"diffLineInserted.mp3"});He.diffLineDeleted=He.register({fileName:"diffLineDeleted.mp3"});He.diffLineModified=He.register({fileName:"diffLineModified.mp3"});He.chatRequestSent=He.register({fileName:"chatRequestSent.mp3"});He.chatResponsePending=He.register({fileName:"chatResponsePending.mp3"});He.chatResponseReceived1=He.register({fileName:"chatResponseReceived1.mp3"});He.chatResponseReceived2=He.register({fileName:"chatResponseReceived2.mp3"});He.chatResponseReceived3=He.register({fileName:"chatResponseReceived3.mp3"});He.chatResponseReceived4=He.register({fileName:"chatResponseReceived4.mp3"});class bAe{constructor(e){this.randomOneOf=e}}class ct{static register(e){const t=new bAe("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),i=new ct(t,e.name,e.settingsKey);return ct._audioCues.add(i),i}constructor(e,t,i){this.sound=e,this.name=t,this.settingsKey=i}}ct._audioCues=new Set;ct.error=ct.register({name:m("audioCues.lineHasError.name","Error on Line"),sound:He.error,settingsKey:"audioCues.lineHasError"});ct.warning=ct.register({name:m("audioCues.lineHasWarning.name","Warning on Line"),sound:He.warning,settingsKey:"audioCues.lineHasWarning"});ct.foldedArea=ct.register({name:m("audioCues.lineHasFoldedArea.name","Folded Area on Line"),sound:He.foldedArea,settingsKey:"audioCues.lineHasFoldedArea"});ct.break=ct.register({name:m("audioCues.lineHasBreakpoint.name","Breakpoint on Line"),sound:He.break,settingsKey:"audioCues.lineHasBreakpoint"});ct.inlineSuggestion=ct.register({name:m("audioCues.lineHasInlineSuggestion.name","Inline Suggestion on Line"),sound:He.quickFixes,settingsKey:"audioCues.lineHasInlineSuggestion"});ct.terminalQuickFix=ct.register({name:m("audioCues.terminalQuickFix.name","Terminal Quick Fix"),sound:He.quickFixes,settingsKey:"audioCues.terminalQuickFix"});ct.onDebugBreak=ct.register({name:m("audioCues.onDebugBreak.name","Debugger Stopped on Breakpoint"),sound:He.break,settingsKey:"audioCues.onDebugBreak"});ct.noInlayHints=ct.register({name:m("audioCues.noInlayHints","No Inlay Hints on Line"),sound:He.error,settingsKey:"audioCues.noInlayHints"});ct.taskCompleted=ct.register({name:m("audioCues.taskCompleted","Task Completed"),sound:He.taskCompleted,settingsKey:"audioCues.taskCompleted"});ct.taskFailed=ct.register({name:m("audioCues.taskFailed","Task Failed"),sound:He.taskFailed,settingsKey:"audioCues.taskFailed"});ct.terminalCommandFailed=ct.register({name:m("audioCues.terminalCommandFailed","Terminal Command Failed"),sound:He.error,settingsKey:"audioCues.terminalCommandFailed"});ct.terminalBell=ct.register({name:m("audioCues.terminalBell","Terminal Bell"),sound:He.terminalBell,settingsKey:"audioCues.terminalBell"});ct.notebookCellCompleted=ct.register({name:m("audioCues.notebookCellCompleted","Notebook Cell Completed"),sound:He.taskCompleted,settingsKey:"audioCues.notebookCellCompleted"});ct.notebookCellFailed=ct.register({name:m("audioCues.notebookCellFailed","Notebook Cell Failed"),sound:He.taskFailed,settingsKey:"audioCues.notebookCellFailed"});ct.diffLineInserted=ct.register({name:m("audioCues.diffLineInserted","Diff Line Inserted"),sound:He.diffLineInserted,settingsKey:"audioCues.diffLineInserted"});ct.diffLineDeleted=ct.register({name:m("audioCues.diffLineDeleted","Diff Line Deleted"),sound:He.diffLineDeleted,settingsKey:"audioCues.diffLineDeleted"});ct.diffLineModified=ct.register({name:m("audioCues.diffLineModified","Diff Line Modified"),sound:He.diffLineModified,settingsKey:"audioCues.diffLineModified"});ct.chatRequestSent=ct.register({name:m("audioCues.chatRequestSent","Chat Request Sent"),sound:He.chatRequestSent,settingsKey:"audioCues.chatRequestSent"});ct.chatResponseReceived=ct.register({name:m("audioCues.chatResponseReceived","Chat Response Received"),settingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[He.chatResponseReceived1,He.chatResponseReceived2,He.chatResponseReceived3,He.chatResponseReceived4]}});ct.chatResponsePending=ct.register({name:m("audioCues.chatResponsePending","Chat Response Pending"),sound:He.chatResponsePending,settingsKey:"audioCues.chatResponsePending"});class vAe extends Y{constructor(e,t=[]){super(),this.logger=new Gpe([e,...t]),this._register(e.onDidChangeLogLevel(i=>this.setLevel(i)))}get onDidChangeLogLevel(){return this.logger.onDidChangeLogLevel}setLevel(e){this.logger.setLevel(e)}getLevel(){return this.logger.getLevel()}trace(e,...t){this.logger.trace(e,...t)}debug(e,...t){this.logger.debug(e,...t)}info(e,...t){this.logger.info(e,...t)}warn(e,...t){this.logger.warn(e,...t)}error(e,...t){this.logger.error(e,...t)}}const yAe=[];function wAe(){return yAe.slice(0)}var Ru=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},gn=function(n,e){return function(t,i){e(t,i,n)}},Pp=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class CAe{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new B}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}let YN=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new bge(new CAe(t))):Promise.reject(new Error("Model not found"))}};YN=Ru([gn(0,hs)],YN);class VD{show(){return VD.NULL_PROGRESS_RUNNER}showWhile(e,t){return Pp(this,void 0,void 0,function*(){yield e})}}VD.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};class SAe{withProgress(e,t,i){return t({report:()=>{}})}}class xAe{constructor(){this.isExtensionDevelopment=!1,this.isBuilt=!1}}class LAe{confirm(e){return Pp(this,void 0,void 0,function*(){return{confirmed:this.doConfirm(e.message,e.detail),checkboxChecked:!1}})}doConfirm(e,t){let i=e;return t&&(i=i+` -`+t),window.confirm(i)}prompt(e){var t,i;return Rp(this,void 0,void 0,function*(){let s;if(this.doConfirm(e.message,e.detail)){const r=[...(t=e.buttons)!==null&&t!==void 0?t:[]];e.cancelButton&&typeof e.cancelButton!="string"&&typeof e.cancelButton!="boolean"&&r.push(e.cancelButton),s=yield(i=r[0])===null||i===void 0?void 0:i.run({checkboxChecked:!1})}return{result:s}})}error(e,t){return Rp(this,void 0,void 0,function*(){yield this.prompt({type:bi.Error,message:e,detail:t})})}}class Iv{info(e){return this.notify({severity:bi.Info,message:e})}warn(e){return this.notify({severity:bi.Warning,message:e})}error(e){return this.notify({severity:bi.Error,message:e})}notify(e){switch(e.severity){case bi.Error:console.error(e.message);break;case bi.Warning:console.warn(e.message);break;default:console.log(e.message);break}return Iv.NO_OP}prompt(e,t,i,s){return Iv.NO_OP}status(e,t){return Y.None}}Iv.NO_OP=new axe;let QN=class{constructor(e){this._onWillExecuteCommand=new B,this._onDidExecuteCommand=new B,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=Zt.getCommand(e);if(!i)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const s=this._instantiationService.invokeFunction.apply(this._instantiationService,[i.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(s)}catch(s){return Promise.reject(s)}}};QN=Nu([mn(0,yt)],QN);let Bm=class extends bLe{constructor(e,t,i,s,o,r){super(e,t,i,s,o),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=f=>{const g=new pe;g.add(K(f,de.KEY_DOWN,p=>{const _=new Ht(p);this._dispatch(_,_.target)&&(_.preventDefault(),_.stopPropagation())})),g.add(K(f,de.KEY_UP,p=>{const _=new Ht(p);this._singleModifierDispatch(_,_.target)&&_.preventDefault()})),this._domNodeListeners.push(new rAe(f,g))},l=f=>{for(let g=0;g{f.getOption(61)||a(f.getContainerDomNode())},d=f=>{f.getOption(61)||l(f.getContainerDomNode())};this._register(r.onCodeEditorAdd(c)),this._register(r.onCodeEditorRemove(d)),r.listCodeEditors().forEach(c);const u=f=>{a(f.getContainerDomNode())},h=f=>{l(f.getContainerDomNode())};this._register(r.onDiffEditorAdd(u)),this._register(r.onDiffEditorRemove(h)),r.listDiffEditors().forEach(u)}addDynamicKeybinding(e,t,i,s){return br(Zt.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:s}]))}addDynamicKeybindings(e){const t=e.map(i=>{var s;return{keybinding:sT(i.keybinding,wo),command:(s=i.command)!==null&&s!==void 0?s:null,commandArgs:i.commandArgs,when:i.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}});return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),Ze(()=>{for(let i=0;ithis._log(i))}return this._cachedResolver}_documentHasFocus(){return document.hasFocus()}_toNormalizedKeybindingItems(e,t){const i=[];let s=0;for(const o of e){const r=o.when||void 0,a=o.keybinding;if(!a)i[s++]=new V6(void 0,o.command,o.commandArgs,r,t,null,!1);else{const l=bv.resolveKeybinding(a,wo);for(const c of l)i[s++]=new V6(c,o.command,o.commandArgs,r,t,null,!1)}}return i}resolveKeyboardEvent(e){const t=new bf(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new bv([t],wo)}};Bm=Nu([mn(0,tt),mn(1,gs),mn(2,Cc),mn(3,Dn),mn(4,Sc),mn(5,qt)],Bm);class rAe extends Y{constructor(e,t){super(),this.domNode=e,this._register(t)}}function B8(n){return n&&typeof n=="object"&&(!n.overrideIdentifier||typeof n.overrideIdentifier=="string")&&(!n.resource||n.resource instanceof je)}class wK{constructor(){this._onDidChangeConfiguration=new B,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const e=new XEe;this._configuration=new kD(e.reload(),new An,new An,new An),e.dispose()}getValue(e,t){const i=typeof e=="string"?e:void 0,s=B8(e)?e:B8(t)?t:{};return this._configuration.getValue(i,s,void 0)}updateValues(e){const t={data:this._configuration.toData()},i=[];for(const s of e){const[o,r]=s;this.getValue(o)!==r&&(this._configuration.updateValue(o,r),i.push(o))}if(i.length>0){const s=new gLe({keys:i,overrides:[]},t,this._configuration);s.source=8,s.sourceConfig=null,this._onDidChangeConfiguration.fire(s)}return Promise.resolve()}updateValue(e,t,i,s){return this.updateValues([[e,t]])}inspect(e,t={}){return this._configuration.inspect(e,t,void 0)}}let JN=class{constructor(e,t,i){this.configurationService=e,this.modelService=t,this.languageService=i,this._onDidChangeConfiguration=new B,this.configurationService.onDidChangeConfiguration(s=>{this._onDidChangeConfiguration.fire({affectedKeys:s.affectedKeys,affectsConfiguration:(o,r)=>s.affectsConfiguration(r)})})}getValue(e,t,i){const s=V.isIPosition(t)?t:null,o=s?typeof i=="string"?i:void 0:typeof t=="string"?t:void 0,r=e?this.getLanguage(e,s):void 0;return typeof o>"u"?this.configurationService.getValue({resource:e,overrideIdentifier:r}):this.configurationService.getValue(o,{resource:e,overrideIdentifier:r})}getLanguage(e,t){const i=this.modelService.getModel(e);return i?t?i.getLanguageIdAtPosition(t.lineNumber,t.column):i.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}};JN=Nu([mn(0,ni),mn(1,fs),mn(2,Ni)],JN);let eR=class{constructor(e){this.configurationService=e}getEOL(e,t){const i=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return i&&typeof i=="string"&&i!=="auto"?i:Jn||mt?` +`+t),window.confirm(i)}prompt(e){var t,i;return Pp(this,void 0,void 0,function*(){let s;if(this.doConfirm(e.message,e.detail)){const r=[...(t=e.buttons)!==null&&t!==void 0?t:[]];e.cancelButton&&typeof e.cancelButton!="string"&&typeof e.cancelButton!="boolean"&&r.push(e.cancelButton),s=yield(i=r[0])===null||i===void 0?void 0:i.run({checkboxChecked:!1})}return{result:s}})}error(e,t){return Pp(this,void 0,void 0,function*(){yield this.prompt({type:_i.Error,message:e,detail:t})})}}class Nv{info(e){return this.notify({severity:_i.Info,message:e})}warn(e){return this.notify({severity:_i.Warning,message:e})}error(e){return this.notify({severity:_i.Error,message:e})}notify(e){switch(e.severity){case _i.Error:console.error(e.message);break;case _i.Warning:console.warn(e.message);break;default:console.log(e.message);break}return Nv.NO_OP}prompt(e,t,i,s){return Nv.NO_OP}status(e,t){return Y.None}}Nv.NO_OP=new kxe;let ZN=class{constructor(e){this._onWillExecuteCommand=new B,this._onDidExecuteCommand=new B,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=Yt.getCommand(e);if(!i)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});const s=this._instantiationService.invokeFunction.apply(this._instantiationService,[i.handler,...t]);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(s)}catch(s){return Promise.reject(s)}}};ZN=Ru([gn(0,vt)],ZN);let zm=class extends BLe{constructor(e,t,i,s,o,r){super(e,t,i,s,o),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const a=f=>{const g=new pe;g.add(K(f,de.KEY_DOWN,p=>{const _=new zt(p);this._dispatch(_,_.target)&&(_.preventDefault(),_.stopPropagation())})),g.add(K(f,de.KEY_UP,p=>{const _=new zt(p);this._singleModifierDispatch(_,_.target)&&_.preventDefault()})),this._domNodeListeners.push(new DAe(f,g))},l=f=>{for(let g=0;g{f.getOption(61)||a(f.getContainerDomNode())},d=f=>{f.getOption(61)||l(f.getContainerDomNode())};this._register(r.onCodeEditorAdd(c)),this._register(r.onCodeEditorRemove(d)),r.listCodeEditors().forEach(c);const u=f=>{a(f.getContainerDomNode())},h=f=>{l(f.getContainerDomNode())};this._register(r.onDiffEditorAdd(u)),this._register(r.onDiffEditorRemove(h)),r.listDiffEditors().forEach(u)}addDynamicKeybinding(e,t,i,s){return _r(Yt.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:s}]))}addDynamicKeybindings(e){const t=e.map(i=>{var s;return{keybinding:iT(i.keybinding,bo),command:(s=i.command)!==null&&s!==void 0?s:null,commandArgs:i.commandArgs,when:i.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}});return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),Ye(()=>{for(let i=0;ithis._log(i))}return this._cachedResolver}_documentHasFocus(){return document.hasFocus()}_toNormalizedKeybindingItems(e,t){const i=[];let s=0;for(const o of e){const r=o.when||void 0,a=o.keybinding;if(!a)i[s++]=new O6(void 0,o.command,o.commandArgs,r,t,null,!1);else{const l=yv.resolveKeybinding(a,bo);for(const c of l)i[s++]=new O6(c,o.command,o.commandArgs,r,t,null,!1)}}return i}resolveKeyboardEvent(e){const t=new wf(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new yv([t],bo)}};zm=Ru([gn(0,et),gn(1,fs),gn(2,Cc),gn(3,xn),gn(4,Sc),gn(5,jt)],zm);class DAe extends Y{constructor(e,t){super(),this.domNode=e,this._register(t)}}function M8(n){return n&&typeof n=="object"&&(!n.overrideIdentifier||typeof n.overrideIdentifier=="string")&&(!n.resource||n.resource instanceof Ue)}class yK{constructor(){this._onDidChangeConfiguration=new B,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const e=new _Ae;this._configuration=new yD(e.reload(),new kn,new kn,new kn),e.dispose()}getValue(e,t){const i=typeof e=="string"?e:void 0,s=M8(e)?e:M8(t)?t:{};return this._configuration.getValue(i,s,void 0)}updateValues(e){const t={data:this._configuration.toData()},i=[];for(const s of e){const[o,r]=s;this.getValue(o)!==r&&(this._configuration.updateValue(o,r),i.push(o))}if(i.length>0){const s=new MLe({keys:i,overrides:[]},t,this._configuration);s.source=8,s.sourceConfig=null,this._onDidChangeConfiguration.fire(s)}return Promise.resolve()}updateValue(e,t,i,s){return this.updateValues([[e,t]])}inspect(e,t={}){return this._configuration.inspect(e,t,void 0)}}let XN=class{constructor(e,t,i){this.configurationService=e,this.modelService=t,this.languageService=i,this._onDidChangeConfiguration=new B,this.configurationService.onDidChangeConfiguration(s=>{this._onDidChangeConfiguration.fire({affectedKeys:s.affectedKeys,affectsConfiguration:(o,r)=>s.affectsConfiguration(r)})})}getValue(e,t,i){const s=V.isIPosition(t)?t:null,o=s?typeof i=="string"?i:void 0:typeof t=="string"?t:void 0,r=e?this.getLanguage(e,s):void 0;return typeof o>"u"?this.configurationService.getValue({resource:e,overrideIdentifier:r}):this.configurationService.getValue(o,{resource:e,overrideIdentifier:r})}getLanguage(e,t){const i=this.modelService.getModel(e);return i?t?i.getLanguageIdAtPosition(t.lineNumber,t.column):i.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}};XN=Ru([gn(0,ii),gn(1,hs),gn(2,Ni)],XN);let QN=class{constructor(e){this.configurationService=e}getEOL(e,t){const i=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return i&&typeof i=="string"&&i!=="auto"?i:Xn||pt?` `:`\r -`}};eR=Nu([mn(0,ni)],eR);class aAe{publicLog2(){}}class Tv{constructor(){const e=je.from({scheme:Tv.SCHEME,authority:"model",path:"/"});this.workspace={id:NLe,folders:[new ILe({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===Tv.SCHEME?this.workspace.folders[0]:null}}Tv.SCHEME="inmemory";function Nx(n,e,t){if(!e||!(n instanceof wK))return;const i=[];Object.keys(e).forEach(s=>{lLe(s)&&i.push([`editor.${s}`,e[s]]),t&&cLe(s)&&i.push([`diffEditor.${s}`,e[s]])}),i.length>0&&n.updateValues(i)}let tR=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}apply(e,t){return Rp(this,void 0,void 0,function*(){const i=Array.isArray(e)?e:qP.convert(e),s=new Map;for(const a of i){if(!(a instanceof ef))throw new Error("bad edit - only text edits are supported");const l=this._modelService.getModel(a.resource);if(!l)throw new Error("bad edit - model not found");if(typeof a.versionId=="number"&&l.getVersionId()!==a.versionId)throw new Error("bad state - model changed in the meantime");let c=s.get(l);c||(c=[],s.set(l,c)),c.push(uLe.replaceMove(N.lift(a.textEdit.range),a.textEdit.text))}let o=0,r=0;for(const[a,l]of s)a.pushStackElement(),a.pushEditOperations([],l,()=>[]),a.pushStackElement(),r+=1,o+=l.length;return{ariaSummary:Bb(rN.bulkEditServiceSummary,o,r),isApplied:o>0}})}};tR=Nu([mn(0,fs)],tR);class lAe{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return la(e)}}let iR=class extends aN{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,i){if(!t){const s=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();s&&(t=s.getContainerDomNode())}return super.showContextView(e,t,i)}};iR=Nu([mn(0,r0),mn(1,qt)],iR);class cAe{constructor(){this._neverEmitter=new B,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class dAe extends yv{constructor(){super()}}class uAe extends JEe{constructor(){super(new Dpe)}}let nR=class extends xN{constructor(e,t,i,s,o,r){super(e,t,i,s,o,r),this.configure({blockMouse:!1})}};nR=Nu([mn(0,Cc),mn(1,Dn),mn(2,Iu),mn(3,vi),mn(4,Lu),mn(5,tt)],nR);class hAe{playAudioCue(e,t){return Rp(this,void 0,void 0,function*(){})}}gt(ni,wK,0);gt(Mj,JN,0);gt(Pj,eR,0);gt(ALe,Tv,0);gt(AD,lAe,0);gt(Cc,aAe,0);gt(eG,oAe,0);gt(oG,sAe,0);gt(Dn,Iv,0);gt(pl,Gc,0);gt(Ni,dAe,0);gt(Rr,REe,0);gt(Sc,uAe,0);gt(fs,Sx,0);gt(hP,AN,0);gt(tt,ZN,0);gt(xLe,nAe,0);gt(ny,GD,0);gt(Qf,bke,0);gt(ry,wT,0);gt(hG,tR,0);gt(RLe,cAe,0);gt(xu,XN,0);gt(Eu,jN,0);gt(Jo,M2e,0);gt(gs,QN,0);gt(vi,Bm,0);gt(S3,$N,0);gt(Iu,iR,0);gt(Dc,EN,0);gt(hy,YN,0);gt(Tu,nR,0);gt(Lu,qN,0);gt(qD,hAe,0);var Ae;(function(n){const e=new DD;for(const[l,c]of S9())e.set(l,c);const t=new Tx(e,!0);e.set(yt,t);function i(l){s||r({});const c=e.get(l);if(!c)throw new Error("Missing service "+l);return c instanceof ka?t.invokeFunction(d=>d.get(l)):c}n.get=i;let s=!1;const o=new B;function r(l){if(s)return t;s=!0;for(const[d,u]of S9())e.get(d)||e.set(d,u);for(const d in l)if(l.hasOwnProperty(d)){const u=at(d);e.get(u)instanceof ka&&e.set(u,l[d])}const c=tAe();for(const d of c)try{t.createInstance(d)}catch(u){_t(u)}return o.fire(),t}n.initialize=r;function a(l){if(s)return l();const c=new pe,d=c.add(o.event(()=>{d.dispose(),c.add(l())}));return c}n.withServices=a})(Ae||(Ae={}));let fAe;function lc(){return fAe}let CK;function gAe(n){CK=n}class SK{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,t){const i=t===void 0?void 0:e,s=t===void 0?e:t;return CK({owner:i,debugName:()=>{const o=ig(s);if(o!==void 0)return o;const a=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(s.toString());if(a)return`${this.debugName}.${a[2]}`;if(!i)return`${this.debugName} (mapped)`}},o=>s(this.read(o),o))}}class fy extends SK{constructor(){super(...arguments),this.observers=new Set}addObserver(e){const t=this.observers.size;this.observers.add(e),t===0&&this.onFirstObserverAdded()}removeObserver(e){this.observers.delete(e)&&this.observers.size===0&&this.onLastObserverRemoved()}onFirstObserverAdded(){}onLastObserverRemoved(){}}function On(n,e){const t=new xK(n,e);try{n(t)}finally{t.finish()}}function pAe(n,e,t){n?e(n):On(e,t)}class xK{constructor(e,t){var i;this._fn=e,this._getDebugName=t,this.updatingObservers=[],(i=lc())===null||i===void 0||i.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():ig(this._fn)}updateObserver(e,t){this.updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){var e;const t=this.updatingObservers;this.updatingObservers=null;for(const{observer:i,observable:s}of t)i.endUpdate(s);(e=lc())===null||e===void 0||e.handleEndTransaction()}}function E3(n,e,t,i){let s;if(n!==void 0)if(typeof n=="function"){if(s=n(),s!==void 0)return s}else return n;if(e!==void 0&&(s=ig(e),s!==void 0))return s;if(t!==void 0){for(const o in t)if(t[o]===i)return o}}function ig(n){const e=n.toString(),i=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e),s=i?i[1]:void 0;return s==null?void 0:s.trim()}function li(n,e){return typeof n=="string"?new sR(void 0,n,e):new sR(n,void 0,e)}class sR extends fy{get debugName(){var e;return(e=E3(this._debugName,void 0,this._owner,this))!==null&&e!==void 0?e:"ObservableValue"}constructor(e,t,i){super(),this._owner=e,this._debugName=t,this._value=i}get(){return this._value}set(e,t,i){var s;if(this._value===e)return;let o;t||(t=o=new xK(()=>{},()=>`Setting ${this.debugName}`));try{const r=this._value;this._setValue(e),(s=lc())===null||s===void 0||s.handleObservableChanged(this,{oldValue:r,newValue:e,change:i,didChange:!0,hadValue:!0});for(const a of this.observers)t.updateObserver(a,this),a.handleChange(this,i)}finally{o&&o.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function mAe(n,e){return new _Ae(void 0,n,e)}class _Ae extends sR{_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){var e;(e=this._value)===null||e===void 0||e.dispose()}}const oR=(n,e)=>n===e;function bt(n,e){return e!==void 0?new rR(n,void 0,e,void 0,void 0,void 0,oR):new rR(void 0,void 0,n,void 0,void 0,void 0,oR)}function Nv(n,e){let t,i;e===void 0?(t=n,i=void 0):(i=n,t=e);const s=new pe;return new rR(i,()=>{var o;return(o=ig(t))!==null&&o!==void 0?o:"(anonymous)"},o=>(s.clear(),t(o,s)),void 0,void 0,()=>s.dispose(),oR)}gAe(bt);class rR extends fy{get debugName(){var e;return(e=E3(this._debugName,this._computeFn,this._owner,this))!==null&&e!==void 0?e:"(anonymous)"}constructor(e,t,i,s,o,r=void 0,a){var l,c;super(),this._owner=e,this._debugName=t,this._computeFn=i,this.createChangeSummary=s,this._handleChange=o,this._handleLastObserverRemoved=r,this._equalityComparator=a,this.state=0,this.value=void 0,this.updateCount=0,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=void 0,this.changeSummary=(l=this.createChangeSummary)===null||l===void 0?void 0:l.call(this),(c=lc())===null||c===void 0||c.handleDerivedCreated(this)}onLastObserverRemoved(){var e;this.state=0,this.value=void 0;for(const t of this.dependencies)t.removeObserver(this);this.dependencies.clear(),(e=this._handleLastObserverRemoved)===null||e===void 0||e.call(this)}get(){var e;if(this.observers.size===0){const t=this._computeFn(this,(e=this.createChangeSummary)===null||e===void 0?void 0:e.call(this));return this.onLastObserverRemoved(),t}else{do{if(this.state===1){for(const t of this.dependencies)if(t.reportChanges(),this.state===2)break}this.state===1&&(this.state=3),this._recomputeIfNeeded()}while(this.state!==3);return this.value}}_recomputeIfNeeded(){var e,t;if(this.state===3)return;const i=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=i;const s=this.state!==0,o=this.value;this.state=3;const r=this.changeSummary;this.changeSummary=(e=this.createChangeSummary)===null||e===void 0?void 0:e.call(this);try{this.value=this._computeFn(this,r)}finally{for(const l of this.dependenciesToBeRemoved)l.removeObserver(this);this.dependenciesToBeRemoved.clear()}const a=s&&!this._equalityComparator(o,this.value);if((t=lc())===null||t===void 0||t.handleDerivedRecomputed(this,{oldValue:o,newValue:this.value,change:void 0,didChange:a,hadValue:s}),a)for(const l of this.observers)l.handleChange(this,void 0)}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){this.updateCount++;const t=this.updateCount===1;if(this.state===3&&(this.state=1,!t))for(const i of this.observers)i.handlePossibleChange(this);if(t)for(const i of this.observers)i.beginUpdate(this)}endUpdate(e){if(this.updateCount--,this.updateCount===0){const t=[...this.observers];for(const i of t)i.endUpdate(this)}if(this.updateCount<0)throw new Gi}handlePossibleChange(e){if(this.state===3&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){this.state=1;for(const t of this.observers)t.handlePossibleChange(this)}}handleChange(e,t){if(this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){const i=this._handleChange?this._handleChange({changedObservable:e,change:t,didChange:o=>o===e},this.changeSummary):!0,s=this.state===3;if(i&&(this.state===1||s)&&(this.state=2,s))for(const o of this.observers)o.handlePossibleChange(this)}}readObservable(e){e.addObserver(this);const t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}addObserver(e){const t=!this.observers.has(e)&&this.updateCount>0;super.addObserver(e),t&&e.beginUpdate(this)}removeObserver(e){const t=this.observers.has(e)&&this.updateCount>0;super.removeObserver(e),t&&e.endUpdate(this)}}function LK(n,e){return new YD(n.debugName,e,void 0,void 0)}function ui(n){return new YD(void 0,n,void 0,void 0)}function KD(n,e){return new YD(n.debugName,e,n.createEmptyChangeSummary,n.handleChange)}function js(n){const e=new pe,t=LK({debugName:()=>ig(n)||"(anonymous)"},i=>{e.clear(),n(i,e)});return Ze(()=>{t.dispose(),e.dispose()})}class YD{get debugName(){if(typeof this._debugName=="string")return this._debugName;if(typeof this._debugName=="function"){const t=this._debugName();if(t!==void 0)return t}const e=ig(this._runFn);return e!==void 0?e:"(anonymous)"}constructor(e,t,i,s){var o,r;this._debugName=e,this._runFn=t,this.createChangeSummary=i,this._handleChange=s,this.state=2,this.updateCount=0,this.disposed=!1,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=(o=this.createChangeSummary)===null||o===void 0?void 0:o.call(this),(r=lc())===null||r===void 0||r.handleAutorunCreated(this),this._runIfNeeded()}dispose(){this.disposed=!0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear()}_runIfNeeded(){var e,t,i;if(this.state===3)return;const s=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=s,this.state=3;try{if(!this.disposed){(e=lc())===null||e===void 0||e.handleAutorunTriggered(this);const o=this.changeSummary;this.changeSummary=(t=this.createChangeSummary)===null||t===void 0?void 0:t.call(this),this._runFn(this,o)}}finally{(i=lc())===null||i===void 0||i.handleAutorunFinished(this);for(const o of this.dependenciesToBeRemoved)o.removeObserver(this);this.dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(){this.state===3&&(this.state=1),this.updateCount++}endUpdate(){if(this.updateCount===1)do{if(this.state===1){this.state=3;for(const e of this.dependencies)if(e.reportChanges(),this.state===2)break}this._runIfNeeded()}while(this.state!==3);this.updateCount--,Hb(()=>this.updateCount>=0)}handlePossibleChange(e){this.state===3&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(this.state=1)}handleChange(e,t){this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(!this._handleChange||this._handleChange({changedObservable:e,change:t,didChange:s=>s===e},this.changeSummary))&&(this.state=2)}readObservable(e){if(this.disposed)return e.get();e.addObserver(this);const t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}}(function(n){n.Observer=YD})(ui||(ui={}));function W8(n){return new bAe(n)}class bAe extends SK{constructor(e){super(),this.value=e}get debugName(){return this.toString()}get(){return this.value}addObserver(e){}removeObserver(e){}toString(){return`Const: ${this.value}`}}function vAe(n,e){return new Promise(t=>{let i=!1,s=!1;const o=ui(r=>{const a=n.read(r);e(a)&&(i?o.dispose():s=!0,t(a))});i=!0,s&&o.dispose()})}function Is(n,e){return new DK(n,e)}class DK extends fy{constructor(e,t){super(),this.event=e,this._getValue=t,this.hasValue=!1,this.handleEvent=i=>{var s;const o=this._getValue(i),r=!this.hasValue||this.value!==o;(s=lc())===null||s===void 0||s.handleFromEventObservableTriggered(this,{oldValue:this.value,newValue:o,change:void 0,didChange:r,hadValue:this.hasValue}),r&&(this.value=o,this.hasValue&&On(a=>{for(const l of this.observers)a.updateObserver(l,this),l.handleChange(this,void 0)},()=>{const a=this.getDebugName();return"Event fired"+(a?`: ${a}`:"")}),this.hasValue=!0)}}getDebugName(){return ig(this._getValue)}get debugName(){const e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0,this.hasValue=!1,this.value=void 0}get(){return this.subscription?(this.hasValue||this.handleEvent(void 0),this.value):this._getValue(void 0)}}(function(n){n.Observer=DK})(Is||(Is={}));function Oo(n,e){return new yAe(n,e)}class yAe extends fy{constructor(e,t){super(),this.debugName=e,this.event=t,this.handleEvent=()=>{On(i=>{for(const s of this.observers)i.updateObserver(s,this),s.handleChange(this,void 0)},()=>this.debugName)}}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}function wAe(n){return new CAe(n)}class CAe extends fy{get debugName(){var e;return(e=E3(this._debugName,void 0,this._owner,this))!==null&&e!==void 0?e:"Observable Signal"}constructor(e,t){super(),this._debugName=e,this._owner=t}trigger(e,t){if(!e){On(i=>{this.trigger(i,t)},()=>`Trigger signal ${this.debugName}`);return}for(const i of this.observers)e.updateObserver(i,this),i.handleChange(this,t)}get(){}}function Rx(n){const e=new SAe(!0);return n.addObserver(e),n.reportChanges(),Ze(()=>{n.removeObserver(e)})}class SAe{constructor(e){this.forceRecompute=e,this.counter=0}beginUpdate(e){this.counter++}endUpdate(e){this.counter--,this.counter===0&&this.forceRecompute&&e.reportChanges()}handlePossibleChange(e){}handleChange(e,t){}}function kK(){return!!vU.VSCODE_DEV}function xAe(n){if(kK()){const e=LAe();return e.add(n),{dispose(){e.delete(n)}}}else return{dispose(){}}}function LAe(){Aw||(Aw=new Set);const n=globalThis;return n.$hotReload_applyNewExports||(n.$hotReload_applyNewExports=e=>{for(const t of Aw){const i=t(e);if(i)return i}}),Aw}let Aw;function DAe(n,e,t,i){if(n.length===0)return e;if(e.length===0)return n;const s=[];let o=0,r=0;for(;od?(s.push(l),r++):(s.push(i(a,l)),o++,r++)}for(;o`Apply decorations from ${e.debugName}`},s=>{const o=e.read(s);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}function Iw(n,e){return n.appendChild(e),Ze(()=>{n.removeChild(e)})}class kAe extends Y{get width(){return this._width}get height(){return this._height}constructor(e,t){super(),this.elementSizeObserver=this._register(new Uj(e,t)),this._width=li(this,this.elementSizeObserver.getWidth()),this._height=li(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(i=>On(s=>{this._width.set(this.elementSizeObserver.getWidth(),s),this._height.set(this.elementSizeObserver.getHeight(),s)})))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}function V8(n,e){let t=n.get(),i=t,s=t;const o=li("animatedValue",t);let r=-1;const a=300;let l;e.add(KD({createEmptyChangeSummary:()=>({animate:!1}),handleChange:(d,u)=>(d.didChange(n)&&(u.animate=u.animate||d.change),!0)},(d,u)=>{l!==void 0&&(cancelAnimationFrame(l),l=void 0),i=s,t=n.read(d),r=Date.now()-(u.animate?0:a),c()}));function c(){const d=Date.now()-r;s=Math.floor(EAe(d,i,t-i,a)),d{this._actualTop.set(i,void 0)},this.onComputedHeight=i=>{this._actualHeight.set(i,void 0)}}}class ZD{constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId=`managedOverlayWidget-${ZD._counter++}`,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}}ZD._counter=0;function Od(n,e){return ui(t=>{for(let[i,s]of Object.entries(e))s&&typeof s=="object"&&"read"in s&&(s=s.read(t)),typeof s=="number"&&(s=`${s}px`),i=i.replace(/[A-Z]/g,o=>"-"+o.toLowerCase()),n.style[i]=s})}function Kc(n,e){return AAe([n],e),n}function AAe(n,e){kK()&&Oo("reload",i=>xAe(s=>{if([...Object.values(s)].some(o=>n.includes(o)))return o=>(i(void 0),!0)})).read(e)}function Ox(n,e,t){const i=new pe,s=[];return i.add(ui(o=>{const r=e.read(o),a=new Map,l=new Map;t&&t(!0),n.changeViewZones(c=>{for(const d of s)c.removeZone(d);s.length=0;for(const d of r){const u=c.addZone(d);s.push(u),a.set(d,u)}}),t&&t(!1),i.add(KD({createEmptyChangeSummary(){return[]},handleChange(c,d){const u=l.get(c.changedObservable);return u!==void 0&&d.push(u),!0}},(c,d)=>{for(const u of r)u.onChange&&(l.set(u.onChange,a.get(u)),u.onChange.read(c));t&&t(!0),n.changeViewZones(u=>{for(const h of d)u.layoutZone(h)}),t&&t(!1)}))})),i.add({dispose(){t&&t(!0),n.changeViewZones(o=>{for(const r of s)o.removeZone(r)}),t&&t(!1)}}),i}class IAe extends Ir{dispose(){super.dispose(!0)}}var A3=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},I3=function(n,e){return function(t,i){e(t,i,n)}},TAe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const NAe=Xi("diff-review-insert",se.add,m("accessibleDiffViewerInsertIcon","Icon for 'Insert' in accessible diff viewer.")),RAe=Xi("diff-review-remove",se.remove,m("accessibleDiffViewerRemoveIcon","Icon for 'Remove' in accessible diff viewer.")),MAe=Xi("diff-review-close",se.close,m("accessibleDiffViewerCloseIcon","Icon for 'Close' in accessible diff viewer."));let yd=class extends Y{constructor(e,t,i,s,o,r,a,l,c){super(),this._parentNode=e,this._visible=t,this._setVisible=i,this._canClose=s,this._width=o,this._height=r,this._diffs=a,this._editors=l,this._instantiationService=c,this.model=Nv(this,(d,u)=>{const h=this._visible.read(d);if(this._parentNode.style.visibility=h?"visible":"hidden",!h)return null;const f=u.add(this._instantiationService.createInstance(aR,this._diffs,this._editors,this._setVisible,this._canClose)),g=u.add(this._instantiationService.createInstance(lR,this._parentNode,f,this._width,this._height,this._editors));return{model:f,view:g}}),this._register(Rx(this.model))}next(){On(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this.model.get().model.nextGroup(e)})}prev(){On(e=>{this._setVisible(!0,e),this.model.get().model.previousGroup(e)})}close(){On(e=>{this._setVisible(!1,e)})}};yd._ttPolicy=jf("diffReview",{createHTML:n=>n});yd=A3([I3(8,yt)],yd);let aR=class extends Y{constructor(e,t,i,s,o){super(),this._diffs=e,this._editors=t,this._setVisible=i,this.canClose=s,this._audioCueService=o,this._groups=li(this,[]),this._currentGroupIdx=li(this,0),this._currentElementIdx=li(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map((r,a)=>this._groups.read(a)[r]),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map((r,a)=>{var l;return(l=this.currentGroup.read(a))===null||l===void 0?void 0:l.lines[r]}),this._register(ui(r=>{const a=this._diffs.read(r);if(!a){this._groups.set([],void 0);return}const l=PAe(a,this._editors.original.getModel().getLineCount(),this._editors.modified.getModel().getLineCount());On(c=>{const d=this._editors.modified.getPosition();if(d){const u=l.findIndex(h=>(d==null?void 0:d.lineNumber){const a=this.currentElement.read(r);(a==null?void 0:a.type)===rs.Deleted?this._audioCueService.playAudioCue(dt.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):(a==null?void 0:a.type)===rs.Added&&this._audioCueService.playAudioCue(dt.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(ui(r=>{var a;const l=this.currentElement.read(r);if(l&&l.type!==rs.Header){const c=(a=l.modifiedLineNumber)!==null&&a!==void 0?a:l.diff.modified.startLineNumber;this._editors.modified.setSelection(N.fromPositions(new V(c,1)))}}))}_goToGroupDelta(e,t){const i=this.groups.get();!i||i.length<=1||pAe(t,s=>{this._currentGroupIdx.set(Ye.ofLength(i.length).clipCyclic(this._currentGroupIdx.get()+e),s),this._currentElementIdx.set(0,s)})}nextGroup(e){this._goToGroupDelta(1,e)}previousGroup(e){this._goToGroupDelta(-1,e)}_goToLineDelta(e){const t=this.currentGroup.get();!t||t.lines.length<=1||On(i=>{this._currentElementIdx.set(Ye.ofLength(t.lines.length).clip(this._currentElementIdx.get()+e),i)})}goToNextLine(){this._goToLineDelta(1)}goToPreviousLine(){this._goToLineDelta(-1)}goToLine(e){const t=this.currentGroup.get();if(!t)return;const i=t.lines.indexOf(e);i!==-1&&On(s=>{this._currentElementIdx.set(i,s)})}revealCurrentElementInEditor(){this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===rs.Deleted?(this._editors.original.setSelection(N.fromPositions(new V(e.originalLineNumber,1))),this._editors.original.revealLine(e.originalLineNumber),this._editors.original.focus()):(e.type!==rs.Header&&(this._editors.modified.setSelection(N.fromPositions(new V(e.modifiedLineNumber,1))),this._editors.modified.revealLine(e.modifiedLineNumber)),this._editors.modified.focus()))}close(){this._setVisible(!1,void 0),this._editors.modified.focus()}};aR=A3([I3(4,qD)],aR);const B0=3;function PAe(n,e,t){const i=[];for(const s of Z$(n,(o,r)=>r.modified.startLineNumber-o.modified.endLineNumberExclusive<2*B0)){const o=[];o.push(new FAe);const r=new Qe(Math.max(1,s[0].original.startLineNumber-B0),Math.min(s[s.length-1].original.endLineNumberExclusive+B0,e+1)),a=new Qe(Math.max(1,s[0].modified.startLineNumber-B0),Math.min(s[s.length-1].modified.endLineNumberExclusive+B0,t+1));X$(s,(d,u)=>{const h=new Qe(d?d.original.endLineNumberExclusive:r.startLineNumber,u?u.original.startLineNumber:r.endLineNumberExclusive),f=new Qe(d?d.modified.endLineNumberExclusive:a.startLineNumber,u?u.modified.startLineNumber:a.endLineNumberExclusive);h.forEach(g=>{o.push(new VAe(g,f.startLineNumber+(g-h.startLineNumber)))}),u&&(u.original.forEach(g=>{o.push(new BAe(u,g))}),u.modified.forEach(g=>{o.push(new WAe(u,g))}))});const l=s[0].modified.join(s[s.length-1].modified),c=s[0].original.join(s[s.length-1].original);i.push(new OAe(new nl(l,c),o))}return i}var rs;(function(n){n[n.Header=0]="Header",n[n.Unchanged=1]="Unchanged",n[n.Deleted=2]="Deleted",n[n.Added=3]="Added"})(rs||(rs={}));class OAe{constructor(e,t){this.range=e,this.lines=t}}class FAe{constructor(){this.type=rs.Header}}class BAe{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=rs.Deleted,this.modifiedLineNumber=void 0}}class WAe{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=rs.Added,this.originalLineNumber=void 0}}class VAe{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=rs.Unchanged}}let lR=class extends Y{constructor(e,t,i,s,o,r){super(),this._element=e,this._model=t,this._width=i,this._height=s,this._editors=o,this._languageService=r,this.domNode=this._element,this.domNode.className="diff-review monaco-editor-background";const a=document.createElement("div");a.className="diff-review-actions",this._actionBar=this._register(new al(a)),this._register(ui(l=>{this._actionBar.clear(),this._model.canClose.read(l)&&this._actionBar.push(new Do("diffreview.close",m("label.close","Close"),"close-diff-review "+Te.asClassName(MAe),!0,()=>TAe(this,void 0,void 0,function*(){return t.close()})),{label:!1,icon:!0})})),this._content=document.createElement("div"),this._content.className="diff-review-content",this._content.setAttribute("role","code"),this._scrollbar=this._register(new SP(this._content,{})),ds(this.domNode,this._scrollbar.getDomNode(),a),this._register(Ze(()=>{ds(this.domNode)})),this._register(Od(this.domNode,{width:this._width,height:this._height})),this._register(Od(this._content,{width:this._width,height:this._height})),this._register(js((l,c)=>{this._model.currentGroup.read(l),this._render(c)})),this._register(ji(this.domNode,"keydown",l=>{(l.equals(18)||l.equals(2066)||l.equals(530))&&(l.preventDefault(),this._model.goToNextLine()),(l.equals(16)||l.equals(2064)||l.equals(528))&&(l.preventDefault(),this._model.goToPreviousLine()),(l.equals(9)||l.equals(2057)||l.equals(521)||l.equals(1033))&&(l.preventDefault(),this._model.close()),(l.equals(10)||l.equals(3))&&(l.preventDefault(),this._model.revealCurrentElementInEditor())}))}_render(e){const t=this._editors.original.getOptions(),i=this._editors.modified.getOptions(),s=document.createElement("div");s.className="diff-review-table",s.setAttribute("role","list"),s.setAttribute("aria-label",m("ariaLabel","Accessible Diff Viewer. Use arrow up and down to navigate.")),Mn(s,i.get(50)),ds(this._content,s);const o=this._editors.original.getModel(),r=this._editors.modified.getModel();if(!o||!r)return;const a=o.getOptions(),l=r.getOptions(),c=i.get(66),d=this._model.currentGroup.get();for(const u of(d==null?void 0:d.lines)||[]){if(!d)break;let h;if(u.type===rs.Header){const g=document.createElement("div");g.className="diff-review-row",g.setAttribute("role","listitem");const p=d.range,_=this._model.currentGroupIndex.get(),v=this._model.groups.get().length,b=L=>L===0?m("no_lines_changed","no lines changed"):L===1?m("one_line_changed","1 line changed"):m("more_lines_changed","{0} lines changed",L),y=b(p.original.length),w=b(p.modified.length);g.setAttribute("aria-label",m({key:"header",comment:["This is the ARIA label for a git diff header.","A git diff header looks like this: @@ -154,12 +159,39 @@.","That encodes that at original line 154 (which is now line 159), 12 lines were removed/changed with 39 lines.","Variables 0 and 1 refer to the diff index out of total number of diffs.","Variables 2 and 4 will be numbers (a line number).",'Variables 3 and 5 will be "no lines changed", "1 line changed" or "X lines changed", localized separately.']},"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",_+1,v,p.original.startLineNumber,y,p.modified.startLineNumber,w));const C=document.createElement("div");C.className="diff-review-cell diff-review-summary",C.appendChild(document.createTextNode(`${_+1}/${v}: @@ -${p.original.startLineNumber},${p.original.length} +${p.modified.startLineNumber},${p.modified.length} @@`)),g.appendChild(C),h=g}else h=this._createRow(u,c,this._width.get(),t,o,a,i,r,l);s.appendChild(h);const f=bt(g=>this._model.currentElement.read(g)===u);e.add(ui(g=>{const p=f.read(g);h.tabIndex=p?0:-1,p&&h.focus()})),e.add(K(h,"focus",()=>{this._model.goToLine(u)}))}this._scrollbar.scanDomNode()}_createRow(e,t,i,s,o,r,a,l,c){const d=s.get(143),u=d.glyphMarginWidth+d.lineNumbersWidth,h=a.get(143),f=10+h.glyphMarginWidth+h.lineNumbersWidth;let g="diff-review-row",p="";const _="diff-review-spacer";let v=null;switch(e.type){case rs.Added:g="diff-review-row line-insert",p=" char-insert",v=NAe;break;case rs.Deleted:g="diff-review-row line-delete",p=" char-delete",v=RAe;break}const b=document.createElement("div");b.style.minWidth=i+"px",b.className=g,b.setAttribute("role","listitem"),b.ariaLevel="";const y=document.createElement("div");y.className="diff-review-cell",y.style.height=`${t}px`,b.appendChild(y);const w=document.createElement("span");w.style.width=u+"px",w.style.minWidth=u+"px",w.className="diff-review-line-number"+p,e.originalLineNumber!==void 0?w.appendChild(document.createTextNode(String(e.originalLineNumber))):w.innerText=" ",y.appendChild(w);const C=document.createElement("span");C.style.width=f+"px",C.style.minWidth=f+"px",C.style.paddingRight="10px",C.className="diff-review-line-number"+p,e.modifiedLineNumber!==void 0?C.appendChild(document.createTextNode(String(e.modifiedLineNumber))):C.innerText=" ",y.appendChild(C);const L=document.createElement("span");if(L.className=_,v){const k=document.createElement("span");k.className=Te.asClassName(v),k.innerText="  ",L.appendChild(k)}else L.innerText="  ";y.appendChild(L);let x;if(e.modifiedLineNumber!==void 0){let k=this._getLineHtml(l,a,c.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);yd._ttPolicy&&(k=yd._ttPolicy.createHTML(k)),y.insertAdjacentHTML("beforeend",k),x=l.getLineContent(e.modifiedLineNumber)}else{let k=this._getLineHtml(o,s,r.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);yd._ttPolicy&&(k=yd._ttPolicy.createHTML(k)),y.insertAdjacentHTML("beforeend",k),x=o.getLineContent(e.originalLineNumber)}x.length===0&&(x=m("blankLine","blank"));let D="";switch(e.type){case rs.Unchanged:e.originalLineNumber===e.modifiedLineNumber?D=m({key:"unchangedLine",comment:["The placeholders are contents of the line and should not be translated."]},"{0} unchanged line {1}",x,e.originalLineNumber):D=m("equalLine","{0} original line {1} modified line {2}",x,e.originalLineNumber,e.modifiedLineNumber);break;case rs.Added:D=m("insertLine","+ {0} modified line {1}",x,e.modifiedLineNumber);break;case rs.Deleted:D=m("deleteLine","- {0} original line {1}",x,e.originalLineNumber);break}return b.setAttribute("aria-label",D),b}_getLineHtml(e,t,i,s,o){const r=e.getLineContent(s),a=t.get(50),l=an.createEmpty(r,o),c=Eo.isBasicASCII(r,e.mightContainNonBasicASCII()),d=Eo.containsRTL(r,c,e.mightContainRTL());return gD(new s0(a.isMonospace&&!t.get(33),a.canUseHalfwidthRightwardsArrow,r,!1,c,d,0,l,[],i,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,t.get(116),t.get(98),t.get(93),t.get(51)!==Mo.OFF,null)).html}};lR=A3([I3(5,Ni)],lR);const zAe=Xi("diff-insert",se.add,m("diffInsertIcon","Line decoration for inserts in the diff editor.")),AK=Xi("diff-remove",se.remove,m("diffRemoveIcon","Line decoration for removals in the diff editor.")),z8=et.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+Te.asClassName(zAe),marginClassName:"gutter-insert"}),H8=et.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+Te.asClassName(AK),marginClassName:"gutter-delete"}),$8=et.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),U8=et.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),j8=et.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),HAe=et.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),$Ae=et.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),cR=et.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),UAe=et.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),jAe=et.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"}),qAe=et.register({description:"diff-editor-arrow-revert-change",glyphMarginHoverMessage:new Mm(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(m("revertChangeHoverMessage","Click to revert change")),glyphMarginClassName:"arrow-revert-change "+Te.asClassName(se.arrowRight),zIndex:10001});class Fd extends Y{constructor(e,t,i,s,o){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=i,this._modifiedEditorLayoutInfo=s,this._editors=o,this._originalScrollTop=Is(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Is(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=Oo("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=li(this,0),this._modifiedViewZonesChangedSignal=Oo("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=Oo("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=Nv((h,f)=>{var g;this._element.replaceChildren();const p=this._diffModel.read(h),_=(g=p==null?void 0:p.diff.read(h))===null||g===void 0?void 0:g.movedTexts;if(!_||_.length===0){this.width.set(0,void 0);return}this._viewZonesChanged.read(h);const v=this._originalEditorLayoutInfo.read(h),b=this._modifiedEditorLayoutInfo.read(h);if(!v||!b){this.width.set(0,void 0);return}this._modifiedViewZonesChangedSignal.read(h),this._originalViewZonesChangedSignal.read(h);const y=_.map(P=>{function O(Se,Ie){const me=Ie.getTopForLineNumber(Se.startLineNumber,!0),ie=Ie.getTopForLineNumber(Se.endLineNumberExclusive,!0);return(me+ie)/2}const M=O(P.lineRangeMapping.original,this._editors.original),R=this._originalScrollTop.read(h),z=O(P.lineRangeMapping.modified,this._editors.modified),G=this._modifiedScrollTop.read(h),te=M-R,ae=z-G,fe=Math.min(M,z),oe=Math.max(M,z);return{range:new Ye(fe,oe),from:te,to:ae,fromWithoutScroll:M,toWithoutScroll:z,move:P}});y.sort(Bhe(mr(P=>P.fromWithoutScroll>P.toWithoutScroll,Whe),mr(P=>P.fromWithoutScroll>P.toWithoutScroll?P.fromWithoutScroll:-P.toWithoutScroll,Ld)));const w=T3.compute(y.map(P=>P.range)),C=10,L=v.verticalScrollbarWidth,x=(w.getTrackCount()-1)*10+C*2,D=L+x+(b.contentLeft-Fd.movedCodeBlockPadding);let k=0;for(const P of y){const O=w.getTrack(k),M=L+C+O*10,R=15,z=15,G=D,te=b.glyphMarginWidth+b.lineNumbersWidth,ae=18,fe=document.createElementNS("http://www.w3.org/2000/svg","rect");fe.classList.add("arrow-rectangle"),fe.setAttribute("x",`${G-te}`),fe.setAttribute("y",`${P.to-ae/2}`),fe.setAttribute("width",`${te}`),fe.setAttribute("height",`${ae}`),this._element.appendChild(fe);const oe=document.createElementNS("http://www.w3.org/2000/svg","g"),Se=document.createElementNS("http://www.w3.org/2000/svg","path");Se.setAttribute("d",`M 0 ${P.from} L ${M} ${P.from} L ${M} ${P.to} L ${G-z} ${P.to}`),Se.setAttribute("fill","none"),oe.appendChild(Se);const Ie=document.createElementNS("http://www.w3.org/2000/svg","polygon");Ie.classList.add("arrow"),f.add(ui(me=>{Se.classList.toggle("currentMove",P.move===p.activeMovedText.read(me)),Ie.classList.toggle("currentMove",P.move===p.activeMovedText.read(me))})),Ie.setAttribute("points",`${G-z},${P.to-R/2} ${G},${P.to} ${G-z},${P.to+R/2}`),oe.appendChild(Ie),this._element.appendChild(oe),k++}this.width.set(x,void 0)}),this._element=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("class","moved-blocks-lines"),this._rootElement.appendChild(this._element),this._register(Ze(()=>this._element.remove())),this._register(ui(h=>{const f=this._originalEditorLayoutInfo.read(h),g=this._modifiedEditorLayoutInfo.read(h);!f||!g||(this._element.style.left=`${f.width-f.verticalScrollbarWidth}px`,this._element.style.height=`${f.height}px`,this._element.style.width=`${f.verticalScrollbarWidth+f.contentLeft-Fd.movedCodeBlockPadding+this.width.read(h)}px`)})),this._register(Rx(this._state));const r=bt(h=>{const f=this._diffModel.read(h),g=f==null?void 0:f.diff.read(h);return g?g.movedTexts.map(p=>({move:p,original:new Px(W8(p.lineRangeMapping.original.startLineNumber-1),18),modified:new Px(W8(p.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(Ox(this._editors.original,r.map(h=>h.map(f=>f.original)))),this._register(Ox(this._editors.modified,r.map(h=>h.map(f=>f.modified)))),this._register(js((h,f)=>{const g=r.read(h);for(const p of g)f.add(new q8(this._editors.original,p.original,p.move,"original",this._diffModel.get())),f.add(new q8(this._editors.modified,p.modified,p.move,"modified",this._diffModel.get()))}));const a=Is(this._editors.original.onDidChangeCursorPosition,()=>this._editors.original.getPosition()),l=Is(this._editors.modified.onDidChangeCursorPosition,()=>this._editors.modified.getPosition()),c=Oo("original.onDidFocusEditorWidget",h=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>h(void 0),0))),d=Oo("modified.onDidFocusEditorWidget",h=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>h(void 0),0)));let u="modified";this._register(KD({createEmptyChangeSummary:()=>{},handleChange:(h,f)=>(h.didChange(c)&&(u="original"),h.didChange(d)&&(u="modified"),!0)},h=>{c.read(h),d.read(h);const f=this._diffModel.read(h);if(!f)return;const g=f.diff.read(h);let p;if(g&&u==="original"){const _=a.read(h);_&&(p=g.movedTexts.find(v=>v.lineRangeMapping.original.contains(_.lineNumber)))}if(g&&u==="modified"){const _=l.read(h);_&&(p=g.movedTexts.find(v=>v.lineRangeMapping.modified.contains(_.lineNumber)))}p!==f.movedTextToCompare.get()&&f.movedTextToCompare.set(void 0,void 0),f.setActiveMovedText(p)}))}}Fd.movedCodeBlockPadding=4;class T3{static compute(e){const t=[],i=[];for(const s of e){let o=t.findIndex(r=>!r.intersectsStrict(s));o===-1&&(t.length>=6?o=o_e(t,mr(a=>a.intersectWithRangeLength(s),Ld)):(o=t.length,t.push(new sP))),t[o].addRange(s),i.push(o)}return new T3(t.length,i)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class q8 extends EK{constructor(e,t,i,s,o){const r=hn("div.diff-hidden-lines-widget");super(e,t,r.root),this._editor=e,this._move=i,this._kind=s,this._diffModel=o,this._nodes=hn("div.diff-moved-code-block",{style:{marginRight:"4px"}},[hn("div.text-content@textContent"),hn("div.action-bar@actionBar")]),r.root.appendChild(this._nodes.root);const a=Is(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(Od(this._nodes.root,{paddingRight:a.map(h=>h.verticalScrollbarWidth)}));let l;i.changes.length>0?l=this._kind==="original"?m("codeMovedToWithChanges","Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):m("codeMovedFromWithChanges","Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):l=this._kind==="original"?m("codeMovedTo","Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):m("codeMovedFrom","Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const c=this._register(new al(this._nodes.actionBar,{highlightToggledItems:!0})),d=new Do("",l,"",!1);c.push(d,{icon:!1,label:!0});const u=new Do("","Compare",Te.asClassName(se.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===i?void 0:this._move,void 0)});this._register(ui(h=>{const f=this._diffModel.movedTextToCompare.read(h)===i;u.checked=f})),c.push(u,{icon:!1,label:!0})}}class GAe extends Y{constructor(e,t,i){super(),this._editors=e,this._diffModel=t,this._options=i,this._decorations=bt(this,s=>{var o;const r=(o=this._diffModel.read(s))===null||o===void 0?void 0:o.diff.read(s);if(!r)return null;const a=this._diffModel.read(s).movedTextToCompare.read(s),l=this._options.renderIndicators.read(s),c=this._options.showEmptyDecorations.read(s),d=[],u=[];if(!a)for(const f of r.mappings){if(f.lineRangeMapping.original.isEmpty||d.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:l?H8:U8}),f.lineRangeMapping.modified.isEmpty||u.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:l?z8:$8}),f.lineRangeMapping.modified.isEmpty||f.lineRangeMapping.original.isEmpty)f.lineRangeMapping.original.isEmpty||d.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:UAe}),f.lineRangeMapping.modified.isEmpty||u.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:HAe});else for(const g of f.lineRangeMapping.innerChanges||[])f.lineRangeMapping.original.contains(g.originalRange.startLineNumber)&&d.push({range:g.originalRange,options:g.originalRange.isEmpty()&&c?jAe:cR}),f.lineRangeMapping.modified.contains(g.modifiedRange.startLineNumber)&&u.push({range:g.modifiedRange,options:g.modifiedRange.isEmpty()&&c?$Ae:j8});!f.lineRangeMapping.modified.isEmpty&&this._options.shouldRenderRevertArrows.read(s)&&!a&&u.push({range:N.fromPositions(new V(f.lineRangeMapping.modified.startLineNumber,1)),options:qAe})}if(a)for(const f of a.changes){const g=f.original.toInclusiveRange();g&&d.push({range:g,options:l?H8:U8});const p=f.modified.toInclusiveRange();p&&u.push({range:p,options:l?z8:$8});for(const _ of f.innerChanges||[])d.push({range:_.originalRange,options:cR}),u.push({range:_.modifiedRange,options:j8})}const h=this._diffModel.read(s).activeMovedText.read(s);for(const f of r.movedTexts)d.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(f===h?" currentMove":""),blockPadding:[Fd.movedCodeBlockPadding,0,Fd.movedCodeBlockPadding,Fd.movedCodeBlockPadding]}}),u.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(f===h?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:d,modifiedDecorations:u}}),this._register(Mx(this._editors.original,this._decorations.map(s=>(s==null?void 0:s.originalDecorations)||[]))),this._register(Mx(this._editors.modified,this._decorations.map(s=>(s==null?void 0:s.modifiedDecorations)||[])))}}class KAe extends Y{constructor(e,t,i){super(),this._options=e,this._domNode=t,this._dimensions=i,this._sashRatio=li(this,void 0),this.sashLeft=bt(this,s=>{var o;const r=(o=this._sashRatio.read(s))!==null&&o!==void 0?o:this._options.splitViewDefaultRatio.read(s);return this._computeSashLeft(r,s)}),this._sash=this._register(new En(this._domNode,{getVerticalSashTop:s=>0,getVerticalSashLeft:s=>this.sashLeft.get(),getVerticalSashHeight:s=>this._dimensions.height.get()},{orientation:0})),this._startSashPosition=void 0,this._register(this._sash.onDidStart(()=>{this._startSashPosition=this.sashLeft.get()})),this._register(this._sash.onDidChange(s=>{const o=this._dimensions.width.get(),r=this._computeSashLeft((this._startSashPosition+(s.currentX-s.startX))/o,void 0);this._sashRatio.set(r/o,void 0)})),this._register(this._sash.onDidEnd(()=>this._sash.layout())),this._register(this._sash.onDidReset(()=>this._sashRatio.set(void 0,void 0))),this._register(ui(s=>{const o=this._options.enableSplitViewResizing.read(s);this._sash.state=o?3:0,this.sashLeft.read(s),this._dimensions.height.read(s),this._sash.layout()}))}setBoundarySashes(e){this._sash.orthogonalEndSash=e.bottom}_computeSashLeft(e,t){const i=this._dimensions.width.read(t),s=Math.floor(this._options.splitViewDefaultRatio.read(t)*i),o=this._options.enableSplitViewResizing.read(t)?Math.floor(e*i):s,r=100;return i<=r*2?s:oi-r?i-r:o}}class sp{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 s=i;for(let o=0;t.children.get(s)!==void 0;o++)s=`${i}_${o}`;return s}static empty(e){return e.children.size===0}}class G8 extends sp{constructor(e,t,i){super(),this.id=e,this.parent=t,this.symbol=i,this.children=new Map}}class YAe extends sp{constructor(e,t,i,s){super(),this.id=e,this.parent=t,this.label=i,this.order=s,this.children=new Map}}class Yc extends sp{static create(e,t,i){const s=new Ir(i),o=new Yc(t.uri),r=e.ordered(t),a=r.map((c,d)=>{var u;const h=sp.findId(`provider_${d}`,o),f=new YAe(h,o,(u=c.displayName)!==null&&u!==void 0?u:"Unknown Outline Provider",d);return Promise.resolve(c.provideDocumentSymbols(t,s.token)).then(g=>{for(const p of g||[])Yc._makeOutlineElement(p,f);return f},g=>(wc(g),f)).then(g=>{sp.empty(g)?g.remove():o._groups.set(h,g)})}),l=e.onDidChange(()=>{const c=e.ordered(t);Zi(c,r)||s.cancel()});return Promise.all(a).then(()=>s.token.isCancellationRequested&&!i.isCancellationRequested?Yc.create(e,t,i):o._compact()).finally(()=>{s.dispose(),l.dispose()})}static _makeOutlineElement(e,t){const i=sp.findId(e,t),s=new G8(i,t,e);if(e.children)for(const o of e.children)Yc._makeOutlineElement(o,s);t.children.set(s.id,s)}constructor(e){super(),this.uri=e,this.id="root",this.parent=void 0,this._groups=new Map,this.children=new Map,this.id="root",this.parent=void 0}_compact(){let e=0;for(const[t,i]of this._groups)i.children.size===0?this._groups.delete(t):e+=1;if(e!==1)this.children=this._groups;else{const t=ht.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 G8?e.push(t.symbol):e.push(...ht.map(t.children.values(),i=>i.symbol));return e.sort((t,i)=>N.compareRangesUsingStarts(t.range,i.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return Yc._flattenDocumentSymbols(t,e,""),t.sort((i,s)=>V.compare(N.getStartPosition(i.range),N.getStartPosition(s.range))||V.compare(N.getEndPosition(s.range),N.getEndPosition(i.range)))}static _flattenDocumentSymbols(e,t,i){for(const s of t)e.push({kind:s.kind,tags:s.tags,name:s.name,detail:s.detail,containerName:s.containerName||i,range:s.range,selectionRange:s.selectionRange,children:void 0}),s.children&&Yc._flattenDocumentSymbols(e,s.children,s.name)}}var IK=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},TK=function(n,e){return function(t,i){e(t,i,n)}},ZAe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let dR=class extends Y{get isUpdatingViewZones(){return this._isUpdatingViewZones}constructor(e,t,i,s){super(),this._editors=e,this._diffModel=t,this._options=i,this._languageFeaturesService=s,this._isUpdatingViewZones=!1,this._modifiedOutlineSource=Nv(this,(c,d)=>{const u=this._editors.modifiedModel.read(c);if(u)return d.add(new uR(this._languageFeaturesService,u))}),this._register(this._editors.original.onDidChangeCursorPosition(c=>{if(c.reason===3){const d=this._diffModel.get();On(u=>{for(const h of this._editors.original.getSelections()||[])d==null||d.ensureOriginalLineIsVisible(h.getStartPosition().lineNumber,u),d==null||d.ensureOriginalLineIsVisible(h.getEndPosition().lineNumber,u)})}})),this._register(this._editors.modified.onDidChangeCursorPosition(c=>{if(c.reason===3){const d=this._diffModel.get();On(u=>{for(const h of this._editors.modified.getSelections()||[])d==null||d.ensureModifiedLineIsVisible(h.getStartPosition().lineNumber,u),d==null||d.ensureModifiedLineIsVisible(h.getEndPosition().lineNumber,u)})}}));const o=this._diffModel.map((c,d)=>{var u,h;return((u=c==null?void 0:c.diff.read(d))===null||u===void 0?void 0:u.mappings.length)===0?[]:(h=c==null?void 0:c.unchangedRegions.read(d))!==null&&h!==void 0?h:[]}),r=Nv(this,(c,d)=>{const u=this._modifiedOutlineSource.read(c);if(!u)return{origViewZones:[],modViewZones:[]};const h=[],f=[],g=this._options.renderSideBySide.read(c),p=o.read(c);for(const _ of p)if(!_.shouldHideControls(c)){{const v=bt(y=>_.getHiddenOriginalRange(y).startLineNumber-1),b=new Px(v,24);h.push(b),d.add(new K8(this._editors.original,b,_,_.originalUnchangedRange,!g,u,y=>this._diffModel.get().ensureModifiedLineIsVisible(y,void 0),this._options))}{const v=bt(y=>_.getHiddenModifiedRange(y).startLineNumber-1),b=new Px(v,24);f.push(b),d.add(new K8(this._editors.modified,b,_,_.modifiedUnchangedRange,!1,u,y=>this._diffModel.get().ensureModifiedLineIsVisible(y,void 0),this._options))}}return{origViewZones:h,modViewZones:f}}),a={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},l={description:"Fold Unchanged",glyphMarginHoverMessage:new Mm(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(m("foldUnchanged","Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+Te.asClassName(se.fold),zIndex:10001};this._register(Mx(this._editors.original,bt(c=>{const d=o.read(c),u=d.map(h=>({range:h.originalUnchangedRange.toInclusiveRange(),options:a}));for(const h of d)h.shouldHideControls(c)&&u.push({range:N.fromPositions(new V(h.originalLineNumber,1)),options:l});return u}))),this._register(Mx(this._editors.modified,bt(c=>{const d=o.read(c),u=d.map(h=>({range:h.modifiedUnchangedRange.toInclusiveRange(),options:a}));for(const h of d)h.shouldHideControls(c)&&u.push({range:Qe.ofLength(h.modifiedLineNumber,1).toInclusiveRange(),options:l});return u}))),this._register(Ox(this._editors.original,r.map(c=>c.origViewZones),c=>this._isUpdatingViewZones=c)),this._register(Ox(this._editors.modified,r.map(c=>c.modViewZones),c=>this._isUpdatingViewZones=c)),this._register(ui(c=>{const d=o.read(c);this._editors.original.setHiddenAreas(d.map(u=>u.getHiddenOriginalRange(c).toInclusiveRange()).filter(bS)),this._editors.modified.setHiddenAreas(d.map(u=>u.getHiddenModifiedRange(c).toInclusiveRange()).filter(bS))})),this._register(this._editors.modified.onMouseUp(c=>{var d;if(!c.event.rightButton&&c.target.position&&(!((d=c.target.element)===null||d===void 0)&&d.className.includes("fold-unchanged"))){const u=c.target.position.lineNumber,h=this._diffModel.get();if(!h)return;const f=h.unchangedRegions.get().find(g=>g.modifiedUnchangedRange.includes(u));if(!f)return;f.collapseAll(void 0),c.event.stopPropagation(),c.event.preventDefault()}})),this._register(this._editors.original.onMouseUp(c=>{var d;if(!c.event.rightButton&&c.target.position&&(!((d=c.target.element)===null||d===void 0)&&d.className.includes("fold-unchanged"))){const u=c.target.position.lineNumber,h=this._diffModel.get();if(!h)return;const f=h.unchangedRegions.get().find(g=>g.originalUnchangedRange.includes(u));if(!f)return;f.collapseAll(void 0),c.event.stopPropagation(),c.event.preventDefault()}}))}};dR=IK([TK(3,nt)],dR);let uR=class extends Y{constructor(e,t){super(),this._languageFeaturesService=e,this._textModel=t,this._currentModel=li(this,void 0);const i=Oo("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),s=Oo("_textModel.onDidChangeContent",ue.debounce(o=>this._textModel.onDidChangeContent(o),()=>{},100));this._register(js((o,r)=>ZAe(this,void 0,void 0,function*(){i.read(o),s.read(o);const a=r.add(new IAe),l=yield Yc.create(this._languageFeaturesService.documentSymbolProvider,this._textModel,a.token);r.isDisposed||this._currentModel.set(l,void 0)})))}getBreadcrumbItems(e,t){const i=this._currentModel.read(t);if(!i)return[];const s=i.asListOfDocumentSymbols().filter(o=>e.contains(o.range.startLineNumber)&&!e.contains(o.range.endLineNumber));return s.sort(tU(mr(o=>o.range.endLineNumber-o.range.startLineNumber,Ld))),s.map(o=>({name:o.name,kind:o.kind,startLineNumber:o.range.startLineNumber}))}};uR=IK([TK(0,nt)],uR);class K8 extends EK{constructor(e,t,i,s,o,r,a,l){const c=hn("div.diff-hidden-lines-widget");super(e,t,c.root),this._editor=e,this._unchangedRegion=i,this._unchangedRegionRange=s,this.hide=o,this._modifiedOutlineSource=r,this._revealModifiedHiddenLine=a,this._options=l,this._nodes=hn("div.diff-hidden-lines",[hn("div.top@top",{title:m("diff.hiddenLines.top","Click or drag to show more above")}),hn("div.center@content",{style:{display:"flex"}},[hn("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[ye("a",{title:m("showAll","Show all"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...nf("$(unfold)"))]),hn("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),hn("div.bottom@bottom",{title:m("diff.bottom","Click or drag to show more below"),role:"button"})]),c.root.appendChild(this._nodes.root);const d=Is(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this.hide?ds(this._nodes.first):this._register(Od(this._nodes.first,{width:d.map(h=>h.contentLeft)}));const u=this._editor;this._register(K(this._nodes.top,"mousedown",h=>{if(h.button!==0)return;this._nodes.top.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const f=h.clientY;let g=!1;const p=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set(!0,void 0);const _=K(window,"mousemove",b=>{const w=b.clientY-f;g=g||Math.abs(w)>2;const C=Math.round(w/u.getOption(66)),L=Math.max(0,Math.min(p+C,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(L,void 0)}),v=K(window,"mouseup",b=>{g||this._unchangedRegion.showMoreAbove(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0),this._nodes.top.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),this._unchangedRegion.isDragged.set(!1,void 0),_.dispose(),v.dispose()})})),this._register(K(this._nodes.bottom,"mousedown",h=>{if(h.button!==0)return;this._nodes.bottom.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const f=h.clientY;let g=!1;const p=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set(!0,void 0);const _=K(window,"mousemove",b=>{const w=b.clientY-f;g=g||Math.abs(w)>2;const C=Math.round(w/u.getOption(66)),L=Math.max(0,Math.min(p-C,this._unchangedRegion.getMaxVisibleLineCountBottom())),x=u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(L,void 0);const D=u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);u.setScrollTop(u.getScrollTop()+(D-x))}),v=K(window,"mouseup",b=>{if(this._unchangedRegion.isDragged.set(!1,void 0),!g){const y=u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const w=u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);u.setScrollTop(u.getScrollTop()+(w-y))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),_.dispose(),v.dispose()})})),this._register(ui(h=>{const f=[];if(!this.hide){const g=i.getHiddenModifiedRange(h).length,p=m("hiddenLines","{0} hidden lines",g),_=ye("span",{title:m("diff.hiddenLines.expandAll","Double click to unfold")},p);_.addEventListener("dblclick",y=>{y.button===0&&(y.preventDefault(),this._unchangedRegion.showAll(void 0))}),f.push(_);const v=this._unchangedRegion.getHiddenModifiedRange(h),b=this._modifiedOutlineSource.getBreadcrumbItems(v,h);if(b.length>0){f.push(ye("span",void 0,"  |  "));for(let y=0;y{this._revealModifiedHiddenLine(w.startLineNumber)}}}}ds(this._nodes.others,...f)}))}}class Rv{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new Rv(e.getScrollTop(),e.getContentHeight(),null,0,null);let t=null,i=0;const s=e.getVisibleRanges();if(s.length>0){t=s[0].getStartPosition();const o=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-o}return new Rv(e.getScrollTop(),e.getContentHeight(),t,i,e.getPosition())}constructor(e,t,i,s,o){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=s,this._cursorPosition=o}restore(e){if(!(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())&&this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){if(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())return;const t=e.getPosition();if(!this._cursorPosition||!t)return;const i=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+i)}}var XAe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Y8=function(n,e){return function(t,i){e(t,i,n)}},QAe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},oh;let Fx=oh=class{constructor(e,t,i){this.editorWorkerService=t,this.telemetryService=i,this.onDidChangeEventEmitter=new B,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="advanced",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(e)}dispose(){var e;(e=this.diffAlgorithmOnDidChangeSubscription)===null||e===void 0||e.dispose()}computeDiff(e,t,i,s){var o,r;return QAe(this,void 0,void 0,function*(){if(typeof this.diffAlgorithm!="string")return this.diffAlgorithm.computeDiff(e,t,i,s);if(e.getLineCount()===1&&e.getLineMaxColumn(1)===1)return t.getLineCount()===1&&t.getLineMaxColumn(1)===1?{changes:[],identical:!0,quitEarly:!1,moves:[]}:{changes:[new Ko(new Qe(1,2),new Qe(1,t.getLineCount()+1),[new su(e.getFullModelRange(),t.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};const a=JSON.stringify([e.uri.toString(),t.uri.toString()]),l=JSON.stringify([e.id,t.id,e.getAlternativeVersionId(),t.getAlternativeVersionId(),JSON.stringify(i)]),c=oh.diffCache.get(a);if(c&&c.context===l)return c.result;const d=Cu.create(),u=yield this.editorWorkerService.computeDiff(e.uri,t.uri,i,this.diffAlgorithm),h=d.elapsed();if(this.telemetryService.publicLog2("diffEditor.computeDiff",{timeMs:h,timedOut:(o=u==null?void 0:u.quitEarly)!==null&&o!==void 0?o:!0,detectedMoves:i.computeMoves?(r=u==null?void 0:u.moves.length)!==null&&r!==void 0?r:0:-1}),s.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!u)throw new Error("no diff result available");return oh.diffCache.size>10&&oh.diffCache.delete(oh.diffCache.keys().next().value),oh.diffCache.set(a,{result:u,context:l}),u})}setOptions(e){var t;let i=!1;e.diffAlgorithm&&this.diffAlgorithm!==e.diffAlgorithm&&((t=this.diffAlgorithmOnDidChangeSubscription)===null||t===void 0||t.dispose(),this.diffAlgorithmOnDidChangeSubscription=void 0,this.diffAlgorithm=e.diffAlgorithm,typeof e.diffAlgorithm!="string"&&(this.diffAlgorithmOnDidChangeSubscription=e.diffAlgorithm.onDidChange(()=>this.onDidChangeEventEmitter.fire())),i=!0),i&&this.onDidChangeEventEmitter.fire()}};Fx.diffCache=new Map;Fx=oh=XAe([Y8(1,ry),Y8(2,Cc)],Fx);var JAe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},eIe=function(n,e){return function(t,i){e(t,i,n)}};const NK=at("diffProviderFactoryService");let hR=class{constructor(e){this.instantiationService=e}createDiffProvider(e,t){return this.instantiationService.createInstance(Fx,t)}};hR=JAe([eIe(0,yt)],hR);gt(NK,hR,1);var tIe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},iIe=function(n,e){return function(t,i){e(t,i,n)}},Z8=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let fR=class extends Y{setActiveMovedText(e){this._activeMovedText.set(e,void 0)}constructor(e,t,i,s){super(),this.model=e,this._options=t,this._editor=i,this._diffProviderFactoryService=s,this._isDiffUpToDate=li(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=li(this,void 0),this.diff=this._diff,this._unchangedRegions=li(this,{regions:[],originalDecorationIds:[],modifiedDecorationIds:[]}),this.unchangedRegions=bt(this,l=>this._options.hideUnchangedRegions.read(l)?this._unchangedRegions.read(l).regions:(On(c=>{for(const d of this._unchangedRegions.get().regions)d.collapseAll(c)}),[])),this.movedTextToCompare=li(this,void 0),this._activeMovedText=li(this,void 0),this._hoveredMovedText=li(this,void 0),this.activeMovedText=bt(this,l=>{var c,d;return(d=(c=this.movedTextToCompare.read(l))!==null&&c!==void 0?c:this._hoveredMovedText.read(l))!==null&&d!==void 0?d:this._activeMovedText.read(l)}),this._cancellationTokenSource=new Ir,this._diffProvider=bt(this,l=>{const c=this._diffProviderFactoryService.createDiffProvider(this._editor,{diffAlgorithm:this._options.diffAlgorithm.read(l)}),d=Oo("onDidChange",c.onDidChange);return{diffProvider:c,onChangeSignal:d}}),this._register(Ze(()=>this._cancellationTokenSource.cancel()));const o=wAe("contentChangedSignal"),r=this._register(new Di(()=>o.trigger(void 0),200)),a=(l,c,d)=>{const u=Bx.fromDiffs(l.changes,e.original.getLineCount(),e.modified.getLineCount(),this._options.hideUnchangedRegionsMinimumLineCount.read(d),this._options.hideUnchangedRegionsContextLineCount.read(d)),h=this._unchangedRegions.get(),f=h.originalDecorationIds.map(v=>e.original.getDecorationRange(v)).filter(v=>!!v).map(v=>Qe.fromRange(v)),g=h.modifiedDecorationIds.map(v=>e.modified.getDecorationRange(v)).filter(v=>!!v).map(v=>Qe.fromRange(v)),p=e.original.deltaDecorations(h.originalDecorationIds,u.map(v=>({range:v.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),_=e.modified.deltaDecorations(h.modifiedDecorationIds,u.map(v=>({range:v.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));for(const v of u)for(let b=0;b{if(this._diff.get()){const d=ic.fromModelContentChanges(l.changes);this._lastDiff,e.original,e.modified}r.schedule()})),this._register(e.original.onDidChangeContent(l=>{if(this._diff.get()){const d=ic.fromModelContentChanges(l.changes);this._lastDiff,e.original,e.modified}r.schedule()})),this._register(js((l,c)=>Z8(this,void 0,void 0,function*(){var d,u;this._options.hideUnchangedRegionsMinimumLineCount.read(l),this._options.hideUnchangedRegionsContextLineCount.read(l),r.cancel(),o.read(l);const h=this._diffProvider.read(l);h.onChangeSignal.read(l),Kc(Nj,l),Kc(yT,l),this._isDiffUpToDate.set(!1,void 0);let f=[];c.add(e.original.onDidChangeContent(_=>{const v=ic.fromModelContentChanges(_.changes);f=tx(f,v)}));let g=[];c.add(e.modified.onDidChangeContent(_=>{const v=ic.fromModelContentChanges(_.changes);g=tx(g,v)}));let p=yield h.diffProvider.computeDiff(e.original,e.modified,{ignoreTrimWhitespace:this._options.ignoreTrimWhitespace.read(l),maxComputationTimeMs:this._options.maxComputationTimeMs.read(l),computeMoves:this._options.showMoves.read(l)},this._cancellationTokenSource.token);this._cancellationTokenSource.token.isCancellationRequested||(p=nIe(p,e.original,e.modified),p=(d=(e.original,e.modified,void 0))!==null&&d!==void 0?d:p,p=(u=(e.original,e.modified,void 0))!==null&&u!==void 0?u:p,On(_=>{a(p,_),this._lastDiff=p;const v=N3.fromDiffResult(p);this._diff.set(v,_),this._isDiffUpToDate.set(!0,_);const b=this.movedTextToCompare.get();this.movedTextToCompare.set(b?this._lastDiff.moves.find(y=>y.lineRangeMapping.modified.intersect(b.lineRangeMapping.modified)):void 0,_)}))})))}ensureModifiedLineIsVisible(e,t){var i;if(((i=this.diff.get())===null||i===void 0?void 0:i.mappings.length)===0)return;const s=this._unchangedRegions.get().regions;for(const o of s)if(o.getHiddenModifiedRange(void 0).contains(e)){o.showModifiedLine(e,t);return}}ensureOriginalLineIsVisible(e,t){var i;if(((i=this.diff.get())===null||i===void 0?void 0:i.mappings.length)===0)return;const s=this._unchangedRegions.get().regions;for(const o of s)if(o.getHiddenOriginalRange(void 0).contains(e)){o.showOriginalLine(e,t);return}}waitForDiff(){return Z8(this,void 0,void 0,function*(){yield vAe(this.isDiffUpToDate,e=>e)})}serializeState(){return{collapsedRegions:this._unchangedRegions.get().regions.map(t=>({range:t.getHiddenModifiedRange(void 0).serialize()}))}}restoreSerializedState(e){const t=e.collapsedRegions.map(s=>Qe.deserialize(s.range)),i=this._unchangedRegions.get();On(s=>{for(const o of i.regions)for(const r of t)if(o.modifiedUnchangedRange.intersect(r)){o.setHiddenModifiedRange(r,s);break}})}};fR=tIe([iIe(3,NK)],fR);function nIe(n,e,t){return{changes:n.changes.map(i=>new Ko(i.original,i.modified,i.innerChanges?i.innerChanges.map(s=>sIe(s,e,t)):void 0)),moves:n.moves,identical:n.identical,quitEarly:n.quitEarly}}function sIe(n,e,t){let i=n.originalRange,s=n.modifiedRange;return(i.endColumn!==1||s.endColumn!==1)&&i.endColumn===e.getLineMaxColumn(i.endLineNumber)&&s.endColumn===t.getLineMaxColumn(s.endLineNumber)&&i.endLineNumbernew RK(t)),e.moves||[],e.identical,e.quitEarly)}constructor(e,t,i,s){this.mappings=e,this.movedTexts=t,this.identical=i,this.quitEarly=s}}class RK{constructor(e){this.lineRangeMapping=e}}class Bx{static fromDiffs(e,t,i,s,o){const r=Ko.inverse(e,t,i),a=[];for(const l of r){let c=l.original.startLineNumber,d=l.modified.startLineNumber,u=l.original.length;const h=c===1&&d===1,f=c+u===t+1&&d+u===i+1;(h||f)&&u>=o+s?(h&&!f&&(u-=o),f&&!h&&(c+=o,d+=o,u-=o),a.push(new Bx(c,d,u,0,0))):u>=o*2+s&&(c+=o,d+=o,u-=o*2,a.push(new Bx(c,d,u,0,0)))}return a}get originalUnchangedRange(){return Qe.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return Qe.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,i,s,o){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=i,this._visibleLineCountTop=li(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=li(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=bt(this,r=>this.visibleLineCountTop.read(r)+this.visibleLineCountBottom.read(r)===this.lineCount&&!this.isDragged.read(r)),this.isDragged=li(this,!1),this._visibleLineCountTop.set(s,void 0),this._visibleLineCountBottom.set(o,void 0)}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return Qe.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return Qe.ofLength(this.modifiedLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}setHiddenModifiedRange(e,t){const i=e.startLineNumber-this.modifiedLineNumber,s=this.modifiedLineNumber+this.lineCount-e.endLineNumberExclusive;this.setState(i,s,t)}getMaxVisibleLineCountTop(){return this.lineCount-this._visibleLineCountBottom.get()}getMaxVisibleLineCountBottom(){return this.lineCount-this._visibleLineCountTop.get()}showMoreAbove(e=10,t){const i=this.getMaxVisibleLineCountTop();this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+e,i),t)}showMoreBelow(e=10,t){const i=this.lineCount-this._visibleLineCountTop.get();this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+e,i),t)}showAll(e){this._visibleLineCountBottom.set(this.lineCount-this._visibleLineCountTop.get(),e)}showModifiedLine(e,t){const i=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),s=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;i{var _;this._contextMenuService.showContextMenu({domForShadowRoot:h&&(_=i.getDomNode())!==null&&_!==void 0?_:void 0,getAnchor:()=>({x:g,y:p}),getActions:()=>{const v=[],b=s.modified.isEmpty;return v.push(new Do("diff.clipboard.copyDeletedContent",b?s.original.length>1?m("diff.clipboard.copyDeletedLinesContent.label","Copy deleted lines"):m("diff.clipboard.copyDeletedLinesContent.single.label","Copy deleted line"):s.original.length>1?m("diff.clipboard.copyChangedLinesContent.label","Copy changed lines"):m("diff.clipboard.copyChangedLinesContent.single.label","Copy changed line"),void 0,!0,()=>bE(this,void 0,void 0,function*(){const w=this._originalTextModel.getValueInRange(s.original.toExclusiveRange());yield this._clipboardService.writeText(w)}))),s.original.length>1&&v.push(new Do("diff.clipboard.copyDeletedLineContent",b?m("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",s.original.startLineNumber+u):m("diff.clipboard.copyChangedLineContent.label","Copy changed line ({0})",s.original.startLineNumber+u),void 0,!0,()=>bE(this,void 0,void 0,function*(){let w=this._originalTextModel.getLineContent(s.original.startLineNumber+u);w===""&&(w=this._originalTextModel.getEndOfLineSequence()===0?` +`}};QN=Ru([gn(0,ii)],QN);class kAe{publicLog2(){}}class Rv{constructor(){const e=Ue.from({scheme:Rv.SCHEME,authority:"model",path:"/"});this.workspace={id:QLe,folders:[new ZLe({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===Rv.SCHEME?this.workspace.folders[0]:null}}Rv.SCHEME="inmemory";function Lx(n,e,t){if(!e||!(n instanceof yK))return;const i=[];Object.keys(e).forEach(s=>{ELe(s)&&i.push([`editor.${s}`,e[s]]),t&&ALe(s)&&i.push([`diffEditor.${s}`,e[s]])}),i.length>0&&n.updateValues(i)}let JN=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}apply(e,t){return Pp(this,void 0,void 0,function*(){const i=Array.isArray(e)?e:U3.convert(e),s=new Map;for(const a of i){if(!(a instanceof sf))throw new Error("bad edit - only text edits are supported");const l=this._modelService.getModel(a.resource);if(!l)throw new Error("bad edit - model not found");if(typeof a.versionId=="number"&&l.getVersionId()!==a.versionId)throw new Error("bad state - model changed in the meantime");let c=s.get(l);c||(c=[],s.set(l,c)),c.push(TLe.replaceMove(N.lift(a.textEdit.range),a.textEdit.text))}let o=0,r=0;for(const[a,l]of s)a.pushStackElement(),a.pushEditOperations([],l,()=>[]),a.pushStackElement(),r+=1,o+=l.length;return{ariaSummary:Vb(sN.bulkEditServiceSummary,o,r),isApplied:o>0}})}};JN=Ru([gn(0,hs)],JN);class EAe{getUriLabel(e,t){return e.scheme==="file"?e.fsPath:e.path}getUriBasenameLabel(e){return ra(e)}}let eR=class extends oN{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,i){if(!t){const s=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();s&&(t=s.getContainerDomNode())}return super.showContextView(e,t,i)}};eR=Ru([gn(0,d0),gn(1,jt)],eR);class AAe{constructor(){this._neverEmitter=new B,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}}class IAe extends Cv{constructor(){super()}}class TAe extends vAe{constructor(){super(new qpe)}}let tR=class extends CN{constructor(e,t,i,s,o,r){super(e,t,i,s,o,r),this.configure({blockMouse:!1})}};tR=Ru([gn(0,Cc),gn(1,xn),gn(2,Tu),gn(3,bi),gn(4,Du),gn(5,et)],tR);class NAe{playAudioCue(e,t){return Pp(this,void 0,void 0,function*(){})}}ft(ii,yK,0);ft(Rj,XN,0);ft(Mj,QN,0);ft(YLe,Rv,0);ft(CD,EAe,0);ft(Cc,kAe,0);ft(Jq,LAe,0);ft(sG,xAe,0);ft(xn,Nv,0);ft(ml,Gc,0);ft(Ni,IAe,0);ft(Nr,JEe,0);ft(Sc,TAe,0);ft(hs,mx,0);ft(d3,kN,0);ft(et,KN,0);ft(ULe,SAe,0);ft(oy,VD,0);ft(tg,Bke,0);ft(ly,vT,0);ft(uG,JN,0);ft(JLe,AAe,0);ft(Lu,YN,0);ft(Au,$N,0);ft(Qo,eEe,0);ft(fs,ZN,0);ft(bi,zm,0);ft(wP,zN,0);ft(Tu,eR,0);ft(Dc,DN,0);ft(gy,GN,0);ft(Nu,tR,0);ft(Du,UN,0);ft(WD,NAe,0);var Ae;(function(n){const e=new vD;for(const[l,c]of v9())e.set(l,c);const t=new xx(e,!0);e.set(vt,t);function i(l){s||r({});const c=e.get(l);if(!c)throw new Error("Missing service "+l);return c instanceof La?t.invokeFunction(d=>d.get(l)):c}n.get=i;let s=!1;const o=new B;function r(l){if(s)return t;s=!0;for(const[d,u]of v9())e.get(d)||e.set(d,u);for(const d in l)if(l.hasOwnProperty(d)){const u=rt(d);e.get(u)instanceof La&&e.set(u,l[d])}const c=wAe();for(const d of c)try{t.createInstance(d)}catch(u){mt(u)}return o.fire(),t}n.initialize=r;function a(l){if(s)return l();const c=new pe,d=c.add(o.event(()=>{d.dispose(),c.add(l())}));return c}n.withServices=a})(Ae||(Ae={}));let RAe;function cc(){return RAe}let wK;function MAe(n){wK=n}class CK{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,t){const i=t===void 0?void 0:e,s=t===void 0?e:t;return wK({owner:i,debugName:()=>{const o=og(s);if(o!==void 0)return o;const a=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(s.toString());if(a)return`${this.debugName}.${a[2]}`;if(!i)return`${this.debugName} (mapped)`}},o=>s(this.read(o),o))}}class py extends CK{constructor(){super(...arguments),this.observers=new Set}addObserver(e){const t=this.observers.size;this.observers.add(e),t===0&&this.onFirstObserverAdded()}removeObserver(e){this.observers.delete(e)&&this.observers.size===0&&this.onLastObserverRemoved()}onFirstObserverAdded(){}onLastObserverRemoved(){}}function Mn(n,e){const t=new SK(n,e);try{n(t)}finally{t.finish()}}function PAe(n,e,t){n?e(n):Mn(e,t)}class SK{constructor(e,t){var i;this._fn=e,this._getDebugName=t,this.updatingObservers=[],(i=cc())===null||i===void 0||i.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():og(this._fn)}updateObserver(e,t){this.updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){var e;const t=this.updatingObservers;this.updatingObservers=null;for(const{observer:i,observable:s}of t)i.endUpdate(s);(e=cc())===null||e===void 0||e.handleEndTransaction()}}function DP(n,e,t,i){let s;if(n!==void 0)if(typeof n=="function"){if(s=n(),s!==void 0)return s}else return n;if(e!==void 0&&(s=og(e),s!==void 0))return s;if(t!==void 0){for(const o in t)if(t[o]===i)return o}}function og(n){const e=n.toString(),i=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e),s=i?i[1]:void 0;return s==null?void 0:s.trim()}function ai(n,e){return typeof n=="string"?new iR(void 0,n,e):new iR(n,void 0,e)}class iR extends py{get debugName(){var e;return(e=DP(this._debugName,void 0,this._owner,this))!==null&&e!==void 0?e:"ObservableValue"}constructor(e,t,i){super(),this._owner=e,this._debugName=t,this._value=i}get(){return this._value}set(e,t,i){var s;if(this._value===e)return;let o;t||(t=o=new SK(()=>{},()=>`Setting ${this.debugName}`));try{const r=this._value;this._setValue(e),(s=cc())===null||s===void 0||s.handleObservableChanged(this,{oldValue:r,newValue:e,change:i,didChange:!0,hadValue:!0});for(const a of this.observers)t.updateObserver(a,this),a.handleChange(this,i)}finally{o&&o.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function OAe(n,e){return new FAe(void 0,n,e)}class FAe extends iR{_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){var e;(e=this._value)===null||e===void 0||e.dispose()}}const nR=(n,e)=>n===e;function _t(n,e){return e!==void 0?new sR(n,void 0,e,void 0,void 0,void 0,nR):new sR(void 0,void 0,n,void 0,void 0,void 0,nR)}function Mv(n,e){let t,i;e===void 0?(t=n,i=void 0):(i=n,t=e);const s=new pe;return new sR(i,()=>{var o;return(o=og(t))!==null&&o!==void 0?o:"(anonymous)"},o=>(s.clear(),t(o,s)),void 0,void 0,()=>s.dispose(),nR)}MAe(_t);class sR extends py{get debugName(){var e;return(e=DP(this._debugName,this._computeFn,this._owner,this))!==null&&e!==void 0?e:"(anonymous)"}constructor(e,t,i,s,o,r=void 0,a){var l,c;super(),this._owner=e,this._debugName=t,this._computeFn=i,this.createChangeSummary=s,this._handleChange=o,this._handleLastObserverRemoved=r,this._equalityComparator=a,this.state=0,this.value=void 0,this.updateCount=0,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=void 0,this.changeSummary=(l=this.createChangeSummary)===null||l===void 0?void 0:l.call(this),(c=cc())===null||c===void 0||c.handleDerivedCreated(this)}onLastObserverRemoved(){var e;this.state=0,this.value=void 0;for(const t of this.dependencies)t.removeObserver(this);this.dependencies.clear(),(e=this._handleLastObserverRemoved)===null||e===void 0||e.call(this)}get(){var e;if(this.observers.size===0){const t=this._computeFn(this,(e=this.createChangeSummary)===null||e===void 0?void 0:e.call(this));return this.onLastObserverRemoved(),t}else{do{if(this.state===1){for(const t of this.dependencies)if(t.reportChanges(),this.state===2)break}this.state===1&&(this.state=3),this._recomputeIfNeeded()}while(this.state!==3);return this.value}}_recomputeIfNeeded(){var e,t;if(this.state===3)return;const i=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=i;const s=this.state!==0,o=this.value;this.state=3;const r=this.changeSummary;this.changeSummary=(e=this.createChangeSummary)===null||e===void 0?void 0:e.call(this);try{this.value=this._computeFn(this,r)}finally{for(const l of this.dependenciesToBeRemoved)l.removeObserver(this);this.dependenciesToBeRemoved.clear()}const a=s&&!this._equalityComparator(o,this.value);if((t=cc())===null||t===void 0||t.handleDerivedRecomputed(this,{oldValue:o,newValue:this.value,change:void 0,didChange:a,hadValue:s}),a)for(const l of this.observers)l.handleChange(this,void 0)}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){this.updateCount++;const t=this.updateCount===1;if(this.state===3&&(this.state=1,!t))for(const i of this.observers)i.handlePossibleChange(this);if(t)for(const i of this.observers)i.beginUpdate(this)}endUpdate(e){if(this.updateCount--,this.updateCount===0){const t=[...this.observers];for(const i of t)i.endUpdate(this)}if(this.updateCount<0)throw new qi}handlePossibleChange(e){if(this.state===3&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){this.state=1;for(const t of this.observers)t.handlePossibleChange(this)}}handleChange(e,t){if(this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){const i=this._handleChange?this._handleChange({changedObservable:e,change:t,didChange:o=>o===e},this.changeSummary):!0,s=this.state===3;if(i&&(this.state===1||s)&&(this.state=2,s))for(const o of this.observers)o.handlePossibleChange(this)}}readObservable(e){e.addObserver(this);const t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}addObserver(e){const t=!this.observers.has(e)&&this.updateCount>0;super.addObserver(e),t&&e.beginUpdate(this)}removeObserver(e){const t=this.observers.has(e)&&this.updateCount>0;super.removeObserver(e),t&&e.endUpdate(this)}}function xK(n,e){return new HD(n.debugName,e,void 0,void 0)}function di(n){return new HD(void 0,n,void 0,void 0)}function zD(n,e){return new HD(n.debugName,e,n.createEmptyChangeSummary,n.handleChange)}function $s(n){const e=new pe,t=xK({debugName:()=>og(n)||"(anonymous)"},i=>{e.clear(),n(i,e)});return Ye(()=>{t.dispose(),e.dispose()})}class HD{get debugName(){if(typeof this._debugName=="string")return this._debugName;if(typeof this._debugName=="function"){const t=this._debugName();if(t!==void 0)return t}const e=og(this._runFn);return e!==void 0?e:"(anonymous)"}constructor(e,t,i,s){var o,r;this._debugName=e,this._runFn=t,this.createChangeSummary=i,this._handleChange=s,this.state=2,this.updateCount=0,this.disposed=!1,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=(o=this.createChangeSummary)===null||o===void 0?void 0:o.call(this),(r=cc())===null||r===void 0||r.handleAutorunCreated(this),this._runIfNeeded()}dispose(){this.disposed=!0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear()}_runIfNeeded(){var e,t,i;if(this.state===3)return;const s=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=s,this.state=3;try{if(!this.disposed){(e=cc())===null||e===void 0||e.handleAutorunTriggered(this);const o=this.changeSummary;this.changeSummary=(t=this.createChangeSummary)===null||t===void 0?void 0:t.call(this),this._runFn(this,o)}}finally{(i=cc())===null||i===void 0||i.handleAutorunFinished(this);for(const o of this.dependenciesToBeRemoved)o.removeObserver(this);this.dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(){this.state===3&&(this.state=1),this.updateCount++}endUpdate(){if(this.updateCount===1)do{if(this.state===1){this.state=3;for(const e of this.dependencies)if(e.reportChanges(),this.state===2)break}this._runIfNeeded()}while(this.state!==3);this.updateCount--,Ub(()=>this.updateCount>=0)}handlePossibleChange(e){this.state===3&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(this.state=1)}handleChange(e,t){this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(!this._handleChange||this._handleChange({changedObservable:e,change:t,didChange:s=>s===e},this.changeSummary))&&(this.state=2)}readObservable(e){if(this.disposed)return e.get();e.addObserver(this);const t=e.get();return this.dependencies.add(e),this.dependenciesToBeRemoved.delete(e),t}}(function(n){n.Observer=HD})(di||(di={}));function P8(n){return new BAe(n)}class BAe extends CK{constructor(e){super(),this.value=e}get debugName(){return this.toString()}get(){return this.value}addObserver(e){}removeObserver(e){}toString(){return`Const: ${this.value}`}}function WAe(n,e){return new Promise(t=>{let i=!1,s=!1;const o=di(r=>{const a=n.read(r);e(a)&&(i?o.dispose():s=!0,t(a))});i=!0,s&&o.dispose()})}function As(n,e){return new LK(n,e)}class LK extends py{constructor(e,t){super(),this.event=e,this._getValue=t,this.hasValue=!1,this.handleEvent=i=>{var s;const o=this._getValue(i),r=!this.hasValue||this.value!==o;(s=cc())===null||s===void 0||s.handleFromEventObservableTriggered(this,{oldValue:this.value,newValue:o,change:void 0,didChange:r,hadValue:this.hasValue}),r&&(this.value=o,this.hasValue&&Mn(a=>{for(const l of this.observers)a.updateObserver(l,this),l.handleChange(this,void 0)},()=>{const a=this.getDebugName();return"Event fired"+(a?`: ${a}`:"")}),this.hasValue=!0)}}getDebugName(){return og(this._getValue)}get debugName(){const e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0,this.hasValue=!1,this.value=void 0}get(){return this.subscription?(this.hasValue||this.handleEvent(void 0),this.value):this._getValue(void 0)}}(function(n){n.Observer=LK})(As||(As={}));function Ro(n,e){return new VAe(n,e)}class VAe extends py{constructor(e,t){super(),this.debugName=e,this.event=t,this.handleEvent=()=>{Mn(i=>{for(const s of this.observers)i.updateObserver(s,this),s.handleChange(this,void 0)},()=>this.debugName)}}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}function zAe(n){return new HAe(n)}class HAe extends py{get debugName(){var e;return(e=DP(this._debugName,void 0,this._owner,this))!==null&&e!==void 0?e:"Observable Signal"}constructor(e,t){super(),this._debugName=e,this._owner=t}trigger(e,t){if(!e){Mn(i=>{this.trigger(i,t)},()=>`Trigger signal ${this.debugName}`);return}for(const i of this.observers)e.updateObserver(i,this),i.handleChange(this,t)}get(){}}function Dx(n){const e=new $Ae(!0);return n.addObserver(e),n.reportChanges(),Ye(()=>{n.removeObserver(e)})}class $Ae{constructor(e){this.forceRecompute=e,this.counter=0}beginUpdate(e){this.counter++}endUpdate(e){this.counter--,this.counter===0&&this.forceRecompute&&e.reportChanges()}handlePossibleChange(e){}handleChange(e,t){}}function DK(){return!!bU.VSCODE_DEV}function UAe(n){if(DK()){const e=jAe();return e.add(n),{dispose(){e.delete(n)}}}else return{dispose(){}}}function jAe(){Sw||(Sw=new Set);const n=globalThis;return n.$hotReload_applyNewExports||(n.$hotReload_applyNewExports=e=>{for(const t of Sw){const i=t(e);if(i)return i}}),Sw}let Sw;function qAe(n,e,t,i){if(n.length===0)return e;if(e.length===0)return n;const s=[];let o=0,r=0;for(;od?(s.push(l),r++):(s.push(i(a,l)),o++,r++)}for(;o`Apply decorations from ${e.debugName}`},s=>{const o=e.read(s);i.set(o)})),t.add({dispose:()=>{i.clear()}}),t}function xw(n,e){return n.appendChild(e),Ye(()=>{n.removeChild(e)})}class GAe extends Y{get width(){return this._width}get height(){return this._height}constructor(e,t){super(),this.elementSizeObserver=this._register(new $j(e,t)),this._width=ai(this,this.elementSizeObserver.getWidth()),this._height=ai(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange(i=>Mn(s=>{this._width.set(this.elementSizeObserver.getWidth(),s),this._height.set(this.elementSizeObserver.getHeight(),s)})))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}function O8(n,e){let t=n.get(),i=t,s=t;const o=ai("animatedValue",t);let r=-1;const a=300;let l;e.add(zD({createEmptyChangeSummary:()=>({animate:!1}),handleChange:(d,u)=>(d.didChange(n)&&(u.animate=u.animate||d.change),!0)},(d,u)=>{l!==void 0&&(cancelAnimationFrame(l),l=void 0),i=s,t=n.read(d),r=Date.now()-(u.animate?0:a),c()}));function c(){const d=Date.now()-r;s=Math.floor(KAe(d,i,t-i,a)),d{this._actualTop.set(i,void 0)},this.onComputedHeight=i=>{this._actualHeight.set(i,void 0)}}}class $D{constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId=`managedOverlayWidget-${$D._counter++}`,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}}$D._counter=0;function Fd(n,e){return di(t=>{for(let[i,s]of Object.entries(e))s&&typeof s=="object"&&"read"in s&&(s=s.read(t)),typeof s=="number"&&(s=`${s}px`),i=i.replace(/[A-Z]/g,o=>"-"+o.toLowerCase()),n.style[i]=s})}function Kc(n,e){return YAe([n],e),n}function YAe(n,e){DK()&&Ro("reload",i=>UAe(s=>{if([...Object.values(s)].some(o=>n.includes(o)))return o=>(i(void 0),!0)})).read(e)}function Ax(n,e,t){const i=new pe,s=[];return i.add(di(o=>{const r=e.read(o),a=new Map,l=new Map;t&&t(!0),n.changeViewZones(c=>{for(const d of s)c.removeZone(d);s.length=0;for(const d of r){const u=c.addZone(d);s.push(u),a.set(d,u)}}),t&&t(!1),i.add(zD({createEmptyChangeSummary(){return[]},handleChange(c,d){const u=l.get(c.changedObservable);return u!==void 0&&d.push(u),!0}},(c,d)=>{for(const u of r)u.onChange&&(l.set(u.onChange,a.get(u)),u.onChange.read(c));t&&t(!0),n.changeViewZones(u=>{for(const h of d)u.layoutZone(h)}),t&&t(!1)}))})),i.add({dispose(){t&&t(!0),n.changeViewZones(o=>{for(const r of s)o.removeZone(r)}),t&&t(!1)}}),i}class ZAe extends Ar{dispose(){super.dispose(!0)}}var kP=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},EP=function(n,e){return function(t,i){e(t,i,n)}},XAe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const QAe=Zi("diff-review-insert",se.add,m("accessibleDiffViewerInsertIcon","Icon for 'Insert' in accessible diff viewer.")),JAe=Zi("diff-review-remove",se.remove,m("accessibleDiffViewerRemoveIcon","Icon for 'Remove' in accessible diff viewer.")),eIe=Zi("diff-review-close",se.close,m("accessibleDiffViewerCloseIcon","Icon for 'Close' in accessible diff viewer."));let wd=class extends Y{constructor(e,t,i,s,o,r,a,l,c){super(),this._parentNode=e,this._visible=t,this._setVisible=i,this._canClose=s,this._width=o,this._height=r,this._diffs=a,this._editors=l,this._instantiationService=c,this.model=Mv(this,(d,u)=>{const h=this._visible.read(d);if(this._parentNode.style.visibility=h?"visible":"hidden",!h)return null;const f=u.add(this._instantiationService.createInstance(oR,this._diffs,this._editors,this._setVisible,this._canClose)),g=u.add(this._instantiationService.createInstance(rR,this._parentNode,f,this._width,this._height,this._editors));return{model:f,view:g}}),this._register(Dx(this.model))}next(){Mn(e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this.model.get().model.nextGroup(e)})}prev(){Mn(e=>{this._setVisible(!0,e),this.model.get().model.previousGroup(e)})}close(){Mn(e=>{this._setVisible(!1,e)})}};wd._ttPolicy=Kf("diffReview",{createHTML:n=>n});wd=kP([EP(8,vt)],wd);let oR=class extends Y{constructor(e,t,i,s,o){super(),this._diffs=e,this._editors=t,this._setVisible=i,this.canClose=s,this._audioCueService=o,this._groups=ai(this,[]),this._currentGroupIdx=ai(this,0),this._currentElementIdx=ai(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map((r,a)=>this._groups.read(a)[r]),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map((r,a)=>{var l;return(l=this.currentGroup.read(a))===null||l===void 0?void 0:l.lines[r]}),this._register(di(r=>{const a=this._diffs.read(r);if(!a){this._groups.set([],void 0);return}const l=tIe(a,this._editors.original.getModel().getLineCount(),this._editors.modified.getModel().getLineCount());Mn(c=>{const d=this._editors.modified.getPosition();if(d){const u=l.findIndex(h=>(d==null?void 0:d.lineNumber){const a=this.currentElement.read(r);(a==null?void 0:a.type)===ss.Deleted?this._audioCueService.playAudioCue(ct.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):(a==null?void 0:a.type)===ss.Added&&this._audioCueService.playAudioCue(ct.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})})),this._register(di(r=>{var a;const l=this.currentElement.read(r);if(l&&l.type!==ss.Header){const c=(a=l.modifiedLineNumber)!==null&&a!==void 0?a:l.diff.modified.startLineNumber;this._editors.modified.setSelection(N.fromPositions(new V(c,1)))}}))}_goToGroupDelta(e,t){const i=this.groups.get();!i||i.length<=1||PAe(t,s=>{this._currentGroupIdx.set(Ke.ofLength(i.length).clipCyclic(this._currentGroupIdx.get()+e),s),this._currentElementIdx.set(0,s)})}nextGroup(e){this._goToGroupDelta(1,e)}previousGroup(e){this._goToGroupDelta(-1,e)}_goToLineDelta(e){const t=this.currentGroup.get();!t||t.lines.length<=1||Mn(i=>{this._currentElementIdx.set(Ke.ofLength(t.lines.length).clip(this._currentElementIdx.get()+e),i)})}goToNextLine(){this._goToLineDelta(1)}goToPreviousLine(){this._goToLineDelta(-1)}goToLine(e){const t=this.currentGroup.get();if(!t)return;const i=t.lines.indexOf(e);i!==-1&&Mn(s=>{this._currentElementIdx.set(i,s)})}revealCurrentElementInEditor(){this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===ss.Deleted?(this._editors.original.setSelection(N.fromPositions(new V(e.originalLineNumber,1))),this._editors.original.revealLine(e.originalLineNumber),this._editors.original.focus()):(e.type!==ss.Header&&(this._editors.modified.setSelection(N.fromPositions(new V(e.modifiedLineNumber,1))),this._editors.modified.revealLine(e.modifiedLineNumber)),this._editors.modified.focus()))}close(){this._setVisible(!1,void 0),this._editors.modified.focus()}};oR=kP([EP(4,WD)],oR);const H0=3;function tIe(n,e,t){const i=[];for(const s of Y$(n,(o,r)=>r.modified.startLineNumber-o.modified.endLineNumberExclusive<2*H0)){const o=[];o.push(new nIe);const r=new Xe(Math.max(1,s[0].original.startLineNumber-H0),Math.min(s[s.length-1].original.endLineNumberExclusive+H0,e+1)),a=new Xe(Math.max(1,s[0].modified.startLineNumber-H0),Math.min(s[s.length-1].modified.endLineNumberExclusive+H0,t+1));Z$(s,(d,u)=>{const h=new Xe(d?d.original.endLineNumberExclusive:r.startLineNumber,u?u.original.startLineNumber:r.endLineNumberExclusive),f=new Xe(d?d.modified.endLineNumberExclusive:a.startLineNumber,u?u.modified.startLineNumber:a.endLineNumberExclusive);h.forEach(g=>{o.push(new rIe(g,f.startLineNumber+(g-h.startLineNumber)))}),u&&(u.original.forEach(g=>{o.push(new sIe(u,g))}),u.modified.forEach(g=>{o.push(new oIe(u,g))}))});const l=s[0].modified.join(s[s.length-1].modified),c=s[0].original.join(s[s.length-1].original);i.push(new iIe(new nl(l,c),o))}return i}var ss;(function(n){n[n.Header=0]="Header",n[n.Unchanged=1]="Unchanged",n[n.Deleted=2]="Deleted",n[n.Added=3]="Added"})(ss||(ss={}));class iIe{constructor(e,t){this.range=e,this.lines=t}}class nIe{constructor(){this.type=ss.Header}}class sIe{constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=ss.Deleted,this.modifiedLineNumber=void 0}}class oIe{constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=ss.Added,this.originalLineNumber=void 0}}class rIe{constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=ss.Unchanged}}let rR=class extends Y{constructor(e,t,i,s,o,r){super(),this._element=e,this._model=t,this._width=i,this._height=s,this._editors=o,this._languageService=r,this.domNode=this._element,this.domNode.className="diff-review monaco-editor-background";const a=document.createElement("div");a.className="diff-review-actions",this._actionBar=this._register(new al(a)),this._register(di(l=>{this._actionBar.clear(),this._model.canClose.read(l)&&this._actionBar.push(new So("diffreview.close",m("label.close","Close"),"close-diff-review "+Te.asClassName(eIe),!0,()=>XAe(this,void 0,void 0,function*(){return t.close()})),{label:!1,icon:!0})})),this._content=document.createElement("div"),this._content.className="diff-review-content",this._content.setAttribute("role","code"),this._scrollbar=this._register(new w3(this._content,{})),ls(this.domNode,this._scrollbar.getDomNode(),a),this._register(Ye(()=>{ls(this.domNode)})),this._register(Fd(this.domNode,{width:this._width,height:this._height})),this._register(Fd(this._content,{width:this._width,height:this._height})),this._register($s((l,c)=>{this._model.currentGroup.read(l),this._render(c)})),this._register(Ui(this.domNode,"keydown",l=>{(l.equals(18)||l.equals(2066)||l.equals(530))&&(l.preventDefault(),this._model.goToNextLine()),(l.equals(16)||l.equals(2064)||l.equals(528))&&(l.preventDefault(),this._model.goToPreviousLine()),(l.equals(9)||l.equals(2057)||l.equals(521)||l.equals(1033))&&(l.preventDefault(),this._model.close()),(l.equals(10)||l.equals(3))&&(l.preventDefault(),this._model.revealCurrentElementInEditor())}))}_render(e){const t=this._editors.original.getOptions(),i=this._editors.modified.getOptions(),s=document.createElement("div");s.className="diff-review-table",s.setAttribute("role","list"),s.setAttribute("aria-label",m("ariaLabel","Accessible Diff Viewer. Use arrow up and down to navigate.")),Nn(s,i.get(50)),ls(this._content,s);const o=this._editors.original.getModel(),r=this._editors.modified.getModel();if(!o||!r)return;const a=o.getOptions(),l=r.getOptions(),c=i.get(66),d=this._model.currentGroup.get();for(const u of(d==null?void 0:d.lines)||[]){if(!d)break;let h;if(u.type===ss.Header){const g=document.createElement("div");g.className="diff-review-row",g.setAttribute("role","listitem");const p=d.range,_=this._model.currentGroupIndex.get(),v=this._model.groups.get().length,b=L=>L===0?m("no_lines_changed","no lines changed"):L===1?m("one_line_changed","1 line changed"):m("more_lines_changed","{0} lines changed",L),y=b(p.original.length),w=b(p.modified.length);g.setAttribute("aria-label",m({key:"header",comment:["This is the ARIA label for a git diff header.","A git diff header looks like this: @@ -154,12 +159,39 @@.","That encodes that at original line 154 (which is now line 159), 12 lines were removed/changed with 39 lines.","Variables 0 and 1 refer to the diff index out of total number of diffs.","Variables 2 and 4 will be numbers (a line number).",'Variables 3 and 5 will be "no lines changed", "1 line changed" or "X lines changed", localized separately.']},"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",_+1,v,p.original.startLineNumber,y,p.modified.startLineNumber,w));const S=document.createElement("div");S.className="diff-review-cell diff-review-summary",S.appendChild(document.createTextNode(`${_+1}/${v}: @@ -${p.original.startLineNumber},${p.original.length} +${p.modified.startLineNumber},${p.modified.length} @@`)),g.appendChild(S),h=g}else h=this._createRow(u,c,this._width.get(),t,o,a,i,r,l);s.appendChild(h);const f=_t(g=>this._model.currentElement.read(g)===u);e.add(di(g=>{const p=f.read(g);h.tabIndex=p?0:-1,p&&h.focus()})),e.add(K(h,"focus",()=>{this._model.goToLine(u)}))}this._scrollbar.scanDomNode()}_createRow(e,t,i,s,o,r,a,l,c){const d=s.get(143),u=d.glyphMarginWidth+d.lineNumbersWidth,h=a.get(143),f=10+h.glyphMarginWidth+h.lineNumbersWidth;let g="diff-review-row",p="";const _="diff-review-spacer";let v=null;switch(e.type){case ss.Added:g="diff-review-row line-insert",p=" char-insert",v=QAe;break;case ss.Deleted:g="diff-review-row line-delete",p=" char-delete",v=JAe;break}const b=document.createElement("div");b.style.minWidth=i+"px",b.className=g,b.setAttribute("role","listitem"),b.ariaLevel="";const y=document.createElement("div");y.className="diff-review-cell",y.style.height=`${t}px`,b.appendChild(y);const w=document.createElement("span");w.style.width=u+"px",w.style.minWidth=u+"px",w.className="diff-review-line-number"+p,e.originalLineNumber!==void 0?w.appendChild(document.createTextNode(String(e.originalLineNumber))):w.innerText=" ",y.appendChild(w);const S=document.createElement("span");S.style.width=f+"px",S.style.minWidth=f+"px",S.style.paddingRight="10px",S.className="diff-review-line-number"+p,e.modifiedLineNumber!==void 0?S.appendChild(document.createTextNode(String(e.modifiedLineNumber))):S.innerText=" ",y.appendChild(S);const L=document.createElement("span");if(L.className=_,v){const k=document.createElement("span");k.className=Te.asClassName(v),k.innerText="  ",L.appendChild(k)}else L.innerText="  ";y.appendChild(L);let x;if(e.modifiedLineNumber!==void 0){let k=this._getLineHtml(l,a,c.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);wd._ttPolicy&&(k=wd._ttPolicy.createHTML(k)),y.insertAdjacentHTML("beforeend",k),x=l.getLineContent(e.modifiedLineNumber)}else{let k=this._getLineHtml(o,s,r.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);wd._ttPolicy&&(k=wd._ttPolicy.createHTML(k)),y.insertAdjacentHTML("beforeend",k),x=o.getLineContent(e.originalLineNumber)}x.length===0&&(x=m("blankLine","blank"));let D="";switch(e.type){case ss.Unchanged:e.originalLineNumber===e.modifiedLineNumber?D=m({key:"unchangedLine",comment:["The placeholders are contents of the line and should not be translated."]},"{0} unchanged line {1}",x,e.originalLineNumber):D=m("equalLine","{0} original line {1} modified line {2}",x,e.originalLineNumber,e.modifiedLineNumber);break;case ss.Added:D=m("insertLine","+ {0} modified line {1}",x,e.modifiedLineNumber);break;case ss.Deleted:D=m("deleteLine","- {0} original line {1}",x,e.originalLineNumber);break}return b.setAttribute("aria-label",D),b}_getLineHtml(e,t,i,s,o){const r=e.getLineContent(s),a=t.get(50),l=on.createEmpty(r,o),c=Lo.isBasicASCII(r,e.mightContainNonBasicASCII()),d=Lo.containsRTL(r,c,e.mightContainRTL());return aD(new l0(a.isMonospace&&!t.get(33),a.canUseHalfwidthRightwardsArrow,r,!1,c,d,0,l,[],i,0,a.spaceWidth,a.middotWidth,a.wsmiddotWidth,t.get(116),t.get(98),t.get(93),t.get(51)!==To.OFF,null)).html}};rR=kP([EP(5,Ni)],rR);const aIe=Zi("diff-insert",se.add,m("diffInsertIcon","Line decoration for inserts in the diff editor.")),EK=Zi("diff-remove",se.remove,m("diffRemoveIcon","Line decoration for removals in the diff editor.")),F8=Je.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+Te.asClassName(aIe),marginClassName:"gutter-insert"}),B8=Je.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+Te.asClassName(EK),marginClassName:"gutter-delete"}),W8=Je.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),V8=Je.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),z8=Je.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),lIe=Je.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),cIe=Je.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),aR=Je.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),dIe=Je.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),uIe=Je.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"}),hIe=Je.register({description:"diff-editor-arrow-revert-change",glyphMarginHoverMessage:new Fm(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(m("revertChangeHoverMessage","Click to revert change")),glyphMarginClassName:"arrow-revert-change "+Te.asClassName(se.arrowRight),zIndex:10001});class Bd extends Y{constructor(e,t,i,s,o){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=i,this._modifiedEditorLayoutInfo=s,this._editors=o,this._originalScrollTop=As(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=As(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._viewZonesChanged=Ro("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=ai(this,0),this._modifiedViewZonesChangedSignal=Ro("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=Ro("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=Mv((h,f)=>{var g;this._element.replaceChildren();const p=this._diffModel.read(h),_=(g=p==null?void 0:p.diff.read(h))===null||g===void 0?void 0:g.movedTexts;if(!_||_.length===0){this.width.set(0,void 0);return}this._viewZonesChanged.read(h);const v=this._originalEditorLayoutInfo.read(h),b=this._modifiedEditorLayoutInfo.read(h);if(!v||!b){this.width.set(0,void 0);return}this._modifiedViewZonesChangedSignal.read(h),this._originalViewZonesChangedSignal.read(h);const y=_.map(P=>{function O(Se,Ie){const me=Ie.getTopForLineNumber(Se.startLineNumber,!0),ie=Ie.getTopForLineNumber(Se.endLineNumberExclusive,!0);return(me+ie)/2}const M=O(P.lineRangeMapping.original,this._editors.original),R=this._originalScrollTop.read(h),z=O(P.lineRangeMapping.modified,this._editors.modified),G=this._modifiedScrollTop.read(h),te=M-R,ae=z-G,fe=Math.min(M,z),oe=Math.max(M,z);return{range:new Ke(fe,oe),from:te,to:ae,fromWithoutScroll:M,toWithoutScroll:z,move:P}});y.sort(sfe(pr(P=>P.fromWithoutScroll>P.toWithoutScroll,ofe),pr(P=>P.fromWithoutScroll>P.toWithoutScroll?P.fromWithoutScroll:-P.toWithoutScroll,Dd)));const w=AP.compute(y.map(P=>P.range)),S=10,L=v.verticalScrollbarWidth,x=(w.getTrackCount()-1)*10+S*2,D=L+x+(b.contentLeft-Bd.movedCodeBlockPadding);let k=0;for(const P of y){const O=w.getTrack(k),M=L+S+O*10,R=15,z=15,G=D,te=b.glyphMarginWidth+b.lineNumbersWidth,ae=18,fe=document.createElementNS("http://www.w3.org/2000/svg","rect");fe.classList.add("arrow-rectangle"),fe.setAttribute("x",`${G-te}`),fe.setAttribute("y",`${P.to-ae/2}`),fe.setAttribute("width",`${te}`),fe.setAttribute("height",`${ae}`),this._element.appendChild(fe);const oe=document.createElementNS("http://www.w3.org/2000/svg","g"),Se=document.createElementNS("http://www.w3.org/2000/svg","path");Se.setAttribute("d",`M 0 ${P.from} L ${M} ${P.from} L ${M} ${P.to} L ${G-z} ${P.to}`),Se.setAttribute("fill","none"),oe.appendChild(Se);const Ie=document.createElementNS("http://www.w3.org/2000/svg","polygon");Ie.classList.add("arrow"),f.add(di(me=>{Se.classList.toggle("currentMove",P.move===p.activeMovedText.read(me)),Ie.classList.toggle("currentMove",P.move===p.activeMovedText.read(me))})),Ie.setAttribute("points",`${G-z},${P.to-R/2} ${G},${P.to} ${G-z},${P.to+R/2}`),oe.appendChild(Ie),this._element.appendChild(oe),k++}this.width.set(x,void 0)}),this._element=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("class","moved-blocks-lines"),this._rootElement.appendChild(this._element),this._register(Ye(()=>this._element.remove())),this._register(di(h=>{const f=this._originalEditorLayoutInfo.read(h),g=this._modifiedEditorLayoutInfo.read(h);!f||!g||(this._element.style.left=`${f.width-f.verticalScrollbarWidth}px`,this._element.style.height=`${f.height}px`,this._element.style.width=`${f.verticalScrollbarWidth+f.contentLeft-Bd.movedCodeBlockPadding+this.width.read(h)}px`)})),this._register(Dx(this._state));const r=_t(h=>{const f=this._diffModel.read(h),g=f==null?void 0:f.diff.read(h);return g?g.movedTexts.map(p=>({move:p,original:new Ex(P8(p.lineRangeMapping.original.startLineNumber-1),18),modified:new Ex(P8(p.lineRangeMapping.modified.startLineNumber-1),18)})):[]});this._register(Ax(this._editors.original,r.map(h=>h.map(f=>f.original)))),this._register(Ax(this._editors.modified,r.map(h=>h.map(f=>f.modified)))),this._register($s((h,f)=>{const g=r.read(h);for(const p of g)f.add(new H8(this._editors.original,p.original,p.move,"original",this._diffModel.get())),f.add(new H8(this._editors.modified,p.modified,p.move,"modified",this._diffModel.get()))}));const a=As(this._editors.original.onDidChangeCursorPosition,()=>this._editors.original.getPosition()),l=As(this._editors.modified.onDidChangeCursorPosition,()=>this._editors.modified.getPosition()),c=Ro("original.onDidFocusEditorWidget",h=>this._editors.original.onDidFocusEditorWidget(()=>setTimeout(()=>h(void 0),0))),d=Ro("modified.onDidFocusEditorWidget",h=>this._editors.modified.onDidFocusEditorWidget(()=>setTimeout(()=>h(void 0),0)));let u="modified";this._register(zD({createEmptyChangeSummary:()=>{},handleChange:(h,f)=>(h.didChange(c)&&(u="original"),h.didChange(d)&&(u="modified"),!0)},h=>{c.read(h),d.read(h);const f=this._diffModel.read(h);if(!f)return;const g=f.diff.read(h);let p;if(g&&u==="original"){const _=a.read(h);_&&(p=g.movedTexts.find(v=>v.lineRangeMapping.original.contains(_.lineNumber)))}if(g&&u==="modified"){const _=l.read(h);_&&(p=g.movedTexts.find(v=>v.lineRangeMapping.modified.contains(_.lineNumber)))}p!==f.movedTextToCompare.get()&&f.movedTextToCompare.set(void 0,void 0),f.setActiveMovedText(p)}))}}Bd.movedCodeBlockPadding=4;class AP{static compute(e){const t=[],i=[];for(const s of e){let o=t.findIndex(r=>!r.intersectsStrict(s));o===-1&&(t.length>=6?o=L_e(t,pr(a=>a.intersectWithRangeLength(s),Dd)):(o=t.length,t.push(new i3))),t[o].addRange(s),i.push(o)}return new AP(t.length,i)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class H8 extends kK{constructor(e,t,i,s,o){const r=dn("div.diff-hidden-lines-widget");super(e,t,r.root),this._editor=e,this._move=i,this._kind=s,this._diffModel=o,this._nodes=dn("div.diff-moved-code-block",{style:{marginRight:"4px"}},[dn("div.text-content@textContent"),dn("div.action-bar@actionBar")]),r.root.appendChild(this._nodes.root);const a=As(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this._register(Fd(this._nodes.root,{paddingRight:a.map(h=>h.verticalScrollbarWidth)}));let l;i.changes.length>0?l=this._kind==="original"?m("codeMovedToWithChanges","Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):m("codeMovedFromWithChanges","Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):l=this._kind==="original"?m("codeMovedTo","Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):m("codeMovedFrom","Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const c=this._register(new al(this._nodes.actionBar,{highlightToggledItems:!0})),d=new So("",l,"",!1);c.push(d,{icon:!1,label:!0});const u=new So("","Compare",Te.asClassName(se.compareChanges),!0,()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===i?void 0:this._move,void 0)});this._register(di(h=>{const f=this._diffModel.movedTextToCompare.read(h)===i;u.checked=f})),c.push(u,{icon:!1,label:!0})}}class fIe extends Y{constructor(e,t,i){super(),this._editors=e,this._diffModel=t,this._options=i,this._decorations=_t(this,s=>{var o;const r=(o=this._diffModel.read(s))===null||o===void 0?void 0:o.diff.read(s);if(!r)return null;const a=this._diffModel.read(s).movedTextToCompare.read(s),l=this._options.renderIndicators.read(s),c=this._options.showEmptyDecorations.read(s),d=[],u=[];if(!a)for(const f of r.mappings){if(f.lineRangeMapping.original.isEmpty||d.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:l?B8:V8}),f.lineRangeMapping.modified.isEmpty||u.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:l?F8:W8}),f.lineRangeMapping.modified.isEmpty||f.lineRangeMapping.original.isEmpty)f.lineRangeMapping.original.isEmpty||d.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:dIe}),f.lineRangeMapping.modified.isEmpty||u.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:lIe});else for(const g of f.lineRangeMapping.innerChanges||[])f.lineRangeMapping.original.contains(g.originalRange.startLineNumber)&&d.push({range:g.originalRange,options:g.originalRange.isEmpty()&&c?uIe:aR}),f.lineRangeMapping.modified.contains(g.modifiedRange.startLineNumber)&&u.push({range:g.modifiedRange,options:g.modifiedRange.isEmpty()&&c?cIe:z8});!f.lineRangeMapping.modified.isEmpty&&this._options.shouldRenderRevertArrows.read(s)&&!a&&u.push({range:N.fromPositions(new V(f.lineRangeMapping.modified.startLineNumber,1)),options:hIe})}if(a)for(const f of a.changes){const g=f.original.toInclusiveRange();g&&d.push({range:g,options:l?B8:V8});const p=f.modified.toInclusiveRange();p&&u.push({range:p,options:l?F8:W8});for(const _ of f.innerChanges||[])d.push({range:_.originalRange,options:aR}),u.push({range:_.modifiedRange,options:z8})}const h=this._diffModel.read(s).activeMovedText.read(s);for(const f of r.movedTexts)d.push({range:f.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(f===h?" currentMove":""),blockPadding:[Bd.movedCodeBlockPadding,0,Bd.movedCodeBlockPadding,Bd.movedCodeBlockPadding]}}),u.push({range:f.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(f===h?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:d,modifiedDecorations:u}}),this._register(kx(this._editors.original,this._decorations.map(s=>(s==null?void 0:s.originalDecorations)||[]))),this._register(kx(this._editors.modified,this._decorations.map(s=>(s==null?void 0:s.modifiedDecorations)||[])))}}class gIe extends Y{constructor(e,t,i){super(),this._options=e,this._domNode=t,this._dimensions=i,this._sashRatio=ai(this,void 0),this.sashLeft=_t(this,s=>{var o;const r=(o=this._sashRatio.read(s))!==null&&o!==void 0?o:this._options.splitViewDefaultRatio.read(s);return this._computeSashLeft(r,s)}),this._sash=this._register(new Dn(this._domNode,{getVerticalSashTop:s=>0,getVerticalSashLeft:s=>this.sashLeft.get(),getVerticalSashHeight:s=>this._dimensions.height.get()},{orientation:0})),this._startSashPosition=void 0,this._register(this._sash.onDidStart(()=>{this._startSashPosition=this.sashLeft.get()})),this._register(this._sash.onDidChange(s=>{const o=this._dimensions.width.get(),r=this._computeSashLeft((this._startSashPosition+(s.currentX-s.startX))/o,void 0);this._sashRatio.set(r/o,void 0)})),this._register(this._sash.onDidEnd(()=>this._sash.layout())),this._register(this._sash.onDidReset(()=>this._sashRatio.set(void 0,void 0))),this._register(di(s=>{const o=this._options.enableSplitViewResizing.read(s);this._sash.state=o?3:0,this.sashLeft.read(s),this._dimensions.height.read(s),this._sash.layout()}))}setBoundarySashes(e){this._sash.orthogonalEndSash=e.bottom}_computeSashLeft(e,t){const i=this._dimensions.width.read(t),s=Math.floor(this._options.splitViewDefaultRatio.read(t)*i),o=this._options.enableSplitViewResizing.read(t)?Math.floor(e*i):s,r=100;return i<=r*2?s:oi-r?i-r:o}}class rp{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 s=i;for(let o=0;t.children.get(s)!==void 0;o++)s=`${i}_${o}`;return s}static empty(e){return e.children.size===0}}class $8 extends rp{constructor(e,t,i){super(),this.id=e,this.parent=t,this.symbol=i,this.children=new Map}}class pIe extends rp{constructor(e,t,i,s){super(),this.id=e,this.parent=t,this.label=i,this.order=s,this.children=new Map}}class Yc extends rp{static create(e,t,i){const s=new Ar(i),o=new Yc(t.uri),r=e.ordered(t),a=r.map((c,d)=>{var u;const h=rp.findId(`provider_${d}`,o),f=new pIe(h,o,(u=c.displayName)!==null&&u!==void 0?u:"Unknown Outline Provider",d);return Promise.resolve(c.provideDocumentSymbols(t,s.token)).then(g=>{for(const p of g||[])Yc._makeOutlineElement(p,f);return f},g=>(wc(g),f)).then(g=>{rp.empty(g)?g.remove():o._groups.set(h,g)})}),l=e.onDidChange(()=>{const c=e.ordered(t);Yi(c,r)||s.cancel()});return Promise.all(a).then(()=>s.token.isCancellationRequested&&!i.isCancellationRequested?Yc.create(e,t,i):o._compact()).finally(()=>{s.dispose(),l.dispose()})}static _makeOutlineElement(e,t){const i=rp.findId(e,t),s=new $8(i,t,e);if(e.children)for(const o of e.children)Yc._makeOutlineElement(o,s);t.children.set(s.id,s)}constructor(e){super(),this.uri=e,this.id="root",this.parent=void 0,this._groups=new Map,this.children=new Map,this.id="root",this.parent=void 0}_compact(){let e=0;for(const[t,i]of this._groups)i.children.size===0?this._groups.delete(t):e+=1;if(e!==1)this.children=this._groups;else{const t=ut.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 $8?e.push(t.symbol):e.push(...ut.map(t.children.values(),i=>i.symbol));return e.sort((t,i)=>N.compareRangesUsingStarts(t.range,i.range))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return Yc._flattenDocumentSymbols(t,e,""),t.sort((i,s)=>V.compare(N.getStartPosition(i.range),N.getStartPosition(s.range))||V.compare(N.getEndPosition(s.range),N.getEndPosition(i.range)))}static _flattenDocumentSymbols(e,t,i){for(const s of t)e.push({kind:s.kind,tags:s.tags,name:s.name,detail:s.detail,containerName:s.containerName||i,range:s.range,selectionRange:s.selectionRange,children:void 0}),s.children&&Yc._flattenDocumentSymbols(e,s.children,s.name)}}var AK=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},IK=function(n,e){return function(t,i){e(t,i,n)}},mIe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let lR=class extends Y{get isUpdatingViewZones(){return this._isUpdatingViewZones}constructor(e,t,i,s){super(),this._editors=e,this._diffModel=t,this._options=i,this._languageFeaturesService=s,this._isUpdatingViewZones=!1,this._modifiedOutlineSource=Mv(this,(c,d)=>{const u=this._editors.modifiedModel.read(c);if(u)return d.add(new cR(this._languageFeaturesService,u))}),this._register(this._editors.original.onDidChangeCursorPosition(c=>{if(c.reason===3){const d=this._diffModel.get();Mn(u=>{for(const h of this._editors.original.getSelections()||[])d==null||d.ensureOriginalLineIsVisible(h.getStartPosition().lineNumber,u),d==null||d.ensureOriginalLineIsVisible(h.getEndPosition().lineNumber,u)})}})),this._register(this._editors.modified.onDidChangeCursorPosition(c=>{if(c.reason===3){const d=this._diffModel.get();Mn(u=>{for(const h of this._editors.modified.getSelections()||[])d==null||d.ensureModifiedLineIsVisible(h.getStartPosition().lineNumber,u),d==null||d.ensureModifiedLineIsVisible(h.getEndPosition().lineNumber,u)})}}));const o=this._diffModel.map((c,d)=>{var u,h;return((u=c==null?void 0:c.diff.read(d))===null||u===void 0?void 0:u.mappings.length)===0?[]:(h=c==null?void 0:c.unchangedRegions.read(d))!==null&&h!==void 0?h:[]}),r=Mv(this,(c,d)=>{const u=this._modifiedOutlineSource.read(c);if(!u)return{origViewZones:[],modViewZones:[]};const h=[],f=[],g=this._options.renderSideBySide.read(c),p=o.read(c);for(const _ of p)if(!_.shouldHideControls(c)){{const v=_t(y=>_.getHiddenOriginalRange(y).startLineNumber-1),b=new Ex(v,24);h.push(b),d.add(new U8(this._editors.original,b,_,_.originalUnchangedRange,!g,u,y=>this._diffModel.get().ensureModifiedLineIsVisible(y,void 0),this._options))}{const v=_t(y=>_.getHiddenModifiedRange(y).startLineNumber-1),b=new Ex(v,24);f.push(b),d.add(new U8(this._editors.modified,b,_,_.modifiedUnchangedRange,!1,u,y=>this._diffModel.get().ensureModifiedLineIsVisible(y,void 0),this._options))}}return{origViewZones:h,modViewZones:f}}),a={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},l={description:"Fold Unchanged",glyphMarginHoverMessage:new Fm(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(m("foldUnchanged","Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+Te.asClassName(se.fold),zIndex:10001};this._register(kx(this._editors.original,_t(c=>{const d=o.read(c),u=d.map(h=>({range:h.originalUnchangedRange.toInclusiveRange(),options:a}));for(const h of d)h.shouldHideControls(c)&&u.push({range:N.fromPositions(new V(h.originalLineNumber,1)),options:l});return u}))),this._register(kx(this._editors.modified,_t(c=>{const d=o.read(c),u=d.map(h=>({range:h.modifiedUnchangedRange.toInclusiveRange(),options:a}));for(const h of d)h.shouldHideControls(c)&&u.push({range:Xe.ofLength(h.modifiedLineNumber,1).toInclusiveRange(),options:l});return u}))),this._register(Ax(this._editors.original,r.map(c=>c.origViewZones),c=>this._isUpdatingViewZones=c)),this._register(Ax(this._editors.modified,r.map(c=>c.modViewZones),c=>this._isUpdatingViewZones=c)),this._register(di(c=>{const d=o.read(c);this._editors.original.setHiddenAreas(d.map(u=>u.getHiddenOriginalRange(c).toInclusiveRange()).filter(uS)),this._editors.modified.setHiddenAreas(d.map(u=>u.getHiddenModifiedRange(c).toInclusiveRange()).filter(uS))})),this._register(this._editors.modified.onMouseUp(c=>{var d;if(!c.event.rightButton&&c.target.position&&(!((d=c.target.element)===null||d===void 0)&&d.className.includes("fold-unchanged"))){const u=c.target.position.lineNumber,h=this._diffModel.get();if(!h)return;const f=h.unchangedRegions.get().find(g=>g.modifiedUnchangedRange.includes(u));if(!f)return;f.collapseAll(void 0),c.event.stopPropagation(),c.event.preventDefault()}})),this._register(this._editors.original.onMouseUp(c=>{var d;if(!c.event.rightButton&&c.target.position&&(!((d=c.target.element)===null||d===void 0)&&d.className.includes("fold-unchanged"))){const u=c.target.position.lineNumber,h=this._diffModel.get();if(!h)return;const f=h.unchangedRegions.get().find(g=>g.originalUnchangedRange.includes(u));if(!f)return;f.collapseAll(void 0),c.event.stopPropagation(),c.event.preventDefault()}}))}};lR=AK([IK(3,it)],lR);let cR=class extends Y{constructor(e,t){super(),this._languageFeaturesService=e,this._textModel=t,this._currentModel=ai(this,void 0);const i=Ro("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),s=Ro("_textModel.onDidChangeContent",ue.debounce(o=>this._textModel.onDidChangeContent(o),()=>{},100));this._register($s((o,r)=>mIe(this,void 0,void 0,function*(){i.read(o),s.read(o);const a=r.add(new ZAe),l=yield Yc.create(this._languageFeaturesService.documentSymbolProvider,this._textModel,a.token);r.isDisposed||this._currentModel.set(l,void 0)})))}getBreadcrumbItems(e,t){const i=this._currentModel.read(t);if(!i)return[];const s=i.asListOfDocumentSymbols().filter(o=>e.contains(o.range.startLineNumber)&&!e.contains(o.range.endLineNumber));return s.sort(eU(pr(o=>o.range.endLineNumber-o.range.startLineNumber,Dd))),s.map(o=>({name:o.name,kind:o.kind,startLineNumber:o.range.startLineNumber}))}};cR=AK([IK(0,it)],cR);class U8 extends kK{constructor(e,t,i,s,o,r,a,l){const c=dn("div.diff-hidden-lines-widget");super(e,t,c.root),this._editor=e,this._unchangedRegion=i,this._unchangedRegionRange=s,this.hide=o,this._modifiedOutlineSource=r,this._revealModifiedHiddenLine=a,this._options=l,this._nodes=dn("div.diff-hidden-lines",[dn("div.top@top",{title:m("diff.hiddenLines.top","Click or drag to show more above")}),dn("div.center@content",{style:{display:"flex"}},[dn("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[ye("a",{title:m("showAll","Show all"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...rf("$(unfold)"))]),dn("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),dn("div.bottom@bottom",{title:m("diff.bottom","Click or drag to show more below"),role:"button"})]),c.root.appendChild(this._nodes.root);const d=As(this._editor.onDidLayoutChange,()=>this._editor.getLayoutInfo());this.hide?ls(this._nodes.first):this._register(Fd(this._nodes.first,{width:d.map(h=>h.contentLeft)}));const u=this._editor;this._register(K(this._nodes.top,"mousedown",h=>{if(h.button!==0)return;this._nodes.top.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const f=h.clientY;let g=!1;const p=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set(!0,void 0);const _=K(window,"mousemove",b=>{const w=b.clientY-f;g=g||Math.abs(w)>2;const S=Math.round(w/u.getOption(66)),L=Math.max(0,Math.min(p+S,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(L,void 0)}),v=K(window,"mouseup",b=>{g||this._unchangedRegion.showMoreAbove(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0),this._nodes.top.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),this._unchangedRegion.isDragged.set(!1,void 0),_.dispose(),v.dispose()})})),this._register(K(this._nodes.bottom,"mousedown",h=>{if(h.button!==0)return;this._nodes.bottom.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),h.preventDefault();const f=h.clientY;let g=!1;const p=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set(!0,void 0);const _=K(window,"mousemove",b=>{const w=b.clientY-f;g=g||Math.abs(w)>2;const S=Math.round(w/u.getOption(66)),L=Math.max(0,Math.min(p-S,this._unchangedRegion.getMaxVisibleLineCountBottom())),x=u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(L,void 0);const D=u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);u.setScrollTop(u.getScrollTop()+(D-x))}),v=K(window,"mouseup",b=>{if(this._unchangedRegion.isDragged.set(!1,void 0),!g){const y=u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const w=u.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);u.setScrollTop(u.getScrollTop()+(w-y))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),_.dispose(),v.dispose()})})),this._register(di(h=>{const f=[];if(!this.hide){const g=i.getHiddenModifiedRange(h).length,p=m("hiddenLines","{0} hidden lines",g),_=ye("span",{title:m("diff.hiddenLines.expandAll","Double click to unfold")},p);_.addEventListener("dblclick",y=>{y.button===0&&(y.preventDefault(),this._unchangedRegion.showAll(void 0))}),f.push(_);const v=this._unchangedRegion.getHiddenModifiedRange(h),b=this._modifiedOutlineSource.getBreadcrumbItems(v,h);if(b.length>0){f.push(ye("span",void 0,"  |  "));for(let y=0;y{this._revealModifiedHiddenLine(w.startLineNumber)}}}}ls(this._nodes.others,...f)}))}}class Pv{static capture(e){if(e.getScrollTop()===0||e.hasPendingScrollAnimation())return new Pv(e.getScrollTop(),e.getContentHeight(),null,0,null);let t=null,i=0;const s=e.getVisibleRanges();if(s.length>0){t=s[0].getStartPosition();const o=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-o}return new Pv(e.getScrollTop(),e.getContentHeight(),t,i,e.getPosition())}constructor(e,t,i,s,o){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=s,this._cursorPosition=o}restore(e){if(!(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())&&this._visiblePosition){const t=e.getTopForPosition(this._visiblePosition.lineNumber,this._visiblePosition.column);e.setScrollTop(t+this._visiblePositionScrollDelta)}}restoreRelativeVerticalPositionOfCursor(e){if(this._initialContentHeight===e.getContentHeight()&&this._initialScrollTop===e.getScrollTop())return;const t=e.getPosition();if(!this._cursorPosition||!t)return;const i=e.getTopForLineNumber(t.lineNumber)-e.getTopForLineNumber(this._cursorPosition.lineNumber);e.setScrollTop(e.getScrollTop()+i)}}var _Ie=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},j8=function(n,e){return function(t,i){e(t,i,n)}},bIe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},rh;let Ix=rh=class{constructor(e,t,i){this.editorWorkerService=t,this.telemetryService=i,this.onDidChangeEventEmitter=new B,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="advanced",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(e)}dispose(){var e;(e=this.diffAlgorithmOnDidChangeSubscription)===null||e===void 0||e.dispose()}computeDiff(e,t,i,s){var o,r;return bIe(this,void 0,void 0,function*(){if(typeof this.diffAlgorithm!="string")return this.diffAlgorithm.computeDiff(e,t,i,s);if(e.getLineCount()===1&&e.getLineMaxColumn(1)===1)return t.getLineCount()===1&&t.getLineMaxColumn(1)===1?{changes:[],identical:!0,quitEarly:!1,moves:[]}:{changes:[new Go(new Xe(1,2),new Xe(1,t.getLineCount()+1),[new ou(e.getFullModelRange(),t.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};const a=JSON.stringify([e.uri.toString(),t.uri.toString()]),l=JSON.stringify([e.id,t.id,e.getAlternativeVersionId(),t.getAlternativeVersionId(),JSON.stringify(i)]),c=rh.diffCache.get(a);if(c&&c.context===l)return c.result;const d=Su.create(),u=yield this.editorWorkerService.computeDiff(e.uri,t.uri,i,this.diffAlgorithm),h=d.elapsed();if(this.telemetryService.publicLog2("diffEditor.computeDiff",{timeMs:h,timedOut:(o=u==null?void 0:u.quitEarly)!==null&&o!==void 0?o:!0,detectedMoves:i.computeMoves?(r=u==null?void 0:u.moves.length)!==null&&r!==void 0?r:0:-1}),s.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!u)throw new Error("no diff result available");return rh.diffCache.size>10&&rh.diffCache.delete(rh.diffCache.keys().next().value),rh.diffCache.set(a,{result:u,context:l}),u})}setOptions(e){var t;let i=!1;e.diffAlgorithm&&this.diffAlgorithm!==e.diffAlgorithm&&((t=this.diffAlgorithmOnDidChangeSubscription)===null||t===void 0||t.dispose(),this.diffAlgorithmOnDidChangeSubscription=void 0,this.diffAlgorithm=e.diffAlgorithm,typeof e.diffAlgorithm!="string"&&(this.diffAlgorithmOnDidChangeSubscription=e.diffAlgorithm.onDidChange(()=>this.onDidChangeEventEmitter.fire())),i=!0),i&&this.onDidChangeEventEmitter.fire()}};Ix.diffCache=new Map;Ix=rh=_Ie([j8(1,ly),j8(2,Cc)],Ix);var vIe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},yIe=function(n,e){return function(t,i){e(t,i,n)}};const TK=rt("diffProviderFactoryService");let dR=class{constructor(e){this.instantiationService=e}createDiffProvider(e,t){return this.instantiationService.createInstance(Ix,t)}};dR=vIe([yIe(0,vt)],dR);ft(TK,dR,1);var wIe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},CIe=function(n,e){return function(t,i){e(t,i,n)}},q8=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};let uR=class extends Y{setActiveMovedText(e){this._activeMovedText.set(e,void 0)}constructor(e,t,i,s){super(),this.model=e,this._options=t,this._editor=i,this._diffProviderFactoryService=s,this._isDiffUpToDate=ai(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=ai(this,void 0),this.diff=this._diff,this._unchangedRegions=ai(this,{regions:[],originalDecorationIds:[],modifiedDecorationIds:[]}),this.unchangedRegions=_t(this,l=>this._options.hideUnchangedRegions.read(l)?this._unchangedRegions.read(l).regions:(Mn(c=>{for(const d of this._unchangedRegions.get().regions)d.collapseAll(c)}),[])),this.movedTextToCompare=ai(this,void 0),this._activeMovedText=ai(this,void 0),this._hoveredMovedText=ai(this,void 0),this.activeMovedText=_t(this,l=>{var c,d;return(d=(c=this.movedTextToCompare.read(l))!==null&&c!==void 0?c:this._hoveredMovedText.read(l))!==null&&d!==void 0?d:this._activeMovedText.read(l)}),this._cancellationTokenSource=new Ar,this._diffProvider=_t(this,l=>{const c=this._diffProviderFactoryService.createDiffProvider(this._editor,{diffAlgorithm:this._options.diffAlgorithm.read(l)}),d=Ro("onDidChange",c.onDidChange);return{diffProvider:c,onChangeSignal:d}}),this._register(Ye(()=>this._cancellationTokenSource.cancel()));const o=zAe("contentChangedSignal"),r=this._register(new Li(()=>o.trigger(void 0),200)),a=(l,c,d)=>{const u=Tx.fromDiffs(l.changes,e.original.getLineCount(),e.modified.getLineCount(),this._options.hideUnchangedRegionsMinimumLineCount.read(d),this._options.hideUnchangedRegionsContextLineCount.read(d)),h=this._unchangedRegions.get(),f=h.originalDecorationIds.map(v=>e.original.getDecorationRange(v)).filter(v=>!!v).map(v=>Xe.fromRange(v)),g=h.modifiedDecorationIds.map(v=>e.modified.getDecorationRange(v)).filter(v=>!!v).map(v=>Xe.fromRange(v)),p=e.original.deltaDecorations(h.originalDecorationIds,u.map(v=>({range:v.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))),_=e.modified.deltaDecorations(h.modifiedDecorationIds,u.map(v=>({range:v.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})));for(const v of u)for(let b=0;b{if(this._diff.get()){const d=nc.fromModelContentChanges(l.changes);this._lastDiff,e.original,e.modified}r.schedule()})),this._register(e.original.onDidChangeContent(l=>{if(this._diff.get()){const d=nc.fromModelContentChanges(l.changes);this._lastDiff,e.original,e.modified}r.schedule()})),this._register($s((l,c)=>q8(this,void 0,void 0,function*(){var d,u;this._options.hideUnchangedRegionsMinimumLineCount.read(l),this._options.hideUnchangedRegionsContextLineCount.read(l),r.cancel(),o.read(l);const h=this._diffProvider.read(l);h.onChangeSignal.read(l),Kc(Tj,l),Kc(bT,l),this._isDiffUpToDate.set(!1,void 0);let f=[];c.add(e.original.onDidChangeContent(_=>{const v=nc.fromModelContentChanges(_.changes);f=KS(f,v)}));let g=[];c.add(e.modified.onDidChangeContent(_=>{const v=nc.fromModelContentChanges(_.changes);g=KS(g,v)}));let p=yield h.diffProvider.computeDiff(e.original,e.modified,{ignoreTrimWhitespace:this._options.ignoreTrimWhitespace.read(l),maxComputationTimeMs:this._options.maxComputationTimeMs.read(l),computeMoves:this._options.showMoves.read(l)},this._cancellationTokenSource.token);this._cancellationTokenSource.token.isCancellationRequested||(p=SIe(p,e.original,e.modified),p=(d=(e.original,e.modified,void 0))!==null&&d!==void 0?d:p,p=(u=(e.original,e.modified,void 0))!==null&&u!==void 0?u:p,Mn(_=>{a(p,_),this._lastDiff=p;const v=IP.fromDiffResult(p);this._diff.set(v,_),this._isDiffUpToDate.set(!0,_);const b=this.movedTextToCompare.get();this.movedTextToCompare.set(b?this._lastDiff.moves.find(y=>y.lineRangeMapping.modified.intersect(b.lineRangeMapping.modified)):void 0,_)}))})))}ensureModifiedLineIsVisible(e,t){var i;if(((i=this.diff.get())===null||i===void 0?void 0:i.mappings.length)===0)return;const s=this._unchangedRegions.get().regions;for(const o of s)if(o.getHiddenModifiedRange(void 0).contains(e)){o.showModifiedLine(e,t);return}}ensureOriginalLineIsVisible(e,t){var i;if(((i=this.diff.get())===null||i===void 0?void 0:i.mappings.length)===0)return;const s=this._unchangedRegions.get().regions;for(const o of s)if(o.getHiddenOriginalRange(void 0).contains(e)){o.showOriginalLine(e,t);return}}waitForDiff(){return q8(this,void 0,void 0,function*(){yield WAe(this.isDiffUpToDate,e=>e)})}serializeState(){return{collapsedRegions:this._unchangedRegions.get().regions.map(t=>({range:t.getHiddenModifiedRange(void 0).serialize()}))}}restoreSerializedState(e){const t=e.collapsedRegions.map(s=>Xe.deserialize(s.range)),i=this._unchangedRegions.get();Mn(s=>{for(const o of i.regions)for(const r of t)if(o.modifiedUnchangedRange.intersect(r)){o.setHiddenModifiedRange(r,s);break}})}};uR=wIe([CIe(3,TK)],uR);function SIe(n,e,t){return{changes:n.changes.map(i=>new Go(i.original,i.modified,i.innerChanges?i.innerChanges.map(s=>xIe(s,e,t)):void 0)),moves:n.moves,identical:n.identical,quitEarly:n.quitEarly}}function xIe(n,e,t){let i=n.originalRange,s=n.modifiedRange;return(i.endColumn!==1||s.endColumn!==1)&&i.endColumn===e.getLineMaxColumn(i.endLineNumber)&&s.endColumn===t.getLineMaxColumn(s.endLineNumber)&&i.endLineNumbernew NK(t)),e.moves||[],e.identical,e.quitEarly)}constructor(e,t,i,s){this.mappings=e,this.movedTexts=t,this.identical=i,this.quitEarly=s}}class NK{constructor(e){this.lineRangeMapping=e}}class Tx{static fromDiffs(e,t,i,s,o){const r=Go.inverse(e,t,i),a=[];for(const l of r){let c=l.original.startLineNumber,d=l.modified.startLineNumber,u=l.original.length;const h=c===1&&d===1,f=c+u===t+1&&d+u===i+1;(h||f)&&u>=o+s?(h&&!f&&(u-=o),f&&!h&&(c+=o,d+=o,u-=o),a.push(new Tx(c,d,u,0,0))):u>=o*2+s&&(c+=o,d+=o,u-=o*2,a.push(new Tx(c,d,u,0,0)))}return a}get originalUnchangedRange(){return Xe.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return Xe.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,i,s,o){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=i,this._visibleLineCountTop=ai(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=ai(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=_t(this,r=>this.visibleLineCountTop.read(r)+this.visibleLineCountBottom.read(r)===this.lineCount&&!this.isDragged.read(r)),this.isDragged=ai(this,!1),this._visibleLineCountTop.set(s,void 0),this._visibleLineCountBottom.set(o,void 0)}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return Xe.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return Xe.ofLength(this.modifiedLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}setHiddenModifiedRange(e,t){const i=e.startLineNumber-this.modifiedLineNumber,s=this.modifiedLineNumber+this.lineCount-e.endLineNumberExclusive;this.setState(i,s,t)}getMaxVisibleLineCountTop(){return this.lineCount-this._visibleLineCountBottom.get()}getMaxVisibleLineCountBottom(){return this.lineCount-this._visibleLineCountTop.get()}showMoreAbove(e=10,t){const i=this.getMaxVisibleLineCountTop();this._visibleLineCountTop.set(Math.min(this._visibleLineCountTop.get()+e,i),t)}showMoreBelow(e=10,t){const i=this.lineCount-this._visibleLineCountTop.get();this._visibleLineCountBottom.set(Math.min(this._visibleLineCountBottom.get()+e,i),t)}showAll(e){this._visibleLineCountBottom.set(this.lineCount-this._visibleLineCountTop.get(),e)}showModifiedLine(e,t){const i=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),s=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;i{var _;this._contextMenuService.showContextMenu({domForShadowRoot:h&&(_=i.getDomNode())!==null&&_!==void 0?_:void 0,getAnchor:()=>({x:g,y:p}),getActions:()=>{const v=[],b=s.modified.isEmpty;return v.push(new So("diff.clipboard.copyDeletedContent",b?s.original.length>1?m("diff.clipboard.copyDeletedLinesContent.label","Copy deleted lines"):m("diff.clipboard.copyDeletedLinesContent.single.label","Copy deleted line"):s.original.length>1?m("diff.clipboard.copyChangedLinesContent.label","Copy changed lines"):m("diff.clipboard.copyChangedLinesContent.single.label","Copy changed line"),void 0,!0,()=>fE(this,void 0,void 0,function*(){const w=this._originalTextModel.getValueInRange(s.original.toExclusiveRange());yield this._clipboardService.writeText(w)}))),s.original.length>1&&v.push(new So("diff.clipboard.copyDeletedLineContent",b?m("diff.clipboard.copyDeletedLineContent.label","Copy deleted line ({0})",s.original.startLineNumber+u):m("diff.clipboard.copyChangedLineContent.label","Copy changed line ({0})",s.original.startLineNumber+u),void 0,!0,()=>fE(this,void 0,void 0,function*(){let w=this._originalTextModel.getLineContent(s.original.startLineNumber+u);w===""&&(w=this._originalTextModel.getEndOfLineSequence()===0?` `:`\r -`),yield this._clipboardService.writeText(w)}))),i.getOption(90)||v.push(new Do("diff.inline.revertChange",m("diff.inline.revertChange.label","Revert this change"),void 0,!0,()=>bE(this,void 0,void 0,function*(){this._editor.revert(this._diff)}))),v},autoSelectFirstItem:!0})};this._register(ji(this._diffActions,"mousedown",g=>{const{top:p,height:_}=Rn(this._diffActions),v=Math.floor(d/3);g.preventDefault(),f(g.posx,p+_+v)})),this._register(i.onMouseMove(g=>{(g.target.type===8||g.target.type===5)&&g.target.detail.viewZoneId===this._getViewZoneId()?(u=this._updateLightBulbPosition(this._marginDomNode,g.event.browserEvent.y,d),this.visibility=!0):this.visibility=!1})),this._register(i.onMouseDown(g=>{g.event.rightButton&&(g.target.type===8||g.target.type===5)&&g.target.detail.viewZoneId===this._getViewZoneId()&&(g.event.preventDefault(),u=this._updateLightBulbPosition(this._marginDomNode,g.event.browserEvent.y,d),f(g.event.posx,g.event.posy+d))}))}_updateLightBulbPosition(e,t,i){const{top:s}=Rn(e),o=t-s,r=Math.floor(o/i),a=r*i;if(this._diffActions.style.top=`${a}px`,this._viewLineCounts){let l=0;for(let c=0;cn});function rIe(n,e,t,i){Mn(i,e.fontInfo);const s=t.length>0,o=new aD(1e4);let r=0,a=0;const l=[];for(let h=0;h');const l=e.getLineContent(),c=Eo.isBasicASCII(l,s),d=Eo.containsRTL(l,c,o),u=cP(new s0(r.fontInfo.isMonospace&&!r.disableMonospaceOptimizations,r.fontInfo.canUseHalfwidthRightwardsArrow,l,!1,c,d,0,e,t,r.tabSize,0,r.fontInfo.spaceWidth,r.fontInfo.middotWidth,r.fontInfo.wsmiddotWidth,r.stopRenderingLineAfter,r.renderWhitespace,r.renderControlCharacters,r.fontLigatures!==Mo.OFF,null),a);return a.appendString(""),u.characterMapping.getHorizontalOffset(u.characterMapping.length)}var lIe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},J8=function(n,e){return function(t,i){e(t,i,n)}};let gR=class extends Y{constructor(e,t,i,s,o,r,a){super(),this._editors=e,this._diffModel=t,this._options=i,this._diffEditorWidget=s,this._canIgnoreViewZoneUpdateEvent=o,this._clipboardService=r,this._contextMenuService=a,this._originalTopPadding=li(this,0),this._originalScrollOffset=li(this,0),this._originalScrollOffsetAnimated=V8(this._originalScrollOffset,this._store),this._modifiedTopPadding=li(this,0),this._modifiedScrollOffset=li(this,0),this._modifiedScrollOffsetAnimated=V8(this._modifiedScrollOffset,this._store);let l=!1;const c=li("state",0),d=this._register(new Di(()=>{c.set(c.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(w=>{!l&&!this._canIgnoreViewZoneUpdateEvent()&&d.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(w=>{!l&&!this._canIgnoreViewZoneUpdateEvent()&&d.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(w=>{(w.hasChanged(144)||w.hasChanged(66))&&d.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(w=>{(w.hasChanged(144)||w.hasChanged(66))&&d.schedule()}));const u=this._diffModel.map(w=>w?Is(w.model.original.onDidChangeTokens,()=>w.model.original.tokenization.backgroundTokenizationState===2):void 0).map((w,C)=>w==null?void 0:w.read(C)),h=new Set,f=new Set,g=bt(w=>{const C=this._diffModel.read(w),L=C==null?void 0:C.diff.read(w);if(!C||!L)return null;c.read(w);const D=this._options.renderSideBySide.read(w);return eB(this._editors.original,this._editors.modified,L.mappings,h,f,D)}),p=bt(w=>{var C;const L=(C=this._diffModel.read(w))===null||C===void 0?void 0:C.movedTextToCompare.read(w);if(!L)return null;c.read(w);const x=L.changes.map(D=>new RK(D));return eB(this._editors.original,this._editors.modified,x,h,f,!0)});function _(){const w=document.createElement("div");return w.className="diagonal-fill",w}const v=this._register(new pe),b=bt(w=>{var C,L,x,D,k,P,O,M;v.clear();const R=g.read(w)||[],z=[],G=[],te=this._modifiedTopPadding.read(w);te>0&&G.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:te,showInHiddenAreas:!0,suppressMouseDown:!0});const ae=this._originalTopPadding.read(w);ae>0&&z.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:ae,showInHiddenAreas:!0,suppressMouseDown:!0});const fe=this._options.renderSideBySide.read(w),oe=fe||(C=this._editors.modified._getViewModel())===null||C===void 0?void 0:C.createLineBreaksComputer();if(oe){for(const Ge of R)if(Ge.diff)for(let si=Ge.originalRange.startLineNumber;sithis._editors.original.getModel().tokenization.getLineTokens(Tt)),Ge.originalRange.mapToLineArray(Tt=>Se[Ie++]),Xt,Dt),ge=[];for(const Tt of Ge.diff.innerChanges||[])ge.push(new M_(Tt.originalRange.delta(-(Ge.diff.original.startLineNumber-1)),cR.className,0));const he=rIe(Ve,Nt,ge,ke),Ei=document.createElement("div");if(Ei.className="inline-deleted-margin-view-zone",Mn(Ei,Nt.fontInfo),this._options.renderIndicators.read(w))for(let Tt=0;TtiI(kt),Ei,this._editors.modified,Ge.diff,this._diffEditorWidget,he.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let Tt=0;Tt1&&z.push({afterLineNumber:Ge.originalRange.startLineNumber+Tt,domNode:_(),heightInPx:(yi-1)*me,showInHiddenAreas:!0,suppressMouseDown:!0})}G.push({afterLineNumber:Ge.modifiedRange.startLineNumber-1,domNode:ke,heightInPx:he.heightInLines*me,minWidthInPx:he.minWidthInPx,marginDomNode:Ei,setZoneId(Tt){kt=Tt},showInHiddenAreas:!0,suppressMouseDown:!0})}const si=document.createElement("div");si.className="gutter-delete",z.push({afterLineNumber:Ge.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:Ge.modifiedHeightInPx,marginDomNode:si,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const si=Ge.modifiedHeightInPx-Ge.originalHeightInPx;if(si>0){if(ie!=null&&ie.lineRangeMapping.original.delta(-1).deltaLength(2).contains(Ge.originalRange.endLineNumberExclusive-1))continue;z.push({afterLineNumber:Ge.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:si,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let ke=function(){const ge=document.createElement("div");return ge.className="arrow-revert-change "+Te.asClassName(se.arrowRight),ye("div",{},ge)};if(ie!=null&&ie.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(Ge.modifiedRange.endLineNumberExclusive-1))continue;let Ve;Ge.diff&&Ge.diff.modified.isEmpty&&this._options.shouldRenderRevertArrows.read(w)&&(Ve=ke()),G.push({afterLineNumber:Ge.modifiedRange.endLineNumberExclusive-1,domNode:_(),heightInPx:-si,marginDomNode:Ve,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const Ge of(M=p.read(w))!==null&&M!==void 0?M:[]){if(!(ie!=null&&ie.lineRangeMapping.original.intersect(Ge.originalRange))||!(ie!=null&&ie.lineRangeMapping.modified.intersect(Ge.modifiedRange)))continue;const si=Ge.modifiedHeightInPx-Ge.originalHeightInPx;si>0?z.push({afterLineNumber:Ge.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:si,showInHiddenAreas:!0,suppressMouseDown:!0}):G.push({afterLineNumber:Ge.modifiedRange.endLineNumberExclusive-1,domNode:_(),heightInPx:-si,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:z,mod:G}});this._register(js(w=>{const C=Rv.capture(this._editors.modified),L=b.read(w);l=!0,this._editors.original.changeViewZones(x=>{for(const D of h)x.removeZone(D);h.clear();for(const D of L.orig){const k=x.addZone(D);D.setZoneId&&D.setZoneId(k),h.add(k)}}),this._editors.modified.changeViewZones(x=>{for(const D of f)x.removeZone(D);f.clear();for(const D of L.mod){const k=x.addZone(D);D.setZoneId&&D.setZoneId(k),f.add(k)}}),l=!1,C.restore(this._editors.modified)})),this._register(Ze(()=>{this._editors.original.changeViewZones(w=>{for(const C of h)w.removeZone(C);h.clear()}),this._editors.modified.changeViewZones(w=>{for(const C of f)w.removeZone(C);f.clear()})}));let y=!1;this._register(this._editors.original.onDidScrollChange(w=>{w.scrollLeftChanged&&!y&&(y=!0,this._editors.modified.setScrollLeft(w.scrollLeft),y=!1)})),this._register(this._editors.modified.onDidScrollChange(w=>{w.scrollLeftChanged&&!y&&(y=!0,this._editors.original.setScrollLeft(w.scrollLeft),y=!1)})),this._originalScrollTop=Is(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=Is(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(ui(w=>{const C=this._originalScrollTop.read(w)-(this._originalScrollOffsetAnimated.get()-this._modifiedScrollOffsetAnimated.read(w))-(this._originalTopPadding.get()-this._modifiedTopPadding.read(w));C!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(C,1)})),this._register(ui(w=>{const C=this._modifiedScrollTop.read(w)-(this._modifiedScrollOffsetAnimated.get()-this._originalScrollOffsetAnimated.read(w))-(this._modifiedTopPadding.get()-this._originalTopPadding.read(w));C!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(C,1)})),this._register(ui(w=>{var C;const L=(C=this._diffModel.read(w))===null||C===void 0?void 0:C.movedTextToCompare.read(w);let x=0;if(L){const D=this._editors.original.getTopForLineNumber(L.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.get();x=this._editors.modified.getTopForLineNumber(L.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.get()-D}x>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(x,void 0)):x<0?(this._modifiedTopPadding.set(-x,void 0),this._originalTopPadding.set(0,void 0)):setTimeout(()=>{this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(0,void 0)},400),this._editors.modified.hasTextFocus()?this._originalScrollOffset.set(this._modifiedScrollOffset.get()-x,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.get()+x,void 0,!0)}))}};gR=lIe([J8(5,hy),J8(6,Tu)],gR);function eB(n,e,t,i,s,o){const r=new _c(tB(n,i)),a=new _c(tB(e,s)),l=n.getOption(66),c=e.getOption(66),d=[];let u=0,h=0;function f(g,p){for(;;){let _=r.peek(),v=a.peek();if(_&&_.lineNumber>=g&&(_=void 0),v&&v.lineNumber>=p&&(v=void 0),!_&&!v)break;const b=_?_.lineNumber-u:Number.MAX_VALUE,y=v?v.lineNumber-h:Number.MAX_VALUE;by?(a.dequeue(),_={lineNumber:v.lineNumber-h+u,heightInPx:0}):(r.dequeue(),a.dequeue()),d.push({originalRange:Qe.ofLength(_.lineNumber,1),modifiedRange:Qe.ofLength(v.lineNumber,1),originalHeightInPx:l+_.heightInPx,modifiedHeightInPx:c+v.heightInPx,diff:void 0})}}for(const g of t){let y=function(w,C){var L,x,D,k;if(wz.lineNumberz+G.heightInPx,0))!==null&&x!==void 0?x:0,R=(k=(D=a.takeWhile(z=>z.lineNumberz+G.heightInPx,0))!==null&&k!==void 0?k:0;d.push({originalRange:P,modifiedRange:O,originalHeightInPx:P.length*l+M,modifiedHeightInPx:O.length*c+R,diff:g.lineRangeMapping}),b=w,v=C};const p=g.lineRangeMapping;f(p.original.startLineNumber,p.modified.startLineNumber);let _=!0,v=p.modified.startLineNumber,b=p.original.startLineNumber;if(o)for(const w of p.innerChanges||[])w.originalRange.startColumn>1&&w.modifiedRange.startColumn>1&&y(w.originalRange.startLineNumber,w.modifiedRange.startLineNumber),w.originalRange.endColumn1&&i.push({lineNumber:l,heightInPx:r*(c-1)})}for(const l of n.getWhitespaces()){if(e.has(l.id))continue;const c=l.afterLineNumber===0?0:o.convertViewPositionToModelPosition(new V(l.afterLineNumber,1)).lineNumber;t.push({lineNumber:c,heightInPx:l.height})}return DAe(t,i,l=>l.lineNumber,(l,c)=>({lineNumber:l.lineNumber,heightInPx:l.heightInPx+c.heightInPx}))}var cIe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},dIe=function(n,e){return function(t,i){e(t,i,n)}},Hr;let cc=Hr=class extends Y{constructor(e,t,i,s,o,r,a,l){super(),this._editors=e,this._rootElement=t,this._diffModel=i,this._rootWidth=s,this._rootHeight=o,this._modifiedEditorLayoutInfo=r,this._options=a,this._themeService=l;const c=Is(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),d=bt(f=>{const g=c.read(f),p=g.getColor(_ve)||(g.getColor(pve)||ET).transparent(2),_=g.getColor(bve)||(g.getColor(mve)||AT).transparent(2);return{insertColor:p,removeColor:_}}),u=Is(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),h=Is(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollHeight());this._register(js((f,g)=>{if(!this._options.renderOverviewRuler.read(f))return;const p=vt(document.createElement("div"));p.setClassName("diffViewport"),p.setPosition("absolute");const _=hn("div.diffOverview",{style:{position:"absolute",top:"0px",width:Hr.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;g.add(Iw(_,p.domNode)),g.add(ji(_,de.POINTER_DOWN,v=>{this._editors.modified.delegateVerticalScrollbarPointerDown(v)})),g.add(K(_,de.MOUSE_WHEEL,v=>{this._editors.modified.delegateScrollFromMouseWheelEvent(v)},{passive:!1})),g.add(Iw(this._rootElement,_)),g.add(js((v,b)=>{const y=this._diffModel.read(v),w=this._editors.original.createOverviewRuler("original diffOverviewRuler");w&&(b.add(w),b.add(Iw(_,w.getDomNode())));const C=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(C&&(b.add(C),b.add(Iw(_,C.getDomNode()))),!w||!C)return;const L=Oo("viewZoneChanged",this._editors.original.onDidChangeViewZones),x=Oo("viewZoneChanged",this._editors.modified.onDidChangeViewZones),D=Oo("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),k=Oo("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);b.add(ui(P=>{var O;L.read(P),x.read(P),D.read(P),k.read(P);const M=d.read(P),R=(O=y==null?void 0:y.diff.read(P))===null||O===void 0?void 0:O.mappings;function z(ae,fe,oe){const Se=oe._getViewModel();return Se?ae.filter(Ie=>Ie.length>0).map(Ie=>{const me=Se.coordinatesConverter.convertModelPositionToViewPosition(new V(Ie.startLineNumber,1)),ie=Se.coordinatesConverter.convertModelPositionToViewPosition(new V(Ie.endLineNumberExclusive,1)),Xt=ie.lineNumber-me.lineNumber;return new Eq(me.lineNumber,ie.lineNumber,Xt,fe.toString())}):[]}const G=z((R||[]).map(ae=>ae.lineRangeMapping.original),M.removeColor,this._editors.original),te=z((R||[]).map(ae=>ae.lineRangeMapping.modified),M.insertColor,this._editors.modified);w==null||w.setZones(G),C==null||C.setZones(te)})),b.add(ui(P=>{const O=this._rootHeight.read(P),M=this._rootWidth.read(P),R=this._modifiedEditorLayoutInfo.read(P);if(R){const z=Hr.ENTIRE_DIFF_OVERVIEW_WIDTH-2*Hr.ONE_OVERVIEW_WIDTH;w.setLayout({top:0,height:O,right:z+Hr.ONE_OVERVIEW_WIDTH,width:Hr.ONE_OVERVIEW_WIDTH}),C.setLayout({top:0,height:O,right:0,width:Hr.ONE_OVERVIEW_WIDTH});const G=u.read(P),te=h.read(P),ae=this._editors.modified.getOption(102),fe=new Em(ae.verticalHasArrows?ae.arrowSize:0,ae.verticalScrollbarSize,0,R.height,te,G);p.setTop(fe.getSliderPosition()),p.setHeight(fe.getSliderSize())}else p.setTop(0),p.setHeight(0);_.style.height=O+"px",_.style.left=M-Hr.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",p.setWidth(Hr.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}))}};cc.ONE_OVERVIEW_WIDTH=15;cc.ENTIRE_DIFF_OVERVIEW_WIDTH=Hr.ONE_OVERVIEW_WIDTH*2;cc=Hr=cIe([dIe(7,co)],cc);E("diffEditor.move.border",{dark:"#8b8b8b9c",light:"#8b8b8b9c",hcDark:"#8b8b8b9c",hcLight:"#8b8b8b9c"},m("diffEditor.move.border","The border color for text that got moved in the diff editor."));E("diffEditor.moveActive.border",{dark:"#FFA500",light:"#FFA500",hcDark:"#FFA500",hcLight:"#FFA500"},m("diffEditor.moveActive.border","The active border color for text that got moved in the diff editor."));class XD extends Y{constructor(){super(...arguments),this._id=++XD.idCounter,this._onDidDispose=this._register(new B),this.onDidDispose=this._onDidDispose.event}getId(){return this.getEditorType()+":v2:"+this._id}getVisibleColumnFromPosition(e){return this._targetEditor.getVisibleColumnFromPosition(e)}getPosition(){return this._targetEditor.getPosition()}setPosition(e,t="api"){this._targetEditor.setPosition(e,t)}revealLine(e,t=0){this._targetEditor.revealLine(e,t)}revealLineInCenter(e,t=0){this._targetEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=0){this._targetEditor.revealLineNearTop(e,t)}revealPosition(e,t=0){this._targetEditor.revealPosition(e,t)}revealPositionInCenter(e,t=0){this._targetEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=0){this._targetEditor.revealPositionNearTop(e,t)}getSelection(){return this._targetEditor.getSelection()}getSelections(){return this._targetEditor.getSelections()}setSelection(e,t="api"){this._targetEditor.setSelection(e,t)}setSelections(e,t="api"){this._targetEditor.setSelections(e,t)}revealLines(e,t,i=0){this._targetEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=0){this._targetEditor.revealLinesInCenter(e,t,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=0){this._targetEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=0,i=!1,s=!0){this._targetEditor.revealRange(e,t,i,s)}revealRangeInCenter(e,t=0){this._targetEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=0){this._targetEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._targetEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=0){this._targetEditor.revealRangeAtTop(e,t)}getSupportedActions(){return this._targetEditor.getSupportedActions()}focus(){this._targetEditor.focus()}trigger(e,t,i){this._targetEditor.trigger(e,t,i)}createDecorationsCollection(e){return this._targetEditor.createDecorationsCollection(e)}changeDecorations(e){return this._targetEditor.changeDecorations(e)}}XD.idCounter=0;var uIe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},iB=function(n,e){return function(t,i){e(t,i,n)}};let pR=class extends Y{constructor(e,t,i,s,o,r,a){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=i,this._createInnerEditor=o,this._instantiationService=r,this._keybindingService=a,this._onDidContentSizeChange=this._register(new B),this.original=this._register(this._createLeftHandSideEditor(i.editorOptions.get(),s.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(i.editorOptions.get(),s.modifiedEditor||{})),this.modifiedModel=Is(this.modified.onDidChangeModel,()=>this.modified.getModel()),this._register(KD({createEmptyChangeSummary:()=>({}),handleChange:(l,c)=>(l.didChange(i.editorOptions)&&Object.assign(c,l.change.changedOptions),!0)},(l,c)=>{i.editorOptions.read(l),this._options.renderSideBySide.read(l),this.modified.updateOptions(this._adjustOptionsForRightHandSide(l,c)),this.original.updateOptions(this._adjustOptionsForLeftHandSide(l,c))}))}_createLeftHandSideEditor(e,t){const i=this._adjustOptionsForLeftHandSide(void 0,e),s=this._constructInnerEditor(this._instantiationService,this.originalEditorElement,i,t);return s.setContextValue("isInDiffLeftEditor",!0),s}_createRightHandSideEditor(e,t){const i=this._adjustOptionsForRightHandSide(void 0,e),s=this._constructInnerEditor(this._instantiationService,this.modifiedEditorElement,i,t);return s.setContextValue("isInDiffRightEditor",!0),s}_constructInnerEditor(e,t,i,s){const o=this._createInnerEditor(e,t,i,s);return this._register(o.onDidContentSizeChange(r=>{const a=this.original.getContentWidth()+this.modified.getContentWidth()+cc.ENTIRE_DIFF_OVERVIEW_WIDTH,l=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:l,contentWidth:a,contentHeightChanged:r.contentHeightChanged,contentWidthChanged:r.contentWidthChanged})})),o}_adjustOptionsForLeftHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return this._options.renderSideBySide.get()?(i.unicodeHighlight=this._options.editorOptions.get().unicodeHighlight||{},i.wordWrapOverride1=this._options.diffWordWrap.get()):(i.wordWrapOverride1="off",i.wordWrapOverride2="off",i.stickyScroll={enabled:!1},i.unicodeHighlight={nonBasicASCII:!1,ambiguousCharacters:!1,invisibleCharacters:!1}),t.originalAriaLabel&&(i.ariaLabel=t.originalAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.readOnly=!this._options.originalEditable.get(),i.dropIntoEditor={enabled:!i.readOnly},i.extraEditorClassName="original-in-monaco-diff-editor",i}_adjustOptionsForRightHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(i.ariaLabel=t.modifiedAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.wordWrapOverride1=this._options.diffWordWrap.get(),i.revealHorizontalRightPadding=Ff.revealHorizontalRightPadding.defaultValue+cc.ENTIRE_DIFF_OVERVIEW_WIDTH,i.scrollbar.verticalHasArrows=!1,i.extraEditorClassName="modified-in-monaco-diff-editor",i}_adjustOptionsForSubEditor(e){const t=Object.assign(Object.assign({},e),{dimension:{height:0,width:0}});return t.inDiffEditor=!0,t.automaticLayout=!1,t.scrollbar=Object.assign({},t.scrollbar||{}),t.scrollbar.vertical="visible",t.folding=!1,t.codeLens=this._options.diffCodeLens.get(),t.fixedOverflowWidgets=!0,t.minimap=Object.assign({},t.minimap||{}),t.minimap.enabled=!1,this._options.hideUnchangedRegions.get()?t.stickyScroll={enabled:!1}:t.stickyScroll=this._options.editorOptions.get().stickyScroll,t}_updateAriaLabel(e){var t;e||(e="");const i=m("diff-aria-navigation-tip"," use {0} to open the accessibility help.",(t=this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp"))===null||t===void 0?void 0:t.getAriaLabel());return this._options.accessibilityVerbose.get()?e+i:e?e.replaceAll(i,""):""}};pR=uIe([iB(5,yt),iB(6,vi)],pR);class hIe{get editorOptions(){return this._options}constructor(e,t){this.diffEditorWidth=t,this.couldShowInlineViewBecauseOfSize=bt(this,s=>this._options.read(s).renderSideBySide&&this.diffEditorWidth.read(s)<=this._options.read(s).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=bt(this,s=>this._options.read(s).renderOverviewRuler),this.renderSideBySide=bt(this,s=>this._options.read(s).renderSideBySide&&!(this._options.read(s).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(s))),this.readOnly=bt(this,s=>this._options.read(s).readOnly),this.shouldRenderRevertArrows=bt(this,s=>!(!this._options.read(s).renderMarginRevertIcon||!this.renderSideBySide.read(s)||this.readOnly.read(s))),this.renderIndicators=bt(this,s=>this._options.read(s).renderIndicators),this.enableSplitViewResizing=bt(this,s=>this._options.read(s).enableSplitViewResizing),this.splitViewDefaultRatio=bt(this,s=>this._options.read(s).splitViewDefaultRatio),this.ignoreTrimWhitespace=bt(this,s=>this._options.read(s).ignoreTrimWhitespace),this.maxComputationTimeMs=bt(this,s=>this._options.read(s).maxComputationTime),this.showMoves=bt(this,s=>this._options.read(s).experimental.showMoves&&this.renderSideBySide.read(s)),this.isInEmbeddedEditor=bt(this,s=>this._options.read(s).isInEmbeddedEditor),this.diffWordWrap=bt(this,s=>this._options.read(s).diffWordWrap),this.originalEditable=bt(this,s=>this._options.read(s).originalEditable),this.diffCodeLens=bt(this,s=>this._options.read(s).diffCodeLens),this.accessibilityVerbose=bt(this,s=>this._options.read(s).accessibilityVerbose),this.diffAlgorithm=bt(this,s=>this._options.read(s).diffAlgorithm),this.showEmptyDecorations=bt(this,s=>this._options.read(s).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=bt(this,s=>this._options.read(s).onlyShowAccessibleDiffViewer),this.hideUnchangedRegions=bt(this,s=>this._options.read(s).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=bt(this,s=>this._options.read(s).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=bt(this,s=>this._options.read(s).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=bt(this,s=>this._options.read(s).hideUnchangedRegions.minimumLineCount);const i=Object.assign(Object.assign({},e),nB(e,qn));this._options=li(this,i)}updateOptions(e){const t=nB(e,this._options.get()),i=Object.assign(Object.assign(Object.assign({},this._options.get()),e),t);this._options.set(i,void 0,{changedOptions:e})}}function nB(n,e){var t,i,s,o,r,a,l,c;return{enableSplitViewResizing:ve(n.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:rfe(n.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:ve(n.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:ve(n.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:eh(n.maxComputationTime,e.maxComputationTime,0,1073741824),maxFileSize:eh(n.maxFileSize,e.maxFileSize,0,1073741824),ignoreTrimWhitespace:ve(n.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:ve(n.renderIndicators,e.renderIndicators),originalEditable:ve(n.originalEditable,e.originalEditable),diffCodeLens:ve(n.diffCodeLens,e.diffCodeLens),renderOverviewRuler:ve(n.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:Li(n.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:Li(n.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:ve(n.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:ve((t=n.experimental)===null||t===void 0?void 0:t.showMoves,e.experimental.showMoves),showEmptyDecorations:ve((i=n.experimental)===null||i===void 0?void 0:i.showEmptyDecorations,e.experimental.showEmptyDecorations)},hideUnchangedRegions:{enabled:ve((o=(s=n.hideUnchangedRegions)===null||s===void 0?void 0:s.enabled)!==null&&o!==void 0?o:(r=n.experimental)===null||r===void 0?void 0:r.collapseUnchangedRegions,e.hideUnchangedRegions.enabled),contextLineCount:eh((a=n.hideUnchangedRegions)===null||a===void 0?void 0:a.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:eh((l=n.hideUnchangedRegions)===null||l===void 0?void 0:l.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:eh((c=n.hideUnchangedRegions)===null||c===void 0?void 0:c.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:ve(n.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:ve(n.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:eh(n.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:ve(n.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited)}}var fIe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},W0=function(n,e){return function(t,i){e(t,i,n)}};let mR=class extends XD{constructor(e,t,i,s,o,r,a,l){var c;super(),this._domElement=e,this._parentContextKeyService=s,this._parentInstantiationService=o,this._audioCueService=a,this._editorProgressService=l,this.elements=hn("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[hn("div.noModificationsOverlay@overlay",{style:{position:"absolute",height:"100%",visibility:"hidden"}},[ye("span",{},"No Changes")]),hn("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),hn("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),hn("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModel=this._register(mAe("diffModel",void 0)),this.onDidChangeModel=ue.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._parentInstantiationService.createChild(new DD([tt,this._contextKeyService])),this._boundarySashes=li(this,void 0),this._accessibleDiffViewerShouldBeVisible=li(this,!1),this._accessibleDiffViewerVisible=bt(this,p=>this._options.onlyShowAccessibleDiffViewer.read(p)?!0:this._accessibleDiffViewerShouldBeVisible.read(p)),this.movedBlocksLinesPart=li(this,void 0),this._layoutInfo=bt(this,p=>{var _,v,b;const y=this._rootSizeObserver.width.read(p),w=this._rootSizeObserver.height.read(p),C=(_=this._sash.read(p))===null||_===void 0?void 0:_.sashLeft.read(p),L=C??Math.max(5,this._editors.original.getLayoutInfo().decorationsLeft),x=y-L-(this._options.renderOverviewRuler.read(p)?cc.ENTIRE_DIFF_OVERVIEW_WIDTH:0),D=(b=(v=this.movedBlocksLinesPart.read(p))===null||v===void 0?void 0:v.width.read(p))!==null&&b!==void 0?b:0,k=L-D;return this.elements.original.style.width=k+"px",this.elements.original.style.left="0px",this.elements.modified.style.width=x+"px",this.elements.modified.style.left=L+"px",this._editors.original.layout({width:k,height:w}),this._editors.modified.layout({width:x,height:w}),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((p,_)=>p==null?void 0:p.diff.read(_)),this.onDidUpdateDiff=ue.fromObservableLight(this._diffValue),r.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(Ze(()=>this._domElement.removeChild(this.elements.root))),this._rootSizeObserver=this._register(new kAe(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout((c=t.automaticLayout)!==null&&c!==void 0?c:!1),this._options=new hIe(t,this._rootSizeObserver.width),this._contextKeyService.createKey($.isEmbeddedDiffEditor.key,!1);const d=$.isEmbeddedDiffEditor.bindTo(this._contextKeyService);this._register(ui(p=>{d.set(this._options.isInEmbeddedEditor.read(p))}));const u=$.comparingMovedCode.bindTo(this._contextKeyService);this._register(ui(p=>{var _;u.set(!!(!((_=this._diffModel.read(p))===null||_===void 0)&&_.movedTextToCompare.read(p)))}));const h=$.diffEditorRenderSideBySideInlineBreakpointReached.bindTo(this._contextKeyService);this._register(ui(p=>{h.set(this._options.couldShowInlineViewBecauseOfSize.read(p))})),this._editors=this._register(this._instantiationService.createInstance(pR,this.elements.original,this.elements.modified,this._options,i,(p,_,v,b)=>this._createInnerEditor(p,_,v,b))),this._sash=Nv(this,(p,_)=>{const v=this._options.renderSideBySide.read(p);if(this.elements.root.classList.toggle("side-by-side",v),!v)return;const b=_.add(new KAe(this._options,this.elements.root,{height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((y,w)=>y-(this._options.renderOverviewRuler.read(w)?cc.ENTIRE_DIFF_OVERVIEW_WIDTH:0))}));return _.add(ui(y=>{const w=this._boundarySashes.read(y);w&&b.setBoundarySashes(w)})),b}),this._register(Rx(this._sash)),this._register(js((p,_)=>{this.unchangedRangesFeature=_.add(this._instantiationService.createInstance(Kc(dR,p),this._editors,this._diffModel,this._options))})),this._register(js((p,_)=>{_.add(new(Kc(GAe,p))(this._editors,this._diffModel,this._options))})),this._register(js((p,_)=>{_.add(this._instantiationService.createInstance(Kc(gR,p),this._editors,this._diffModel,this._options,this,()=>this.unchangedRangesFeature.isUpdatingViewZones))})),this._register(js((p,_)=>{_.add(this._instantiationService.createInstance(Kc(cc,p),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(v=>v.modifiedEditor),this._options))})),this._register(js((p,_)=>{this._accessibleDiffViewer=_.add(this._register(this._instantiationService.createInstance(Kc(yd,p),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(v,b)=>this._accessibleDiffViewerShouldBeVisible.set(v,b),this._options.onlyShowAccessibleDiffViewer.map(v=>!v),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((v,b)=>{var y;return(y=v==null?void 0:v.diff.read(b))===null||y===void 0?void 0:y.mappings.map(w=>w.lineRangeMapping)}),this._editors)))}));const f=this._accessibleDiffViewerVisible.map(p=>p?"hidden":"visible");this._register(Od(this.elements.modified,{visibility:f})),this._register(Od(this.elements.original,{visibility:f})),this._createDiffEditorContributions(),r.addDiffEditor(this),this._register(Rx(this._layoutInfo)),this._register(js((p,_)=>{this.movedBlocksLinesPart.set(_.add(new(Kc(Fd,p))(this.elements.root,this._diffModel,this._layoutInfo.map(v=>v.originalEditor),this._layoutInfo.map(v=>v.modifiedEditor),this._editors)),void 0)})),this._register(Od(this.elements.overlay,{width:this._layoutInfo.map((p,_)=>p.originalEditor.width+(this._options.renderSideBySide.read(_)?0:p.modifiedEditor.width)),visibility:bt(p=>{var _,v;return this._options.hideUnchangedRegions.read(p)&&((v=(_=this._diffModel.read(p))===null||_===void 0?void 0:_.diff.read(p))===null||v===void 0?void 0:v.mappings.length)===0?"visible":"hidden"})})),this._register(this._editors.modified.onMouseDown(p=>{var _,v;if(!p.event.rightButton&&p.target.position&&(!((_=p.target.element)===null||_===void 0)&&_.className.includes("arrow-revert-change"))){const b=p.target.position.lineNumber,y=p.target,w=this._diffModel.get();if(!w)return;const C=(v=w.diff.get())===null||v===void 0?void 0:v.mappings;if(!C)return;const L=C.find(x=>(y==null?void 0:y.detail.afterLineNumber)===x.lineRangeMapping.modified.startLineNumber-1||x.lineRangeMapping.modified.startLineNumber===b);if(!L)return;this.revert(L.lineRangeMapping),p.event.stopPropagation()}})),this._register(ue.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,p=>{var _,v;if((p==null?void 0:p.reason)===3){const b=(v=(_=this._diffModel.get())===null||_===void 0?void 0:_.diff.get())===null||v===void 0?void 0:v.mappings.find(y=>y.lineRangeMapping.modified.contains(p.position.lineNumber));b!=null&&b.lineRangeMapping.modified.isEmpty?this._audioCueService.playAudioCue(dt.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):b!=null&&b.lineRangeMapping.original.isEmpty?this._audioCueService.playAudioCue(dt.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):b&&this._audioCueService.playAudioCue(dt.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}));const g=this._diffModel.map((p,_)=>p==null?void 0:p.isDiffUpToDate.read(_));this._register(js((p,_)=>{if(g.read(p)===!1){const v=this._editorProgressService.show(!0,1e3);_.add(Ze(()=>v.done()))}}))}_createInnerEditor(e,t,i,s){return e.createInstance(Tm,t,i,s)}_createDiffEditorContributions(){const e=gp.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(i){_t(i)}}get _targetEditor(){return this._editors.modified}getEditorType(){return fD.IDiffEditor}layout(e){this._rootSizeObserver.observe(e)}hasTextFocus(){return this._editors.original.hasTextFocus()||this._editors.modified.hasTextFocus()}saveViewState(){var e;const t=this._editors.original.saveViewState(),i=this._editors.modified.saveViewState();return{original:t,modified:i,modelState:(e=this._diffModel.get())===null||e===void 0?void 0:e.serializeState()}}restoreViewState(e){var t;if(e&&e.original&&e.modified){const i=e;this._editors.original.restoreViewState(i.original),this._editors.modified.restoreViewState(i.modified),i.modelState&&((t=this._diffModel.get())===null||t===void 0||t.restoreSerializedState(i.modelState))}}createViewModel(e){return this._instantiationService.createInstance(fR,e,this._options,this)}getModel(){var e,t;return(t=(e=this._diffModel.get())===null||e===void 0?void 0:e.model)!==null&&t!==void 0?t:null}setModel(e){!e&&this._diffModel.get()&&this._accessibleDiffViewer.close();const t=e?"model"in e?e:this.createViewModel(e):void 0;this._editors.original.setModel(t?t.model.original:null),this._editors.modified.setModel(t?t.model.modified:null),On(i=>{this._diffModel.set(t,i)})}updateOptions(e){this._options.updateOptions(e)}getContainerDomNode(){return this._domElement}getOriginalEditor(){return this._editors.original}getModifiedEditor(){return this._editors.modified}getLineChanges(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.diff.get();return t?mIe(t):null}revert(e){var t;const i=(t=this._diffModel.get())===null||t===void 0?void 0:t.model;if(!i)return;const s=e.innerChanges?e.innerChanges.map(o=>({range:o.modifiedRange,text:i.original.getValueInRange(o.originalRange)})):[{range:e.modified.toExclusiveRange(),text:i.original.getValueInRange(e.original.toExclusiveRange())}];this._editors.modified.executeEdits("diffEditor",s)}accessibleDiffViewerNext(){this._accessibleDiffViewer.next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.prev()}mapToOtherSide(){var e,t;const i=this._editors.modified.hasWidgetFocus(),s=i?this._editors.modified:this._editors.original,o=i?this._editors.original:this._editors.modified;let r;const a=s.getSelection();if(a){const l=(t=(e=this._diffModel.get())===null||e===void 0?void 0:e.diff.get())===null||t===void 0?void 0:t.mappings.map(c=>i?c.lineRangeMapping.flip():c.lineRangeMapping);if(l){const c=sB(a.getStartPosition(),l),d=sB(a.getEndPosition(),l);r=N.plusRange(c,d)}}return{destination:o,destinationSelection:r}}switchSide(){const{destination:e,destinationSelection:t}=this.mapToOtherSide();e.focus(),t&&e.setSelection(t)}exitCompareMove(){const e=this._diffModel.get();e&&e.movedTextToCompare.set(void 0,void 0)}collapseAllUnchangedRegions(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.unchangedRegions.get();t&&On(i=>{for(const s of t)s.collapseAll(i)})}showAllUnchangedRegions(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.unchangedRegions.get();t&&On(i=>{for(const s of t)s.showAll(i)})}};mR=fIe([W0(3,tt),W0(4,yt),W0(5,qt),W0(6,qD),W0(7,ny)],mR);function sB(n,e){const t=mT(e,s=>s.original.startLineNumber<=n.lineNumber);if(!t)return N.fromPositions(n);if(t.original.endLineNumberExclusive<=n.lineNumber){const s=n.lineNumber-t.original.endLineNumberExclusive+t.modified.endLineNumberExclusive;return N.fromPositions(new V(s,n.column))}if(!t.innerChanges)return N.fromPositions(new V(t.modified.startLineNumber,1));const i=mT(t.innerChanges,s=>s.originalRange.getStartPosition().isBeforeOrEqual(n));if(!i){const s=n.lineNumber-t.original.startLineNumber+t.modified.startLineNumber;return N.fromPositions(new V(s,n.column))}if(i.originalRange.containsPosition(n))return i.modifiedRange;{const s=gIe(i.originalRange.getEndPosition(),n);return N.fromPositions(pIe(i.modifiedRange.getEndPosition(),s))}}function gIe(n,e){return n.lineNumber===e.lineNumber?new hv(0,e.column-n.column):new hv(e.lineNumber-n.lineNumber,e.column-1)}function pIe(n,e){return e.lineCount===0?new V(n.lineNumber,n.column+e.columnCount):new V(n.lineNumber+e.lineCount,e.columnCount+1)}function mIe(n){return n.mappings.map(e=>{const t=e.lineRangeMapping;let i,s,o,r,a=t.innerChanges;return t.original.isEmpty?(i=t.original.startLineNumber-1,s=0,a=void 0):(i=t.original.startLineNumber,s=t.original.endLineNumberExclusive-1),t.modified.isEmpty?(o=t.modified.startLineNumber-1,r=0,a=void 0):(o=t.modified.startLineNumber,r=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:i,originalEndLineNumber:s,modifiedStartLineNumber:o,modifiedEndLineNumber:r,charChanges:a==null?void 0:a.map(l=>({originalStartLineNumber:l.originalRange.startLineNumber,originalStartColumn:l.originalRange.startColumn,originalEndLineNumber:l.originalRange.endLineNumber,originalEndColumn:l.originalRange.endColumn,modifiedStartLineNumber:l.modifiedRange.startLineNumber,modifiedStartColumn:l.modifiedRange.startColumn,modifiedEndLineNumber:l.modifiedRange.endLineNumber,modifiedEndColumn:l.modifiedRange.endColumn}))}})}var M3=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Ut=function(n,e){return function(t,i){e(t,i,n)}};let _Ie=0,oB=!1;function bIe(n){if(!n){if(oB)return;oB=!0}gbe(n||document.body)}let Wx=class extends Tm{constructor(e,t,i,s,o,r,a,l,c,d,u,h){const f=Object.assign({},t);f.ariaLabel=f.ariaLabel||fx.editorViewAccessibleLabel,f.ariaLabel=f.ariaLabel+";"+fx.accessibilityHelpMessage,super(e,f,{},i,s,o,r,l,c,d,u,h),a instanceof Bm?this._standaloneKeybindingService=a:this._standaloneKeybindingService=null,bIe(f.ariaContainerElement)}addCommand(e,t,i){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const s="DYNAMIC_"+ ++_Ie,o=xe.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(s,e,t,o),s}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if(typeof e.id!="string"||typeof e.label!="string"||typeof e.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),Y.None;const t=e.id,i=e.label,s=xe.and(xe.equals("editorId",this.getId()),xe.deserialize(e.precondition)),o=e.keybindings,r=xe.and(s,xe.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,l=e.contextMenuOrder||0,c=(f,...g)=>Promise.resolve(e.run(this,...g)),d=new pe,u=this.getId()+":"+t;if(d.add(Zt.registerCommand(u,c)),a){const f={command:{id:u,title:i},when:s,group:a,order:l};d.add(dr.appendMenuItem(I.EditorContext,f))}if(Array.isArray(o))for(const f of o)d.add(this._standaloneKeybindingService.addDynamicKeybinding(u,f,c,r));const h=new Aq(u,i,i,s,(...f)=>Promise.resolve(e.run(this,...f)),this._contextKeyService);return this._actions.set(t,h),d.add(Ze(()=>{this._actions.delete(t)})),d}_triggerCommand(e,t){if(this._codeEditorService instanceof lx)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};Wx=M3([Ut(2,yt),Ut(3,qt),Ut(4,gs),Ut(5,tt),Ut(6,vi),Ut(7,co),Ut(8,Dn),Ut(9,Eu),Ut(10,ao),Ut(11,nt)],Wx);let _R=class extends Wx{constructor(e,t,i,s,o,r,a,l,c,d,u,h,f,g,p){const _=Object.assign({},t);Nx(d,_,!1);const v=l.registerEditorContainer(e);typeof _.theme=="string"&&l.setTheme(_.theme),typeof _.autoDetectHighContrast<"u"&&l.setAutoDetectHighContrast(!!_.autoDetectHighContrast);const b=_.model;delete _.model,super(e,_,i,s,o,r,a,l,c,u,g,p),this._configurationService=d,this._standaloneThemeService=l,this._register(v);let y;if(typeof b>"u"){const w=f.getLanguageIdByMimeType(_.language)||_.language||$o;y=MK(h,f,_.value||"",w,void 0),this._ownsModel=!0}else y=b,this._ownsModel=!1;if(this._attachModel(y),y){const w={oldModelUrl:null,newModelUrl:y.uri};this._onDidChangeModel.fire(w)}}dispose(){super.dispose()}updateOptions(e){Nx(this._configurationService,e,!1),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};_R=M3([Ut(2,yt),Ut(3,qt),Ut(4,gs),Ut(5,tt),Ut(6,vi),Ut(7,Rr),Ut(8,Dn),Ut(9,ni),Ut(10,Eu),Ut(11,fs),Ut(12,Ni),Ut(13,ao),Ut(14,nt)],_R);let bR=class extends mR{constructor(e,t,i,s,o,r,a,l,c,d,u,h){const f=Object.assign({},t);Nx(l,f,!0);const g=r.registerEditorContainer(e);typeof f.theme=="string"&&r.setTheme(f.theme),typeof f.autoDetectHighContrast<"u"&&r.setAutoDetectHighContrast(!!f.autoDetectHighContrast),super(e,f,{},s,i,o,h,d),this._configurationService=l,this._standaloneThemeService=r,this._register(g)}dispose(){super.dispose()}updateOptions(e){Nx(this._configurationService,e,!0),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_createInnerEditor(e,t,i){return e.createInstance(Wx,t,i)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,i){return this.getModifiedEditor().addCommand(e,t,i)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};bR=M3([Ut(2,yt),Ut(3,tt),Ut(4,qt),Ut(5,Rr),Ut(6,Dn),Ut(7,ni),Ut(8,Tu),Ut(9,ny),Ut(10,hy),Ut(11,qD)],bR);function MK(n,e,t,i,s){if(t=t||"",!i){const o=t.indexOf(` -`);let r=t;return o!==-1&&(r=t.substring(0,o)),rB(n,t,e.createByFilepathOrFirstLine(s||null,r),s)}return rB(n,t,e.createById(i),s)}function rB(n,e,t,i){return n.createModel(e,t,i)}var PK=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function vIe(n,e,t){return Ae.initialize(t||{}).createInstance(_R,n,e)}function yIe(n){return Ae.get(qt).onCodeEditorAdd(t=>{n(t)})}function wIe(n){return Ae.get(qt).onDiffEditorAdd(t=>{n(t)})}function CIe(){return Ae.get(qt).listCodeEditors()}function SIe(){return Ae.get(qt).listDiffEditors()}function xIe(n,e,t){return Ae.initialize(t||{}).createInstance(bR,n,e)}function LIe(n){if(typeof n.id!="string"||typeof n.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return Zt.registerCommand(n.id,n.run)}function DIe(n){if(typeof n.id!="string"||typeof n.label!="string"||typeof n.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const e=xe.deserialize(n.precondition),t=(s,...o)=>Er.runEditorCommand(s,o,e,(r,a,l)=>Promise.resolve(n.run(a,...l))),i=new pe;if(i.add(Zt.registerCommand(n.id,t)),n.contextMenuGroupId){const s={command:{id:n.id,title:n.label},when:e,group:n.contextMenuGroupId,order:n.contextMenuOrder||0};i.add(dr.appendMenuItem(I.EditorContext,s))}if(Array.isArray(n.keybindings)){const s=Ae.get(vi);if(!(s instanceof Bm))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const o=xe.and(e,xe.deserialize(n.keybindingContext));i.add(s.addDynamicKeybindings(n.keybindings.map(r=>({keybinding:r,command:n.id,when:o}))))}}return i}function kIe(n){return OK([n])}function OK(n){const e=Ae.get(vi);return e instanceof Bm?e.addDynamicKeybindings(n.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:xe.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),Y.None)}function EIe(n,e,t){const i=Ae.get(Ni),s=i.getLanguageIdByMimeType(e)||e;return MK(Ae.get(fs),i,n,s,t)}function AIe(n,e){const t=Ae.get(Ni),i=t.getLanguageIdByMimeType(e)||e||$o;n.setLanguage(t.createById(i))}function IIe(n,e,t){n&&Ae.get(pl).changeOne(e,n.uri,t)}function TIe(n){Ae.get(pl).changeAll(n,[])}function NIe(n){return Ae.get(pl).read(n)}function RIe(n){return Ae.get(pl).onMarkerChanged(n)}function MIe(n){return Ae.get(fs).getModel(n)}function PIe(){return Ae.get(fs).getModels()}function OIe(n){return Ae.get(fs).onModelAdded(n)}function FIe(n){return Ae.get(fs).onModelRemoved(n)}function BIe(n){return Ae.get(fs).onModelLanguageChanged(t=>{n({model:t.model,oldLanguage:t.oldLanguageId})})}function WIe(n){return z_e(Ae.get(fs),Ae.get(ao),n)}function VIe(n,e){const t=Ae.get(Ni),i=Ae.get(Rr);return uP.colorizeElement(i,t,n,e).then(()=>{i.registerEditorContainer(n)})}function zIe(n,e,t){const i=Ae.get(Ni);return Ae.get(Rr).registerEditorContainer(document.body),uP.colorize(i,n,e,t)}function HIe(n,e,t=4){return Ae.get(Rr).registerEditorContainer(document.body),uP.colorizeModelLine(n,e,t)}function $Ie(n){const e=xi.get(n);return e||{getInitialState:()=>Xb,tokenize:(t,i,s)=>Fj(n,s)}}function UIe(n,e){xi.getOrCreate(e);const t=$Ie(e),i=Vf(n),s=[];let o=t.getInitialState();for(let r=0,a=i.length;rPK(this,void 0,void 0,function*(){var o;if(!i)return null;const r=(o=t.options)===null||o===void 0?void 0:o.selection;let a;return r&&typeof r.endLineNumber=="number"&&typeof r.endColumn=="number"?a=r:r&&(a={lineNumber:r.startLineNumber,column:r.startColumn}),(yield n.openCodeEditor(i,t.resource,a))?i:null}))}function XIe(){return{create:vIe,getEditors:CIe,getDiffEditors:SIe,onDidCreateEditor:yIe,onDidCreateDiffEditor:wIe,createDiffEditor:xIe,addCommand:LIe,addEditorAction:DIe,addKeybindingRule:kIe,addKeybindingRules:OK,createModel:EIe,setModelLanguage:AIe,setModelMarkers:IIe,getModelMarkers:NIe,removeAllMarkers:TIe,onDidChangeMarkers:RIe,getModels:PIe,getModel:MIe,onDidCreateModel:OIe,onWillDisposeModel:FIe,onDidChangeModelLanguage:BIe,createWebWorker:WIe,colorizeElement:VIe,colorize:zIe,colorizeModelLine:HIe,tokenize:UIe,defineTheme:jIe,setTheme:qIe,remeasureFonts:GIe,registerCommand:KIe,registerLinkOpener:YIe,registerEditorOpener:ZIe,AccessibilitySupport:fI,ContentWidgetPositionPreference:vI,CursorChangeReason:yI,DefaultEndOfLine:wI,EditorAutoIndentStrategy:SI,EditorOption:xI,EndOfLinePreference:LI,EndOfLineSequence:DI,MinimapPosition:PI,MouseTargetType:OI,OverlayWidgetPositionPreference:FI,OverviewRulerLane:BI,GlyphMarginLane:kI,RenderLineNumbersType:VI,RenderMinimap:zI,ScrollbarVisibility:$I,ScrollType:HI,TextEditorCursorBlinkingStyle:KI,TextEditorCursorStyle:YI,TrackedRangeStickiness:ZI,WrappingIndent:XI,InjectedTextCursorStops:AI,PositionAffinity:WI,ConfigurationChangedEvent:hU,BareFontInfo:Gh,FontInfo:eT,TextModelResolvedOptions:mC,FindMatch:qb,ApplyUpdateResult:I_,EditorZoom:Xc,EditorType:fD,EditorOptions:Ff}}function QIe(n,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!n(t))return!1;return!0}function Tw(n,e){return typeof n=="boolean"?n:e}function aB(n,e){return typeof n=="string"?n:e}function JIe(n){const e={};for(const t of n)e[t]=!0;return e}function lB(n,e=!1){e&&(n=n.map(function(i){return i.toLowerCase()}));const t=JIe(n);return e?function(i){return t[i.toLowerCase()]!==void 0&&t.hasOwnProperty(i.toLowerCase())}:function(i){return t[i]!==void 0&&t.hasOwnProperty(i)}}function vR(n,e){e=e.replace(/@@/g,"");let t=0,i;do i=!1,e=e.replace(/@(\w+)/g,function(o,r){i=!0;let a="";if(typeof n[r]=="string")a=n[r];else if(n[r]&&n[r]instanceof RegExp)a=n[r].source;else throw n[r]===void 0?zt(n,"language definition does not contain attribute '"+r+"', used at: "+e):zt(n,"attribute reference '"+r+"' must be a string, used at: "+e);return kg(a)?"":"(?:"+a+")"}),t++;while(i&&t<5);e=e.replace(/\x01/g,"@");const s=(n.ignoreCase?"i":"")+(n.unicode?"u":"");return new RegExp(e,s)}function eTe(n,e,t,i){if(i<0)return n;if(i=100){i=i-100;const s=t.split(".");if(s.unshift(t),i=0&&(i.tokenSubst=!0),typeof t.bracket=="string")if(t.bracket==="@open")i.bracket=1;else if(t.bracket==="@close")i.bracket=-1;else throw zt(n,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw zt(n,"the next state must be a string value in rule: "+e);{let s=t.next;if(!/^(@pop|@push|@popall)$/.test(s)&&(s[0]==="@"&&(s=s.substr(1)),s.indexOf("$")<0&&!rbe(n,Qc(n,s,"",[],""))))throw zt(n,"the next state '"+t.next+"' is not defined in rule: "+e);i.next=s}}return typeof t.goBack=="number"&&(i.goBack=t.goBack),typeof t.switchTo=="string"&&(i.switchTo=t.switchTo),typeof t.log=="string"&&(i.log=t.log),typeof t.nextEmbedded=="string"&&(i.nextEmbedded=t.nextEmbedded,n.usesEmbedded=!0),i}}else if(Array.isArray(t)){const i=[];for(let s=0,o=t.length;s0&&i[0]==="^",this.name=this.name+": "+i,this.regex=vR(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")")}setAction(e,t){this.action=yR(e,this.name,t)}}function FK(n,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const t={};t.languageId=n,t.includeLF=Tw(e.includeLF,!1),t.noThrow=!1,t.maxStack=100,t.start=typeof e.start=="string"?e.start:null,t.ignoreCase=Tw(e.ignoreCase,!1),t.unicode=Tw(e.unicode,!1),t.tokenPostfix=aB(e.tokenPostfix,"."+t.languageId),t.defaultToken=aB(e.defaultToken,"source"),t.usesEmbedded=!1;const i=e;i.languageId=n,i.includeLF=t.includeLF,i.ignoreCase=t.ignoreCase,i.unicode=t.unicode,i.noThrow=t.noThrow,i.usesEmbedded=t.usesEmbedded,i.stateNames=e.tokenizer,i.defaultToken=t.defaultToken;function s(r,a,l){for(const c of l){let d=c.include;if(d){if(typeof d!="string")throw zt(t,"an 'include' attribute must be a string at: "+r);if(d[0]==="@"&&(d=d.substr(1)),!e.tokenizer[d])throw zt(t,"include target '"+d+"' is not defined at: "+r);s(r+"."+d,a,e.tokenizer[d])}else{const u=new iTe(r);if(Array.isArray(c)&&c.length>=1&&c.length<=3)if(u.setRegex(i,c[0]),c.length>=3)if(typeof c[1]=="string")u.setAction(i,{token:c[1],next:c[2]});else if(typeof c[1]=="object"){const h=c[1];h.next=c[2],u.setAction(i,h)}else throw zt(t,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+r);else u.setAction(i,c[1]);else{if(!c.regex)throw zt(t,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+r);c.name&&typeof c.name=="string"&&(u.name=c.name),c.matchOnlyAtStart&&(u.matchOnlyAtLineStart=Tw(c.matchOnlyAtLineStart,!1)),u.setRegex(i,c.regex),u.setAction(i,c.action)}a.push(u)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw zt(t,"a language definition must define the 'tokenizer' attribute as an object");t.tokenizer=[];for(const r in e.tokenizer)if(e.tokenizer.hasOwnProperty(r)){t.start||(t.start=r);const a=e.tokenizer[r];t.tokenizer[r]=new Array,s("tokenizer."+r,t.tokenizer[r],a)}if(t.usesEmbedded=i.usesEmbedded,e.brackets){if(!Array.isArray(e.brackets))throw zt(t,"the 'brackets' attribute must be defined as an array")}else e.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];const o=[];for(const r of e.brackets){let a=r;if(a&&Array.isArray(a)&&a.length===3&&(a={token:a[2],open:a[0],close:a[1]}),a.open===a.close)throw zt(t,"open and close brackets in a 'brackets' attribute must be different: "+a.open+` - hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof a.open=="string"&&typeof a.token=="string"&&typeof a.close=="string")o.push({token:a.token+t.tokenPostfix,open:Td(t,a.open),close:Td(t,a.close)});else throw zt(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=o,t.noThrow=!0,t}var nTe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function sTe(n){ym.registerLanguage(n)}function oTe(){let n=[];return n=n.concat(ym.getLanguages()),n}function rTe(n){return Ae.get(Ni).languageIdCodec.encodeLanguageId(n)}function aTe(n,e){return Ae.withServices(()=>{const i=Ae.get(Ni).onDidRequestRichLanguageFeatures(s=>{s===n&&(i.dispose(),e())});return i})}function lTe(n,e){return Ae.withServices(()=>{const i=Ae.get(Ni).onDidRequestBasicLanguageFeatures(s=>{s===n&&(i.dispose(),e())});return i})}function cTe(n,e){if(!Ae.get(Ni).isRegisteredLanguageId(n))throw new Error(`Cannot set configuration for unknown language ${n}`);return Ae.get(ao).register(n,e,100)}class dTe{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if(typeof this._actual.tokenize=="function")return Mv.adaptTokenize(this._languageId,this._actual,e,i);throw new Error("Not supported!")}tokenizeEncoded(e,t,i){const s=this._actual.tokenizeEncoded(e,i);return new UL(s.tokens,s.endState)}}class Mv{constructor(e,t,i,s){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=s}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let s=0;for(let o=0,r=e.length;o0&&o[r-1]===h)continue;let f=u.startIndex;c===0?f=0:fnTe(this,void 0,void 0,function*(){const i=yield Promise.resolve(e.create());return i?uTe(i)?WK(n,i):new ev(Ae.get(Ni),Ae.get(Rr),n,FK(n,i),Ae.get(ni)):null}));return xi.registerFactory(n,t)}function gTe(n,e){if(!Ae.get(Ni).isRegisteredLanguageId(n))throw new Error(`Cannot set tokens provider for unknown language ${n}`);return BK(e)?P3(n,{create:()=>e}):xi.register(n,WK(n,e))}function pTe(n,e){const t=i=>new ev(Ae.get(Ni),Ae.get(Rr),n,FK(n,i),Ae.get(ni));return BK(e)?P3(n,{create:()=>e}):xi.register(n,t(e))}function mTe(n,e){return Ae.get(nt).referenceProvider.register(n,e)}function _Te(n,e){return Ae.get(nt).renameProvider.register(n,e)}function bTe(n,e){return Ae.get(nt).signatureHelpProvider.register(n,e)}function vTe(n,e){return Ae.get(nt).hoverProvider.register(n,{provideHover:(i,s,o)=>{const r=i.getWordAtPosition(s);return Promise.resolve(e.provideHover(i,s,o)).then(a=>{if(a)return!a.range&&r&&(a.range=new N(s.lineNumber,r.startColumn,s.lineNumber,r.endColumn)),a.range||(a.range=new N(s.lineNumber,s.column,s.lineNumber,s.column)),a})}})}function yTe(n,e){return Ae.get(nt).documentSymbolProvider.register(n,e)}function wTe(n,e){return Ae.get(nt).documentHighlightProvider.register(n,e)}function CTe(n,e){return Ae.get(nt).linkedEditingRangeProvider.register(n,e)}function STe(n,e){return Ae.get(nt).definitionProvider.register(n,e)}function xTe(n,e){return Ae.get(nt).implementationProvider.register(n,e)}function LTe(n,e){return Ae.get(nt).typeDefinitionProvider.register(n,e)}function DTe(n,e){return Ae.get(nt).codeLensProvider.register(n,e)}function kTe(n,e,t){return Ae.get(nt).codeActionProvider.register(n,{providedCodeActionKinds:t==null?void 0:t.providedCodeActionKinds,documentation:t==null?void 0:t.documentation,provideCodeActions:(s,o,r,a)=>{const c=Ae.get(pl).read({resource:s.uri}).filter(d=>N.areIntersectingOrTouching(d,o));return e.provideCodeActions(s,o,{markers:c,only:r.only,trigger:r.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function ETe(n,e){return Ae.get(nt).documentFormattingEditProvider.register(n,e)}function ATe(n,e){return Ae.get(nt).documentRangeFormattingEditProvider.register(n,e)}function ITe(n,e){return Ae.get(nt).onTypeFormattingEditProvider.register(n,e)}function TTe(n,e){return Ae.get(nt).linkProvider.register(n,e)}function NTe(n,e){return Ae.get(nt).completionProvider.register(n,e)}function RTe(n,e){return Ae.get(nt).colorProvider.register(n,e)}function MTe(n,e){return Ae.get(nt).foldingRangeProvider.register(n,e)}function PTe(n,e){return Ae.get(nt).declarationProvider.register(n,e)}function OTe(n,e){return Ae.get(nt).selectionRangeProvider.register(n,e)}function FTe(n,e){return Ae.get(nt).documentSemanticTokensProvider.register(n,e)}function BTe(n,e){return Ae.get(nt).documentRangeSemanticTokensProvider.register(n,e)}function WTe(n,e){return Ae.get(nt).inlineCompletionsProvider.register(n,e)}function VTe(n,e){return Ae.get(nt).inlayHintsProvider.register(n,e)}function zTe(){return{register:sTe,getLanguages:oTe,onLanguage:aTe,onLanguageEncountered:lTe,getEncodedLanguageId:rTe,setLanguageConfiguration:cTe,setColorMap:fTe,registerTokensProviderFactory:P3,setTokensProvider:gTe,setMonarchTokensProvider:pTe,registerReferenceProvider:mTe,registerRenameProvider:_Te,registerCompletionItemProvider:NTe,registerSignatureHelpProvider:bTe,registerHoverProvider:vTe,registerDocumentSymbolProvider:yTe,registerDocumentHighlightProvider:wTe,registerLinkedEditingRangeProvider:CTe,registerDefinitionProvider:STe,registerImplementationProvider:xTe,registerTypeDefinitionProvider:LTe,registerCodeLensProvider:DTe,registerCodeActionProvider:kTe,registerDocumentFormattingEditProvider:ETe,registerDocumentRangeFormattingEditProvider:ATe,registerOnTypeFormattingEditProvider:ITe,registerLinkProvider:TTe,registerColorProvider:RTe,registerFoldingRangeProvider:MTe,registerDeclarationProvider:PTe,registerSelectionRangeProvider:OTe,registerDocumentSemanticTokensProvider:FTe,registerDocumentRangeSemanticTokensProvider:BTe,registerInlineCompletionsProvider:WTe,registerInlayHintsProvider:VTe,DocumentHighlightKind:CI,CompletionItemKind:mI,CompletionItemTag:_I,CompletionItemInsertTextRule:pI,SymbolKind:qI,SymbolTag:GI,IndentAction:EI,CompletionTriggerKind:bI,SignatureHelpTriggerKind:jI,InlayHintKind:II,InlineCompletionTriggerKind:TI,CodeActionTriggerType:gI,FoldingRangeKind:cs,SelectedSuggestionInfo:Ige}}const O3=at("IEditorCancelService"),VK=new _e("cancellableOperation",!1,m("cancellableOperation","Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));gt(O3,class{constructor(){this._tokens=new WeakMap}add(n,e){let t=this._tokens.get(n);t||(t=n.invokeWithinContext(s=>{const o=VK.bindTo(s.get(tt)),r=new ks;return{key:o,tokens:r}}),this._tokens.set(n,t));let i;return t.key.set(!0),i=t.tokens.push(e),()=>{i&&(i(),t.key.set(!t.tokens.isEmpty()),i=void 0)}}cancel(n){const e=this._tokens.get(n);if(!e)return;const t=e.tokens.pop();t&&(t.cancel(),e.key.set(!e.tokens.isEmpty()))}},1);class HTe extends Ir{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(O3).add(e,this))}dispose(){this._unregister(),super.dispose()}}Ee(new class extends Er{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:VK})}runEditorCommand(n,e){n.get(O3).cancel(e)}});let $Te=class wR{constructor(e,t){if(this.flags=t,this.flags&1){const i=e.getModel();this.modelVersionId=i?Bb("{0}#{1}",i.uri.toString(),i.getVersionId()):null}else this.modelVersionId=null;this.flags&4?this.position=e.getPosition():this.position=null,this.flags&2?this.selection=e.getSelection():this.selection=null,this.flags&8?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof wR))return!1;const t=e;return!(this.modelVersionId!==t.modelVersionId||this.scrollLeft!==t.scrollLeft||this.scrollTop!==t.scrollTop||!this.position&&t.position||this.position&&!t.position||this.position&&t.position&&!this.position.equals(t.position)||!this.selection&&t.selection||this.selection&&!t.selection||this.selection&&t.selection&&!this.selection.equalsRange(t.selection))}validate(e){return this._equals(new wR(e,this.flags))}};class UTe extends HTe{constructor(e,t,i,s){super(e,s),this._listener=new pe,t&4&&this._listener.add(e.onDidChangeCursorPosition(o=>{(!i||!N.containsPosition(i,o.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(o=>{(!i||!N.containsRange(i,o.selection))&&this.cancel()})),t&8&&this._listener.add(e.onDidScrollChange(o=>this.cancel())),t&1&&(this._listener.add(e.onDidChangeModel(o=>this.cancel())),this._listener.add(e.onDidChangeModelContent(o=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class jTe extends Ir{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}function zK(n){return n&&typeof n.getEditorType=="function"?n.getEditorType()===fD.ICodeEditor:!1}class cB{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class qTe{constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(cB.toKey(e))}has(e){return this._set.has(cB.toKey(e))}}var c0=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function GTe(n,e,t){const i=[],s=new qTe,o=n.ordered(t);for(const a of o)i.push(a),a.extensionId&&s.add(a.extensionId);const r=e.ordered(t);for(const a of r){if(a.extensionId){if(s.has(a.extensionId))continue;s.add(a.extensionId)}i.push({displayName:a.displayName,extensionId:a.extensionId,provideDocumentFormattingEdits(l,c,d){return a.provideDocumentRangeFormattingEdits(l,l.getFullModelRange(),c,d)}})}return i}class Pv{static setFormatterSelector(e){return{dispose:Pv._selectors.unshift(e)}}static select(e,t,i){return c0(this,void 0,void 0,function*(){if(e.length===0)return;const s=ht.first(Pv._selectors);if(s)return yield s(e,t,i)})}}Pv._selectors=new ks;function KTe(n,e,t,i,s,o){return c0(this,void 0,void 0,function*(){const r=e.documentRangeFormattingEditProvider.ordered(t);for(const a of r){const l=yield Promise.resolve(a.provideDocumentRangeFormattingEdits(t,i,s,o)).catch(wc);if(sc(l))return yield n.computeMoreMinimalEdits(t.uri,l)}})}function YTe(n,e,t,i,s){return c0(this,void 0,void 0,function*(){const o=GTe(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const r of o){const a=yield Promise.resolve(r.provideDocumentFormattingEdits(t,i,s)).catch(wc);if(sc(a))return yield n.computeMoreMinimalEdits(t.uri,a)}})}function ZTe(n,e,t,i,s,o,r){const a=e.onTypeFormattingEditProvider.ordered(t);return a.length===0||a[0].autoFormatTriggerCharacters.indexOf(s)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(t,i,s,o,r)).catch(wc).then(l=>n.computeMoreMinimalEdits(t.uri,l))}Zt.registerCommand("_executeFormatRangeProvider",function(n,...e){return c0(this,void 0,void 0,function*(){const[t,i,s]=e;Ls(je.isUri(t)),Ls(N.isIRange(i));const o=n.get(xu),r=n.get(ry),a=n.get(nt),l=yield o.createModelReference(t);try{return KTe(r,a,l.object.textEditorModel,N.lift(i),s,ln.None)}finally{l.dispose()}})});Zt.registerCommand("_executeFormatDocumentProvider",function(n,...e){return c0(this,void 0,void 0,function*(){const[t,i]=e;Ls(je.isUri(t));const s=n.get(xu),o=n.get(ry),r=n.get(nt),a=yield s.createModelReference(t);try{return YTe(o,r,a.object.textEditorModel,i,ln.None)}finally{a.dispose()}})});Zt.registerCommand("_executeFormatOnTypeProvider",function(n,...e){return c0(this,void 0,void 0,function*(){const[t,i,s,o]=e;Ls(je.isUri(t)),Ls(V.isIPosition(i)),Ls(typeof s=="string");const r=n.get(xu),a=n.get(ry),l=n.get(nt),c=yield r.createModelReference(t);try{return ZTe(a,l,c.object.textEditorModel,V.lift(i),s,o,ln.None)}finally{c.dispose()}})});Ff.wrappingIndent.defaultValue=0;Ff.glyphMargin.defaultValue=!1;Ff.autoIndent.defaultValue=3;Ff.overviewRulerLanes.defaultValue=2;Pv.setFormatterSelector((n,e,t)=>Promise.resolve(n[0]));const ms=EU();ms.editor=XIe();ms.languages=zTe();const XTe=ms.CancellationTokenSource,QTe=ms.Emitter,JTe=ms.KeyCode,eNe=ms.KeyMod,tNe=ms.Position,iNe=ms.Range,nNe=ms.Selection,sNe=ms.SelectionDirection,oNe=ms.MarkerSeverity,rNe=ms.MarkerTag,aNe=ms.Uri,lNe=ms.Token,HK=ms.editor,$K=ms.languages,vE=globalThis.MonacoEnvironment;(vE!=null&&vE.globalAPI||typeof define=="function"&&define.amd)&&(globalThis.monaco=ms);typeof globalThis.require<"u"&&typeof globalThis.require.config=="function"&&globalThis.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]});const cNe=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:XTe,Emitter:QTe,KeyCode:JTe,KeyMod:eNe,MarkerSeverity:oNe,MarkerTag:rNe,Position:tNe,Range:iNe,Selection:nNe,SelectionDirection:sNe,Token:lNe,Uri:aNe,editor:HK,languages:$K},Symbol.toStringTag,{value:"Module"})),dNe="#/definitions/RootSpec",uNe="http://json-schema.org/draft-07/schema#",hNe={AggregateOp:{enum:["count","valid","sum","min","max","mean","median","variance"],type:"string"},AggregateParams:{additionalProperties:!1,properties:{as:{description:"The names for the output fields corresponding to each aggregated field. If not provided, names will be automatically created using the operation and field names (e.g., `sum_field`, `average_field`).",items:{type:"string"},type:"array"},fields:{description:"The data fields to apply aggregate functions to. This array should correspond with the `ops` and `as` arrays. If no fields or operations are specified, a count aggregation will be applied by default.",items:{$ref:"#/definitions/Field"},type:"array"},groupby:{description:"The fields by which to group the data. If these are not defined, all data objects will be grouped into a single category.",items:{$ref:"#/definitions/Field"},type:"array"},ops:{description:'The aggregation operations to be performed on the fields, such as `"sum"`, `"average"`, or `"count"`.',items:{$ref:"#/definitions/AggregateOp"},type:"array"},type:{const:"aggregate",description:"The type of the transform to be applied",type:"string"}},required:["type"],type:"object"},Align:{enum:["left","center","right"],type:"string"},Axis:{additionalProperties:!1,properties:{domain:{description:"A boolean flag indicating if the domain (the axis baseline) should be included as part of the axis.\n\n__Default value:__ `true`",type:"boolean"},domainCap:{description:'The stroke cap for the domain line\'s ending style. One of `"butt"`, `"round"` or `"square"`.\n\n__Default value:__ `"butt"`',enum:["butt","round","square"],type:"string"},domainColor:{description:'Color of axis domain line.\n\n__Default value:__ `"gray"`.',type:"string"},domainDash:{description:"An array of alternating [stroke, space] lengths for dashed domain lines.",items:{type:"number"},type:"array"},domainDashOffset:{description:"The pixel offset at which to start drawing with the domain dash array.",type:"number"},domainWidth:{description:"Stroke width of axis domain line\n\n__Default value:__ `1`",type:"number"},format:{description:"The format specifier pattern for axis labels. Must be a legal [d3-format](https://github.com/d3/d3-format#locale_format) specifier.",type:"string"},grid:{description:"A boolean flag indicating if grid lines should be included as part of the axis.\n\n__Default value:__ `false`",type:"boolean"},gridCap:{description:'The stroke cap for the grid line\'s ending style. One of `"butt"`, `"round"` or `"square"`.\n\n__Default value:__ `"butt"`',enum:["butt","round","square"],type:"string"},gridColor:{description:"Color of grid lines.\n\n__Default value:__ `lightgray`",type:"string"},gridDash:{description:"An array of alternating [stroke, space] lengths for dashed grid mark lines.",items:{type:"number"},type:"array"},gridDashOffset:{description:"The pixel offset at which to start drawing with the grid mark dash array.",type:"number"},gridOpacity:{description:"The opacity of the grid lines.\n\n__Default value:__ `1`",type:"number"},gridWidth:{description:"Width of the grid lines.\n\n__Default value:__ `1`",type:"number"},labelAlign:{$ref:"#/definitions/Align",description:"Horizontal text alignment of axis tick labels, overriding the default setting for the current axis orientation."},labelAngle:{description:"The rotation angle of the axis labels.\n\n__Default value:__ `-90` for nominal and ordinal fields; `0` otherwise.",maximum:360,minimum:-360,type:"number"},labelBaseline:{$ref:"#/definitions/Baseline",description:'Vertical text baseline of axis tick labels, overriding the default setting for the current axis orientation. One of `"alphabetic"` (default), `"top"`, `"middle"`, `"bottom"`.'},labelColor:{description:"The color of the tick label, can be in hex color code or regular color name.",type:"string"},labelFont:{description:"The font of the tick label.",type:"string"},labelFontSize:{description:"The font size of the label, in pixels.",minimum:0,type:"number"},labelFontStyle:{description:"Font style of the title.",type:"string"},labelFontWeight:{description:"Font weight of axis tick labels.",type:"string"},labelLimit:{description:"Maximum allowed pixel width of axis tick labels.\n\n__Default value:__ `180`",type:"number"},labelPadding:{description:"The padding, in pixels, between axis and text labels.\n\n__Default value:__ `2`",type:"number"},labels:{description:"A boolean flag indicating if labels should be included as part of the axis.\n\n__Default value:__ `true`.",type:"boolean"},maxExtent:{description:"The maximum extent in pixels that axis ticks and labels should use. This determines a maximum offset value for axis titles.\n\n__Default value:__ `undefined`.",type:"number"},minExtent:{description:"The minimum extent in pixels that axis ticks and labels should use. This determines a minimum offset value for axis titles.\n\n__Default value:__ `30` for y-axis; `undefined` for x-axis.",type:"number"},offset:{description:"The orthogonal offset in pixels by which to displace the axis from its position along the edge of the chart.",type:"number"},orient:{$ref:"#/definitions/AxisOrient",description:'The orientation of the axis. One of `"top"`, `"bottom"`, `"left"` or `"right"`. The orientation can be used to further specialize the axis type (e.g., a y axis oriented for the right edge of the chart).\n\n__Default value:__ `"bottom"` for x-axes and `"left"` for y-axes.'},tickCap:{description:'The stroke cap for the tick lines\' ending style. One of `"butt"`, `"round"` or `"square"`.\n\n__Default value:__ `"butt"`',enum:["butt","round","square"],type:"string"},tickColor:{description:`The color of the axis's tick. +`),yield this._clipboardService.writeText(w)}))),i.getOption(90)||v.push(new So("diff.inline.revertChange",m("diff.inline.revertChange.label","Revert this change"),void 0,!0,()=>fE(this,void 0,void 0,function*(){this._editor.revert(this._diff)}))),v},autoSelectFirstItem:!0})};this._register(Ui(this._diffActions,"mousedown",g=>{const{top:p,height:_}=Tn(this._diffActions),v=Math.floor(d/3);g.preventDefault(),f(g.posx,p+_+v)})),this._register(i.onMouseMove(g=>{(g.target.type===8||g.target.type===5)&&g.target.detail.viewZoneId===this._getViewZoneId()?(u=this._updateLightBulbPosition(this._marginDomNode,g.event.browserEvent.y,d),this.visibility=!0):this.visibility=!1})),this._register(i.onMouseDown(g=>{g.event.rightButton&&(g.target.type===8||g.target.type===5)&&g.target.detail.viewZoneId===this._getViewZoneId()&&(g.event.preventDefault(),u=this._updateLightBulbPosition(this._marginDomNode,g.event.browserEvent.y,d),f(g.event.posx,g.event.posy+d))}))}_updateLightBulbPosition(e,t,i){const{top:s}=Tn(e),o=t-s,r=Math.floor(o/i),a=r*i;if(this._diffActions.style.top=`${a}px`,this._viewLineCounts){let l=0;for(let c=0;cn});function DIe(n,e,t,i){Nn(i,e.fontInfo);const s=t.length>0,o=new eD(1e4);let r=0,a=0;const l=[];for(let h=0;h');const l=e.getLineContent(),c=Lo.isBasicASCII(l,s),d=Lo.containsRTL(l,c,o),u=a3(new l0(r.fontInfo.isMonospace&&!r.disableMonospaceOptimizations,r.fontInfo.canUseHalfwidthRightwardsArrow,l,!1,c,d,0,e,t,r.tabSize,0,r.fontInfo.spaceWidth,r.fontInfo.middotWidth,r.fontInfo.wsmiddotWidth,r.stopRenderingLineAfter,r.renderWhitespace,r.renderControlCharacters,r.fontLigatures!==To.OFF,null),a);return a.appendString(""),u.characterMapping.getHorizontalOffset(u.characterMapping.length)}var EIe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Y8=function(n,e){return function(t,i){e(t,i,n)}};let hR=class extends Y{constructor(e,t,i,s,o,r,a){super(),this._editors=e,this._diffModel=t,this._options=i,this._diffEditorWidget=s,this._canIgnoreViewZoneUpdateEvent=o,this._clipboardService=r,this._contextMenuService=a,this._originalTopPadding=ai(this,0),this._originalScrollOffset=ai(this,0),this._originalScrollOffsetAnimated=O8(this._originalScrollOffset,this._store),this._modifiedTopPadding=ai(this,0),this._modifiedScrollOffset=ai(this,0),this._modifiedScrollOffsetAnimated=O8(this._modifiedScrollOffset,this._store);let l=!1;const c=ai("state",0),d=this._register(new Li(()=>{c.set(c.get()+1,void 0)},0));this._register(this._editors.original.onDidChangeViewZones(w=>{!l&&!this._canIgnoreViewZoneUpdateEvent()&&d.schedule()})),this._register(this._editors.modified.onDidChangeViewZones(w=>{!l&&!this._canIgnoreViewZoneUpdateEvent()&&d.schedule()})),this._register(this._editors.original.onDidChangeConfiguration(w=>{(w.hasChanged(144)||w.hasChanged(66))&&d.schedule()})),this._register(this._editors.modified.onDidChangeConfiguration(w=>{(w.hasChanged(144)||w.hasChanged(66))&&d.schedule()}));const u=this._diffModel.map(w=>w?As(w.model.original.onDidChangeTokens,()=>w.model.original.tokenization.backgroundTokenizationState===2):void 0).map((w,S)=>w==null?void 0:w.read(S)),h=new Set,f=new Set,g=_t(w=>{const S=this._diffModel.read(w),L=S==null?void 0:S.diff.read(w);if(!S||!L)return null;c.read(w);const D=this._options.renderSideBySide.read(w);return Z8(this._editors.original,this._editors.modified,L.mappings,h,f,D)}),p=_t(w=>{var S;const L=(S=this._diffModel.read(w))===null||S===void 0?void 0:S.movedTextToCompare.read(w);if(!L)return null;c.read(w);const x=L.changes.map(D=>new NK(D));return Z8(this._editors.original,this._editors.modified,x,h,f,!0)});function _(){const w=document.createElement("div");return w.className="diagonal-fill",w}const v=this._register(new pe),b=_t(w=>{var S,L,x,D,k,P,O,M;v.clear();const R=g.read(w)||[],z=[],G=[],te=this._modifiedTopPadding.read(w);te>0&&G.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:te,showInHiddenAreas:!0,suppressMouseDown:!0});const ae=this._originalTopPadding.read(w);ae>0&&z.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:ae,showInHiddenAreas:!0,suppressMouseDown:!0});const fe=this._options.renderSideBySide.read(w),oe=fe||(S=this._editors.modified._getViewModel())===null||S===void 0?void 0:S.createLineBreaksComputer();if(oe){for(const qe of R)if(qe.diff)for(let ni=qe.originalRange.startLineNumber;nithis._editors.original.getModel().tokenization.getLineTokens(It)),qe.originalRange.mapToLineArray(It=>Se[Ie++]),Zt,Dt),ge=[];for(const It of qe.diff.innerChanges||[])ge.push(new W_(It.originalRange.delta(-(qe.diff.original.startLineNumber-1)),aR.className,0));const he=DIe(Ve,Tt,ge,ke),ki=document.createElement("div");if(ki.className="inline-deleted-margin-view-zone",Nn(ki,Tt.fontInfo),this._options.renderIndicators.read(w))for(let It=0;IteI(kt),ki,this._editors.modified,qe.diff,this._diffEditorWidget,he.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let It=0;It1&&z.push({afterLineNumber:qe.originalRange.startLineNumber+It,domNode:_(),heightInPx:(vi-1)*me,showInHiddenAreas:!0,suppressMouseDown:!0})}G.push({afterLineNumber:qe.modifiedRange.startLineNumber-1,domNode:ke,heightInPx:he.heightInLines*me,minWidthInPx:he.minWidthInPx,marginDomNode:ki,setZoneId(It){kt=It},showInHiddenAreas:!0,suppressMouseDown:!0})}const ni=document.createElement("div");ni.className="gutter-delete",z.push({afterLineNumber:qe.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:qe.modifiedHeightInPx,marginDomNode:ni,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const ni=qe.modifiedHeightInPx-qe.originalHeightInPx;if(ni>0){if(ie!=null&&ie.lineRangeMapping.original.delta(-1).deltaLength(2).contains(qe.originalRange.endLineNumberExclusive-1))continue;z.push({afterLineNumber:qe.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:ni,showInHiddenAreas:!0,suppressMouseDown:!0})}else{let ke=function(){const ge=document.createElement("div");return ge.className="arrow-revert-change "+Te.asClassName(se.arrowRight),ye("div",{},ge)};if(ie!=null&&ie.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(qe.modifiedRange.endLineNumberExclusive-1))continue;let Ve;qe.diff&&qe.diff.modified.isEmpty&&this._options.shouldRenderRevertArrows.read(w)&&(Ve=ke()),G.push({afterLineNumber:qe.modifiedRange.endLineNumberExclusive-1,domNode:_(),heightInPx:-ni,marginDomNode:Ve,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const qe of(M=p.read(w))!==null&&M!==void 0?M:[]){if(!(ie!=null&&ie.lineRangeMapping.original.intersect(qe.originalRange))||!(ie!=null&&ie.lineRangeMapping.modified.intersect(qe.modifiedRange)))continue;const ni=qe.modifiedHeightInPx-qe.originalHeightInPx;ni>0?z.push({afterLineNumber:qe.originalRange.endLineNumberExclusive-1,domNode:_(),heightInPx:ni,showInHiddenAreas:!0,suppressMouseDown:!0}):G.push({afterLineNumber:qe.modifiedRange.endLineNumberExclusive-1,domNode:_(),heightInPx:-ni,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:z,mod:G}});this._register($s(w=>{const S=Pv.capture(this._editors.modified),L=b.read(w);l=!0,this._editors.original.changeViewZones(x=>{for(const D of h)x.removeZone(D);h.clear();for(const D of L.orig){const k=x.addZone(D);D.setZoneId&&D.setZoneId(k),h.add(k)}}),this._editors.modified.changeViewZones(x=>{for(const D of f)x.removeZone(D);f.clear();for(const D of L.mod){const k=x.addZone(D);D.setZoneId&&D.setZoneId(k),f.add(k)}}),l=!1,S.restore(this._editors.modified)})),this._register(Ye(()=>{this._editors.original.changeViewZones(w=>{for(const S of h)w.removeZone(S);h.clear()}),this._editors.modified.changeViewZones(w=>{for(const S of f)w.removeZone(S);f.clear()})}));let y=!1;this._register(this._editors.original.onDidScrollChange(w=>{w.scrollLeftChanged&&!y&&(y=!0,this._editors.modified.setScrollLeft(w.scrollLeft),y=!1)})),this._register(this._editors.modified.onDidScrollChange(w=>{w.scrollLeftChanged&&!y&&(y=!0,this._editors.original.setScrollLeft(w.scrollLeft),y=!1)})),this._originalScrollTop=As(this._editors.original.onDidScrollChange,()=>this._editors.original.getScrollTop()),this._modifiedScrollTop=As(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),this._register(di(w=>{const S=this._originalScrollTop.read(w)-(this._originalScrollOffsetAnimated.get()-this._modifiedScrollOffsetAnimated.read(w))-(this._originalTopPadding.get()-this._modifiedTopPadding.read(w));S!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(S,1)})),this._register(di(w=>{const S=this._modifiedScrollTop.read(w)-(this._modifiedScrollOffsetAnimated.get()-this._originalScrollOffsetAnimated.read(w))-(this._modifiedTopPadding.get()-this._originalTopPadding.read(w));S!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(S,1)})),this._register(di(w=>{var S;const L=(S=this._diffModel.read(w))===null||S===void 0?void 0:S.movedTextToCompare.read(w);let x=0;if(L){const D=this._editors.original.getTopForLineNumber(L.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.get();x=this._editors.modified.getTopForLineNumber(L.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.get()-D}x>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(x,void 0)):x<0?(this._modifiedTopPadding.set(-x,void 0),this._originalTopPadding.set(0,void 0)):setTimeout(()=>{this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(0,void 0)},400),this._editors.modified.hasTextFocus()?this._originalScrollOffset.set(this._modifiedScrollOffset.get()-x,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.get()+x,void 0,!0)}))}};hR=EIe([Y8(5,gy),Y8(6,Nu)],hR);function Z8(n,e,t,i,s,o){const r=new _c(X8(n,i)),a=new _c(X8(e,s)),l=n.getOption(66),c=e.getOption(66),d=[];let u=0,h=0;function f(g,p){for(;;){let _=r.peek(),v=a.peek();if(_&&_.lineNumber>=g&&(_=void 0),v&&v.lineNumber>=p&&(v=void 0),!_&&!v)break;const b=_?_.lineNumber-u:Number.MAX_VALUE,y=v?v.lineNumber-h:Number.MAX_VALUE;by?(a.dequeue(),_={lineNumber:v.lineNumber-h+u,heightInPx:0}):(r.dequeue(),a.dequeue()),d.push({originalRange:Xe.ofLength(_.lineNumber,1),modifiedRange:Xe.ofLength(v.lineNumber,1),originalHeightInPx:l+_.heightInPx,modifiedHeightInPx:c+v.heightInPx,diff:void 0})}}for(const g of t){let y=function(w,S){var L,x,D,k;if(wz.lineNumberz+G.heightInPx,0))!==null&&x!==void 0?x:0,R=(k=(D=a.takeWhile(z=>z.lineNumberz+G.heightInPx,0))!==null&&k!==void 0?k:0;d.push({originalRange:P,modifiedRange:O,originalHeightInPx:P.length*l+M,modifiedHeightInPx:O.length*c+R,diff:g.lineRangeMapping}),b=w,v=S};const p=g.lineRangeMapping;f(p.original.startLineNumber,p.modified.startLineNumber);let _=!0,v=p.modified.startLineNumber,b=p.original.startLineNumber;if(o)for(const w of p.innerChanges||[])w.originalRange.startColumn>1&&w.modifiedRange.startColumn>1&&y(w.originalRange.startLineNumber,w.modifiedRange.startLineNumber),w.originalRange.endColumn1&&i.push({lineNumber:l,heightInPx:r*(c-1)})}for(const l of n.getWhitespaces()){if(e.has(l.id))continue;const c=l.afterLineNumber===0?0:o.convertViewPositionToModelPosition(new V(l.afterLineNumber,1)).lineNumber;t.push({lineNumber:c,heightInPx:l.height})}return qAe(t,i,l=>l.lineNumber,(l,c)=>({lineNumber:l.lineNumber,heightInPx:l.heightInPx+c.heightInPx}))}var AIe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},IIe=function(n,e){return function(t,i){e(t,i,n)}},zr;let dc=zr=class extends Y{constructor(e,t,i,s,o,r,a,l){super(),this._editors=e,this._rootElement=t,this._diffModel=i,this._rootWidth=s,this._rootHeight=o,this._modifiedEditorLayoutInfo=r,this._options=a,this._themeService=l;const c=As(this._themeService.onDidColorThemeChange,()=>this._themeService.getColorTheme()),d=_t(f=>{const g=c.read(f),p=g.getColor(Fve)||(g.getColor(Pve)||DT).transparent(2),_=g.getColor(Bve)||(g.getColor(Ove)||kT).transparent(2);return{insertColor:p,removeColor:_}}),u=As(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollTop()),h=As(this._editors.modified.onDidScrollChange,()=>this._editors.modified.getScrollHeight());this._register($s((f,g)=>{if(!this._options.renderOverviewRuler.read(f))return;const p=bt(document.createElement("div"));p.setClassName("diffViewport"),p.setPosition("absolute");const _=dn("div.diffOverview",{style:{position:"absolute",top:"0px",width:zr.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;g.add(xw(_,p.domNode)),g.add(Ui(_,de.POINTER_DOWN,v=>{this._editors.modified.delegateVerticalScrollbarPointerDown(v)})),g.add(K(_,de.MOUSE_WHEEL,v=>{this._editors.modified.delegateScrollFromMouseWheelEvent(v)},{passive:!1})),g.add(xw(this._rootElement,_)),g.add($s((v,b)=>{const y=this._diffModel.read(v),w=this._editors.original.createOverviewRuler("original diffOverviewRuler");w&&(b.add(w),b.add(xw(_,w.getDomNode())));const S=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(S&&(b.add(S),b.add(xw(_,S.getDomNode()))),!w||!S)return;const L=Ro("viewZoneChanged",this._editors.original.onDidChangeViewZones),x=Ro("viewZoneChanged",this._editors.modified.onDidChangeViewZones),D=Ro("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),k=Ro("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);b.add(di(P=>{var O;L.read(P),x.read(P),D.read(P),k.read(P);const M=d.read(P),R=(O=y==null?void 0:y.diff.read(P))===null||O===void 0?void 0:O.mappings;function z(ae,fe,oe){const Se=oe._getViewModel();return Se?ae.filter(Ie=>Ie.length>0).map(Ie=>{const me=Se.coordinatesConverter.convertModelPositionToViewPosition(new V(Ie.startLineNumber,1)),ie=Se.coordinatesConverter.convertModelPositionToViewPosition(new V(Ie.endLineNumberExclusive,1)),Zt=ie.lineNumber-me.lineNumber;return new kq(me.lineNumber,ie.lineNumber,Zt,fe.toString())}):[]}const G=z((R||[]).map(ae=>ae.lineRangeMapping.original),M.removeColor,this._editors.original),te=z((R||[]).map(ae=>ae.lineRangeMapping.modified),M.insertColor,this._editors.modified);w==null||w.setZones(G),S==null||S.setZones(te)})),b.add(di(P=>{const O=this._rootHeight.read(P),M=this._rootWidth.read(P),R=this._modifiedEditorLayoutInfo.read(P);if(R){const z=zr.ENTIRE_DIFF_OVERVIEW_WIDTH-2*zr.ONE_OVERVIEW_WIDTH;w.setLayout({top:0,height:O,right:z+zr.ONE_OVERVIEW_WIDTH,width:zr.ONE_OVERVIEW_WIDTH}),S.setLayout({top:0,height:O,right:0,width:zr.ONE_OVERVIEW_WIDTH});const G=u.read(P),te=h.read(P),ae=this._editors.modified.getOption(102),fe=new Tm(ae.verticalHasArrows?ae.arrowSize:0,ae.verticalScrollbarSize,0,R.height,te,G);p.setTop(fe.getSliderPosition()),p.setHeight(fe.getSliderSize())}else p.setTop(0),p.setHeight(0);_.style.height=O+"px",_.style.left=M-zr.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",p.setWidth(zr.ENTIRE_DIFF_OVERVIEW_WIDTH)}))}))}))}};dc.ONE_OVERVIEW_WIDTH=15;dc.ENTIRE_DIFF_OVERVIEW_WIDTH=zr.ONE_OVERVIEW_WIDTH*2;dc=zr=AIe([IIe(7,ro)],dc);E("diffEditor.move.border",{dark:"#8b8b8b9c",light:"#8b8b8b9c",hcDark:"#8b8b8b9c",hcLight:"#8b8b8b9c"},m("diffEditor.move.border","The border color for text that got moved in the diff editor."));E("diffEditor.moveActive.border",{dark:"#FFA500",light:"#FFA500",hcDark:"#FFA500",hcLight:"#FFA500"},m("diffEditor.moveActive.border","The active border color for text that got moved in the diff editor."));class UD extends Y{constructor(){super(...arguments),this._id=++UD.idCounter,this._onDidDispose=this._register(new B),this.onDidDispose=this._onDidDispose.event}getId(){return this.getEditorType()+":v2:"+this._id}getVisibleColumnFromPosition(e){return this._targetEditor.getVisibleColumnFromPosition(e)}getPosition(){return this._targetEditor.getPosition()}setPosition(e,t="api"){this._targetEditor.setPosition(e,t)}revealLine(e,t=0){this._targetEditor.revealLine(e,t)}revealLineInCenter(e,t=0){this._targetEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=0){this._targetEditor.revealLineNearTop(e,t)}revealPosition(e,t=0){this._targetEditor.revealPosition(e,t)}revealPositionInCenter(e,t=0){this._targetEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=0){this._targetEditor.revealPositionNearTop(e,t)}getSelection(){return this._targetEditor.getSelection()}getSelections(){return this._targetEditor.getSelections()}setSelection(e,t="api"){this._targetEditor.setSelection(e,t)}setSelections(e,t="api"){this._targetEditor.setSelections(e,t)}revealLines(e,t,i=0){this._targetEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=0){this._targetEditor.revealLinesInCenter(e,t,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=0){this._targetEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=0,i=!1,s=!0){this._targetEditor.revealRange(e,t,i,s)}revealRangeInCenter(e,t=0){this._targetEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=0){this._targetEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._targetEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=0){this._targetEditor.revealRangeAtTop(e,t)}getSupportedActions(){return this._targetEditor.getSupportedActions()}focus(){this._targetEditor.focus()}trigger(e,t,i){this._targetEditor.trigger(e,t,i)}createDecorationsCollection(e){return this._targetEditor.createDecorationsCollection(e)}changeDecorations(e){return this._targetEditor.changeDecorations(e)}}UD.idCounter=0;var TIe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Q8=function(n,e){return function(t,i){e(t,i,n)}};let fR=class extends Y{constructor(e,t,i,s,o,r,a){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=i,this._createInnerEditor=o,this._instantiationService=r,this._keybindingService=a,this._onDidContentSizeChange=this._register(new B),this.original=this._register(this._createLeftHandSideEditor(i.editorOptions.get(),s.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(i.editorOptions.get(),s.modifiedEditor||{})),this.modifiedModel=As(this.modified.onDidChangeModel,()=>this.modified.getModel()),this._register(zD({createEmptyChangeSummary:()=>({}),handleChange:(l,c)=>(l.didChange(i.editorOptions)&&Object.assign(c,l.change.changedOptions),!0)},(l,c)=>{i.editorOptions.read(l),this._options.renderSideBySide.read(l),this.modified.updateOptions(this._adjustOptionsForRightHandSide(l,c)),this.original.updateOptions(this._adjustOptionsForLeftHandSide(l,c))}))}_createLeftHandSideEditor(e,t){const i=this._adjustOptionsForLeftHandSide(void 0,e),s=this._constructInnerEditor(this._instantiationService,this.originalEditorElement,i,t);return s.setContextValue("isInDiffLeftEditor",!0),s}_createRightHandSideEditor(e,t){const i=this._adjustOptionsForRightHandSide(void 0,e),s=this._constructInnerEditor(this._instantiationService,this.modifiedEditorElement,i,t);return s.setContextValue("isInDiffRightEditor",!0),s}_constructInnerEditor(e,t,i,s){const o=this._createInnerEditor(e,t,i,s);return this._register(o.onDidContentSizeChange(r=>{const a=this.original.getContentWidth()+this.modified.getContentWidth()+dc.ENTIRE_DIFF_OVERVIEW_WIDTH,l=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:l,contentWidth:a,contentHeightChanged:r.contentHeightChanged,contentWidthChanged:r.contentWidthChanged})})),o}_adjustOptionsForLeftHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return this._options.renderSideBySide.get()?(i.unicodeHighlight=this._options.editorOptions.get().unicodeHighlight||{},i.wordWrapOverride1=this._options.diffWordWrap.get()):(i.wordWrapOverride1="off",i.wordWrapOverride2="off",i.stickyScroll={enabled:!1},i.unicodeHighlight={nonBasicASCII:!1,ambiguousCharacters:!1,invisibleCharacters:!1}),t.originalAriaLabel&&(i.ariaLabel=t.originalAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.readOnly=!this._options.originalEditable.get(),i.dropIntoEditor={enabled:!i.readOnly},i.extraEditorClassName="original-in-monaco-diff-editor",i}_adjustOptionsForRightHandSide(e,t){const i=this._adjustOptionsForSubEditor(t);return t.modifiedAriaLabel&&(i.ariaLabel=t.modifiedAriaLabel),i.ariaLabel=this._updateAriaLabel(i.ariaLabel),i.wordWrapOverride1=this._options.diffWordWrap.get(),i.revealHorizontalRightPadding=Vf.revealHorizontalRightPadding.defaultValue+dc.ENTIRE_DIFF_OVERVIEW_WIDTH,i.scrollbar.verticalHasArrows=!1,i.extraEditorClassName="modified-in-monaco-diff-editor",i}_adjustOptionsForSubEditor(e){const t=Object.assign(Object.assign({},e),{dimension:{height:0,width:0}});return t.inDiffEditor=!0,t.automaticLayout=!1,t.scrollbar=Object.assign({},t.scrollbar||{}),t.scrollbar.vertical="visible",t.folding=!1,t.codeLens=this._options.diffCodeLens.get(),t.fixedOverflowWidgets=!0,t.minimap=Object.assign({},t.minimap||{}),t.minimap.enabled=!1,this._options.hideUnchangedRegions.get()?t.stickyScroll={enabled:!1}:t.stickyScroll=this._options.editorOptions.get().stickyScroll,t}_updateAriaLabel(e){var t;e||(e="");const i=m("diff-aria-navigation-tip"," use {0} to open the accessibility help.",(t=this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp"))===null||t===void 0?void 0:t.getAriaLabel());return this._options.accessibilityVerbose.get()?e+i:e?e.replaceAll(i,""):""}};fR=TIe([Q8(5,vt),Q8(6,bi)],fR);class NIe{get editorOptions(){return this._options}constructor(e,t){this.diffEditorWidth=t,this.couldShowInlineViewBecauseOfSize=_t(this,s=>this._options.read(s).renderSideBySide&&this.diffEditorWidth.read(s)<=this._options.read(s).renderSideBySideInlineBreakpoint),this.renderOverviewRuler=_t(this,s=>this._options.read(s).renderOverviewRuler),this.renderSideBySide=_t(this,s=>this._options.read(s).renderSideBySide&&!(this._options.read(s).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(s))),this.readOnly=_t(this,s=>this._options.read(s).readOnly),this.shouldRenderRevertArrows=_t(this,s=>!(!this._options.read(s).renderMarginRevertIcon||!this.renderSideBySide.read(s)||this.readOnly.read(s))),this.renderIndicators=_t(this,s=>this._options.read(s).renderIndicators),this.enableSplitViewResizing=_t(this,s=>this._options.read(s).enableSplitViewResizing),this.splitViewDefaultRatio=_t(this,s=>this._options.read(s).splitViewDefaultRatio),this.ignoreTrimWhitespace=_t(this,s=>this._options.read(s).ignoreTrimWhitespace),this.maxComputationTimeMs=_t(this,s=>this._options.read(s).maxComputationTime),this.showMoves=_t(this,s=>this._options.read(s).experimental.showMoves&&this.renderSideBySide.read(s)),this.isInEmbeddedEditor=_t(this,s=>this._options.read(s).isInEmbeddedEditor),this.diffWordWrap=_t(this,s=>this._options.read(s).diffWordWrap),this.originalEditable=_t(this,s=>this._options.read(s).originalEditable),this.diffCodeLens=_t(this,s=>this._options.read(s).diffCodeLens),this.accessibilityVerbose=_t(this,s=>this._options.read(s).accessibilityVerbose),this.diffAlgorithm=_t(this,s=>this._options.read(s).diffAlgorithm),this.showEmptyDecorations=_t(this,s=>this._options.read(s).experimental.showEmptyDecorations),this.onlyShowAccessibleDiffViewer=_t(this,s=>this._options.read(s).onlyShowAccessibleDiffViewer),this.hideUnchangedRegions=_t(this,s=>this._options.read(s).hideUnchangedRegions.enabled),this.hideUnchangedRegionsRevealLineCount=_t(this,s=>this._options.read(s).hideUnchangedRegions.revealLineCount),this.hideUnchangedRegionsContextLineCount=_t(this,s=>this._options.read(s).hideUnchangedRegions.contextLineCount),this.hideUnchangedRegionsMinimumLineCount=_t(this,s=>this._options.read(s).hideUnchangedRegions.minimumLineCount);const i=Object.assign(Object.assign({},e),J8(e,$n));this._options=ai(this,i)}updateOptions(e){const t=J8(e,this._options.get()),i=Object.assign(Object.assign(Object.assign({},this._options.get()),e),t);this._options.set(i,void 0,{changedOptions:e})}}function J8(n,e){var t,i,s,o,r,a,l,c;return{enableSplitViewResizing:ve(n.enableSplitViewResizing,e.enableSplitViewResizing),splitViewDefaultRatio:Dfe(n.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:ve(n.renderSideBySide,e.renderSideBySide),renderMarginRevertIcon:ve(n.renderMarginRevertIcon,e.renderMarginRevertIcon),maxComputationTime:th(n.maxComputationTime,e.maxComputationTime,0,1073741824),maxFileSize:th(n.maxFileSize,e.maxFileSize,0,1073741824),ignoreTrimWhitespace:ve(n.ignoreTrimWhitespace,e.ignoreTrimWhitespace),renderIndicators:ve(n.renderIndicators,e.renderIndicators),originalEditable:ve(n.originalEditable,e.originalEditable),diffCodeLens:ve(n.diffCodeLens,e.diffCodeLens),renderOverviewRuler:ve(n.renderOverviewRuler,e.renderOverviewRuler),diffWordWrap:xi(n.diffWordWrap,e.diffWordWrap,["off","on","inherit"]),diffAlgorithm:xi(n.diffAlgorithm,e.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:ve(n.accessibilityVerbose,e.accessibilityVerbose),experimental:{showMoves:ve((t=n.experimental)===null||t===void 0?void 0:t.showMoves,e.experimental.showMoves),showEmptyDecorations:ve((i=n.experimental)===null||i===void 0?void 0:i.showEmptyDecorations,e.experimental.showEmptyDecorations)},hideUnchangedRegions:{enabled:ve((o=(s=n.hideUnchangedRegions)===null||s===void 0?void 0:s.enabled)!==null&&o!==void 0?o:(r=n.experimental)===null||r===void 0?void 0:r.collapseUnchangedRegions,e.hideUnchangedRegions.enabled),contextLineCount:th((a=n.hideUnchangedRegions)===null||a===void 0?void 0:a.contextLineCount,e.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:th((l=n.hideUnchangedRegions)===null||l===void 0?void 0:l.minimumLineCount,e.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:th((c=n.hideUnchangedRegions)===null||c===void 0?void 0:c.revealLineCount,e.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:ve(n.isInEmbeddedEditor,e.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:ve(n.onlyShowAccessibleDiffViewer,e.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:th(n.renderSideBySideInlineBreakpoint,e.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:ve(n.useInlineViewWhenSpaceIsLimited,e.useInlineViewWhenSpaceIsLimited)}}var RIe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},$0=function(n,e){return function(t,i){e(t,i,n)}};let gR=class extends UD{constructor(e,t,i,s,o,r,a,l){var c;super(),this._domElement=e,this._parentContextKeyService=s,this._parentInstantiationService=o,this._audioCueService=a,this._editorProgressService=l,this.elements=dn("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[dn("div.noModificationsOverlay@overlay",{style:{position:"absolute",height:"100%",visibility:"hidden"}},[ye("span",{},"No Changes")]),dn("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),dn("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),dn("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModel=this._register(OAe("diffModel",void 0)),this.onDidChangeModel=ue.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._parentInstantiationService.createChild(new vD([et,this._contextKeyService])),this._boundarySashes=ai(this,void 0),this._accessibleDiffViewerShouldBeVisible=ai(this,!1),this._accessibleDiffViewerVisible=_t(this,p=>this._options.onlyShowAccessibleDiffViewer.read(p)?!0:this._accessibleDiffViewerShouldBeVisible.read(p)),this.movedBlocksLinesPart=ai(this,void 0),this._layoutInfo=_t(this,p=>{var _,v,b;const y=this._rootSizeObserver.width.read(p),w=this._rootSizeObserver.height.read(p),S=(_=this._sash.read(p))===null||_===void 0?void 0:_.sashLeft.read(p),L=S??Math.max(5,this._editors.original.getLayoutInfo().decorationsLeft),x=y-L-(this._options.renderOverviewRuler.read(p)?dc.ENTIRE_DIFF_OVERVIEW_WIDTH:0),D=(b=(v=this.movedBlocksLinesPart.read(p))===null||v===void 0?void 0:v.width.read(p))!==null&&b!==void 0?b:0,k=L-D;return this.elements.original.style.width=k+"px",this.elements.original.style.left="0px",this.elements.modified.style.width=x+"px",this.elements.modified.style.left=L+"px",this._editors.original.layout({width:k,height:w}),this._editors.modified.layout({width:x,height:w}),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}}),this._diffValue=this._diffModel.map((p,_)=>p==null?void 0:p.diff.read(_)),this.onDidUpdateDiff=ue.fromObservableLight(this._diffValue),r.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(Ye(()=>this._domElement.removeChild(this.elements.root))),this._rootSizeObserver=this._register(new GAe(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout((c=t.automaticLayout)!==null&&c!==void 0?c:!1),this._options=new NIe(t,this._rootSizeObserver.width),this._contextKeyService.createKey($.isEmbeddedDiffEditor.key,!1);const d=$.isEmbeddedDiffEditor.bindTo(this._contextKeyService);this._register(di(p=>{d.set(this._options.isInEmbeddedEditor.read(p))}));const u=$.comparingMovedCode.bindTo(this._contextKeyService);this._register(di(p=>{var _;u.set(!!(!((_=this._diffModel.read(p))===null||_===void 0)&&_.movedTextToCompare.read(p)))}));const h=$.diffEditorRenderSideBySideInlineBreakpointReached.bindTo(this._contextKeyService);this._register(di(p=>{h.set(this._options.couldShowInlineViewBecauseOfSize.read(p))})),this._editors=this._register(this._instantiationService.createInstance(fR,this.elements.original,this.elements.modified,this._options,i,(p,_,v,b)=>this._createInnerEditor(p,_,v,b))),this._sash=Mv(this,(p,_)=>{const v=this._options.renderSideBySide.read(p);if(this.elements.root.classList.toggle("side-by-side",v),!v)return;const b=_.add(new gIe(this._options,this.elements.root,{height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map((y,w)=>y-(this._options.renderOverviewRuler.read(w)?dc.ENTIRE_DIFF_OVERVIEW_WIDTH:0))}));return _.add(di(y=>{const w=this._boundarySashes.read(y);w&&b.setBoundarySashes(w)})),b}),this._register(Dx(this._sash)),this._register($s((p,_)=>{this.unchangedRangesFeature=_.add(this._instantiationService.createInstance(Kc(lR,p),this._editors,this._diffModel,this._options))})),this._register($s((p,_)=>{_.add(new(Kc(fIe,p))(this._editors,this._diffModel,this._options))})),this._register($s((p,_)=>{_.add(this._instantiationService.createInstance(Kc(hR,p),this._editors,this._diffModel,this._options,this,()=>this.unchangedRangesFeature.isUpdatingViewZones))})),this._register($s((p,_)=>{_.add(this._instantiationService.createInstance(Kc(dc,p),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map(v=>v.modifiedEditor),this._options))})),this._register($s((p,_)=>{this._accessibleDiffViewer=_.add(this._register(this._instantiationService.createInstance(Kc(wd,p),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,(v,b)=>this._accessibleDiffViewerShouldBeVisible.set(v,b),this._options.onlyShowAccessibleDiffViewer.map(v=>!v),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map((v,b)=>{var y;return(y=v==null?void 0:v.diff.read(b))===null||y===void 0?void 0:y.mappings.map(w=>w.lineRangeMapping)}),this._editors)))}));const f=this._accessibleDiffViewerVisible.map(p=>p?"hidden":"visible");this._register(Fd(this.elements.modified,{visibility:f})),this._register(Fd(this.elements.original,{visibility:f})),this._createDiffEditorContributions(),r.addDiffEditor(this),this._register(Dx(this._layoutInfo)),this._register($s((p,_)=>{this.movedBlocksLinesPart.set(_.add(new(Kc(Bd,p))(this.elements.root,this._diffModel,this._layoutInfo.map(v=>v.originalEditor),this._layoutInfo.map(v=>v.modifiedEditor),this._editors)),void 0)})),this._register(Fd(this.elements.overlay,{width:this._layoutInfo.map((p,_)=>p.originalEditor.width+(this._options.renderSideBySide.read(_)?0:p.modifiedEditor.width)),visibility:_t(p=>{var _,v;return this._options.hideUnchangedRegions.read(p)&&((v=(_=this._diffModel.read(p))===null||_===void 0?void 0:_.diff.read(p))===null||v===void 0?void 0:v.mappings.length)===0?"visible":"hidden"})})),this._register(this._editors.modified.onMouseDown(p=>{var _,v;if(!p.event.rightButton&&p.target.position&&(!((_=p.target.element)===null||_===void 0)&&_.className.includes("arrow-revert-change"))){const b=p.target.position.lineNumber,y=p.target,w=this._diffModel.get();if(!w)return;const S=(v=w.diff.get())===null||v===void 0?void 0:v.mappings;if(!S)return;const L=S.find(x=>(y==null?void 0:y.detail.afterLineNumber)===x.lineRangeMapping.modified.startLineNumber-1||x.lineRangeMapping.modified.startLineNumber===b);if(!L)return;this.revert(L.lineRangeMapping),p.event.stopPropagation()}})),this._register(ue.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,p=>{var _,v;if((p==null?void 0:p.reason)===3){const b=(v=(_=this._diffModel.get())===null||_===void 0?void 0:_.diff.get())===null||v===void 0?void 0:v.mappings.find(y=>y.lineRangeMapping.modified.contains(p.position.lineNumber));b!=null&&b.lineRangeMapping.modified.isEmpty?this._audioCueService.playAudioCue(ct.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):b!=null&&b.lineRangeMapping.original.isEmpty?this._audioCueService.playAudioCue(ct.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):b&&this._audioCueService.playAudioCue(ct.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}}));const g=this._diffModel.map((p,_)=>p==null?void 0:p.isDiffUpToDate.read(_));this._register($s((p,_)=>{if(g.read(p)===!1){const v=this._editorProgressService.show(!0,1e3);_.add(Ye(()=>v.done()))}}))}_createInnerEditor(e,t,i,s){return e.createInstance(Mm,t,i,s)}_createDiffEditorContributions(){const e=mp.getDiffEditorContributions();for(const t of e)try{this._register(this._instantiationService.createInstance(t.ctor,this))}catch(i){mt(i)}}get _targetEditor(){return this._editors.modified}getEditorType(){return rD.IDiffEditor}layout(e){this._rootSizeObserver.observe(e)}hasTextFocus(){return this._editors.original.hasTextFocus()||this._editors.modified.hasTextFocus()}saveViewState(){var e;const t=this._editors.original.saveViewState(),i=this._editors.modified.saveViewState();return{original:t,modified:i,modelState:(e=this._diffModel.get())===null||e===void 0?void 0:e.serializeState()}}restoreViewState(e){var t;if(e&&e.original&&e.modified){const i=e;this._editors.original.restoreViewState(i.original),this._editors.modified.restoreViewState(i.modified),i.modelState&&((t=this._diffModel.get())===null||t===void 0||t.restoreSerializedState(i.modelState))}}createViewModel(e){return this._instantiationService.createInstance(uR,e,this._options,this)}getModel(){var e,t;return(t=(e=this._diffModel.get())===null||e===void 0?void 0:e.model)!==null&&t!==void 0?t:null}setModel(e){!e&&this._diffModel.get()&&this._accessibleDiffViewer.close();const t=e?"model"in e?e:this.createViewModel(e):void 0;this._editors.original.setModel(t?t.model.original:null),this._editors.modified.setModel(t?t.model.modified:null),Mn(i=>{this._diffModel.set(t,i)})}updateOptions(e){this._options.updateOptions(e)}getContainerDomNode(){return this._domElement}getOriginalEditor(){return this._editors.original}getModifiedEditor(){return this._editors.modified}getLineChanges(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.diff.get();return t?OIe(t):null}revert(e){var t;const i=(t=this._diffModel.get())===null||t===void 0?void 0:t.model;if(!i)return;const s=e.innerChanges?e.innerChanges.map(o=>({range:o.modifiedRange,text:i.original.getValueInRange(o.originalRange)})):[{range:e.modified.toExclusiveRange(),text:i.original.getValueInRange(e.original.toExclusiveRange())}];this._editors.modified.executeEdits("diffEditor",s)}accessibleDiffViewerNext(){this._accessibleDiffViewer.next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.prev()}mapToOtherSide(){var e,t;const i=this._editors.modified.hasWidgetFocus(),s=i?this._editors.modified:this._editors.original,o=i?this._editors.original:this._editors.modified;let r;const a=s.getSelection();if(a){const l=(t=(e=this._diffModel.get())===null||e===void 0?void 0:e.diff.get())===null||t===void 0?void 0:t.mappings.map(c=>i?c.lineRangeMapping.flip():c.lineRangeMapping);if(l){const c=eB(a.getStartPosition(),l),d=eB(a.getEndPosition(),l);r=N.plusRange(c,d)}}return{destination:o,destinationSelection:r}}switchSide(){const{destination:e,destinationSelection:t}=this.mapToOtherSide();e.focus(),t&&e.setSelection(t)}exitCompareMove(){const e=this._diffModel.get();e&&e.movedTextToCompare.set(void 0,void 0)}collapseAllUnchangedRegions(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.unchangedRegions.get();t&&Mn(i=>{for(const s of t)s.collapseAll(i)})}showAllUnchangedRegions(){var e;const t=(e=this._diffModel.get())===null||e===void 0?void 0:e.unchangedRegions.get();t&&Mn(i=>{for(const s of t)s.showAll(i)})}};gR=RIe([$0(3,et),$0(4,vt),$0(5,jt),$0(6,WD),$0(7,oy)],gR);function eB(n,e){const t=gT(e,s=>s.original.startLineNumber<=n.lineNumber);if(!t)return N.fromPositions(n);if(t.original.endLineNumberExclusive<=n.lineNumber){const s=n.lineNumber-t.original.endLineNumberExclusive+t.modified.endLineNumberExclusive;return N.fromPositions(new V(s,n.column))}if(!t.innerChanges)return N.fromPositions(new V(t.modified.startLineNumber,1));const i=gT(t.innerChanges,s=>s.originalRange.getStartPosition().isBeforeOrEqual(n));if(!i){const s=n.lineNumber-t.original.startLineNumber+t.modified.startLineNumber;return N.fromPositions(new V(s,n.column))}if(i.originalRange.containsPosition(n))return i.modifiedRange;{const s=MIe(i.originalRange.getEndPosition(),n);return N.fromPositions(PIe(i.modifiedRange.getEndPosition(),s))}}function MIe(n,e){return n.lineNumber===e.lineNumber?new gv(0,e.column-n.column):new gv(e.lineNumber-n.lineNumber,e.column-1)}function PIe(n,e){return e.lineCount===0?new V(n.lineNumber,n.column+e.columnCount):new V(n.lineNumber+e.lineCount,e.columnCount+1)}function OIe(n){return n.mappings.map(e=>{const t=e.lineRangeMapping;let i,s,o,r,a=t.innerChanges;return t.original.isEmpty?(i=t.original.startLineNumber-1,s=0,a=void 0):(i=t.original.startLineNumber,s=t.original.endLineNumberExclusive-1),t.modified.isEmpty?(o=t.modified.startLineNumber-1,r=0,a=void 0):(o=t.modified.startLineNumber,r=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:i,originalEndLineNumber:s,modifiedStartLineNumber:o,modifiedEndLineNumber:r,charChanges:a==null?void 0:a.map(l=>({originalStartLineNumber:l.originalRange.startLineNumber,originalStartColumn:l.originalRange.startColumn,originalEndLineNumber:l.originalRange.endLineNumber,originalEndColumn:l.originalRange.endColumn,modifiedStartLineNumber:l.modifiedRange.startLineNumber,modifiedStartColumn:l.modifiedRange.startColumn,modifiedEndLineNumber:l.modifiedRange.endLineNumber,modifiedEndColumn:l.modifiedRange.endColumn}))}})}var NP=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},$t=function(n,e){return function(t,i){e(t,i,n)}};let FIe=0,tB=!1;function BIe(n){if(!n){if(tB)return;tB=!0}Mbe(n||document.body)}let Nx=class extends Mm{constructor(e,t,i,s,o,r,a,l,c,d,u,h){const f=Object.assign({},t);f.ariaLabel=f.ariaLabel||rx.editorViewAccessibleLabel,f.ariaLabel=f.ariaLabel+";"+rx.accessibilityHelpMessage,super(e,f,{},i,s,o,r,l,c,d,u,h),a instanceof zm?this._standaloneKeybindingService=a:this._standaloneKeybindingService=null,BIe(f.ariaContainerElement)}addCommand(e,t,i){if(!this._standaloneKeybindingService)return console.warn("Cannot add command because the editor is configured with an unrecognized KeybindingService"),null;const s="DYNAMIC_"+ ++FIe,o=Le.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(s,e,t,o),s}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if(typeof e.id!="string"||typeof e.label!="string"||typeof e.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");if(!this._standaloneKeybindingService)return console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),Y.None;const t=e.id,i=e.label,s=Le.and(Le.equals("editorId",this.getId()),Le.deserialize(e.precondition)),o=e.keybindings,r=Le.and(s,Le.deserialize(e.keybindingContext)),a=e.contextMenuGroupId||null,l=e.contextMenuOrder||0,c=(f,...g)=>Promise.resolve(e.run(this,...g)),d=new pe,u=this.getId()+":"+t;if(d.add(Yt.registerCommand(u,c)),a){const f={command:{id:u,title:i},when:s,group:a,order:l};d.add(cr.appendMenuItem(I.EditorContext,f))}if(Array.isArray(o))for(const f of o)d.add(this._standaloneKeybindingService.addDynamicKeybinding(u,f,c,r));const h=new Eq(u,i,i,s,(...f)=>Promise.resolve(e.run(this,...f)),this._contextKeyService);return this._actions.set(t,h),d.add(Ye(()=>{this._actions.delete(t)})),d}_triggerCommand(e,t){if(this._codeEditorService instanceof tx)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};Nx=NP([$t(2,vt),$t(3,jt),$t(4,fs),$t(5,et),$t(6,bi),$t(7,ro),$t(8,xn),$t(9,Au),$t(10,so),$t(11,it)],Nx);let pR=class extends Nx{constructor(e,t,i,s,o,r,a,l,c,d,u,h,f,g,p){const _=Object.assign({},t);Lx(d,_,!1);const v=l.registerEditorContainer(e);typeof _.theme=="string"&&l.setTheme(_.theme),typeof _.autoDetectHighContrast<"u"&&l.setAutoDetectHighContrast(!!_.autoDetectHighContrast);const b=_.model;delete _.model,super(e,_,i,s,o,r,a,l,c,u,g,p),this._configurationService=d,this._standaloneThemeService=l,this._register(v);let y;if(typeof b>"u"){const w=f.getLanguageIdByMimeType(_.language)||_.language||Ho;y=RK(h,f,_.value||"",w,void 0),this._ownsModel=!0}else y=b,this._ownsModel=!1;if(this._attachModel(y),y){const w={oldModelUrl:null,newModelUrl:y.uri};this._onDidChangeModel.fire(w)}}dispose(){super.dispose()}updateOptions(e){Lx(this._configurationService,e,!1),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};pR=NP([$t(2,vt),$t(3,jt),$t(4,fs),$t(5,et),$t(6,bi),$t(7,Nr),$t(8,xn),$t(9,ii),$t(10,Au),$t(11,hs),$t(12,Ni),$t(13,so),$t(14,it)],pR);let mR=class extends gR{constructor(e,t,i,s,o,r,a,l,c,d,u,h){const f=Object.assign({},t);Lx(l,f,!0);const g=r.registerEditorContainer(e);typeof f.theme=="string"&&r.setTheme(f.theme),typeof f.autoDetectHighContrast<"u"&&r.setAutoDetectHighContrast(!!f.autoDetectHighContrast),super(e,f,{},s,i,o,h,d),this._configurationService=l,this._standaloneThemeService=r,this._register(g)}dispose(){super.dispose()}updateOptions(e){Lx(this._configurationService,e,!0),typeof e.theme=="string"&&this._standaloneThemeService.setTheme(e.theme),typeof e.autoDetectHighContrast<"u"&&this._standaloneThemeService.setAutoDetectHighContrast(!!e.autoDetectHighContrast),super.updateOptions(e)}_createInnerEditor(e,t,i){return e.createInstance(Nx,t,i)}getOriginalEditor(){return super.getOriginalEditor()}getModifiedEditor(){return super.getModifiedEditor()}addCommand(e,t,i){return this.getModifiedEditor().addCommand(e,t,i)}createContextKey(e,t){return this.getModifiedEditor().createContextKey(e,t)}addAction(e){return this.getModifiedEditor().addAction(e)}};mR=NP([$t(2,vt),$t(3,et),$t(4,jt),$t(5,Nr),$t(6,xn),$t(7,ii),$t(8,Nu),$t(9,oy),$t(10,gy),$t(11,WD)],mR);function RK(n,e,t,i,s){if(t=t||"",!i){const o=t.indexOf(` +`);let r=t;return o!==-1&&(r=t.substring(0,o)),iB(n,t,e.createByFilepathOrFirstLine(s||null,r),s)}return iB(n,t,e.createById(i),s)}function iB(n,e,t,i){return n.createModel(e,t,i)}var MK=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function WIe(n,e,t){return Ae.initialize(t||{}).createInstance(pR,n,e)}function VIe(n){return Ae.get(jt).onCodeEditorAdd(t=>{n(t)})}function zIe(n){return Ae.get(jt).onDiffEditorAdd(t=>{n(t)})}function HIe(){return Ae.get(jt).listCodeEditors()}function $Ie(){return Ae.get(jt).listDiffEditors()}function UIe(n,e,t){return Ae.initialize(t||{}).createInstance(mR,n,e)}function jIe(n){if(typeof n.id!="string"||typeof n.run!="function")throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return Yt.registerCommand(n.id,n.run)}function qIe(n){if(typeof n.id!="string"||typeof n.label!="string"||typeof n.run!="function")throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const e=Le.deserialize(n.precondition),t=(s,...o)=>kr.runEditorCommand(s,o,e,(r,a,l)=>Promise.resolve(n.run(a,...l))),i=new pe;if(i.add(Yt.registerCommand(n.id,t)),n.contextMenuGroupId){const s={command:{id:n.id,title:n.label},when:e,group:n.contextMenuGroupId,order:n.contextMenuOrder||0};i.add(cr.appendMenuItem(I.EditorContext,s))}if(Array.isArray(n.keybindings)){const s=Ae.get(bi);if(!(s instanceof zm))console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService");else{const o=Le.and(e,Le.deserialize(n.keybindingContext));i.add(s.addDynamicKeybindings(n.keybindings.map(r=>({keybinding:r,command:n.id,when:o}))))}}return i}function GIe(n){return PK([n])}function PK(n){const e=Ae.get(bi);return e instanceof zm?e.addDynamicKeybindings(n.map(t=>({keybinding:t.keybinding,command:t.command,commandArgs:t.commandArgs,when:Le.deserialize(t.when)}))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),Y.None)}function KIe(n,e,t){const i=Ae.get(Ni),s=i.getLanguageIdByMimeType(e)||e;return RK(Ae.get(hs),i,n,s,t)}function YIe(n,e){const t=Ae.get(Ni),i=t.getLanguageIdByMimeType(e)||e||Ho;n.setLanguage(t.createById(i))}function ZIe(n,e,t){n&&Ae.get(ml).changeOne(e,n.uri,t)}function XIe(n){Ae.get(ml).changeAll(n,[])}function QIe(n){return Ae.get(ml).read(n)}function JIe(n){return Ae.get(ml).onMarkerChanged(n)}function eTe(n){return Ae.get(hs).getModel(n)}function tTe(){return Ae.get(hs).getModels()}function iTe(n){return Ae.get(hs).onModelAdded(n)}function nTe(n){return Ae.get(hs).onModelRemoved(n)}function sTe(n){return Ae.get(hs).onModelLanguageChanged(t=>{n({model:t.model,oldLanguage:t.oldLanguageId})})}function oTe(n){return abe(Ae.get(hs),Ae.get(so),n)}function rTe(n,e){const t=Ae.get(Ni),i=Ae.get(Nr);return c3.colorizeElement(i,t,n,e).then(()=>{i.registerEditorContainer(n)})}function aTe(n,e,t){const i=Ae.get(Ni);return Ae.get(Nr).registerEditorContainer(document.body),c3.colorize(i,n,e,t)}function lTe(n,e,t=4){return Ae.get(Nr).registerEditorContainer(document.body),c3.colorizeModelLine(n,e,t)}function cTe(n){const e=Si.get(n);return e||{getInitialState:()=>Jb,tokenize:(t,i,s)=>Oj(n,s)}}function dTe(n,e){Si.getOrCreate(e);const t=cTe(e),i=$f(n),s=[];let o=t.getInitialState();for(let r=0,a=i.length;rMK(this,void 0,void 0,function*(){var o;if(!i)return null;const r=(o=t.options)===null||o===void 0?void 0:o.selection;let a;return r&&typeof r.endLineNumber=="number"&&typeof r.endColumn=="number"?a=r:r&&(a={lineNumber:r.startLineNumber,column:r.startColumn}),(yield n.openCodeEditor(i,t.resource,a))?i:null}))}function _Te(){return{create:WIe,getEditors:HIe,getDiffEditors:$Ie,onDidCreateEditor:VIe,onDidCreateDiffEditor:zIe,createDiffEditor:UIe,addCommand:jIe,addEditorAction:qIe,addKeybindingRule:GIe,addKeybindingRules:PK,createModel:KIe,setModelLanguage:YIe,setModelMarkers:ZIe,getModelMarkers:QIe,removeAllMarkers:XIe,onDidChangeMarkers:JIe,getModels:tTe,getModel:eTe,onDidCreateModel:iTe,onWillDisposeModel:nTe,onDidChangeModelLanguage:sTe,createWebWorker:oTe,colorizeElement:rTe,colorize:aTe,colorizeModelLine:lTe,tokenize:dTe,defineTheme:uTe,setTheme:hTe,remeasureFonts:fTe,registerCommand:gTe,registerLinkOpener:pTe,registerEditorOpener:mTe,AccessibilitySupport:uI,ContentWidgetPositionPreference:_I,CursorChangeReason:bI,DefaultEndOfLine:vI,EditorAutoIndentStrategy:wI,EditorOption:CI,EndOfLinePreference:SI,EndOfLineSequence:xI,MinimapPosition:RI,MouseTargetType:MI,OverlayWidgetPositionPreference:PI,OverviewRulerLane:OI,GlyphMarginLane:LI,RenderLineNumbersType:BI,RenderMinimap:WI,ScrollbarVisibility:zI,ScrollType:VI,TextEditorCursorBlinkingStyle:qI,TextEditorCursorStyle:GI,TrackedRangeStickiness:KI,WrappingIndent:YI,InjectedTextCursorStops:kI,PositionAffinity:FI,ConfigurationChangedEvent:uU,BareFontInfo:Zh,FontInfo:QI,TextModelResolvedOptions:dC,FindMatch:Kb,ApplyUpdateResult:P_,EditorZoom:Xc,EditorType:rD,EditorOptions:Vf}}function bTe(n,e){if(!e||!Array.isArray(e))return!1;for(const t of e)if(!n(t))return!1;return!0}function Lw(n,e){return typeof n=="boolean"?n:e}function nB(n,e){return typeof n=="string"?n:e}function vTe(n){const e={};for(const t of n)e[t]=!0;return e}function sB(n,e=!1){e&&(n=n.map(function(i){return i.toLowerCase()}));const t=vTe(n);return e?function(i){return t[i.toLowerCase()]!==void 0&&t.hasOwnProperty(i.toLowerCase())}:function(i){return t[i]!==void 0&&t.hasOwnProperty(i)}}function _R(n,e){e=e.replace(/@@/g,"");let t=0,i;do i=!1,e=e.replace(/@(\w+)/g,function(o,r){i=!0;let a="";if(typeof n[r]=="string")a=n[r];else if(n[r]&&n[r]instanceof RegExp)a=n[r].source;else throw n[r]===void 0?Vt(n,"language definition does not contain attribute '"+r+"', used at: "+e):Vt(n,"attribute reference '"+r+"' must be a string, used at: "+e);return Ig(a)?"":"(?:"+a+")"}),t++;while(i&&t<5);e=e.replace(/\x01/g,"@");const s=(n.ignoreCase?"i":"")+(n.unicode?"u":"");return new RegExp(e,s)}function yTe(n,e,t,i){if(i<0)return n;if(i=100){i=i-100;const s=t.split(".");if(s.unshift(t),i=0&&(i.tokenSubst=!0),typeof t.bracket=="string")if(t.bracket==="@open")i.bracket=1;else if(t.bracket==="@close")i.bracket=-1;else throw Vt(n,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw Vt(n,"the next state must be a string value in rule: "+e);{let s=t.next;if(!/^(@pop|@push|@popall)$/.test(s)&&(s[0]==="@"&&(s=s.substr(1)),s.indexOf("$")<0&&!Dbe(n,Qc(n,s,"",[],""))))throw Vt(n,"the next state '"+t.next+"' is not defined in rule: "+e);i.next=s}}return typeof t.goBack=="number"&&(i.goBack=t.goBack),typeof t.switchTo=="string"&&(i.switchTo=t.switchTo),typeof t.log=="string"&&(i.log=t.log),typeof t.nextEmbedded=="string"&&(i.nextEmbedded=t.nextEmbedded,n.usesEmbedded=!0),i}}else if(Array.isArray(t)){const i=[];for(let s=0,o=t.length;s0&&i[0]==="^",this.name=this.name+": "+i,this.regex=_R(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")")}setAction(e,t){this.action=bR(e,this.name,t)}}function OK(n,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");const t={};t.languageId=n,t.includeLF=Lw(e.includeLF,!1),t.noThrow=!1,t.maxStack=100,t.start=typeof e.start=="string"?e.start:null,t.ignoreCase=Lw(e.ignoreCase,!1),t.unicode=Lw(e.unicode,!1),t.tokenPostfix=nB(e.tokenPostfix,"."+t.languageId),t.defaultToken=nB(e.defaultToken,"source"),t.usesEmbedded=!1;const i=e;i.languageId=n,i.includeLF=t.includeLF,i.ignoreCase=t.ignoreCase,i.unicode=t.unicode,i.noThrow=t.noThrow,i.usesEmbedded=t.usesEmbedded,i.stateNames=e.tokenizer,i.defaultToken=t.defaultToken;function s(r,a,l){for(const c of l){let d=c.include;if(d){if(typeof d!="string")throw Vt(t,"an 'include' attribute must be a string at: "+r);if(d[0]==="@"&&(d=d.substr(1)),!e.tokenizer[d])throw Vt(t,"include target '"+d+"' is not defined at: "+r);s(r+"."+d,a,e.tokenizer[d])}else{const u=new CTe(r);if(Array.isArray(c)&&c.length>=1&&c.length<=3)if(u.setRegex(i,c[0]),c.length>=3)if(typeof c[1]=="string")u.setAction(i,{token:c[1],next:c[2]});else if(typeof c[1]=="object"){const h=c[1];h.next=c[2],u.setAction(i,h)}else throw Vt(t,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+r);else u.setAction(i,c[1]);else{if(!c.regex)throw Vt(t,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+r);c.name&&typeof c.name=="string"&&(u.name=c.name),c.matchOnlyAtStart&&(u.matchOnlyAtLineStart=Lw(c.matchOnlyAtLineStart,!1)),u.setRegex(i,c.regex),u.setAction(i,c.action)}a.push(u)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw Vt(t,"a language definition must define the 'tokenizer' attribute as an object");t.tokenizer=[];for(const r in e.tokenizer)if(e.tokenizer.hasOwnProperty(r)){t.start||(t.start=r);const a=e.tokenizer[r];t.tokenizer[r]=new Array,s("tokenizer."+r,t.tokenizer[r],a)}if(t.usesEmbedded=i.usesEmbedded,e.brackets){if(!Array.isArray(e.brackets))throw Vt(t,"the 'brackets' attribute must be defined as an array")}else e.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];const o=[];for(const r of e.brackets){let a=r;if(a&&Array.isArray(a)&&a.length===3&&(a={token:a[2],open:a[0],close:a[1]}),a.open===a.close)throw Vt(t,"open and close brackets in a 'brackets' attribute must be different: "+a.open+` + hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof a.open=="string"&&typeof a.token=="string"&&typeof a.close=="string")o.push({token:a.token+t.tokenPostfix,open:Nd(t,a.open),close:Nd(t,a.close)});else throw Vt(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=o,t.noThrow=!0,t}var STe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function xTe(n){Sm.registerLanguage(n)}function LTe(){let n=[];return n=n.concat(Sm.getLanguages()),n}function DTe(n){return Ae.get(Ni).languageIdCodec.encodeLanguageId(n)}function kTe(n,e){return Ae.withServices(()=>{const i=Ae.get(Ni).onDidRequestRichLanguageFeatures(s=>{s===n&&(i.dispose(),e())});return i})}function ETe(n,e){return Ae.withServices(()=>{const i=Ae.get(Ni).onDidRequestBasicLanguageFeatures(s=>{s===n&&(i.dispose(),e())});return i})}function ATe(n,e){if(!Ae.get(Ni).isRegisteredLanguageId(n))throw new Error(`Cannot set configuration for unknown language ${n}`);return Ae.get(so).register(n,e,100)}class ITe{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if(typeof this._actual.tokenize=="function")return Ov.adaptTokenize(this._languageId,this._actual,e,i);throw new Error("Not supported!")}tokenizeEncoded(e,t,i){const s=this._actual.tokenizeEncoded(e,i);return new FL(s.tokens,s.endState)}}class Ov{constructor(e,t,i,s){this._languageId=e,this._actual=t,this._languageService=i,this._standaloneThemeService=s}dispose(){}getInitialState(){return this._actual.getInitialState()}static _toClassicTokens(e,t){const i=[];let s=0;for(let o=0,r=e.length;o0&&o[r-1]===h)continue;let f=u.startIndex;c===0?f=0:fSTe(this,void 0,void 0,function*(){const i=yield Promise.resolve(e.create());return i?TTe(i)?BK(n,i):new iv(Ae.get(Ni),Ae.get(Nr),n,OK(n,i),Ae.get(ii)):null}));return Si.registerFactory(n,t)}function MTe(n,e){if(!Ae.get(Ni).isRegisteredLanguageId(n))throw new Error(`Cannot set tokens provider for unknown language ${n}`);return FK(e)?RP(n,{create:()=>e}):Si.register(n,BK(n,e))}function PTe(n,e){const t=i=>new iv(Ae.get(Ni),Ae.get(Nr),n,OK(n,i),Ae.get(ii));return FK(e)?RP(n,{create:()=>e}):Si.register(n,t(e))}function OTe(n,e){return Ae.get(it).referenceProvider.register(n,e)}function FTe(n,e){return Ae.get(it).renameProvider.register(n,e)}function BTe(n,e){return Ae.get(it).signatureHelpProvider.register(n,e)}function WTe(n,e){return Ae.get(it).hoverProvider.register(n,{provideHover:(i,s,o)=>{const r=i.getWordAtPosition(s);return Promise.resolve(e.provideHover(i,s,o)).then(a=>{if(a)return!a.range&&r&&(a.range=new N(s.lineNumber,r.startColumn,s.lineNumber,r.endColumn)),a.range||(a.range=new N(s.lineNumber,s.column,s.lineNumber,s.column)),a})}})}function VTe(n,e){return Ae.get(it).documentSymbolProvider.register(n,e)}function zTe(n,e){return Ae.get(it).documentHighlightProvider.register(n,e)}function HTe(n,e){return Ae.get(it).linkedEditingRangeProvider.register(n,e)}function $Te(n,e){return Ae.get(it).definitionProvider.register(n,e)}function UTe(n,e){return Ae.get(it).implementationProvider.register(n,e)}function jTe(n,e){return Ae.get(it).typeDefinitionProvider.register(n,e)}function qTe(n,e){return Ae.get(it).codeLensProvider.register(n,e)}function GTe(n,e,t){return Ae.get(it).codeActionProvider.register(n,{providedCodeActionKinds:t==null?void 0:t.providedCodeActionKinds,documentation:t==null?void 0:t.documentation,provideCodeActions:(s,o,r,a)=>{const c=Ae.get(ml).read({resource:s.uri}).filter(d=>N.areIntersectingOrTouching(d,o));return e.provideCodeActions(s,o,{markers:c,only:r.only,trigger:r.trigger},a)},resolveCodeAction:e.resolveCodeAction})}function KTe(n,e){return Ae.get(it).documentFormattingEditProvider.register(n,e)}function YTe(n,e){return Ae.get(it).documentRangeFormattingEditProvider.register(n,e)}function ZTe(n,e){return Ae.get(it).onTypeFormattingEditProvider.register(n,e)}function XTe(n,e){return Ae.get(it).linkProvider.register(n,e)}function QTe(n,e){return Ae.get(it).completionProvider.register(n,e)}function JTe(n,e){return Ae.get(it).colorProvider.register(n,e)}function eNe(n,e){return Ae.get(it).foldingRangeProvider.register(n,e)}function tNe(n,e){return Ae.get(it).declarationProvider.register(n,e)}function iNe(n,e){return Ae.get(it).selectionRangeProvider.register(n,e)}function nNe(n,e){return Ae.get(it).documentSemanticTokensProvider.register(n,e)}function sNe(n,e){return Ae.get(it).documentRangeSemanticTokensProvider.register(n,e)}function oNe(n,e){return Ae.get(it).inlineCompletionsProvider.register(n,e)}function rNe(n,e){return Ae.get(it).inlayHintsProvider.register(n,e)}function aNe(){return{register:xTe,getLanguages:LTe,onLanguage:kTe,onLanguageEncountered:ETe,getEncodedLanguageId:DTe,setLanguageConfiguration:ATe,setColorMap:RTe,registerTokensProviderFactory:RP,setTokensProvider:MTe,setMonarchTokensProvider:PTe,registerReferenceProvider:OTe,registerRenameProvider:FTe,registerCompletionItemProvider:QTe,registerSignatureHelpProvider:BTe,registerHoverProvider:WTe,registerDocumentSymbolProvider:VTe,registerDocumentHighlightProvider:zTe,registerLinkedEditingRangeProvider:HTe,registerDefinitionProvider:$Te,registerImplementationProvider:UTe,registerTypeDefinitionProvider:jTe,registerCodeLensProvider:qTe,registerCodeActionProvider:GTe,registerDocumentFormattingEditProvider:KTe,registerDocumentRangeFormattingEditProvider:YTe,registerOnTypeFormattingEditProvider:ZTe,registerLinkProvider:XTe,registerColorProvider:JTe,registerFoldingRangeProvider:eNe,registerDeclarationProvider:tNe,registerSelectionRangeProvider:iNe,registerDocumentSemanticTokensProvider:nNe,registerDocumentRangeSemanticTokensProvider:sNe,registerInlineCompletionsProvider:oNe,registerInlayHintsProvider:rNe,DocumentHighlightKind:yI,CompletionItemKind:gI,CompletionItemTag:pI,CompletionItemInsertTextRule:fI,SymbolKind:UI,SymbolTag:jI,IndentAction:DI,CompletionTriggerKind:mI,SignatureHelpTriggerKind:$I,InlayHintKind:EI,InlineCompletionTriggerKind:AI,CodeActionTriggerType:hI,FoldingRangeKind:as,SelectedSuggestionInfo:Zge}}const MP=rt("IEditorCancelService"),WK=new _e("cancellableOperation",!1,m("cancellableOperation","Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));ft(MP,class{constructor(){this._tokens=new WeakMap}add(n,e){let t=this._tokens.get(n);t||(t=n.invokeWithinContext(s=>{const o=WK.bindTo(s.get(et)),r=new Ds;return{key:o,tokens:r}}),this._tokens.set(n,t));let i;return t.key.set(!0),i=t.tokens.push(e),()=>{i&&(i(),t.key.set(!t.tokens.isEmpty()),i=void 0)}}cancel(n){const e=this._tokens.get(n);if(!e)return;const t=e.tokens.pop();t&&(t.cancel(),e.key.set(!e.tokens.isEmpty()))}},1);class lNe extends Ar{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext(i=>i.get(MP).add(e,this))}dispose(){this._unregister(),super.dispose()}}Ee(new class extends kr{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:WK})}runEditorCommand(n,e){n.get(MP).cancel(e)}});let cNe=class vR{constructor(e,t){if(this.flags=t,this.flags&1){const i=e.getModel();this.modelVersionId=i?Vb("{0}#{1}",i.uri.toString(),i.getVersionId()):null}else this.modelVersionId=null;this.flags&4?this.position=e.getPosition():this.position=null,this.flags&2?this.selection=e.getSelection():this.selection=null,this.flags&8?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof vR))return!1;const t=e;return!(this.modelVersionId!==t.modelVersionId||this.scrollLeft!==t.scrollLeft||this.scrollTop!==t.scrollTop||!this.position&&t.position||this.position&&!t.position||this.position&&t.position&&!this.position.equals(t.position)||!this.selection&&t.selection||this.selection&&!t.selection||this.selection&&t.selection&&!this.selection.equalsRange(t.selection))}validate(e){return this._equals(new vR(e,this.flags))}};class dNe extends lNe{constructor(e,t,i,s){super(e,s),this._listener=new pe,t&4&&this._listener.add(e.onDidChangeCursorPosition(o=>{(!i||!N.containsPosition(i,o.position))&&this.cancel()})),t&2&&this._listener.add(e.onDidChangeCursorSelection(o=>{(!i||!N.containsRange(i,o.selection))&&this.cancel()})),t&8&&this._listener.add(e.onDidScrollChange(o=>this.cancel())),t&1&&(this._listener.add(e.onDidChangeModel(o=>this.cancel())),this._listener.add(e.onDidChangeModelContent(o=>this.cancel())))}dispose(){this._listener.dispose(),super.dispose()}}class uNe extends Ar{constructor(e,t){super(t),this._listener=e.onDidChangeContent(()=>this.cancel())}dispose(){this._listener.dispose(),super.dispose()}}function VK(n){return n&&typeof n.getEditorType=="function"?n.getEditorType()===rD.ICodeEditor:!1}class oB{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return typeof e=="string"?e.toLowerCase():e._lower}}class hNe{constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(oB.toKey(e))}has(e){return this._set.has(oB.toKey(e))}}var f0=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function fNe(n,e,t){const i=[],s=new hNe,o=n.ordered(t);for(const a of o)i.push(a),a.extensionId&&s.add(a.extensionId);const r=e.ordered(t);for(const a of r){if(a.extensionId){if(s.has(a.extensionId))continue;s.add(a.extensionId)}i.push({displayName:a.displayName,extensionId:a.extensionId,provideDocumentFormattingEdits(l,c,d){return a.provideDocumentRangeFormattingEdits(l,l.getFullModelRange(),c,d)}})}return i}class Fv{static setFormatterSelector(e){return{dispose:Fv._selectors.unshift(e)}}static select(e,t,i){return f0(this,void 0,void 0,function*(){if(e.length===0)return;const s=ut.first(Fv._selectors);if(s)return yield s(e,t,i)})}}Fv._selectors=new Ds;function gNe(n,e,t,i,s,o){return f0(this,void 0,void 0,function*(){const r=e.documentRangeFormattingEditProvider.ordered(t);for(const a of r){const l=yield Promise.resolve(a.provideDocumentRangeFormattingEdits(t,i,s,o)).catch(wc);if(oc(l))return yield n.computeMoreMinimalEdits(t.uri,l)}})}function pNe(n,e,t,i,s){return f0(this,void 0,void 0,function*(){const o=fNe(e.documentFormattingEditProvider,e.documentRangeFormattingEditProvider,t);for(const r of o){const a=yield Promise.resolve(r.provideDocumentFormattingEdits(t,i,s)).catch(wc);if(oc(a))return yield n.computeMoreMinimalEdits(t.uri,a)}})}function mNe(n,e,t,i,s,o,r){const a=e.onTypeFormattingEditProvider.ordered(t);return a.length===0||a[0].autoFormatTriggerCharacters.indexOf(s)<0?Promise.resolve(void 0):Promise.resolve(a[0].provideOnTypeFormattingEdits(t,i,s,o,r)).catch(wc).then(l=>n.computeMoreMinimalEdits(t.uri,l))}Yt.registerCommand("_executeFormatRangeProvider",function(n,...e){return f0(this,void 0,void 0,function*(){const[t,i,s]=e;xs(Ue.isUri(t)),xs(N.isIRange(i));const o=n.get(Lu),r=n.get(ly),a=n.get(it),l=yield o.createModelReference(t);try{return gNe(r,a,l.object.textEditorModel,N.lift(i),s,rn.None)}finally{l.dispose()}})});Yt.registerCommand("_executeFormatDocumentProvider",function(n,...e){return f0(this,void 0,void 0,function*(){const[t,i]=e;xs(Ue.isUri(t));const s=n.get(Lu),o=n.get(ly),r=n.get(it),a=yield s.createModelReference(t);try{return pNe(o,r,a.object.textEditorModel,i,rn.None)}finally{a.dispose()}})});Yt.registerCommand("_executeFormatOnTypeProvider",function(n,...e){return f0(this,void 0,void 0,function*(){const[t,i,s,o]=e;xs(Ue.isUri(t)),xs(V.isIPosition(i)),xs(typeof s=="string");const r=n.get(Lu),a=n.get(ly),l=n.get(it),c=yield r.createModelReference(t);try{return mNe(a,l,c.object.textEditorModel,V.lift(i),s,o,rn.None)}finally{c.dispose()}})});Vf.wrappingIndent.defaultValue=0;Vf.glyphMargin.defaultValue=!1;Vf.autoIndent.defaultValue=3;Vf.overviewRulerLanes.defaultValue=2;Fv.setFormatterSelector((n,e,t)=>Promise.resolve(n[0]));const ps=kU();ps.editor=_Te();ps.languages=aNe();const _Ne=ps.CancellationTokenSource,bNe=ps.Emitter,vNe=ps.KeyCode,yNe=ps.KeyMod,wNe=ps.Position,CNe=ps.Range,SNe=ps.Selection,xNe=ps.SelectionDirection,LNe=ps.MarkerSeverity,DNe=ps.MarkerTag,kNe=ps.Uri,ENe=ps.Token,zK=ps.editor,HK=ps.languages,gE=globalThis.MonacoEnvironment;(gE!=null&&gE.globalAPI||typeof define=="function"&&define.amd)&&(globalThis.monaco=ps);typeof globalThis.require<"u"&&typeof globalThis.require.config=="function"&&globalThis.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]});const ANe=Object.freeze(Object.defineProperty({__proto__:null,CancellationTokenSource:_Ne,Emitter:bNe,KeyCode:vNe,KeyMod:yNe,MarkerSeverity:LNe,MarkerTag:DNe,Position:wNe,Range:CNe,Selection:SNe,SelectionDirection:xNe,Token:ENe,Uri:kNe,editor:zK,languages:HK},Symbol.toStringTag,{value:"Module"})),INe="#/definitions/RootSpec",TNe="http://json-schema.org/draft-07/schema#",NNe={AggregateOp:{enum:["count","valid","sum","min","max","mean","median","variance"],type:"string"},AggregateParams:{additionalProperties:!1,properties:{as:{description:"The names for the output fields corresponding to each aggregated field. If not provided, names will be automatically created using the operation and field names (e.g., `sum_field`, `average_field`).",items:{type:"string"},type:"array"},fields:{description:"The data fields to apply aggregate functions to. This array should correspond with the `ops` and `as` arrays. If no fields or operations are specified, a count aggregation will be applied by default.",items:{$ref:"#/definitions/Field"},type:"array"},groupby:{description:"The fields by which to group the data. If these are not defined, all data objects will be grouped into a single category.",items:{$ref:"#/definitions/Field"},type:"array"},ops:{description:'The aggregation operations to be performed on the fields, such as `"sum"`, `"average"`, or `"count"`.',items:{$ref:"#/definitions/AggregateOp"},type:"array"},type:{const:"aggregate",description:"The type of the transform to be applied",type:"string"}},required:["type"],type:"object"},Align:{enum:["left","center","right"],type:"string"},Axis:{additionalProperties:!1,properties:{domain:{description:"A boolean flag indicating if the domain (the axis baseline) should be included as part of the axis.\n\n__Default value:__ `true`",type:"boolean"},domainCap:{description:'The stroke cap for the domain line\'s ending style. One of `"butt"`, `"round"` or `"square"`.\n\n__Default value:__ `"butt"`',enum:["butt","round","square"],type:"string"},domainColor:{description:'Color of axis domain line.\n\n__Default value:__ `"gray"`.',type:"string"},domainDash:{description:"An array of alternating [stroke, space] lengths for dashed domain lines.",items:{type:"number"},type:"array"},domainDashOffset:{description:"The pixel offset at which to start drawing with the domain dash array.",type:"number"},domainWidth:{description:"Stroke width of axis domain line\n\n__Default value:__ `1`",type:"number"},format:{description:"The format specifier pattern for axis labels. Must be a legal [d3-format](https://github.com/d3/d3-format#locale_format) specifier.",type:"string"},grid:{description:"A boolean flag indicating if grid lines should be included as part of the axis.\n\n__Default value:__ `false`",type:"boolean"},gridCap:{description:'The stroke cap for the grid line\'s ending style. One of `"butt"`, `"round"` or `"square"`.\n\n__Default value:__ `"butt"`',enum:["butt","round","square"],type:"string"},gridColor:{description:"Color of grid lines.\n\n__Default value:__ `lightgray`",type:"string"},gridDash:{description:"An array of alternating [stroke, space] lengths for dashed grid mark lines.",items:{type:"number"},type:"array"},gridDashOffset:{description:"The pixel offset at which to start drawing with the grid mark dash array.",type:"number"},gridOpacity:{description:"The opacity of the grid lines.\n\n__Default value:__ `1`",type:"number"},gridWidth:{description:"Width of the grid lines.\n\n__Default value:__ `1`",type:"number"},labelAlign:{$ref:"#/definitions/Align",description:"Horizontal text alignment of axis tick labels, overriding the default setting for the current axis orientation."},labelAngle:{description:"The rotation angle of the axis labels.\n\n__Default value:__ `-90` for nominal and ordinal fields; `0` otherwise.",maximum:360,minimum:-360,type:"number"},labelBaseline:{$ref:"#/definitions/Baseline",description:'Vertical text baseline of axis tick labels, overriding the default setting for the current axis orientation. One of `"alphabetic"` (default), `"top"`, `"middle"`, `"bottom"`.'},labelColor:{description:"The color of the tick label, can be in hex color code or regular color name.",type:"string"},labelFont:{description:"The font of the tick label.",type:"string"},labelFontSize:{description:"The font size of the label, in pixels.",minimum:0,type:"number"},labelFontStyle:{description:"Font style of the title.",type:"string"},labelFontWeight:{description:"Font weight of axis tick labels.",type:"string"},labelLimit:{description:"Maximum allowed pixel width of axis tick labels.\n\n__Default value:__ `180`",type:"number"},labelPadding:{description:"The padding, in pixels, between axis and text labels.\n\n__Default value:__ `2`",type:"number"},labels:{description:"A boolean flag indicating if labels should be included as part of the axis.\n\n__Default value:__ `true`.",type:"boolean"},maxExtent:{description:"The maximum extent in pixels that axis ticks and labels should use. This determines a maximum offset value for axis titles.\n\n__Default value:__ `undefined`.",type:"number"},minExtent:{description:"The minimum extent in pixels that axis ticks and labels should use. This determines a minimum offset value for axis titles.\n\n__Default value:__ `30` for y-axis; `undefined` for x-axis.",type:"number"},offset:{description:"The orthogonal offset in pixels by which to displace the axis from its position along the edge of the chart.",type:"number"},orient:{$ref:"#/definitions/AxisOrient",description:'The orientation of the axis. One of `"top"`, `"bottom"`, `"left"` or `"right"`. The orientation can be used to further specialize the axis type (e.g., a y axis oriented for the right edge of the chart).\n\n__Default value:__ `"bottom"` for x-axes and `"left"` for y-axes.'},tickCap:{description:'The stroke cap for the tick lines\' ending style. One of `"butt"`, `"round"` or `"square"`.\n\n__Default value:__ `"butt"`',enum:["butt","round","square"],type:"string"},tickColor:{description:`The color of the axis's tick. __Default value:__ \`"gray"\``,type:"string"},tickCount:{description:'A desired number of ticks, for axes visualizing quantitative scales. The resulting number may be different so that values are "nice" (multiples of `2`, `5`, `10`) and lie within the underlying scale\'s range.',minimum:0,type:"number"},tickDash:{description:"An array of alternating [stroke, space] lengths for dashed tick mark lines.",items:{type:"number"},type:"array"},tickDashOffset:{description:"The pixel offset at which to start drawing with the tick mark dash array.",type:"number"},tickMinStep:{description:"The minimum desired step between axis ticks, in terms of scale domain values. For example, a value of `1` indicates that ticks should not be less than 1 unit apart. If `tickMinStep` is specified, the `tickCount` value will be adjusted, if necessary, to enforce the minimum step value.",type:"number"},tickSize:{description:"The size in pixels of axis ticks.\n\n__Default value:__ `5`",minimum:0,type:"number"},tickWidth:{description:"The width, in pixels, of ticks.\n\n__Default value:__ `1`",minimum:0,type:"number"},ticks:{description:"Boolean value that determines whether the axis should include ticks.\n\n__Default value:__ `true`",type:"boolean"},title:{description:"A title for the axis (none by default).",type:"string"},titleColor:{description:"Color of the title, can be in hex color code or regular color name.",type:"string"},titleFont:{description:'Font of the title. (e.g., `"Helvetica Neue"`).',type:"string"},titleFontSize:{description:"Font size of the title.",minimum:0,type:"number"},titleFontStyle:{description:"Font style of the title.",type:"string"},titleFontWeight:{description:'Font weight of the title. This can be either a string (e.g `"bold"`, `"normal"`) or a number (`100`, `200`, `300`, ..., `900` where `"normal"` = `400` and `"bold"` = `700`).',type:"string"},titleOpacity:{description:"Opacity of the axis title.",type:"number"},titlePadding:{description:"The padding, in pixels, between title and axis.",type:"number"},values:{description:"Explicitly set the visible axis tick and label values.",items:{},type:"array"}},type:"object"},AxisGenomeData:{additionalProperties:!1,properties:{channel:{$ref:"#/definitions/PrimaryPositionalChannel",description:"Which channel's scale domain to use"},type:{const:"axisGenome",type:"string"}},required:["type","channel"],type:"object"},AxisOrient:{enum:["top","bottom","left","right"],type:"string"},AxisTicksData:{additionalProperties:!1,properties:{axis:{$ref:"#/definitions/Axis",description:"Optional axis properties"},channel:{$ref:"#/definitions/PrimaryPositionalChannel",description:"Which channel's scale domain to listen to"},type:{const:"axisTicks",type:"string"}},required:["type","channel"],type:"object"},BamData:{additionalProperties:!1,properties:{channel:{$ref:"#/definitions/PrimaryPositionalChannel",description:`Which channel's scale domain to monitor. @@ -3642,29 +3443,106 @@ See the [format documentation](https://vega.github.io/vega-lite/docs/format.html TODO: Write proper documentation with examples. -**Default:** \`1.0\``},padding:{$ref:"#/definitions/PaddingConfig",description:"Padding applied to the view. Accepts either a number representing pixels or an object specifying separate paddings for each edge.\n\nExamples:\n- `padding: 10`\n- `padding: { top: 10, right: 20, bottom: 10, left: 20 }`\n\n**Default value:** `0`"},params:{description:"Dynamic variables that [parameterize](https://genomespy.app/docs/grammar/parameters/) a visualization.",items:{$ref:"#/definitions/Parameter"},type:"array"},resolve:{additionalProperties:!1,description:"Specifies how scales and axes are [resolved](https://genomespy.app/docs/grammar/composition/#scale-and-axis-resolution) in the view hierarchy.",properties:{axis:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"},scale:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"}},type:"object"},templates:{additionalProperties:{$ref:"#/definitions/ViewSpec"},description:"[Templates](https://genomespy.app/docs/grammar/import/#repeating-with-named-templates) that can be reused within the view specification by importing them with the template key.",type:"object"},title:{anyOf:[{type:"string"},{$ref:"#/definitions/Title"}],description:"View title. N.B.: Currently, GenomeSpy doesn't do bound calculation, and you need to manually specify proper padding for the view to ensure that the title is visible."},transform:{description:"An array of [transformations](https://genomespy.app/docs/grammar/transform/) applied to the data before visual encoding.",items:{$ref:"#/definitions/TransformParams"},type:"array"},view:{$ref:"#/definitions/ViewBackground",description:"The background of the view, including fill, stroke, and stroke width."},viewportHeight:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport height of the view. If the view size exceeds the viewport height, it will be shown with [scrollbars](https://genomespy.app/docs/grammar/composition/concat/#scrollable-viewports). This property implicitly enables clipping.\n\n**Default:** `null` (same as `height`)"},viewportWidth:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport width of the view. If the view size exceeds the viewport width, it will be shown with [scrollbars](https://genomespy.app/docs/grammar/composition/concat/#scrollable-viewports). This property implicitly enables clipping.\n\n**Default:** `null` (same as `width`)"},visible:{description:"The default visibility of the view. An invisible view is removed from the layout and not rendered. For context, see [toggleable view visibility](https://genomespy.app/docs/sample-collections/visualizing/#toggleable-view-visibility).\n\n**Default:** `true`",type:"boolean"},width:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Width of the view. If a number, it is interpreted as pixels. Check [child sizing](https://genomespy.app/docs/grammar/composition/concat/#child-sizing) for details.\n\n**Default:** `"container"`'}},required:["mark"],type:"object"},UrlData:{additionalProperties:!1,properties:{format:{$ref:"#/definitions/DataFormat",description:"An object that specifies the format for parsing the data."},name:{description:"Provide a placeholder name and bind data at runtime.",type:"string"},url:{anyOf:[{type:"string"},{items:{type:"string"},type:"array"},{$ref:"#/definitions/ExprRef"}],description:"An URL or an array of URLs from which to load the data set. Use the `format.type` property to ensure the loaded data is correctly parsed."}},required:["url"],type:"object"},UrlGenomeConfig:{additionalProperties:!1,properties:{name:{description:"Name of the genome assembly, e.g., `hg19` or `hg38`.",type:"string"},url:{description:'A URL to a `chrom.sizes` file, which is a tab-separated file with two columns: the sequence name and its size.\n\nYou may want to strip alternative loci, haplotypes, and other non-canonical contigs from the file.\n\nExample: `"https://genomespy.app/data/genomes/hg19/chrom.sizes"`',type:"string"}},required:["name","url"],type:"object"},UrlImport:{additionalProperties:!1,properties:{url:{description:"Imports a specification from the specified URL.",type:"string"}},required:["url"],type:"object"},VConcatSpec:{additionalProperties:!1,properties:{baseUrl:{description:"The base URL for relative URL data sources and URL [imports](https://genomespy.app/docs/grammar/import/#importing-from-a-url). The base URLs are inherited in the view hierarchy unless overridden with this property. By default, the top-level view's base URL equals to the visualization specification's base URL.",type:"string"},configurableVisibility:{description:"Is the visibility configurable interactively from the [GenomeSpy App](https://genomespy.app/docs/sample-collections/). Configurability requires that the view has an explicitly specified name that is *unique* in within the view hierarchy.\n\n**Default:** `false` for children of `layer`, `true` for others.",type:"boolean"},data:{$ref:"#/definitions/Data",description:"Specifies a [data source](https://genomespy.app/docs/grammar/data/). If omitted, the data source is inherited from the parent view."},description:{anyOf:[{type:"string"},{items:{type:"string"},type:"array"}],description:"A description of the view. Can be used for documentation. The description of the top-level view is shown in the toolbar of the [GenomeSpy App](https://genomespy.app/docs/sample-collections/)."},encoding:{$ref:"#/definitions/Encoding",description:"Specifies how data are [encoded](https://genomespy.app/docs/grammar/mark/#encoding) using the visual channels."},height:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Height of the view. If a number, it is interpreted as pixels. Check [child sizing](https://genomespy.app/docs/grammar/composition/concat/#child-sizing) for details.\n\n**Default value:** `"container"`'},name:{description:"An internal name that can be used for referring the view. For referencing purposes, the name should be unique within the view hierarchy.",type:"string"},padding:{$ref:"#/definitions/PaddingConfig",description:"Padding applied to the view. Accepts either a number representing pixels or an object specifying separate paddings for each edge.\n\nExamples:\n- `padding: 10`\n- `padding: { top: 10, right: 20, bottom: 10, left: 20 }`\n\n**Default value:** `0`"},params:{description:"Dynamic variables that [parameterize](https://genomespy.app/docs/grammar/parameters/) a visualization.",items:{$ref:"#/definitions/Parameter"},type:"array"},resolve:{additionalProperties:!1,description:"Specifies how scales and axes are [resolved](https://genomespy.app/docs/grammar/composition/#scale-and-axis-resolution) in the view hierarchy.",properties:{axis:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"},scale:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"}},type:"object"},spacing:{description:"The gap between the views, in pixels.",type:"number"},templates:{additionalProperties:{$ref:"#/definitions/ViewSpec"},description:"[Templates](https://genomespy.app/docs/grammar/import/#repeating-with-named-templates) that can be reused within the view specification by importing them with the template key.",type:"object"},title:{anyOf:[{type:"string"},{$ref:"#/definitions/Title"}],description:"View title. N.B.: Currently, GenomeSpy doesn't do bound calculation, and you need to manually specify proper padding for the view to ensure that the title is visible."},transform:{description:"An array of [transformations](https://genomespy.app/docs/grammar/transform/) applied to the data before visual encoding.",items:{$ref:"#/definitions/TransformParams"},type:"array"},vconcat:{description:"Specifies views that will be concatenated vertically.",items:{anyOf:[{$ref:"#/definitions/ViewSpec"},{$ref:"#/definitions/ImportSpec"}]},type:"array"},viewportHeight:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport height of the view. If the view size exceeds the viewport height, it will be shown with [scrollbars](https://genomespy.app/docs/grammar/composition/concat/#scrollable-viewports). This property implicitly enables clipping.\n\n**Default:** `null` (same as `height`)"},viewportWidth:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport width of the view. If the view size exceeds the viewport width, it will be shown with [scrollbars](https://genomespy.app/docs/grammar/composition/concat/#scrollable-viewports). This property implicitly enables clipping.\n\n**Default:** `null` (same as `width`)"},visible:{description:"The default visibility of the view. An invisible view is removed from the layout and not rendered. For context, see [toggleable view visibility](https://genomespy.app/docs/sample-collections/visualizing/#toggleable-view-visibility).\n\n**Default:** `true`",type:"boolean"},width:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Width of the view. If a number, it is interpreted as pixels. Check [child sizing](https://genomespy.app/docs/grammar/composition/concat/#child-sizing) for details.\n\n**Default:** `"container"`'}},required:["vconcat"],type:"object"},"ValueDef":{additionalProperties:!1,properties:{title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]},value:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:'A constant value in visual domain (e.g., `"red"` / `"#0099ff"`, values between `0` to `1` for opacity).'}},required:["value"],type:"object"},"ValueDefWithCondition<(string|null)>":{additionalProperties:!1,minProperties:1,properties:{condition:{anyOf:[{$ref:"#/definitions/Conditional%3CFieldDef%3E"},{$ref:"#/definitions/Conditional%3CDatumDef%3E"},{$ref:"#/definitions/Conditional%3CValueDef%3C(string%7Cnull%7CExprRef)%3E%3E"},{items:{$ref:"#/definitions/Conditional%3CValueDef%3C(string%7Cnull%7CExprRef)%3E%3E"},type:"array"}],description:"A field definition or one or more value definition(s) with a parameter predicate."},title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]},value:{anyOf:[{type:"string"},{type:"null"},{$ref:"#/definitions/ExprRef"}],description:'A constant value in visual domain (e.g., `"red"` / `"#0099ff"`, values between `0` to `1` for opacity).'}},type:"object"},"ValueDefWithCondition":{additionalProperties:!1,minProperties:1,properties:{condition:{anyOf:[{$ref:"#/definitions/Conditional%3CFieldDef%3E"},{$ref:"#/definitions/Conditional%3CDatumDef%3E"},{$ref:"#/definitions/Conditional%3CValueDef%3C(number%7CExprRef)%3E%3E"},{items:{$ref:"#/definitions/Conditional%3CValueDef%3C(number%7CExprRef)%3E%3E"},type:"array"}],description:"A field definition or one or more value definition(s) with a parameter predicate."},title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]},value:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:'A constant value in visual domain (e.g., `"red"` / `"#0099ff"`, values between `0` to `1` for opacity).'}},type:"object"},VariableParameter:{additionalProperties:!1,properties:{bind:{$ref:"#/definitions/Binding",description:"Binds the parameter to an external input element such as a slider, selection list or radio button group."},expr:{description:"An expression for the value of the parameter. This expression may include other parameters, in which case the parameter will automatically update in response to upstream parameter changes.",type:"string"},name:{description:'A unique name for the variable parameter. Parameter names should be valid JavaScript identifiers: they should contain only alphanumeric characters (or "$", or "_") and may not start with a digit. Reserved keywords that may not be used as parameter names are: "datum".',type:"string"},push:{const:"outer",type:"string"},value:{description:"The [initial value](http://vega.github.io/vega-lite/docs/value.html) of the parameter.\n\n__Default value:__ `undefined`"}},required:["name"],type:"object"},ViewBackground:{additionalProperties:!1,properties:{fill:{anyOf:[{type:"string"},{$ref:"#/definitions/ExprRef"}],description:"The fill color."},fillOpacity:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:"The fill opacity. Value between `0` and `1`."},stroke:{anyOf:[{type:"string"},{$ref:"#/definitions/ExprRef"}],description:"The stroke color"},strokeOpacity:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:"The stroke opacity. Value between `0` and `1`."},strokeWidth:{description:"The stroke width in pixels.",type:"number"}},type:"object"},ViewOpacityDef:{anyOf:[{type:"number"},{$ref:"#/definitions/DynamicOpacity"},{$ref:"#/definitions/ExprRef"}]},ViewSpec:{anyOf:[{$ref:"#/definitions/UnitSpec"},{$ref:"#/definitions/LayerSpec"},{$ref:"#/definitions/VConcatSpec"},{$ref:"#/definitions/HConcatSpec"},{$ref:"#/definitions/ConcatSpec"},{$ref:"#/definitions/SampleSpec"}]},ZoomParams:{additionalProperties:!1,properties:{extent:{anyOf:[{$ref:"#/definitions/ScalarDomain"},{$ref:"#/definitions/ComplexDomain"}],description:"The boundaries that limit the zoom and pan interactions."}},type:"object"}},dB={$ref:dNe,$schema:uNe,definitions:hNe},fNe="@genome-spy/playground",gNe="0.56.1",pNe="A playground for testing GenomeSpy visualizations",mNe="module",_Ne={dev:"vite",build:"vite build",serve:"vite preview"},bNe="Kari Lavikka",vNe="MIT",yNe={"@fortawesome/fontawesome-free":"^6.1.1","@fortawesome/fontawesome-svg-core":"^6.1.1","@fortawesome/free-solid-svg-icons":"^6.1.1","@genome-spy/core":"^0.56.1",lit:"^3.1.2","monaco-editor":"^0.44.0","vega-loader":"^4.4.0"},uB={name:fNe,private:!0,version:gNe,description:pNe,type:mNe,scripts:_Ne,author:bNe,license:vNe,dependencies:yNe};/*!----------------------------------------------------------------------------- +**Default:** \`1.0\``},padding:{$ref:"#/definitions/PaddingConfig",description:"Padding applied to the view. Accepts either a number representing pixels or an object specifying separate paddings for each edge.\n\nExamples:\n- `padding: 10`\n- `padding: { top: 10, right: 20, bottom: 10, left: 20 }`\n\n**Default value:** `0`"},params:{description:"Dynamic variables that [parameterize](https://genomespy.app/docs/grammar/parameters/) a visualization.",items:{$ref:"#/definitions/Parameter"},type:"array"},resolve:{additionalProperties:!1,description:"Specifies how scales and axes are [resolved](https://genomespy.app/docs/grammar/composition/#scale-and-axis-resolution) in the view hierarchy.",properties:{axis:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"},scale:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"}},type:"object"},templates:{additionalProperties:{$ref:"#/definitions/ViewSpec"},description:"[Templates](https://genomespy.app/docs/grammar/import/#repeating-with-named-templates) that can be reused within the view specification by importing them with the template key.",type:"object"},title:{anyOf:[{type:"string"},{$ref:"#/definitions/Title"}],description:"View title. N.B.: Currently, GenomeSpy doesn't do bound calculation, and you need to manually specify proper padding for the view to ensure that the title is visible."},transform:{description:"An array of [transformations](https://genomespy.app/docs/grammar/transform/) applied to the data before visual encoding.",items:{$ref:"#/definitions/TransformParams"},type:"array"},view:{$ref:"#/definitions/ViewBackground",description:"The background of the view, including fill, stroke, and stroke width."},viewportHeight:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport height of the view. If the view size exceeds the viewport height, it will be shown with [scrollbars](https://genomespy.app/docs/grammar/composition/concat/#scrollable-viewports). This property implicitly enables clipping.\n\n**Default:** `null` (same as `height`)"},viewportWidth:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport width of the view. If the view size exceeds the viewport width, it will be shown with [scrollbars](https://genomespy.app/docs/grammar/composition/concat/#scrollable-viewports). This property implicitly enables clipping.\n\n**Default:** `null` (same as `width`)"},visible:{description:"The default visibility of the view. An invisible view is removed from the layout and not rendered. For context, see [toggleable view visibility](https://genomespy.app/docs/sample-collections/visualizing/#toggleable-view-visibility).\n\n**Default:** `true`",type:"boolean"},width:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Width of the view. If a number, it is interpreted as pixels. Check [child sizing](https://genomespy.app/docs/grammar/composition/concat/#child-sizing) for details.\n\n**Default:** `"container"`'}},required:["mark"],type:"object"},UrlData:{additionalProperties:!1,properties:{format:{$ref:"#/definitions/DataFormat",description:"An object that specifies the format for parsing the data."},name:{description:"Provide a placeholder name and bind data at runtime.",type:"string"},url:{anyOf:[{type:"string"},{items:{type:"string"},type:"array"},{$ref:"#/definitions/ExprRef"}],description:"An URL or an array of URLs from which to load the data set. Use the `format.type` property to ensure the loaded data is correctly parsed."}},required:["url"],type:"object"},UrlGenomeConfig:{additionalProperties:!1,properties:{name:{description:"Name of the genome assembly, e.g., `hg19` or `hg38`.",type:"string"},url:{description:'A URL to a `chrom.sizes` file, which is a tab-separated file with two columns: the sequence name and its size.\n\nYou may want to strip alternative loci, haplotypes, and other non-canonical contigs from the file.\n\nExample: `"https://genomespy.app/data/genomes/hg19/chrom.sizes"`',type:"string"}},required:["name","url"],type:"object"},UrlImport:{additionalProperties:!1,properties:{url:{description:"Imports a specification from the specified URL.",type:"string"}},required:["url"],type:"object"},VConcatSpec:{additionalProperties:!1,properties:{baseUrl:{description:"The base URL for relative URL data sources and URL [imports](https://genomespy.app/docs/grammar/import/#importing-from-a-url). The base URLs are inherited in the view hierarchy unless overridden with this property. By default, the top-level view's base URL equals to the visualization specification's base URL.",type:"string"},configurableVisibility:{description:"Is the visibility configurable interactively from the [GenomeSpy App](https://genomespy.app/docs/sample-collections/). Configurability requires that the view has an explicitly specified name that is *unique* in within the view hierarchy.\n\n**Default:** `false` for children of `layer`, `true` for others.",type:"boolean"},data:{$ref:"#/definitions/Data",description:"Specifies a [data source](https://genomespy.app/docs/grammar/data/). If omitted, the data source is inherited from the parent view."},description:{anyOf:[{type:"string"},{items:{type:"string"},type:"array"}],description:"A description of the view. Can be used for documentation. The description of the top-level view is shown in the toolbar of the [GenomeSpy App](https://genomespy.app/docs/sample-collections/)."},encoding:{$ref:"#/definitions/Encoding",description:"Specifies how data are [encoded](https://genomespy.app/docs/grammar/mark/#encoding) using the visual channels."},height:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Height of the view. If a number, it is interpreted as pixels. Check [child sizing](https://genomespy.app/docs/grammar/composition/concat/#child-sizing) for details.\n\n**Default value:** `"container"`'},name:{description:"An internal name that can be used for referring the view. For referencing purposes, the name should be unique within the view hierarchy.",type:"string"},padding:{$ref:"#/definitions/PaddingConfig",description:"Padding applied to the view. Accepts either a number representing pixels or an object specifying separate paddings for each edge.\n\nExamples:\n- `padding: 10`\n- `padding: { top: 10, right: 20, bottom: 10, left: 20 }`\n\n**Default value:** `0`"},params:{description:"Dynamic variables that [parameterize](https://genomespy.app/docs/grammar/parameters/) a visualization.",items:{$ref:"#/definitions/Parameter"},type:"array"},resolve:{additionalProperties:!1,description:"Specifies how scales and axes are [resolved](https://genomespy.app/docs/grammar/composition/#scale-and-axis-resolution) in the view hierarchy.",properties:{axis:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"},scale:{additionalProperties:{$ref:"#/definitions/ResolutionBehavior"},properties:{default:{$ref:"#/definitions/ResolutionBehavior"}},type:"object"}},type:"object"},spacing:{description:"The gap between the views, in pixels.",type:"number"},templates:{additionalProperties:{$ref:"#/definitions/ViewSpec"},description:"[Templates](https://genomespy.app/docs/grammar/import/#repeating-with-named-templates) that can be reused within the view specification by importing them with the template key.",type:"object"},title:{anyOf:[{type:"string"},{$ref:"#/definitions/Title"}],description:"View title. N.B.: Currently, GenomeSpy doesn't do bound calculation, and you need to manually specify proper padding for the view to ensure that the title is visible."},transform:{description:"An array of [transformations](https://genomespy.app/docs/grammar/transform/) applied to the data before visual encoding.",items:{$ref:"#/definitions/TransformParams"},type:"array"},vconcat:{description:"Specifies views that will be concatenated vertically.",items:{anyOf:[{$ref:"#/definitions/ViewSpec"},{$ref:"#/definitions/ImportSpec"}]},type:"array"},viewportHeight:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport height of the view. If the view size exceeds the viewport height, it will be shown with [scrollbars](https://genomespy.app/docs/grammar/composition/concat/#scrollable-viewports). This property implicitly enables clipping.\n\n**Default:** `null` (same as `height`)"},viewportWidth:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{const:"container",type:"string"}],description:"Optional viewport width of the view. If the view size exceeds the viewport width, it will be shown with [scrollbars](https://genomespy.app/docs/grammar/composition/concat/#scrollable-viewports). This property implicitly enables clipping.\n\n**Default:** `null` (same as `width`)"},visible:{description:"The default visibility of the view. An invisible view is removed from the layout and not rendered. For context, see [toggleable view visibility](https://genomespy.app/docs/sample-collections/visualizing/#toggleable-view-visibility).\n\n**Default:** `true`",type:"boolean"},width:{anyOf:[{$ref:"#/definitions/SizeDef"},{type:"number"},{$ref:"#/definitions/Step"},{const:"container",type:"string"}],description:'Width of the view. If a number, it is interpreted as pixels. Check [child sizing](https://genomespy.app/docs/grammar/composition/concat/#child-sizing) for details.\n\n**Default:** `"container"`'}},required:["vconcat"],type:"object"},"ValueDef":{additionalProperties:!1,properties:{title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]},value:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:'A constant value in visual domain (e.g., `"red"` / `"#0099ff"`, values between `0` to `1` for opacity).'}},required:["value"],type:"object"},"ValueDefWithCondition<(string|null)>":{additionalProperties:!1,minProperties:1,properties:{condition:{anyOf:[{$ref:"#/definitions/Conditional%3CFieldDef%3E"},{$ref:"#/definitions/Conditional%3CDatumDef%3E"},{$ref:"#/definitions/Conditional%3CValueDef%3C(string%7Cnull%7CExprRef)%3E%3E"},{items:{$ref:"#/definitions/Conditional%3CValueDef%3C(string%7Cnull%7CExprRef)%3E%3E"},type:"array"}],description:"A field definition or one or more value definition(s) with a parameter predicate."},title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]},value:{anyOf:[{type:"string"},{type:"null"},{$ref:"#/definitions/ExprRef"}],description:'A constant value in visual domain (e.g., `"red"` / `"#0099ff"`, values between `0` to `1` for opacity).'}},type:"object"},"ValueDefWithCondition":{additionalProperties:!1,minProperties:1,properties:{condition:{anyOf:[{$ref:"#/definitions/Conditional%3CFieldDef%3E"},{$ref:"#/definitions/Conditional%3CDatumDef%3E"},{$ref:"#/definitions/Conditional%3CValueDef%3C(number%7CExprRef)%3E%3E"},{items:{$ref:"#/definitions/Conditional%3CValueDef%3C(number%7CExprRef)%3E%3E"},type:"array"}],description:"A field definition or one or more value definition(s) with a parameter predicate."},title:{description:"A title for the field. If `null`, the title will be removed.",type:["string","null"]},value:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:'A constant value in visual domain (e.g., `"red"` / `"#0099ff"`, values between `0` to `1` for opacity).'}},type:"object"},VariableParameter:{additionalProperties:!1,properties:{bind:{$ref:"#/definitions/Binding",description:"Binds the parameter to an external input element such as a slider, selection list or radio button group."},expr:{description:"An expression for the value of the parameter. This expression may include other parameters, in which case the parameter will automatically update in response to upstream parameter changes.",type:"string"},name:{description:'A unique name for the variable parameter. Parameter names should be valid JavaScript identifiers: they should contain only alphanumeric characters (or "$", or "_") and may not start with a digit. Reserved keywords that may not be used as parameter names are: "datum".',type:"string"},push:{const:"outer",type:"string"},value:{description:"The [initial value](http://vega.github.io/vega-lite/docs/value.html) of the parameter.\n\n__Default value:__ `undefined`"}},required:["name"],type:"object"},ViewBackground:{additionalProperties:!1,properties:{fill:{anyOf:[{type:"string"},{$ref:"#/definitions/ExprRef"}],description:"The fill color."},fillOpacity:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:"The fill opacity. Value between `0` and `1`."},stroke:{anyOf:[{type:"string"},{$ref:"#/definitions/ExprRef"}],description:"The stroke color"},strokeOpacity:{anyOf:[{type:"number"},{$ref:"#/definitions/ExprRef"}],description:"The stroke opacity. Value between `0` and `1`."},strokeWidth:{description:"The stroke width in pixels.",type:"number"}},type:"object"},ViewOpacityDef:{anyOf:[{type:"number"},{$ref:"#/definitions/DynamicOpacity"},{$ref:"#/definitions/ExprRef"}]},ViewSpec:{anyOf:[{$ref:"#/definitions/UnitSpec"},{$ref:"#/definitions/LayerSpec"},{$ref:"#/definitions/VConcatSpec"},{$ref:"#/definitions/HConcatSpec"},{$ref:"#/definitions/ConcatSpec"},{$ref:"#/definitions/SampleSpec"}]},ZoomParams:{additionalProperties:!1,properties:{extent:{anyOf:[{$ref:"#/definitions/ScalarDomain"},{$ref:"#/definitions/ComplexDomain"}],description:"The boundaries that limit the zoom and pan interactions."}},type:"object"}},rB={$ref:INe,$schema:TNe,definitions:NNe},RNe="@genome-spy/playground",MNe="0.57.0",PNe="A playground for testing GenomeSpy visualizations",ONe="module",FNe={dev:"vite",build:"vite build",serve:"vite preview"},BNe="Kari Lavikka",WNe="MIT",VNe={"@fortawesome/fontawesome-free":"^6.1.1","@fortawesome/fontawesome-svg-core":"^6.1.1","@fortawesome/free-solid-svg-icons":"^6.1.1","@genome-spy/core":"^0.57.0",lit:"^3.1.2","monaco-editor":"^0.44.0",prettier:"^3.4.1","vega-loader":"^4.4.0"},aB={name:RNe,private:!0,version:MNe,description:PNe,type:ONe,scripts:FNe,author:BNe,license:WNe,dependencies:VNe};var Km,$K,UK;class yR extends zh{constructor(){super();Pe(this,Km);this.orientation="horizontal",this.reverse=!1}render(){return Lt`

${xe(this,Km,$K).call(this)}
`}}Km=new WeakSet,$K=function(){const t=Array.from(this.children);return Array.from(this.reverse?t.reverse():t).map((i,s)=>Lt` +
+ + ${sxe(this,Km,UK).call(this,o,s)} + >
`:""} + + `)},UK=function(t,i){t.preventDefault(),t.stopPropagation();const s=this.shadowRoot.querySelectorAll(".resizable"),o=s[i],r=s[i+1],a=t.clientX,l=t.clientY,c=o.getBoundingClientRect().width,d=o.getBoundingClientRect().height,u=r.getBoundingClientRect().width,h=r.getBoundingClientRect().height;this.classList.add("resizing");const f=p=>{if(this.orientation==="horizontal"){const _=p.clientX-a;o.style.flexBasis=`${(c+_)/this.clientWidth*100}%`,r.style.flexBasis=`${(u-_)/this.clientWidth*100}%`}else{const _=p.clientY-l;o.style.flexBasis=`${(d+_)/this.clientHeight*100}%`,r.style.flexBasis=`${(h-_)/this.clientHeight*100}%`}p.stopPropagation()},g=()=>{window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",g),this.classList.remove("resizing")};window.addEventListener("mousemove",f),window.addEventListener("mouseup",g)},Ei(yR,"properties",{orientation:{type:String,reflect:!0},inverse:{type:Boolean,reflect:!0}}),Ei(yR,"styles",nZ` + :host { + display: block; + position: relative; + --border-color: #e0e0e0; + --handle-hover-color: rgba(255, 0, 0, 0.1); + } + .container { + display: flex; + position: relative; + width: 100%; + height: 100%; + } + .resizable { + position: relative; + overflow: visible; + } + .resizable-slot { + position: absolute; + inset: 0; + overflow: hidden; + } + .resizable-handle { + position: absolute; + z-index: 10; + } + + .resizable-handle:hover { + background-color: var(--handle-hover-color); + } + + :host([orientation="horizontal"]) .resizable-handle { + right: -3px; + top: 0; + width: 5px; + height: 100%; + cursor: ew-resize; + } + :host([orientation="horizontal"]) .resizable:not(:last-child) { + border-right: 1px solid var(--border-color); + } + + :host([orientation="vertical"]) .container { + flex-direction: column; + } + + :host([orientation="vertical"]) .resizable-handle { + right: auto; + bottom: -3px; + width: 100%; + height: 5px; + cursor: ns-resize; + } + + :host([orientation="vertical"]) .resizable:not(:last-child) { + border-bottom: 1px solid var(--border-color); + } + :host(.resizing[orientation="horizontal"]) { + cursor: ew-resize; + } + :host(.resizing[orientation="vertical"]) { + cursor: ns-resize; + } + `);customElements.define("split-panel",yR);/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt - *-----------------------------------------------------------------------------*/var wNe=Object.defineProperty,CNe=Object.getOwnPropertyDescriptor,SNe=Object.getOwnPropertyNames,xNe=Object.prototype.hasOwnProperty,LNe=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of SNe(e))!xNe.call(n,s)&&s!==t&&wNe(n,s,{get:()=>e[s],enumerable:!(i=CNe(e,s))||i.enumerable});return n},DNe=(n,e,t)=>(LNe(n,e,"default"),t),gy={};DNe(gy,cNe);var kNe=class{constructor(n,e,t){zi(this,"_onDidChange",new gy.Emitter);zi(this,"_diagnosticsOptions");zi(this,"_modeConfiguration");zi(this,"_languageId");this._languageId=n,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(n){this._diagnosticsOptions=n||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(n){this._modeConfiguration=n||Object.create(null),this._onDidChange.fire(this)}},ENe={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},ANe={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},UK=new kNe("json",ENe,ANe);gy.languages.json={jsonDefaults:UK};function INe(){return Xs(()=>import("./jsonMode-Co5BPlPO.js"),[],import.meta.url)}gy.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});gy.languages.onLanguage("json",()=>{INe().then(n=>n.setupMode(UK))});const TNe={0:" ",1:"u",2:"r"},hB=65535,qr=16777215,fB=4278190080;class yE{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<hB)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new yE(e.length),this._userDefinedStates=new yE(e.length),this._recoveredStates=new yE(e.length),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(i,s)=>{const o=e[e.length-1];return this.getStartLineNumber(o)<=i&&this.getEndLineNumber(o)>=s};for(let i=0,s=this._startIndexes.length;iqr||r>qr)throw new Error("startLineNumber or endLineNumber must not exceed "+qr);for(;e.length>0&&!t(o,r);)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]=r+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&qr}getEndLineNumber(e){return this._endIndexes[e]&qr}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 s=0;s>>24)+((this._endIndexes[e]&fB)>>>16);return t===hB?-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=0){if(this.getEndLineNumber(t)>=e)return t;for(t=this.getParentIndex(t);t!==-1;){if(this.contains(t,e))return t;t=this.getParentIndex(t)}}return-1}toString(){const e=[];for(let t=0;tArray.isArray(p)?v=>v<_?p[v]:void 0:v=>v<_?p.toFoldRange(v):void 0,o=s(e,e.length),r=s(t,t.length);let a=0,l=0,c=o(0),d=r(0);const u=[];let h,f=0;const g=[];for(;c||d;){let p;if(d&&(!c||c.startLineNumber>=d.startLineNumber))c&&c.startLineNumber===d.startLineNumber?(d.source===1?p=d:(p=c,p.isCollapsed=d.isCollapsed&&c.endLineNumber===d.endLineNumber,p.source=0),c=o(++a)):(p=d,d.isCollapsed&&d.source===0&&(p.source=2)),d=r(++l);else{let _=l,v=d;for(;;){if(!v||v.startLineNumber>c.endLineNumber){p=c;break}if(v.source===1&&v.endLineNumber>c.endLineNumber)break;v=r(++_)}c=o(++a)}if(p){for(;h&&h.endLineNumberp.startLineNumber&&p.startLineNumber>f&&p.endLineNumber<=i&&(!h||h.endLineNumber>=p.endLineNumber)&&(g.push(p),f=p.startLineNumber,h&&u.push(h),h=p)}}return g}}class NNe{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 RNe{get regions(){return this._regions}get textModel(){return this._textModel}constructor(e,t){this._updateEventEmitter=new B,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new mo(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[]}toggleCollapseState(e){if(!e.length)return;e=e.sort((i,s)=>i.regionIndex-s.regionIndex);const t={};this._decorationProvider.changeDecorations(i=>{let s=0,o=-1,r=-1;const a=l=>{for(;sr&&(r=c),s++}};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=s=>{for(const o of e)if(!(o.startLineNumber>s.endLineNumber||s.startLineNumber>o.endLineNumber))return!0;return!1};for(let s=0;si&&(i=a)}this._decorationProvider.changeDecorations(s=>this._editorDecorationIds=s.deltaDecorations(this._editorDecorationIds,t)),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e=[]){const t=(s,o)=>{for(const r of e)if(s=r.endLineNumber||r.startLineNumber<1||r.endLineNumber>i)continue;const a=this._getLinesChecksum(r.startLineNumber+1,r.endLineNumber);t.push({startLineNumber:r.startLineNumber,endLineNumber:r.endLineNumber,isCollapsed:r.isCollapsed,source:r.source,checksum:a})}return t.length>0?t:void 0}applyMemento(e){var t,i;if(!Array.isArray(e))return;const s=[],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)&&s.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 r=mo.sanitizeAndMerge(this._regions,s,o);this.updatePost(mo.fromFoldRanges(r))}_getLinesChecksum(e,t){return E0e(this._textModel.getLineContent(e)+this._textModel.getLineContent(t))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(e,t){const i=[];if(this._regions){let s=this._regions.findRange(e),o=1;for(;s>=0;){const r=this._regions.toRegion(s);(!t||t(r,o))&&i.push(r),o++,s=r.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=[],s=e?e.regionIndex+1:0,o=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const r=[];for(let a=s,l=this._regions.length;a0&&!c.containedBy(r[r.length-1]);)r.pop();r.push(c),t(c,r.length)&&i.push(c)}else break}}else for(let r=s,a=this._regions.length;r0)for(const o of i){const r=n.getRegionAtLine(o);if(r&&(r.isCollapsed!==e&&s.push(r),t>1)){const a=n.getRegionsInside(r,(l,c)=>l.isCollapsed!==e&&cr.isCollapsed!==e&&aa.isCollapsed!==e&&l<=t);s.push(...r)}n.toggleCollapseState(s)}function PNe(n,e,t){const i=[];for(const s of t){const o=n.getAllRegionsAtLine(s,r=>r.isCollapsed!==e);o.length>0&&i.push(o[0])}n.toggleCollapseState(i)}function ONe(n,e,t,i){const s=(r,a)=>a===e&&r.isCollapsed!==t&&!i.some(l=>r.containsLine(l)),o=n.getRegionsInside(null,s);n.toggleCollapseState(o)}function qK(n,e,t){const i=[];for(const r of t){const a=n.getAllRegionsAtLine(r,void 0);a.length>0&&i.push(a[0])}const s=r=>i.every(a=>!a.containedBy(r)&&!r.containedBy(a))&&r.isCollapsed!==e,o=n.getRegionsInside(null,s);n.toggleCollapseState(o)}function F3(n,e,t){const i=n.textModel,s=n.regions,o=[];for(let r=s.length-1;r>=0;r--)if(t!==s.isCollapsed(r)){const a=s.getStartLineNumber(r);e.test(i.getLineContent(a))&&o.push(s.toRegion(r))}n.toggleCollapseState(o)}function B3(n,e,t){const i=n.regions,s=[];for(let o=i.length-1;o>=0;o--)t!==i.isCollapsed(o)&&e===i.getType(o)&&s.push(i.toRegion(o));n.toggleCollapseState(s)}function FNe(n,e){let t=null;const i=e.getRegionAtLine(n);if(i!==null&&(t=i.startLineNumber,n===t)){const s=i.parentIndex;s!==-1?t=e.regions.getStartLineNumber(s):t=null}return t}function BNe(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){if(n!==t.startLineNumber)return t.startLineNumber;{const i=t.parentIndex;let s=0;for(i!==-1&&(s=e.regions.getStartLineNumber(t.parentIndex));t!==null;)if(t.regionIndex>0){if(t=e.regions.toRegion(t.regionIndex-1),t.startLineNumber<=s)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.startLineNumber0?t=e.regions.toRegion(t.regionIndex-1):t=null}return null}function WNe(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){const i=t.parentIndex;let s=0;if(i!==-1)s=e.regions.getEndLineNumber(t.parentIndex);else{if(e.regions.length===0)return null;s=e.regions.getEndLineNumber(e.regions.length-1)}for(;t!==null;)if(t.regionIndex=s)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>n)return t.startLineNumber;t.regionIndexthis.updateHiddenRanges()),this._hiddenRanges=[],e.regions.length&&this.updateHiddenRanges()}notifyChangeModelContent(e){this._hiddenRanges.length&&!this._hasLineChanges&&(this._hasLineChanges=e.changes.some(t=>t.range.endLineNumber!==t.range.startLineNumber||Cf(t.text)[0]!==0))}updateHiddenRanges(){let e=!1;const t=[];let i=0,s=0,o=Number.MAX_VALUE,r=-1;const a=this._foldingModel.regions;for(;i0}isHidden(e){return gB(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const i=this._foldingModel.textModel;let s=null;const o=r=>((!s||!zNe(r,s))&&(s=gB(this._hiddenRanges,r)),s?s.startLineNumber-1:null);for(let r=0,a=e.length;r0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function zNe(n,e){return n>=e.startLineNumber&&n<=e.endLineNumber}function gB(n,e){const t=Yb(n,i=>e=0&&n[t].endLineNumber>=e?n[t]:null}const HNe=5e3,$Ne="indent";class GK{constructor(e,t,i){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=i,this.id=$Ne}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,i=t&&!!t.offSide,s=t&&t.markers;return Promise.resolve(qNe(this.editorModel,i,s,this.foldingRangesLimit))}}let UNe=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>qr||t>qr)return;const s=this._length;this._startIndexes[s]=e,this._endIndexes[s]=t,this._length++,i<1e3&&(this._indentOccurrences[i]=(this._indentOccurrences[i]||0)+1)}toIndentRanges(e){const t=this._foldingRangesLimit.limit;if(this._length<=t){this._foldingRangesLimit.update(this._length,!1);const i=new Uint32Array(this._length),s=new Uint32Array(this._length);for(let o=this._length-1,r=0;o>=0;o--,r++)i[r]=this._startIndexes[o],s[r]=this._endIndexes[o];return new mo(i,s)}else{this._foldingRangesLimit.update(this._length,t);let i=0,s=this._indentOccurrences.length;for(let l=0;lt){s=l;break}i+=c}}const o=e.getOptions().tabSize,r=new Uint32Array(t),a=new Uint32Array(t);for(let l=this._length-1,c=0;l>=0;l--){const d=this._startIndexes[l],u=e.getLineContent(d),h=SD(u,o);(h{}};function qNe(n,e,t,i=jNe){const s=n.getOptions().tabSize,o=new UNe(i);let r;t&&(r=new RegExp(`(${t.start.source})|(?:${t.end.source})`));const a=[],l=n.getLineCount()+1;a.push({indent:-1,endAbove:l,line:l});for(let c=n.getLineCount();c>0;c--){const d=n.getLineContent(c),u=SD(d,s);let h=a[a.length-1];if(u===-1){e&&(h.endAbove=c);continue}let f;if(r&&(f=d.match(r)))if(f[1]){let g=a.length-1;for(;g>0&&a[g].indent!==-2;)g--;if(g>0){a.length=g+1,h=a[g],o.insertFirst(c,h.line,u),h.line=c,h.indent=u,h.endAbove=c;continue}}else{a.push({indent:-2,endAbove:c,line:c});continue}if(h.indent>u){do a.pop(),h=a[a.length-1];while(h.indent>u);const g=h.endAbove-1;g-c>=1&&o.insertFirst(c,g,u)}h.indent===u?h.endAbove=c:a.push({indent:u,endAbove:c,line:c})}return o.toIndentRanges(n)}const GNe=E("editor.foldBackground",{light:we(hd,.3),dark:we(hd,.3),hcDark:null,hcLight:null},m("foldBackgroundBackground","Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);E("editorGutter.foldingControlForeground",{dark:ud,light:ud,hcDark:ud,hcLight:ud},m("editorGutter.foldingControlForeground","Color of the folding control in the editor gutter."));const W3=Xi("folding-expanded",se.chevronDown,m("foldingExpandedIcon","Icon for expanded ranges in the editor glyph margin.")),V3=Xi("folding-collapsed",se.chevronRight,m("foldingCollapsedIcon","Icon for collapsed ranges in the editor glyph margin.")),KK=Xi("folding-manual-collapsed",V3,m("foldingManualCollapedIcon","Icon for manually collapsed ranges in the editor glyph margin.")),YK=Xi("folding-manual-expanded",W3,m("foldingManualExpandedIcon","Icon for manually expanded ranges in the editor glyph margin.")),z3={color:rn(GNe),position:Js.Inline};class Ai{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,i){return t?Ai.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?Ai.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:Ai.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:Ai.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?i?this.showFoldingHighlights?Ai.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ai.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?Ai.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ai.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?i?Ai.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:Ai.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:i?Ai.MANUALLY_EXPANDED_VISUAL_DECORATION:Ai.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}}Ai.COLLAPSED_VISUAL_DECORATION=et.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:Te.asClassName(V3)});Ai.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=et.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:z3,isWholeLine:!0,firstLineDecorationClassName:Te.asClassName(V3)});Ai.MANUALLY_COLLAPSED_VISUAL_DECORATION=et.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:Te.asClassName(KK)});Ai.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=et.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:z3,isWholeLine:!0,firstLineDecorationClassName:Te.asClassName(KK)});Ai.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=et.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0});Ai.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=et.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:z3,isWholeLine:!0});Ai.EXPANDED_VISUAL_DECORATION=et.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Te.asClassName(W3)});Ai.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=et.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:Te.asClassName(W3)});Ai.MANUALLY_EXPANDED_VISUAL_DECORATION=et.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Te.asClassName(YK)});Ai.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=et.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:Te.asClassName(YK)});Ai.NO_CONTROLS_EXPANDED_RANGE_DECORATION=et.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0});Ai.HIDDEN_RANGE_DECORATION=et.register({description:"folding-hidden-range-decoration",stickiness:1});const KNe={},YNe="syntax";class ZK{constructor(e,t,i,s,o){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=i,this.foldingRangesLimit=s,this.fallbackRangeProvider=o,this.id=YNe,this.disposables=new pe,o&&this.disposables.add(o);for(const r of t)typeof r.onDidChange=="function"&&this.disposables.add(r.onDidChange(i))}compute(e){return ZNe(this.providers,this.editorModel,e).then(t=>{var i,s;return t?QNe(t,this.foldingRangesLimit):(s=(i=this.fallbackRangeProvider)===null||i===void 0?void 0:i.compute(e))!==null&&s!==void 0?s:null})}dispose(){this.disposables.dispose()}}function ZNe(n,e,t){let i=null;const s=n.map((o,r)=>Promise.resolve(o.provideFoldingRanges(e,KNe,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:r,kind:c.kind})}},wc));return Promise.all(s).then(o=>i)}class XNe{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,i,s){if(e>qr||t>qr)return;const o=this._length;this._startIndexes[o]=e,this._endIndexes[o]=t,this._nestingLevels[o]=s,this._types[o]=i,this._length++,s<30&&(this._nestingLevelCounts[s]=(this._nestingLevelCounts[s]||0)+1)}toIndentRanges(){const e=this._foldingRangesLimit.limit;if(this._length<=e){this._foldingRangesLimit.update(this._length,!1);const t=new Uint32Array(this._length),i=new Uint32Array(this._length);for(let s=0;se){i=a;break}t+=l}}const s=new Uint32Array(e),o=new Uint32Array(e),r=[];for(let a=0,l=0;a{let l=r.start-a.start;return l===0&&(l=r.rank-a.rank),l}),i=new XNe(e);let s;const o=[];for(const r of t)if(!s)s=r,i.add(r.start,r.end,r.kind&&r.kind.value,o.length);else if(r.start>s.start)if(r.end<=s.end)o.push(s),s=r,i.add(r.start,r.end,r.kind&&r.kind.value,o.length);else{if(r.start>s.end){do s=o.pop();while(s&&r.start>s.end);s&&o.push(s),s=r}i.add(r.start,r.end,r.kind&&r.kind.value,o.length)}return i.toIndentRanges()}var JNe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},V0=function(n,e){return function(t,i){e(t,i,n)}},eRe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},Ig;const $n=new _e("foldingEnabled",!1);let Df=Ig=class extends Y{static get(e){return e.getContribution(Ig.ID)}static getFoldingRangeProviders(e,t){var i,s;const o=e.foldingRangeProvider.ordered(t);return(s=(i=Ig._foldingRangeSelector)===null||i===void 0?void 0:i.call(Ig,o,t))!==null&&s!==void 0?s:o}constructor(e,t,i,s,o,r){super(),this.contextKeyService=t,this.languageConfigurationService=i,this.languageFeaturesService=r,this.localToDispose=this._register(new pe),this.editor=e,this._foldingLimitReporter=new tRe(e);const a=this.editor.getOptions();this._isEnabled=a.get(43),this._useFoldingProviders=a.get(44)!=="indentation",this._unfoldOnClickAfterEndOfLine=a.get(48),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=a.get(46),this.updateDebounceInfo=o.for(r.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 Ai(e),this.foldingDecorationProvider.showFoldingControls=a.get(109),this.foldingDecorationProvider.showFoldingHighlights=a.get(45),this.foldingEnabled=$n.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel(()=>this.onModelChanged())),this._register(this.editor.onDidChangeConfiguration(l=>{if(l.hasChanged(43)&&(this._isEnabled=this.editor.getOptions().get(43),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),l.hasChanged(47)&&this.onModelChanged(),l.hasChanged(109)||l.hasChanged(45)){const c=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=c.get(109),this.foldingDecorationProvider.showFoldingHighlights=c.get(45),this.triggerFoldingModelChanged()}l.hasChanged(44)&&(this._useFoldingProviders=this.editor.getOptions().get(44)!=="indentation",this.onFoldingStrategyChanged()),l.hasChanged(48)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(48)),l.hasChanged(46)&&(this._foldingImportsByDefault=this.editor.getOptions().get(46))})),this.onModelChanged()}saveViewState(){const e=this.editor.getModel();if(!e||!this._isEnabled||e.isTooLargeForTokenization())return{};if(this.foldingModel){const t=this.foldingModel.getMemento(),i=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:i,foldedImports:this._currentModelHasFoldedImports}}}restoreViewState(e){const t=this.editor.getModel();if(!(!t||!this._isEnabled||t.isTooLargeForTokenization()||!this.hiddenRangeModel)&&e&&(this._currentModelHasFoldedImports=!!e.foldedImports,e.collapsedRegions&&e.collapsedRegions.length>0&&this.foldingModel)){this._restoringViewState=!0;try{this.foldingModel.applyMemento(e.collapsedRegions)}finally{this._restoringViewState=!1}}}onModelChanged(){this.localToDispose.clear();const e=this.editor.getModel();!this._isEnabled||!e||e.isTooLargeForTokenization()||(this._currentModelHasFoldedImports=!1,this.foldingModel=new RNe(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new VNe(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new Du(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new Di(()=>this.revealCursor(),200),this.localToDispose.add(this.cursorChangedScheduler),this.localToDispose.add(this.languageFeaturesService.foldingRangeProvider.onDidChange(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelContent(t=>this.onDidChangeModelContent(t))),this.localToDispose.add(this.editor.onDidChangeCursorPosition(()=>this.onCursorPositionChanged())),this.localToDispose.add(this.editor.onMouseDown(t=>this.onEditorMouseDown(t))),this.localToDispose.add(this.editor.onMouseUp(t=>this.onEditorMouseUp(t))),this.localToDispose.add({dispose:()=>{var t,i;this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),(t=this.updateScheduler)===null||t===void 0||t.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,(i=this.rangeProvider)===null||i===void 0||i.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){var e;(e=this.rangeProvider)===null||e===void 0||e.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;const t=new GK(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const i=Ig.getFoldingRangeProviders(this.languageFeaturesService,e);i.length>0&&(this.rangeProvider=new ZK(e,i,()=>this.triggerFoldingModelChanged(),this._foldingLimitReporter,t))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){var t;(t=this.hiddenRangeModel)===null||t===void 0||t.notifyChangeModelContent(e),this.triggerFoldingModelChanged()}triggerFoldingModelChanged(){this.updateScheduler&&(this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.foldingModelPromise=this.updateScheduler.trigger(()=>{const e=this.foldingModel;if(!e)return null;const t=new Cu,i=this.getRangeProvider(e.textModel),s=this.foldingRegionPromise=xc(o=>i.compute(o));return s.then(o=>{if(o&&s===this.foldingRegionPromise){let r;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const d=o.setCollapsedAllOfType(cs.Imports.value,!0);d&&(r=Rv.capture(this.editor),this._currentModelHasFoldedImports=d)}const a=this.editor.getSelections(),l=a?a.map(d=>d.startLineNumber):[];e.update(o,l),r==null||r.restore(this.editor);const c=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=c)}return e})}).then(void 0,e=>(_t(e),null)))}onHiddenRangesChanges(e){if(this.hiddenRangeModel&&e.length&&!this._restoringViewState){const t=this.editor.getSelections();t&&this.hiddenRangeModel.adjustSelections(t)&&this.editor.setSelections(t)}this.editor.setHiddenAreas(e,this)}onCursorPositionChanged(){this.hiddenRangeModel&&this.hiddenRangeModel.hasRanges()&&this.cursorChangedScheduler.schedule()}revealCursor(){const e=this.getFoldingModel();e&&e.then(t=>{if(t){const i=this.editor.getSelections();if(i&&i.length>0){const s=[];for(const o of i){const r=o.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(r)&&s.push(...t.getAllRegionsAtLine(r,a=>a.isCollapsed&&r>a.startLineNumber))}s.length&&(t.toggleCollapseState(s),this.reveal(i[0].getPosition()))}}}).then(void 0,_t)}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 s=e.target.detail,o=e.target.element.offsetLeft;if(s.offsetX-o<4)return;i=!0;break}case 7:{if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return}case 6:{if(this.hiddenRangeModel.hasRanges()){const s=this.editor.getModel();if(s&&t.startColumn===s.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,s=this.mouseDownInfo.iconClicked,o=e.target.range;if(!o||o.startLineNumber!==i)return;if(s){if(e.target.type!==4)return}else{const a=this.editor.getModel();if(!a||o.startColumn!==a.getLineMaxColumn(i))return}const r=t.getRegionAtLine(i);if(r&&r.startLineNumber===i){const a=r.isCollapsed;if(s||a){const l=e.event.altKey;let c=[];if(l){const d=h=>!h.containedBy(r)&&!r.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(r))u.isCollapsed===a&&c.push(u);(a||!d||c.length===0)&&c.push(r)}t.toggleCollapseState(c),this.reveal({lineNumber:i,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}};Df.ID="editor.contrib.folding";Df=Ig=JNe([V0(1,tt),V0(2,ao),V0(3,Dn),V0(4,rG),V0(5,nt)],Df);class tRe{constructor(e){this.editor=e,this._onDidChange=new B,this._computed=0,this._limited=!1}get limit(){return this.editor.getOptions().get(47)}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}class ts extends Jt{runEditorCommand(e,t,i){const s=e.get(ao),o=Df.get(t);if(!o)return;const r=o.getFoldingModel();if(r)return this.reportTelemetry(e,t),r.then(a=>{if(a){this.invoke(o,a,t,i,s);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 XK(n){if(!Ks(n)){if(!Ds(n))return!1;const e=n;if(!Ks(e.levels)&&!Qd(e.levels)||!Ks(e.direction)&&!Ms(e.direction)||!Ks(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(Qd)))return!1}return!0}class iRe extends ts{constructor(){super({id:"editor.unfold",label:m("unfoldAction.label","Unfold"),alias:"Unfold",precondition:$n,kbOpts:{kbExpr:$.editorTextFocus,primary:3166,mac:{primary:2654},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: + *-----------------------------------------------------------------------------*/var zNe=Object.defineProperty,HNe=Object.getOwnPropertyDescriptor,$Ne=Object.getOwnPropertyNames,UNe=Object.prototype.hasOwnProperty,jNe=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of $Ne(e))!UNe.call(n,s)&&s!==t&&zNe(n,s,{get:()=>e[s],enumerable:!(i=HNe(e,s))||i.enumerable});return n},qNe=(n,e,t)=>(jNe(n,e,"default"),t),my={};qNe(my,ANe);var GNe=class{constructor(n,e,t){Ei(this,"_onDidChange",new my.Emitter);Ei(this,"_diagnosticsOptions");Ei(this,"_modeConfiguration");Ei(this,"_languageId");this._languageId=n,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(n){this._diagnosticsOptions=n||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(n){this._modeConfiguration=n||Object.create(null),this._onDidChange.fire(this)}},KNe={validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},YNe={documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0},jK=new GNe("json",KNe,YNe);my.languages.json={jsonDefaults:jK};function ZNe(){return Zn(()=>import("./jsonMode-hN_PqfqK.js"),[],import.meta.url)}my.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]});my.languages.onLanguage("json",()=>{ZNe().then(n=>n.setupMode(jK))});const XNe={0:" ",1:"u",2:"r"},lB=65535,jr=16777215,cB=4278190080;class pE{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<lB)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new pE(e.length),this._userDefinedStates=new pE(e.length),this._recoveredStates=new pE(e.length),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(i,s)=>{const o=e[e.length-1];return this.getStartLineNumber(o)<=i&&this.getEndLineNumber(o)>=s};for(let i=0,s=this._startIndexes.length;ijr||r>jr)throw new Error("startLineNumber or endLineNumber must not exceed "+jr);for(;e.length>0&&!t(o,r);)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]=r+((a&65280)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&jr}getEndLineNumber(e){return this._endIndexes[e]&jr}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 s=0;s>>24)+((this._endIndexes[e]&cB)>>>16);return t===lB?-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=0){if(this.getEndLineNumber(t)>=e)return t;for(t=this.getParentIndex(t);t!==-1;){if(this.contains(t,e))return t;t=this.getParentIndex(t)}}return-1}toString(){const e=[];for(let t=0;tArray.isArray(p)?v=>v<_?p[v]:void 0:v=>v<_?p.toFoldRange(v):void 0,o=s(e,e.length),r=s(t,t.length);let a=0,l=0,c=o(0),d=r(0);const u=[];let h,f=0;const g=[];for(;c||d;){let p;if(d&&(!c||c.startLineNumber>=d.startLineNumber))c&&c.startLineNumber===d.startLineNumber?(d.source===1?p=d:(p=c,p.isCollapsed=d.isCollapsed&&c.endLineNumber===d.endLineNumber,p.source=0),c=o(++a)):(p=d,d.isCollapsed&&d.source===0&&(p.source=2)),d=r(++l);else{let _=l,v=d;for(;;){if(!v||v.startLineNumber>c.endLineNumber){p=c;break}if(v.source===1&&v.endLineNumber>c.endLineNumber)break;v=r(++_)}c=o(++a)}if(p){for(;h&&h.endLineNumberp.startLineNumber&&p.startLineNumber>f&&p.endLineNumber<=i&&(!h||h.endLineNumber>=p.endLineNumber)&&(g.push(p),f=p.startLineNumber,h&&u.push(h),h=p)}}return g}}class QNe{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 JNe{get regions(){return this._regions}get textModel(){return this._textModel}constructor(e,t){this._updateEventEmitter=new B,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new fo(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[]}toggleCollapseState(e){if(!e.length)return;e=e.sort((i,s)=>i.regionIndex-s.regionIndex);const t={};this._decorationProvider.changeDecorations(i=>{let s=0,o=-1,r=-1;const a=l=>{for(;sr&&(r=c),s++}};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=s=>{for(const o of e)if(!(o.startLineNumber>s.endLineNumber||s.startLineNumber>o.endLineNumber))return!0;return!1};for(let s=0;si&&(i=a)}this._decorationProvider.changeDecorations(s=>this._editorDecorationIds=s.deltaDecorations(this._editorDecorationIds,t)),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e=[]){const t=(s,o)=>{for(const r of e)if(s=r.endLineNumber||r.startLineNumber<1||r.endLineNumber>i)continue;const a=this._getLinesChecksum(r.startLineNumber+1,r.endLineNumber);t.push({startLineNumber:r.startLineNumber,endLineNumber:r.endLineNumber,isCollapsed:r.isCollapsed,source:r.source,checksum:a})}return t.length>0?t:void 0}applyMemento(e){var t,i;if(!Array.isArray(e))return;const s=[],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)&&s.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 r=fo.sanitizeAndMerge(this._regions,s,o);this.updatePost(fo.fromFoldRanges(r))}_getLinesChecksum(e,t){return K0e(this._textModel.getLineContent(e)+this._textModel.getLineContent(t))%1e6}dispose(){this._decorationProvider.removeDecorations(this._editorDecorationIds)}getAllRegionsAtLine(e,t){const i=[];if(this._regions){let s=this._regions.findRange(e),o=1;for(;s>=0;){const r=this._regions.toRegion(s);(!t||t(r,o))&&i.push(r),o++,s=r.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=[],s=e?e.regionIndex+1:0,o=e?e.endLineNumber:Number.MAX_VALUE;if(t&&t.length===2){const r=[];for(let a=s,l=this._regions.length;a0&&!c.containedBy(r[r.length-1]);)r.pop();r.push(c),t(c,r.length)&&i.push(c)}else break}}else for(let r=s,a=this._regions.length;r0)for(const o of i){const r=n.getRegionAtLine(o);if(r&&(r.isCollapsed!==e&&s.push(r),t>1)){const a=n.getRegionsInside(r,(l,c)=>l.isCollapsed!==e&&cr.isCollapsed!==e&&aa.isCollapsed!==e&&l<=t);s.push(...r)}n.toggleCollapseState(s)}function tRe(n,e,t){const i=[];for(const s of t){const o=n.getAllRegionsAtLine(s,r=>r.isCollapsed!==e);o.length>0&&i.push(o[0])}n.toggleCollapseState(i)}function iRe(n,e,t,i){const s=(r,a)=>a===e&&r.isCollapsed!==t&&!i.some(l=>r.containsLine(l)),o=n.getRegionsInside(null,s);n.toggleCollapseState(o)}function GK(n,e,t){const i=[];for(const r of t){const a=n.getAllRegionsAtLine(r,void 0);a.length>0&&i.push(a[0])}const s=r=>i.every(a=>!a.containedBy(r)&&!r.containedBy(a))&&r.isCollapsed!==e,o=n.getRegionsInside(null,s);n.toggleCollapseState(o)}function PP(n,e,t){const i=n.textModel,s=n.regions,o=[];for(let r=s.length-1;r>=0;r--)if(t!==s.isCollapsed(r)){const a=s.getStartLineNumber(r);e.test(i.getLineContent(a))&&o.push(s.toRegion(r))}n.toggleCollapseState(o)}function OP(n,e,t){const i=n.regions,s=[];for(let o=i.length-1;o>=0;o--)t!==i.isCollapsed(o)&&e===i.getType(o)&&s.push(i.toRegion(o));n.toggleCollapseState(s)}function nRe(n,e){let t=null;const i=e.getRegionAtLine(n);if(i!==null&&(t=i.startLineNumber,n===t)){const s=i.parentIndex;s!==-1?t=e.regions.getStartLineNumber(s):t=null}return t}function sRe(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){if(n!==t.startLineNumber)return t.startLineNumber;{const i=t.parentIndex;let s=0;for(i!==-1&&(s=e.regions.getStartLineNumber(t.parentIndex));t!==null;)if(t.regionIndex>0){if(t=e.regions.toRegion(t.regionIndex-1),t.startLineNumber<=s)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.startLineNumber0?t=e.regions.toRegion(t.regionIndex-1):t=null}return null}function oRe(n,e){let t=e.getRegionAtLine(n);if(t!==null&&t.startLineNumber===n){const i=t.parentIndex;let s=0;if(i!==-1)s=e.regions.getEndLineNumber(t.parentIndex);else{if(e.regions.length===0)return null;s=e.regions.getEndLineNumber(e.regions.length-1)}for(;t!==null;)if(t.regionIndex=s)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>n)return t.startLineNumber;t.regionIndexthis.updateHiddenRanges()),this._hiddenRanges=[],e.regions.length&&this.updateHiddenRanges()}notifyChangeModelContent(e){this._hiddenRanges.length&&!this._hasLineChanges&&(this._hasLineChanges=e.changes.some(t=>t.range.endLineNumber!==t.range.startLineNumber||Lf(t.text)[0]!==0))}updateHiddenRanges(){let e=!1;const t=[];let i=0,s=0,o=Number.MAX_VALUE,r=-1;const a=this._foldingModel.regions;for(;i0}isHidden(e){return dB(this._hiddenRanges,e)!==null}adjustSelections(e){let t=!1;const i=this._foldingModel.textModel;let s=null;const o=r=>((!s||!aRe(r,s))&&(s=dB(this._hiddenRanges,r)),s?s.startLineNumber-1:null);for(let r=0,a=e.length;r0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function aRe(n,e){return n>=e.startLineNumber&&n<=e.endLineNumber}function dB(n,e){const t=Xb(n,i=>e=0&&n[t].endLineNumber>=e?n[t]:null}const lRe=5e3,cRe="indent";class KK{constructor(e,t,i){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=i,this.id=cRe}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,i=t&&!!t.offSide,s=t&&t.markers;return Promise.resolve(hRe(this.editorModel,i,s,this.foldingRangesLimit))}}let dRe=class{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>jr||t>jr)return;const s=this._length;this._startIndexes[s]=e,this._endIndexes[s]=t,this._length++,i<1e3&&(this._indentOccurrences[i]=(this._indentOccurrences[i]||0)+1)}toIndentRanges(e){const t=this._foldingRangesLimit.limit;if(this._length<=t){this._foldingRangesLimit.update(this._length,!1);const i=new Uint32Array(this._length),s=new Uint32Array(this._length);for(let o=this._length-1,r=0;o>=0;o--,r++)i[r]=this._startIndexes[o],s[r]=this._endIndexes[o];return new fo(i,s)}else{this._foldingRangesLimit.update(this._length,t);let i=0,s=this._indentOccurrences.length;for(let l=0;lt){s=l;break}i+=c}}const o=e.getOptions().tabSize,r=new Uint32Array(t),a=new Uint32Array(t);for(let l=this._length-1,c=0;l>=0;l--){const d=this._startIndexes[l],u=e.getLineContent(d),h=mD(u,o);(h{}};function hRe(n,e,t,i=uRe){const s=n.getOptions().tabSize,o=new dRe(i);let r;t&&(r=new RegExp(`(${t.start.source})|(?:${t.end.source})`));const a=[],l=n.getLineCount()+1;a.push({indent:-1,endAbove:l,line:l});for(let c=n.getLineCount();c>0;c--){const d=n.getLineContent(c),u=mD(d,s);let h=a[a.length-1];if(u===-1){e&&(h.endAbove=c);continue}let f;if(r&&(f=d.match(r)))if(f[1]){let g=a.length-1;for(;g>0&&a[g].indent!==-2;)g--;if(g>0){a.length=g+1,h=a[g],o.insertFirst(c,h.line,u),h.line=c,h.indent=u,h.endAbove=c;continue}}else{a.push({indent:-2,endAbove:c,line:c});continue}if(h.indent>u){do a.pop(),h=a[a.length-1];while(h.indent>u);const g=h.endAbove-1;g-c>=1&&o.insertFirst(c,g,u)}h.indent===u?h.endAbove=c:a.push({indent:u,endAbove:c,line:c})}return o.toIndentRanges(n)}const fRe=E("editor.foldBackground",{light:we(fd,.3),dark:we(fd,.3),hcDark:null,hcLight:null},m("foldBackgroundBackground","Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);E("editorGutter.foldingControlForeground",{dark:hd,light:hd,hcDark:hd,hcLight:hd},m("editorGutter.foldingControlForeground","Color of the folding control in the editor gutter."));const FP=Zi("folding-expanded",se.chevronDown,m("foldingExpandedIcon","Icon for expanded ranges in the editor glyph margin.")),BP=Zi("folding-collapsed",se.chevronRight,m("foldingCollapsedIcon","Icon for collapsed ranges in the editor glyph margin.")),YK=Zi("folding-manual-collapsed",BP,m("foldingManualCollapedIcon","Icon for manually collapsed ranges in the editor glyph margin.")),ZK=Zi("folding-manual-expanded",FP,m("foldingManualExpandedIcon","Icon for manually expanded ranges in the editor glyph margin.")),WP={color:sn(fRe),position:Zs.Inline};class Ai{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,i){return t?Ai.HIDDEN_RANGE_DECORATION:this.showFoldingControls==="never"?e?this.showFoldingHighlights?Ai.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:Ai.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:Ai.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?i?this.showFoldingHighlights?Ai.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ai.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?Ai.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:Ai.COLLAPSED_VISUAL_DECORATION:this.showFoldingControls==="mouseover"?i?Ai.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:Ai.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:i?Ai.MANUALLY_EXPANDED_VISUAL_DECORATION:Ai.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}}Ai.COLLAPSED_VISUAL_DECORATION=Je.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:Te.asClassName(BP)});Ai.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Je.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:WP,isWholeLine:!0,firstLineDecorationClassName:Te.asClassName(BP)});Ai.MANUALLY_COLLAPSED_VISUAL_DECORATION=Je.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:Te.asClassName(YK)});Ai.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Je.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:WP,isWholeLine:!0,firstLineDecorationClassName:Te.asClassName(YK)});Ai.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=Je.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0});Ai.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=Je.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:WP,isWholeLine:!0});Ai.EXPANDED_VISUAL_DECORATION=Je.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Te.asClassName(FP)});Ai.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Je.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:Te.asClassName(FP)});Ai.MANUALLY_EXPANDED_VISUAL_DECORATION=Je.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+Te.asClassName(ZK)});Ai.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Je.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:Te.asClassName(ZK)});Ai.NO_CONTROLS_EXPANDED_RANGE_DECORATION=Je.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0});Ai.HIDDEN_RANGE_DECORATION=Je.register({description:"folding-hidden-range-decoration",stickiness:1});const gRe={},pRe="syntax";class XK{constructor(e,t,i,s,o){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=i,this.foldingRangesLimit=s,this.fallbackRangeProvider=o,this.id=pRe,this.disposables=new pe,o&&this.disposables.add(o);for(const r of t)typeof r.onDidChange=="function"&&this.disposables.add(r.onDidChange(i))}compute(e){return mRe(this.providers,this.editorModel,e).then(t=>{var i,s;return t?bRe(t,this.foldingRangesLimit):(s=(i=this.fallbackRangeProvider)===null||i===void 0?void 0:i.compute(e))!==null&&s!==void 0?s:null})}dispose(){this.disposables.dispose()}}function mRe(n,e,t){let i=null;const s=n.map((o,r)=>Promise.resolve(o.provideFoldingRanges(e,gRe,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:r,kind:c.kind})}},wc));return Promise.all(s).then(o=>i)}class _Re{constructor(e){this._startIndexes=[],this._endIndexes=[],this._nestingLevels=[],this._nestingLevelCounts=[],this._types=[],this._length=0,this._foldingRangesLimit=e}add(e,t,i,s){if(e>jr||t>jr)return;const o=this._length;this._startIndexes[o]=e,this._endIndexes[o]=t,this._nestingLevels[o]=s,this._types[o]=i,this._length++,s<30&&(this._nestingLevelCounts[s]=(this._nestingLevelCounts[s]||0)+1)}toIndentRanges(){const e=this._foldingRangesLimit.limit;if(this._length<=e){this._foldingRangesLimit.update(this._length,!1);const t=new Uint32Array(this._length),i=new Uint32Array(this._length);for(let s=0;se){i=a;break}t+=l}}const s=new Uint32Array(e),o=new Uint32Array(e),r=[];for(let a=0,l=0;a{let l=r.start-a.start;return l===0&&(l=r.rank-a.rank),l}),i=new _Re(e);let s;const o=[];for(const r of t)if(!s)s=r,i.add(r.start,r.end,r.kind&&r.kind.value,o.length);else if(r.start>s.start)if(r.end<=s.end)o.push(s),s=r,i.add(r.start,r.end,r.kind&&r.kind.value,o.length);else{if(r.start>s.end){do s=o.pop();while(s&&r.start>s.end);s&&o.push(s),s=r}i.add(r.start,r.end,r.kind&&r.kind.value,o.length)}return i.toIndentRanges()}var vRe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},U0=function(n,e){return function(t,i){e(t,i,n)}},yRe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},Rg;const Vn=new _e("foldingEnabled",!1);let Af=Rg=class extends Y{static get(e){return e.getContribution(Rg.ID)}static getFoldingRangeProviders(e,t){var i,s;const o=e.foldingRangeProvider.ordered(t);return(s=(i=Rg._foldingRangeSelector)===null||i===void 0?void 0:i.call(Rg,o,t))!==null&&s!==void 0?s:o}constructor(e,t,i,s,o,r){super(),this.contextKeyService=t,this.languageConfigurationService=i,this.languageFeaturesService=r,this.localToDispose=this._register(new pe),this.editor=e,this._foldingLimitReporter=new wRe(e);const a=this.editor.getOptions();this._isEnabled=a.get(43),this._useFoldingProviders=a.get(44)!=="indentation",this._unfoldOnClickAfterEndOfLine=a.get(48),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=a.get(46),this.updateDebounceInfo=o.for(r.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 Ai(e),this.foldingDecorationProvider.showFoldingControls=a.get(109),this.foldingDecorationProvider.showFoldingHighlights=a.get(45),this.foldingEnabled=Vn.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel(()=>this.onModelChanged())),this._register(this.editor.onDidChangeConfiguration(l=>{if(l.hasChanged(43)&&(this._isEnabled=this.editor.getOptions().get(43),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),l.hasChanged(47)&&this.onModelChanged(),l.hasChanged(109)||l.hasChanged(45)){const c=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=c.get(109),this.foldingDecorationProvider.showFoldingHighlights=c.get(45),this.triggerFoldingModelChanged()}l.hasChanged(44)&&(this._useFoldingProviders=this.editor.getOptions().get(44)!=="indentation",this.onFoldingStrategyChanged()),l.hasChanged(48)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(48)),l.hasChanged(46)&&(this._foldingImportsByDefault=this.editor.getOptions().get(46))})),this.onModelChanged()}saveViewState(){const e=this.editor.getModel();if(!e||!this._isEnabled||e.isTooLargeForTokenization())return{};if(this.foldingModel){const t=this.foldingModel.getMemento(),i=this.rangeProvider?this.rangeProvider.id:void 0;return{collapsedRegions:t,lineCount:e.getLineCount(),provider:i,foldedImports:this._currentModelHasFoldedImports}}}restoreViewState(e){const t=this.editor.getModel();if(!(!t||!this._isEnabled||t.isTooLargeForTokenization()||!this.hiddenRangeModel)&&e&&(this._currentModelHasFoldedImports=!!e.foldedImports,e.collapsedRegions&&e.collapsedRegions.length>0&&this.foldingModel)){this._restoringViewState=!0;try{this.foldingModel.applyMemento(e.collapsedRegions)}finally{this._restoringViewState=!1}}}onModelChanged(){this.localToDispose.clear();const e=this.editor.getModel();!this._isEnabled||!e||e.isTooLargeForTokenization()||(this._currentModelHasFoldedImports=!1,this.foldingModel=new JNe(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new rRe(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange(t=>this.onHiddenRangesChanges(t))),this.updateScheduler=new ku(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new Li(()=>this.revealCursor(),200),this.localToDispose.add(this.cursorChangedScheduler),this.localToDispose.add(this.languageFeaturesService.foldingRangeProvider.onDidChange(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelLanguageConfiguration(()=>this.onFoldingStrategyChanged())),this.localToDispose.add(this.editor.onDidChangeModelContent(t=>this.onDidChangeModelContent(t))),this.localToDispose.add(this.editor.onDidChangeCursorPosition(()=>this.onCursorPositionChanged())),this.localToDispose.add(this.editor.onMouseDown(t=>this.onEditorMouseDown(t))),this.localToDispose.add(this.editor.onMouseUp(t=>this.onEditorMouseUp(t))),this.localToDispose.add({dispose:()=>{var t,i;this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),(t=this.updateScheduler)===null||t===void 0||t.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,(i=this.rangeProvider)===null||i===void 0||i.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){var e;(e=this.rangeProvider)===null||e===void 0||e.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;const t=new KK(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const i=Rg.getFoldingRangeProviders(this.languageFeaturesService,e);i.length>0&&(this.rangeProvider=new XK(e,i,()=>this.triggerFoldingModelChanged(),this._foldingLimitReporter,t))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){var t;(t=this.hiddenRangeModel)===null||t===void 0||t.notifyChangeModelContent(e),this.triggerFoldingModelChanged()}triggerFoldingModelChanged(){this.updateScheduler&&(this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),this.foldingModelPromise=this.updateScheduler.trigger(()=>{const e=this.foldingModel;if(!e)return null;const t=new Su,i=this.getRangeProvider(e.textModel),s=this.foldingRegionPromise=xc(o=>i.compute(o));return s.then(o=>{if(o&&s===this.foldingRegionPromise){let r;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const d=o.setCollapsedAllOfType(as.Imports.value,!0);d&&(r=Pv.capture(this.editor),this._currentModelHasFoldedImports=d)}const a=this.editor.getSelections(),l=a?a.map(d=>d.startLineNumber):[];e.update(o,l),r==null||r.restore(this.editor);const c=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=c)}return e})}).then(void 0,e=>(mt(e),null)))}onHiddenRangesChanges(e){if(this.hiddenRangeModel&&e.length&&!this._restoringViewState){const t=this.editor.getSelections();t&&this.hiddenRangeModel.adjustSelections(t)&&this.editor.setSelections(t)}this.editor.setHiddenAreas(e,this)}onCursorPositionChanged(){this.hiddenRangeModel&&this.hiddenRangeModel.hasRanges()&&this.cursorChangedScheduler.schedule()}revealCursor(){const e=this.getFoldingModel();e&&e.then(t=>{if(t){const i=this.editor.getSelections();if(i&&i.length>0){const s=[];for(const o of i){const r=o.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(r)&&s.push(...t.getAllRegionsAtLine(r,a=>a.isCollapsed&&r>a.startLineNumber))}s.length&&(t.toggleCollapseState(s),this.reveal(i[0].getPosition()))}}}).then(void 0,mt)}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 s=e.target.detail,o=e.target.element.offsetLeft;if(s.offsetX-o<4)return;i=!0;break}case 7:{if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()&&!e.target.detail.isAfterLines)break;return}case 6:{if(this.hiddenRangeModel.hasRanges()){const s=this.editor.getModel();if(s&&t.startColumn===s.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,s=this.mouseDownInfo.iconClicked,o=e.target.range;if(!o||o.startLineNumber!==i)return;if(s){if(e.target.type!==4)return}else{const a=this.editor.getModel();if(!a||o.startColumn!==a.getLineMaxColumn(i))return}const r=t.getRegionAtLine(i);if(r&&r.startLineNumber===i){const a=r.isCollapsed;if(s||a){const l=e.event.altKey;let c=[];if(l){const d=h=>!h.containedBy(r)&&!r.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(r))u.isCollapsed===a&&c.push(u);(a||!d||c.length===0)&&c.push(r)}t.toggleCollapseState(c),this.reveal({lineNumber:i,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}};Af.ID="editor.contrib.folding";Af=Rg=vRe([U0(1,et),U0(2,so),U0(3,xn),U0(4,oG),U0(5,it)],Af);class wRe{constructor(e){this.editor=e,this._onDidChange=new B,this._computed=0,this._limited=!1}get limit(){return this.editor.getOptions().get(47)}update(e,t){(e!==this._computed||t!==this._limited)&&(this._computed=e,this._limited=t,this._onDidChange.fire())}}class Jn extends Qt{runEditorCommand(e,t,i){const s=e.get(so),o=Af.get(t);if(!o)return;const r=o.getFoldingModel();if(r)return this.reportTelemetry(e,t),r.then(a=>{if(a){this.invoke(o,a,t,i,s);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 QK(n){if(!qs(n)){if(!Ls(n))return!1;const e=n;if(!qs(e.levels)&&!Jd(e.levels)||!qs(e.direction)&&!Rs(e.direction)||!qs(e.selectionLines)&&(!Array.isArray(e.selectionLines)||!e.selectionLines.every(Jd)))return!1}return!0}class CRe extends Jn{constructor(){super({id:"editor.unfold",label:m("unfoldAction.label","Unfold"),alias:"Unfold",precondition:Vn,kbOpts:{kbExpr:$.editorTextFocus,primary:3166,mac:{primary:2654},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:XK,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,s){const o=s&&s.levels||1,r=this.getLineNumbers(s,i);s&&s.direction==="up"?jK(t,!1,o,r):d0(t,!1,o,r)}}class nRe extends ts{constructor(){super({id:"editor.unfoldRecursively",label:m("unFoldRecursivelyAction.label","Unfold Recursively"),alias:"Unfold Recursively",precondition:$n,kbOpts:{kbExpr:$.editorTextFocus,primary:Bn(2089,2142),weight:100}})}invoke(e,t,i,s){d0(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}}class sRe extends ts{constructor(){super({id:"editor.fold",label:m("foldAction.label","Fold"),alias:"Fold",precondition:$n,kbOpts:{kbExpr:$.editorTextFocus,primary:3164,mac:{primary:2652},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: + `,constraint:QK,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,s){const o=s&&s.levels||1,r=this.getLineNumbers(s,i);s&&s.direction==="up"?qK(t,!1,o,r):g0(t,!1,o,r)}}class SRe extends Jn{constructor(){super({id:"editor.unfoldRecursively",label:m("unFoldRecursivelyAction.label","Unfold Recursively"),alias:"Unfold Recursively",precondition:Vn,kbOpts:{kbExpr:$.editorTextFocus,primary:Pn(2089,2142),weight:100}})}invoke(e,t,i,s){g0(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}}class xRe extends Jn{constructor(){super({id:"editor.fold",label:m("foldAction.label","Fold"),alias:"Fold",precondition:Vn,kbOpts:{kbExpr:$.editorTextFocus,primary:3164,mac:{primary:2652},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:XK,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,s){const o=this.getLineNumbers(s,i),r=s&&s.levels,a=s&&s.direction;typeof r!="number"&&typeof a!="string"?PNe(t,!0,o):a==="up"?jK(t,!0,r||1,o):d0(t,!0,r||1,o)}}class oRe extends ts{constructor(){super({id:"editor.toggleFold",label:m("toggleFoldAction.label","Toggle Fold"),alias:"Toggle Fold",precondition:$n,kbOpts:{kbExpr:$.editorTextFocus,primary:Bn(2089,2090),weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);MNe(t,1,s)}}class rRe extends ts{constructor(){super({id:"editor.foldRecursively",label:m("foldRecursivelyAction.label","Fold Recursively"),alias:"Fold Recursively",precondition:$n,kbOpts:{kbExpr:$.editorTextFocus,primary:Bn(2089,2140),weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);d0(t,!0,Number.MAX_VALUE,s)}}class aRe extends ts{constructor(){super({id:"editor.foldAllBlockComments",label:m("foldAllBlockComments.label","Fold All Block Comments"),alias:"Fold All Block Comments",precondition:$n,kbOpts:{kbExpr:$.editorTextFocus,primary:Bn(2089,2138),weight:100}})}invoke(e,t,i,s,o){if(t.regions.hasTypes())B3(t,cs.Comment.value,!0);else{const r=i.getModel();if(!r)return;const a=o.getLanguageConfiguration(r.getLanguageId()).comments;if(a&&a.blockCommentStartToken){const l=new RegExp("^\\s*"+xr(a.blockCommentStartToken));F3(t,l,!0)}}}}class lRe extends ts{constructor(){super({id:"editor.foldAllMarkerRegions",label:m("foldAllMarkerRegions.label","Fold All Regions"),alias:"Fold All Regions",precondition:$n,kbOpts:{kbExpr:$.editorTextFocus,primary:Bn(2089,2077),weight:100}})}invoke(e,t,i,s,o){if(t.regions.hasTypes())B3(t,cs.Region.value,!0);else{const r=i.getModel();if(!r)return;const a=o.getLanguageConfiguration(r.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);F3(t,l,!0)}}}}class cRe extends ts{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:m("unfoldAllMarkerRegions.label","Unfold All Regions"),alias:"Unfold All Regions",precondition:$n,kbOpts:{kbExpr:$.editorTextFocus,primary:Bn(2089,2078),weight:100}})}invoke(e,t,i,s,o){if(t.regions.hasTypes())B3(t,cs.Region.value,!1);else{const r=i.getModel();if(!r)return;const a=o.getLanguageConfiguration(r.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);F3(t,l,!1)}}}}class dRe extends ts{constructor(){super({id:"editor.foldAllExcept",label:m("foldAllExcept.label","Fold All Except Selected"),alias:"Fold All Except Selected",precondition:$n,kbOpts:{kbExpr:$.editorTextFocus,primary:Bn(2089,2136),weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);qK(t,!0,s)}}class uRe extends ts{constructor(){super({id:"editor.unfoldAllExcept",label:m("unfoldAllExcept.label","Unfold All Except Selected"),alias:"Unfold All Except Selected",precondition:$n,kbOpts:{kbExpr:$.editorTextFocus,primary:Bn(2089,2134),weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);qK(t,!1,s)}}class hRe extends ts{constructor(){super({id:"editor.foldAll",label:m("foldAllAction.label","Fold All"),alias:"Fold All",precondition:$n,kbOpts:{kbExpr:$.editorTextFocus,primary:Bn(2089,2069),weight:100}})}invoke(e,t,i){d0(t,!0)}}class fRe extends ts{constructor(){super({id:"editor.unfoldAll",label:m("unfoldAllAction.label","Unfold All"),alias:"Unfold All",precondition:$n,kbOpts:{kbExpr:$.editorTextFocus,primary:Bn(2089,2088),weight:100}})}invoke(e,t,i){d0(t,!1)}}class kf extends ts{getFoldingLevel(){return parseInt(this.id.substr(kf.ID_PREFIX.length))}invoke(e,t,i){ONe(t,this.getFoldingLevel(),!0,this.getSelectedLines(i))}}kf.ID_PREFIX="editor.foldLevel";kf.ID=n=>kf.ID_PREFIX+n;class gRe extends ts{constructor(){super({id:"editor.gotoParentFold",label:m("gotoParentFold.label","Go to Parent Fold"),alias:"Go to Parent Fold",precondition:$n,kbOpts:{kbExpr:$.editorTextFocus,weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);if(s.length>0){const o=FNe(s[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class pRe extends ts{constructor(){super({id:"editor.gotoPreviousFold",label:m("gotoPreviousFold.label","Go to Previous Folding Range"),alias:"Go to Previous Folding Range",precondition:$n,kbOpts:{kbExpr:$.editorTextFocus,weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);if(s.length>0){const o=BNe(s[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class mRe extends ts{constructor(){super({id:"editor.gotoNextFold",label:m("gotoNextFold.label","Go to Next Folding Range"),alias:"Go to Next Folding Range",precondition:$n,kbOpts:{kbExpr:$.editorTextFocus,weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);if(s.length>0){const o=WNe(s[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class _Re extends ts{constructor(){super({id:"editor.createFoldingRangeFromSelection",label:m("createManualFoldRange.label","Create Folding Range from Selection"),alias:"Create Folding Range from Selection",precondition:$n,kbOpts:{kbExpr:$.editorTextFocus,primary:Bn(2089,2135),weight:100}})}invoke(e,t,i){var s;const o=[],r=i.getSelections();if(r){for(const a of r){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=mo.sanitizeAndMerge(t.regions,o,(s=i.getModel())===null||s===void 0?void 0:s.getLineCount());t.updatePost(mo.fromFoldRanges(a))}}}}class bRe extends ts{constructor(){super({id:"editor.removeManualFoldingRanges",label:m("removeManualFoldingRanges.label","Remove Manual Folding Ranges"),alias:"Remove Manual Folding Ranges",precondition:$n,kbOpts:{kbExpr:$.editorTextFocus,primary:Bn(2089,2137),weight:100}})}invoke(e,t,i){const s=i.getSelections();if(s){const o=[];for(const r of s){const{startLineNumber:a,endLineNumber:l}=r;o.push(l>=a?{startLineNumber:a,endLineNumber:l}:{endLineNumber:l,startLineNumber:a})}t.removeManualRanges(o),e.triggerFoldingModelChanged()}}}Tr(Df.ID,Df,0);Xe(iRe);Xe(nRe);Xe(sRe);Xe(rRe);Xe(hRe);Xe(fRe);Xe(aRe);Xe(lRe);Xe(cRe);Xe(dRe);Xe(uRe);Xe(oRe);Xe(gRe);Xe(pRe);Xe(mRe);Xe(_Re);Xe(bRe);for(let n=1;n<=7;n++)Lme(new kf({id:kf.ID(n),label:m("foldLevelAction.label","Fold Level {0}",n),alias:`Fold Level ${n}`,precondition:$n,kbOpts:{kbExpr:$.editorTextFocus,primary:Bn(2089,2048|21+n),weight:100}}));Zt.registerCommand("_executeFoldingRangeProvider",function(n,...e){return eRe(this,void 0,void 0,function*(){const[t]=e;if(!(t instanceof je))throw oc();const i=n.get(nt),s=n.get(fs).getModel(t);if(!s)throw oc();const o=n.get(ni);if(!o.getValue("editor.folding",{resource:t}))return[];const r=n.get(ao),a=o.getValue("editor.foldingStrategy",{resource:t}),l={get limit(){return o.getValue("editor.foldingMaximumRegions",{resource:t})},update:(f,g)=>{}},c=new GK(s,r,l);let d=c;if(a!=="indentation"){const f=Df.getFoldingRangeProviders(i,s);f.length&&(d=new ZK(s,f,()=>{},l,c))}const u=yield d.compute(ln.None),h=[];try{if(u)for(let f=0;fthis._editor.getModel().getDecorationRange(t)).filter(t=>!!t);if(e.length)return e}return null}getStartPosition(){return this._startPosition}setStartPosition(e){this._startPosition=e,this.setCurrentFindMatch(null)}_getDecorationIndex(e){const t=this._decorations.indexOf(e);return t>=0?t+1:1}getDecorationRangeAt(e){const t=e{if(this._highlightedDecorationId!==null&&(s.changeDecorationOptions(this._highlightedDecorationId,Kn._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,s.changeDecorationOptions(this._highlightedDecorationId,Kn._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(s.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let o=this._editor.getModel().getDecorationRange(t);if(o.startLineNumber!==o.endLineNumber&&o.endColumn===1){const r=o.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(r);o=new N(o.startLineNumber,o.startColumn,r,a)}this._rangeHighlightDecorationId=s.addDecoration(o,Kn._RANGE_HIGHLIGHT_DECORATION)}}),i}set(e,t){this._editor.changeDecorations(i=>{let s=Kn._FIND_MATCH_DECORATION;const o=[];if(e.length>1e3){s=Kn._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 f=1,g=e.length;f=p.startLineNumber?p.endLineNumber>h&&(h=p.endLineNumber):(o.push({range:new N(u,1,h,1),options:Kn._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),u=p.startLineNumber,h=p.endLineNumber)}o.push({range:new N(u,1,h,1),options:Kn._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const r=new Array(e.length);for(let a=0,l=e.length;ai.removeDecoration(a)),this._findScopeDecorationIds=[]),t!=null&&t.length&&(this._findScopeDecorationIds=t.map(a=>i.addDecoration(a,Kn._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],s=this._editor.getModel().getDecorationRange(i);if(!(!s||s.endLineNumber>e.lineNumber)){if(s.endLineNumbere.column))return s}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let t=0,i=this._decorations.length;te.lineNumber)return o;if(!(o.startColumn0){const i=[];for(let r=0;rN.compareRangesUsingStarts(r.range,a.range));const s=[];let o=i[0];for(let r=1;r0?e[0].toUpperCase()+e.substr(1):n[0][0].toUpperCase()!==n[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function pB(n,e,t){return n[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&n[0].split(t).length===e.split(t).length}function mB(n,e,t){const i=e.split(t),s=n[0].split(t);let o="";return i.forEach((r,a)=>{o+=QK([s[a]],r)+t}),o.slice(0,-1)}class _B{constructor(e){this.staticValue=e,this.kind=0}}class yRe{constructor(e){this.pieces=e,this.kind=1}}class Wm{static fromStaticValue(e){return new Wm([sf.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){!e||e.length===0?this._state=new _B(""):e.length===1&&e[0].staticValue!==null?this._state=new _B(e[0].staticValue):this._state=new yRe(e)}buildReplaceString(e,t){if(this._state.kind===0)return t?QK(e,this._state.staticValue):this._state.staticValue;let i="";for(let s=0,o=this._state.pieces.length;s0){const l=[],c=r.caseOps.length;let d=0;for(let u=0,h=a.length;u=c){l.push(a.slice(u));break}switch(r.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=s)break;const r=n.charCodeAt(i);switch(r){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(r));break}continue}if(o===36){if(i++,i>=s)break;const r=n.charCodeAt(i);if(r===36){t.emitUnchanged(i-1),t.emitStatic("$",i+1);continue}if(r===48||r===38){t.emitUnchanged(i-1),t.emitMatchIndex(0,i+1,e),e.length=0;continue}if(49<=r&&r<=57){let a=r-48;if(i+1this.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,Bt(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)},SRe)):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 N(a.startLineNumber,1,l,this._editor.getModel().getLineMaxColumn(l))}return a}));const s=this._findMatches(i,!1,wd);this._decorations.set(s,i);const o=this._editor.getSelection();let r=this._decorations.getCurrentMatchesPosition(o);if(r===0&&s.length>0){const a=Yb(s.map(l=>l.range),l=>N.compareRangesUsingStarts(l,o)>=0);r=a>0?a-1+1:r}this._state.changeMatchInfo(r,this._decorations.getCount(),void 0),e&&this._editor.getOption(41).cursorMoveOnType&&this._moveToNextMatch(this._decorations.getStartPosition())}_hasMatches(){return this._state.matchesCount>0}_cannotFind(){if(!this._hasMatches()){const e=this._decorations.getFindScope();return e&&this._editor.revealRangeInCenterIfOutsideViewport(e,0),!0}return!1}_setCurrentFindMatch(e){const t=this._decorations.setCurrentFindMatch(e);this._state.changeMatchInfo(t,this._decorations.getCount(),e),this._editor.setSelection(e),this._editor.revealRangeInCenterIfOutsideViewport(e,0)}_prevSearchPosition(e){const t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:s}=e;const o=this._editor.getModel();return t||s===1?(i===1?i=o.getLineCount():i--,s=o.getLineMaxColumn(i)):s--,new V(i,s)}_moveToPrevMatch(e,t=!1){if(!this._state.canNavigateBack()){const d=this._decorations.matchAfterPosition(e);d&&this._setCurrentFindMatch(d);return}if(this._decorations.getCount()=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:s}=e;const o=this._editor.getModel();return t||s===o.getLineMaxColumn(i)?(i===o.getLineCount()?i=1:i++,s=1):s++,new V(i,s)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const i=this._decorations.matchBeforePosition(e);i&&this._setCurrentFindMatch(i);return}if(this._decorations.getCount()Q_._getSearchRange(this._editor.getModel(),o));return this._editor.getModel().findMatches(this._state.searchString,s,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null,t,i)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();e===null&&this._state.matchesCount>=wd?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const t=new ih(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):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 s=this._editor.getModel(),o=s.getValue(1),r=s.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 vq(r,l,this._editor.getSelection());this._executeEditorCommand("replaceAll",d)}_regularReplaceAll(e){const t=this._getReplacePattern(),i=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,1073741824),s=[];for(let r=0,a=i.length;rr.range),s);this._executeEditorCommand("replaceAll",o)}selectAllMatches(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();let i=this._findMatches(e,!1,1073741824).map(o=>new ct(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn));const s=this._editor.getSelection();for(let o=0,r=i.length;othis._hide(),2e3)),this._isVisible=!1,this._editor=e,this._state=t,this._keybindingService=i,this._domNode=document.createElement("div"),this._domNode.className="findOptionsWidget",this._domNode.style.display="none",this._domNode.style.top="10px",this._domNode.style.zIndex="12",this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true");const s={inputActiveOptionBorder:re(gP),inputActiveOptionForeground:re(pP),inputActiveOptionBackground:re(kh)};this.caseSensitive=this._register(new $G(Object.assign({appendTitle:this._keybindingLabelFor(Pt.ToggleCaseSensitiveCommand),isChecked:this._state.matchCase},s))),this._domNode.appendChild(this.caseSensitive.domNode),this._register(this.caseSensitive.onChange(()=>{this._state.change({matchCase:this.caseSensitive.checked},!1)})),this.wholeWords=this._register(new UG(Object.assign({appendTitle:this._keybindingLabelFor(Pt.ToggleWholeWordCommand),isChecked:this._state.wholeWord},s))),this._domNode.appendChild(this.wholeWords.domNode),this._register(this.wholeWords.onChange(()=>{this._state.change({wholeWord:this.wholeWords.checked},!1)})),this.regex=this._register(new jG(Object.assign({appendTitle:this._keybindingLabelFor(Pt.ToggleRegexCommand),isChecked:this._state.isRegex},s))),this._domNode.appendChild(this.regex.domNode),this._register(this.regex.onChange(()=>{this._state.change({isRegex:this.regex.checked},!1)})),this._editor.addOverlayWidget(this),this._register(this._state.onFindReplaceStateChange(o=>{let r=!1;o.isRegex&&(this.regex.checked=this._state.isRegex,r=!0),o.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,r=!0),o.matchCase&&(this.caseSensitive.checked=this._state.matchCase,r=!0),!this._state.isRevealed&&r&&this._revealTemporarily()})),this._register(K(this._domNode,de.MOUSE_LEAVE,o=>this._onMouseLeave())),this._register(K(this._domNode,"mouseover",o=>this._onMouseOver()))}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return JD.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")}}JD.ID="editor.contrib.findOptionsWidget";function Fw(n,e){return n===1?!0:n===2?!1:e}class xRe extends Y{get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return Fw(this._isRegexOverride,this._isRegex)}get wholeWord(){return Fw(this._wholeWordOverride,this._wholeWord)}get matchCase(){return Fw(this._matchCaseOverride,this._matchCase)}get preserveCase(){return Fw(this._preserveCaseOverride,this._preserveCase)}get actualIsRegex(){return this._isRegex}get actualWholeWord(){return this._wholeWord}get actualMatchCase(){return this._matchCase}get actualPreserveCase(){return this._preserveCase}get searchScope(){return this._searchScope}get matchesPosition(){return this._matchesPosition}get matchesCount(){return this._matchesCount}get currentMatch(){return this._currentMatch}constructor(){super(),this._onFindReplaceStateChange=this._register(new B),this.onFindReplaceStateChange=this._onFindReplaceStateChange.event,this._searchString="",this._replaceString="",this._isRevealed=!1,this._isReplaceRevealed=!1,this._isRegex=!1,this._isRegexOverride=0,this._wholeWord=!1,this._wholeWordOverride=0,this._matchCase=!1,this._matchCaseOverride=0,this._preserveCase=!1,this._preserveCaseOverride=0,this._searchScope=null,this._matchesPosition=0,this._matchesCount=0,this._currentMatch=null,this._loop=!0,this._isSearching=!1,this._filters=null}changeMatchInfo(e,t,i){const s={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,s.matchesPosition=!0,o=!0),this._matchesCount!==t&&(this._matchesCount=t,s.matchesCount=!0,o=!0),typeof i<"u"&&(N.equalsRange(this._currentMatch,i)||(this._currentMatch=i,s.currentMatch=!0,o=!0)),o&&this._onFindReplaceStateChange.fire(s)}change(e,t,i=!0){var s;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 r=!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,r=!0),typeof e.replaceString<"u"&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,o.replaceString=!0,r=!0),typeof e.isRevealed<"u"&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,o.isRevealed=!0,r=!0),typeof e.isReplaceRevealed<"u"&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,o.isReplaceRevealed=!0,r=!0),typeof e.isRegex<"u"&&(this._isRegex=e.isRegex),typeof e.wholeWord<"u"&&(this._wholeWord=e.wholeWord),typeof e.matchCase<"u"&&(this._matchCase=e.matchCase),typeof e.preserveCase<"u"&&(this._preserveCase=e.preserveCase),typeof e.searchScope<"u"&&(!((s=e.searchScope)===null||s===void 0)&&s.every(u=>{var h;return(h=this._searchScope)===null||h===void 0?void 0:h.some(f=>!N.equalsRange(f,u))})||(this._searchScope=e.searchScope,o.searchScope=!0,r=!0)),typeof e.loop<"u"&&this._loop!==e.loop&&(this._loop=e.loop,o.loop=!0,r=!0),typeof e.isSearching<"u"&&this._isSearching!==e.isSearching&&(this._isSearching=e.isSearching,o.isSearching=!0,r=!0),typeof e.filters<"u"&&(this._filters?this._filters.update(e.filters):this._filters=e.filters,o.filters=!0,r=!0),this._isRegexOverride=typeof e.isRegexOverride<"u"?e.isRegexOverride:0,this._wholeWordOverride=typeof e.wholeWordOverride<"u"?e.wholeWordOverride:0,this._matchCaseOverride=typeof e.matchCaseOverride<"u"?e.matchCaseOverride:0,this._preserveCaseOverride=typeof e.preserveCaseOverride<"u"?e.preserveCaseOverride:0,a!==this.isRegex&&(r=!0,o.isRegex=!0),l!==this.wholeWord&&(r=!0,o.wholeWord=!0),c!==this.matchCase&&(r=!0,o.matchCase=!0),d!==this.preserveCase&&(r=!0,o.preserveCase=!0),r&&this._onFindReplaceStateChange.fire(o)}canNavigateBack(){return this.canNavigateInLoop()||this.matchesPosition!==1}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition=wd}}const LRe=m("defaultLabel","input"),DRe=m("label.preserveCaseToggle","Preserve Case");class kRe extends l0{constructor(e){super({icon:se.preserveCase,title:DRe+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class ERe extends fa{constructor(e,t,i,s){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new B),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new B),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new B),this._onInput=this._register(new B),this._onKeyUp=this._register(new B),this._onPreserveCaseKeyDown=this._register(new B),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this.contextViewProvider=t,this.placeholder=s.placeholder||"",this.validation=s.validation,this.label=s.label||LRe;const o=s.appendPreserveCaseLabel||"",r=s.history||[],a=!!s.flexibleHeight,l=!!s.flexibleWidth,c=s.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new qG(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},history:r,showHistoryHint:s.showHistoryHint,flexibleHeight:a,flexibleWidth:l,flexibleMaxHeight:c,inputBoxStyles:s.inputBoxStyles})),this.preserveCase=this._register(new kRe(Object.assign({appendTitle:o,isChecked:!1},s.toggleStyles))),this._register(this.preserveCase.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.preserveCase.onKeyDown(h=>{this._onPreserveCaseKeyDown.fire(h)})),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;const d=[this.preserveCase.domNode];this.onkeydown(this.domNode,h=>{if(h.equals(15)||h.equals(17)||h.equals(9)){const f=d.indexOf(document.activeElement);if(f>=0){let g=-1;h.equals(17)?g=(f+1)%d.length:h.equals(15)&&(f===0?g=d.length-1:g=f-1),h.equals(9)?(d[f].blur(),this.inputBox.focus()):g>=0&&d[g].focus(),Ue.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==null||e.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,h=>this._onKeyDown.fire(h)),this.onkeyup(this.inputBox.inputElement,h=>this._onKeyUp.fire(h)),this.oninput(this.inputBox.inputElement,h=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,h=>this._onMouseDown.fire(h))}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.preserveCase.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.preserveCase.disable()}setEnabled(e){e?this.enable():this.disable()}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getPreserveCase(){return this.preserveCase.checked}setPreserveCase(e){this.preserveCase.checked=e}focusOnPreserve(){this.preserveCase.focus()}validate(){var e;(e=this.inputBox)===null||e===void 0||e.validate()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.domNode.style.width=e+"px"}dispose(){super.dispose()}}var JK=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},eY=function(n,e){return function(t,i){e(t,i,n)}};const tY=new _e("suggestWidgetVisible",!1,m("suggestWidgetVisible","Whether suggestion are visible")),$3="historyNavigationWidgetFocus",iY="historyNavigationForwardsEnabled",nY="historyNavigationBackwardsEnabled";let dc;const Bw=[];function sY(n,e){if(Bw.includes(e))throw new Error("Cannot register the same widget multiple times");Bw.push(e);const t=new pe,i=new _e($3,!1).bindTo(n),s=new _e(iY,!0).bindTo(n),o=new _e(nY,!0).bindTo(n),r=()=>{i.set(!0),dc=e},a=()=>{i.set(!1),dc===e&&(dc=void 0)};return e.element===document.activeElement&&r(),t.add(e.onDidFocus(()=>r())),t.add(e.onDidBlur(()=>a())),t.add(Ze(()=>{Bw.splice(Bw.indexOf(e),1),a()})),{historyNavigationForwardsEnablement:s,historyNavigationBackwardsEnablement:o,dispose(){t.dispose()}}}let CR=class extends GG{constructor(e,t,i,s){super(e,t,i);const o=this._register(s.createScoped(this.inputBox.element));this._register(sY(o,this.inputBox))}};CR=JK([eY(3,tt)],CR);let SR=class extends ERe{constructor(e,t,i,s,o=!1){super(e,t,o,i);const r=this._register(s.createScoped(this.inputBox.element));this._register(sY(r,this.inputBox))}};SR=JK([eY(3,tt)],SR);Ws.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:xe.and(xe.has($3),xe.equals(nY,!0),xe.not("isComposing"),tY.isEqualTo(!1)),primary:16,secondary:[528],handler:n=>{dc==null||dc.showPreviousValue()}});Ws.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:xe.and(xe.has($3),xe.equals(iY,!0),xe.not("isComposing"),tY.isEqualTo(!1)),primary:18,secondary:[530],handler:n=>{dc==null||dc.showNextValue()}});function bB(n){var e,t;return((e=n.lookupKeybinding("history.showPrevious"))===null||e===void 0?void 0:e.getElectronAccelerator())==="Up"&&((t=n.lookupKeybinding("history.showNext"))===null||t===void 0?void 0:t.getElectronAccelerator())==="Down"}var ARe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,[])).next())})};const IRe=Xi("find-selection",se.selection,m("findSelectionIcon","Icon for 'Find in Selection' in the editor find widget.")),vB=Xi("find-collapsed",se.chevronRight,m("findCollapsedIcon","Icon to indicate that the editor find widget is collapsed.")),yB=Xi("find-expanded",se.chevronDown,m("findExpandedIcon","Icon to indicate that the editor find widget is expanded.")),TRe=Xi("find-replace",se.replace,m("findReplaceIcon","Icon for 'Replace' in the editor find widget.")),NRe=Xi("find-replace-all",se.replaceAll,m("findReplaceAllIcon","Icon for 'Replace All' in the editor find widget.")),RRe=Xi("find-previous-match",se.arrowUp,m("findPreviousMatchIcon","Icon for 'Find Previous' in the editor find widget.")),MRe=Xi("find-next-match",se.arrowDown,m("findNextMatchIcon","Icon for 'Find Next' in the editor find widget.")),PRe=m("label.findDialog","Find / Replace"),ORe=m("label.find","Find"),FRe=m("placeholder.find","Find"),BRe=m("label.previousMatchButton","Previous Match"),WRe=m("label.nextMatchButton","Next Match"),VRe=m("label.toggleSelectionFind","Find in Selection"),zRe=m("label.closeButton","Close"),HRe=m("label.replace","Replace"),$Re=m("placeholder.replace","Replace"),URe=m("label.replaceButton","Replace"),jRe=m("label.replaceAllButton","Replace All"),qRe=m("label.toggleReplaceButton","Toggle Replace"),GRe=m("title.matchesCountLimit","Only the first {0} results are highlighted, but all find operations work on the entire text.",wd),KRe=m("label.matchesLocation","{0} of {1}"),wB=m("label.noResults","No results"),va=419,YRe=275,ZRe=YRe-54;let z0=69;const XRe=33,CB="ctrlEnterReplaceAll.windows.donotask",SB=mt?256:2048;class wE{constructor(e){this.afterLineNumber=e,this.heightInPx=XRe,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function xB(n,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionStart>0){n.stopPropagation();return}}function LB(n,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionEndthis._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(90)&&(this._codeEditor.getOption(90)&&this._state.change({isReplaceRevealed:!1},!1),this._updateButtons()),d.hasChanged(143)&&this._tryUpdateWidgetWidth(),d.hasChanged(2)&&this.updateAccessibilitySupport(),d.hasChanged(41)){const u=this._codeEditor.getOption(41).loop;this._state.change({loop:u},!1);const h=this._codeEditor.getOption(41).addExtraSpaceOnTop;h&&!this._viewZone&&(this._viewZone=new wE(0),this._showViewZone()),!h&&this._viewZone&&this._removeViewZone()}})),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection(()=>{this._isVisible&&this._updateToggleSelectionFindButton()})),this._register(this._codeEditor.onDidFocusEditorWidget(()=>ARe(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=QD.bindTo(r),this._findFocusTracker=this._register(tu(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=H3.bindTo(r),this._replaceFocusTracker=this._register(tu(this._replaceInput.inputBox.inputElement)),this._register(this._replaceFocusTracker.onDidFocus(()=>{this._replaceInputFocused.set(!0),this._updateSearchScope()})),this._register(this._replaceFocusTracker.onDidBlur(()=>{this._replaceInputFocused.set(!1)})),this._codeEditor.addOverlayWidget(this),this._codeEditor.getOption(41).addExtraSpaceOnTop&&(this._viewZone=new wE(0)),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 ek.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(90)&&!this._isReplaceVisible&&(this._isReplaceVisible=!0,this._replaceInput.width=ws(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,_t)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){this._matchesCount.style.minWidth=z0+"px",this._state.matchesCount>=wd?this._matchesCount.title=GRe: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>=wd&&(t+="+");let i=String(this._state.matchesPosition);i==="0"&&(i="?"),e=Bb(KRe,i,t)}else e=wB;this._matchesCount.appendChild(document.createTextNode(e)),Z1(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),z0=Math.max(z0,this._matchesCount.clientWidth)}_getAriaLabel(e,t,i){if(e===wB)return i===""?m("ariaSearchNoResultEmpty","{0} found",e):m("ariaSearchNoResult","{0} found for '{1}'",e,i);if(t){const s=m("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)}, ${s}`:s}return m("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(90);this._toggleReplaceBtn.setEnabled(this._isVisible&&i)}_reveal(){if(this._revealTimeouts.forEach(e=>{clearTimeout(e)}),this._revealTimeouts=[],!this._isVisible){this._isVisible=!0;const e=this._codeEditor.getSelection();switch(this._codeEditor.getOption(41).autoFindInSelection){case"always":this._toggleSelectionFind.checked=!0;break;case"never":this._toggleSelectionFind.checked=!1;break;case"multiline":{const i=!!e&&e.startLineNumber!==e.endLineNumber;this._toggleSelectionFind.checked=i;break}}this._tryUpdateWidgetWidth(),this._updateButtons(),this._revealTimeouts.push(setTimeout(()=>{this._domNode.classList.add("visible"),this._domNode.setAttribute("aria-hidden","false")},0)),this._revealTimeouts.push(setTimeout(()=>{this._findInput.validate()},200)),this._codeEditor.layoutOverlayWidget(this);let t=!0;if(this._codeEditor.getOption(41).seedSearchStringFromSelection&&e){const i=this._codeEditor.getDomNode();if(i){const s=Rn(i),o=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),r=s.left+(o?o.left:0),a=o?o.top:0;if(this._viewZone&&ae.startLineNumber&&(t=!1);const l=ej(this._domNode).left;r>l&&(t=!1);const c=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());s.left+(c?c.left:0)>l&&(t=!1)}}}this._showViewZone(t)}}_hide(e){this._revealTimeouts.forEach(t=>{clearTimeout(t)}),this._revealTimeouts=[],this._isVisible&&(this._isVisible=!1,this._updateButtons(),this._domNode.classList.remove("visible"),this._domNode.setAttribute("aria-hidden","true"),this._findInput.clearMessage(),e&&this._codeEditor.focus(),this._codeEditor.layoutOverlayWidget(this),this._removeViewZone())}_layoutViewZone(e){if(!this._codeEditor.getOption(41).addExtraSpaceOnTop){this._removeViewZone();return}if(!this._isVisible)return;const i=this._viewZone;this._viewZoneId!==void 0||!i||this._codeEditor.changeViewZones(s=>{i.heightInPx=this._getHeight(),this._viewZoneId=s.addZone(i),this._codeEditor.setScrollTop(e||this._codeEditor.getScrollTop()+i.heightInPx)})}_showViewZone(e=!0){if(!this._isVisible||!this._codeEditor.getOption(41).addExtraSpaceOnTop)return;this._viewZone===void 0&&(this._viewZone=new wE(0));const i=this._viewZone;this._codeEditor.changeViewZones(s=>{if(this._viewZoneId!==void 0){const o=this._getHeight();if(o===i.heightInPx)return;const r=o-i.heightInPx;i.heightInPx=o,s.layoutZone(this._viewZoneId),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+r);return}else{let o=this._getHeight();if(o-=this._codeEditor.getOption(83).top,o<=0)return;i.heightInPx=o,this._viewZoneId=s.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))})}_tryUpdateWidgetWidth(){if(!this._isVisible||!X4(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,s=e.minimap.minimapWidth;let o=!1,r=!1,a=!1;if(this._resized&&ws(this._domNode)>va){this._domNode.style.maxWidth=`${i-28-s-15}px`,this._replaceInput.width=ws(this._findInput.domNode);return}if(va+28+s>=i&&(r=!0),va+28+s-z0>=i&&(a=!0),va+28+s-z0>=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",r),!a&&!o&&(this._domNode.style.maxWidth=`${i-28-s-15}px`),this._findInput.layout({collapsedFindWidget:o,narrowFindWidget:a,reducedFindWidget:r}),this._resized){const l=this._findInput.inputBox.element.clientWidth;l>0&&(this._replaceInput.width=l)}else this._isReplaceVisible&&(this._replaceInput.width=ws(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&&!N.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(SB|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 xB(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(18))return LB(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(SB|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{Fs&&dp&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(m("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(CB,!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 xB(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return LB(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 CR(null,this._contextViewProvider,{width:ZRe,label:ORe,placeholder:FRe,appendCaseSensitiveLabel:this._keybindingLabelFor(Pt.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(Pt.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(Pt.ToggleRegexCommand),validation:l=>{if(l.length===0||!this._findInput.getRegex())return null;try{return new RegExp(l,"gu"),null}catch(c){return{content:c.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>bB(this._keybindingService),inputBoxStyles:bx,toggleStyles:_x},this._contextKeyService)),this._findInput.setRegex(!!this._state.isRegex),this._findInput.setCaseSensitive(!!this._state.matchCase),this._findInput.setWholeWords(!!this._state.wholeWord),this._register(this._findInput.onKeyDown(l=>this._onFindInputKeyDown(l))),this._register(this._findInput.inputBox.onDidChange(()=>{this._ignoreChangeEvent||this._state.change({searchString:this._findInput.getValue()},!0)})),this._register(this._findInput.onDidOptionChange(()=>{this._state.change({isRegex:this._findInput.getRegex(),wholeWord:this._findInput.getWholeWords(),matchCase:this._findInput.getCaseSensitive()},!0)})),this._register(this._findInput.onCaseSensitiveKeyDown(l=>{l.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),l.preventDefault())})),this._register(this._findInput.onRegexKeyDown(l=>{l.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),l.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(l=>{this._tryUpdateHeight()&&this._showViewZone()})),Jn&&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 Cg({label:BRe+this._keybindingLabelFor(Pt.PreviousMatchFindAction),icon:RRe,onTrigger:()=>{iI(this._codeEditor.getAction(Pt.PreviousMatchFindAction)).run().then(void 0,_t)}})),this._nextBtn=this._register(new Cg({label:WRe+this._keybindingLabelFor(Pt.NextMatchFindAction),icon:MRe,onTrigger:()=>{iI(this._codeEditor.getAction(Pt.NextMatchFindAction)).run().then(void 0,_t)}}));const i=document.createElement("div");i.className="find-part",i.appendChild(this._findInput.domNode);const s=document.createElement("div");s.className="find-actions",i.appendChild(s),s.appendChild(this._matchesCount),s.appendChild(this._prevBtn.domNode),s.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new l0({icon:IRe,title:VRe+this._keybindingLabelFor(Pt.ToggleSearchScopeCommand),isChecked:!1,inputActiveOptionBackground:re(kh),inputActiveOptionBorder:re(gP),inputActiveOptionForeground:re(pP)})),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)})),s.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new Cg({label:zRe+this._keybindingLabelFor(Pt.CloseFindWidgetCommand),icon:IEe,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:l=>{l.equals(2)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),l.preventDefault())}})),this._replaceInput=this._register(new SR(null,void 0,{label:HRe,placeholder:$Re,appendPreserveCaseLabel:this._keybindingLabelFor(Pt.TogglePreserveCaseCommand),history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>bB(this._keybindingService),inputBoxStyles:bx,toggleStyles:_x},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 Cg({label:URe+this._keybindingLabelFor(Pt.ReplaceOneAction),icon:TRe,onTrigger:()=>{this._controller.replace()},onKeyDown:l=>{l.equals(1026)&&(this._closeBtn.focus(),l.preventDefault())}})),this._replaceAllBtn=this._register(new Cg({label:jRe+this._keybindingLabelFor(Pt.ReplaceAllAction),icon:NRe,onTrigger:()=>{this._controller.replaceAll()}}));const o=document.createElement("div");o.className="replace-part",o.appendChild(this._replaceInput.domNode);const r=document.createElement("div");r.className="replace-actions",o.appendChild(r),r.appendChild(this._replaceBtn.domNode),r.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new Cg({label:qRe,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=ws(this._findInput.domNode),this._replaceInput.inputBox.layout()),this._showViewZone()}})),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible),this._domNode=document.createElement("div"),this._domNode.className="editor-widget find-widget",this._domNode.setAttribute("aria-hidden","true"),this._domNode.ariaLabel=PRe,this._domNode.role="dialog",this._domNode.style.width=`${va}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(i),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(o),this._resizeSash=new En(this._domNode,this,{orientation:0,size:2}),this._resized=!1;let a=va;this._register(this._resizeSash.onDidStart(()=>{a=ws(this._domNode)})),this._register(this._resizeSash.onDidChange(l=>{this._resized=!0;const c=a+l.startX-l.currentX;if(cd||(this._domNode.style.width=`${c}px`,this._isReplaceVisible&&(this._replaceInput.width=ws(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const l=ws(this._domNode);if(l{this._opts.onTrigger(),i.preventDefault()}),this.onkeydown(this._domNode,i=>{var s,o;if(i.equals(10)||i.equals(3)){this._opts.onTrigger(),i.preventDefault();return}(o=(s=this._opts).onKeyDown)===null||o===void 0||o.call(s,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(...Te.asClassNameArray(vB)),this._domNode.classList.add(...Te.asClassNameArray(yB))):(this._domNode.classList.remove(...Te.asClassNameArray(yB)),this._domNode.classList.add(...Te.asClassNameArray(vB)))}}Nr((n,e)=>{const t=(p,_)=>{_&&e.addRule(`.monaco-editor ${p} { background-color: ${_}; }`)};t(".findMatch",n.getColor($a)),t(".currentFindMatch",n.getColor(dve)),t(".findScope",n.getColor(uve));const i=n.getColor(Ui);t(".find-widget",i);const s=n.getColor(Ql);s&&e.addRule(`.monaco-editor .find-widget { box-shadow: 0 0 8px 2px ${s}; }`);const o=n.getColor(qj);o&&e.addRule(`.monaco-editor .find-widget { border-left: 1px solid ${o}; border-right: 1px solid ${o}; border-bottom: 1px solid ${o}; }`);const r=n.getColor(fd);r&&e.addRule(`.monaco-editor .findMatch { border: 1px ${ac(n.type)?"dotted":"solid"} ${r}; box-sizing: border-box; }`);const a=n.getColor(hve);a&&e.addRule(`.monaco-editor .currentFindMatch { border: 2px solid ${a}; padding: 1px; box-sizing: border-box; }`);const l=n.getColor(fve);l&&e.addRule(`.monaco-editor .findScope { border: 1px ${ac(n.type)?"dashed":"solid"} ${l}; }`);const c=n.getColor(Je);c&&e.addRule(`.monaco-editor .find-widget { border: 1px solid ${c}; }`);const d=n.getColor(Ha);d&&e.addRule(`.monaco-editor .find-widget { color: ${d}; }`);const u=n.getColor(Ibe);u&&e.addRule(`.monaco-editor .find-widget.no-results .matchesCount { color: ${u}; }`);const h=n.getColor(tve);if(h)e.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${h}; }`);else{const p=n.getColor(Ug);p&&e.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${p}; }`)}const f=n.getColor(NT);f&&e.addRule(` + `,constraint:QK,schema:{type:"object",properties:{levels:{type:"number"},direction:{type:"string",enum:["up","down"]},selectionLines:{type:"array",items:{type:"number"}}}}}]}})}invoke(e,t,i,s){const o=this.getLineNumbers(s,i),r=s&&s.levels,a=s&&s.direction;typeof r!="number"&&typeof a!="string"?tRe(t,!0,o):a==="up"?qK(t,!0,r||1,o):g0(t,!0,r||1,o)}}class LRe extends Jn{constructor(){super({id:"editor.toggleFold",label:m("toggleFoldAction.label","Toggle Fold"),alias:"Toggle Fold",precondition:Vn,kbOpts:{kbExpr:$.editorTextFocus,primary:Pn(2089,2090),weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);eRe(t,1,s)}}class DRe extends Jn{constructor(){super({id:"editor.foldRecursively",label:m("foldRecursivelyAction.label","Fold Recursively"),alias:"Fold Recursively",precondition:Vn,kbOpts:{kbExpr:$.editorTextFocus,primary:Pn(2089,2140),weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);g0(t,!0,Number.MAX_VALUE,s)}}class kRe extends Jn{constructor(){super({id:"editor.foldAllBlockComments",label:m("foldAllBlockComments.label","Fold All Block Comments"),alias:"Fold All Block Comments",precondition:Vn,kbOpts:{kbExpr:$.editorTextFocus,primary:Pn(2089,2138),weight:100}})}invoke(e,t,i,s,o){if(t.regions.hasTypes())OP(t,as.Comment.value,!0);else{const r=i.getModel();if(!r)return;const a=o.getLanguageConfiguration(r.getLanguageId()).comments;if(a&&a.blockCommentStartToken){const l=new RegExp("^\\s*"+Sr(a.blockCommentStartToken));PP(t,l,!0)}}}}class ERe extends Jn{constructor(){super({id:"editor.foldAllMarkerRegions",label:m("foldAllMarkerRegions.label","Fold All Regions"),alias:"Fold All Regions",precondition:Vn,kbOpts:{kbExpr:$.editorTextFocus,primary:Pn(2089,2077),weight:100}})}invoke(e,t,i,s,o){if(t.regions.hasTypes())OP(t,as.Region.value,!0);else{const r=i.getModel();if(!r)return;const a=o.getLanguageConfiguration(r.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);PP(t,l,!0)}}}}class ARe extends Jn{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:m("unfoldAllMarkerRegions.label","Unfold All Regions"),alias:"Unfold All Regions",precondition:Vn,kbOpts:{kbExpr:$.editorTextFocus,primary:Pn(2089,2078),weight:100}})}invoke(e,t,i,s,o){if(t.regions.hasTypes())OP(t,as.Region.value,!1);else{const r=i.getModel();if(!r)return;const a=o.getLanguageConfiguration(r.getLanguageId()).foldingRules;if(a&&a.markers&&a.markers.start){const l=new RegExp(a.markers.start);PP(t,l,!1)}}}}class IRe extends Jn{constructor(){super({id:"editor.foldAllExcept",label:m("foldAllExcept.label","Fold All Except Selected"),alias:"Fold All Except Selected",precondition:Vn,kbOpts:{kbExpr:$.editorTextFocus,primary:Pn(2089,2136),weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);GK(t,!0,s)}}class TRe extends Jn{constructor(){super({id:"editor.unfoldAllExcept",label:m("unfoldAllExcept.label","Unfold All Except Selected"),alias:"Unfold All Except Selected",precondition:Vn,kbOpts:{kbExpr:$.editorTextFocus,primary:Pn(2089,2134),weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);GK(t,!1,s)}}class NRe extends Jn{constructor(){super({id:"editor.foldAll",label:m("foldAllAction.label","Fold All"),alias:"Fold All",precondition:Vn,kbOpts:{kbExpr:$.editorTextFocus,primary:Pn(2089,2069),weight:100}})}invoke(e,t,i){g0(t,!0)}}class RRe extends Jn{constructor(){super({id:"editor.unfoldAll",label:m("unfoldAllAction.label","Unfold All"),alias:"Unfold All",precondition:Vn,kbOpts:{kbExpr:$.editorTextFocus,primary:Pn(2089,2088),weight:100}})}invoke(e,t,i){g0(t,!1)}}class If extends Jn{getFoldingLevel(){return parseInt(this.id.substr(If.ID_PREFIX.length))}invoke(e,t,i){iRe(t,this.getFoldingLevel(),!0,this.getSelectedLines(i))}}If.ID_PREFIX="editor.foldLevel";If.ID=n=>If.ID_PREFIX+n;class MRe extends Jn{constructor(){super({id:"editor.gotoParentFold",label:m("gotoParentFold.label","Go to Parent Fold"),alias:"Go to Parent Fold",precondition:Vn,kbOpts:{kbExpr:$.editorTextFocus,weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);if(s.length>0){const o=nRe(s[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class PRe extends Jn{constructor(){super({id:"editor.gotoPreviousFold",label:m("gotoPreviousFold.label","Go to Previous Folding Range"),alias:"Go to Previous Folding Range",precondition:Vn,kbOpts:{kbExpr:$.editorTextFocus,weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);if(s.length>0){const o=sRe(s[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class ORe extends Jn{constructor(){super({id:"editor.gotoNextFold",label:m("gotoNextFold.label","Go to Next Folding Range"),alias:"Go to Next Folding Range",precondition:Vn,kbOpts:{kbExpr:$.editorTextFocus,weight:100}})}invoke(e,t,i){const s=this.getSelectedLines(i);if(s.length>0){const o=oRe(s[0],t);o!==null&&i.setSelection({startLineNumber:o,startColumn:1,endLineNumber:o,endColumn:1})}}}class FRe extends Jn{constructor(){super({id:"editor.createFoldingRangeFromSelection",label:m("createManualFoldRange.label","Create Folding Range from Selection"),alias:"Create Folding Range from Selection",precondition:Vn,kbOpts:{kbExpr:$.editorTextFocus,primary:Pn(2089,2135),weight:100}})}invoke(e,t,i){var s;const o=[],r=i.getSelections();if(r){for(const a of r){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=fo.sanitizeAndMerge(t.regions,o,(s=i.getModel())===null||s===void 0?void 0:s.getLineCount());t.updatePost(fo.fromFoldRanges(a))}}}}class BRe extends Jn{constructor(){super({id:"editor.removeManualFoldingRanges",label:m("removeManualFoldingRanges.label","Remove Manual Folding Ranges"),alias:"Remove Manual Folding Ranges",precondition:Vn,kbOpts:{kbExpr:$.editorTextFocus,primary:Pn(2089,2137),weight:100}})}invoke(e,t,i){const s=i.getSelections();if(s){const o=[];for(const r of s){const{startLineNumber:a,endLineNumber:l}=r;o.push(l>=a?{startLineNumber:a,endLineNumber:l}:{endLineNumber:l,startLineNumber:a})}t.removeManualRanges(o),e.triggerFoldingModelChanged()}}}Ir(Af.ID,Af,0);Ze(CRe);Ze(SRe);Ze(xRe);Ze(DRe);Ze(NRe);Ze(RRe);Ze(kRe);Ze(ERe);Ze(ARe);Ze(IRe);Ze(TRe);Ze(LRe);Ze(MRe);Ze(PRe);Ze(ORe);Ze(FRe);Ze(BRe);for(let n=1;n<=7;n++)jme(new If({id:If.ID(n),label:m("foldLevelAction.label","Fold Level {0}",n),alias:`Fold Level ${n}`,precondition:Vn,kbOpts:{kbExpr:$.editorTextFocus,primary:Pn(2089,2048|21+n),weight:100}}));Yt.registerCommand("_executeFoldingRangeProvider",function(n,...e){return yRe(this,void 0,void 0,function*(){const[t]=e;if(!(t instanceof Ue))throw rc();const i=n.get(it),s=n.get(hs).getModel(t);if(!s)throw rc();const o=n.get(ii);if(!o.getValue("editor.folding",{resource:t}))return[];const r=n.get(so),a=o.getValue("editor.foldingStrategy",{resource:t}),l={get limit(){return o.getValue("editor.foldingMaximumRegions",{resource:t})},update:(f,g)=>{}},c=new KK(s,r,l);let d=c;if(a!=="indentation"){const f=Af.getFoldingRangeProviders(i,s);f.length&&(d=new XK(s,f,()=>{},l,c))}const u=yield d.compute(rn.None),h=[];try{if(u)for(let f=0;fthis._editor.getModel().getDecorationRange(t)).filter(t=>!!t);if(e.length)return e}return null}getStartPosition(){return this._startPosition}setStartPosition(e){this._startPosition=e,this.setCurrentFindMatch(null)}_getDecorationIndex(e){const t=this._decorations.indexOf(e);return t>=0?t+1:1}getDecorationRangeAt(e){const t=e{if(this._highlightedDecorationId!==null&&(s.changeDecorationOptions(this._highlightedDecorationId,jn._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),t!==null&&(this._highlightedDecorationId=t,s.changeDecorationOptions(this._highlightedDecorationId,jn._CURRENT_FIND_MATCH_DECORATION)),this._rangeHighlightDecorationId!==null&&(s.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),t!==null){let o=this._editor.getModel().getDecorationRange(t);if(o.startLineNumber!==o.endLineNumber&&o.endColumn===1){const r=o.endLineNumber-1,a=this._editor.getModel().getLineMaxColumn(r);o=new N(o.startLineNumber,o.startColumn,r,a)}this._rangeHighlightDecorationId=s.addDecoration(o,jn._RANGE_HIGHLIGHT_DECORATION)}}),i}set(e,t){this._editor.changeDecorations(i=>{let s=jn._FIND_MATCH_DECORATION;const o=[];if(e.length>1e3){s=jn._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 f=1,g=e.length;f=p.startLineNumber?p.endLineNumber>h&&(h=p.endLineNumber):(o.push({range:new N(u,1,h,1),options:jn._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),u=p.startLineNumber,h=p.endLineNumber)}o.push({range:new N(u,1,h,1),options:jn._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const r=new Array(e.length);for(let a=0,l=e.length;ai.removeDecoration(a)),this._findScopeDecorationIds=[]),t!=null&&t.length&&(this._findScopeDecorationIds=t.map(a=>i.addDecoration(a,jn._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],s=this._editor.getModel().getDecorationRange(i);if(!(!s||s.endLineNumber>e.lineNumber)){if(s.endLineNumbere.column))return s}}return this._editor.getModel().getDecorationRange(this._decorations[this._decorations.length-1])}matchAfterPosition(e){if(this._decorations.length===0)return null;for(let t=0,i=this._decorations.length;te.lineNumber)return o;if(!(o.startColumn0){const i=[];for(let r=0;rN.compareRangesUsingStarts(r.range,a.range));const s=[];let o=i[0];for(let r=1;r0?e[0].toUpperCase()+e.substr(1):n[0][0].toUpperCase()!==n[0][0]&&e.length>0?e[0].toLowerCase()+e.substr(1):e}else return e}function uB(n,e,t){return n[0].indexOf(t)!==-1&&e.indexOf(t)!==-1&&n[0].split(t).length===e.split(t).length}function hB(n,e,t){const i=e.split(t),s=n[0].split(t);let o="";return i.forEach((r,a)=>{o+=JK([s[a]],r)+t}),o.slice(0,-1)}class fB{constructor(e){this.staticValue=e,this.kind=0}}class VRe{constructor(e){this.pieces=e,this.kind=1}}class Hm{static fromStaticValue(e){return new Hm([af.staticValue(e)])}get hasReplacementPatterns(){return this._state.kind===1}constructor(e){!e||e.length===0?this._state=new fB(""):e.length===1&&e[0].staticValue!==null?this._state=new fB(e[0].staticValue):this._state=new VRe(e)}buildReplaceString(e,t){if(this._state.kind===0)return t?JK(e,this._state.staticValue):this._state.staticValue;let i="";for(let s=0,o=this._state.pieces.length;s0){const l=[],c=r.caseOps.length;let d=0;for(let u=0,h=a.length;u=c){l.push(a.slice(u));break}switch(r.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=s)break;const r=n.charCodeAt(i);switch(r){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(r));break}continue}if(o===36){if(i++,i>=s)break;const r=n.charCodeAt(i);if(r===36){t.emitUnchanged(i-1),t.emitStatic("$",i+1);continue}if(r===48||r===38){t.emitUnchanged(i-1),t.emitMatchIndex(0,i+1,e),e.length=0;continue}if(49<=r&&r<=57){let a=r-48;if(i+1this.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,Ft(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)},$Re)):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 N(a.startLineNumber,1,l,this._editor.getModel().getLineMaxColumn(l))}return a}));const s=this._findMatches(i,!1,Cd);this._decorations.set(s,i);const o=this._editor.getSelection();let r=this._decorations.getCurrentMatchesPosition(o);if(r===0&&s.length>0){const a=Xb(s.map(l=>l.range),l=>N.compareRangesUsingStarts(l,o)>=0);r=a>0?a-1+1:r}this._state.changeMatchInfo(r,this._decorations.getCount(),void 0),e&&this._editor.getOption(41).cursorMoveOnType&&this._moveToNextMatch(this._decorations.getStartPosition())}_hasMatches(){return this._state.matchesCount>0}_cannotFind(){if(!this._hasMatches()){const e=this._decorations.getFindScope();return e&&this._editor.revealRangeInCenterIfOutsideViewport(e,0),!0}return!1}_setCurrentFindMatch(e){const t=this._decorations.setCurrentFindMatch(e);this._state.changeMatchInfo(t,this._decorations.getCount(),e),this._editor.setSelection(e),this._editor.revealRangeInCenterIfOutsideViewport(e,0)}_prevSearchPosition(e){const t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:s}=e;const o=this._editor.getModel();return t||s===1?(i===1?i=o.getLineCount():i--,s=o.getLineMaxColumn(i)):s--,new V(i,s)}_moveToPrevMatch(e,t=!1){if(!this._state.canNavigateBack()){const d=this._decorations.matchAfterPosition(e);d&&this._setCurrentFindMatch(d);return}if(this._decorations.getCount()=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:s}=e;const o=this._editor.getModel();return t||s===o.getLineMaxColumn(i)?(i===o.getLineCount()?i=1:i++,s=1):s++,new V(i,s)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const i=this._decorations.matchBeforePosition(e);i&&this._setCurrentFindMatch(i);return}if(this._decorations.getCount()nb._getSearchRange(this._editor.getModel(),o));return this._editor.getModel().findMatches(this._state.searchString,s,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null,t,i)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();e===null&&this._state.matchesCount>=Cd?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const t=new nh(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):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 s=this._editor.getModel(),o=s.getValue(1),r=s.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 bq(r,l,this._editor.getSelection());this._executeEditorCommand("replaceAll",d)}_regularReplaceAll(e){const t=this._getReplacePattern(),i=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,1073741824),s=[];for(let r=0,a=i.length;rr.range),s);this._executeEditorCommand("replaceAll",o)}selectAllMatches(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();let i=this._findMatches(e,!1,1073741824).map(o=>new lt(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn));const s=this._editor.getSelection();for(let o=0,r=i.length;othis._hide(),2e3)),this._isVisible=!1,this._editor=e,this._state=t,this._keybindingService=i,this._domNode=document.createElement("div"),this._domNode.className="findOptionsWidget",this._domNode.style.display="none",this._domNode.style.top="10px",this._domNode.style.zIndex="12",this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true");const s={inputActiveOptionBorder:re(h3),inputActiveOptionForeground:re(f3),inputActiveOptionBackground:re(kh)};this.caseSensitive=this._register(new HG(Object.assign({appendTitle:this._keybindingLabelFor(Mt.ToggleCaseSensitiveCommand),isChecked:this._state.matchCase},s))),this._domNode.appendChild(this.caseSensitive.domNode),this._register(this.caseSensitive.onChange(()=>{this._state.change({matchCase:this.caseSensitive.checked},!1)})),this.wholeWords=this._register(new $G(Object.assign({appendTitle:this._keybindingLabelFor(Mt.ToggleWholeWordCommand),isChecked:this._state.wholeWord},s))),this._domNode.appendChild(this.wholeWords.domNode),this._register(this.wholeWords.onChange(()=>{this._state.change({wholeWord:this.wholeWords.checked},!1)})),this.regex=this._register(new UG(Object.assign({appendTitle:this._keybindingLabelFor(Mt.ToggleRegexCommand),isChecked:this._state.isRegex},s))),this._domNode.appendChild(this.regex.domNode),this._register(this.regex.onChange(()=>{this._state.change({isRegex:this.regex.checked},!1)})),this._editor.addOverlayWidget(this),this._register(this._state.onFindReplaceStateChange(o=>{let r=!1;o.isRegex&&(this.regex.checked=this._state.isRegex,r=!0),o.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,r=!0),o.matchCase&&(this.caseSensitive.checked=this._state.matchCase,r=!0),!this._state.isRevealed&&r&&this._revealTemporarily()})),this._register(K(this._domNode,de.MOUSE_LEAVE,o=>this._onMouseLeave())),this._register(K(this._domNode,"mouseover",o=>this._onMouseOver()))}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return qD.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")}}qD.ID="editor.contrib.findOptionsWidget";function Tw(n,e){return n===1?!0:n===2?!1:e}class URe extends Y{get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return Tw(this._isRegexOverride,this._isRegex)}get wholeWord(){return Tw(this._wholeWordOverride,this._wholeWord)}get matchCase(){return Tw(this._matchCaseOverride,this._matchCase)}get preserveCase(){return Tw(this._preserveCaseOverride,this._preserveCase)}get actualIsRegex(){return this._isRegex}get actualWholeWord(){return this._wholeWord}get actualMatchCase(){return this._matchCase}get actualPreserveCase(){return this._preserveCase}get searchScope(){return this._searchScope}get matchesPosition(){return this._matchesPosition}get matchesCount(){return this._matchesCount}get currentMatch(){return this._currentMatch}constructor(){super(),this._onFindReplaceStateChange=this._register(new B),this.onFindReplaceStateChange=this._onFindReplaceStateChange.event,this._searchString="",this._replaceString="",this._isRevealed=!1,this._isReplaceRevealed=!1,this._isRegex=!1,this._isRegexOverride=0,this._wholeWord=!1,this._wholeWordOverride=0,this._matchCase=!1,this._matchCaseOverride=0,this._preserveCase=!1,this._preserveCaseOverride=0,this._searchScope=null,this._matchesPosition=0,this._matchesCount=0,this._currentMatch=null,this._loop=!0,this._isSearching=!1,this._filters=null}changeMatchInfo(e,t,i){const s={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,s.matchesPosition=!0,o=!0),this._matchesCount!==t&&(this._matchesCount=t,s.matchesCount=!0,o=!0),typeof i<"u"&&(N.equalsRange(this._currentMatch,i)||(this._currentMatch=i,s.currentMatch=!0,o=!0)),o&&this._onFindReplaceStateChange.fire(s)}change(e,t,i=!0){var s;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 r=!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,r=!0),typeof e.replaceString<"u"&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,o.replaceString=!0,r=!0),typeof e.isRevealed<"u"&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,o.isRevealed=!0,r=!0),typeof e.isReplaceRevealed<"u"&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,o.isReplaceRevealed=!0,r=!0),typeof e.isRegex<"u"&&(this._isRegex=e.isRegex),typeof e.wholeWord<"u"&&(this._wholeWord=e.wholeWord),typeof e.matchCase<"u"&&(this._matchCase=e.matchCase),typeof e.preserveCase<"u"&&(this._preserveCase=e.preserveCase),typeof e.searchScope<"u"&&(!((s=e.searchScope)===null||s===void 0)&&s.every(u=>{var h;return(h=this._searchScope)===null||h===void 0?void 0:h.some(f=>!N.equalsRange(f,u))})||(this._searchScope=e.searchScope,o.searchScope=!0,r=!0)),typeof e.loop<"u"&&this._loop!==e.loop&&(this._loop=e.loop,o.loop=!0,r=!0),typeof e.isSearching<"u"&&this._isSearching!==e.isSearching&&(this._isSearching=e.isSearching,o.isSearching=!0,r=!0),typeof e.filters<"u"&&(this._filters?this._filters.update(e.filters):this._filters=e.filters,o.filters=!0,r=!0),this._isRegexOverride=typeof e.isRegexOverride<"u"?e.isRegexOverride:0,this._wholeWordOverride=typeof e.wholeWordOverride<"u"?e.wholeWordOverride:0,this._matchCaseOverride=typeof e.matchCaseOverride<"u"?e.matchCaseOverride:0,this._preserveCaseOverride=typeof e.preserveCaseOverride<"u"?e.preserveCaseOverride:0,a!==this.isRegex&&(r=!0,o.isRegex=!0),l!==this.wholeWord&&(r=!0,o.wholeWord=!0),c!==this.matchCase&&(r=!0,o.matchCase=!0),d!==this.preserveCase&&(r=!0,o.preserveCase=!0),r&&this._onFindReplaceStateChange.fire(o)}canNavigateBack(){return this.canNavigateInLoop()||this.matchesPosition!==1}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition=Cd}}const jRe=m("defaultLabel","input"),qRe=m("label.preserveCaseToggle","Preserve Case");class GRe extends h0{constructor(e){super({icon:se.preserveCase,title:qRe+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class KRe extends ua{constructor(e,t,i,s){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new B),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new B),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new B),this._onInput=this._register(new B),this._onKeyUp=this._register(new B),this._onPreserveCaseKeyDown=this._register(new B),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this.contextViewProvider=t,this.placeholder=s.placeholder||"",this.validation=s.validation,this.label=s.label||jRe;const o=s.appendPreserveCaseLabel||"",r=s.history||[],a=!!s.flexibleHeight,l=!!s.flexibleWidth,c=s.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new jG(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},history:r,showHistoryHint:s.showHistoryHint,flexibleHeight:a,flexibleWidth:l,flexibleMaxHeight:c,inputBoxStyles:s.inputBoxStyles})),this.preserveCase=this._register(new GRe(Object.assign({appendTitle:o,isChecked:!1},s.toggleStyles))),this._register(this.preserveCase.onChange(h=>{this._onDidOptionChange.fire(h),!h&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()})),this._register(this.preserveCase.onKeyDown(h=>{this._onPreserveCaseKeyDown.fire(h)})),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;const d=[this.preserveCase.domNode];this.onkeydown(this.domNode,h=>{if(h.equals(15)||h.equals(17)||h.equals(9)){const f=d.indexOf(document.activeElement);if(f>=0){let g=-1;h.equals(17)?g=(f+1)%d.length:h.equals(15)&&(f===0?g=d.length-1:g=f-1),h.equals(9)?(d[f].blur(),this.inputBox.focus()):g>=0&&d[g].focus(),$e.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==null||e.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,h=>this._onKeyDown.fire(h)),this.onkeyup(this.inputBox.inputElement,h=>this._onKeyUp.fire(h)),this.oninput(this.inputBox.inputElement,h=>this._onInput.fire()),this.onmousedown(this.inputBox.inputElement,h=>this._onMouseDown.fire(h))}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.preserveCase.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.preserveCase.disable()}setEnabled(e){e?this.enable():this.disable()}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getPreserveCase(){return this.preserveCase.checked}setPreserveCase(e){this.preserveCase.checked=e}focusOnPreserve(){this.preserveCase.focus()}validate(){var e;(e=this.inputBox)===null||e===void 0||e.validate()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.domNode.style.width=e+"px"}dispose(){super.dispose()}}var eY=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},tY=function(n,e){return function(t,i){e(t,i,n)}};const iY=new _e("suggestWidgetVisible",!1,m("suggestWidgetVisible","Whether suggestion are visible")),zP="historyNavigationWidgetFocus",nY="historyNavigationForwardsEnabled",sY="historyNavigationBackwardsEnabled";let uc;const Nw=[];function oY(n,e){if(Nw.includes(e))throw new Error("Cannot register the same widget multiple times");Nw.push(e);const t=new pe,i=new _e(zP,!1).bindTo(n),s=new _e(nY,!0).bindTo(n),o=new _e(sY,!0).bindTo(n),r=()=>{i.set(!0),uc=e},a=()=>{i.set(!1),uc===e&&(uc=void 0)};return e.element===document.activeElement&&r(),t.add(e.onDidFocus(()=>r())),t.add(e.onDidBlur(()=>a())),t.add(Ye(()=>{Nw.splice(Nw.indexOf(e),1),a()})),{historyNavigationForwardsEnablement:s,historyNavigationBackwardsEnablement:o,dispose(){t.dispose()}}}let wR=class extends qG{constructor(e,t,i,s){super(e,t,i);const o=this._register(s.createScoped(this.inputBox.element));this._register(oY(o,this.inputBox))}};wR=eY([tY(3,et)],wR);let CR=class extends KRe{constructor(e,t,i,s,o=!1){super(e,t,o,i);const r=this._register(s.createScoped(this.inputBox.element));this._register(oY(r,this.inputBox))}};CR=eY([tY(3,et)],CR);Fs.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:Le.and(Le.has(zP),Le.equals(sY,!0),Le.not("isComposing"),iY.isEqualTo(!1)),primary:16,secondary:[528],handler:n=>{uc==null||uc.showPreviousValue()}});Fs.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:Le.and(Le.has(zP),Le.equals(nY,!0),Le.not("isComposing"),iY.isEqualTo(!1)),primary:18,secondary:[530],handler:n=>{uc==null||uc.showNextValue()}});function gB(n){var e,t;return((e=n.lookupKeybinding("history.showPrevious"))===null||e===void 0?void 0:e.getElectronAccelerator())==="Up"&&((t=n.lookupKeybinding("history.showNext"))===null||t===void 0?void 0:t.getElectronAccelerator())==="Down"}var YRe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,[])).next())})};const ZRe=Zi("find-selection",se.selection,m("findSelectionIcon","Icon for 'Find in Selection' in the editor find widget.")),pB=Zi("find-collapsed",se.chevronRight,m("findCollapsedIcon","Icon to indicate that the editor find widget is collapsed.")),mB=Zi("find-expanded",se.chevronDown,m("findExpandedIcon","Icon to indicate that the editor find widget is expanded.")),XRe=Zi("find-replace",se.replace,m("findReplaceIcon","Icon for 'Replace' in the editor find widget.")),QRe=Zi("find-replace-all",se.replaceAll,m("findReplaceAllIcon","Icon for 'Replace All' in the editor find widget.")),JRe=Zi("find-previous-match",se.arrowUp,m("findPreviousMatchIcon","Icon for 'Find Previous' in the editor find widget.")),eMe=Zi("find-next-match",se.arrowDown,m("findNextMatchIcon","Icon for 'Find Next' in the editor find widget.")),tMe=m("label.findDialog","Find / Replace"),iMe=m("label.find","Find"),nMe=m("placeholder.find","Find"),sMe=m("label.previousMatchButton","Previous Match"),oMe=m("label.nextMatchButton","Next Match"),rMe=m("label.toggleSelectionFind","Find in Selection"),aMe=m("label.closeButton","Close"),lMe=m("label.replace","Replace"),cMe=m("placeholder.replace","Replace"),dMe=m("label.replaceButton","Replace"),uMe=m("label.replaceAllButton","Replace All"),hMe=m("label.toggleReplaceButton","Toggle Replace"),fMe=m("title.matchesCountLimit","Only the first {0} results are highlighted, but all find operations work on the entire text.",Cd),gMe=m("label.matchesLocation","{0} of {1}"),_B=m("label.noResults","No results"),_a=419,pMe=275,mMe=pMe-54;let j0=69;const _Me=33,bB="ctrlEnterReplaceAll.windows.donotask",vB=pt?256:2048;class mE{constructor(e){this.afterLineNumber=e,this.heightInPx=_Me,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function yB(n,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionStart>0){n.stopPropagation();return}}function wB(n,e,t){const i=!!e.match(/\n/);if(t&&i&&t.selectionEndthis._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(90)&&(this._codeEditor.getOption(90)&&this._state.change({isReplaceRevealed:!1},!1),this._updateButtons()),d.hasChanged(143)&&this._tryUpdateWidgetWidth(),d.hasChanged(2)&&this.updateAccessibilitySupport(),d.hasChanged(41)){const u=this._codeEditor.getOption(41).loop;this._state.change({loop:u},!1);const h=this._codeEditor.getOption(41).addExtraSpaceOnTop;h&&!this._viewZone&&(this._viewZone=new mE(0),this._showViewZone()),!h&&this._viewZone&&this._removeViewZone()}})),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection(()=>{this._isVisible&&this._updateToggleSelectionFindButton()})),this._register(this._codeEditor.onDidFocusEditorWidget(()=>YRe(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=jD.bindTo(r),this._findFocusTracker=this._register(iu(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=VP.bindTo(r),this._replaceFocusTracker=this._register(iu(this._replaceInput.inputBox.inputElement)),this._register(this._replaceFocusTracker.onDidFocus(()=>{this._replaceInputFocused.set(!0),this._updateSearchScope()})),this._register(this._replaceFocusTracker.onDidBlur(()=>{this._replaceInputFocused.set(!1)})),this._codeEditor.addOverlayWidget(this),this._codeEditor.getOption(41).addExtraSpaceOnTop&&(this._viewZone=new mE(0)),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 GD.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(90)&&!this._isReplaceVisible&&(this._isReplaceVisible=!0,this._replaceInput.width=ys(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,mt)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){this._matchesCount.style.minWidth=j0+"px",this._state.matchesCount>=Cd?this._matchesCount.title=fMe: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>=Cd&&(t+="+");let i=String(this._state.matchesPosition);i==="0"&&(i="?"),e=Vb(gMe,i,t)}else e=_B;this._matchesCount.appendChild(document.createTextNode(e)),Q1(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),j0=Math.max(j0,this._matchesCount.clientWidth)}_getAriaLabel(e,t,i){if(e===_B)return i===""?m("ariaSearchNoResultEmpty","{0} found",e):m("ariaSearchNoResult","{0} found for '{1}'",e,i);if(t){const s=m("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)}, ${s}`:s}return m("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(90);this._toggleReplaceBtn.setEnabled(this._isVisible&&i)}_reveal(){if(this._revealTimeouts.forEach(e=>{clearTimeout(e)}),this._revealTimeouts=[],!this._isVisible){this._isVisible=!0;const e=this._codeEditor.getSelection();switch(this._codeEditor.getOption(41).autoFindInSelection){case"always":this._toggleSelectionFind.checked=!0;break;case"never":this._toggleSelectionFind.checked=!1;break;case"multiline":{const i=!!e&&e.startLineNumber!==e.endLineNumber;this._toggleSelectionFind.checked=i;break}}this._tryUpdateWidgetWidth(),this._updateButtons(),this._revealTimeouts.push(setTimeout(()=>{this._domNode.classList.add("visible"),this._domNode.setAttribute("aria-hidden","false")},0)),this._revealTimeouts.push(setTimeout(()=>{this._findInput.validate()},200)),this._codeEditor.layoutOverlayWidget(this);let t=!0;if(this._codeEditor.getOption(41).seedSearchStringFromSelection&&e){const i=this._codeEditor.getDomNode();if(i){const s=Tn(i),o=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),r=s.left+(o?o.left:0),a=o?o.top:0;if(this._viewZone&&ae.startLineNumber&&(t=!1);const l=JU(this._domNode).left;r>l&&(t=!1);const c=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());s.left+(c?c.left:0)>l&&(t=!1)}}}this._showViewZone(t)}}_hide(e){this._revealTimeouts.forEach(t=>{clearTimeout(t)}),this._revealTimeouts=[],this._isVisible&&(this._isVisible=!1,this._updateButtons(),this._domNode.classList.remove("visible"),this._domNode.setAttribute("aria-hidden","true"),this._findInput.clearMessage(),e&&this._codeEditor.focus(),this._codeEditor.layoutOverlayWidget(this),this._removeViewZone())}_layoutViewZone(e){if(!this._codeEditor.getOption(41).addExtraSpaceOnTop){this._removeViewZone();return}if(!this._isVisible)return;const i=this._viewZone;this._viewZoneId!==void 0||!i||this._codeEditor.changeViewZones(s=>{i.heightInPx=this._getHeight(),this._viewZoneId=s.addZone(i),this._codeEditor.setScrollTop(e||this._codeEditor.getScrollTop()+i.heightInPx)})}_showViewZone(e=!0){if(!this._isVisible||!this._codeEditor.getOption(41).addExtraSpaceOnTop)return;this._viewZone===void 0&&(this._viewZone=new mE(0));const i=this._viewZone;this._codeEditor.changeViewZones(s=>{if(this._viewZoneId!==void 0){const o=this._getHeight();if(o===i.heightInPx)return;const r=o-i.heightInPx;i.heightInPx=o,s.layoutZone(this._viewZoneId),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+r);return}else{let o=this._getHeight();if(o-=this._codeEditor.getOption(83).top,o<=0)return;i.heightInPx=o,this._viewZoneId=s.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))})}_tryUpdateWidgetWidth(){if(!this._isVisible||!Y4(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,s=e.minimap.minimapWidth;let o=!1,r=!1,a=!1;if(this._resized&&ys(this._domNode)>_a){this._domNode.style.maxWidth=`${i-28-s-15}px`,this._replaceInput.width=ys(this._findInput.domNode);return}if(_a+28+s>=i&&(r=!0),_a+28+s-j0>=i&&(a=!0),_a+28+s-j0>=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",r),!a&&!o&&(this._domNode.style.maxWidth=`${i-28-s-15}px`),this._findInput.layout({collapsedFindWidget:o,narrowFindWidget:a,reducedFindWidget:r}),this._resized){const l=this._findInput.inputBox.element.clientWidth;l>0&&(this._replaceInput.width=l)}else this._isReplaceVisible&&(this._replaceInput.width=ys(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&&!N.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(vB|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 yB(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"));if(e.equals(18))return wB(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea"))}_onReplaceInputKeyDown(e){if(e.equals(vB|3))if(this._keybindingService.dispatchEvent(e,e.target)){e.preventDefault();return}else{Ps&&hp&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(m("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(bB,!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 yB(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea"));if(e.equals(18))return wB(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 wR(null,this._contextViewProvider,{width:mMe,label:iMe,placeholder:nMe,appendCaseSensitiveLabel:this._keybindingLabelFor(Mt.ToggleCaseSensitiveCommand),appendWholeWordsLabel:this._keybindingLabelFor(Mt.ToggleWholeWordCommand),appendRegexLabel:this._keybindingLabelFor(Mt.ToggleRegexCommand),validation:l=>{if(l.length===0||!this._findInput.getRegex())return null;try{return new RegExp(l,"gu"),null}catch(c){return{content:c.message}}},flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>gB(this._keybindingService),inputBoxStyles:ux,toggleStyles:dx},this._contextKeyService)),this._findInput.setRegex(!!this._state.isRegex),this._findInput.setCaseSensitive(!!this._state.matchCase),this._findInput.setWholeWords(!!this._state.wholeWord),this._register(this._findInput.onKeyDown(l=>this._onFindInputKeyDown(l))),this._register(this._findInput.inputBox.onDidChange(()=>{this._ignoreChangeEvent||this._state.change({searchString:this._findInput.getValue()},!0)})),this._register(this._findInput.onDidOptionChange(()=>{this._state.change({isRegex:this._findInput.getRegex(),wholeWord:this._findInput.getWholeWords(),matchCase:this._findInput.getCaseSensitive()},!0)})),this._register(this._findInput.onCaseSensitiveKeyDown(l=>{l.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),l.preventDefault())})),this._register(this._findInput.onRegexKeyDown(l=>{l.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),l.preventDefault())})),this._register(this._findInput.inputBox.onDidHeightChange(l=>{this._tryUpdateHeight()&&this._showViewZone()})),Xn&&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 Lg({label:sMe+this._keybindingLabelFor(Mt.PreviousMatchFindAction),icon:JRe,onTrigger:()=>{eI(this._codeEditor.getAction(Mt.PreviousMatchFindAction)).run().then(void 0,mt)}})),this._nextBtn=this._register(new Lg({label:oMe+this._keybindingLabelFor(Mt.NextMatchFindAction),icon:eMe,onTrigger:()=>{eI(this._codeEditor.getAction(Mt.NextMatchFindAction)).run().then(void 0,mt)}}));const i=document.createElement("div");i.className="find-part",i.appendChild(this._findInput.domNode);const s=document.createElement("div");s.className="find-actions",i.appendChild(s),s.appendChild(this._matchesCount),s.appendChild(this._prevBtn.domNode),s.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new h0({icon:ZRe,title:rMe+this._keybindingLabelFor(Mt.ToggleSearchScopeCommand),isChecked:!1,inputActiveOptionBackground:re(kh),inputActiveOptionBorder:re(h3),inputActiveOptionForeground:re(f3)})),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)})),s.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new Lg({label:aMe+this._keybindingLabelFor(Mt.CloseFindWidgetCommand),icon:ZEe,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:l=>{l.equals(2)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),l.preventDefault())}})),this._replaceInput=this._register(new CR(null,void 0,{label:lMe,placeholder:cMe,appendPreserveCaseLabel:this._keybindingLabelFor(Mt.TogglePreserveCaseCommand),history:[],flexibleHeight:!0,flexibleWidth:!0,flexibleMaxHeight:118,showHistoryHint:()=>gB(this._keybindingService),inputBoxStyles:ux,toggleStyles:dx},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 Lg({label:dMe+this._keybindingLabelFor(Mt.ReplaceOneAction),icon:XRe,onTrigger:()=>{this._controller.replace()},onKeyDown:l=>{l.equals(1026)&&(this._closeBtn.focus(),l.preventDefault())}})),this._replaceAllBtn=this._register(new Lg({label:uMe+this._keybindingLabelFor(Mt.ReplaceAllAction),icon:QRe,onTrigger:()=>{this._controller.replaceAll()}}));const o=document.createElement("div");o.className="replace-part",o.appendChild(this._replaceInput.domNode);const r=document.createElement("div");r.className="replace-actions",o.appendChild(r),r.appendChild(this._replaceBtn.domNode),r.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new Lg({label:hMe,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=ys(this._findInput.domNode),this._replaceInput.inputBox.layout()),this._showViewZone()}})),this._toggleReplaceBtn.setExpanded(this._isReplaceVisible),this._domNode=document.createElement("div"),this._domNode.className="editor-widget find-widget",this._domNode.setAttribute("aria-hidden","true"),this._domNode.ariaLabel=tMe,this._domNode.role="dialog",this._domNode.style.width=`${_a}px`,this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(i),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(o),this._resizeSash=new Dn(this._domNode,this,{orientation:0,size:2}),this._resized=!1;let a=_a;this._register(this._resizeSash.onDidStart(()=>{a=ys(this._domNode)})),this._register(this._resizeSash.onDidChange(l=>{this._resized=!0;const c=a+l.startX-l.currentX;if(c<_a)return;const d=parseFloat(YL(this._domNode).maxWidth)||0;c>d||(this._domNode.style.width=`${c}px`,this._isReplaceVisible&&(this._replaceInput.width=ys(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())})),this._register(this._resizeSash.onDidReset(()=>{const l=ys(this._domNode);if(l<_a)return;let c=_a;if(!this._resized||l===_a){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=ys(this._findInput.domNode)),this._findInput.inputBox.layout()}))}updateAccessibilitySupport(){const e=this._codeEditor.getOption(2);this._findInput.setFocusInputOnOptionClick(e!==2)}}GD.ID="editor.contrib.findWidget";class Lg extends ua{constructor(e){super(),this._opts=e;let t="button";this._opts.className&&(t=t+" "+this._opts.className),this._opts.icon&&(t=t+" "+Te.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 s,o;if(i.equals(10)||i.equals(3)){this._opts.onTrigger(),i.preventDefault();return}(o=(s=this._opts).onKeyDown)===null||o===void 0||o.call(s,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(...Te.asClassNameArray(pB)),this._domNode.classList.add(...Te.asClassNameArray(mB))):(this._domNode.classList.remove(...Te.asClassNameArray(mB)),this._domNode.classList.add(...Te.asClassNameArray(pB)))}}Tr((n,e)=>{const t=(p,_)=>{_&&e.addRule(`.monaco-editor ${p} { background-color: ${_}; }`)};t(".findMatch",n.getColor(Ha)),t(".currentFindMatch",n.getColor(Ive)),t(".findScope",n.getColor(Tve));const i=n.getColor(Hi);t(".find-widget",i);const s=n.getColor(Jl);s&&e.addRule(`.monaco-editor .find-widget { box-shadow: 0 0 8px 2px ${s}; }`);const o=n.getColor(jj);o&&e.addRule(`.monaco-editor .find-widget { border-left: 1px solid ${o}; border-right: 1px solid ${o}; border-bottom: 1px solid ${o}; }`);const r=n.getColor(gd);r&&e.addRule(`.monaco-editor .findMatch { border: 1px ${lc(n.type)?"dotted":"solid"} ${r}; box-sizing: border-box; }`);const a=n.getColor(Nve);a&&e.addRule(`.monaco-editor .currentFindMatch { border: 2px solid ${a}; padding: 1px; box-sizing: border-box; }`);const l=n.getColor(Rve);l&&e.addRule(`.monaco-editor .findScope { border: 1px ${lc(n.type)?"dashed":"solid"} ${l}; }`);const c=n.getColor(Qe);c&&e.addRule(`.monaco-editor .find-widget { border: 1px solid ${c}; }`);const d=n.getColor(za);d&&e.addRule(`.monaco-editor .find-widget { color: ${d}; }`);const u=n.getColor(Zbe);u&&e.addRule(`.monaco-editor .find-widget.no-results .matchesCount { color: ${u}; }`);const h=n.getColor(wve);if(h)e.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${h}; }`);else{const p=n.getColor(qg);p&&e.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${p}; }`)}const f=n.getColor(IT);f&&e.addRule(` .monaco-editor .find-widget .button:not(.disabled):hover, .monaco-editor .find-widget .codicon-find-selection:hover { background-color: ${f} !important; } - `);const g=n.getColor(Co);g&&e.addRule(`.monaco-editor .find-widget .monaco-inputbox.synthetic-focus { outline-color: ${g}; }`)});var oY=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Gr=function(n,e){return function(t,i){e(t,i,n)}},Ef=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,[])).next())})},xR;const QRe=524288;function LR(n,e="single",t=!1){if(!n.hasModel())return null;const i=n.getSelection();if(e==="single"&&i.startLineNumber===i.endLineNumber||e==="multiple"){if(i.isEmpty()){const s=n.getConfiguredWordAtPosition(i.getStartPosition());if(s&&t===!1)return s.word}else if(n.getModel().getValueLengthInRange(i)this._onStateChanged(r))),this._model=null,this._register(this._editor.onDidChangeModel(()=>{const r=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),r&&this._start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!1,updateSearchScope:!1,loop:this._editor.getOption(41).loop})}))}dispose(){this.disposeModel(),super.dispose()}disposeModel(){this._model&&(this._model.dispose(),this._model=null)}_onStateChanged(e){this.saveQueryState(e),e.isRevealed&&(this._state.isRevealed?this._findWidgetVisible.set(!0):(this._findWidgetVisible.reset(),this.disposeModel())),e.searchString&&this.setGlobalBufferTerm(this._state.searchString)}saveQueryState(e){e.isRegex&&this._storageService.store("editor.isRegex",this._state.actualIsRegex,1,1),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,1,1),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,1,1),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,1,1)}loadQueryState(){this._state.change({matchCase:this._storageService.getBoolean("editor.matchCase",1,this._state.matchCase),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,this._state.wholeWord),isRegex:this._storageService.getBoolean("editor.isRegex",1,this._state.isRegex),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,this._state.preserveCase)},!1)}isFindInputFocused(){return!!QD.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=xr(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}_start(e,t){return Ef(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 s=LR(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);s&&(this._state.isRegex?i.searchString=xr(s):i.searchString=s)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){const s=LR(this._editor,e.seedSearchStringFromSelection);s&&(i.searchString=s)}if(!i.searchString&&e.seedSearchStringFromGlobalClipboard){const s=yield this.getGlobalBufferTerm();if(!this._editor.hasModel())return;s&&(i.searchString=s)}if(e.forceRevealReplace||i.isReplaceRevealed?i.isReplaceRevealed=!0:this._findWidgetVisible.get()||(i.isReplaceRevealed=!1),e.updateSearchScope){const s=this._editor.getSelections();s.some(o=>!o.isEmpty())&&(i.searchScope=s)}i.loop=e.loop,this._state.change(i,!1),this._model||(this._model=new Q_(this._editor,this._state))})}start(e,t){return this._start(e,t)}moveToNextMatch(){return this._model?(this._model.moveToNextMatch(),!0):!1}moveToPrevMatch(){return this._model?(this._model.moveToPrevMatch(),!0):!1}goToMatch(e){return this._model?(this._model.moveToMatch(e),!0):!1}replace(){return this._model?(this._model.replace(),!0):!1}replaceAll(){var e;return this._model?!((e=this._editor.getModel())===null||e===void 0)&&e.isTooLargeForHeapOperation()?(this._notificationService.warn(m("too.large.for.replaceall","The file is too large to perform a replace all operation.")),!1):(this._model.replaceAll(),!0):!1}selectAllMatches(){return this._model?(this._model.selectAllMatches(),this._editor.focus(),!0):!1}getGlobalBufferTerm(){return Ef(this,void 0,void 0,function*(){return this._editor.getOption(41).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()?this._clipboardService.readFindText():""})}setGlobalBufferTerm(e){this._editor.getOption(41).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()&&this._clipboardService.writeFindText(e)}};hs.ID="editor.contrib.findController";hs=xR=oY([Gr(1,tt),Gr(2,Qf),Gr(3,hy),Gr(4,Dn)],hs);let DR=class extends hs{constructor(e,t,i,s,o,r,a,l){super(e,i,a,l,r),this._contextViewService=t,this._keybindingService=s,this._themeService=o,this._widget=null,this._findOptionsWidget=null}_start(e,t){const i=Object.create(null,{_start:{get:()=>super._start}});return Ef(this,void 0,void 0,function*(){this._widget||this._createFindWidget();const s=this._editor.getSelection();let o=!1;switch(this._editor.getOption(41).autoFindInSelection){case"always":o=!0;break;case"never":o=!1;break;case"multiline":{o=!!s&&s.startLineNumber!==s.endLineNumber;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 ek(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService)),this._findOptionsWidget=this._register(new JD(this._editor,this._state,this._keybindingService))}};DR=oY([Gr(1,Iu),Gr(2,tt),Gr(3,vi),Gr(4,co),Gr(5,Dn),Gr(6,Qf),Gr(7,hy)],DR);const JRe=lj(new aj({id:Pt.StartFindAction,label:m("startFindAction","Find"),alias:"Find",precondition:xe.or($.focus,xe.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:I.MenubarEditMenu,group:"3_find",title:m({key:"miFind",comment:["&& denotes a mnemonic"]},"&&Find"),order:1}}));JRe.addImplementation(0,(n,e,t)=>{const i=hs.get(e);return i?i.start({forceRevealReplace:!1,seedSearchStringFromSelection:e.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(41).globalFindClipboard,shouldFocus:1,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(41).loop}):!1});const eMe={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:m("actions.find.isRegexOverride",`Overrides "Use Regular Expression" flag. + `);const g=n.getColor(vo);g&&e.addRule(`.monaco-editor .find-widget .monaco-inputbox.synthetic-focus { outline-color: ${g}; }`)});var rY=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},qr=function(n,e){return function(t,i){e(t,i,n)}},Tf=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,[])).next())})},SR;const bMe=524288;function xR(n,e="single",t=!1){if(!n.hasModel())return null;const i=n.getSelection();if(e==="single"&&i.startLineNumber===i.endLineNumber||e==="multiple"){if(i.isEmpty()){const s=n.getConfiguredWordAtPosition(i.getStartPosition());if(s&&t===!1)return s.word}else if(n.getModel().getValueLengthInRange(i)this._onStateChanged(r))),this._model=null,this._register(this._editor.onDidChangeModel(()=>{const r=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),r&&this._start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!1,updateSearchScope:!1,loop:this._editor.getOption(41).loop})}))}dispose(){this.disposeModel(),super.dispose()}disposeModel(){this._model&&(this._model.dispose(),this._model=null)}_onStateChanged(e){this.saveQueryState(e),e.isRevealed&&(this._state.isRevealed?this._findWidgetVisible.set(!0):(this._findWidgetVisible.reset(),this.disposeModel())),e.searchString&&this.setGlobalBufferTerm(this._state.searchString)}saveQueryState(e){e.isRegex&&this._storageService.store("editor.isRegex",this._state.actualIsRegex,1,1),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,1,1),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,1,1),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,1,1)}loadQueryState(){this._state.change({matchCase:this._storageService.getBoolean("editor.matchCase",1,this._state.matchCase),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,this._state.wholeWord),isRegex:this._storageService.getBoolean("editor.isRegex",1,this._state.isRegex),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,this._state.preserveCase)},!1)}isFindInputFocused(){return!!jD.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=Sr(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}_start(e,t){return Tf(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 s=xR(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);s&&(this._state.isRegex?i.searchString=Sr(s):i.searchString=s)}else if(e.seedSearchStringFromSelection==="multiple"&&!e.updateSearchScope){const s=xR(this._editor,e.seedSearchStringFromSelection);s&&(i.searchString=s)}if(!i.searchString&&e.seedSearchStringFromGlobalClipboard){const s=yield this.getGlobalBufferTerm();if(!this._editor.hasModel())return;s&&(i.searchString=s)}if(e.forceRevealReplace||i.isReplaceRevealed?i.isReplaceRevealed=!0:this._findWidgetVisible.get()||(i.isReplaceRevealed=!1),e.updateSearchScope){const s=this._editor.getSelections();s.some(o=>!o.isEmpty())&&(i.searchScope=s)}i.loop=e.loop,this._state.change(i,!1),this._model||(this._model=new nb(this._editor,this._state))})}start(e,t){return this._start(e,t)}moveToNextMatch(){return this._model?(this._model.moveToNextMatch(),!0):!1}moveToPrevMatch(){return this._model?(this._model.moveToPrevMatch(),!0):!1}goToMatch(e){return this._model?(this._model.moveToMatch(e),!0):!1}replace(){return this._model?(this._model.replace(),!0):!1}replaceAll(){var e;return this._model?!((e=this._editor.getModel())===null||e===void 0)&&e.isTooLargeForHeapOperation()?(this._notificationService.warn(m("too.large.for.replaceall","The file is too large to perform a replace all operation.")),!1):(this._model.replaceAll(),!0):!1}selectAllMatches(){return this._model?(this._model.selectAllMatches(),this._editor.focus(),!0):!1}getGlobalBufferTerm(){return Tf(this,void 0,void 0,function*(){return this._editor.getOption(41).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()?this._clipboardService.readFindText():""})}setGlobalBufferTerm(e){this._editor.getOption(41).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()&&this._clipboardService.writeFindText(e)}};us.ID="editor.contrib.findController";us=SR=rY([qr(1,et),qr(2,tg),qr(3,gy),qr(4,xn)],us);let LR=class extends us{constructor(e,t,i,s,o,r,a,l){super(e,i,a,l,r),this._contextViewService=t,this._keybindingService=s,this._themeService=o,this._widget=null,this._findOptionsWidget=null}_start(e,t){const i=Object.create(null,{_start:{get:()=>super._start}});return Tf(this,void 0,void 0,function*(){this._widget||this._createFindWidget();const s=this._editor.getSelection();let o=!1;switch(this._editor.getOption(41).autoFindInSelection){case"always":o=!0;break;case"never":o=!1;break;case"multiline":{o=!!s&&s.startLineNumber!==s.endLineNumber;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 GD(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService)),this._findOptionsWidget=this._register(new qD(this._editor,this._state,this._keybindingService))}};LR=rY([qr(1,Tu),qr(2,et),qr(3,bi),qr(4,ro),qr(5,xn),qr(6,tg),qr(7,gy)],LR);const vMe=aj(new rj({id:Mt.StartFindAction,label:m("startFindAction","Find"),alias:"Find",precondition:Le.or($.focus,Le.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:I.MenubarEditMenu,group:"3_find",title:m({key:"miFind",comment:["&& denotes a mnemonic"]},"&&Find"),order:1}}));vMe.addImplementation(0,(n,e,t)=>{const i=us.get(e);return i?i.start({forceRevealReplace:!1,seedSearchStringFromSelection:e.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(41).globalFindClipboard,shouldFocus:1,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(41).loop}):!1});const yMe={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:m("actions.find.isRegexOverride",`Overrides "Use Regular Expression" flag. The flag will not be saved for the future. 0: Do Nothing 1: True @@ -3680,17 +3558,18 @@ The flag will not be saved for the future. The flag will not be saved for the future. 0: Do Nothing 1: True -2: False`)},findInSelection:{type:"boolean"}}}}]};class tMe extends Jt{constructor(){super({id:Pt.StartFindWithArgs,label:m("startFindWithArgsAction","Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:100},description:eMe})}run(e,t,i){return Ef(this,void 0,void 0,function*(){const s=hs.get(t);if(s){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 s.start({forceRevealReplace:!1,seedSearchStringFromSelection:s.getState().searchString.length===0&&t.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:1,shouldAnimate:!0,updateSearchScope:(i==null?void 0:i.findInSelection)||!1,loop:t.getOption(41).loop},o),s.setGlobalBufferTerm(s.getState().searchString)}})}}class iMe extends Jt{constructor(){super({id:Pt.StartFindWithSelection,label:m("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 Ef(this,void 0,void 0,function*(){const i=hs.get(t);i&&(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),i.setGlobalBufferTerm(i.getState().searchString))})}}class rY extends Jt{run(e,t){return Ef(this,void 0,void 0,function*(){const i=hs.get(t);i&&!this._run(i)&&(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:i.getState().searchString.length===0&&t.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),this._run(i))})}}class nMe extends rY{constructor(){super({id:Pt.NextMatchFindAction,label:m("findNextMatchAction","Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:$.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:xe.and($.focus,QD),primary:3,weight:100}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class sMe extends rY{constructor(){super({id:Pt.PreviousMatchFindAction,label:m("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:$.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:xe.and($.focus,QD),primary:1027,weight:100}]})}_run(e){return e.moveToPrevMatch()}}class oMe extends Jt{constructor(){super({id:Pt.GoToMatchFindAction,label:m("findMatchAction.goToMatch","Go to Match..."),alias:"Go to Match...",precondition:Ac}),this._highlightDecorations=[]}run(e,t,i){const s=hs.get(t);if(!s)return;const o=s.getState().matchesCount;if(o<1){e.get(Dn).notify({severity:Zq.Warning,message:m("findMatchAction.noResults","No matches. Try searching for something else.")});return}const a=e.get(S3).createInputBox();a.placeholder=m("findMatchAction.inputPlaceHolder","Type a number to go to a specific match (between 1 and {0})",o);const l=d=>{const u=parseInt(d);if(isNaN(u))return;const h=s.getState().matchesCount;if(u>0&&u<=h)return u-1;if(u<0&&u>=-h)return h+u},c=d=>{const u=l(d);if(typeof u=="number"){a.validationMessage=void 0,s.goToMatch(u);const h=s.getState().currentMatch;h&&this.addDecorations(t,h)}else a.validationMessage=m("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",s.getState().matchesCount),this.clearDecorations(t)};a.onDidChangeValue(d=>{c(d)}),a.onDidAccept(()=>{const d=l(a.value);typeof d=="number"?(s.goToMatch(d),a.hide()):a.validationMessage=m("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",s.getState().matchesCount)}),a.onDidHide(()=>{this.clearDecorations(t),a.dispose()}),a.show()}clearDecorations(e){e.changeDecorations(t=>{this._highlightDecorations=t.deltaDecorations(this._highlightDecorations,[])})}addDecorations(e,t){e.changeDecorations(i=>{this._highlightDecorations=i.deltaDecorations(this._highlightDecorations,[{range:t,options:{description:"find-match-quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"find-match-quick-access-range-highlight-overview",overviewRuler:{color:rn(rye),position:Go.Full}}}])})}}class aY extends Jt{run(e,t){return Ef(this,void 0,void 0,function*(){const i=hs.get(t);if(!i)return;const s=LR(t,"single",!1);s&&i.setSearchString(s),this._run(i)||(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),this._run(i))})}}class rMe extends aY{constructor(){super({id:Pt.NextSelectionMatchFindAction,label:m("nextSelectionMatchFindAction","Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:$.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}class aMe extends aY{constructor(){super({id:Pt.PreviousSelectionMatchFindAction,label:m("previousSelectionMatchFindAction","Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:$.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}}const lMe=lj(new aj({id:Pt.StartFindReplaceAction,label:m("startReplace","Replace"),alias:"Replace",precondition:xe.or($.focus,xe.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:I.MenubarEditMenu,group:"3_find",title:m({key:"miReplace",comment:["&& denotes a mnemonic"]},"&&Replace"),order:2}}));lMe.addImplementation(0,(n,e,t)=>{if(!e.hasModel()||e.getOption(90))return!1;const i=hs.get(e);if(!i)return!1;const s=e.getSelection(),o=i.isFindInputFocused(),r=!s.isEmpty()&&s.startLineNumber===s.endLineNumber&&e.getOption(41).seedSearchStringFromSelection!=="never"&&!o,a=o||r?2:1;return i.start({forceRevealReplace:!0,seedSearchStringFromSelection:r?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(41).seedSearchStringFromSelection!=="never",shouldFocus:a,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(41).loop})});Tr(hs.ID,DR,0);Xe(tMe);Xe(iMe);Xe(nMe);Xe(sMe);Xe(oMe);Xe(rMe);Xe(aMe);const pa=Er.bindToContribution(hs.get);Ee(new pa({id:Pt.CloseFindWidgetCommand,precondition:Ac,handler:n=>n.closeFindWidget(),kbOpts:{weight:105,kbExpr:xe.and($.focus,xe.not("isComposing")),primary:9,secondary:[1033]}}));Ee(new pa({id:Pt.ToggleCaseSensitiveCommand,precondition:void 0,handler:n=>n.toggleCaseSensitive(),kbOpts:{weight:105,kbExpr:$.focus,primary:Nw.primary,mac:Nw.mac,win:Nw.win,linux:Nw.linux}}));Ee(new pa({id:Pt.ToggleWholeWordCommand,precondition:void 0,handler:n=>n.toggleWholeWords(),kbOpts:{weight:105,kbExpr:$.focus,primary:Rw.primary,mac:Rw.mac,win:Rw.win,linux:Rw.linux}}));Ee(new pa({id:Pt.ToggleRegexCommand,precondition:void 0,handler:n=>n.toggleRegex(),kbOpts:{weight:105,kbExpr:$.focus,primary:Mw.primary,mac:Mw.mac,win:Mw.win,linux:Mw.linux}}));Ee(new pa({id:Pt.ToggleSearchScopeCommand,precondition:void 0,handler:n=>n.toggleSearchScope(),kbOpts:{weight:105,kbExpr:$.focus,primary:Pw.primary,mac:Pw.mac,win:Pw.win,linux:Pw.linux}}));Ee(new pa({id:Pt.TogglePreserveCaseCommand,precondition:void 0,handler:n=>n.togglePreserveCase(),kbOpts:{weight:105,kbExpr:$.focus,primary:Ow.primary,mac:Ow.mac,win:Ow.win,linux:Ow.linux}}));Ee(new pa({id:Pt.ReplaceOneAction,precondition:Ac,handler:n=>n.replace(),kbOpts:{weight:105,kbExpr:$.focus,primary:3094}}));Ee(new pa({id:Pt.ReplaceOneAction,precondition:Ac,handler:n=>n.replace(),kbOpts:{weight:105,kbExpr:xe.and($.focus,H3),primary:3}}));Ee(new pa({id:Pt.ReplaceAllAction,precondition:Ac,handler:n=>n.replaceAll(),kbOpts:{weight:105,kbExpr:$.focus,primary:2563}}));Ee(new pa({id:Pt.ReplaceAllAction,precondition:Ac,handler:n=>n.replaceAll(),kbOpts:{weight:105,kbExpr:xe.and($.focus,H3),primary:void 0,mac:{primary:2051}}}));Ee(new pa({id:Pt.SelectAllMatchesAction,precondition:Ac,handler:n=>n.selectAllMatches(),kbOpts:{weight:105,kbExpr:$.focus,primary:515}}));const Ww=E("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hcDark:null,hcLight:null},m("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);E("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hcDark:null,hcLight:null},m("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);E("editor.wordHighlightTextBackground",{light:Ww,dark:Ww,hcDark:Ww,hcLight:Ww},m("wordHighlightText","Background color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0);const Vw=E("editor.wordHighlightBorder",{light:null,dark:null,hcDark:Gt,hcLight:Gt},m("wordHighlightBorder","Border color of a symbol during read-access, like reading a variable."));E("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:Gt,hcLight:Gt},m("wordHighlightStrongBorder","Border color of a symbol during write-access, like writing to a variable."));E("editor.wordHighlightTextBorder",{light:Vw,dark:Vw,hcDark:Vw,hcLight:Vw},m("wordHighlightTextBorder","Border color of a textual occurrence for a symbol."));const cMe=E("editorOverviewRuler.wordHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},m("overviewRulerWordHighlightForeground","Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),dMe=E("editorOverviewRuler.wordHighlightStrongForeground",{dark:"#C0A0C0CC",light:"#C0A0C0CC",hcDark:"#C0A0C0CC",hcLight:"#C0A0C0CC"},m("overviewRulerWordHighlightStrongForeground","Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),uMe=E("editorOverviewRuler.wordHighlightTextForeground",{dark:h_,light:h_,hcDark:h_,hcLight:h_},m("overviewRulerWordHighlightTextForeground","Overview ruler marker color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0);et.register({description:"word-highlight-strong",stickiness:1,className:"wordHighlightStrong",overviewRuler:{color:rn(dMe),position:Go.Center},minimap:{color:rn(_D),position:Js.Inline}});et.register({description:"word-highlight-text",stickiness:1,className:"wordHighlightText",overviewRuler:{color:rn(uMe),position:Go.Center},minimap:{color:rn(_D),position:Js.Inline}});const hMe=et.register({description:"selection-highlight-overview",stickiness:1,className:"selectionHighlight",overviewRuler:{color:rn(h_),position:Go.Center},minimap:{color:rn(_D),position:Js.Inline}}),fMe=et.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight"});et.register({description:"word-highlight",stickiness:1,className:"wordHighlight",overviewRuler:{color:rn(cMe),position:Go.Center},minimap:{color:rn(_D),position:Js.Inline}});function gMe(n){return n?fMe:hMe}Nr((n,e)=>{const t=n.getColor(mP);t&&e.addRule(`.monaco-editor .selectionHighlight { background-color: ${t.transparent(.5)}; }`)});var pMe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},mMe=function(n,e){return function(t,i){e(t,i,n)}},kR;function Ru(n,e){const t=e.filter(i=>!n.find(s=>s.equals(i)));if(t.length>=1){const i=t.map(o=>`line ${o.viewState.position.lineNumber} column ${o.viewState.position.column}`).join(", "),s=t.length===1?m("cursorAdded","Cursor added: {0}",i):m("cursorsAdded","Cursors added: {0}",i);tv(s)}}class _Me extends Jt{constructor(){super({id:"editor.action.insertCursorAbove",label:m("mutlicursor.insertAbove","Add Cursor Above"),alias:"Add Cursor Above",precondition:void 0,kbOpts:{kbExpr:$.editorTextFocus,primary:2576,linux:{primary:1552,secondary:[3088]},weight:100},menuOpts:{menuId:I.MenubarSelectionMenu,group:"3_multi",title:m({key:"miInsertCursorAbove",comment:["&& denotes a mnemonic"]},"&&Add Cursor Above"),order:2}})}run(e,t,i){if(!t.hasModel())return;let s=!0;i&&i.logicalLine===!1&&(s=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const r=o.getCursorStates();o.setCursorStates(i.source,3,bn.addCursorUp(o,r,s)),o.revealTopMostCursor(i.source),Ru(r,o.getCursorStates())}}class bMe extends Jt{constructor(){super({id:"editor.action.insertCursorBelow",label:m("mutlicursor.insertBelow","Add Cursor Below"),alias:"Add Cursor Below",precondition:void 0,kbOpts:{kbExpr:$.editorTextFocus,primary:2578,linux:{primary:1554,secondary:[3090]},weight:100},menuOpts:{menuId:I.MenubarSelectionMenu,group:"3_multi",title:m({key:"miInsertCursorBelow",comment:["&& denotes a mnemonic"]},"A&&dd Cursor Below"),order:3}})}run(e,t,i){if(!t.hasModel())return;let s=!0;i&&i.logicalLine===!1&&(s=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const r=o.getCursorStates();o.setCursorStates(i.source,3,bn.addCursorDown(o,r,s)),o.revealBottomMostCursor(i.source),Ru(r,o.getCursorStates())}}class vMe extends Jt{constructor(){super({id:"editor.action.insertCursorAtEndOfEachLineSelected",label:m("mutlicursor.insertAtEndOfEachLineSelected","Add Cursors to Line Ends"),alias:"Add Cursors to Line Ends",precondition:void 0,kbOpts:{kbExpr:$.editorTextFocus,primary:1575,weight:100},menuOpts:{menuId:I.MenubarSelectionMenu,group:"3_multi",title:m({key:"miInsertCursorAtEndOfEachLineSelected",comment:["&& denotes a mnemonic"]},"Add C&&ursors to Line Ends"),order:4}})}getCursorsForSelection(e,t,i){if(!e.isEmpty()){for(let s=e.startLineNumber;s1&&i.push(new ct(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const i=t.getModel(),s=t.getSelections(),o=t._getViewModel(),r=o.getCursorStates(),a=[];s.forEach(l=>this.getCursorsForSelection(l,i,a)),a.length>0&&t.setSelections(a),Ru(r,o.getCursorStates())}}class yMe extends Jt{constructor(){super({id:"editor.action.addCursorsToBottom",label:m("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(),s=t.getModel().getLineCount(),o=[];for(let l=i[0].startLineNumber;l<=s;l++)o.push(new ct(l,i[0].startColumn,l,i[0].endColumn));const r=t._getViewModel(),a=r.getCursorStates();o.length>0&&t.setSelections(o),Ru(a,r.getCursorStates())}}class wMe extends Jt{constructor(){super({id:"editor.action.addCursorsToTop",label:m("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(),s=[];for(let a=i[0].startLineNumber;a>=1;a--)s.push(new ct(a,i[0].startColumn,a,i[0].endColumn));const o=t._getViewModel(),r=o.getCursorStates();s.length>0&&t.setSelections(s),Ru(r,o.getCursorStates())}}class zw{constructor(e,t,i){this.selections=e,this.revealRange=t,this.revealScrollType=i}}class Ov{static create(e,t){if(!e.hasModel())return null;const i=t.getState();if(!e.hasTextFocus()&&i.isRevealed&&i.searchString.length>0)return new Ov(e,t,!1,i.searchString,i.wholeWord,i.matchCase,null);let s=!1,o,r;const a=e.getSelections();a.length===1&&a[0].isEmpty()?(s=!0,o=!0,r=!0):(o=i.wholeWord,r=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 ct(l.startLineNumber,u.startColumn,l.startLineNumber,u.endColumn)}else c=e.getModel().getValueInRange(l).replace(/\r\n/g,` -`);return new Ov(e,t,s,c,o,r,d)}constructor(e,t,i,s,o,r,a){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=i,this.searchText=s,this.wholeWord=o,this.matchCase=r,this.currentMatch=a}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new zw(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 zw(t.slice(0,t.length-1).concat(e),e,0)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const s=this.currentMatch;return this.currentMatch=null,s}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1);return i?new ct(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 zw(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 zw(t.slice(0,t.length-1).concat(e),e,0)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const s=this.currentMatch;return this.currentMatch=null,s}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1);return i?new ct(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}selectAll(e){if(!this._editor.hasModel())return[];this.findController.highlightFindOptions();const t=this._editor.getModel();return e?t.findMatches(this.searchText,e,!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1,1073741824):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1,1073741824)}}class Af extends Y{static get(e){return e.getContribution(Af.ID)}constructor(e){super(),this._sessionDispose=this._register(new pe),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=Ov.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(s=>{this._ignoreSelectionChange||this._endSession()})),this._sessionDispose.add(this._editor.onDidBlurEditorText(()=>{this._endSession()})),this._sessionDispose.add(e.getState().onFindReplaceStateChange(s=>{(s.matchCase||s.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 ct(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 s=e.getState().matchCase;if(!lY(this._editor.getModel(),t,s)){const r=this._editor.getModel(),a=[];for(let l=0,c=t.length;l0&&i.isRegex){const s=this._editor.getModel();i.searchScope?t=s.findMatches(i.searchString,i.searchScope,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(129):null,!1,1073741824):t=s.findMatches(i.searchString,!0,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(129):null,!1,1073741824)}else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll(i.searchScope)}if(t.length>0){const s=this._editor.getSelection();for(let o=0,r=t.length;onew ct(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn)))}}}Af.ID="editor.contrib.multiCursorController";class u0 extends Jt{run(e,t){const i=Af.get(t);if(!i)return;const s=t._getViewModel();if(s){const o=s.getCursorStates(),r=hs.get(t);if(r)this._run(i,r);else{const a=e.get(yt).createInstance(hs,t);this._run(i,a),a.dispose()}Ru(o,s.getCursorStates())}}}class CMe extends u0{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:m("addSelectionToNextFindMatch","Add Selection To Next Find Match"),alias:"Add Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:$.focus,primary:2082,weight:100},menuOpts:{menuId:I.MenubarSelectionMenu,group:"3_multi",title:m({key:"miAddSelectionToNextFindMatch",comment:["&& denotes a mnemonic"]},"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}class SMe extends u0{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:m("addSelectionToPreviousFindMatch","Add Selection To Previous Find Match"),alias:"Add Selection To Previous Find Match",precondition:void 0,menuOpts:{menuId:I.MenubarSelectionMenu,group:"3_multi",title:m({key:"miAddSelectionToPreviousFindMatch",comment:["&& denotes a mnemonic"]},"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}class xMe extends u0{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:m("moveSelectionToNextFindMatch","Move Last Selection To Next Find Match"),alias:"Move Last Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:$.focus,primary:Bn(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}class LMe extends u0{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:m("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 DMe extends u0{constructor(){super({id:"editor.action.selectHighlights",label:m("selectAllOccurrencesOfFindMatch","Select All Occurrences of Find Match"),alias:"Select All Occurrences of Find Match",precondition:void 0,kbOpts:{kbExpr:$.focus,primary:3114,weight:100},menuOpts:{menuId:I.MenubarSelectionMenu,group:"3_multi",title:m({key:"miSelectHighlights",comment:["&& denotes a mnemonic"]},"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}class kMe extends u0{constructor(){super({id:"editor.action.changeAll",label:m("changeAll.label","Change All Occurrences"),alias:"Change All Occurrences",precondition:xe.and($.writable,$.editorTextFocus),kbOpts:{kbExpr:$.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}class EMe{constructor(e,t,i,s,o){this._model=e,this._searchText=t,this._matchCase=i,this._wordSeparators=s,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(N.compareRangesUsingStarts)),this._cachedFindMatches}}let Fv=kR=class extends Y{constructor(e,t){super(),this._languageFeaturesService=t,this.editor=e,this._isEnabled=e.getOption(107),this._decorations=e.createDecorationsCollection(),this.updateSoon=this._register(new Di(()=>this._update(),300)),this.state=null,this._register(e.onDidChangeConfiguration(s=>{this._isEnabled=e.getOption(107)})),this._register(e.onDidChangeCursorSelection(s=>{this._isEnabled&&(s.selection.isEmpty()?s.reason===3?(this.state&&this._setState(null),this.updateSoon.schedule()):this._setState(null):this._update())})),this._register(e.onDidChangeModel(s=>{this._setState(null)})),this._register(e.onDidChangeModelContent(s=>{this._isEnabled&&this.updateSoon.schedule()}));const i=hs.get(e);i&&this._register(i.getState().onFindReplaceStateChange(s=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState(kR._createState(this.state,this._isEnabled,this.editor))}static _createState(e,t,i){if(!t||!i.hasModel())return null;const s=i.getSelection();if(s.startLineNumber!==s.endLineNumber)return null;const o=Af.get(i);if(!o)return null;const r=hs.get(i);if(!r)return null;let a=o.getSession(r);if(!a){const d=i.getSelections();if(d.length>1){const h=r.getState().matchCase;if(!lY(i.getModel(),d,h))return null}a=Ov.create(i,r)}if(!a||a.currentMatch||/^[ \t]+$/.test(a.searchText)||a.searchText.length>200)return null;const l=r.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 EMe(i.getModel(),a.searchText,a.matchCase,a.wholeWord?i.getOption(129):null,e)}_setState(e){if(this.state=e,!this.state){this._decorations.clear();return}if(!this.editor.hasModel())return;const t=this.editor.getModel();if(t.isTooLargeForTokenization())return;const i=this.state.findMatches(),s=this.editor.getSelections();s.sort(N.compareRangesUsingStarts);const o=[];for(let l=0,c=0,d=i.length,u=s.length;l=u)o.push(h),l++;else{const f=N.compareRangesUsingStarts(h,s[c]);f<0?((s[c].isEmpty()||!N.areIntersecting(h,s[c]))&&o.push(h),l++):(f>0||l++,c++)}}const r=this._languageFeaturesService.documentHighlightProvider.has(t)&&this.editor.getOption(80),a=o.map(l=>({range:l,options:gMe(r)}));this._decorations.set(a)}dispose(){this._setState(null),super.dispose()}};Fv.ID="editor.contrib.selectionHighlighter";Fv=kR=pMe([mMe(1,nt)],Fv);function lY(n,e,t){const i=DB(n,e[0],!t);for(let s=1,o=e.length;sthis._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(71),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(71)&&(this._matchBrackets=this._editor.getOption(71),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const s=i.getStartPosition(),o=e.bracketPairs.matchBracket(s);let r=null;if(o)o[0].containsPosition(s)&&!o[1].containsPosition(s)?r=o[1].getStartPosition():o[1].containsPosition(s)&&(r=o[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(s);if(a)r=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(s);l&&l.range&&(r=l.range.getStartPosition())}}return r?new ct(r.lineNumber,r.column,r.lineNumber,r.column):new ct(s.lineNumber,s.column,s.lineNumber,s.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(s=>{const o=s.getStartPosition();let r=t.bracketPairs.matchBracket(o);if(!r&&(r=t.bracketPairs.findEnclosingBrackets(o),!r)){const c=t.bracketPairs.findNextBracket(o);c&&c.range&&(r=t.bracketPairs.matchBracket(c.range.getStartPosition()))}let a=null,l=null;if(r){r.sort(N.compareRangesUsingStarts);const[c,d]=r;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 ct(a.lineNumber,a.column,l.lineNumber,l.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const s=i.getPosition();let o=t.bracketPairs.matchBracket(s);o||(o=t.bracketPairs.findEnclosingBrackets(s)),o&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:o[0],text:""},{range:o[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const s=i.brackets;s&&(e[t++]={range:s[0],options:i.options},e[t++]={range:s[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 s=[];this._lastVersionId===i&&(s=this._lastBracketsData);const o=[];let r=0;for(let u=0,h=e.length;u1&&o.sort(V.compare);const a=[];let l=0,c=0;const d=s.length;for(let u=0,h=o.length;us.target.position?s.target.position.lineNumber:0,this._opts=EB(this._editor.getOption(77)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(s=>{if(s.hasChanged(77)){const o=EB(this._editor.getOption(77));if(this._opts.equals(o))return;this._opts=o,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(s=>this._onEditorMouseMove(new CE(s,this._opts)))),this._register(this._editor.onMouseDown(s=>this._onEditorMouseDown(new CE(s,this._opts)))),this._register(this._editor.onMouseUp(s=>this._onEditorMouseUp(new CE(s,this._opts)))),this._register(this._editor.onKeyDown(s=>this._onEditorKeyDown(new kB(s,this._opts)))),this._register(this._editor.onKeyUp(s=>this._onEditorKeyUp(new kB(s,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(s=>this._onDidChangeCursorSelection(s))),this._register(this._editor.onDidChangeModel(s=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(s=>{(s.scrollTopChanged||s.scrollLeftChanged)&&this._resetHandler()}))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=this._extractLineNumberFromMouseEvent(e)}_onEditorMouseUp(e){const t=this._extractLineNumberFromMouseEvent(e);this._hasTriggerKeyOnMouseDown&&this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t&&this._onExecute.fire(e)}_onEditorKeyDown(e){this._lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}}var FMe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Sl=function(n,e){return function(t,i){e(t,i,n)}};let Vm=class extends Tm{constructor(e,t,i,s,o,r,a,l,c,d,u,h,f){super(e,Object.assign(Object.assign({},s.getRawOptions()),{overflowWidgetsDomNode:s.getOverflowWidgetsDomNode()}),i,o,r,a,l,c,d,u,h,f),this._parentEditor=s,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(s.onDidChangeConfiguration(g=>this._onParentConfigurationChanged(g)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){HL(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};Vm=FMe([Sl(4,yt),Sl(5,qt),Sl(6,gs),Sl(7,tt),Sl(8,co),Sl(9,Dn),Sl(10,Eu),Sl(11,ao),Sl(12,nt)],Vm);const AB=new H(new ft(0,122,204)),BMe={showArrow:!0,showFrame:!0,className:"",frameColor:AB,arrowColor:AB,keepEditorSelection:!1},WMe="vs.editor.contrib.zoneWidget";class VMe{constructor(e,t,i,s,o,r,a,l){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=s,this.showInHiddenAreas=a,this.ordinal=l,this._onDomNodeTop=o,this._onComputedHeight=r}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class zMe{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class tk{constructor(e){this._editor=e,this._ruleName=tk._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),h9(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(){h9(this._ruleName),lT(`.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:N.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}}tk._IdGenerator=new t3(".arrow-decoration-");class HMe{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new pe,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=Nl(t),HL(this.options,BMe,!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 s=this._getWidth(i);this.domNode.style.width=s+"px",this.domNode.style.left=this._getLeft(i)+"px",this._onWidth(s)}))}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 tk(this.editor),this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()}style(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()}_applyStyles(){if(this.container&&this.options.frameColor){const e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){const e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&e.minimap.minimapLeft===0?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){var t;if(this.domNode.style.height=`${e}px`,this.container){const i=e-this._decoratingElementsHeight();this.container.style.height=`${i}px`;const s=this.editor.getLayoutInfo();this._doLayout(i,this._getWidth(s))}(t=this._resizeSash)===null||t===void 0||t.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(e)return e.getStartPosition()}show(e,t){const i=N.isIRange(e)?N.lift(e):N.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:et.EMPTY}])}hide(){var e;this._viewZone&&(this.editor.changeViewZones(t=>{this._viewZone&&t.removeZone(this._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),(e=this._arrow)===null||e===void 0||e.hide(),this._positionMarkerId.clear()}_decoratingElementsHeight(){const e=this.editor.getOption(66);let t=0;if(this.options.showArrow){const i=Math.round(e/3);t+=2*i}if(this.options.showFrame){const i=Math.round(e/9);t+=2*i}return t}_showImpl(e,t){const i=e.getStartPosition(),s=this.editor.getLayoutInfo(),o=this._getWidth(s);this.domNode.style.width=`${o}px`,this.domNode.style.left=this._getLeft(s)+"px";const r=document.createElement("div");r.style.overflow="hidden";const a=this.editor.getOption(66);if(!this.options.allowUnlimitedHeight){const h=Math.max(12,this.editor.getLayoutInfo().height/a*.8);t=Math.min(t,h)}let l=0,c=0;if(this._arrow&&this.options.showArrow&&(l=Math.round(a/3),this._arrow.height=l,this._arrow.show(i)),this.options.showFrame&&(c=Math.round(a/9)),this.editor.changeViewZones(h=>{this._viewZone&&h.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new VMe(r,i.lineNumber,i.column,t,f=>this._onViewZoneTop(f),f=>this._onViewZoneHeight(f),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=h.addZone(this._viewZone),this._overlayWidget=new zMe(WMe+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){const h=this.options.frameWidth?this.options.frameWidth:c;this.container.style.borderTopWidth=h+"px",this.container.style.borderBottomWidth=h+"px"}const d=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=l+"px",this.container.style.height=d+"px",this.container.style.overflow="hidden"),this._doLayout(d,o),this.options.keepEditorSelection||this.editor.setSelection(e);const u=this.editor.getModel();if(u){const h=u.validateRange(new N(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(h,h.startLineNumber===u.getLineCount())}}revealRange(e,t){t?this.editor.revealLineNearTop(e.endLineNumber,0):this.editor.revealRange(e,0)}setCssClass(e,t){this.container&&(t&&this.container.classList.remove(t),this.container.classList.add(e))}_onWidth(e){}_doLayout(e,t){}_relayout(e){this._viewZone&&this._viewZone.heightInLines!==e&&this.editor.changeViewZones(t=>{this._viewZone&&(this._viewZone.heightInLines=e,t.layoutZone(this._viewZone.id))})}_initSash(){if(this._resizeSash)return;this._resizeSash=this._disposables.add(new En(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.state=0);let e;this._disposables.add(this._resizeSash.onDidStart(t=>{this._viewZone&&(e={startY:t.startY,heightInLines:this._viewZone.heightInLines})})),this._disposables.add(this._resizeSash.onDidEnd(()=>{e=void 0})),this._disposables.add(this._resizeSash.onDidChange(t=>{if(e){const i=(t.currentY-e.startY)/this.editor.getOption(66),s=i<0?Math.ceil(i):Math.floor(i),o=e.heightInLines+s;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 cY=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},dY=function(n,e){return function(t,i){e(t,i,n)}};const uY=at("IPeekViewService");gt(uY,class{constructor(){this._widgets=new Map}addExclusiveWidget(n,e){const t=this._widgets.get(n);t&&(t.listener.dispose(),t.widget.dispose());const i=()=>{const s=this._widgets.get(n);s&&s.widget===e&&(s.listener.dispose(),this._widgets.delete(n))};this._widgets.set(n,{widget:e,listener:e.onDidClose(i)})}},1);var no;(function(n){n.inPeekEditor=new _e("inReferenceSearchEditor",!0,m("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),n.notInPeekEditor=n.inPeekEditor.toNegated()})(no||(no={}));let Bv=class{constructor(e,t){e instanceof Vm&&no.inPeekEditor.bindTo(t)}dispose(){}};Bv.ID="editor.contrib.referenceController";Bv=cY([dY(1,tt)],Bv);Tr(Bv.ID,Bv,0);function $Me(n){const e=n.get(qt).getFocusedCodeEditor();return e instanceof Vm?e.getParentEditor():e}const UMe={headerBackgroundColor:H.white,primaryHeadingColor:H.fromHex("#333333"),secondaryHeadingColor:H.fromHex("#6c6c6cb3")};let Vx=class extends HMe{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new B,this.onDidClose=this._onDidClose.event,HL(this.options,UMe,!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=ye(".head"),this._bodyElement=ye(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=ye(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),ji(this._titleElement,"click",o=>this._onTitleClick(o))),le(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=ye("span.filename"),this._secondaryHeading=ye("span.dirname"),this._metaHeading=ye("span.meta"),le(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=ye(".peekview-actions");le(this._headElement,i);const s=this._getActionBarOptions();this._actionbarWidget=new al(i,s),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new Do("peekview.close",m("label.close","Close"),Te.asClassName(se.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:kke.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:ko(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,Kh(this._metaHeading)):ld(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const i=Math.ceil(this.editor.getOption(66)*1.2),s=Math.round(e-(i+2));this._doLayoutHead(i,t),this._doLayoutBody(s,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`)}};Vx=cY([dY(2,yt)],Vx);const jMe=E("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:H.black,hcLight:H.white},m("peekViewTitleBackground","Background color of the peek view title area.")),hY=E("peekViewTitleLabel.foreground",{dark:H.white,light:H.black,hcDark:H.white,hcLight:Au},m("peekViewTitleForeground","Color of the peek view title.")),fY=E("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},m("peekViewTitleInfoForeground","Color of the peek view title info.")),qMe=E("peekView.border",{dark:Es,light:Es,hcDark:Je,hcLight:Je},m("peekViewBorder","Color of the peek view borders and arrow.")),GMe=E("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:H.black,hcLight:H.white},m("peekViewResultsBackground","Background color of the peek view result list."));E("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:H.white,hcLight:Au},m("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list."));E("peekViewResult.fileForeground",{dark:H.white,light:"#1E1E1E",hcDark:H.white,hcLight:Au},m("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list."));E("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},m("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list."));E("peekViewResult.selectionForeground",{dark:H.white,light:"#6C6C6C",hcDark:H.white,hcLight:Au},m("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list."));const Cd=E("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:H.black,hcLight:H.white},m("peekViewEditorBackground","Background color of the peek view editor."));E("peekViewEditorGutter.background",{dark:Cd,light:Cd,hcDark:Cd,hcLight:Cd},m("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor."));E("peekViewEditorStickyScroll.background",{dark:Cd,light:Cd,hcDark:Cd,hcLight:Cd},m("peekViewEditorStickScrollBackground","Background color of sticky scroll in the peek view editor."));E("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},m("peekViewResultsMatchHighlight","Match highlight color in the peek view result list."));E("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},m("peekViewEditorMatchHighlight","Match highlight color in the peek view editor."));E("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:Gt,hcLight:Gt},m("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));var KMe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class au{constructor(e,t,i,s){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=s,this.id=gN.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?m({key:"aria.oneReference.preview",comment:["Placeholders are: 0: filename, 1:line number, 2: column number, 3: preview snippet of source code"]},"{0} in {1} on line {2} at column {3}",t.value,la(this.uri),this.range.startLineNumber,this.range.startColumn):m("aria.oneReference","in {0} on line {1} at column {2}",la(this.uri),this.range.startLineNumber,this.range.startColumn)}}class YMe{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const i=this._modelReference.object.textEditorModel;if(!i)return;const{startLineNumber:s,startColumn:o,endLineNumber:r,endColumn:a}=e,l=i.getWordUntilPosition({lineNumber:s,column:o-t}),c=new N(s,l.startColumn,s,o),d=new N(r,a,r,1073741824),u=i.getValueInRange(c).replace(/^\s+/,""),h=i.getValueInRange(e),f=i.getValueInRange(d).replace(/\s+$/,"");return{value:u+h+f,highlight:{start:u.length,end:u.length+h.length}}}}class Wv{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new Tn}dispose(){Bt(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?m("aria.fileReferences.1","1 symbol in {0}, full path {1}",la(this.uri),this.uri.fsPath):m("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,la(this.uri),this.uri.fsPath)}resolve(e){return KMe(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 YMe(i))}catch(i){_t(i)}return this})}}class eo{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new B,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;e.sort(eo._compareReferences);let s;for(const o of e)if((!s||!$t.isEqual(s.uri,o.uri,!0))&&(s=new Wv(this,o.uri),this.groups.push(s)),s.children.length===0||eo._compareReferences(o,s.children[s.children.length-1])!==0){const r=new au(i===o,s,o,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(r),s.children.push(r)}}dispose(){Bt(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new eo(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?m("aria.result.0","No results found"):this.references.length===1?m("aria.result.1","Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?m("aria.result.n1","Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):m("aria.result.nm","Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){const{parent:i}=e;let s=i.children.indexOf(e);const o=i.children.length,r=i.parent.groups.length;return r===1||t&&s+10?(t?s=(s+1)%o:s=(s+o-1)%o,i.children[s]):(s=i.parent.groups.indexOf(i),t?(s=(s+1)%r,i.parent.groups[s].children[0]):(s=(s+r-1)%r,i.parent.groups[s].children[i.parent.groups[s].children.length-1]))}nearestReference(e,t){const i=this.references.map((s,o)=>({idx:o,prefixLen:ES(s.uri.toString(),e.toString()),offsetDist:Math.abs(s.range.startLineNumber-t.lineNumber)*100+Math.abs(s.range.startColumn-t.column)})).sort((s,o)=>s.prefixLen>o.prefixLen?-1:s.prefixLeno.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()&&N.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 $t.compare(e.uri,t.uri)||N.compareRangesUsingStarts(e.range,t.range)}}var ik=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},nk=function(n,e){return function(t,i){e(t,i,n)}},AR;let IR=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof eo||e instanceof Wv}getChildren(e){if(e instanceof eo)return e.groups;if(e instanceof Wv)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};IR=ik([nk(0,xu)],IR);class ZMe{getHeight(){return 23}getTemplateId(e){return e instanceof Wv?Vv.id:py.id}}let TR=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof au){const i=(t=e.parent.getPreview(e))===null||t===void 0?void 0:t.preview(e.range);if(i)return i.value}return la(e.uri)}};TR=ik([nk(0,vi)],TR);class XMe{getId(e){return e instanceof au?e.id:e.uri}}let NR=class extends Y{constructor(e,t){super(),this._labelService=t;const i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new BN(i,{supportHighlights:!0})),this.badge=new FN(le(i,ye(".count")),{},OG),e.appendChild(i)}set(e,t){const i=NP(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 s=e.children.length;this.badge.setCount(s),s>1?this.badge.setTitleFormat(m("referencesCount","{0} references",s)):this.badge.setTitleFormat(m("referenceCount","{0} reference",s))}};NR=ik([nk(1,AD)],NR);let Vv=AR=class{constructor(e){this._instantiationService=e,this.templateId=AR.id}renderTemplate(e){return this._instantiationService.createInstance(NR,e)}renderElement(e,t,i){i.set(e.element,XP(e.filterData))}disposeTemplate(e){e.dispose()}};Vv.id="FileReferencesRenderer";Vv=AR=ik([nk(0,yt)],Vv);class QMe{constructor(e){this.label=new Pd(e)}set(e,t){var i;const s=(i=e.parent.getPreview(e))===null||i===void 0?void 0:i.preview(e.range);if(!s||!s.value)this.label.set(`${la(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:o,highlight:r}=s;t&&!tf.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(o,XP(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(o,[r]))}}}class py{constructor(){this.templateId=py.id}renderTemplate(e){return new QMe(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(){}}py.id="OneReferenceRenderer";class JMe{getWidgetAriaLabel(){return m("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var e4e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},xl=function(n,e){return function(t,i){e(t,i,n)}},IB=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class sk{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new pe,this._callOnModelChange=new pe,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 s=0,o=e.children.length;s{const o=s.deltaDecorations([],t);for(let r=0;r{o.equals(9)&&(this._keybindingService.dispatchEvent(o,o.target),o.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(i4e,"ReferencesWidget",this._treeContainer,new ZMe,[this._instantiationService.createInstance(Vv),this._instantiationService.createInstance(py)],this._instantiationService.createInstance(IR),i),this._splitView.addView({onDidChange:ue.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:o=>{this._preview.layout({height:this._dim.height,width:o})}},Dx.Distribute),this._splitView.addView({onDidChange:ue.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)}},Dx.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const s=(o,r)=>{o instanceof au&&(r==="show"&&this._revealReference(o,!1),this._onDidSelectReference.fire({element:o,kind:r,source:"tree"}))};this._tree.onDidOpen(o=>{o.sideBySide?s(o.element,"side"):o.editorOptions.pinned?s(o.element,"goto"):s(o.element,"show")}),ld(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new ei(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=m("noResults","No results"),Kh(this._messageContainer),Promise.resolve(void 0)):(ld(this._messageContainer),this._decorationsManager=new sk(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 s=this._getFocusedReference();s&&this._onDidSelectReference.fire({element:{uri:s.uri,range:i.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),Kh(this._treeContainer),Kh(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 au)return e;if(e instanceof Wv&&e.children.length>0)return e.children[0]}revealReference(e){return IB(this,void 0,void 0,function*(){yield this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})})}_revealReference(e,t){return IB(this,void 0,void 0,function*(){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==it.inMemory?this.setTitle(pCe(e.uri),this._uriLabel.getUriLabel(NP(e.uri))):this.setTitle(m("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 s=yield i;if(!this._model){s.dispose();return}Bt(this._previewModelReference);const o=s.object;if(o){const r=this._preview.getModel()===o.textEditorModel?0:1,a=N.lift(e.range).collapseToStart();this._previewModelReference=s,this._preview.setModel(o.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,r)}else this._preview.setModel(this._previewNotAvailableMessage),s.dispose()})}};RR=e4e([xl(3,co),xl(4,xu),xl(5,yt),xl(6,uY),xl(7,AD),xl(8,LD),xl(9,vi),xl(10,Ni),xl(11,ao)],RR);var n4e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Sg=function(n,e){return function(t,i){e(t,i,n)}},TB=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},PC;const ng=new _e("referenceSearchVisible",!1,m("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let zm=PC=class{static get(e){return e.getContribution(PC.ID)}constructor(e,t,i,s,o,r,a,l){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=s,this._notificationService=o,this._instantiationService=r,this._storageService=a,this._configurationService=l,this._disposables=new pe,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=ng.bindTo(i)}dispose(){var e,t;this._referenceSearchVisible.reset(),this._disposables.dispose(),(e=this._widget)===null||e===void 0||e.dispose(),(t=this._model)===null||t===void 0||t.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,i){let s;if(this._widget&&(s=this._widget.position),this.closeWidget(),s&&e.containsPosition(s))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",r=t4e.fromJSON(this._storageService.get(o,0,"{}"));this._widget=this._instantiationService.createInstance(RR,this._editor,this._defaultTreeKeyboardSupport,r),this._widget.setTitle(m("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,!0):this.openReference(c,!1,!0);break}}));const a=++this._requestIdPool;t.then(l=>{var c;if(a!==this._requestIdPool||!this._widget){l.dispose();return}return(c=this._model)===null||c===void 0||c.dispose(),this._model=l,this._widget.setModel(this._model).then(()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(m("metaTitle.N","{0} ({1})",this._model.title,this._model.references.length));const d=this._editor.getModel().uri,u=new V(e.startLineNumber,e.startColumn),h=this._model.nearestReference(d,u);if(h)return this._widget.setSelection(h).then(()=>{this._widget&&this._editor.getOption(86)==="editor"&&this._widget.focusOnPreviewEditor()})}})},l=>{this._notificationService.error(l)})}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}goToNextOrPreviousReference(e){return TB(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 s=this._model.nextOrPreviousReference(i,e),o=this._editor.hasTextFocus(),r=this._widget.isPreviewEditorFocused();yield this._widget.setSelection(s),yield this._gotoReference(s,!1),o?this._editor.focus():this._widget&&r&&this._widget.focusOnPreviewEditor()})}revealReference(e){return TB(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,t){var i;(i=this._widget)===null||i===void 0||i.hide(),this._ignoreModelChangeEvent=!0;const s=N.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:s,selectionSource:"code.jump",pinned:t}},this._editor).then(o=>{var r;if(this._ignoreModelChangeEvent=!1,!o||!this._widget){this.closeWidget();return}if(this._editor===o)this._widget.show(s),this._widget.focusOnReferenceTree();else{const a=PC.get(o),l=this._model.clone();this.closeWidget(),o.focus(),a==null||a.toggleWidget(s,xc(c=>Promise.resolve(l)),(r=this._peekMode)!==null&&r!==void 0?r:!1)}},o=>{this._ignoreModelChangeEvent=!1,_t(o)})}openReference(e,t,i){t||this.closeWidget();const{uri:s,range:o}=e;this._editorService.openCodeEditor({resource:s,options:{selection:o,selectionSource:"code.jump",pinned:i}},this._editor,t)}};zm.ID="editor.contrib.referencesController";zm=PC=n4e([Sg(2,tt),Sg(3,qt),Sg(4,Dn),Sg(5,yt),Sg(6,Qf),Sg(7,ni)],zm);function sg(n,e){const t=$Me(n);if(!t)return;const i=zm.get(t);i&&e(i)}Ws.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:Bn(2089,60),when:xe.or(ng,no.inPeekEditor),handler(n){sg(n,e=>{e.changeFocusBetweenPreviewAndReferences()})}});Ws.registerCommandAndKeybindingRule({id:"goToNextReference",weight:90,primary:62,secondary:[70],when:xe.or(ng,no.inPeekEditor),handler(n){sg(n,e=>{e.goToNextOrPreviousReference(!0)})}});Ws.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:90,primary:1086,secondary:[1094],when:xe.or(ng,no.inPeekEditor),handler(n){sg(n,e=>{e.goToNextOrPreviousReference(!1)})}});Zt.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");Zt.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");Zt.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");Zt.registerCommand("closeReferenceSearch",n=>sg(n,e=>e.closeWidget()));Ws.registerKeybindingRule({id:"closeReferenceSearch",weight:-1,primary:9,secondary:[1033],when:xe.and(no.inPeekEditor,xe.not("config.editor.stablePeek"))});Ws.registerKeybindingRule({id:"closeReferenceSearch",weight:250,primary:9,secondary:[1033],when:xe.and(ng,xe.not("config.editor.stablePeek"))});Ws.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:xe.and(ng,nK,_3.negate(),b3.negate()),handler(n){var e;const i=(e=n.get(Jo).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof au&&sg(n,s=>s.revealReference(i[0]))}});Ws.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:xe.and(ng,nK,_3.negate(),b3.negate()),handler(n){var e;const i=(e=n.get(Jo).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof au&&sg(n,s=>s.openReference(i[0],!0,!0))}});Zt.registerCommand("openReference",n=>{var e;const i=(e=n.get(Jo).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof au&&sg(n,s=>s.openReference(i[0],!1,!0))});var gY=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},v_=function(n,e){return function(t,i){e(t,i,n)}};const U3=new _e("hasSymbols",!1,m("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),ok=at("ISymbolNavigationService");let MR=class{constructor(e,t,i,s){this._editorService=t,this._notificationService=i,this._keybindingService=s,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=U3.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 PR(this._editorService),s=i.onDidChange(o=>{if(this._ignoreEditorChange)return;const r=this._editorService.getActiveCodeEditor();if(!r)return;const a=r.getModel(),l=r.getPosition();if(!a||!l)return;let c=!1,d=!1;for(const u of t.references)if(TP(u.uri,a.uri))c=!0,d=d||N.containsPosition(u.range,l);else if(c)break;(!c||!d)&&this.reset()});this._currentState=br(i,s)}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:N.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?m("location.kb","Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,t.getLabel()):m("location","Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(i)}};MR=gY([v_(0,tt),v_(1,qt),v_(2,Dn),v_(3,vi)],MR);gt(ok,MR,1);Ee(new class extends Er{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:U3,kbOpts:{weight:100,primary:70}})}runEditorCommand(n,e){return n.get(ok).revealNext(e)}});Ws.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:U3,primary:9,handler(n){n.get(ok).reset()}});let PR=class{constructor(e){this._listener=new Map,this._disposables=new pe,this._onDidChange=new B,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(),Bt(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,br(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)}};PR=gY([v_(0,qt)],PR);var s4e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},NB=function(n,e){return function(t,i){e(t,i,n)}},pY=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},OR;let zv=OR=class{constructor(e,t,i){this._options=e,this._languageService=t,this._openerService=i,this._onDidRenderAsync=new B,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,i){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const s=new pe,o=s.add(TD(e,Object.assign(Object.assign({},this._getRenderOptions(e,s)),t),i));return o.element.classList.add("rendered-markdown"),{element:o.element,dispose:()=>s.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:(i,s)=>pY(this,void 0,void 0,function*(){var o,r,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=$o);const c=yield WSe(this._languageService,s,l),d=document.createElement("span");if(d.innerHTML=(a=(r=OR._ttpTokenizer)===null||r===void 0?void 0:r.createHTML(c))!==null&&a!==void 0?a:c,this._options.editor){const u=this._options.editor.getOption(50);Mn(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=>mY(this._openerService,i,e.isTrusted),disposables:t}}}};zv._ttpTokenizer=jf("tokenizeToString",{createHTML(n){return n}});zv=OR=s4e([NB(1,Ni),NB(2,Dc)],zv);function mY(n,e,t){return pY(this,void 0,void 0,function*(){try{return yield n.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:o4e(t)})}catch(i){return _t(i),!1}})}function o4e(n){return n===!0?!0:n&&Array.isArray(n.enabledCommands)?n.enabledCommands:!1}var r4e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},RB=function(n,e){return function(t,i){e(t,i,n)}},OC;let yr=OC=class{static get(e){return e.getContribution(OC.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new ra,this._messageListeners=new pe,this._mouseOverMessage=!1,this._editor=e,this._visible=OC.MESSAGE_VISIBLE.bindTo(t)}dispose(){var e;(e=this._message)===null||e===void 0||e.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){Z1(Rd(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=Rd(e)?TD(e,{actionHandler:{callback:s=>mY(this._openerService,s,Rd(e)?e.isTrusted:void 0),disposables:this._messageListeners}}):void 0,this._messageWidget.value=new MB(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(ue.debounce(this._editor.onDidBlurEditorText,(s,o)=>o,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&Sn(ia(),this._messageWidget.value.getDomNode())||this.closeMessage()})),this._messageListeners.add(this._editor.onDidChangeCursorPosition(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidDispose(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeModel(()=>this.closeMessage())),this._messageListeners.add(K(this._messageWidget.value.getDomNode(),de.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(K(this._messageWidget.value.getDomNode(),de.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let i;this._messageListeners.add(this._editor.onMouseMove(s=>{s.target.position&&(i?i.containsPosition(s.target.position)||this.closeMessage():i=new N(t.lineNumber-3,1,s.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(MB.fadeOut(this._messageWidget.value))}};yr.ID="editor.contrib.messageController";yr.MESSAGE_VISIBLE=new _e("messageVisible",!1,m("messageVisible","Whether the editor is currently showing an inline message"));yr=OC=r4e([RB(1,tt),RB(2,Dc)],yr);const a4e=Er.bindToContribution(yr.get);Ee(new a4e({id:"leaveEditorMessage",precondition:yr.MESSAGE_VISIBLE,handler:n=>n.closeMessage(),kbOpts:{weight:130,primary:9}}));let MB=class{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},s){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 r=document.createElement("div");typeof s=="string"?(r.classList.add("message"),r.textContent=s):(s.classList.add("message"),r.appendChild(s)),this._domNode.appendChild(r);const a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",e===2)}};Tr(yr.ID,yr,4);var j3=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function my(n,e,t,i){return j3(this,void 0,void 0,function*(){const o=t.ordered(n).map(a=>Promise.resolve(i(a,n,e)).then(void 0,l=>{wc(l)})),r=yield Promise.all(o);return VL(r.flat())})}function q3(n,e,t,i){return my(e,t,n,(s,o,r)=>s.provideDefinition(o,r,i))}function _Y(n,e,t,i){return my(e,t,n,(s,o,r)=>s.provideDeclaration(o,r,i))}function bY(n,e,t,i){return my(e,t,n,(s,o,r)=>s.provideImplementation(o,r,i))}function vY(n,e,t,i){return my(e,t,n,(s,o,r)=>s.provideTypeDefinition(o,r,i))}function rk(n,e,t,i,s){return my(e,t,n,(o,r,a)=>j3(this,void 0,void 0,function*(){const l=yield o.provideReferences(r,a,{includeDeclaration:!0},s);if(!i||!l||l.length!==2)return l;const c=yield o.provideReferences(r,a,{includeDeclaration:!1},s);return c&&c.length===1?c:l}))}function _y(n){return j3(this,void 0,void 0,function*(){const e=yield n(),t=new eo(e,""),i=t.references.map(s=>s.link);return t.dispose(),i})}n0("_executeDefinitionProvider",(n,e,t)=>{const i=n.get(nt),s=q3(i.definitionProvider,e,t,ln.None);return _y(()=>s)});n0("_executeTypeDefinitionProvider",(n,e,t)=>{const i=n.get(nt),s=vY(i.typeDefinitionProvider,e,t,ln.None);return _y(()=>s)});n0("_executeDeclarationProvider",(n,e,t)=>{const i=n.get(nt),s=_Y(i.declarationProvider,e,t,ln.None);return _y(()=>s)});n0("_executeReferenceProvider",(n,e,t)=>{const i=n.get(nt),s=rk(i.referenceProvider,e,t,!1,ln.None);return _y(()=>s)});n0("_executeImplementationProvider",(n,e,t)=>{const i=n.get(nt),s=bY(i.implementationProvider,e,t,ln.None);return _y(()=>s)});var wr=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},H0,$0,U0,$w,Uw,jw,qw,Gw;dr.appendMenuItem(I.EditorContext,{submenu:I.EditorContextPeek,title:m("peek.submenu","Peek"),group:"navigation",order:100});class zx{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof zx||V.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}class ss extends xme{static all(){return ss._allSymbolNavigationCommands.values()}static _patchConfig(e){const t=Object.assign(Object.assign({},e),{f1:!0});if(t.menu)for(const i of ht.wrap(t.menu))(i.id===I.EditorContext||i.id===I.EditorContextPeek)&&(i.when=xe.and(e.precondition,i.when));return t}constructor(e,t){super(ss._patchConfig(t)),this.configuration=e,ss._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,s){if(!t.hasModel())return Promise.resolve(void 0);const o=e.get(Dn),r=e.get(qt),a=e.get(ny),l=e.get(ok),c=e.get(nt),d=e.get(yt),u=t.getModel(),h=t.getPosition(),f=zx.is(i)?i:new zx(u,h),g=new UTe(t,5),p=Eme(this._getLocationModel(c,f.model,f.position,g.token),g.token).then(_=>wr(this,void 0,void 0,function*(){var v;if(!_||g.token.isCancellationRequested)return;Z1(_.ariaMessage);let b;if(_.referenceAt(u.uri,h)){const w=this._getAlternativeCommand(t);!ss._activeAlternativeCommands.has(w)&&ss._allSymbolNavigationCommands.has(w)&&(b=ss._allSymbolNavigationCommands.get(w))}const y=_.references.length;if(y===0){if(!this.configuration.muteMessage){const w=u.getWordAtPosition(h);(v=yr.get(t))===null||v===void 0||v.showMessage(this._getNoResultFoundMessage(w),h)}}else if(y===1&&b)ss._activeAlternativeCommands.add(this.desc.id),d.invokeFunction(w=>b.runEditorCommand(w,t,i,s).finally(()=>{ss._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(r,l,t,_,s)}),_=>{o.error(_)}).finally(()=>{g.dispose()});return a.showWhile(p,250),p}_onResult(e,t,i,s,o){return wr(this,void 0,void 0,function*(){const r=this._getGoToPreference(i);if(!(i instanceof Vm)&&(this.configuration.openInPeek||r==="peek"&&s.references.length>1))this._openInPeek(i,s,o);else{const a=s.firstReference(),l=s.references.length>1&&r==="gotoAndPeek",c=yield this._openReference(i,e,a,this.configuration.openToSide,!l);l&&c?this._openInPeek(c,s,o):s.dispose(),r==="goto"&&t.put(a)}})}_openReference(e,t,i,s,o){return wr(this,void 0,void 0,function*(){let r;if(Tge(i)&&(r=i.targetSelectionRange),r||(r=i.range),!r)return;const a=yield t.openCodeEditor({resource:i.uri,options:{selection:N.collapseToStart(r),selectionRevealType:3,selectionSource:"code.jump"}},e,s);if(a){if(o){const l=a.getModel(),c=a.createDecorationsCollection([{range:r,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===l&&c.clear()},350)}return a}})}_openInPeek(e,t,i){const s=zm.get(e);s&&e.hasModel()?s.toggleWidget(i??e.getSelection(),xc(o=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}}ss._allSymbolNavigationCommands=new Map;ss._activeAlternativeCommands=new Set;class ak extends ss{_getLocationModel(e,t,i,s){return wr(this,void 0,void 0,function*(){return new eo(yield q3(e.definitionProvider,t,i,s),m("def.title","Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?m("noResultWord","No definition found for '{0}'",e.word):m("generic.noResults","No definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleDefinitions}}Vs((H0=class extends ak{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:H0.id,title:{value:m("actions.goToDecl.label","Go to Definition"),original:"Go to Definition",mnemonicTitle:m({key:"miGotoDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Definition")},precondition:xe.and($.hasDefinitionProvider,$.isInWalkThroughSnippet.toNegated()),keybinding:[{when:$.editorTextFocus,primary:70,weight:100},{when:xe.and($.editorTextFocus,eK),primary:2118,weight:100}],menu:[{id:I.EditorContext,group:"navigation",order:1.1},{id:I.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),Zt.registerCommandAlias("editor.action.goToDeclaration",H0.id)}},H0.id="editor.action.revealDefinition",H0));Vs(($0=class extends ak{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:$0.id,title:{value:m("actions.goToDeclToSide.label","Open Definition to the Side"),original:"Open Definition to the Side"},precondition:xe.and($.hasDefinitionProvider,$.isInWalkThroughSnippet.toNegated()),keybinding:[{when:$.editorTextFocus,primary:Bn(2089,70),weight:100},{when:xe.and($.editorTextFocus,eK),primary:Bn(2089,2118),weight:100}]}),Zt.registerCommandAlias("editor.action.openDeclarationToTheSide",$0.id)}},$0.id="editor.action.revealDefinitionAside",$0));Vs((U0=class extends ak{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:U0.id,title:{value:m("actions.previewDecl.label","Peek Definition"),original:"Peek Definition"},precondition:xe.and($.hasDefinitionProvider,no.notInPeekEditor,$.isInWalkThroughSnippet.toNegated()),keybinding:{when:$.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:I.EditorContextPeek,group:"peek",order:2}}),Zt.registerCommandAlias("editor.action.previewDeclaration",U0.id)}},U0.id="editor.action.peekDefinition",U0));class yY extends ss{_getLocationModel(e,t,i,s){return wr(this,void 0,void 0,function*(){return new eo(yield _Y(e.declarationProvider,t,i,s),m("decl.title","Declarations"))})}_getNoResultFoundMessage(e){return e&&e.word?m("decl.noResultWord","No declaration found for '{0}'",e.word):m("decl.generic.noResults","No declaration found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(58).multipleDeclarations}}Vs(($w=class extends yY{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:$w.id,title:{value:m("actions.goToDeclaration.label","Go to Declaration"),original:"Go to Declaration",mnemonicTitle:m({key:"miGotoDeclaration",comment:["&& denotes a mnemonic"]},"Go to &&Declaration")},precondition:xe.and($.hasDeclarationProvider,$.isInWalkThroughSnippet.toNegated()),menu:[{id:I.EditorContext,group:"navigation",order:1.3},{id:I.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?m("decl.noResultWord","No declaration found for '{0}'",e.word):m("decl.generic.noResults","No declaration found")}},$w.id="editor.action.revealDeclaration",$w));Vs(class extends yY{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:{value:m("actions.peekDecl.label","Peek Declaration"),original:"Peek Declaration"},precondition:xe.and($.hasDeclarationProvider,no.notInPeekEditor,$.isInWalkThroughSnippet.toNegated()),menu:{id:I.EditorContextPeek,group:"peek",order:3}})}});class wY extends ss{_getLocationModel(e,t,i,s){return wr(this,void 0,void 0,function*(){return new eo(yield vY(e.typeDefinitionProvider,t,i,s),m("typedef.title","Type Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?m("goToTypeDefinition.noResultWord","No type definition found for '{0}'",e.word):m("goToTypeDefinition.generic.noResults","No type definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleTypeDefinitions}}Vs((Uw=class extends wY{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:Uw.ID,title:{value:m("actions.goToTypeDefinition.label","Go to Type Definition"),original:"Go to Type Definition",mnemonicTitle:m({key:"miGotoTypeDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Type Definition")},precondition:xe.and($.hasTypeDefinitionProvider,$.isInWalkThroughSnippet.toNegated()),keybinding:{when:$.editorTextFocus,primary:0,weight:100},menu:[{id:I.EditorContext,group:"navigation",order:1.4},{id:I.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},Uw.ID="editor.action.goToTypeDefinition",Uw));Vs((jw=class extends wY{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:jw.ID,title:{value:m("actions.peekTypeDefinition.label","Peek Type Definition"),original:"Peek Type Definition"},precondition:xe.and($.hasTypeDefinitionProvider,no.notInPeekEditor,$.isInWalkThroughSnippet.toNegated()),menu:{id:I.EditorContextPeek,group:"peek",order:4}})}},jw.ID="editor.action.peekTypeDefinition",jw));class CY extends ss{_getLocationModel(e,t,i,s){return wr(this,void 0,void 0,function*(){return new eo(yield bY(e.implementationProvider,t,i,s),m("impl.title","Implementations"))})}_getNoResultFoundMessage(e){return e&&e.word?m("goToImplementation.noResultWord","No implementation found for '{0}'",e.word):m("goToImplementation.generic.noResults","No implementation found")}_getAlternativeCommand(e){return e.getOption(58).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(58).multipleImplementations}}Vs((qw=class extends CY{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:qw.ID,title:{value:m("actions.goToImplementation.label","Go to Implementations"),original:"Go to Implementations",mnemonicTitle:m({key:"miGotoImplementation",comment:["&& denotes a mnemonic"]},"Go to &&Implementations")},precondition:xe.and($.hasImplementationProvider,$.isInWalkThroughSnippet.toNegated()),keybinding:{when:$.editorTextFocus,primary:2118,weight:100},menu:[{id:I.EditorContext,group:"navigation",order:1.45},{id:I.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},qw.ID="editor.action.goToImplementation",qw));Vs((Gw=class extends CY{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:Gw.ID,title:{value:m("actions.peekImplementation.label","Peek Implementations"),original:"Peek Implementations"},precondition:xe.and($.hasImplementationProvider,no.notInPeekEditor,$.isInWalkThroughSnippet.toNegated()),keybinding:{when:$.editorTextFocus,primary:3142,weight:100},menu:{id:I.EditorContextPeek,group:"peek",order:5}})}},Gw.ID="editor.action.peekImplementation",Gw));class SY extends ss{_getNoResultFoundMessage(e){return e?m("references.no","No references found for '{0}'",e.word):m("references.noGeneric","No references found")}_getAlternativeCommand(e){return e.getOption(58).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(58).multipleReferences}}Vs(class extends SY{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{value:m("goToReferences.label","Go to References"),original:"Go to References",mnemonicTitle:m({key:"miGotoReference",comment:["&& denotes a mnemonic"]},"Go to &&References")},precondition:xe.and($.hasReferenceProvider,no.notInPeekEditor,$.isInWalkThroughSnippet.toNegated()),keybinding:{when:$.editorTextFocus,primary:1094,weight:100},menu:[{id:I.EditorContext,group:"navigation",order:1.45},{id:I.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}_getLocationModel(e,t,i,s){return wr(this,void 0,void 0,function*(){return new eo(yield rk(e.referenceProvider,t,i,!0,s),m("ref.title","References"))})}});Vs(class extends SY{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:{value:m("references.action.label","Peek References"),original:"Peek References"},precondition:xe.and($.hasReferenceProvider,no.notInPeekEditor,$.isInWalkThroughSnippet.toNegated()),menu:{id:I.EditorContextPeek,group:"peek",order:6}})}_getLocationModel(e,t,i,s){return wr(this,void 0,void 0,function*(){return new eo(yield rk(e.referenceProvider,t,i,!1,s),m("ref.title","References"))})}});class l4e extends ss{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",title:{value:m("label.generic","Go to Any Symbol"),original:"Go to Any Symbol"},precondition:xe.and(no.notInPeekEditor,$.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}_getLocationModel(e,t,i,s){return wr(this,void 0,void 0,function*(){return new eo(this._references,m("generic.title","Locations"))})}_getNoResultFoundMessage(e){return e&&m("generic.noResult","No results for '{0}'",e.word)||""}_getGoToPreference(e){var t;return(t=this._gotoMultipleBehaviour)!==null&&t!==void 0?t:e.getOption(58).multipleReferences}_getAlternativeCommand(){return""}}Zt.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:je},{name:"position",description:"The position at which to start",constraint:V.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"},{name:"noResultsMessage",description:"Human readable message that shows when locations is empty."}]},handler:(n,e,t,i,s,o,r)=>wr(void 0,void 0,void 0,function*(){Ls(je.isUri(e)),Ls(V.isIPosition(t)),Ls(Array.isArray(i)),Ls(typeof s>"u"||typeof s=="string"),Ls(typeof r>"u"||typeof r=="boolean");const a=n.get(qt),l=yield a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(zK(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(c=>{const d=new class extends l4e{_getNoResultFoundMessage(u){return o||super._getNoResultFoundMessage(u)}}({muteMessage:!o,openInPeek:!!r,openToSide:!1},i,s);c.get(yt).invokeFunction(d.run.bind(d),l)})})});Zt.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:je},{name:"position",description:"The position at which to start",constraint:V.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"}]},handler:(n,e,t,i,s)=>wr(void 0,void 0,void 0,function*(){n.get(gs).executeCommand("editor.action.goToLocations",e,t,i,s,void 0,!0)})});Zt.registerCommand({id:"editor.action.findReferences",handler:(n,e,t)=>{Ls(je.isUri(e)),Ls(V.isIPosition(t));const i=n.get(nt),s=n.get(qt);return s.openCodeEditor({resource:e},s.getFocusedCodeEditor()).then(o=>{if(!zK(o)||!o.hasModel())return;const r=zm.get(o);if(!r)return;const a=xc(c=>rk(i.referenceProvider,o.getModel(),V.lift(t),!1,c).then(d=>new eo(d,m("ref.title","References")))),l=new N(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(r.toggleWidget(l,a,!1))})}});Zt.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");var c4e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},SE=function(n,e){return function(t,i){e(t,i,n)}},PB=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},y_;let If=y_=class{constructor(e,t,i,s){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=s,this.toUnhook=new pe,this.toUnhookForKeyboard=new pe,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const o=new OMe(e);this.toUnhook.add(o),this.toUnhook.add(o.onMouseMoveOrRelevantKeyDown(([r,a])=>{this.startFindDefinitionFromMouse(r,a??void 0)})),this.toUnhook.add(o.onExecute(r=>{this.isEnabled(r)&&this.gotoDefinition(r.target.position,r.hasSideBySideModifier).catch(a=>{_t(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(o.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(y_.ID)}startFindDefinitionFromCursor(e){return PB(this,void 0,void 0,function*(){yield this.startFindDefinition(e),this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()})),this.toUnhookForKeyboard.add(this.editor.onKeyDown(t=>{t&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())}))})}startFindDefinitionFromMouse(e,t){if(e.target.type===9&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(e,t)){this.currentWordAtPosition=null,this.removeLinkDecorations();return}const i=e.target.position;this.startFindDefinition(i)}startFindDefinition(e){var t;return PB(this,void 0,void 0,function*(){this.toUnhookForKeyboard.clear();const i=e?(t=this.editor.getModel())===null||t===void 0?void 0:t.getWordAtPosition(e):null;if(!i){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===i.startColumn&&this.currentWordAtPosition.endColumn===i.endColumn&&this.currentWordAtPosition.word===i.word)return;this.currentWordAtPosition=i;const s=new $Te(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=xc(a=>this.findDefinition(e,a));let o;try{o=yield this.previousPromise}catch(a){_t(a);return}if(!o||!o.length||!s.validate(this.editor)){this.removeLinkDecorations();return}const r=o[0].originSelectionRange?N.lift(o[0].originSelectionRange):new N(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn);if(o.length>1){let a=r;for(const{originSelectionRange:l}of o)l&&(a=N.plusRange(a,l));this.addDecoration(a,new Mm().appendText(m("multipleResults","Click to show {0} definitions.",o.length)))}else{const a=o[0];if(!a.uri)return;this.textModelResolverService.createModelReference(a.uri).then(l=>{if(!l.object||!l.object.textEditorModel){l.dispose();return}const{object:{textEditorModel:c}}=l,{startLineNumber:d}=a.range;if(d<1||d>c.getLineCount()){l.dispose();return}const u=this.getPreviewValue(c,d,a),h=this.languageService.guessLanguageIdByFilepathOrFirstLine(c.uri);this.addDecoration(r,u?new Mm().appendCodeblock(h||"",u):void 0),l.dispose()})}})}getPreviewValue(e,t,i){let s=i.range;return s.endLineNumber-s.startLineNumber>=y_.MAX_SOURCE_PREVIEW_LINES&&(s=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,s)}stripIndentationFromPreviewRange(e,t,i){let o=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a{const s=!t&&this.editor.getOption(87)&&!this.isInPeekEditor(i);return new ak({openToSide:t,openInPeek:s,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(i)})}isInPeekEditor(e){const t=e.get(tt);return no.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};If.ID="editor.contrib.gotodefinitionatposition";If.MAX_SOURCE_PREVIEW_LINES=8;If=y_=c4e([SE(1,xu),SE(2,Ni),SE(3,nt)],If);Tr(If.ID,If,2);const Kw=ye;class xY extends Y{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 SP(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}}class G3 extends Y{static render(e,t,i){return new G3(e,t,i)}constructor(e,t,i){super(),this.actionContainer=le(e,Kw("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=le(this.actionContainer,Kw("a.action")),this.action.setAttribute("role","button"),t.iconClass&&le(this.action,Kw(`span.icon.${t.iconClass}`));const s=le(this.action,Kw("span"));s.textContent=i?`${t.label} (${i})`:t.label,this._register(K(this.actionContainer,de.CLICK,o=>{o.stopPropagation(),o.preventDefault(),t.run(this.actionContainer)})),this._register(K(this.actionContainer,de.KEY_DOWN,o=>{const r=new Ht(o);(r.equals(3)||r.equals(10))&&(o.stopPropagation(),o.preventDefault(),t.run(this.actionContainer))})),this.setEnabled(!0)}setEnabled(e){e?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}}function d4e(n,e){return n&&e?m("acessibleViewHint","Inspect this in the accessible view with {0}.",e):n?m("acessibleViewHintNoKbOpen","Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}var u4e=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},h4e=function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof __values=="function"?__values(n):n[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(o){t[o]=n[o]&&function(r){return new Promise(function(a,l){r=n[o](r),s(a,l,r.done,r.value)})}}function s(o,r,a,l){Promise.resolve(l).then(function(c){o({value:c,done:a})},r)}};let f4e=class{constructor(e,t,i){this.value=e,this.isComplete=t,this.hasLoadingMessage=i}};class LY extends Y{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new B),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new Di(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new Di(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new Di(()=>this._triggerLoadingMessage(),0)),this._state=0,this._asyncIterable=null,this._asyncIterableDone=!1,this._result=[]}dispose(){this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),super.dispose()}get _hoverTime(){return this._editor.getOption(60).delay}get _firstWaitTime(){return this._hoverTime/2}get _secondWaitTime(){return this._hoverTime-this._firstWaitTime}get _loadingMessageTime(){return 3*this._hoverTime}_setState(e,t=!0){this._state=e,t&&this._fireResult()}_triggerAsyncComputation(){this._setState(2),this._secondWaitScheduler.schedule(this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=Mme(e=>this._computer.computeAsync(e)),u4e(this,void 0,void 0,function*(){var e,t,i,s;try{try{for(var o=!0,r=h4e(this._asyncIterable),a;a=yield r.next(),e=a.done,!e;o=!0){s=a.value,o=!1;const l=s;l&&(this._result.push(l),this._fireResult())}}catch(l){t={error:l}}finally{try{!o&&!e&&(i=r.return)&&(yield i.call(r))}finally{if(t)throw t.error}}this._asyncIterableDone=!0,(this._state===3||this._state===4)&&this._setState(0)}catch(l){_t(l)}})):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 f4e(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 xE{constructor(e,t,i,s){this.priority=e,this.range=t,this.initialMousePosX=i,this.initialMousePosY=s,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}}const K3=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class g4e{constructor(){this._onDidWillResize=new B,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new B,this.onDidResize=this._onDidResize.event,this._sashListener=new pe,this._size=new ei(0,0),this._minSize=new ei(0,0),this._maxSize=new ei(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new En(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new En(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new En(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:xx.North}),this._southSash=new En(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:xx.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(ue.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(ue.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(s=>{e&&(i=s.currentX-s.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(s=>{e&&(i=-(s.currentX-s.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(s=>{e&&(t=-(s.currentY-s.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(s=>{e&&(t=s.currentY-s.startY,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(ue.any(this._eastSash.onDidReset,this._westSash.onDidReset)(s=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(ue.any(this._northSash.onDidReset,this._southSash.onDidReset)(s=>{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,s){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=i?3:0,this._westSash.state=s?3:0}layout(e=this.size.height,t=this.size.width){const{height:i,width:s}=this._minSize,{height:o,width:r}=this._maxSize;e=Math.max(i,Math.min(o,e)),t=Math.max(s,Math.min(r,t));const a=new ei(t,e);ei.equals(a,this._size)||(this.domNode.style.height=e+"px",this.domNode.style.width=t+"px",this._size=a,this._northSash.layout(),this._eastSash.layout(),this._southSash.layout(),this._westSash.layout())}clearSashHoverState(){this._eastSash.clearSashHoverState(),this._westSash.clearSashHoverState(),this._northSash.clearSashHoverState(),this._southSash.clearSashHoverState()}get size(){return this._size}set maxSize(e){this._maxSize=e}get maxSize(){return this._maxSize}set minSize(e){this._minSize=e}get minSize(){return this._minSize}set preferredSize(e){this._preferredSize=e}get preferredSize(){return this._preferredSize}}const p4e=30,m4e=24;class _4e extends Y{constructor(e,t=new ei(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new g4e),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=ei.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(i=>{this._resize(new ei(i.dimension.width,i.dimension.height)),i.done&&(this._isResizing=!1)})),this._register(this._resizableNode.onDidWillResize(()=>{this._isResizing=!0}))}get isResizing(){return this._isResizing}getDomNode(){return this._resizableNode.domNode}getPosition(){return this._contentPosition}get position(){var e;return!((e=this._contentPosition)===null||e===void 0)&&e.position?V.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);return!t||!i?void 0:Rn(t).top+i.top-p4e}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;const s=Rn(t),o=nD(t.ownerDocument.body),r=s.top+i.top+i.height;return o.height-r-m4e}_findPositionPreference(e,t){var i,s;const o=Math.min((i=this._availableVerticalSpaceBelow(t))!==null&&i!==void 0?i:1/0,e),r=Math.min((s=this._availableVerticalSpaceAbove(t))!==null&&s!==void 0?s:1/0,e),a=Math.min(Math.max(r,o),e),l=Math.min(e,a);let c;return this._editor.getOption(60).above?c=l<=r?1:2:c=l<=o?2:1,c===1?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),c}_resize(e){this._resizableNode.layout(e.height,e.width)}}var Y3=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Nh=function(n,e){return function(t,i){e(t,i,n)}},FC,wa;const OB=ye;let Hx=FC=class extends Y{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._currentResult=null,this._widget=this._register(this._instantiationService.createInstance(Bd,this._editor)),this._participants=[];for(const s of K3.getAll())this._participants.push(this._instantiationService.createInstance(s,this._editor));this._participants.sort((s,o)=>s.hoverOrdinal-o.hoverOrdinal),this._computer=new $x(this._editor,this._participants),this._hoverOperation=this._register(new LY(this._editor,this._computer)),this._register(this._hoverOperation.onResult(s=>{if(!this._computer.anchor)return;const o=s.hasLoadingMessage?this._addLoadingMessage(s.value):s.value;this._withResult(new DY(this._computer.anchor,o,s.isComplete))})),this._register(ji(this._widget.getDomNode(),"keydown",s=>{s.equals(9)&&this.hide()})),this._register(xi.onDidChange(()=>{this._widget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)}))}get widget(){return this._widget}maybeShowAt(e){if(this._widget.isResizing)return!0;const t=[];for(const s of this._participants)if(s.suggestHoverAnchor){const o=s.suggestHoverAnchor(e);o&&t.push(o)}const i=e.target;if(i.type===6&&t.push(new xE(0,i.range,e.event.posx,e.event.posy)),i.type===7){const s=this._editor.getOption(50).typicalHalfwidthCharacterWidth/2;!i.detail.isAfterLines&&typeof i.detail.horizontalDistanceToText=="number"&&i.detail.horizontalDistanceToTexto.priority-s.priority),this._startShowingOrUpdateHover(t[0],0,0,!1,e))}startShowingAtRange(e,t,i,s){this._startShowingOrUpdateHover(new xE(0,e,void 0,void 0),t,i,s,null)}_startShowingOrUpdateHover(e,t,i,s,o){return!this._widget.position||!this._currentResult?e?(this._startHoverOperationIfNecessary(e,t,i,s,!1),!0):!1:this._editor.getOption(60).sticky&&o&&this._widget.isMouseGettingCloser(o.event.posx,o.event.posy)?(e&&this._startHoverOperationIfNecessary(e,t,i,s,!0),!0):e?e&&this._currentResult.anchor.equals(e)?!0:e.canAdoptVisibleHover(this._currentResult.anchor,this._widget.position)?(this._setCurrentResult(this._currentResult.filter(e)),this._startHoverOperationIfNecessary(e,t,i,s,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,i,s,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,t,i,s,o){this._computer.anchor&&this._computer.anchor.equals(e)||(this._hoverOperation.cancel(),this._computer.anchor=e,this._computer.shouldFocus=s,this._computer.source=i,this._computer.insistOnKeepingHoverVisible=o,this._hoverOperation.start(t))}_setCurrentResult(e){this._currentResult!==e&&(e&&e.messages.length===0&&(e=null),this._currentResult=e,this._currentResult?this._renderMessages(this._currentResult.anchor,this._currentResult.messages):this._widget.hide())}hide(){this._computer.anchor=null,this._hoverOperation.cancel(),this._setCurrentResult(null)}get isColorPickerVisible(){return this._widget.isColorPickerVisible}get isVisibleFromKeyboard(){return this._widget.isVisibleFromKeyboard}get isVisible(){return this._widget.isVisible}get isFocused(){return this._widget.isFocused}get isResizing(){return this._widget.isResizing}containsNode(e){return e?this._widget.getDomNode().contains(e):!1}_addLoadingMessage(e){if(this._computer.anchor){for(const t of this._participants)if(t.createLoadingMessage){const i=t.createLoadingMessage(this._computer.anchor);if(i)return e.slice(0).concat([i])}}return e}_withResult(e){this._widget.position&&this._currentResult&&this._currentResult.isComplete&&(!e.isComplete||this._computer.insistOnKeepingHoverVisible&&e.messages.length===0)||this._setCurrentResult(e)}_renderMessages(e,t){const{showAtPosition:i,showAtSecondaryPosition:s,highlightRange:o}=FC.computeHoverRanges(this._editor,e.range,t),r=new pe,a=r.add(new FR(this._keybindingService)),l=document.createDocumentFragment();let c=null;const d={fragment:l,statusBar:a,setColorPicker:h=>c=h,onContentsChanged:()=>this._widget.onContentsChanged(),setMinimumDimensions:h=>this._widget.setMinimumDimensions(h),hide:()=>this.hide()};for(const h of this._participants){const f=t.filter(g=>g.owner===h);f.length>0&&r.add(h.renderHoverParts(d,f))}const u=t.some(h=>h.isBeforeContent);if(a.hasContent&&l.appendChild(a.hoverElement),l.hasChildNodes()){if(o){const h=this._editor.createDecorationsCollection();h.set([{range:o,options:FC._DECORATION_OPTIONS}]),r.add(Ze(()=>{h.clear()}))}this._widget.showAt(l,new v4e(c,i,s,this._editor.getOption(60).above,this._computer.shouldFocus,this._computer.source,u,e.initialMousePosX,e.initialMousePosY,r))}else r.dispose()}static computeHoverRanges(e,t,i){let s=1;if(e.hasModel()){const c=e._getViewModel(),d=c.coordinatesConverter,u=d.convertModelRangeToViewRange(t),h=new V(u.startLineNumber,c.getLineMinColumn(u.startLineNumber));s=d.convertViewPositionToModelPosition(h).column}const o=t.startLineNumber;let r=t.startColumn,a=i[0].range,l=null;for(const c of i)a=N.plusRange(a,c.range),c.range.startLineNumber===o&&c.range.endLineNumber===o&&(r=Math.max(Math.min(r,c.range.startColumn),s)),c.forceShowAtRange&&(l=c.range);return{showAtPosition:l?l.getStartPosition():new V(o,t.startColumn),showAtSecondaryPosition:l?l.getStartPosition():new V(o,r),highlightRange:a}}focus(){this._widget.focus()}scrollUp(){this._widget.scrollUp()}scrollDown(){this._widget.scrollDown()}scrollLeft(){this._widget.scrollLeft()}scrollRight(){this._widget.scrollRight()}pageUp(){this._widget.pageUp()}pageDown(){this._widget.pageDown()}goToTop(){this._widget.goToTop()}goToBottom(){this._widget.goToBottom()}};Hx._DECORATION_OPTIONS=et.register({description:"content-hover-highlight",className:"hoverHighlight"});Hx=FC=Y3([Nh(1,yt),Nh(2,vi)],Hx);class DY{constructor(e,t,i){this.anchor=e,this.messages=t,this.isComplete=i}filter(e){const t=this.messages.filter(i=>i.isValidForHoverAnchor(e));return t.length===this.messages.length?this:new b4e(this,this.anchor,t,this.isComplete)}}class b4e extends DY{constructor(e,t,i,s){super(t,i,s),this.original=e}filter(e){return this.original.filter(e)}}class v4e{constructor(e,t,i,s,o,r,a,l,c,d){this.colorPicker=e,this.showAtPosition=t,this.showAtSecondaryPosition=i,this.preferAbove=s,this.stoleFocus=o,this.source=r,this.isBeforeContent=a,this.initialMousePosX=l,this.initialMousePosY=c,this.disposables=d,this.closestMouseDistance=void 0}}const FB=30,LE=10,y4e=6;let Bd=wa=class extends _4e{get isColorPickerVisible(){var e;return!!(!((e=this._visibleData)===null||e===void 0)&&e.colorPicker)}get isVisibleFromKeyboard(){var e;return((e=this._visibleData)===null||e===void 0?void 0:e.source)===1}get isVisible(){var e;return(e=this._hoverVisibleKey.get())!==null&&e!==void 0?e:!1}get isFocused(){var e;return(e=this._hoverFocusedKey.get())!==null&&e!==void 0?e:!1}constructor(e,t,i,s,o){const r=e.getOption(66)+8,a=150,l=new ei(a,r);super(e,l),this._configurationService=i,this._accessibilityService=s,this._keybindingService=o,this._hover=this._register(new xY),this._minimumSize=l,this._hoverVisibleKey=$.hoverVisible.bindTo(t),this._hoverFocusedKey=$.hoverFocused.bindTo(t),le(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._register(this._editor.onDidLayoutChange(()=>this._layout())),this._register(this._editor.onDidChangeConfiguration(d=>{d.hasChanged(50)&&this._updateFont()}));const c=this._register(tu(this._resizableNode.domNode));this._register(c.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(c.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._setHoverData(void 0),this._layout(),this._editor.addContentWidget(this)}dispose(){var e;super.dispose(),(e=this._visibleData)===null||e===void 0||e.disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return wa.ID}static _applyDimensions(e,t,i){const s=typeof t=="number"?`${t}px`:t,o=typeof i=="number"?`${i}px`:i;e.style.width=s,e.style.height=o}_setContentsDomNodeDimensions(e,t){const i=this._hover.contentsDomNode;return wa._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){const i=this._hover.containerDomNode;return wa._applyDimensions(i,e,t)}_setHoverWidgetDimensions(e,t){this._setContentsDomNodeDimensions(e,t),this._setContainerDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,i){const s=typeof t=="number"?`${t}px`:t,o=typeof i=="number"?`${i}px`:i;e.style.maxWidth=s,e.style.maxHeight=o}_setHoverWidgetMaxDimensions(e,t){wa._applyMaxDimensions(this._hover.contentsDomNode,e,t),wa._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth",typeof e=="number"?`${e}px`:e),this._layoutContentWidget()}_hasHorizontalScrollbar(){const e=this._hover.scrollbar.getScrollDimensions();return e.scrollWidth>e.width}_adjustContentsBottomPadding(){const e=this._hover.contentsDomNode,t=`${this._hover.scrollbar.options.horizontalScrollbarSize}px`;e.style.paddingBottom!==t&&(e.style.paddingBottom=t)}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions("none","none");const t=e.width,i=e.height;this._setHoverWidgetDimensions(t,i),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._setContentsDomNodeDimensions(t,i-LE))}_updateResizableNodeMaxDimensions(){var e,t;const i=(e=this._findMaximumRenderingWidth())!==null&&e!==void 0?e:1/0,s=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._resizableNode.maxSize=new ei(i,s),this._setHoverWidgetMaxDimensions(i,s)}_resize(e){var t,i;wa._lastDimensions=new ei(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),(i=(t=this._visibleData)===null||t===void 0?void 0:t.colorPicker)===null||i===void 0||i.layout()}_findAvailableSpaceVertically(){var e;const t=(e=this._visibleData)===null||e===void 0?void 0:e.showAtPosition;if(t)return this._positionPreference===1?this._availableVerticalSpaceAbove(t):this._availableVerticalSpaceBelow(t)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let t=y4e;return Array.from(this._hover.contentsDomNode.children).forEach(i=>{t+=i.clientHeight}),this._hasHorizontalScrollbar()&&(t+=LE),Math.min(e,t)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace","nowrap"),this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace","nowrap");const e=Array.from(this._hover.contentsDomNode.children).some(t=>t.scrollWidth>t.clientWidth);return this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"),this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"),e}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;const e=this._isHoverTextOverflowing(),t=typeof this._contentWidth>"u"?0:this._contentWidth-2;return e||this._hover.containerDomNode.clientWidth"u"||typeof this._visibleData.initialMousePosY>"u")return this._visibleData.initialMousePosX=e,this._visibleData.initialMousePosY=t,!1;const i=Rn(this.getDomNode());typeof this._visibleData.closestMouseDistance>"u"&&(this._visibleData.closestMouseDistance=BB(this._visibleData.initialMousePosX,this._visibleData.initialMousePosY,i.left,i.top,i.width,i.height));const s=BB(e,t,i.left,i.top,i.width,i.height);return s>this._visibleData.closestMouseDistance+4?!1:(this._visibleData.closestMouseDistance=Math.min(this._visibleData.closestMouseDistance,s),!0)}_setHoverData(e){var t;(t=this._visibleData)===null||t===void 0||t.disposables.dispose(),this._visibleData=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle("hidden",!e)}_layout(){const{fontSize:e,lineHeight:t}=this._editor.getOption(50),i=this._hover.contentsDomNode;i.style.fontSize=`${e}px`,i.style.lineHeight=`${t/e}`,this._updateMaxDimensions()}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}_updateContent(e){const t=this._hover.contentsDomNode;t.style.paddingBottom="",t.textContent="",t.appendChild(e)}_layoutContentWidget(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}_updateMaxDimensions(){const e=Math.max(this._editor.getLayoutInfo().height/4,250,wa._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,wa._lastDimensions.width);this._setHoverWidgetMaxDimensions(t,e)}_render(e,t){this._setHoverData(t),this._updateFont(),this._updateContent(e),this._updateMaxDimensions(),this.onContentsChanged(),this._editor.render()}getPosition(){var e;return this._visibleData?{position:this._visibleData.showAtPosition,secondaryPosition:this._visibleData.showAtSecondaryPosition,positionAffinity:this._visibleData.isBeforeContent?3:void 0,preference:[(e=this._positionPreference)!==null&&e!==void 0?e:1]}:null}showAt(e,t){var i,s,o,r;if(!this._editor||!this._editor.hasModel())return;this._render(e,t);const a=Dh(this._hover.containerDomNode),l=t.showAtPosition;this._positionPreference=(i=this._findPositionPreference(a,l))!==null&&i!==void 0?i:1,this.onContentsChanged(),t.stoleFocus&&this._hover.containerDomNode.focus(),(s=t.colorPicker)===null||s===void 0||s.layout();const c=d4e(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(r=(o=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))===null||o===void 0?void 0:o.getAriaLabel())!==null&&r!==void 0?r:"");c&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+c)}hide(){if(!this._visibleData)return;const e=this._visibleData.stoleFocus||this._hoverFocusedKey.get();this._setHoverData(void 0),this._resizableNode.maxSize=new ei(1/0,1/0),this._resizableNode.clearSashHoverState(),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),e&&this._editor.focus()}_removeConstraintsRenderNormally(){const e=this._editor.getLayoutInfo();this._resizableNode.layout(e.height,e.width),this._setHoverWidgetDimensions("auto","auto")}_adjustHoverHeightForScrollbar(e){var t;const i=this._hover.containerDomNode,s=this._hover.contentsDomNode,o=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._setContainerDomNodeDimensions(ws(i),Math.min(o,e)),this._setContentsDomNodeDimensions(ws(s),Math.min(o,e-LE))}setMinimumDimensions(e){this._minimumSize=new ei(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){const e=typeof this._contentWidth>"u"?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new ei(e,this._minimumSize.height)}onContentsChanged(){var e;this._removeConstraintsRenderNormally();const t=this._hover.containerDomNode;let i=Dh(t),s=ws(t);if(this._resizableNode.layout(i,s),this._setHoverWidgetDimensions(s,i),i=Dh(t),s=ws(t),this._contentWidth=s,this._updateMinimumWidth(),this._resizableNode.layout(i,s),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._adjustHoverHeightForScrollbar(i)),!((e=this._visibleData)===null||e===void 0)&&e.showAtPosition){const o=Dh(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(o,this._visibleData.showAtPosition)}this._layoutContentWidget()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-FB})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+FB})}pageUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e-t})}pageDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e+t})}goToTop(){this._hover.scrollbar.setScrollPosition({scrollTop:0})}goToBottom(){this._hover.scrollbar.setScrollPosition({scrollTop:this._hover.scrollbar.getScrollDimensions().scrollHeight})}};Bd.ID="editor.contrib.resizableContentHoverWidget";Bd._lastDimensions=new ei(0,0);Bd=wa=Y3([Nh(1,tt),Nh(2,ni),Nh(3,Eu),Nh(4,vi)],Bd);let FR=class extends Y{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=OB("div.hover-row.status-bar"),this.actionsElement=le(this.hoverElement,OB("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;return this._hasContent=!0,this._register(G3.render(this.actionsElement,e,i))}append(e){const t=le(this.actionsElement,e);return this._hasContent=!0,t}};FR=Y3([Nh(0,vi)],FR);class $x{get anchor(){return this._anchor}set anchor(e){this._anchor=e}get shouldFocus(){return this._shouldFocus}set shouldFocus(e){this._shouldFocus=e}get source(){return this._source}set source(e){this._source=e}get insistOnKeepingHoverVisible(){return this._insistOnKeepingHoverVisible}set insistOnKeepingHoverVisible(e){this._insistOnKeepingHoverVisible=e}constructor(e,t){this._editor=e,this._participants=t,this._anchor=null,this._shouldFocus=!1,this._source=0,this._insistOnKeepingHoverVisible=!1}static _getLineDecorations(e,t){if(t.type!==1&&!t.supportsMarkerHover)return[];const i=e.getModel(),s=t.range.startLineNumber;if(s>i.getLineCount())return[];const o=i.getLineMaxColumn(s);return e.getLineDecorations(s).filter(r=>{if(r.options.isWholeLine)return!0;const a=r.range.startLineNumber===s?r.range.startColumn:1,l=r.range.endLineNumber===s?r.range.endColumn:o;if(r.options.showIfCollapsed){if(a>t.range.startColumn+1||t.range.endColumn-1>l)return!1}else if(a>t.range.startColumn||t.range.endColumn>l)return!1;return!0})}computeAsync(e){const t=this._anchor;if(!this._editor.hasModel()||!t)return dn.EMPTY;const i=$x._getLineDecorations(this._editor,t);return dn.merge(this._participants.map(s=>s.computeAsync?s.computeAsync(t,i,e):dn.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=$x._getLineDecorations(this._editor,this._anchor);let t=[];for(const i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return VL(t)}}function BB(n,e,t,i,s,o){const r=t+s/2,a=i+o/2,l=Math.max(Math.abs(n-r)-s/2,0),c=Math.max(Math.abs(e-a)-o/2,0);return Math.sqrt(l*l+c*c)}const WB=ye;class Mp extends Y{constructor(e,t,i){super(),this._renderDisposeables=this._register(new pe),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new xY),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new zv({editor:this._editor},t,i)),this._computer=new w4e(this._editor),this._hoverOperation=this._register(new LY(this._editor,this._computer)),this._register(this._hoverOperation.onResult(s=>{this._withResult(s.value)})),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(50)&&this._updateFont()})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return Mp.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 s of t){const o=WB("div.hover-row.markdown-hover"),r=le(o,WB("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(s.value));r.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),s=this._editor.getScrollTop(),o=this._editor.getOption(66),r=this._hover.containerDomNode.clientHeight,a=i-s-(r-o)/2;this._hover.containerDomNode.style.left=`${t.glyphMarginLeft+t.glyphMarginWidth}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(a),0)}px`}}Mp.ID="editor.contrib.modesGlyphHoverWidget";class w4e{get lineNumber(){return this._lineNumber}set lineNumber(e){this._lineNumber=e}constructor(e){this._editor=e,this._lineNumber=-1}computeSync(){const e=s=>({value:s}),t=this._editor.getLineDecorations(this._lineNumber),i=[];if(!t)return i;for(const s of t){if(!s.options.glyphMarginClassName)continue;const o=s.options.glyphMarginHoverMessage;!o||wv(o)||i.push(...J$(o).map(e))}return i}}var C4e=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class S4e{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}function x4e(n,e,t,i,s){return C4e(this,void 0,void 0,function*(){try{const o=yield Promise.resolve(n.provideHover(t,i,s));if(o&&D4e(o))return new S4e(n,o,e)}catch(o){wc(o)}})}function kY(n,e,t,i){const o=n.ordered(e).map((r,a)=>x4e(r,a,e,t,i));return dn.fromPromises(o).coalesce()}function L4e(n,e,t,i){return kY(n,e,t,i).map(s=>s.hover).toPromise()}n0("_executeHoverProvider",(n,e,t)=>{const i=n.get(nt);return L4e(i.hoverProvider,e,t,ln.None)});function D4e(n){const e=typeof n.range<"u",t=typeof n.contents<"u"&&n.contents&&n.contents.length>0;return e&&t}var k4e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Yw=function(n,e){return function(t,i){e(t,i,n)}};const VB=ye;class j0{constructor(e,t,i,s,o){this.owner=e,this.range=t,this.contents=i,this.isBeforeContent=s,this.ordinal=o}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let BR=class{constructor(e,t,i,s,o){this._editor=e,this._languageService=t,this._openerService=i,this._configurationService=s,this._languageFeaturesService=o,this.hoverOrdinal=3}createLoadingMessage(e){return new j0(this,e.range,[new Mm().appendText(m("modesContentHover.loading","Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),s=e.range.startLineNumber,o=i.getLineMaxColumn(s),r=[];let a=1e3;const l=i.getLineLength(s),c=i.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),d=this._editor.getOption(116),u=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:c});let h=!1;d>=0&&l>d&&e.range.startColumn>=d&&(h=!0,r.push(new j0(this,e.range,[{value:m("stopped rendering","Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,a++))),!h&&typeof u=="number"&&l>=u&&r.push(new j0(this,e.range,[{value:m("too many characters","Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],!1,a++));let f=!1;for(const g of t){const p=g.range.startLineNumber===s?g.range.startColumn:1,_=g.range.endLineNumber===s?g.range.endColumn:o,v=g.options.hoverMessage;if(!v||wv(v))continue;g.options.beforeContentClassName&&(f=!0);const b=new N(e.range.startLineNumber,p,e.range.startLineNumber,_);r.push(new j0(this,b,J$(v),f,a++))}return r}computeAsync(e,t,i){if(!this._editor.hasModel()||e.type!==1)return dn.EMPTY;const s=this._editor.getModel();if(!this._languageFeaturesService.hoverProvider.has(s))return dn.EMPTY;const o=new V(e.range.startLineNumber,e.range.startColumn);return kY(this._languageFeaturesService.hoverProvider,s,o,i).filter(r=>!wv(r.hover.contents)).map(r=>{const a=r.hover.range?N.lift(r.hover.range):e.range;return new j0(this,a,r.hover.contents,!1,r.ordinal)})}renderHoverParts(e,t){return E4e(e,t,this._editor,this._languageService,this._openerService)}};BR=k4e([Yw(1,Ni),Yw(2,Dc),Yw(3,ni),Yw(4,nt)],BR);function E4e(n,e,t,i,s){e.sort((r,a)=>r.ordinal-a.ordinal);const o=new pe;for(const r of e)for(const a of r.contents){if(wv(a))continue;const l=VB("div.hover-row.markdown-hover"),c=le(l,VB("div.hover-contents")),d=o.add(new zv({editor:t},i,s));o.add(d.onDidRenderAsync(()=>{c.className="hover-contents code-hover-contents",n.onContentsChanged()}));const u=o.add(d.render(a));c.appendChild(u.element),n.fragment.appendChild(l)}return o}var A4e=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class We{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+We.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new We(this.value+We.sep+e)}}We.sep=".";We.None=new We("@@none@@");We.Empty=new We("");We.QuickFix=new We("quickfix");We.Refactor=new We("refactor");We.RefactorExtract=We.Refactor.append("extract");We.RefactorInline=We.Refactor.append("inline");We.RefactorMove=We.Refactor.append("move");We.RefactorRewrite=We.Refactor.append("rewrite");We.Notebook=new We("notebook");We.Source=new We("source");We.SourceOrganizeImports=We.Source.append("organizeImports");We.SourceFixAll=We.Source.append("fixAll");We.SurroundWith=We.Refactor.append("surround");var lu;(function(n){n.Refactor="refactor",n.RefactorPreview="refactor preview",n.Lightbulb="lightbulb",n.Default="other (default)",n.SourceAction="source action",n.QuickFix="quick fix action",n.FixAll="fix all",n.OrganizeImports="organize imports",n.AutoFix="auto fix",n.QuickFixHover="quick fix hover window",n.OnSave="save participants",n.ProblemsView="problems view"})(lu||(lu={}));function I4e(n,e){return!(n.include&&!n.include.intersects(e)||n.excludes&&n.excludes.some(t=>EY(e,t,n.include))||!n.includeSourceActions&&We.Source.contains(e))}function T4e(n,e){const t=e.kind?new We(e.kind):void 0;return!(n.include&&(!t||!n.include.contains(t))||n.excludes&&t&&n.excludes.some(i=>EY(t,i,n.include))||!n.includeSourceActions&&t&&We.Source.contains(t)||n.onlyIncludePreferredActions&&!e.isPreferred)}function EY(n,e,t){return!(!e.contains(n)||t&&e.contains(t))}class mh{static fromUser(e,t){return!e||typeof e!="object"?new mh(t.kind,t.apply,!1):new mh(mh.getKindFromUser(e,t.kind),mh.getApplyFromUser(e,t.apply),mh.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 We(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}constructor(e,t,i){this.kind=e,this.apply=t,this.preferred=i}}class N4e{constructor(e,t,i){this.action=e,this.provider=t,this.highlightRange=i}resolve(e){var t;return A4e(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(s){wc(s)}i&&(this.action.edit=i.edit)}return this})}}var Ux=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const R4e="editor.action.codeAction",AY="editor.action.quickFix",M4e="editor.action.autoFix",P4e="editor.action.refactor",O4e="editor.action.sourceAction",IY="editor.action.organizeImports",TY="editor.action.fixAll";class J_ extends Y{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return sc(e.diagnostics)?sc(t.diagnostics)?J_.codeActionsPreferredComparator(e,t):-1:sc(t.diagnostics)?1:J_.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(J_.codeActionsComparator),this.validActions=this.allActions.filter(({action:s})=>!s.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&We.QuickFix.contains(new We(e.kind))&&!!e.isPreferred)}}const zB={actions:[],documentation:void 0};function eb(n,e,t,i,s,o){var r;return Ux(this,void 0,void 0,function*(){const a=i.filter||{},l=Object.assign(Object.assign({},a),{excludes:[...a.excludes||[],We.Notebook]}),c={only:(r=a.include)===null||r===void 0?void 0:r.value,trigger:i.type},d=new jTe(e,o),u=i.type===2,h=F4e(n,e,u?l:a),f=new pe,g=h.map(_=>Ux(this,void 0,void 0,function*(){try{s.report(_);const v=yield _.provideCodeActions(e,t,c,d.token);if(v&&f.add(v),d.token.isCancellationRequested)return zB;const b=((v==null?void 0:v.actions)||[]).filter(w=>w&&T4e(a,w)),y=W4e(_,b,a.include);return{actions:b.map(w=>new N4e(w,_)),documentation:y}}catch(v){if(Bf(v))throw v;return wc(v),zB}})),p=n.onDidChange(()=>{const _=n.all(e);Zi(_,h)||d.cancel()});try{const _=yield Promise.all(g),v=_.map(y=>y.actions).flat(),b=[...VL(_.map(y=>y.documentation)),...B4e(n,e,i,v)];return new J_(v,b,f)}finally{p.dispose(),d.dispose()}})}function F4e(n,e,t){return n.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(s=>I4e(t,new We(s))):!0)}function*B4e(n,e,t,i){var s,o,r;if(e&&i.length)for(const a of n.all(e))a._getAdditionalMenuItems&&(yield*(s=a._getAdditionalMenuItems)===null||s===void 0?void 0:s.call(a,{trigger:t.type,only:(r=(o=t.filter)===null||o===void 0?void 0:o.include)===null||r===void 0?void 0:r.value},i.map(l=>l.action)))}function W4e(n,e,t){if(!n.documentation)return;const i=n.documentation.map(s=>({kind:new We(s.kind),command:s.command}));if(t){let s;for(const o of i)o.kind.contains(t)&&(s?s.kind.contains(o.kind)&&(s=o):s=o);if(s)return s==null?void 0:s.command}for(const s of e)if(s.kind){for(const o of i)if(o.kind.contains(new We(s.kind)))return o.command}}var jx;(function(n){n.OnSave="onSave",n.FromProblemsView="fromProblemsView",n.FromCodeActions="fromCodeActions"})(jx||(jx={}));function V4e(n,e,t,i,s=ln.None){var o;return Ux(this,void 0,void 0,function*(){const r=n.get(hG),a=n.get(gs),l=n.get(Cc),c=n.get(Dn);if(l.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),yield e.resolve(s),!s.isCancellationRequested&&!(!((o=e.action.edit)===null||o===void 0)&&o.edits.length&&!(yield r.apply(e.action.edit,{editor:i==null?void 0:i.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==jx.OnSave,showPreview:i==null?void 0:i.preview})).isApplied)&&e.action.command)try{yield a.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(d){const u=z4e(d);c.error(typeof u=="string"?u:m("applyCodeActionFailed","An unknown error occurred while applying the code action"))}})}function z4e(n){return typeof n=="string"?n:n instanceof Error&&typeof n.message=="string"?n.message:void 0}Zt.registerCommand("_executeCodeActionProvider",function(n,e,t,i,s){return Ux(this,void 0,void 0,function*(){if(!(e instanceof je))throw oc();const{codeActionProvider:o}=n.get(nt),r=n.get(fs).getModel(e);if(!r)throw oc();const a=ct.isISelection(t)?ct.liftSelection(t):N.isIRange(t)?r.validateRange(t):void 0;if(!a)throw oc();const l=typeof i=="string"?new We(i):void 0,c=yield eb(o,r,a,{type:1,triggerAction:lu.Default,filter:{includeSourceActions:!0,include:l}},kp.None,ln.None),d=[],u=Math.min(c.validActions.length,typeof s=="number"?s:0);for(let h=0;hh.action)}finally{setTimeout(()=>c.dispose(),100)}})});var H4e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},$4e=function(n,e){return function(t,i){e(t,i,n)}},WR;let qx=WR=class{constructor(e){this.keybindingService=e}getResolver(){const e=new Wf(()=>this.keybindingService.getKeybindings().filter(t=>WR.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===IY?i={kind:We.SourceOrganizeImports.value}:t.command===TY&&(i={kind:We.SourceFixAll.value}),Object.assign({resolvedKeybinding:t.resolvedKeybinding},mh.fromUser(i,{kind:We.None,apply:"never"}))}));return t=>{if(t.kind){const i=this.bestKeybindingForCodeAction(t,e.value);return i==null?void 0:i.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new We(e.kind);return t.filter(s=>s.kind.contains(i)).filter(s=>s.preferred?e.isPreferred:!0).reduceRight((s,o)=>s?s.kind.contains(o.kind)?o:s:o,void 0)}};qx.codeActionCommands=[P4e,R4e,O4e,IY,TY];qx=WR=H4e([$4e(0,vi)],qx);E("symbolIcon.arrayForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.booleanForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},m("symbolIcon.classForeground","The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.colorForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.constantForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},m("symbolIcon.constructorForeground","The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},m("symbolIcon.enumeratorForeground","The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},m("symbolIcon.enumeratorMemberForeground","The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},m("symbolIcon.eventForeground","The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},m("symbolIcon.fieldForeground","The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.fileForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.folderForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},m("symbolIcon.functionForeground","The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},m("symbolIcon.interfaceForeground","The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.keyForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.keywordForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},m("symbolIcon.methodForeground","The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.moduleForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.namespaceForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.nullForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.numberForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.objectForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.operatorForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.packageForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.propertyForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.referenceForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.snippetForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.stringForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.structForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.textForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.typeParameterForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.unitForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},m("symbolIcon.variableForeground","The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));const NY=Object.freeze({kind:We.Empty,title:m("codeAction.widget.id.more","More Actions...")}),U4e=Object.freeze([{kind:We.QuickFix,title:m("codeAction.widget.id.quickfix","Quick Fix")},{kind:We.RefactorExtract,title:m("codeAction.widget.id.extract","Extract"),icon:se.wrench},{kind:We.RefactorInline,title:m("codeAction.widget.id.inline","Inline"),icon:se.wrench},{kind:We.RefactorRewrite,title:m("codeAction.widget.id.convert","Rewrite"),icon:se.wrench},{kind:We.RefactorMove,title:m("codeAction.widget.id.move","Move"),icon:se.wrench},{kind:We.SurroundWith,title:m("codeAction.widget.id.surround","Surround With"),icon:se.symbolSnippet},{kind:We.Source,title:m("codeAction.widget.id.source","Source Action"),icon:se.symbolFile},NY]);function j4e(n,e,t){if(!e)return n.map(o=>{var r;return{kind:"action",item:o,group:NY,disabled:!!o.action.disabled,label:o.action.disabled||o.action.title,canPreview:!!(!((r=o.action.edit)===null||r===void 0)&&r.edits.length)}});const i=U4e.map(o=>({group:o,actions:[]}));for(const o of n){const r=o.action.kind?new We(o.action.kind):We.None;for(const a of i)if(a.group.kind.contains(r)){a.actions.push(o);break}}const s=[];for(const o of i)if(o.actions.length){s.push({kind:"header",group:o.group});for(const r of o.actions)s.push({kind:"action",item:r,group:o.group,label:r.action.title,disabled:!!r.action.disabled,keybinding:t(r.action)})}return s}var q4e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},G4e=function(n,e){return function(t,i){e(t,i,n)}},VR,op;(function(n){n.Hidden={type:0};class e{constructor(i,s,o,r){this.actions=i,this.trigger=s,this.editorPosition=o,this.widgetPosition=r,this.type=1}}n.Showing=e})(op||(op={}));let Hv=VR=class extends Y{constructor(e,t){super(),this._editor=e,this._onClick=this._register(new B),this.onClick=this._onClick.event,this._state=op.Hidden,this._domNode=ye("div.lightBulbWidget"),this._register(Mt.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(i=>{const s=this._editor.getModel();(this.state.type!==1||!s||this.state.editorPosition.lineNumber>=s.getLineCount())&&this.hide()})),this._register(ame(this._domNode,i=>{if(this.state.type!==1)return;this._editor.focus(),i.preventDefault();const{top:s,height:o}=Rn(this._domNode),r=this._editor.getOption(66);let a=Math.floor(r/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber{(i.buttons&1)===1&&this.hide()})),this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(64)&&!this._editor.getOption(64).enabled&&this.hide()})),this._register(ue.runAndSubscribe(t.onDidUpdateKeybindings,()=>{var i,s,o,r;this._preferredKbLabel=(s=(i=t.lookupKeybinding(M4e))===null||i===void 0?void 0:i.getLabel())!==null&&s!==void 0?s:void 0,this._quickFixKbLabel=(r=(o=t.lookupKeybinding(AY))===null||o===void 0?void 0:o.getLabel())!==null&&r!==void 0?r:void 0,this._updateLightBulbTitleAndIcon()}))}dispose(){super.dispose(),this._editor.removeContentWidget(this)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return this._state.type===1?this._state.widgetPosition:null}update(e,t,i){if(e.validActions.length<=0)return this.hide();const s=this._editor.getOptions();if(!s.get(64).enabled)return this.hide();const o=this._editor.getModel();if(!o)return this.hide();const{lineNumber:r,column:a}=o.validatePosition(i),l=o.getOptions().tabSize,c=s.get(50),d=o.getLineContent(r),u=SD(d,l),h=c.spaceWidth*u>22,f=p=>p>2&&this._editor.getTopForLineNumber(p)===this._editor.getTopForLineNumber(p-1);let g=r;if(!h){if(r>1&&!f(r-1))g-=1;else if(!f(r+1))g+=1;else if(a*c.spaceWidth<22)return this.hide()}this.state=new op.Showing(e,t,i,{position:{lineNumber:g,column:1},preference:VR._posPref}),this._editor.layoutContentWidget(this)}hide(){this.state!==op.Hidden&&(this.state=op.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(...Te.asClassNameArray(se.lightBulb)),this._domNode.classList.add(...Te.asClassNameArray(se.lightbulbAutofix)),this._preferredKbLabel)){this.title=m("preferredcodeActionWithKb","Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel);return}this._domNode.classList.remove(...Te.asClassNameArray(se.lightbulbAutofix)),this._domNode.classList.add(...Te.asClassNameArray(se.lightBulb)),this._quickFixKbLabel?this.title=m("codeActionWithKb","Show Code Actions ({0})",this._quickFixKbLabel):this.title=m("codeAction","Show Code Actions")}set title(e){this._domNode.title=e}};Hv.ID="editor.contrib.lightbulbWidget";Hv._posPref=[0];Hv=VR=q4e([G4e(1,vi)],Hv);var RY=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},zR=function(n,e){return function(t,i){e(t,i,n)}},K4e=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const MY="acceptSelectedCodeAction",PY="previewSelectedCodeAction";class Y4e{get templateId(){return"header"}renderTemplate(e){e.classList.add("group-header");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,i){var s,o;i.text.textContent=(o=(s=e.group)===null||s===void 0?void 0:s.title)!==null&&o!==void 0?o:""}disposeTemplate(e){}}let HR=class{get templateId(){return"action"}constructor(e,t){this._supportsPreview=e,this._keybindingService=t}renderTemplate(e){e.classList.add(this.templateId);const t=document.createElement("div");t.className="icon",e.append(t);const i=document.createElement("span");i.className="title",e.append(i);const s=new cy(e,wo);return{container:e,icon:t,text:i,keybinding:s}}renderElement(e,t,i){var s,o,r;if(!((s=e.group)===null||s===void 0)&&s.icon?(i.icon.className=Te.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=re(e.group.icon.color.id))):(i.icon.className=Te.asClassName(se.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;i.text.textContent=OY(e.label),i.keybinding.set(e.keybinding),bme(!!e.keybinding,i.keybinding.element);const a=(o=this._keybindingService.lookupKeybinding(MY))===null||o===void 0?void 0:o.getLabel(),l=(r=this._keybindingService.lookupKeybinding(PY))===null||r===void 0?void 0:r.getLabel();i.container.classList.toggle("option-disabled",e.disabled),e.disabled?i.container.title=e.label:a&&l?this._supportsPreview&&e.canPreview?i.container.title=m({key:"label-preview",comment:['placeholders are keybindings, e.g "F2 to apply, Shift+F2 to preview"']},"{0} to apply, {1} to preview",a,l):i.container.title=m({key:"label",comment:['placeholder is a keybinding, e.g "F2 to apply"']},"{0} to apply",a):i.container.title=""}disposeTemplate(e){}};HR=RY([zR(1,vi)],HR);class Z4e extends UIEvent{constructor(){super("acceptSelectedAction")}}class HB extends UIEvent{constructor(){super("previewSelectedAction")}}function X4e(n){if(n.kind==="action")return n.label}let $R=class extends Y{constructor(e,t,i,s,o,r){super(),this._delegate=s,this._contextViewService=o,this._keybindingService=r,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new Ir),this.domNode=document.createElement("div"),this.domNode.classList.add("actionList");const a={getHeight:l=>l.kind==="header"?this._headerLineHeight:this._actionLineHeight,getTemplateId:l=>l.kind};this._list=this._register(new ga(e,this.domNode,a,[new HR(t,this._keybindingService),new Y4e],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:X4e},accessibilityProvider:{getAriaLabel:l=>{if(l.kind==="action"){let c=l.label?OY(l==null?void 0:l.label):"";return l.disabled&&(c=m({key:"customQuickFixWidget.labels",comment:["Action widget labels for accessibility."]},"{0}, Disabled Reason: {1}",c,l.disabled)),c}return null},getWidgetAriaLabel:()=>m({key:"customQuickFixWidget",comment:["An action widget option"]},"Action Widget"),getRole:l=>l.kind==="action"?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(Jf),this._register(this._list.onMouseClick(l=>this.onListClick(l))),this._register(this._list.onMouseOver(l=>this.onListHover(l))),this._register(this._list.onDidChangeFocus(()=>this.onFocus())),this._register(this._list.onDidChangeSelection(l=>this.onListSelection(l))),this._allMenuItems=i,this._list.splice(0,this._list.length,this._allMenuItems),this._list.length&&this.focusNext()}focusCondition(e){return!e.disabled&&e.kind==="action"}hide(e){this._delegate.onHide(e),this.cts.cancel(),this._contextViewService.hideContextView()}layout(e){const t=this._allMenuItems.filter(c=>c.kind==="header").length,s=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight;this._list.layout(s);const o=this._allMenuItems.map((c,d)=>{const u=document.getElementById(this._list.getElementID(d));if(u){u.style.width="auto";const h=u.getBoundingClientRect().width;return u.style.width="",h}return 0}),r=Math.max(...o,e),l=Math.min(s,document.body.clientHeight*.7);return this._list.layout(l,r),this.domNode.style.height=`${l}px`,this._list.domFocus(),r}focusPrevious(){this._list.focusPrevious(1,!0,void 0,this.focusCondition)}focusNext(){this._list.focusNext(1,!0,void 0,this.focusCondition)}acceptSelected(e){const t=this._list.getFocus();if(t.length===0)return;const i=t[0],s=this._list.element(i);if(!this.focusCondition(s))return;const o=e?new HB:new Z4e;this._list.setSelection([i],o)}onListSelection(e){if(!e.elements.length)return;const t=e.elements[0];t.item&&this.focusCondition(t)?this._delegate.onSelect(t.item,e.browserEvent instanceof HB):this._list.setSelection([])}onFocus(){var e,t;this._list.domFocus();const i=this._list.getFocus();if(i.length===0)return;const s=i[0],o=this._list.element(s);(t=(e=this._delegate).onFocus)===null||t===void 0||t.call(e,o.item)}onListHover(e){return K4e(this,void 0,void 0,function*(){const t=e.element;if(t&&t.item&&this.focusCondition(t)){if(this._delegate.onHover&&!t.disabled&&t.kind==="action"){const i=yield this._delegate.onHover(t.item,this.cts.token);t.canPreview=i?i.canPreview:void 0}e.index&&this._list.splice(e.index,1,[t])}this._list.setFocus(typeof e.index=="number"?[e.index]:[])})}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}};$R=RY([zR(4,Iu),zR(5,vi)],$R);function OY(n){return n.replace(/\r\n|\r|\n/g," ")}var Q4e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},DE=function(n,e){return function(t,i){e(t,i,n)}};E("actionBar.toggledBackground",{dark:kh,light:kh,hcDark:kh,hcLight:kh},m("actionBar.toggledBackground","Background color for toggled action items in action bar."));const Tf={Visible:new _e("codeActionMenuVisible",!1,m("codeActionMenuVisible","Whether the action widget list is visible"))},og=at("actionWidgetService");let Nf=class extends Y{get isVisible(){return Tf.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new ra)}show(e,t,i,s,o,r,a){const l=Tf.Visible.bindTo(this._contextKeyService),c=this._instantiationService.createInstance($R,e,t,i,s);this._contextViewService.showContextView({getAnchor:()=>o,render:d=>(l.set(!0),this._renderWidget(d,c,a??[])),onHide:d=>{l.reset(),this._onWidgetClosed(d)}},r,!1)}acceptSelected(e){var t;(t=this._list.value)===null||t===void 0||t.acceptSelected(e)}focusPrevious(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusPrevious()}focusNext(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusNext()}hide(){var e;(e=this._list.value)===null||e===void 0||e.hide(),this._list.clear()}_renderWidget(e,t,i){var s;const o=document.createElement("div");if(o.classList.add("action-widget"),e.appendChild(o),this._list.value=t,this._list.value)o.appendChild(this._list.value.domNode);else throw new Error("List has no value");const r=new pe,a=document.createElement("div"),l=e.appendChild(a);l.classList.add("context-view-block"),r.add(K(l,de.MOUSE_DOWN,g=>g.stopPropagation()));const c=document.createElement("div"),d=e.appendChild(c);d.classList.add("context-view-pointerBlock"),r.add(K(d,de.POINTER_MOVE,()=>d.remove())),r.add(K(d,de.MOUSE_DOWN,()=>d.remove()));let u=0;if(i.length){const g=this._createActionBar(".action-widget-action-bar",i);g&&(o.appendChild(g.getContainer().parentElement),r.add(g),u=g.getContainer().offsetWidth)}const h=(s=this._list.value)===null||s===void 0?void 0:s.layout(u);o.style.width=`${h}px`;const f=r.add(tu(e));return r.add(f.onDidBlur(()=>this.hide())),r}_createActionBar(e,t){if(!t.length)return;const i=ye(e),s=new al(i);return s.push(t,{icon:!1,label:!0}),s}_onWidgetClosed(e){var t;(t=this._list.value)===null||t===void 0||t.hide(e)}};Nf=Q4e([DE(0,Iu),DE(1,tt),DE(2,yt)],Nf);gt(og,Nf,1);const by=1100;Vs(class extends i0{constructor(){super({id:"hideCodeActionWidget",title:{value:m("hideCodeActionWidget.title","Hide action widget"),original:"Hide action widget"},precondition:Tf.Visible,keybinding:{weight:by,primary:9,secondary:[1033]}})}run(n){n.get(og).hide()}});Vs(class extends i0{constructor(){super({id:"selectPrevCodeAction",title:{value:m("selectPrevCodeAction.title","Select previous action"),original:"Select previous action"},precondition:Tf.Visible,keybinding:{weight:by,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(n){const e=n.get(og);e instanceof Nf&&e.focusPrevious()}});Vs(class extends i0{constructor(){super({id:"selectNextCodeAction",title:{value:m("selectNextCodeAction.title","Select next action"),original:"Select next action"},precondition:Tf.Visible,keybinding:{weight:by,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(n){const e=n.get(og);e instanceof Nf&&e.focusNext()}});Vs(class extends i0{constructor(){super({id:MY,title:{value:m("acceptSelected.title","Accept selected action"),original:"Accept selected action"},precondition:Tf.Visible,keybinding:{weight:by,primary:3,secondary:[2137]}})}run(n){const e=n.get(og);e instanceof Nf&&e.acceptSelected()}});Vs(class extends i0{constructor(){super({id:PY,title:{value:m("previewSelected.title","Preview selected action"),original:"Preview selected action"},precondition:Tf.Visible,keybinding:{weight:by,primary:2051}})}run(n){const e=n.get(og);e instanceof Nf&&e.acceptSelected(!0)}});var J4e=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const ePe=new _e("supportedCodeAction","");class tPe extends Y{constructor(e,t,i,s=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=s,this._autoTriggerTimer=this._register(new Lc),this._register(this._markerService.onMarkerChanged(o=>this._onMarkerChanges(o))),this._register(this._editor.onDidChangeCursorPosition(()=>this._tryAutoTrigger()))}trigger(e){const t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);this._signalChange(t?{trigger:e,selection:t}:void 0)}_onMarkerChanges(e){const t=this._editor.getModel();t&&e.some(i=>TP(i,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:lu.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=this._editor.getSelection();if(i.isEmpty()&&e.type===2){const{lineNumber:s,column:o}=i.getPosition(),r=t.getLineContent(s);if(r.length===0)return;if(o===1){if(/\s/.test(r[0]))return}else if(o===t.getLineMaxColumn(s)){if(/\s/.test(r[r.length-1]))return}else if(/\s/.test(r[o-2])&&/\s/.test(r[o-1]))return}return i}}var _h;(function(n){n.Empty={type:0};class e{constructor(i,s,o){this.trigger=i,this.position=s,this._cancellablePromise=o,this.type=1,this.actions=o.catch(r=>{if(Bf(r))return FY;throw r})}cancel(){this._cancellablePromise.cancel()}}n.Triggered=e})(_h||(_h={}));const FY=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1});class iPe extends Y{constructor(e,t,i,s,o,r){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=o,this._configurationService=r,this._codeActionOracle=this._register(new ra),this._state=_h.Empty,this._onDidChangeState=this._register(new B),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=ePe.bindTo(s),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(this._registry.onDidChange(()=>this._update())),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(_h.Empty,!0))}_settingEnabledNearbyQuickfixes(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService?this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickfixes",{resource:t==null?void 0:t.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(_h.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(90)){const t=this._registry.all(e).flatMap(i=>{var s;return(s=i.providedCodeActionKinds)!==null&&s!==void 0?s:[]});this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new tPe(this._editor,this._markerService,i=>{var s;if(!i){this.setState(_h.Empty);return}const o=i.selection.getStartPosition(),r=xc(a=>J4e(this,void 0,void 0,function*(){var l,c,d,u,h,f;if(this._settingEnabledNearbyQuickfixes()&&i.trigger.type===1&&(i.trigger.triggerAction===lu.QuickFix||!((c=(l=i.trigger.filter)===null||l===void 0?void 0:l.include)===null||c===void 0)&&c.contains(We.QuickFix))){const g=yield eb(this._registry,e,i.selection,i.trigger,kp.None,a);if(a.isCancellationRequested)return FY;if(!((d=g.validActions)===null||d===void 0?void 0:d.some(_=>_.action.kind?We.QuickFix.contains(new We(_.action.kind)):!1))){const _=this._markerService.read({resource:e.uri});if(_.length>0){const v=i.selection.getPosition();let b=v,y=Number.MAX_VALUE,w=!1;for(const C of _){const L=C.endColumn,x=C.endLineNumber,D=C.startLineNumber;(x===v.lineNumber||D===v.lineNumber)&&Math.abs(v.column-L){k.highlightRange=k.action.isPreferred}),D.push(...x.validActions)),{validActions:D,allActions:g.allActions,documentation:g.documentation,hasAutoFix:g.hasAutoFix,dispose:()=>{g.dispose()}}}}}}return eb(this._registry,e,i.selection,i.trigger,kp.None,a)}));i.trigger.type===1&&((s=this._progressService)===null||s===void 0||s.showWhile(r,250)),this.setState(new _h.Triggered(i.trigger,o,r))},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:lu.Default})}else this._supportedCodeActions.reset()}trigger(e){var t;(t=this._codeActionOracle.value)===null||t===void 0||t.trigger(e)}setState(e,t){e!==this._state&&(this._state.type===1&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}}var nPe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Ll=function(n,e){return function(t,i){e(t,i,n)}},q0=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},BC;const sPe="quickfix-edit-highlight";let $v=BC=class extends Y{static get(e){return e.getContribution(BC.ID)}constructor(e,t,i,s,o,r,a,l,c,d){super(),this._commandService=a,this._configurationService=l,this._actionWidgetService=c,this._instantiationService=d,this._activeCodeActions=this._register(new ra),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new iPe(this._editor,o.codeActionProvider,t,i,r,l)),this._register(this._model.onDidChangeState(u=>this.update(u))),this._lightBulbWidget=new Wf(()=>{const u=this._editor.getContribution(Hv.ID);return u&&this._register(u.onClick(h=>this.showCodeActionList(h.actions,h,{includeDisabledActions:!1,fromLightbulb:!0}))),u}),this._resolver=s.createInstance(qx),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}showCodeActions(e,t,i){return this.showCodeActionList(t,i,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,i,s){var o;if(!this._editor.hasModel())return;(o=yr.get(this._editor))===null||o===void 0||o.closeMessage();const r=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:i,autoApply:s,context:{notAvailableMessage:e,position:r}})}_trigger(e){return this._model.trigger(e)}_applyCodeAction(e,t,i){return q0(this,void 0,void 0,function*(){try{yield this._instantiationService.invokeFunction(V4e,e,jx.FromCodeActions,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:lu.QuickFix,filter:{}})}})}update(e){var t,i,s,o,r,a,l;return q0(this,void 0,void 0,function*(){if(e.type!==1){(t=this._lightBulbWidget.rawValue)===null||t===void 0||t.hide();return}let c;try{c=yield e.actions}catch(d){_t(d);return}if(!this._disposed)if((i=this._lightBulbWidget.value)===null||i===void 0||i.update(c,e.trigger,e.position),e.trigger.type===1){if(!((s=e.trigger.filter)===null||s===void 0)&&s.include){const u=this.tryGetValidActionToApply(e.trigger,c);if(u){try{(o=this._lightBulbWidget.value)===null||o===void 0||o.hide(),yield this._applyCodeAction(u,!1,!1)}finally{c.dispose()}return}if(e.trigger.context){const h=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,c);if(h&&h.action.disabled){(r=yr.get(this._editor))===null||r===void 0||r.showMessage(h.action.disabled,e.trigger.context.position),c.dispose();return}}}const d=!!(!((a=e.trigger.filter)===null||a===void 0)&&a.include);if(e.trigger.context&&(!c.allActions.length||!d&&!c.validActions.length)){(l=yr.get(this._editor))===null||l===void 0||l.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=c,c.dispose();return}this._activeCodeActions.value=c,this.showCodeActionList(c,this.toCoords(e.position),{includeDisabledActions:d,fromLightbulb:!1})}else this._actionWidgetService.isVisible?c.dispose():this._activeCodeActions.value=c})}getInvalidActionThatWouldHaveBeenApplied(e,t){if(t.allActions.length&&(e.autoApply==="first"&&t.validActions.length===0||e.autoApply==="ifSingle"&&t.allActions.length===1))return t.allActions.find(({action: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){return q0(this,void 0,void 0,function*(){const s=this._editor.createDecorationsCollection(),o=this._editor.getDomNode();if(!o)return;const r=i.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!r.length)return;const a=V.isIPosition(t)?this.toCoords(t):t,l={onSelect:(c,d)=>q0(this,void 0,void 0,function*(){this._applyCodeAction(c,!0,!!d),this._actionWidgetService.hide(),s.clear()}),onHide:()=>{var c;(c=this._editor)===null||c===void 0||c.focus(),s.clear()},onHover:(c,d)=>q0(this,void 0,void 0,function*(){var u;if(yield c.resolve(d),!d.isCancellationRequested)return{canPreview:!!(!((u=c.action.edit)===null||u===void 0)&&u.edits.length)}}),onFocus:c=>{var d,u;if(c&&c.highlightRange&&c.action.diagnostics){const h=[{range:c.action.diagnostics[0],options:BC.DECORATION}];s.set(h);const f=c.action.diagnostics[0],g=(u=(d=this._editor.getModel())===null||d===void 0?void 0:d.getWordAtPosition({lineNumber:f.startLineNumber,column:f.startColumn}))===null||u===void 0?void 0:u.word;tv(m("editingNewSelection","Context: {0} at line {1} and column {2}.",g,f.startLineNumber,f.startColumn))}else s.clear()}};this._actionWidgetService.show("codeActionWidget",!0,j4e(r,this._shouldShowHeaders(),this._resolver.getResolver()),l,a,o,this._getActionBarActions(e,t,i))})}toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,1),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),i=Rn(this._editor.getDomNode()),s=i.left+t.left,o=i.top+t.top+t.height;return{x:s,y:o}}_shouldShowHeaders(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:t==null?void 0:t.uri})}_getActionBarActions(e,t,i){if(i.fromLightbulb)return[];const s=e.documentation.map(o=>{var r;return{id:o.id,label:o.title,tooltip:(r=o.tooltip)!==null&&r!==void 0?r:"",class:void 0,enabled:!0,run:()=>{var a;return this._commandService.executeCommand(o.id,...(a=o.arguments)!==null&&a!==void 0?a:[])}}});return i.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&s.push(this._showDisabled?{id:"hideMoreActions",label:m("hideMoreActions","Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,i))}:{id:"showMoreActions",label:m("showMoreActions","Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,i))}),s}};$v.ID="editor.contrib.codeActionController";$v.DECORATION=et.register({description:"quickfix-highlight",className:sPe});$v=BC=nPe([Ll(1,pl),Ll(2,tt),Ll(3,yt),Ll(4,nt),Ll(5,ny),Ll(6,gs),Ll(7,ni),Ll(8,og),Ll(9,yt)],$v);Nr((n,e)=>{((s,o)=>{o&&e.addRule(`.monaco-editor ${s} { background-color: ${o}; }`)})(".quickfix-edit-highlight",n.getColor($a));const i=n.getColor(fd);i&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${ac(n.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`)});var BY=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Gx=function(n,e){return function(t,i){e(t,i,n)}};class $B{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let UR=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._dispoables=new pe,this._markers=[],this._nextIdx=-1,je.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const s=this._configService.getValue("problems.sortOrder"),o=(a,l)=>{let c=Wb(a.resource.toString(),l.resource.toString());return c===0&&(s==="position"?c=N.compareRangesUsingStarts(a,l)||ti.compare(a.severity,l.severity):c=ti.compare(a.severity,l.severity)||N.compareRangesUsingStarts(a,l)),c},r=()=>{this._markers=this._markerService.read({resource:je.isUri(e)?e:void 0,severities:ti.Error|ti.Warning|ti.Info}),typeof e=="function"&&(this._markers=this._markers.filter(a=>this._resourceFilter(a.resource))),this._markers.sort(o)};r(),this._dispoables.add(t.onMarkerChanged(a=>{(!this._resourceFilter||a.some(l=>this._resourceFilter(l)))&&(r(),this._nextIdx=-1,this._onDidChange.fire())}))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(e){return!this._resourceFilter&&!e?!0:!this._resourceFilter||!e?!1:this._resourceFilter(e)}get selected(){const e=this._markers[this._nextIdx];return e&&new $B(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let s=!1,o=this._markers.findIndex(r=>r.resource.toString()===e.uri.toString());o<0&&(o=Y$(this._markers,{resource:e.uri},(r,a)=>Wb(r.resource.toString(),a.resource.toString())),o<0&&(o=~o));for(let r=o;rs.resource.toString()===e.toString());if(!(i<0)){for(;i=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},xg=function(n,e){return function(t,i){e(t,i,n)}},GR;class rPe{constructor(e,t,i,s,o){this._openerService=s,this._labelService=o,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new pe,this._editor=t;const r=document.createElement("div");r.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),r.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),r.appendChild(this._relatedBlock),this._disposables.add(ji(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&i(l)})),this._scrollable=new aq(r,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{r.style.left=`-${a.scrollLeft}px`,r.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){Bt(this._disposables)}update(e){const{source:t,message:i,relatedInformation:s,code:o}=e;let r=((t==null?void 0:t.length)||0)+2;o&&(typeof o=="string"?r+=o.length:r+=o.value.length);const a=Vf(i);this._lines=a.length,this._longestLineLength=0;for(const h of a)this._longestLineLength=Math.max(h.length+r,this._longestLineLength);ko(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(const h of a)l=document.createElement("div"),l.innerText=h,h===""&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||o){const h=document.createElement("span");if(h.classList.add("details"),l.appendChild(h),t){const f=document.createElement("span");f.innerText=t,f.classList.add("source"),h.appendChild(f)}if(o)if(typeof o=="string"){const f=document.createElement("span");f.innerText=`(${o})`,f.classList.add("code"),h.appendChild(f)}else{this._codeLink=ye("a.code-link"),this._codeLink.setAttribute("href",`${o.target.toString()}`),this._codeLink.onclick=g=>{this._openerService.open(o.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()};const f=le(this._codeLink,ye("span"));f.innerText=o.value,h.appendChild(this._codeLink)}}if(ko(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),sc(s)){const h=this._relatedBlock.appendChild(document.createElement("div"));h.style.paddingTop=`${Math.floor(this._editor.getOption(66)*.66)}px`,this._lines+=1;for(const f of s){const g=document.createElement("div"),p=document.createElement("a");p.classList.add("filename"),p.innerText=`${this._labelService.getUriBasenameLabel(f.resource)}(${f.startLineNumber}, ${f.startColumn}): `,p.title=this._labelService.getUriLabel(f.resource),this._relatedDiagnostics.set(p,f);const _=document.createElement("span");_.innerText=f.message,g.appendChild(p),g.appendChild(_),this._lines+=1,h.appendChild(g)}}const c=this._editor.getOption(50),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 ti.Error:t=m("Error","Error");break;case ti.Warning:t=m("Warning","Warning");break;case ti.Info:t=m("Info","Info");break;case ti.Hint:t=m("Hint","Hint");break}let i=m("marker aria","{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const s=this._editor.getModel();return s&&e.startLineNumber<=s.getLineCount()&&e.startLineNumber>=1&&(i=`${s.getLineContent(e.startLineNumber)}, ${i}`),i}}let Hm=GR=class extends Vx{constructor(e,t,i,s,o,r,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},o),this._themeService=t,this._openerService=i,this._menuService=s,this._contextKeyService=r,this._labelService=a,this._callOnDispose=new pe,this._onDidSelectRelatedInformation=new B,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=ti.Warning,this._backgroundColor=H.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(dPe);let t=KR,i=aPe;this._severity===ti.Warning?(t=WC,i=lPe):this._severity===ti.Info&&(t=YR,i=cPe);const s=e.getColor(t),o=e.getColor(i);this.style({arrowColor:s,frameColor:s,headerBackgroundColor:o,primaryHeadingColor:e.getColor(hY),secondaryHeadingColor:e.getColor(fY)})}_applyStyles(){this._parentContainer&&(this._parentContainer.style.backgroundColor=this._backgroundColor?this._backgroundColor.toString():""),super._applyStyles()}dispose(){this._callOnDispose.dispose(),super.dispose()}_fillHead(e){super._fillHead(e),this._disposables.add(this._actionbarWidget.actionRunner.onWillRun(s=>this.editor.focus()));const t=[],i=this._menuService.createMenu(GR.TitleMenu,this._contextKeyService);BG(i,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),i.dispose()}_fillTitleIcon(e){this._icon=le(e,ye(""))}_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 rPe(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 s=N.lift(e),o=this.editor.getPosition(),r=o&&s.containsPosition(o)?o:s.getStartPosition();super.show(r,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const l=i>1?m("problems","{0} of {1} problems",t,i):m("change","{0} of {1} problem",t,i);this.setTitle(la(a.uri),l)}this._icon.className=`codicon ${qR.className(ti.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(r,0),this.editor.focus()}updateMarker(e){this._container.classList.remove("stale"),this._message.update(e)}showStale(){this._container.classList.add("stale"),this._relayout()}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._heightInPixel=e,this._message.layout(e,t),this._container.style.height=`${e}px`}_onWidth(e){this._message.layout(this._heightInPixel,e)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}};Hm.TitleMenu=new I("gotoErrorTitleMenu");Hm=GR=oPe([xg(1,co),xg(2,Dc),xg(3,Lu),xg(4,yt),xg(5,tt),xg(6,AD)],Hm);const UB=ov(za,Jbe),jB=ov(So,nv),qB=ov(Es,sv),KR=E("editorMarkerNavigationError.background",{dark:UB,light:UB,hcDark:Je,hcLight:Je},m("editorMarkerNavigationError","Editor marker navigation widget error color.")),aPe=E("editorMarkerNavigationError.headerBackground",{dark:we(KR,.1),light:we(KR,.1),hcDark:null,hcLight:null},m("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),WC=E("editorMarkerNavigationWarning.background",{dark:jB,light:jB,hcDark:Je,hcLight:Je},m("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),lPe=E("editorMarkerNavigationWarning.headerBackground",{dark:we(WC,.1),light:we(WC,.1),hcDark:"#0C141F",hcLight:we(WC,.2)},m("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),YR=E("editorMarkerNavigationInfo.background",{dark:qB,light:qB,hcDark:Je,hcLight:Je},m("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),cPe=E("editorMarkerNavigationInfo.headerBackground",{dark:we(YR,.1),light:we(YR,.1),hcDark:null,hcLight:null},m("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),dPe=E("editorMarkerNavigation.background",{dark:Yi,light:Yi,hcDark:Yi,hcLight:Yi},m("editorMarkerNavigationBackground","Editor marker navigation widget background."));var uPe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Zw=function(n,e){return function(t,i){e(t,i,n)}},VY=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},w_;let cu=w_=class{static get(e){return e.getContribution(w_.ID)}constructor(e,t,i,s,o){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=s,this._instantiationService=o,this._sessionDispoables=new pe,this._editor=e,this._widgetVisible=zY.bindTo(this._contextKeyService)}dispose(){this._cleanUp(),this._sessionDispoables.dispose()}_cleanUp(){this._widgetVisible.reset(),this._sessionDispoables.clear(),this._widget=void 0,this._model=void 0}_getOrCreateModel(e){if(this._model&&this._model.matches(e))return this._model;let t=!1;return this._model&&(t=!0,this._cleanUp()),this._model=this._markerNavigationService.getMarkerList(e),t&&this._model.move(!0,this._editor.getModel(),this._editor.getPosition()),this._widget=this._instantiationService.createInstance(Hm,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 s,o,r;(!(!((s=this._model)===null||s===void 0)&&s.selected)||!N.containsPosition((o=this._model)===null||o===void 0?void 0:o.selected.marker,i.position))&&((r=this._model)===null||r===void 0||r.resetIndex())})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const i=this._model.find(this._editor.getModel().uri,this._widget.position);i?this._widget.updateMarker(i.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(i=>{this._editorService.openCodeEditor({resource:i.resource,options:{pinned:!0,revealIfOpened:!0,selection:N.lift(i).collapseToStart()}},this._editor),this.close(!1)})),this._sessionDispoables.add(this._editor.onDidChangeModel(()=>this._cleanUp())),this._model}close(e=!0){this._cleanUp(),e&&this._editor.focus()}showAtMarker(e){if(this._editor.hasModel()){const t=this._getOrCreateModel(this._editor.getModel().uri);t.resetIndex(),t.move(!0,this._editor.getModel(),new V(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}nagivate(e,t){var i,s;return VY(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 r=yield this._editorService.openCodeEditor({resource:o.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:o.selected.marker}},this._editor);r&&((i=w_.get(r))===null||i===void 0||i.close(),(s=w_.get(r))===null||s===void 0||s.nagivate(e,t))}else this._widget.showAtMarker(o.selected.marker,o.selected.index,o.selected.total)}})}};cu.ID="editor.contrib.markerController";cu=w_=uPe([Zw(1,WY),Zw(2,tt),Zw(3,qt),Zw(4,yt)],cu);class lk extends Jt{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}run(e,t){var i;return VY(this,void 0,void 0,function*(){t.hasModel()&&((i=cu.get(t))===null||i===void 0||i.nagivate(this._next,this._multiFile))})}}class Wd extends lk{constructor(){super(!0,!1,{id:Wd.ID,label:Wd.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:$.focus,primary:578,weight:100},menuOpts:{menuId:Hm.TitleMenu,title:Wd.LABEL,icon:Xi("marker-navigation-next",se.arrowDown,m("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}}Wd.ID="editor.action.marker.next";Wd.LABEL=m("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");class of extends lk{constructor(){super(!1,!1,{id:of.ID,label:of.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:$.focus,primary:1602,weight:100},menuOpts:{menuId:Hm.TitleMenu,title:of.LABEL,icon:Xi("marker-navigation-previous",se.arrowUp,m("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}}of.ID="editor.action.marker.prev";of.LABEL=m("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");class hPe extends lk{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:m("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:$.focus,primary:66,weight:100},menuOpts:{menuId:I.MenubarGoMenu,title:m({key:"miGotoNextProblem",comment:["&& denotes a mnemonic"]},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class fPe extends lk{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:m("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:$.focus,primary:1090,weight:100},menuOpts:{menuId:I.MenubarGoMenu,title:m({key:"miGotoPreviousProblem",comment:["&& denotes a mnemonic"]},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}Tr(cu.ID,cu,4);Xe(Wd);Xe(of);Xe(hPe);Xe(fPe);const zY=new _e("markersNavigationVisible",!1),gPe=Er.bindToContribution(cu.get);Ee(new gPe({id:"closeMarkersNavigation",precondition:zY,handler:n=>n.close(),kbOpts:{weight:150,kbExpr:$.focus,primary:9,secondary:[1033]}}));var pPe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},kE=function(n,e){return function(t,i){e(t,i,n)}};const nr=ye;class mPe{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 GB={type:1,filter:{include:We.QuickFix},triggerAction:lu.QuickFixHover};let ZR=class{constructor(e,t,i,s){this._editor=e,this._markerDecorationsService=t,this._openerService=i,this._languageFeaturesService=s,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1&&!e.supportsMarkerHover)return[];const i=this._editor.getModel(),s=e.range.startLineNumber,o=i.getLineMaxColumn(s),r=[];for(const a of t){const l=a.range.startLineNumber===s?a.range.startColumn:1,c=a.range.endLineNumber===s?a.range.endColumn:o,d=this._markerDecorationsService.getMarker(i.uri,a);if(!d)continue;const u=new N(e.range.startLineNumber,l,e.range.startLineNumber,c);r.push(new mPe(this,u,d))}return r}renderHoverParts(e,t){if(!t.length)return Y.None;const i=new pe;t.forEach(o=>e.fragment.appendChild(this.renderMarkerHover(o,i)));const s=t.length===1?t[0]:t.sort((o,r)=>ti.compare(o.marker.severity,r.marker.severity))[0];return this.renderMarkerStatusbar(e,s,i),i}renderMarkerHover(e,t){const i=nr("div.hover-row"),s=le(i,nr("div.marker.hover-contents")),{source:o,message:r,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(s);const c=le(s,nr("span"));if(c.style.whiteSpace="pre-wrap",c.innerText=r,o||a)if(a&&typeof a!="string"){const d=nr("span");if(o){const g=le(d,nr("span"));g.innerText=o}const u=le(d,nr("a.code-link"));u.setAttribute("href",a.target.toString()),t.add(K(u,"click",g=>{this._openerService.open(a.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()}));const h=le(u,nr("span"));h.innerText=a.value;const f=le(s,d);f.style.opacity="0.6",f.style.paddingLeft="6px"}else{const d=le(s,nr("span"));d.style.opacity="0.6",d.style.paddingLeft="6px",d.innerText=o&&a?`${o}(${a})`:o||`(${a})`}if(sc(l))for(const{message:d,resource:u,startLineNumber:h,startColumn:f}of l){const g=le(s,nr("div"));g.style.marginTop="8px";const p=le(g,nr("a"));p.innerText=`${la(u)}(${h}, ${f}): `,p.style.cursor="pointer",t.add(K(p,"click",v=>{v.stopPropagation(),v.preventDefault(),this._openerService&&this._openerService.open(u,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:h,startColumn:f}}}).catch(_t)}));const _=le(g,nr("span"));_.innerText=d,this._editor.applyFontInfo(_)}return i}renderMarkerStatusbar(e,t,i){if((t.marker.severity===ti.Error||t.marker.severity===ti.Warning||t.marker.severity===ti.Info)&&e.statusBar.addAction({label:m("view problem","View Problem"),commandId:Wd.ID,run:()=>{var s;e.hide(),(s=cu.get(this._editor))===null||s===void 0||s.showAtMarker(t.marker),this._editor.focus()}}),!this._editor.getOption(90)){const s=e.statusBar.append(nr("div"));this.recentMarkerCodeActionsInfo&&(Cx.makeKey(this.recentMarkerCodeActionsInfo.marker)===Cx.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(s.textContent=m("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const o=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?Y.None:i.add(MS(()=>s.textContent=m("checkingForQuickFixes","Checking for quick fixes..."),200));s.textContent||(s.textContent=" ");const r=this.getCodeActions(t.marker);i.add(Ze(()=>r.cancel())),r.then(a=>{if(o.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),s.textContent=m("noQuickFixes","No quick fixes available");return}s.style.display="none";let l=!1;i.add(Ze(()=>{l||a.dispose()})),e.statusBar.addAction({label:m("quick fixes","Quick Fix..."),commandId:AY,run:c=>{l=!0;const d=$v.get(this._editor),u=Rn(c);e.hide(),d==null||d.showCodeActions(GB,a,{x:u.left,y:u.top,width:u.width,height:u.height})}})},_t)}}getCodeActions(e){return xc(t=>eb(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new N(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),GB,kp.None,t))}};ZR=pPe([kE(1,hP),kE(2,Dc),kE(3,nt)],ZR);const _Pe="editor.action.inlineSuggest.showPrevious",bPe="editor.action.inlineSuggest.showNext";var vPe=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class yPe extends Y{constructor(e,t,i={orientation:0}){super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new oge),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new pe),this.options=i,this.lookupKeybindings=typeof this.options.getKeyBinding=="function",this.toggleMenuAction=this._register(new Uv(()=>{var s;return(s=this.toggleMenuActionViewItem)===null||s===void 0?void 0:s.show()},i.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new al(this.element,{orientation:i.orientation,ariaLabel:i.ariaLabel,actionRunner:i.actionRunner,allowContextMenu:i.allowContextMenu,highlightToggledItems:i.highlightToggledItems,actionViewItemProvider:(s,o)=>{var r;if(s.id===Uv.ID)return this.toggleMenuActionViewItem=new mx(s,s.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:Te.asClassNameArray((r=i.moreIcon)!==null&&r!==void 0?r:se.toolBarMore),anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry}),this.toggleMenuActionViewItem.setActionContext(this.actionBar.context),this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)),this.toggleMenuActionViewItem;if(i.actionViewItemProvider){const a=i.actionViewItemProvider(s,o);if(a)return a}if(s instanceof qL){const a=new mx(s,s.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:s.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry});return a.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(a),this.disposables.add(this._onDidChangeDropdownVisibility.add(a.onDidChangeVisibility)),a}}}))}set actionRunner(e){this.actionBar.actionRunner=e}get actionRunner(){return this.actionBar.actionRunner}getElement(){return this.element}getItemAction(e){return this.actionBar.getAction(e)}setActions(e,t){this.clear();const i=e?e.slice(0):[];this.hasSecondaryActions=!!(t&&t.length>0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),i.push(this.toggleMenuAction)),i.forEach(s=>{this.actionBar.push(s,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(s)})})}getKeybindingLabel(e){var t,i,s;const o=this.lookupKeybindings?(i=(t=this.options).getKeyBinding)===null||i===void 0?void 0:i.call(t,e):void 0;return(s=o==null?void 0:o.getLabel())!==null&&s!==void 0?s:void 0}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}class Uv extends Do{constructor(e,t){t=t||m("moreActions","More Actions..."),super(Uv.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}run(){return vPe(this,void 0,void 0,function*(){this.toggleDropdownMenu()})}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}}Uv.ID="toolbar.toggle.more";var wPe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},G0=function(n,e){return function(t,i){e(t,i,n)}};let XR=class extends yPe{constructor(e,t,i,s,o,r,a){super(e,o,Object.assign(Object.assign({getKeyBinding:c=>{var d;return(d=r.lookupKeybinding(c.id))!==null&&d!==void 0?d:void 0}},t),{allowContextMenu:!0,skipTelemetry:typeof(t==null?void 0:t.telemetrySource)=="string"})),this._options=t,this._menuService=i,this._contextKeyService=s,this._contextMenuService=o,this._sessionDisposables=this._store.add(new pe);const l=t==null?void 0:t.telemetrySource;l&&this._store.add(this.actionBar.onDidRun(c=>a.publicLog2("workbenchActionExecuted",{id:c.action.id,from:l})))}setActions(e,t=[],i){var s,o,r;this._sessionDisposables.clear();const a=e.slice(),l=t.slice(),c=[];let d=0;const u=[];let h=!1;if(((s=this._options)===null||s===void 0?void 0:s.hiddenItemStrategy)!==-1)for(let f=0;f_==null?void 0:_.id)),g=this._options.overflowBehavior.maxItems-f.size;let p=0;for(let _=0;_=g&&(a[_]=void 0,u[_]=v))}}TF(a),TF(u),super.setActions(a,Pn.join(u,l)),c.length>0&&this._sessionDisposables.add(K(this.getElement(),"contextmenu",f=>{var g,p,_,v,b;const y=new ur(f),w=this.getItemAction(y.target);if(!w)return;y.preventDefault(),y.stopPropagation();let C=!1;if(d===1&&((g=this._options)===null||g===void 0?void 0:g.hiddenItemStrategy)===0){C=!0;for(let D=0;Dthis._menuService.resetHiddenStates(i)}))),this._contextMenuService.showContextMenu({getAnchor:()=>y,getActions:()=>x,menuId:(_=this._options)===null||_===void 0?void 0:_.contextMenu,menuActionOptions:Object.assign({renderShortTitle:!0},(v=this._options)===null||v===void 0?void 0:v.menuOptions),skipTelemetry:typeof((b=this._options)===null||b===void 0?void 0:b.telemetrySource)=="string",contextKeyService:this._contextKeyService})}))}};XR=wPe([G0(2,Lu),G0(3,tt),G0(4,Tu),G0(5,vi),G0(6,Cc)],XR);var Z3=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Jr=function(n,e){return function(t,i){e(t,i,n)}},VC;let KB=class extends Y{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=Is(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).showToolbar==="always"),this.sessionPosition=void 0,this.position=bt(this,s=>{var o,r,a;const l=(o=this.model.read(s))===null||o===void 0?void 0:o.ghostText.read(s);if(!this.alwaysShowToolbar.read(s)||!l||l.parts.length===0)return this.sessionPosition=void 0,null;const c=l.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==l.lineNumber&&(this.sessionPosition=void 0);const d=new V(l.lineNumber,Math.min(c,(a=(r=this.sessionPosition)===null||r===void 0?void 0:r.column)!==null&&a!==void 0?a:Number.MAX_SAFE_INTEGER));return this.sessionPosition=d,d}),this._register(js((s,o)=>{const r=this.model.read(s);if(!r||!this.alwaysShowToolbar.read(s))return;const a=o.add(this.instantiationService.createInstance($m,this.editor,!0,this.position,r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.selectedInlineCompletion.map(l=>{var c;return(c=l==null?void 0:l.inlineCompletion.source.inlineCompletions.commands)!==null&&c!==void 0?c:[]})));e.addContentWidget(a),o.add(Ze(()=>e.removeContentWidget(a))),o.add(ui(l=>{this.position.read(l)&&r.lastTriggerKind.read(l)!==uI.Explicit&&r.triggerExplicitly()}))}))}};KB=Z3([Jr(2,yt)],KB);const CPe=Xi("inline-suggestion-hints-next",se.chevronRight,m("parameterHintsNextIcon","Icon for show next parameter hint.")),SPe=Xi("inline-suggestion-hints-previous",se.chevronLeft,m("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let $m=VC=class extends Y{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){const s=new Do(e,t,i,!0,()=>this._commandService.executeCommand(e)),o=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let r=t;return o&&(r=m({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",t,o.getLabel())),s.tooltip=r,s}constructor(e,t,i,s,o,r,a,l,c,d,u){super(),this.editor=e,this.withBorder=t,this._position=i,this._currentSuggestionIdx=s,this._suggestionCount=o,this._extraCommands=r,this._commandService=a,this.keybindingService=c,this._contextKeyService=d,this._menuService=u,this.id=`InlineSuggestionHintsContentWidget${VC.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=hn("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[hn("div@toolBar")]),this.previousAction=this.createCommandAction(_Pe,m("previous","Previous"),Te.asClassName(SPe)),this.availableSuggestionCountAction=new Do("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(bPe,m("next","Next"),Te.asClassName(CPe)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(I.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new Di(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new Di(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.lastCommands=[],this.toolBar=this._register(l.createInstance(QR,this.nodes.toolBar,I.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:h=>h.startsWith("primary")},actionViewItemProvider:(h,f)=>{if(h instanceof il)return l.createInstance(LPe,h,void 0);if(h===this.availableSuggestionCountAction){const g=new xPe(void 0,h,{label:!0,icon:!1});return g.setClass("availableSuggestionCount"),g}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(h=>{VC._dropDownVisible=h})),this._register(ui(h=>{this._position.read(h),this.editor.layoutContentWidget(this)})),this._register(ui(h=>{const f=this._suggestionCount.read(h),g=this._currentSuggestionIdx.read(h);f!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${g+1}/${f}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),f!==void 0&&f>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(ui(h=>{const f=this._extraCommands.read(h);if(Zi(this.lastCommands,f))return;this.lastCommands=f;const g=f.map(p=>({class:void 0,id:p.id,enabled:!0,tooltip:p.tooltip||"",label:p.title,run:_=>this._commandService.executeCommand(p.id)}));for(const[p,_]of this.inlineCompletionsActionsMenus.getActions())for(const v of _)v instanceof il&&g.push(v);g.length>0&&g.unshift(new Pn),this.toolBar.setAdditionalSecondaryActions(g)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};$m._dropDownVisible=!1;$m.id=0;$m=VC=Z3([Jr(6,gs),Jr(7,yt),Jr(8,vi),Jr(9,tt),Jr(10,Lu)],$m);class xPe extends ND{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}}class LPe extends Pm{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=hn("div.keybinding").root;new cy(t,wo,Object.assign({disableTitle:!0},Q2e)).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}}let QR=class extends XR{constructor(e,t,i,s,o,r,a,l){super(e,Object.assign({resetMenu:t},i),s,o,r,a,l),this.menuId=t,this.options2=i,this.menuService=s,this.contextKeyService=o,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){var e,t,i,s,o,r,a;const l=[],c=[];BG(this.menu,(e=this.options2)===null||e===void 0?void 0:e.menuOptions,{primary:l,secondary:c},(i=(t=this.options2)===null||t===void 0?void 0:t.toolbarOptions)===null||i===void 0?void 0:i.primaryGroup,(o=(s=this.options2)===null||s===void 0?void 0:s.toolbarOptions)===null||o===void 0?void 0:o.shouldInlineSubmenu,(a=(r=this.options2)===null||r===void 0?void 0:r.toolbarOptions)===null||a===void 0?void 0:a.useSeparatorsInPrimaryActions),c.push(...this.additionalActions),l.unshift(...this.prependedPrimaryActions),this.setActions(l,c)}setPrependedPrimaryActions(e){Zi(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){Zi(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};QR=Z3([Jr(3,Lu),Jr(4,tt),Jr(5,Tu),Jr(6,vi),Jr(7,Cc)],QR);var DPe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Xw=function(n,e){return function(t,i){e(t,i,n)}},JR;const kPe=!1;let so=JR=class extends Y{static get(e){return e.getContribution(JR.ID)}constructor(e,t,i,s,o){super(),this._editor=e,this._instantiationService=t,this._openerService=i,this._languageService=s,this._keybindingService=o,this._toUnhook=new pe,this._hoverActivatedByColorDecoratorClick=!1,this._isMouseDown=!1,this._hoverClicked=!1,this._contentWidget=null,this._glyphWidget=null,this._reactToEditorMouseMoveRunner=this._register(new Di(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookEvents(),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(60)&&(this._unhookEvents(),this._hookEvents())})),this._register(this._editor.onMouseLeave(()=>{this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}))}_hookEvents(){const e=()=>this._hideWidgets(),t=this._editor.getOption(60);this._isHoverEnabled=t.enabled,this._isHoverSticky=t.sticky,this._hidingDelay=t.hidingDelay,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){var t;this._isMouseDown=!0;const i=e.target;if(i.type===9&&i.detail===Bd.ID){this._hoverClicked=!0;return}i.type===12&&i.detail===Mp.ID||(i.type!==12&&(this._hoverClicked=!1),!((t=this._contentWidget)===null||t===void 0)&&t.widget.isResizing||this._hideWidgets())}_onEditorMouseUp(e){this._isMouseDown=!1}_onEditorMouseLeave(e){var t,i;const s=e.event.browserEvent.relatedTarget;!((t=this._contentWidget)===null||t===void 0)&&t.widget.isResizing||!((i=this._contentWidget)===null||i===void 0)&&i.containsNode(s)||this._hideWidgets()}_isMouseOverWidget(e){var t,i,s,o,r;const a=e.target;return!!(this._isHoverSticky&&a.type===9&&a.detail===Bd.ID||this._isHoverSticky&&(!((t=this._contentWidget)===null||t===void 0)&&t.containsNode((i=e.event.browserEvent.view)===null||i===void 0?void 0:i.document.activeElement))&&!(!((o=(s=e.event.browserEvent.view)===null||s===void 0?void 0:s.getSelection())===null||o===void 0)&&o.isCollapsed)||!this._isHoverSticky&&a.type===9&&a.detail===Bd.ID&&(!((r=this._contentWidget)===null||r===void 0)&&r.isColorPickerVisible)||this._isHoverSticky&&a.type===12&&a.detail===Mp.ID)}_onEditorMouseMove(e){var t,i,s,o;if(this._mouseMoveEvent=e,!((t=this._contentWidget)===null||t===void 0)&&t.isFocused||!((i=this._contentWidget)===null||i===void 0)&&i.isResizing||this._isMouseDown&&this._hoverClicked||this._isHoverSticky&&(!((s=this._contentWidget)===null||s===void 0)&&s.isVisibleFromKeyboard))return;if(this._isMouseOverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}if(!((o=this._contentWidget)===null||o===void 0)&&o.isVisible&&this._isHoverSticky&&this._hidingDelay>0){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(this._hidingDelay);return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){var t,i,s;if(!e)return;const o=e.target,r=(t=o.element)===null||t===void 0?void 0:t.classList.contains("colorpicker-color-decoration"),a=this._editor.getOption(146);if(r&&(a==="click"&&!this._hoverActivatedByColorDecoratorClick||a==="hover"&&!this._isHoverEnabled&&!kPe||a==="clickAndHover"&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick)||!r&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick){this._hideWidgets();return}if(this._getOrCreateContentWidget().maybeShowAt(e)){(i=this._glyphWidget)===null||i===void 0||i.hide();return}if(o.type===2&&o.position){(s=this._contentWidget)===null||s===void 0||s.hide(),this._glyphWidget||(this._glyphWidget=new Mp(this._editor,this._languageService,this._openerService)),this._glyphWidget.startShowingAt(o.position.lineNumber);return}this._hideWidgets()}_onKeyDown(e){var t;if(!this._editor.hasModel())return;const i=this._keybindingService.softDispatch(e,this._editor.getDomNode()),s=i.kind===1||i.kind===2&&i.commandId==="editor.action.showHover"&&((t=this._contentWidget)===null||t===void 0?void 0:t.isVisible);e.keyCode!==5&&e.keyCode!==6&&e.keyCode!==57&&e.keyCode!==4&&!s&&this._hideWidgets()}_hideWidgets(){var e,t,i;this._isMouseDown&&this._hoverClicked&&(!((e=this._contentWidget)===null||e===void 0)&&e.isColorPickerVisible)||$m.dropDownVisible||(this._hoverActivatedByColorDecoratorClick=!1,this._hoverClicked=!1,(t=this._glyphWidget)===null||t===void 0||t.hide(),(i=this._contentWidget)===null||i===void 0||i.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(Hx,this._editor)),this._contentWidget}showContentHover(e,t,i,s,o=!1){this._hoverActivatedByColorDecoratorClick=o,this._getOrCreateContentWidget().startShowingAtRange(e,t,i,s)}focus(){var e;(e=this._contentWidget)===null||e===void 0||e.focus()}scrollUp(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollUp()}scrollDown(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollDown()}scrollLeft(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollLeft()}scrollRight(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollRight()}pageUp(){var e;(e=this._contentWidget)===null||e===void 0||e.pageUp()}pageDown(){var e;(e=this._contentWidget)===null||e===void 0||e.pageDown()}goToTop(){var e;(e=this._contentWidget)===null||e===void 0||e.goToTop()}goToBottom(){var e;(e=this._contentWidget)===null||e===void 0||e.goToBottom()}get isColorPickerVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isColorPickerVisible}get isHoverVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isVisible}dispose(){var e,t;super.dispose(),this._unhookEvents(),this._toUnhook.dispose(),(e=this._glyphWidget)===null||e===void 0||e.dispose(),(t=this._contentWidget)===null||t===void 0||t.dispose()}};so.ID="editor.contrib.hover";so=JR=DPe([Xw(1,yt),Xw(2,Dc),Xw(3,Ni),Xw(4,vi)],so);class EPe extends Jt{constructor(){super({id:"editor.action.showHover",label:m({key:"showOrFocusHover",comment:["Label for action that will trigger the showing/focusing of a hover in the editor.","If the hover is not visible, it will show the hover.","This allows for users to show the hover without using the mouse.","If the hover is already visible, it will take focus."]},"Show or Focus Hover"),description:{description:"Show or Focus Hover",args:[{name:"args",schema:{type:"object",properties:{focus:{description:"Controls if when triggered with the keyboard, the hover should take focus immediately.",type:"boolean",default:!1}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:$.editorTextFocus,primary:Bn(2089,2087),weight:100}})}run(e,t,i){if(!t.hasModel())return;const s=so.get(t);if(!s)return;const o=t.getPosition(),r=new N(o.lineNumber,o.column,o.lineNumber,o.column),a=t.getOption(2)===2||!!(i!=null&&i.focus);s.isHoverVisible?s.focus():s.showContentHover(r,1,1,a)}}class APe extends Jt{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:m({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=so.get(t);if(!i)return;const s=t.getPosition();if(!s)return;const o=new N(s.lineNumber,s.column,s.lineNumber,s.column),r=If.get(t);if(!r)return;r.startFindDefinitionFromCursor(s).then(()=>{i.showContentHover(o,1,1,!0)})}}class IPe extends Jt{constructor(){super({id:"editor.action.scrollUpHover",label:m({key:"scrollUpHover",comment:["Action that allows to scroll up in the hover widget with the up arrow when the hover widget is focused."]},"Scroll Up Hover"),alias:"Scroll Up Hover",precondition:$.hoverFocused,kbOpts:{kbExpr:$.hoverFocused,primary:16,weight:100}})}run(e,t){const i=so.get(t);i&&i.scrollUp()}}class TPe extends Jt{constructor(){super({id:"editor.action.scrollDownHover",label:m({key:"scrollDownHover",comment:["Action that allows to scroll down in the hover widget with the up arrow when the hover widget is focused."]},"Scroll Down Hover"),alias:"Scroll Down Hover",precondition:$.hoverFocused,kbOpts:{kbExpr:$.hoverFocused,primary:18,weight:100}})}run(e,t){const i=so.get(t);i&&i.scrollDown()}}class NPe extends Jt{constructor(){super({id:"editor.action.scrollLeftHover",label:m({key:"scrollLeftHover",comment:["Action that allows to scroll left in the hover widget with the left arrow when the hover widget is focused."]},"Scroll Left Hover"),alias:"Scroll Left Hover",precondition:$.hoverFocused,kbOpts:{kbExpr:$.hoverFocused,primary:15,weight:100}})}run(e,t){const i=so.get(t);i&&i.scrollLeft()}}class RPe extends Jt{constructor(){super({id:"editor.action.scrollRightHover",label:m({key:"scrollRightHover",comment:["Action that allows to scroll right in the hover widget with the right arrow when the hover widget is focused."]},"Scroll Right Hover"),alias:"Scroll Right Hover",precondition:$.hoverFocused,kbOpts:{kbExpr:$.hoverFocused,primary:17,weight:100}})}run(e,t){const i=so.get(t);i&&i.scrollRight()}}class MPe extends Jt{constructor(){super({id:"editor.action.pageUpHover",label:m({key:"pageUpHover",comment:["Action that allows to page up in the hover widget with the page up command when the hover widget is focused."]},"Page Up Hover"),alias:"Page Up Hover",precondition:$.hoverFocused,kbOpts:{kbExpr:$.hoverFocused,primary:11,secondary:[528],weight:100}})}run(e,t){const i=so.get(t);i&&i.pageUp()}}class PPe extends Jt{constructor(){super({id:"editor.action.pageDownHover",label:m({key:"pageDownHover",comment:["Action that allows to page down in the hover widget with the page down command when the hover widget is focused."]},"Page Down Hover"),alias:"Page Down Hover",precondition:$.hoverFocused,kbOpts:{kbExpr:$.hoverFocused,primary:12,secondary:[530],weight:100}})}run(e,t){const i=so.get(t);i&&i.pageDown()}}class OPe extends Jt{constructor(){super({id:"editor.action.goToTopHover",label:m({key:"goToTopHover",comment:["Action that allows to go to the top of the hover widget with the home command when the hover widget is focused."]},"Go To Top Hover"),alias:"Go To Bottom Hover",precondition:$.hoverFocused,kbOpts:{kbExpr:$.hoverFocused,primary:14,secondary:[2064],weight:100}})}run(e,t){const i=so.get(t);i&&i.goToTop()}}class FPe extends Jt{constructor(){super({id:"editor.action.goToBottomHover",label:m({key:"goToBottomHover",comment:["Action that allows to go to the bottom in the hover widget with the end command when the hover widget is focused."]},"Go To Bottom Hover"),alias:"Go To Bottom Hover",precondition:$.hoverFocused,kbOpts:{kbExpr:$.hoverFocused,primary:13,secondary:[2066],weight:100}})}run(e,t){const i=so.get(t);i&&i.goToBottom()}}Tr(so.ID,so,2);Xe(EPe);Xe(APe);Xe(IPe);Xe(TPe);Xe(NPe);Xe(RPe);Xe(MPe);Xe(PPe);Xe(OPe);Xe(FPe);K3.register(BR);K3.register(ZR);Nr((n,e)=>{const t=n.getColor(gve);t&&(e.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${t.transparent(.5)}; }`))});function BPe(n){return new Worker(""+new URL("json.worker-B_4HR3xd.js",import.meta.url).href,{name:n==null?void 0:n.name})}self.MonacoEnvironment={getWorker(n,e){if(e==="json")return new BPe;throw new Error("Unsupported language: "+e)}};class WPe extends rp{constructor(){super();zi(this,"_editor");zi(this,"_initialValue")}set value(t){this._editor?this._editor.setValue(t):this._initialValue=t}get value(){var t;return((t=this._editor)==null?void 0:t.getValue())??this._initialValue}createRenderRoot(){return this}disconnectedCallback(){var t,i,s;(t=this._editor)==null||t.dispose(),(s=(i=this._editor)==null?void 0:i.getModel())==null||s.dispose()}render(){return $i}firstUpdated(){this._editor=HK.create(this,{value:this._initialValue,language:"json",minimap:{enabled:!1},fontFamily:"'Source Code Pro', monospace",fontSize:12}),this._editor.getModel().onDidChangeContent(()=>{this.dispatchEvent(new CustomEvent("change",{detail:{}}))}),new ResizeObserver(i=>{this._editor.layout()}).observe(this)}}customElements.define("code-editor",WPe);/** +2: False`)},findInSelection:{type:"boolean"}}}}]};class wMe extends Qt{constructor(){super({id:Mt.StartFindWithArgs,label:m("startFindWithArgsAction","Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:100},description:yMe})}run(e,t,i){return Tf(this,void 0,void 0,function*(){const s=us.get(t);if(s){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 s.start({forceRevealReplace:!1,seedSearchStringFromSelection:s.getState().searchString.length===0&&t.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:1,shouldAnimate:!0,updateSearchScope:(i==null?void 0:i.findInSelection)||!1,loop:t.getOption(41).loop},o),s.setGlobalBufferTerm(s.getState().searchString)}})}}class CMe extends Qt{constructor(){super({id:Mt.StartFindWithSelection,label:m("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 Tf(this,void 0,void 0,function*(){const i=us.get(t);i&&(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),i.setGlobalBufferTerm(i.getState().searchString))})}}class aY extends Qt{run(e,t){return Tf(this,void 0,void 0,function*(){const i=us.get(t);i&&!this._run(i)&&(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:i.getState().searchString.length===0&&t.getOption(41).seedSearchStringFromSelection!=="never"?"single":"none",seedSearchStringFromNonEmptySelection:t.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:!0,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),this._run(i))})}}class SMe extends aY{constructor(){super({id:Mt.NextMatchFindAction,label:m("findNextMatchAction","Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:$.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:Le.and($.focus,jD),primary:3,weight:100}]})}_run(e){return e.moveToNextMatch()?(e.editor.pushUndoStop(),!0):!1}}class xMe extends aY{constructor(){super({id:Mt.PreviousMatchFindAction,label:m("findPreviousMatchAction","Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:$.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:Le.and($.focus,jD),primary:1027,weight:100}]})}_run(e){return e.moveToPrevMatch()}}class LMe extends Qt{constructor(){super({id:Mt.GoToMatchFindAction,label:m("findMatchAction.goToMatch","Go to Match..."),alias:"Go to Match...",precondition:Ac}),this._highlightDecorations=[]}run(e,t,i){const s=us.get(t);if(!s)return;const o=s.getState().matchesCount;if(o<1){e.get(xn).notify({severity:Yq.Warning,message:m("findMatchAction.noResults","No matches. Try searching for something else.")});return}const a=e.get(wP).createInputBox();a.placeholder=m("findMatchAction.inputPlaceHolder","Type a number to go to a specific match (between 1 and {0})",o);const l=d=>{const u=parseInt(d);if(isNaN(u))return;const h=s.getState().matchesCount;if(u>0&&u<=h)return u-1;if(u<0&&u>=-h)return h+u},c=d=>{const u=l(d);if(typeof u=="number"){a.validationMessage=void 0,s.goToMatch(u);const h=s.getState().currentMatch;h&&this.addDecorations(t,h)}else a.validationMessage=m("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",s.getState().matchesCount),this.clearDecorations(t)};a.onDidChangeValue(d=>{c(d)}),a.onDidAccept(()=>{const d=l(a.value);typeof d=="number"?(s.goToMatch(d),a.hide()):a.validationMessage=m("findMatchAction.inputValidationMessage","Please type a number between 1 and {0}",s.getState().matchesCount)}),a.onDidHide(()=>{this.clearDecorations(t),a.dispose()}),a.show()}clearDecorations(e){e.changeDecorations(t=>{this._highlightDecorations=t.deltaDecorations(this._highlightDecorations,[])})}addDecorations(e,t){e.changeDecorations(i=>{this._highlightDecorations=i.deltaDecorations(this._highlightDecorations,[{range:t,options:{description:"find-match-quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"find-match-quick-access-range-highlight-overview",overviewRuler:{color:sn(Dye),position:qo.Full}}}])})}}class lY extends Qt{run(e,t){return Tf(this,void 0,void 0,function*(){const i=us.get(t);if(!i)return;const s=xR(t,"single",!1);s&&i.setSearchString(s),this._run(i)||(yield i.start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),this._run(i))})}}class DMe extends lY{constructor(){super({id:Mt.NextSelectionMatchFindAction,label:m("nextSelectionMatchFindAction","Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:$.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}class kMe extends lY{constructor(){super({id:Mt.PreviousSelectionMatchFindAction,label:m("previousSelectionMatchFindAction","Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:$.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}}const EMe=aj(new rj({id:Mt.StartFindReplaceAction,label:m("startReplace","Replace"),alias:"Replace",precondition:Le.or($.focus,Le.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:I.MenubarEditMenu,group:"3_find",title:m({key:"miReplace",comment:["&& denotes a mnemonic"]},"&&Replace"),order:2}}));EMe.addImplementation(0,(n,e,t)=>{if(!e.hasModel()||e.getOption(90))return!1;const i=us.get(e);if(!i)return!1;const s=e.getSelection(),o=i.isFindInputFocused(),r=!s.isEmpty()&&s.startLineNumber===s.endLineNumber&&e.getOption(41).seedSearchStringFromSelection!=="never"&&!o,a=o||r?2:1;return i.start({forceRevealReplace:!0,seedSearchStringFromSelection:r?"single":"none",seedSearchStringFromNonEmptySelection:e.getOption(41).seedSearchStringFromSelection==="selection",seedSearchStringFromGlobalClipboard:e.getOption(41).seedSearchStringFromSelection!=="never",shouldFocus:a,shouldAnimate:!0,updateSearchScope:!1,loop:e.getOption(41).loop})});Ir(us.ID,LR,0);Ze(wMe);Ze(CMe);Ze(SMe);Ze(xMe);Ze(LMe);Ze(DMe);Ze(kMe);const fa=kr.bindToContribution(us.get);Ee(new fa({id:Mt.CloseFindWidgetCommand,precondition:Ac,handler:n=>n.closeFindWidget(),kbOpts:{weight:105,kbExpr:Le.and($.focus,Le.not("isComposing")),primary:9,secondary:[1033]}}));Ee(new fa({id:Mt.ToggleCaseSensitiveCommand,precondition:void 0,handler:n=>n.toggleCaseSensitive(),kbOpts:{weight:105,kbExpr:$.focus,primary:Dw.primary,mac:Dw.mac,win:Dw.win,linux:Dw.linux}}));Ee(new fa({id:Mt.ToggleWholeWordCommand,precondition:void 0,handler:n=>n.toggleWholeWords(),kbOpts:{weight:105,kbExpr:$.focus,primary:kw.primary,mac:kw.mac,win:kw.win,linux:kw.linux}}));Ee(new fa({id:Mt.ToggleRegexCommand,precondition:void 0,handler:n=>n.toggleRegex(),kbOpts:{weight:105,kbExpr:$.focus,primary:Ew.primary,mac:Ew.mac,win:Ew.win,linux:Ew.linux}}));Ee(new fa({id:Mt.ToggleSearchScopeCommand,precondition:void 0,handler:n=>n.toggleSearchScope(),kbOpts:{weight:105,kbExpr:$.focus,primary:Aw.primary,mac:Aw.mac,win:Aw.win,linux:Aw.linux}}));Ee(new fa({id:Mt.TogglePreserveCaseCommand,precondition:void 0,handler:n=>n.togglePreserveCase(),kbOpts:{weight:105,kbExpr:$.focus,primary:Iw.primary,mac:Iw.mac,win:Iw.win,linux:Iw.linux}}));Ee(new fa({id:Mt.ReplaceOneAction,precondition:Ac,handler:n=>n.replace(),kbOpts:{weight:105,kbExpr:$.focus,primary:3094}}));Ee(new fa({id:Mt.ReplaceOneAction,precondition:Ac,handler:n=>n.replace(),kbOpts:{weight:105,kbExpr:Le.and($.focus,VP),primary:3}}));Ee(new fa({id:Mt.ReplaceAllAction,precondition:Ac,handler:n=>n.replaceAll(),kbOpts:{weight:105,kbExpr:$.focus,primary:2563}}));Ee(new fa({id:Mt.ReplaceAllAction,precondition:Ac,handler:n=>n.replaceAll(),kbOpts:{weight:105,kbExpr:Le.and($.focus,VP),primary:void 0,mac:{primary:2051}}}));Ee(new fa({id:Mt.SelectAllMatchesAction,precondition:Ac,handler:n=>n.selectAllMatches(),kbOpts:{weight:105,kbExpr:$.focus,primary:515}}));const Rw=E("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hcDark:null,hcLight:null},m("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);E("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hcDark:null,hcLight:null},m("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);E("editor.wordHighlightTextBackground",{light:Rw,dark:Rw,hcDark:Rw,hcLight:Rw},m("wordHighlightText","Background color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0);const Mw=E("editor.wordHighlightBorder",{light:null,dark:null,hcDark:qt,hcLight:qt},m("wordHighlightBorder","Border color of a symbol during read-access, like reading a variable."));E("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:qt,hcLight:qt},m("wordHighlightStrongBorder","Border color of a symbol during write-access, like writing to a variable."));E("editor.wordHighlightTextBorder",{light:Mw,dark:Mw,hcDark:Mw,hcLight:Mw},m("wordHighlightTextBorder","Border color of a textual occurrence for a symbol."));const AMe=E("editorOverviewRuler.wordHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},m("overviewRulerWordHighlightForeground","Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),IMe=E("editorOverviewRuler.wordHighlightStrongForeground",{dark:"#C0A0C0CC",light:"#C0A0C0CC",hcDark:"#C0A0C0CC",hcLight:"#C0A0C0CC"},m("overviewRulerWordHighlightStrongForeground","Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),TMe=E("editorOverviewRuler.wordHighlightTextForeground",{dark:__,light:__,hcDark:__,hcLight:__},m("overviewRulerWordHighlightTextForeground","Overview ruler marker color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0);Je.register({description:"word-highlight-strong",stickiness:1,className:"wordHighlightStrong",overviewRuler:{color:sn(IMe),position:qo.Center},minimap:{color:sn(dD),position:Zs.Inline}});Je.register({description:"word-highlight-text",stickiness:1,className:"wordHighlightText",overviewRuler:{color:sn(TMe),position:qo.Center},minimap:{color:sn(dD),position:Zs.Inline}});const NMe=Je.register({description:"selection-highlight-overview",stickiness:1,className:"selectionHighlight",overviewRuler:{color:sn(__),position:qo.Center},minimap:{color:sn(dD),position:Zs.Inline}}),RMe=Je.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight"});Je.register({description:"word-highlight",stickiness:1,className:"wordHighlight",overviewRuler:{color:sn(AMe),position:qo.Center},minimap:{color:sn(dD),position:Zs.Inline}});function MMe(n){return n?RMe:NMe}Tr((n,e)=>{const t=n.getColor(g3);t&&e.addRule(`.monaco-editor .selectionHighlight { background-color: ${t.transparent(.5)}; }`)});var PMe=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},OMe=function(n,e){return function(t,i){e(t,i,n)}},DR;function Mu(n,e){const t=e.filter(i=>!n.find(s=>s.equals(i)));if(t.length>=1){const i=t.map(o=>`line ${o.viewState.position.lineNumber} column ${o.viewState.position.column}`).join(", "),s=t.length===1?m("cursorAdded","Cursor added: {0}",i):m("cursorsAdded","Cursors added: {0}",i);nv(s)}}class FMe extends Qt{constructor(){super({id:"editor.action.insertCursorAbove",label:m("mutlicursor.insertAbove","Add Cursor Above"),alias:"Add Cursor Above",precondition:void 0,kbOpts:{kbExpr:$.editorTextFocus,primary:2576,linux:{primary:1552,secondary:[3088]},weight:100},menuOpts:{menuId:I.MenubarSelectionMenu,group:"3_multi",title:m({key:"miInsertCursorAbove",comment:["&& denotes a mnemonic"]},"&&Add Cursor Above"),order:2}})}run(e,t,i){if(!t.hasModel())return;let s=!0;i&&i.logicalLine===!1&&(s=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const r=o.getCursorStates();o.setCursorStates(i.source,3,mn.addCursorUp(o,r,s)),o.revealTopMostCursor(i.source),Mu(r,o.getCursorStates())}}class BMe extends Qt{constructor(){super({id:"editor.action.insertCursorBelow",label:m("mutlicursor.insertBelow","Add Cursor Below"),alias:"Add Cursor Below",precondition:void 0,kbOpts:{kbExpr:$.editorTextFocus,primary:2578,linux:{primary:1554,secondary:[3090]},weight:100},menuOpts:{menuId:I.MenubarSelectionMenu,group:"3_multi",title:m({key:"miInsertCursorBelow",comment:["&& denotes a mnemonic"]},"A&&dd Cursor Below"),order:3}})}run(e,t,i){if(!t.hasModel())return;let s=!0;i&&i.logicalLine===!1&&(s=!1);const o=t._getViewModel();if(o.cursorConfig.readOnly)return;o.model.pushStackElement();const r=o.getCursorStates();o.setCursorStates(i.source,3,mn.addCursorDown(o,r,s)),o.revealBottomMostCursor(i.source),Mu(r,o.getCursorStates())}}class WMe extends Qt{constructor(){super({id:"editor.action.insertCursorAtEndOfEachLineSelected",label:m("mutlicursor.insertAtEndOfEachLineSelected","Add Cursors to Line Ends"),alias:"Add Cursors to Line Ends",precondition:void 0,kbOpts:{kbExpr:$.editorTextFocus,primary:1575,weight:100},menuOpts:{menuId:I.MenubarSelectionMenu,group:"3_multi",title:m({key:"miInsertCursorAtEndOfEachLineSelected",comment:["&& denotes a mnemonic"]},"Add C&&ursors to Line Ends"),order:4}})}getCursorsForSelection(e,t,i){if(!e.isEmpty()){for(let s=e.startLineNumber;s1&&i.push(new lt(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const i=t.getModel(),s=t.getSelections(),o=t._getViewModel(),r=o.getCursorStates(),a=[];s.forEach(l=>this.getCursorsForSelection(l,i,a)),a.length>0&&t.setSelections(a),Mu(r,o.getCursorStates())}}class VMe extends Qt{constructor(){super({id:"editor.action.addCursorsToBottom",label:m("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(),s=t.getModel().getLineCount(),o=[];for(let l=i[0].startLineNumber;l<=s;l++)o.push(new lt(l,i[0].startColumn,l,i[0].endColumn));const r=t._getViewModel(),a=r.getCursorStates();o.length>0&&t.setSelections(o),Mu(a,r.getCursorStates())}}class zMe extends Qt{constructor(){super({id:"editor.action.addCursorsToTop",label:m("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(),s=[];for(let a=i[0].startLineNumber;a>=1;a--)s.push(new lt(a,i[0].startColumn,a,i[0].endColumn));const o=t._getViewModel(),r=o.getCursorStates();s.length>0&&t.setSelections(s),Mu(r,o.getCursorStates())}}class Pw{constructor(e,t,i){this.selections=e,this.revealRange=t,this.revealScrollType=i}}class Bv{static create(e,t){if(!e.hasModel())return null;const i=t.getState();if(!e.hasTextFocus()&&i.isRevealed&&i.searchString.length>0)return new Bv(e,t,!1,i.searchString,i.wholeWord,i.matchCase,null);let s=!1,o,r;const a=e.getSelections();a.length===1&&a[0].isEmpty()?(s=!0,o=!0,r=!0):(o=i.wholeWord,r=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 lt(l.startLineNumber,u.startColumn,l.startLineNumber,u.endColumn)}else c=e.getModel().getValueInRange(l).replace(/\r\n/g,` +`);return new Bv(e,t,s,c,o,r,d)}constructor(e,t,i,s,o,r,a){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=i,this.searchText=s,this.wholeWord=o,this.matchCase=r,this.currentMatch=a}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new Pw(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 Pw(t.slice(0,t.length-1).concat(e),e,0)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const s=this.currentMatch;return this.currentMatch=null,s}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findNextMatch(this.searchText,t.getEndPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1);return i?new lt(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 Pw(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 Pw(t.slice(0,t.length-1).concat(e),e,0)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const s=this.currentMatch;return this.currentMatch=null,s}this.findController.highlightFindOptions();const e=this._editor.getSelections(),t=e[e.length-1],i=this._editor.getModel().findPreviousMatch(this.searchText,t.getStartPosition(),!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1);return i?new lt(i.range.startLineNumber,i.range.startColumn,i.range.endLineNumber,i.range.endColumn):null}selectAll(e){if(!this._editor.hasModel())return[];this.findController.highlightFindOptions();const t=this._editor.getModel();return e?t.findMatches(this.searchText,e,!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1,1073741824):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1,1073741824)}}class Nf extends Y{static get(e){return e.getContribution(Nf.ID)}constructor(e){super(),this._sessionDispose=this._register(new pe),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=Bv.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(s=>{this._ignoreSelectionChange||this._endSession()})),this._sessionDispose.add(this._editor.onDidBlurEditorText(()=>{this._endSession()})),this._sessionDispose.add(e.getState().onFindReplaceStateChange(s=>{(s.matchCase||s.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 lt(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 s=e.getState().matchCase;if(!cY(this._editor.getModel(),t,s)){const r=this._editor.getModel(),a=[];for(let l=0,c=t.length;l0&&i.isRegex){const s=this._editor.getModel();i.searchScope?t=s.findMatches(i.searchString,i.searchScope,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(129):null,!1,1073741824):t=s.findMatches(i.searchString,!0,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(129):null,!1,1073741824)}else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll(i.searchScope)}if(t.length>0){const s=this._editor.getSelection();for(let o=0,r=t.length;onew lt(o.range.startLineNumber,o.range.startColumn,o.range.endLineNumber,o.range.endColumn)))}}}Nf.ID="editor.contrib.multiCursorController";class p0 extends Qt{run(e,t){const i=Nf.get(t);if(!i)return;const s=t._getViewModel();if(s){const o=s.getCursorStates(),r=us.get(t);if(r)this._run(i,r);else{const a=e.get(vt).createInstance(us,t);this._run(i,a),a.dispose()}Mu(o,s.getCursorStates())}}}class HMe extends p0{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:m("addSelectionToNextFindMatch","Add Selection To Next Find Match"),alias:"Add Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:$.focus,primary:2082,weight:100},menuOpts:{menuId:I.MenubarSelectionMenu,group:"3_multi",title:m({key:"miAddSelectionToNextFindMatch",comment:["&& denotes a mnemonic"]},"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}class $Me extends p0{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:m("addSelectionToPreviousFindMatch","Add Selection To Previous Find Match"),alias:"Add Selection To Previous Find Match",precondition:void 0,menuOpts:{menuId:I.MenubarSelectionMenu,group:"3_multi",title:m({key:"miAddSelectionToPreviousFindMatch",comment:["&& denotes a mnemonic"]},"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}class UMe extends p0{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:m("moveSelectionToNextFindMatch","Move Last Selection To Next Find Match"),alias:"Move Last Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:$.focus,primary:Pn(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}class jMe extends p0{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:m("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 qMe extends p0{constructor(){super({id:"editor.action.selectHighlights",label:m("selectAllOccurrencesOfFindMatch","Select All Occurrences of Find Match"),alias:"Select All Occurrences of Find Match",precondition:void 0,kbOpts:{kbExpr:$.focus,primary:3114,weight:100},menuOpts:{menuId:I.MenubarSelectionMenu,group:"3_multi",title:m({key:"miSelectHighlights",comment:["&& denotes a mnemonic"]},"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}class GMe extends p0{constructor(){super({id:"editor.action.changeAll",label:m("changeAll.label","Change All Occurrences"),alias:"Change All Occurrences",precondition:Le.and($.writable,$.editorTextFocus),kbOpts:{kbExpr:$.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}class KMe{constructor(e,t,i,s,o){this._model=e,this._searchText=t,this._matchCase=i,this._wordSeparators=s,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(N.compareRangesUsingStarts)),this._cachedFindMatches}}let Wv=DR=class extends Y{constructor(e,t){super(),this._languageFeaturesService=t,this.editor=e,this._isEnabled=e.getOption(107),this._decorations=e.createDecorationsCollection(),this.updateSoon=this._register(new Li(()=>this._update(),300)),this.state=null,this._register(e.onDidChangeConfiguration(s=>{this._isEnabled=e.getOption(107)})),this._register(e.onDidChangeCursorSelection(s=>{this._isEnabled&&(s.selection.isEmpty()?s.reason===3?(this.state&&this._setState(null),this.updateSoon.schedule()):this._setState(null):this._update())})),this._register(e.onDidChangeModel(s=>{this._setState(null)})),this._register(e.onDidChangeModelContent(s=>{this._isEnabled&&this.updateSoon.schedule()}));const i=us.get(e);i&&this._register(i.getState().onFindReplaceStateChange(s=>{this._update()})),this.updateSoon.schedule()}_update(){this._setState(DR._createState(this.state,this._isEnabled,this.editor))}static _createState(e,t,i){if(!t||!i.hasModel())return null;const s=i.getSelection();if(s.startLineNumber!==s.endLineNumber)return null;const o=Nf.get(i);if(!o)return null;const r=us.get(i);if(!r)return null;let a=o.getSession(r);if(!a){const d=i.getSelections();if(d.length>1){const h=r.getState().matchCase;if(!cY(i.getModel(),d,h))return null}a=Bv.create(i,r)}if(!a||a.currentMatch||/^[ \t]+$/.test(a.searchText)||a.searchText.length>200)return null;const l=r.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 KMe(i.getModel(),a.searchText,a.matchCase,a.wholeWord?i.getOption(129):null,e)}_setState(e){if(this.state=e,!this.state){this._decorations.clear();return}if(!this.editor.hasModel())return;const t=this.editor.getModel();if(t.isTooLargeForTokenization())return;const i=this.state.findMatches(),s=this.editor.getSelections();s.sort(N.compareRangesUsingStarts);const o=[];for(let l=0,c=0,d=i.length,u=s.length;l=u)o.push(h),l++;else{const f=N.compareRangesUsingStarts(h,s[c]);f<0?((s[c].isEmpty()||!N.areIntersecting(h,s[c]))&&o.push(h),l++):(f>0||l++,c++)}}const r=this._languageFeaturesService.documentHighlightProvider.has(t)&&this.editor.getOption(80),a=o.map(l=>({range:l,options:MMe(r)}));this._decorations.set(a)}dispose(){this._setState(null),super.dispose()}};Wv.ID="editor.contrib.selectionHighlighter";Wv=DR=PMe([OMe(1,it)],Wv);function cY(n,e,t){const i=CB(n,e[0],!t);for(let s=1,o=e.length;sthis._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(71),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(71)&&(this._matchBrackets=this._editor.getOption(71),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const s=i.getStartPosition(),o=e.bracketPairs.matchBracket(s);let r=null;if(o)o[0].containsPosition(s)&&!o[1].containsPosition(s)?r=o[1].getStartPosition():o[1].containsPosition(s)&&(r=o[0].getStartPosition());else{const a=e.bracketPairs.findEnclosingBrackets(s);if(a)r=a[1].getStartPosition();else{const l=e.bracketPairs.findNextBracket(s);l&&l.range&&(r=l.range.getStartPosition())}}return r?new lt(r.lineNumber,r.column,r.lineNumber,r.column):new lt(s.lineNumber,s.column,s.lineNumber,s.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(s=>{const o=s.getStartPosition();let r=t.bracketPairs.matchBracket(o);if(!r&&(r=t.bracketPairs.findEnclosingBrackets(o),!r)){const c=t.bracketPairs.findNextBracket(o);c&&c.range&&(r=t.bracketPairs.matchBracket(c.range.getStartPosition()))}let a=null,l=null;if(r){r.sort(N.compareRangesUsingStarts);const[c,d]=r;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 lt(a.lineNumber,a.column,l.lineNumber,l.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const s=i.getPosition();let o=t.bracketPairs.matchBracket(s);o||(o=t.bracketPairs.findEnclosingBrackets(s)),o&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:o[0],text:""},{range:o[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const s=i.brackets;s&&(e[t++]={range:s[0],options:i.options},e[t++]={range:s[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 s=[];this._lastVersionId===i&&(s=this._lastBracketsData);const o=[];let r=0;for(let u=0,h=e.length;u1&&o.sort(V.compare);const a=[];let l=0,c=0;const d=s.length;for(let u=0,h=o.length;us.target.position?s.target.position.lineNumber:0,this._opts=xB(this._editor.getOption(77)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration(s=>{if(s.hasChanged(77)){const o=xB(this._editor.getOption(77));if(this._opts.equals(o))return;this._opts=o,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}})),this._register(this._editor.onMouseMove(s=>this._onEditorMouseMove(new _E(s,this._opts)))),this._register(this._editor.onMouseDown(s=>this._onEditorMouseDown(new _E(s,this._opts)))),this._register(this._editor.onMouseUp(s=>this._onEditorMouseUp(new _E(s,this._opts)))),this._register(this._editor.onKeyDown(s=>this._onEditorKeyDown(new SB(s,this._opts)))),this._register(this._editor.onKeyUp(s=>this._onEditorKeyUp(new SB(s,this._opts)))),this._register(this._editor.onMouseDrag(()=>this._resetHandler())),this._register(this._editor.onDidChangeCursorSelection(s=>this._onDidChangeCursorSelection(s))),this._register(this._editor.onDidChangeModel(s=>this._resetHandler())),this._register(this._editor.onDidChangeModelContent(()=>this._resetHandler())),this._register(this._editor.onDidScrollChange(s=>{(s.scrollTopChanged||s.scrollLeftChanged)&&this._resetHandler()}))}_onDidChangeCursorSelection(e){e.selection&&e.selection.startColumn!==e.selection.endColumn&&this._resetHandler()}_onEditorMouseMove(e){this._lastMouseMoveEvent=e,this._onMouseMoveOrRelevantKeyDown.fire([e,null])}_onEditorMouseDown(e){this._hasTriggerKeyOnMouseDown=e.hasTriggerModifier,this._lineNumberOnMouseDown=this._extractLineNumberFromMouseEvent(e)}_onEditorMouseUp(e){const t=this._extractLineNumberFromMouseEvent(e);this._hasTriggerKeyOnMouseDown&&this._lineNumberOnMouseDown&&this._lineNumberOnMouseDown===t&&this._onExecute.fire(e)}_onEditorKeyDown(e){this._lastMouseMoveEvent&&(e.keyCodeIsTriggerKey||e.keyCodeIsSideBySideKey&&e.hasTriggerModifier)?this._onMouseMoveOrRelevantKeyDown.fire([this._lastMouseMoveEvent,e]):e.hasTriggerModifier&&this._onCancel.fire()}_onEditorKeyUp(e){e.keyCodeIsTriggerKey&&this._onCancel.fire()}_resetHandler(){this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._onCancel.fire()}}var n4e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},xl=function(n,e){return function(t,i){e(t,i,n)}};let $m=class extends Mm{constructor(e,t,i,s,o,r,a,l,c,d,u,h,f){super(e,Object.assign(Object.assign({},s.getRawOptions()),{overflowWidgetsDomNode:s.getOverflowWidgetsDomNode()}),i,o,r,a,l,c,d,u,h,f),this._parentEditor=s,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(s.onDidChangeConfiguration(g=>this._onParentConfigurationChanged(g)))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){PL(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};$m=n4e([xl(4,vt),xl(5,jt),xl(6,fs),xl(7,et),xl(8,ro),xl(9,xn),xl(10,Au),xl(11,so),xl(12,it)],$m);const LB=new H(new ht(0,122,204)),s4e={showArrow:!0,showFrame:!0,className:"",frameColor:LB,arrowColor:LB,keepEditorSelection:!1},o4e="vs.editor.contrib.zoneWidget";class r4e{constructor(e,t,i,s,o,r,a,l){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=s,this.showInHiddenAreas=a,this.ordinal=l,this._onDomNodeTop=o,this._onComputedHeight=r}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class a4e{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class KD{constructor(e){this._editor=e,this._ruleName=KD._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),l9(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(){l9(this._ruleName),rT(`.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:N.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}}KD._IdGenerator=new J3(".arrow-decoration-");class l4e{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new pe,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=Rl(t),PL(this.options,s4e,!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 s=this._getWidth(i);this.domNode.style.width=s+"px",this.domNode.style.left=this._getLeft(i)+"px",this._onWidth(s)}))}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 KD(this.editor),this._disposables.add(this._arrow)),this._fillContainer(this.container),this._initSash(),this._applyStyles()}style(e){e.frameColor&&(this.options.frameColor=e.frameColor),e.arrowColor&&(this.options.arrowColor=e.arrowColor),this._applyStyles()}_applyStyles(){if(this.container&&this.options.frameColor){const e=this.options.frameColor.toString();this.container.style.borderTopColor=e,this.container.style.borderBottomColor=e}if(this._arrow&&this.options.arrowColor){const e=this.options.arrowColor.toString();this._arrow.color=e}}_getWidth(e){return e.width-e.minimap.minimapWidth-e.verticalScrollbarWidth}_getLeft(e){return e.minimap.minimapWidth>0&&e.minimap.minimapLeft===0?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){var t;if(this.domNode.style.height=`${e}px`,this.container){const i=e-this._decoratingElementsHeight();this.container.style.height=`${i}px`;const s=this.editor.getLayoutInfo();this._doLayout(i,this._getWidth(s))}(t=this._resizeSash)===null||t===void 0||t.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(e)return e.getStartPosition()}show(e,t){const i=N.isIRange(e)?N.lift(e):N.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:Je.EMPTY}])}hide(){var e;this._viewZone&&(this.editor.changeViewZones(t=>{this._viewZone&&t.removeZone(this._viewZone.id)}),this._viewZone=null),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),(e=this._arrow)===null||e===void 0||e.hide(),this._positionMarkerId.clear()}_decoratingElementsHeight(){const e=this.editor.getOption(66);let t=0;if(this.options.showArrow){const i=Math.round(e/3);t+=2*i}if(this.options.showFrame){const i=Math.round(e/9);t+=2*i}return t}_showImpl(e,t){const i=e.getStartPosition(),s=this.editor.getLayoutInfo(),o=this._getWidth(s);this.domNode.style.width=`${o}px`,this.domNode.style.left=this._getLeft(s)+"px";const r=document.createElement("div");r.style.overflow="hidden";const a=this.editor.getOption(66);if(!this.options.allowUnlimitedHeight){const h=Math.max(12,this.editor.getLayoutInfo().height/a*.8);t=Math.min(t,h)}let l=0,c=0;if(this._arrow&&this.options.showArrow&&(l=Math.round(a/3),this._arrow.height=l,this._arrow.show(i)),this.options.showFrame&&(c=Math.round(a/9)),this.editor.changeViewZones(h=>{this._viewZone&&h.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new r4e(r,i.lineNumber,i.column,t,f=>this._onViewZoneTop(f),f=>this._onViewZoneHeight(f),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=h.addZone(this._viewZone),this._overlayWidget=new a4e(o4e+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)}),this.container&&this.options.showFrame){const h=this.options.frameWidth?this.options.frameWidth:c;this.container.style.borderTopWidth=h+"px",this.container.style.borderBottomWidth=h+"px"}const d=t*a-this._decoratingElementsHeight();this.container&&(this.container.style.top=l+"px",this.container.style.height=d+"px",this.container.style.overflow="hidden"),this._doLayout(d,o),this.options.keepEditorSelection||this.editor.setSelection(e);const u=this.editor.getModel();if(u){const h=u.validateRange(new N(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(h,h.startLineNumber===u.getLineCount())}}revealRange(e,t){t?this.editor.revealLineNearTop(e.endLineNumber,0):this.editor.revealRange(e,0)}setCssClass(e,t){this.container&&(t&&this.container.classList.remove(t),this.container.classList.add(e))}_onWidth(e){}_doLayout(e,t){}_relayout(e){this._viewZone&&this._viewZone.heightInLines!==e&&this.editor.changeViewZones(t=>{this._viewZone&&(this._viewZone.heightInLines=e,t.layoutZone(this._viewZone.id))})}_initSash(){if(this._resizeSash)return;this._resizeSash=this._disposables.add(new Dn(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.state=0);let e;this._disposables.add(this._resizeSash.onDidStart(t=>{this._viewZone&&(e={startY:t.startY,heightInLines:this._viewZone.heightInLines})})),this._disposables.add(this._resizeSash.onDidEnd(()=>{e=void 0})),this._disposables.add(this._resizeSash.onDidChange(t=>{if(e){const i=(t.currentY-e.startY)/this.editor.getOption(66),s=i<0?Math.ceil(i):Math.floor(i),o=e.heightInLines+s;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 dY=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},uY=function(n,e){return function(t,i){e(t,i,n)}};const hY=rt("IPeekViewService");ft(hY,class{constructor(){this._widgets=new Map}addExclusiveWidget(n,e){const t=this._widgets.get(n);t&&(t.listener.dispose(),t.widget.dispose());const i=()=>{const s=this._widgets.get(n);s&&s.widget===e&&(s.listener.dispose(),this._widgets.delete(n))};this._widgets.set(n,{widget:e,listener:e.onDidClose(i)})}},1);var eo;(function(n){n.inPeekEditor=new _e("inReferenceSearchEditor",!0,m("inReferenceSearchEditor","Whether the current code editor is embedded inside peek")),n.notInPeekEditor=n.inPeekEditor.toNegated()})(eo||(eo={}));let Vv=class{constructor(e,t){e instanceof $m&&eo.inPeekEditor.bindTo(t)}dispose(){}};Vv.ID="editor.contrib.referenceController";Vv=dY([uY(1,et)],Vv);Ir(Vv.ID,Vv,0);function c4e(n){const e=n.get(jt).getFocusedCodeEditor();return e instanceof $m?e.getParentEditor():e}const d4e={headerBackgroundColor:H.white,primaryHeadingColor:H.fromHex("#333333"),secondaryHeadingColor:H.fromHex("#6c6c6cb3")};let Rx=class extends l4e{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new B,this.onDidClose=this._onDidClose.event,PL(this.options,d4e,!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=ye(".head"),this._bodyElement=ye(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=ye(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),Ui(this._titleElement,"click",o=>this._onTitleClick(o))),le(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=ye("span.filename"),this._secondaryHeading=ye("span.dirname"),this._metaHeading=ye("span.meta"),le(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=ye(".peekview-actions");le(this._headElement,i);const s=this._getActionBarOptions();this._actionbarWidget=new al(i,s),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new So("peekview.close",m("label.close","Close"),Te.asClassName(se.close),!0,()=>(this.dispose(),Promise.resolve())),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:Gke.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:xo(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,Xh(this._metaHeading)):cd(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0){this.dispose();return}const i=Math.ceil(this.editor.getOption(66)*1.2),s=Math.round(e-(i+2));this._doLayoutHead(i,t),this._doLayoutBody(s,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`)}};Rx=dY([uY(2,vt)],Rx);const u4e=E("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:H.black,hcLight:H.white},m("peekViewTitleBackground","Background color of the peek view title area.")),fY=E("peekViewTitleLabel.foreground",{dark:H.white,light:H.black,hcDark:H.white,hcLight:Iu},m("peekViewTitleForeground","Color of the peek view title.")),gY=E("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},m("peekViewTitleInfoForeground","Color of the peek view title info.")),h4e=E("peekView.border",{dark:ks,light:ks,hcDark:Qe,hcLight:Qe},m("peekViewBorder","Color of the peek view borders and arrow.")),f4e=E("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:H.black,hcLight:H.white},m("peekViewResultsBackground","Background color of the peek view result list."));E("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:H.white,hcLight:Iu},m("peekViewResultsMatchForeground","Foreground color for line nodes in the peek view result list."));E("peekViewResult.fileForeground",{dark:H.white,light:"#1E1E1E",hcDark:H.white,hcLight:Iu},m("peekViewResultsFileForeground","Foreground color for file nodes in the peek view result list."));E("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},m("peekViewResultsSelectionBackground","Background color of the selected entry in the peek view result list."));E("peekViewResult.selectionForeground",{dark:H.white,light:"#6C6C6C",hcDark:H.white,hcLight:Iu},m("peekViewResultsSelectionForeground","Foreground color of the selected entry in the peek view result list."));const Sd=E("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:H.black,hcLight:H.white},m("peekViewEditorBackground","Background color of the peek view editor."));E("peekViewEditorGutter.background",{dark:Sd,light:Sd,hcDark:Sd,hcLight:Sd},m("peekViewEditorGutterBackground","Background color of the gutter in the peek view editor."));E("peekViewEditorStickyScroll.background",{dark:Sd,light:Sd,hcDark:Sd,hcLight:Sd},m("peekViewEditorStickScrollBackground","Background color of sticky scroll in the peek view editor."));E("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},m("peekViewResultsMatchHighlight","Match highlight color in the peek view result list."));E("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},m("peekViewEditorMatchHighlight","Match highlight color in the peek view editor."));E("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:qt,hcLight:qt},m("peekViewEditorMatchHighlightBorder","Match highlight border in the peek view editor."));var g4e=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class lu{constructor(e,t,i,s){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=s,this.id=hN.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?m({key:"aria.oneReference.preview",comment:["Placeholders are: 0: filename, 1:line number, 2: column number, 3: preview snippet of source code"]},"{0} in {1} on line {2} at column {3}",t.value,ra(this.uri),this.range.startLineNumber,this.range.startColumn):m("aria.oneReference","in {0} on line {1} at column {2}",ra(this.uri),this.range.startLineNumber,this.range.startColumn)}}class p4e{constructor(e){this._modelReference=e}dispose(){this._modelReference.dispose()}preview(e,t=8){const i=this._modelReference.object.textEditorModel;if(!i)return;const{startLineNumber:s,startColumn:o,endLineNumber:r,endColumn:a}=e,l=i.getWordUntilPosition({lineNumber:s,column:o-t}),c=new N(s,l.startColumn,s,o),d=new N(r,a,r,1073741824),u=i.getValueInRange(c).replace(/^\s+/,""),h=i.getValueInRange(e),f=i.getValueInRange(d).replace(/\s+$/,"");return{value:u+h+f,highlight:{start:u.length,end:u.length+h.length}}}}class zv{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new An}dispose(){Ft(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return e===1?m("aria.fileReferences.1","1 symbol in {0}, full path {1}",ra(this.uri),this.uri.fsPath):m("aria.fileReferences.N","{0} symbols in {1}, full path {2}",e,ra(this.uri),this.uri.fsPath)}resolve(e){return g4e(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 p4e(i))}catch(i){mt(i)}return this})}}class Xs{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new B,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;e.sort(Xs._compareReferences);let s;for(const o of e)if((!s||!Ht.isEqual(s.uri,o.uri,!0))&&(s=new zv(this,o.uri),this.groups.push(s)),s.children.length===0||Xs._compareReferences(o,s.children[s.children.length-1])!==0){const r=new lu(i===o,s,o,a=>this._onDidChangeReferenceRange.fire(a));this.references.push(r),s.children.push(r)}}dispose(){Ft(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new Xs(this._links,this._title)}get title(){return this._title}get isEmpty(){return this.groups.length===0}get ariaMessage(){return this.isEmpty?m("aria.result.0","No results found"):this.references.length===1?m("aria.result.1","Found 1 symbol in {0}",this.references[0].uri.fsPath):this.groups.length===1?m("aria.result.n1","Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):m("aria.result.nm","Found {0} symbols in {1} files",this.references.length,this.groups.length)}nextOrPreviousReference(e,t){const{parent:i}=e;let s=i.children.indexOf(e);const o=i.children.length,r=i.parent.groups.length;return r===1||t&&s+10?(t?s=(s+1)%o:s=(s+o-1)%o,i.children[s]):(s=i.parent.groups.indexOf(i),t?(s=(s+1)%r,i.parent.groups[s].children[0]):(s=(s+r-1)%r,i.parent.groups[s].children[i.parent.groups[s].children.length-1]))}nearestReference(e,t){const i=this.references.map((s,o)=>({idx:o,prefixLen:wS(s.uri.toString(),e.toString()),offsetDist:Math.abs(s.range.startLineNumber-t.lineNumber)*100+Math.abs(s.range.startColumn-t.column)})).sort((s,o)=>s.prefixLen>o.prefixLen?-1:s.prefixLeno.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()&&N.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 Ht.compare(e.uri,t.uri)||N.compareRangesUsingStarts(e.range,t.range)}}var YD=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},ZD=function(n,e){return function(t,i){e(t,i,n)}},ER;let AR=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof Xs||e instanceof zv}getChildren(e){if(e instanceof Xs)return e.groups;if(e instanceof zv)return e.resolve(this._resolverService).then(t=>t.children);throw new Error("bad tree")}};AR=YD([ZD(0,Lu)],AR);class m4e{getHeight(){return 23}getTemplateId(e){return e instanceof zv?Hv.id:_y.id}}let IR=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof lu){const i=(t=e.parent.getPreview(e))===null||t===void 0?void 0:t.preview(e.range);if(i)return i.value}return ra(e.uri)}};IR=YD([ZD(0,bi)],IR);class _4e{getId(e){return e instanceof lu?e.id:e.uri}}let TR=class extends Y{constructor(e,t){super(),this._labelService=t;const i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new ON(i,{supportHighlights:!0})),this.badge=new PN(le(i,ye(".count")),{},PG),e.appendChild(i)}set(e,t){const i=I3(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 s=e.children.length;this.badge.setCount(s),s>1?this.badge.setTitleFormat(m("referencesCount","{0} references",s)):this.badge.setTitleFormat(m("referenceCount","{0} reference",s))}};TR=YD([ZD(1,CD)],TR);let Hv=ER=class{constructor(e){this._instantiationService=e,this.templateId=ER.id}renderTemplate(e){return this._instantiationService.createInstance(TR,e)}renderElement(e,t,i){i.set(e.element,Y3(e.filterData))}disposeTemplate(e){e.dispose()}};Hv.id="FileReferencesRenderer";Hv=ER=YD([ZD(0,vt)],Hv);class b4e{constructor(e){this.label=new Od(e)}set(e,t){var i;const s=(i=e.parent.getPreview(e))===null||i===void 0?void 0:i.preview(e.range);if(!s||!s.value)this.label.set(`${ra(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`);else{const{value:o,highlight:r}=s;t&&!of.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(o,Y3(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(o,[r]))}}}class _y{constructor(){this.templateId=_y.id}renderTemplate(e){return new b4e(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(){}}_y.id="OneReferenceRenderer";class v4e{getWidgetAriaLabel(){return m("treeAriaLabel","References")}getAriaLabel(e){return e.ariaMessage}}var y4e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Ll=function(n,e){return function(t,i){e(t,i,n)}},DB=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class XD{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new pe,this._callOnModelChange=new pe,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 s=0,o=e.children.length;s{const o=s.deltaDecorations([],t);for(let r=0;r{o.equals(9)&&(this._keybindingService.dispatchEvent(o,o.target),o.stopPropagation())},!0)),this._tree=this._instantiationService.createInstance(C4e,"ReferencesWidget",this._treeContainer,new m4e,[this._instantiationService.createInstance(Hv),this._instantiationService.createInstance(_y)],this._instantiationService.createInstance(AR),i),this._splitView.addView({onDidChange:ue.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:o=>{this._preview.layout({height:this._dim.height,width:o})}},vx.Distribute),this._splitView.addView({onDidChange:ue.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)}},vx.Distribute),this._disposables.add(this._splitView.onDidSashChange(()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)},void 0));const s=(o,r)=>{o instanceof lu&&(r==="show"&&this._revealReference(o,!1),this._onDidSelectReference.fire({element:o,kind:r,source:"tree"}))};this._tree.onDidOpen(o=>{o.sideBySide?s(o.element,"side"):o.editorOptions.pinned?s(o.element,"goto"):s(o.element,"show")}),cd(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new Jt(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=m("noResults","No results"),Xh(this._messageContainer),Promise.resolve(void 0)):(cd(this._messageContainer),this._decorationsManager=new XD(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 s=this._getFocusedReference();s&&this._onDidSelectReference.fire({element:{uri:s.uri,range:i.range},kind:t.ctrlKey||t.metaKey||t.altKey?"side":"open",source:"editor"})})),this.container.classList.add("results-loaded"),Xh(this._treeContainer),Xh(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 lu)return e;if(e instanceof zv&&e.children.length>0)return e.children[0]}revealReference(e){return DB(this,void 0,void 0,function*(){yield this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})})}_revealReference(e,t){return DB(this,void 0,void 0,function*(){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==tt.inMemory?this.setTitle(PCe(e.uri),this._uriLabel.getUriLabel(I3(e.uri))):this.setTitle(m("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 s=yield i;if(!this._model){s.dispose();return}Ft(this._previewModelReference);const o=s.object;if(o){const r=this._preview.getModel()===o.textEditorModel?0:1,a=N.lift(e.range).collapseToStart();this._previewModelReference=s,this._preview.setModel(o.textEditorModel),this._preview.setSelection(a),this._preview.revealRangeInCenter(a,r)}else this._preview.setModel(this._previewNotAvailableMessage),s.dispose()})}};NR=y4e([Ll(3,ro),Ll(4,Lu),Ll(5,vt),Ll(6,hY),Ll(7,CD),Ll(8,bD),Ll(9,bi),Ll(10,Ni),Ll(11,so)],NR);var S4e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Dg=function(n,e){return function(t,i){e(t,i,n)}},kB=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},AC;const rg=new _e("referenceSearchVisible",!1,m("referenceSearchVisible","Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let Um=AC=class{static get(e){return e.getContribution(AC.ID)}constructor(e,t,i,s,o,r,a,l){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=s,this._notificationService=o,this._instantiationService=r,this._storageService=a,this._configurationService=l,this._disposables=new pe,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=rg.bindTo(i)}dispose(){var e,t;this._referenceSearchVisible.reset(),this._disposables.dispose(),(e=this._widget)===null||e===void 0||e.dispose(),(t=this._model)===null||t===void 0||t.dispose(),this._widget=void 0,this._model=void 0}toggleWidget(e,t,i){let s;if(this._widget&&(s=this._widget.position),this.closeWidget(),s&&e.containsPosition(s))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",r=w4e.fromJSON(this._storageService.get(o,0,"{}"));this._widget=this._instantiationService.createInstance(NR,this._editor,this._defaultTreeKeyboardSupport,r),this._widget.setTitle(m("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,!0):this.openReference(c,!1,!0);break}}));const a=++this._requestIdPool;t.then(l=>{var c;if(a!==this._requestIdPool||!this._widget){l.dispose();return}return(c=this._model)===null||c===void 0||c.dispose(),this._model=l,this._widget.setModel(this._model).then(()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(m("metaTitle.N","{0} ({1})",this._model.title,this._model.references.length));const d=this._editor.getModel().uri,u=new V(e.startLineNumber,e.startColumn),h=this._model.nearestReference(d,u);if(h)return this._widget.setSelection(h).then(()=>{this._widget&&this._editor.getOption(86)==="editor"&&this._widget.focusOnPreviewEditor()})}})},l=>{this._notificationService.error(l)})}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}goToNextOrPreviousReference(e){return kB(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 s=this._model.nextOrPreviousReference(i,e),o=this._editor.hasTextFocus(),r=this._widget.isPreviewEditorFocused();yield this._widget.setSelection(s),yield this._gotoReference(s,!1),o?this._editor.focus():this._widget&&r&&this._widget.focusOnPreviewEditor()})}revealReference(e){return kB(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,t){var i;(i=this._widget)===null||i===void 0||i.hide(),this._ignoreModelChangeEvent=!0;const s=N.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:s,selectionSource:"code.jump",pinned:t}},this._editor).then(o=>{var r;if(this._ignoreModelChangeEvent=!1,!o||!this._widget){this.closeWidget();return}if(this._editor===o)this._widget.show(s),this._widget.focusOnReferenceTree();else{const a=AC.get(o),l=this._model.clone();this.closeWidget(),o.focus(),a==null||a.toggleWidget(s,xc(c=>Promise.resolve(l)),(r=this._peekMode)!==null&&r!==void 0?r:!1)}},o=>{this._ignoreModelChangeEvent=!1,mt(o)})}openReference(e,t,i){t||this.closeWidget();const{uri:s,range:o}=e;this._editorService.openCodeEditor({resource:s,options:{selection:o,selectionSource:"code.jump",pinned:i}},this._editor,t)}};Um.ID="editor.contrib.referencesController";Um=AC=S4e([Dg(2,et),Dg(3,jt),Dg(4,xn),Dg(5,vt),Dg(6,tg),Dg(7,ii)],Um);function ag(n,e){const t=c4e(n);if(!t)return;const i=Um.get(t);i&&e(i)}Fs.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:Pn(2089,60),when:Le.or(rg,eo.inPeekEditor),handler(n){ag(n,e=>{e.changeFocusBetweenPreviewAndReferences()})}});Fs.registerCommandAndKeybindingRule({id:"goToNextReference",weight:90,primary:62,secondary:[70],when:Le.or(rg,eo.inPeekEditor),handler(n){ag(n,e=>{e.goToNextOrPreviousReference(!0)})}});Fs.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:90,primary:1086,secondary:[1094],when:Le.or(rg,eo.inPeekEditor),handler(n){ag(n,e=>{e.goToNextOrPreviousReference(!1)})}});Yt.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference");Yt.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference");Yt.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch");Yt.registerCommand("closeReferenceSearch",n=>ag(n,e=>e.closeWidget()));Fs.registerKeybindingRule({id:"closeReferenceSearch",weight:-1,primary:9,secondary:[1033],when:Le.and(eo.inPeekEditor,Le.not("config.editor.stablePeek"))});Fs.registerKeybindingRule({id:"closeReferenceSearch",weight:250,primary:9,secondary:[1033],when:Le.and(rg,Le.not("config.editor.stablePeek"))});Fs.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:Le.and(rg,iK,pP.negate(),mP.negate()),handler(n){var e;const i=(e=n.get(Qo).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof lu&&ag(n,s=>s.revealReference(i[0]))}});Fs.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:Le.and(rg,iK,pP.negate(),mP.negate()),handler(n){var e;const i=(e=n.get(Qo).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof lu&&ag(n,s=>s.openReference(i[0],!0,!0))}});Yt.registerCommand("openReference",n=>{var e;const i=(e=n.get(Qo).lastFocusedList)===null||e===void 0?void 0:e.getFocus();Array.isArray(i)&&i[0]instanceof lu&&ag(n,s=>s.openReference(i[0],!1,!0))});var pY=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},x_=function(n,e){return function(t,i){e(t,i,n)}};const HP=new _e("hasSymbols",!1,m("hasSymbols","Whether there are symbol locations that can be navigated via keyboard-only.")),QD=rt("ISymbolNavigationService");let RR=class{constructor(e,t,i,s){this._editorService=t,this._notificationService=i,this._keybindingService=s,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=HP.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 MR(this._editorService),s=i.onDidChange(o=>{if(this._ignoreEditorChange)return;const r=this._editorService.getActiveCodeEditor();if(!r)return;const a=r.getModel(),l=r.getPosition();if(!a||!l)return;let c=!1,d=!1;for(const u of t.references)if(A3(u.uri,a.uri))c=!0,d=d||N.containsPosition(u.range,l);else if(c)break;(!c||!d)&&this.reset()});this._currentState=_r(i,s)}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:N.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?m("location.kb","Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,t.getLabel()):m("location","Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(i)}};RR=pY([x_(0,et),x_(1,jt),x_(2,xn),x_(3,bi)],RR);ft(QD,RR,1);Ee(new class extends kr{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:HP,kbOpts:{weight:100,primary:70}})}runEditorCommand(n,e){return n.get(QD).revealNext(e)}});Fs.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:HP,primary:9,handler(n){n.get(QD).reset()}});let MR=class{constructor(e){this._listener=new Map,this._disposables=new pe,this._onDidChange=new B,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(),Ft(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,_r(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)}};MR=pY([x_(0,jt)],MR);var x4e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},EB=function(n,e){return function(t,i){e(t,i,n)}},mY=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},PR;let $v=PR=class{constructor(e,t,i){this._options=e,this._languageService=t,this._openerService=i,this._onDidRenderAsync=new B,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,i){if(!e)return{element:document.createElement("span"),dispose:()=>{}};const s=new pe,o=s.add(xD(e,Object.assign(Object.assign({},this._getRenderOptions(e,s)),t),i));return o.element.classList.add("rendered-markdown"),{element:o.element,dispose:()=>s.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:(i,s)=>mY(this,void 0,void 0,function*(){var o,r,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=Ho);const c=yield oxe(this._languageService,s,l),d=document.createElement("span");if(d.innerHTML=(a=(r=PR._ttpTokenizer)===null||r===void 0?void 0:r.createHTML(c))!==null&&a!==void 0?a:c,this._options.editor){const u=this._options.editor.getOption(50);Nn(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=>_Y(this._openerService,i,e.isTrusted),disposables:t}}}};$v._ttpTokenizer=Kf("tokenizeToString",{createHTML(n){return n}});$v=PR=x4e([EB(1,Ni),EB(2,Dc)],$v);function _Y(n,e,t){return mY(this,void 0,void 0,function*(){try{return yield n.open(e,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:L4e(t)})}catch(i){return mt(i),!1}})}function L4e(n){return n===!0?!0:n&&Array.isArray(n.enabledCommands)?n.enabledCommands:!1}var D4e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},AB=function(n,e){return function(t,i){e(t,i,n)}},IC;let vr=IC=class{static get(e){return e.getContribution(IC.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new sa,this._messageListeners=new pe,this._mouseOverMessage=!1,this._editor=e,this._visible=IC.MESSAGE_VISIBLE.bindTo(t)}dispose(){var e;(e=this._message)===null||e===void 0||e.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){Q1(Md(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=Md(e)?xD(e,{actionHandler:{callback:s=>_Y(this._openerService,s,Md(e)?e.isTrusted:void 0),disposables:this._messageListeners}}):void 0,this._messageWidget.value=new IB(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(ue.debounce(this._editor.onDidBlurEditorText,(s,o)=>o,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&wn(ea(),this._messageWidget.value.getDomNode())||this.closeMessage()})),this._messageListeners.add(this._editor.onDidChangeCursorPosition(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidDispose(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeModel(()=>this.closeMessage())),this._messageListeners.add(K(this._messageWidget.value.getDomNode(),de.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(K(this._messageWidget.value.getDomNode(),de.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let i;this._messageListeners.add(this._editor.onMouseMove(s=>{s.target.position&&(i?i.containsPosition(s.target.position)||this.closeMessage():i=new N(t.lineNumber-3,1,s.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(IB.fadeOut(this._messageWidget.value))}};vr.ID="editor.contrib.messageController";vr.MESSAGE_VISIBLE=new _e("messageVisible",!1,m("messageVisible","Whether the editor is currently showing an inline message"));vr=IC=D4e([AB(1,et),AB(2,Dc)],vr);const k4e=kr.bindToContribution(vr.get);Ee(new k4e({id:"leaveEditorMessage",precondition:vr.MESSAGE_VISIBLE,handler:n=>n.closeMessage(),kbOpts:{weight:130,primary:9}}));let IB=class{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},s){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 r=document.createElement("div");typeof s=="string"?(r.classList.add("message"),r.textContent=s):(s.classList.add("message"),r.appendChild(s)),this._domNode.appendChild(r);const a=document.createElement("div");a.classList.add("anchor","below"),this._domNode.appendChild(a),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",e===2)}};Ir(vr.ID,vr,4);var $P=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};function by(n,e,t,i){return $P(this,void 0,void 0,function*(){const o=t.ordered(n).map(a=>Promise.resolve(i(a,n,e)).then(void 0,l=>{wc(l)})),r=yield Promise.all(o);return RL(r.flat())})}function UP(n,e,t,i){return by(e,t,n,(s,o,r)=>s.provideDefinition(o,r,i))}function bY(n,e,t,i){return by(e,t,n,(s,o,r)=>s.provideDeclaration(o,r,i))}function vY(n,e,t,i){return by(e,t,n,(s,o,r)=>s.provideImplementation(o,r,i))}function yY(n,e,t,i){return by(e,t,n,(s,o,r)=>s.provideTypeDefinition(o,r,i))}function JD(n,e,t,i,s){return by(e,t,n,(o,r,a)=>$P(this,void 0,void 0,function*(){const l=yield o.provideReferences(r,a,{includeDeclaration:!0},s);if(!i||!l||l.length!==2)return l;const c=yield o.provideReferences(r,a,{includeDeclaration:!1},s);return c&&c.length===1?c:l}))}function vy(n){return $P(this,void 0,void 0,function*(){const e=yield n(),t=new Xs(e,""),i=t.references.map(s=>s.link);return t.dispose(),i})}a0("_executeDefinitionProvider",(n,e,t)=>{const i=n.get(it),s=UP(i.definitionProvider,e,t,rn.None);return vy(()=>s)});a0("_executeTypeDefinitionProvider",(n,e,t)=>{const i=n.get(it),s=yY(i.typeDefinitionProvider,e,t,rn.None);return vy(()=>s)});a0("_executeDeclarationProvider",(n,e,t)=>{const i=n.get(it),s=bY(i.declarationProvider,e,t,rn.None);return vy(()=>s)});a0("_executeReferenceProvider",(n,e,t)=>{const i=n.get(it),s=JD(i.referenceProvider,e,t,!1,rn.None);return vy(()=>s)});a0("_executeImplementationProvider",(n,e,t)=>{const i=n.get(it),s=vY(i.implementationProvider,e,t,rn.None);return vy(()=>s)});var yr=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},q0,G0,K0,Fw,Bw,Ww,Vw,zw;cr.appendMenuItem(I.EditorContext,{submenu:I.EditorContextPeek,title:m("peek.submenu","Peek"),group:"navigation",order:100});class Mx{static is(e){return!e||typeof e!="object"?!1:!!(e instanceof Mx||V.isIPosition(e.position)&&e.model)}constructor(e,t){this.model=e,this.position=t}}class is extends Ume{static all(){return is._allSymbolNavigationCommands.values()}static _patchConfig(e){const t=Object.assign(Object.assign({},e),{f1:!0});if(t.menu)for(const i of ut.wrap(t.menu))(i.id===I.EditorContext||i.id===I.EditorContextPeek)&&(i.when=Le.and(e.precondition,i.when));return t}constructor(e,t){super(is._patchConfig(t)),this.configuration=e,is._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,s){if(!t.hasModel())return Promise.resolve(void 0);const o=e.get(xn),r=e.get(jt),a=e.get(oy),l=e.get(QD),c=e.get(it),d=e.get(vt),u=t.getModel(),h=t.getPosition(),f=Mx.is(i)?i:new Mx(u,h),g=new dNe(t,5),p=Kme(this._getLocationModel(c,f.model,f.position,g.token),g.token).then(_=>yr(this,void 0,void 0,function*(){var v;if(!_||g.token.isCancellationRequested)return;Q1(_.ariaMessage);let b;if(_.referenceAt(u.uri,h)){const w=this._getAlternativeCommand(t);!is._activeAlternativeCommands.has(w)&&is._allSymbolNavigationCommands.has(w)&&(b=is._allSymbolNavigationCommands.get(w))}const y=_.references.length;if(y===0){if(!this.configuration.muteMessage){const w=u.getWordAtPosition(h);(v=vr.get(t))===null||v===void 0||v.showMessage(this._getNoResultFoundMessage(w),h)}}else if(y===1&&b)is._activeAlternativeCommands.add(this.desc.id),d.invokeFunction(w=>b.runEditorCommand(w,t,i,s).finally(()=>{is._activeAlternativeCommands.delete(this.desc.id)}));else return this._onResult(r,l,t,_,s)}),_=>{o.error(_)}).finally(()=>{g.dispose()});return a.showWhile(p,250),p}_onResult(e,t,i,s,o){return yr(this,void 0,void 0,function*(){const r=this._getGoToPreference(i);if(!(i instanceof $m)&&(this.configuration.openInPeek||r==="peek"&&s.references.length>1))this._openInPeek(i,s,o);else{const a=s.firstReference(),l=s.references.length>1&&r==="gotoAndPeek",c=yield this._openReference(i,e,a,this.configuration.openToSide,!l);l&&c?this._openInPeek(c,s,o):s.dispose(),r==="goto"&&t.put(a)}})}_openReference(e,t,i,s,o){return yr(this,void 0,void 0,function*(){let r;if(Xge(i)&&(r=i.targetSelectionRange),r||(r=i.range),!r)return;const a=yield t.openCodeEditor({resource:i.uri,options:{selection:N.collapseToStart(r),selectionRevealType:3,selectionSource:"code.jump"}},e,s);if(a){if(o){const l=a.getModel(),c=a.createDecorationsCollection([{range:r,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout(()=>{a.getModel()===l&&c.clear()},350)}return a}})}_openInPeek(e,t,i){const s=Um.get(e);s&&e.hasModel()?s.toggleWidget(i??e.getSelection(),xc(o=>Promise.resolve(t)),this.configuration.openInPeek):t.dispose()}}is._allSymbolNavigationCommands=new Map;is._activeAlternativeCommands=new Set;class ek extends is{_getLocationModel(e,t,i,s){return yr(this,void 0,void 0,function*(){return new Xs(yield UP(e.definitionProvider,t,i,s),m("def.title","Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?m("noResultWord","No definition found for '{0}'",e.word):m("generic.noResults","No definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleDefinitions}}Bs((q0=class extends ek{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:q0.id,title:{value:m("actions.goToDecl.label","Go to Definition"),original:"Go to Definition",mnemonicTitle:m({key:"miGotoDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Definition")},precondition:Le.and($.hasDefinitionProvider,$.isInWalkThroughSnippet.toNegated()),keybinding:[{when:$.editorTextFocus,primary:70,weight:100},{when:Le.and($.editorTextFocus,JG),primary:2118,weight:100}],menu:[{id:I.EditorContext,group:"navigation",order:1.1},{id:I.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),Yt.registerCommandAlias("editor.action.goToDeclaration",q0.id)}},q0.id="editor.action.revealDefinition",q0));Bs((G0=class extends ek{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:G0.id,title:{value:m("actions.goToDeclToSide.label","Open Definition to the Side"),original:"Open Definition to the Side"},precondition:Le.and($.hasDefinitionProvider,$.isInWalkThroughSnippet.toNegated()),keybinding:[{when:$.editorTextFocus,primary:Pn(2089,70),weight:100},{when:Le.and($.editorTextFocus,JG),primary:Pn(2089,2118),weight:100}]}),Yt.registerCommandAlias("editor.action.openDeclarationToTheSide",G0.id)}},G0.id="editor.action.revealDefinitionAside",G0));Bs((K0=class extends ek{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:K0.id,title:{value:m("actions.previewDecl.label","Peek Definition"),original:"Peek Definition"},precondition:Le.and($.hasDefinitionProvider,eo.notInPeekEditor,$.isInWalkThroughSnippet.toNegated()),keybinding:{when:$.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:I.EditorContextPeek,group:"peek",order:2}}),Yt.registerCommandAlias("editor.action.previewDeclaration",K0.id)}},K0.id="editor.action.peekDefinition",K0));class wY extends is{_getLocationModel(e,t,i,s){return yr(this,void 0,void 0,function*(){return new Xs(yield bY(e.declarationProvider,t,i,s),m("decl.title","Declarations"))})}_getNoResultFoundMessage(e){return e&&e.word?m("decl.noResultWord","No declaration found for '{0}'",e.word):m("decl.generic.noResults","No declaration found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(58).multipleDeclarations}}Bs((Fw=class extends wY{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:Fw.id,title:{value:m("actions.goToDeclaration.label","Go to Declaration"),original:"Go to Declaration",mnemonicTitle:m({key:"miGotoDeclaration",comment:["&& denotes a mnemonic"]},"Go to &&Declaration")},precondition:Le.and($.hasDeclarationProvider,$.isInWalkThroughSnippet.toNegated()),menu:[{id:I.EditorContext,group:"navigation",order:1.3},{id:I.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?m("decl.noResultWord","No declaration found for '{0}'",e.word):m("decl.generic.noResults","No declaration found")}},Fw.id="editor.action.revealDeclaration",Fw));Bs(class extends wY{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:{value:m("actions.peekDecl.label","Peek Declaration"),original:"Peek Declaration"},precondition:Le.and($.hasDeclarationProvider,eo.notInPeekEditor,$.isInWalkThroughSnippet.toNegated()),menu:{id:I.EditorContextPeek,group:"peek",order:3}})}});class CY extends is{_getLocationModel(e,t,i,s){return yr(this,void 0,void 0,function*(){return new Xs(yield yY(e.typeDefinitionProvider,t,i,s),m("typedef.title","Type Definitions"))})}_getNoResultFoundMessage(e){return e&&e.word?m("goToTypeDefinition.noResultWord","No type definition found for '{0}'",e.word):m("goToTypeDefinition.generic.noResults","No type definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleTypeDefinitions}}Bs((Bw=class extends CY{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:Bw.ID,title:{value:m("actions.goToTypeDefinition.label","Go to Type Definition"),original:"Go to Type Definition",mnemonicTitle:m({key:"miGotoTypeDefinition",comment:["&& denotes a mnemonic"]},"Go to &&Type Definition")},precondition:Le.and($.hasTypeDefinitionProvider,$.isInWalkThroughSnippet.toNegated()),keybinding:{when:$.editorTextFocus,primary:0,weight:100},menu:[{id:I.EditorContext,group:"navigation",order:1.4},{id:I.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}},Bw.ID="editor.action.goToTypeDefinition",Bw));Bs((Ww=class extends CY{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:Ww.ID,title:{value:m("actions.peekTypeDefinition.label","Peek Type Definition"),original:"Peek Type Definition"},precondition:Le.and($.hasTypeDefinitionProvider,eo.notInPeekEditor,$.isInWalkThroughSnippet.toNegated()),menu:{id:I.EditorContextPeek,group:"peek",order:4}})}},Ww.ID="editor.action.peekTypeDefinition",Ww));class SY extends is{_getLocationModel(e,t,i,s){return yr(this,void 0,void 0,function*(){return new Xs(yield vY(e.implementationProvider,t,i,s),m("impl.title","Implementations"))})}_getNoResultFoundMessage(e){return e&&e.word?m("goToImplementation.noResultWord","No implementation found for '{0}'",e.word):m("goToImplementation.generic.noResults","No implementation found")}_getAlternativeCommand(e){return e.getOption(58).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(58).multipleImplementations}}Bs((Vw=class extends SY{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:Vw.ID,title:{value:m("actions.goToImplementation.label","Go to Implementations"),original:"Go to Implementations",mnemonicTitle:m({key:"miGotoImplementation",comment:["&& denotes a mnemonic"]},"Go to &&Implementations")},precondition:Le.and($.hasImplementationProvider,$.isInWalkThroughSnippet.toNegated()),keybinding:{when:$.editorTextFocus,primary:2118,weight:100},menu:[{id:I.EditorContext,group:"navigation",order:1.45},{id:I.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}},Vw.ID="editor.action.goToImplementation",Vw));Bs((zw=class extends SY{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:zw.ID,title:{value:m("actions.peekImplementation.label","Peek Implementations"),original:"Peek Implementations"},precondition:Le.and($.hasImplementationProvider,eo.notInPeekEditor,$.isInWalkThroughSnippet.toNegated()),keybinding:{when:$.editorTextFocus,primary:3142,weight:100},menu:{id:I.EditorContextPeek,group:"peek",order:5}})}},zw.ID="editor.action.peekImplementation",zw));class xY extends is{_getNoResultFoundMessage(e){return e?m("references.no","No references found for '{0}'",e.word):m("references.noGeneric","No references found")}_getAlternativeCommand(e){return e.getOption(58).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(58).multipleReferences}}Bs(class extends xY{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{value:m("goToReferences.label","Go to References"),original:"Go to References",mnemonicTitle:m({key:"miGotoReference",comment:["&& denotes a mnemonic"]},"Go to &&References")},precondition:Le.and($.hasReferenceProvider,eo.notInPeekEditor,$.isInWalkThroughSnippet.toNegated()),keybinding:{when:$.editorTextFocus,primary:1094,weight:100},menu:[{id:I.EditorContext,group:"navigation",order:1.45},{id:I.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}_getLocationModel(e,t,i,s){return yr(this,void 0,void 0,function*(){return new Xs(yield JD(e.referenceProvider,t,i,!0,s),m("ref.title","References"))})}});Bs(class extends xY{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:{value:m("references.action.label","Peek References"),original:"Peek References"},precondition:Le.and($.hasReferenceProvider,eo.notInPeekEditor,$.isInWalkThroughSnippet.toNegated()),menu:{id:I.EditorContextPeek,group:"peek",order:6}})}_getLocationModel(e,t,i,s){return yr(this,void 0,void 0,function*(){return new Xs(yield JD(e.referenceProvider,t,i,!1,s),m("ref.title","References"))})}});class E4e extends is{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",title:{value:m("label.generic","Go to Any Symbol"),original:"Go to Any Symbol"},precondition:Le.and(eo.notInPeekEditor,$.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}_getLocationModel(e,t,i,s){return yr(this,void 0,void 0,function*(){return new Xs(this._references,m("generic.title","Locations"))})}_getNoResultFoundMessage(e){return e&&m("generic.noResult","No results for '{0}'",e.word)||""}_getGoToPreference(e){var t;return(t=this._gotoMultipleBehaviour)!==null&&t!==void 0?t:e.getOption(58).multipleReferences}_getAlternativeCommand(){return""}}Yt.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:Ue},{name:"position",description:"The position at which to start",constraint:V.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"},{name:"noResultsMessage",description:"Human readable message that shows when locations is empty."}]},handler:(n,e,t,i,s,o,r)=>yr(void 0,void 0,void 0,function*(){xs(Ue.isUri(e)),xs(V.isIPosition(t)),xs(Array.isArray(i)),xs(typeof s>"u"||typeof s=="string"),xs(typeof r>"u"||typeof r=="boolean");const a=n.get(jt),l=yield a.openCodeEditor({resource:e},a.getFocusedCodeEditor());if(VK(l))return l.setPosition(t),l.revealPositionInCenterIfOutsideViewport(t,0),l.invokeWithinContext(c=>{const d=new class extends E4e{_getNoResultFoundMessage(u){return o||super._getNoResultFoundMessage(u)}}({muteMessage:!o,openInPeek:!!r,openToSide:!1},i,s);c.get(vt).invokeFunction(d.run.bind(d),l)})})});Yt.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:Ue},{name:"position",description:"The position at which to start",constraint:V.isIPosition},{name:"locations",description:"An array of locations.",constraint:Array},{name:"multiple",description:"Define what to do when having multiple results, either `peek`, `gotoAndPeek`, or `goto"}]},handler:(n,e,t,i,s)=>yr(void 0,void 0,void 0,function*(){n.get(fs).executeCommand("editor.action.goToLocations",e,t,i,s,void 0,!0)})});Yt.registerCommand({id:"editor.action.findReferences",handler:(n,e,t)=>{xs(Ue.isUri(e)),xs(V.isIPosition(t));const i=n.get(it),s=n.get(jt);return s.openCodeEditor({resource:e},s.getFocusedCodeEditor()).then(o=>{if(!VK(o)||!o.hasModel())return;const r=Um.get(o);if(!r)return;const a=xc(c=>JD(i.referenceProvider,o.getModel(),V.lift(t),!1,c).then(d=>new Xs(d,m("ref.title","References")))),l=new N(t.lineNumber,t.column,t.lineNumber,t.column);return Promise.resolve(r.toggleWidget(l,a,!1))})}});Yt.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");var A4e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},bE=function(n,e){return function(t,i){e(t,i,n)}},TB=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},L_;let Rf=L_=class{constructor(e,t,i,s){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=s,this.toUnhook=new pe,this.toUnhookForKeyboard=new pe,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const o=new i4e(e);this.toUnhook.add(o),this.toUnhook.add(o.onMouseMoveOrRelevantKeyDown(([r,a])=>{this.startFindDefinitionFromMouse(r,a??void 0)})),this.toUnhook.add(o.onExecute(r=>{this.isEnabled(r)&&this.gotoDefinition(r.target.position,r.hasSideBySideModifier).catch(a=>{mt(a)}).finally(()=>{this.removeLinkDecorations()})})),this.toUnhook.add(o.onCancel(()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null}))}static get(e){return e.getContribution(L_.ID)}startFindDefinitionFromCursor(e){return TB(this,void 0,void 0,function*(){yield this.startFindDefinition(e),this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition(()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()})),this.toUnhookForKeyboard.add(this.editor.onKeyDown(t=>{t&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())}))})}startFindDefinitionFromMouse(e,t){if(e.target.type===9&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(e,t)){this.currentWordAtPosition=null,this.removeLinkDecorations();return}const i=e.target.position;this.startFindDefinition(i)}startFindDefinition(e){var t;return TB(this,void 0,void 0,function*(){this.toUnhookForKeyboard.clear();const i=e?(t=this.editor.getModel())===null||t===void 0?void 0:t.getWordAtPosition(e):null;if(!i){this.currentWordAtPosition=null,this.removeLinkDecorations();return}if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===i.startColumn&&this.currentWordAtPosition.endColumn===i.endColumn&&this.currentWordAtPosition.word===i.word)return;this.currentWordAtPosition=i;const s=new cNe(this.editor,15);this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=xc(a=>this.findDefinition(e,a));let o;try{o=yield this.previousPromise}catch(a){mt(a);return}if(!o||!o.length||!s.validate(this.editor)){this.removeLinkDecorations();return}const r=o[0].originSelectionRange?N.lift(o[0].originSelectionRange):new N(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn);if(o.length>1){let a=r;for(const{originSelectionRange:l}of o)l&&(a=N.plusRange(a,l));this.addDecoration(a,new Fm().appendText(m("multipleResults","Click to show {0} definitions.",o.length)))}else{const a=o[0];if(!a.uri)return;this.textModelResolverService.createModelReference(a.uri).then(l=>{if(!l.object||!l.object.textEditorModel){l.dispose();return}const{object:{textEditorModel:c}}=l,{startLineNumber:d}=a.range;if(d<1||d>c.getLineCount()){l.dispose();return}const u=this.getPreviewValue(c,d,a),h=this.languageService.guessLanguageIdByFilepathOrFirstLine(c.uri);this.addDecoration(r,u?new Fm().appendCodeblock(h||"",u):void 0),l.dispose()})}})}getPreviewValue(e,t,i){let s=i.range;return s.endLineNumber-s.startLineNumber>=L_.MAX_SOURCE_PREVIEW_LINES&&(s=this.getPreviewRangeBasedOnIndentation(e,t)),this.stripIndentationFromPreviewRange(e,t,s)}stripIndentationFromPreviewRange(e,t,i){let o=e.getLineFirstNonWhitespaceColumn(t);for(let a=t+1;a{const s=!t&&this.editor.getOption(87)&&!this.isInPeekEditor(i);return new ek({openToSide:t,openInPeek:s,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(i)})}isInPeekEditor(e){const t=e.get(et);return eo.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};Rf.ID="editor.contrib.gotodefinitionatposition";Rf.MAX_SOURCE_PREVIEW_LINES=8;Rf=L_=A4e([bE(1,Lu),bE(2,Ni),bE(3,it)],Rf);Ir(Rf.ID,Rf,2);const Hw=ye;class LY extends Y{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 w3(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}}class jP extends Y{static render(e,t,i){return new jP(e,t,i)}constructor(e,t,i){super(),this.actionContainer=le(e,Hw("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=le(this.actionContainer,Hw("a.action")),this.action.setAttribute("role","button"),t.iconClass&&le(this.action,Hw(`span.icon.${t.iconClass}`));const s=le(this.action,Hw("span"));s.textContent=i?`${t.label} (${i})`:t.label,this._register(K(this.actionContainer,de.CLICK,o=>{o.stopPropagation(),o.preventDefault(),t.run(this.actionContainer)})),this._register(K(this.actionContainer,de.KEY_DOWN,o=>{const r=new zt(o);(r.equals(3)||r.equals(10))&&(o.stopPropagation(),o.preventDefault(),t.run(this.actionContainer))})),this.setEnabled(!0)}setEnabled(e){e?(this.actionContainer.classList.remove("disabled"),this.actionContainer.removeAttribute("aria-disabled")):(this.actionContainer.classList.add("disabled"),this.actionContainer.setAttribute("aria-disabled","true"))}}function I4e(n,e){return n&&e?m("acessibleViewHint","Inspect this in the accessible view with {0}.",e):n?m("acessibleViewHintNoKbOpen","Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):""}var T4e=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},N4e=function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof __values=="function"?__values(n):n[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(o){t[o]=n[o]&&function(r){return new Promise(function(a,l){r=n[o](r),s(a,l,r.done,r.value)})}}function s(o,r,a,l){Promise.resolve(l).then(function(c){o({value:c,done:a})},r)}};let R4e=class{constructor(e,t,i){this.value=e,this.isComplete=t,this.hasLoadingMessage=i}};class DY extends Y{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new B),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new Li(()=>this._triggerAsyncComputation(),0)),this._secondWaitScheduler=this._register(new Li(()=>this._triggerSyncComputation(),0)),this._loadingMessageScheduler=this._register(new Li(()=>this._triggerLoadingMessage(),0)),this._state=0,this._asyncIterable=null,this._asyncIterableDone=!1,this._result=[]}dispose(){this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),super.dispose()}get _hoverTime(){return this._editor.getOption(60).delay}get _firstWaitTime(){return this._hoverTime/2}get _secondWaitTime(){return this._hoverTime-this._firstWaitTime}get _loadingMessageTime(){return 3*this._hoverTime}_setState(e,t=!0){this._state=e,t&&this._fireResult()}_triggerAsyncComputation(){this._setState(2),this._secondWaitScheduler.schedule(this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=e0e(e=>this._computer.computeAsync(e)),T4e(this,void 0,void 0,function*(){var e,t,i,s;try{try{for(var o=!0,r=N4e(this._asyncIterable),a;a=yield r.next(),e=a.done,!e;o=!0){s=a.value,o=!1;const l=s;l&&(this._result.push(l),this._fireResult())}}catch(l){t={error:l}}finally{try{!o&&!e&&(i=r.return)&&(yield i.call(r))}finally{if(t)throw t.error}}this._asyncIterableDone=!0,(this._state===3||this._state===4)&&this._setState(0)}catch(l){mt(l)}})):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 R4e(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 vE{constructor(e,t,i,s){this.priority=e,this.range=t,this.initialMousePosX=i,this.initialMousePosY=s,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}}const qP=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class M4e{constructor(){this._onDidWillResize=new B,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new B,this.onDidResize=this._onDidResize.event,this._sashListener=new pe,this._size=new Jt(0,0),this._minSize=new Jt(0,0),this._maxSize=new Jt(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new Dn(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new Dn(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new Dn(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:_x.North}),this._southSash=new Dn(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:_x.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(ue.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(ue.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(s=>{e&&(i=s.currentX-s.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(s=>{e&&(i=-(s.currentX-s.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(s=>{e&&(t=-(s.currentY-s.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(s=>{e&&(t=s.currentY-s.startY,this.layout(e.height+t,e.width+i),this._onDidResize.fire({dimension:this._size,done:!1,south:!0}))})),this._sashListener.add(ue.any(this._eastSash.onDidReset,this._westSash.onDidReset)(s=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))})),this._sashListener.add(ue.any(this._northSash.onDidReset,this._southSash.onDidReset)(s=>{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,s){this._northSash.state=e?3:0,this._eastSash.state=t?3:0,this._southSash.state=i?3:0,this._westSash.state=s?3:0}layout(e=this.size.height,t=this.size.width){const{height:i,width:s}=this._minSize,{height:o,width:r}=this._maxSize;e=Math.max(i,Math.min(o,e)),t=Math.max(s,Math.min(r,t));const a=new Jt(t,e);Jt.equals(a,this._size)||(this.domNode.style.height=e+"px",this.domNode.style.width=t+"px",this._size=a,this._northSash.layout(),this._eastSash.layout(),this._southSash.layout(),this._westSash.layout())}clearSashHoverState(){this._eastSash.clearSashHoverState(),this._westSash.clearSashHoverState(),this._northSash.clearSashHoverState(),this._southSash.clearSashHoverState()}get size(){return this._size}set maxSize(e){this._maxSize=e}get maxSize(){return this._maxSize}set minSize(e){this._minSize=e}get minSize(){return this._minSize}set preferredSize(e){this._preferredSize=e}get preferredSize(){return this._preferredSize}}const P4e=30,O4e=24;class F4e extends Y{constructor(e,t=new Jt(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new M4e),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=Jt.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize(i=>{this._resize(new Jt(i.dimension.width,i.dimension.height)),i.done&&(this._isResizing=!1)})),this._register(this._resizableNode.onDidWillResize(()=>{this._isResizing=!0}))}get isResizing(){return this._isResizing}getDomNode(){return this._resizableNode.domNode}getPosition(){return this._contentPosition}get position(){var e;return!((e=this._contentPosition)===null||e===void 0)&&e.position?V.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);return!t||!i?void 0:Tn(t).top+i.top-P4e}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;const s=Tn(t),o=ZL(t.ownerDocument.body),r=s.top+i.top+i.height;return o.height-r-O4e}_findPositionPreference(e,t){var i,s;const o=Math.min((i=this._availableVerticalSpaceBelow(t))!==null&&i!==void 0?i:1/0,e),r=Math.min((s=this._availableVerticalSpaceAbove(t))!==null&&s!==void 0?s:1/0,e),a=Math.min(Math.max(r,o),e),l=Math.min(e,a);let c;return this._editor.getOption(60).above?c=l<=r?1:2:c=l<=o?2:1,c===1?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),c}_resize(e){this._resizableNode.layout(e.height,e.width)}}var GP=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Nh=function(n,e){return function(t,i){e(t,i,n)}},TC,va;const NB=ye;let Px=TC=class extends Y{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._currentResult=null,this._widget=this._register(this._instantiationService.createInstance(Wd,this._editor)),this._participants=[];for(const s of qP.getAll())this._participants.push(this._instantiationService.createInstance(s,this._editor));this._participants.sort((s,o)=>s.hoverOrdinal-o.hoverOrdinal),this._computer=new Ox(this._editor,this._participants),this._hoverOperation=this._register(new DY(this._editor,this._computer)),this._register(this._hoverOperation.onResult(s=>{if(!this._computer.anchor)return;const o=s.hasLoadingMessage?this._addLoadingMessage(s.value):s.value;this._withResult(new kY(this._computer.anchor,o,s.isComplete))})),this._register(Ui(this._widget.getDomNode(),"keydown",s=>{s.equals(9)&&this.hide()})),this._register(Si.onDidChange(()=>{this._widget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)}))}get widget(){return this._widget}maybeShowAt(e){if(this._widget.isResizing)return!0;const t=[];for(const s of this._participants)if(s.suggestHoverAnchor){const o=s.suggestHoverAnchor(e);o&&t.push(o)}const i=e.target;if(i.type===6&&t.push(new vE(0,i.range,e.event.posx,e.event.posy)),i.type===7){const s=this._editor.getOption(50).typicalHalfwidthCharacterWidth/2;!i.detail.isAfterLines&&typeof i.detail.horizontalDistanceToText=="number"&&i.detail.horizontalDistanceToTexto.priority-s.priority),this._startShowingOrUpdateHover(t[0],0,0,!1,e))}startShowingAtRange(e,t,i,s){this._startShowingOrUpdateHover(new vE(0,e,void 0,void 0),t,i,s,null)}_startShowingOrUpdateHover(e,t,i,s,o){return!this._widget.position||!this._currentResult?e?(this._startHoverOperationIfNecessary(e,t,i,s,!1),!0):!1:this._editor.getOption(60).sticky&&o&&this._widget.isMouseGettingCloser(o.event.posx,o.event.posy)?(e&&this._startHoverOperationIfNecessary(e,t,i,s,!0),!0):e?e&&this._currentResult.anchor.equals(e)?!0:e.canAdoptVisibleHover(this._currentResult.anchor,this._widget.position)?(this._setCurrentResult(this._currentResult.filter(e)),this._startHoverOperationIfNecessary(e,t,i,s,!1),!0):(this._setCurrentResult(null),this._startHoverOperationIfNecessary(e,t,i,s,!1),!0):(this._setCurrentResult(null),!1)}_startHoverOperationIfNecessary(e,t,i,s,o){this._computer.anchor&&this._computer.anchor.equals(e)||(this._hoverOperation.cancel(),this._computer.anchor=e,this._computer.shouldFocus=s,this._computer.source=i,this._computer.insistOnKeepingHoverVisible=o,this._hoverOperation.start(t))}_setCurrentResult(e){this._currentResult!==e&&(e&&e.messages.length===0&&(e=null),this._currentResult=e,this._currentResult?this._renderMessages(this._currentResult.anchor,this._currentResult.messages):this._widget.hide())}hide(){this._computer.anchor=null,this._hoverOperation.cancel(),this._setCurrentResult(null)}get isColorPickerVisible(){return this._widget.isColorPickerVisible}get isVisibleFromKeyboard(){return this._widget.isVisibleFromKeyboard}get isVisible(){return this._widget.isVisible}get isFocused(){return this._widget.isFocused}get isResizing(){return this._widget.isResizing}containsNode(e){return e?this._widget.getDomNode().contains(e):!1}_addLoadingMessage(e){if(this._computer.anchor){for(const t of this._participants)if(t.createLoadingMessage){const i=t.createLoadingMessage(this._computer.anchor);if(i)return e.slice(0).concat([i])}}return e}_withResult(e){this._widget.position&&this._currentResult&&this._currentResult.isComplete&&(!e.isComplete||this._computer.insistOnKeepingHoverVisible&&e.messages.length===0)||this._setCurrentResult(e)}_renderMessages(e,t){const{showAtPosition:i,showAtSecondaryPosition:s,highlightRange:o}=TC.computeHoverRanges(this._editor,e.range,t),r=new pe,a=r.add(new OR(this._keybindingService)),l=document.createDocumentFragment();let c=null;const d={fragment:l,statusBar:a,setColorPicker:h=>c=h,onContentsChanged:()=>this._widget.onContentsChanged(),setMinimumDimensions:h=>this._widget.setMinimumDimensions(h),hide:()=>this.hide()};for(const h of this._participants){const f=t.filter(g=>g.owner===h);f.length>0&&r.add(h.renderHoverParts(d,f))}const u=t.some(h=>h.isBeforeContent);if(a.hasContent&&l.appendChild(a.hoverElement),l.hasChildNodes()){if(o){const h=this._editor.createDecorationsCollection();h.set([{range:o,options:TC._DECORATION_OPTIONS}]),r.add(Ye(()=>{h.clear()}))}this._widget.showAt(l,new W4e(c,i,s,this._editor.getOption(60).above,this._computer.shouldFocus,this._computer.source,u,e.initialMousePosX,e.initialMousePosY,r))}else r.dispose()}static computeHoverRanges(e,t,i){let s=1;if(e.hasModel()){const c=e._getViewModel(),d=c.coordinatesConverter,u=d.convertModelRangeToViewRange(t),h=new V(u.startLineNumber,c.getLineMinColumn(u.startLineNumber));s=d.convertViewPositionToModelPosition(h).column}const o=t.startLineNumber;let r=t.startColumn,a=i[0].range,l=null;for(const c of i)a=N.plusRange(a,c.range),c.range.startLineNumber===o&&c.range.endLineNumber===o&&(r=Math.max(Math.min(r,c.range.startColumn),s)),c.forceShowAtRange&&(l=c.range);return{showAtPosition:l?l.getStartPosition():new V(o,t.startColumn),showAtSecondaryPosition:l?l.getStartPosition():new V(o,r),highlightRange:a}}focus(){this._widget.focus()}scrollUp(){this._widget.scrollUp()}scrollDown(){this._widget.scrollDown()}scrollLeft(){this._widget.scrollLeft()}scrollRight(){this._widget.scrollRight()}pageUp(){this._widget.pageUp()}pageDown(){this._widget.pageDown()}goToTop(){this._widget.goToTop()}goToBottom(){this._widget.goToBottom()}};Px._DECORATION_OPTIONS=Je.register({description:"content-hover-highlight",className:"hoverHighlight"});Px=TC=GP([Nh(1,vt),Nh(2,bi)],Px);class kY{constructor(e,t,i){this.anchor=e,this.messages=t,this.isComplete=i}filter(e){const t=this.messages.filter(i=>i.isValidForHoverAnchor(e));return t.length===this.messages.length?this:new B4e(this,this.anchor,t,this.isComplete)}}class B4e extends kY{constructor(e,t,i,s){super(t,i,s),this.original=e}filter(e){return this.original.filter(e)}}class W4e{constructor(e,t,i,s,o,r,a,l,c,d){this.colorPicker=e,this.showAtPosition=t,this.showAtSecondaryPosition=i,this.preferAbove=s,this.stoleFocus=o,this.source=r,this.isBeforeContent=a,this.initialMousePosX=l,this.initialMousePosY=c,this.disposables=d,this.closestMouseDistance=void 0}}const RB=30,yE=10,V4e=6;let Wd=va=class extends F4e{get isColorPickerVisible(){var e;return!!(!((e=this._visibleData)===null||e===void 0)&&e.colorPicker)}get isVisibleFromKeyboard(){var e;return((e=this._visibleData)===null||e===void 0?void 0:e.source)===1}get isVisible(){var e;return(e=this._hoverVisibleKey.get())!==null&&e!==void 0?e:!1}get isFocused(){var e;return(e=this._hoverFocusedKey.get())!==null&&e!==void 0?e:!1}constructor(e,t,i,s,o){const r=e.getOption(66)+8,a=150,l=new Jt(a,r);super(e,l),this._configurationService=i,this._accessibilityService=s,this._keybindingService=o,this._hover=this._register(new LY),this._minimumSize=l,this._hoverVisibleKey=$.hoverVisible.bindTo(t),this._hoverFocusedKey=$.hoverFocused.bindTo(t),le(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._register(this._editor.onDidLayoutChange(()=>this._layout())),this._register(this._editor.onDidChangeConfiguration(d=>{d.hasChanged(50)&&this._updateFont()}));const c=this._register(iu(this._resizableNode.domNode));this._register(c.onDidFocus(()=>{this._hoverFocusedKey.set(!0)})),this._register(c.onDidBlur(()=>{this._hoverFocusedKey.set(!1)})),this._setHoverData(void 0),this._layout(),this._editor.addContentWidget(this)}dispose(){var e;super.dispose(),(e=this._visibleData)===null||e===void 0||e.disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return va.ID}static _applyDimensions(e,t,i){const s=typeof t=="number"?`${t}px`:t,o=typeof i=="number"?`${i}px`:i;e.style.width=s,e.style.height=o}_setContentsDomNodeDimensions(e,t){const i=this._hover.contentsDomNode;return va._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){const i=this._hover.containerDomNode;return va._applyDimensions(i,e,t)}_setHoverWidgetDimensions(e,t){this._setContentsDomNodeDimensions(e,t),this._setContainerDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,i){const s=typeof t=="number"?`${t}px`:t,o=typeof i=="number"?`${i}px`:i;e.style.maxWidth=s,e.style.maxHeight=o}_setHoverWidgetMaxDimensions(e,t){va._applyMaxDimensions(this._hover.contentsDomNode,e,t),va._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth",typeof e=="number"?`${e}px`:e),this._layoutContentWidget()}_hasHorizontalScrollbar(){const e=this._hover.scrollbar.getScrollDimensions();return e.scrollWidth>e.width}_adjustContentsBottomPadding(){const e=this._hover.contentsDomNode,t=`${this._hover.scrollbar.options.horizontalScrollbarSize}px`;e.style.paddingBottom!==t&&(e.style.paddingBottom=t)}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions("none","none");const t=e.width,i=e.height;this._setHoverWidgetDimensions(t,i),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._setContentsDomNodeDimensions(t,i-yE))}_updateResizableNodeMaxDimensions(){var e,t;const i=(e=this._findMaximumRenderingWidth())!==null&&e!==void 0?e:1/0,s=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._resizableNode.maxSize=new Jt(i,s),this._setHoverWidgetMaxDimensions(i,s)}_resize(e){var t,i;va._lastDimensions=new Jt(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),(i=(t=this._visibleData)===null||t===void 0?void 0:t.colorPicker)===null||i===void 0||i.layout()}_findAvailableSpaceVertically(){var e;const t=(e=this._visibleData)===null||e===void 0?void 0:e.showAtPosition;if(t)return this._positionPreference===1?this._availableVerticalSpaceAbove(t):this._availableVerticalSpaceBelow(t)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let t=V4e;return Array.from(this._hover.contentsDomNode.children).forEach(i=>{t+=i.clientHeight}),this._hasHorizontalScrollbar()&&(t+=yE),Math.min(e,t)}_isHoverTextOverflowing(){this._hover.containerDomNode.style.setProperty("--vscode-hover-whiteSpace","nowrap"),this._hover.containerDomNode.style.setProperty("--vscode-hover-sourceWhiteSpace","nowrap");const e=Array.from(this._hover.contentsDomNode.children).some(t=>t.scrollWidth>t.clientWidth);return this._hover.containerDomNode.style.removeProperty("--vscode-hover-whiteSpace"),this._hover.containerDomNode.style.removeProperty("--vscode-hover-sourceWhiteSpace"),e}_findMaximumRenderingWidth(){if(!this._editor||!this._editor.hasModel())return;const e=this._isHoverTextOverflowing(),t=typeof this._contentWidth>"u"?0:this._contentWidth-2;return e||this._hover.containerDomNode.clientWidth"u"||typeof this._visibleData.initialMousePosY>"u")return this._visibleData.initialMousePosX=e,this._visibleData.initialMousePosY=t,!1;const i=Tn(this.getDomNode());typeof this._visibleData.closestMouseDistance>"u"&&(this._visibleData.closestMouseDistance=MB(this._visibleData.initialMousePosX,this._visibleData.initialMousePosY,i.left,i.top,i.width,i.height));const s=MB(e,t,i.left,i.top,i.width,i.height);return s>this._visibleData.closestMouseDistance+4?!1:(this._visibleData.closestMouseDistance=Math.min(this._visibleData.closestMouseDistance,s),!0)}_setHoverData(e){var t;(t=this._visibleData)===null||t===void 0||t.disposables.dispose(),this._visibleData=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle("hidden",!e)}_layout(){const{fontSize:e,lineHeight:t}=this._editor.getOption(50),i=this._hover.contentsDomNode;i.style.fontSize=`${e}px`,i.style.lineHeight=`${t/e}`,this._updateMaxDimensions()}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach(t=>this._editor.applyFontInfo(t))}_updateContent(e){const t=this._hover.contentsDomNode;t.style.paddingBottom="",t.textContent="",t.appendChild(e)}_layoutContentWidget(){this._editor.layoutContentWidget(this),this._hover.onContentsChanged()}_updateMaxDimensions(){const e=Math.max(this._editor.getLayoutInfo().height/4,250,va._lastDimensions.height),t=Math.max(this._editor.getLayoutInfo().width*.66,500,va._lastDimensions.width);this._setHoverWidgetMaxDimensions(t,e)}_render(e,t){this._setHoverData(t),this._updateFont(),this._updateContent(e),this._updateMaxDimensions(),this.onContentsChanged(),this._editor.render()}getPosition(){var e;return this._visibleData?{position:this._visibleData.showAtPosition,secondaryPosition:this._visibleData.showAtSecondaryPosition,positionAffinity:this._visibleData.isBeforeContent?3:void 0,preference:[(e=this._positionPreference)!==null&&e!==void 0?e:1]}:null}showAt(e,t){var i,s,o,r;if(!this._editor||!this._editor.hasModel())return;this._render(e,t);const a=Dh(this._hover.containerDomNode),l=t.showAtPosition;this._positionPreference=(i=this._findPositionPreference(a,l))!==null&&i!==void 0?i:1,this.onContentsChanged(),t.stoleFocus&&this._hover.containerDomNode.focus(),(s=t.colorPicker)===null||s===void 0||s.layout();const c=I4e(this._configurationService.getValue("accessibility.verbosity.hover")===!0&&this._accessibilityService.isScreenReaderOptimized(),(r=(o=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))===null||o===void 0?void 0:o.getAriaLabel())!==null&&r!==void 0?r:"");c&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+c)}hide(){if(!this._visibleData)return;const e=this._visibleData.stoleFocus||this._hoverFocusedKey.get();this._setHoverData(void 0),this._resizableNode.maxSize=new Jt(1/0,1/0),this._resizableNode.clearSashHoverState(),this._hoverFocusedKey.set(!1),this._editor.layoutContentWidget(this),e&&this._editor.focus()}_removeConstraintsRenderNormally(){const e=this._editor.getLayoutInfo();this._resizableNode.layout(e.height,e.width),this._setHoverWidgetDimensions("auto","auto")}_adjustHoverHeightForScrollbar(e){var t;const i=this._hover.containerDomNode,s=this._hover.contentsDomNode,o=(t=this._findMaximumRenderingHeight())!==null&&t!==void 0?t:1/0;this._setContainerDomNodeDimensions(ys(i),Math.min(o,e)),this._setContentsDomNodeDimensions(ys(s),Math.min(o,e-yE))}setMinimumDimensions(e){this._minimumSize=new Jt(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){const e=typeof this._contentWidth>"u"?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new Jt(e,this._minimumSize.height)}onContentsChanged(){var e;this._removeConstraintsRenderNormally();const t=this._hover.containerDomNode;let i=Dh(t),s=ys(t);if(this._resizableNode.layout(i,s),this._setHoverWidgetDimensions(s,i),i=Dh(t),s=ys(t),this._contentWidth=s,this._updateMinimumWidth(),this._resizableNode.layout(i,s),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._adjustHoverHeightForScrollbar(i)),!((e=this._visibleData)===null||e===void 0)&&e.showAtPosition){const o=Dh(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(o,this._visibleData.showAtPosition)}this._layoutContentWidget()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-RB})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+RB})}pageUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e-t})}pageDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._hover.scrollbar.getScrollDimensions().height;this._hover.scrollbar.setScrollPosition({scrollTop:e+t})}goToTop(){this._hover.scrollbar.setScrollPosition({scrollTop:0})}goToBottom(){this._hover.scrollbar.setScrollPosition({scrollTop:this._hover.scrollbar.getScrollDimensions().scrollHeight})}};Wd.ID="editor.contrib.resizableContentHoverWidget";Wd._lastDimensions=new Jt(0,0);Wd=va=GP([Nh(1,et),Nh(2,ii),Nh(3,Au),Nh(4,bi)],Wd);let OR=class extends Y{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=NB("div.hover-row.status-bar"),this.actionsElement=le(this.hoverElement,NB("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;return this._hasContent=!0,this._register(jP.render(this.actionsElement,e,i))}append(e){const t=le(this.actionsElement,e);return this._hasContent=!0,t}};OR=GP([Nh(0,bi)],OR);class Ox{get anchor(){return this._anchor}set anchor(e){this._anchor=e}get shouldFocus(){return this._shouldFocus}set shouldFocus(e){this._shouldFocus=e}get source(){return this._source}set source(e){this._source=e}get insistOnKeepingHoverVisible(){return this._insistOnKeepingHoverVisible}set insistOnKeepingHoverVisible(e){this._insistOnKeepingHoverVisible=e}constructor(e,t){this._editor=e,this._participants=t,this._anchor=null,this._shouldFocus=!1,this._source=0,this._insistOnKeepingHoverVisible=!1}static _getLineDecorations(e,t){if(t.type!==1&&!t.supportsMarkerHover)return[];const i=e.getModel(),s=t.range.startLineNumber;if(s>i.getLineCount())return[];const o=i.getLineMaxColumn(s);return e.getLineDecorations(s).filter(r=>{if(r.options.isWholeLine)return!0;const a=r.range.startLineNumber===s?r.range.startColumn:1,l=r.range.endLineNumber===s?r.range.endColumn:o;if(r.options.showIfCollapsed){if(a>t.range.startColumn+1||t.range.endColumn-1>l)return!1}else if(a>t.range.startColumn||t.range.endColumn>l)return!1;return!0})}computeAsync(e){const t=this._anchor;if(!this._editor.hasModel()||!t)return ln.EMPTY;const i=Ox._getLineDecorations(this._editor,t);return ln.merge(this._participants.map(s=>s.computeAsync?s.computeAsync(t,i,e):ln.EMPTY))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=Ox._getLineDecorations(this._editor,this._anchor);let t=[];for(const i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return RL(t)}}function MB(n,e,t,i,s,o){const r=t+s/2,a=i+o/2,l=Math.max(Math.abs(n-r)-s/2,0),c=Math.max(Math.abs(e-a)-o/2,0);return Math.sqrt(l*l+c*c)}const PB=ye;class Op extends Y{constructor(e,t,i){super(),this._renderDisposeables=this._register(new pe),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new LY),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new $v({editor:this._editor},t,i)),this._computer=new z4e(this._editor),this._hoverOperation=this._register(new DY(this._editor,this._computer)),this._register(this._hoverOperation.onResult(s=>{this._withResult(s.value)})),this._register(this._editor.onDidChangeModelDecorations(()=>this._onModelDecorationsChanged())),this._register(this._editor.onDidChangeConfiguration(s=>{s.hasChanged(50)&&this._updateFont()})),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return Op.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 s of t){const o=PB("div.hover-row.markdown-hover"),r=le(o,PB("div.hover-contents")),a=this._renderDisposeables.add(this._markdownRenderer.render(s.value));r.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),s=this._editor.getScrollTop(),o=this._editor.getOption(66),r=this._hover.containerDomNode.clientHeight,a=i-s-(r-o)/2;this._hover.containerDomNode.style.left=`${t.glyphMarginLeft+t.glyphMarginWidth}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(a),0)}px`}}Op.ID="editor.contrib.modesGlyphHoverWidget";class z4e{get lineNumber(){return this._lineNumber}set lineNumber(e){this._lineNumber=e}constructor(e){this._editor=e,this._lineNumber=-1}computeSync(){const e=s=>({value:s}),t=this._editor.getLineDecorations(this._lineNumber),i=[];if(!t)return i;for(const s of t){if(!s.options.glyphMarginClassName)continue;const o=s.options.glyphMarginHoverMessage;!o||Sv(o)||i.push(...Q$(o).map(e))}return i}}var H4e=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class $4e{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}function U4e(n,e,t,i,s){return H4e(this,void 0,void 0,function*(){try{const o=yield Promise.resolve(n.provideHover(t,i,s));if(o&&q4e(o))return new $4e(n,o,e)}catch(o){wc(o)}})}function EY(n,e,t,i){const o=n.ordered(e).map((r,a)=>U4e(r,a,e,t,i));return ln.fromPromises(o).coalesce()}function j4e(n,e,t,i){return EY(n,e,t,i).map(s=>s.hover).toPromise()}a0("_executeHoverProvider",(n,e,t)=>{const i=n.get(it);return j4e(i.hoverProvider,e,t,rn.None)});function q4e(n){const e=typeof n.range<"u",t=typeof n.contents<"u"&&n.contents&&n.contents.length>0;return e&&t}var G4e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},$w=function(n,e){return function(t,i){e(t,i,n)}};const OB=ye;class Y0{constructor(e,t,i,s,o){this.owner=e,this.range=t,this.contents=i,this.isBeforeContent=s,this.ordinal=o}isValidForHoverAnchor(e){return e.type===1&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let FR=class{constructor(e,t,i,s,o){this._editor=e,this._languageService=t,this._openerService=i,this._configurationService=s,this._languageFeaturesService=o,this.hoverOrdinal=3}createLoadingMessage(e){return new Y0(this,e.range,[new Fm().appendText(m("modesContentHover.loading","Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1)return[];const i=this._editor.getModel(),s=e.range.startLineNumber,o=i.getLineMaxColumn(s),r=[];let a=1e3;const l=i.getLineLength(s),c=i.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),d=this._editor.getOption(116),u=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:c});let h=!1;d>=0&&l>d&&e.range.startColumn>=d&&(h=!0,r.push(new Y0(this,e.range,[{value:m("stopped rendering","Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,a++))),!h&&typeof u=="number"&&l>=u&&r.push(new Y0(this,e.range,[{value:m("too many characters","Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],!1,a++));let f=!1;for(const g of t){const p=g.range.startLineNumber===s?g.range.startColumn:1,_=g.range.endLineNumber===s?g.range.endColumn:o,v=g.options.hoverMessage;if(!v||Sv(v))continue;g.options.beforeContentClassName&&(f=!0);const b=new N(e.range.startLineNumber,p,e.range.startLineNumber,_);r.push(new Y0(this,b,Q$(v),f,a++))}return r}computeAsync(e,t,i){if(!this._editor.hasModel()||e.type!==1)return ln.EMPTY;const s=this._editor.getModel();if(!this._languageFeaturesService.hoverProvider.has(s))return ln.EMPTY;const o=new V(e.range.startLineNumber,e.range.startColumn);return EY(this._languageFeaturesService.hoverProvider,s,o,i).filter(r=>!Sv(r.hover.contents)).map(r=>{const a=r.hover.range?N.lift(r.hover.range):e.range;return new Y0(this,a,r.hover.contents,!1,r.ordinal)})}renderHoverParts(e,t){return K4e(e,t,this._editor,this._languageService,this._openerService)}};FR=G4e([$w(1,Ni),$w(2,Dc),$w(3,ii),$w(4,it)],FR);function K4e(n,e,t,i,s){e.sort((r,a)=>r.ordinal-a.ordinal);const o=new pe;for(const r of e)for(const a of r.contents){if(Sv(a))continue;const l=OB("div.hover-row.markdown-hover"),c=le(l,OB("div.hover-contents")),d=o.add(new $v({editor:t},i,s));o.add(d.onDidRenderAsync(()=>{c.className="hover-contents code-hover-contents",n.onContentsChanged()}));const u=o.add(d.render(a));c.appendChild(u.element),n.fragment.appendChild(l)}return o}var Y4e=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class We{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+We.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new We(this.value+We.sep+e)}}We.sep=".";We.None=new We("@@none@@");We.Empty=new We("");We.QuickFix=new We("quickfix");We.Refactor=new We("refactor");We.RefactorExtract=We.Refactor.append("extract");We.RefactorInline=We.Refactor.append("inline");We.RefactorMove=We.Refactor.append("move");We.RefactorRewrite=We.Refactor.append("rewrite");We.Notebook=new We("notebook");We.Source=new We("source");We.SourceOrganizeImports=We.Source.append("organizeImports");We.SourceFixAll=We.Source.append("fixAll");We.SurroundWith=We.Refactor.append("surround");var cu;(function(n){n.Refactor="refactor",n.RefactorPreview="refactor preview",n.Lightbulb="lightbulb",n.Default="other (default)",n.SourceAction="source action",n.QuickFix="quick fix action",n.FixAll="fix all",n.OrganizeImports="organize imports",n.AutoFix="auto fix",n.QuickFixHover="quick fix hover window",n.OnSave="save participants",n.ProblemsView="problems view"})(cu||(cu={}));function Z4e(n,e){return!(n.include&&!n.include.intersects(e)||n.excludes&&n.excludes.some(t=>AY(e,t,n.include))||!n.includeSourceActions&&We.Source.contains(e))}function X4e(n,e){const t=e.kind?new We(e.kind):void 0;return!(n.include&&(!t||!n.include.contains(t))||n.excludes&&t&&n.excludes.some(i=>AY(t,i,n.include))||!n.includeSourceActions&&t&&We.Source.contains(t)||n.onlyIncludePreferredActions&&!e.isPreferred)}function AY(n,e,t){return!(!e.contains(n)||t&&e.contains(t))}class bh{static fromUser(e,t){return!e||typeof e!="object"?new bh(t.kind,t.apply,!1):new bh(bh.getKindFromUser(e,t.kind),bh.getApplyFromUser(e,t.apply),bh.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 We(e.kind):t}static getPreferredUser(e){return typeof e.preferred=="boolean"?e.preferred:!1}constructor(e,t,i){this.kind=e,this.apply=t,this.preferred=i}}class Q4e{constructor(e,t,i){this.action=e,this.provider=t,this.highlightRange=i}resolve(e){var t;return Y4e(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(s){wc(s)}i&&(this.action.edit=i.edit)}return this})}}var Fx=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const J4e="editor.action.codeAction",IY="editor.action.quickFix",e3e="editor.action.autoFix",t3e="editor.action.refactor",i3e="editor.action.sourceAction",TY="editor.action.organizeImports",NY="editor.action.fixAll";class sb extends Y{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return oc(e.diagnostics)?oc(t.diagnostics)?sb.codeActionsPreferredComparator(e,t):-1:oc(t.diagnostics)?1:sb.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(sb.codeActionsComparator),this.validActions=this.allActions.filter(({action:s})=>!s.disabled)}get hasAutoFix(){return this.validActions.some(({action:e})=>!!e.kind&&We.QuickFix.contains(new We(e.kind))&&!!e.isPreferred)}}const FB={actions:[],documentation:void 0};function ob(n,e,t,i,s,o){var r;return Fx(this,void 0,void 0,function*(){const a=i.filter||{},l=Object.assign(Object.assign({},a),{excludes:[...a.excludes||[],We.Notebook]}),c={only:(r=a.include)===null||r===void 0?void 0:r.value,trigger:i.type},d=new uNe(e,o),u=i.type===2,h=n3e(n,e,u?l:a),f=new pe,g=h.map(_=>Fx(this,void 0,void 0,function*(){try{s.report(_);const v=yield _.provideCodeActions(e,t,c,d.token);if(v&&f.add(v),d.token.isCancellationRequested)return FB;const b=((v==null?void 0:v.actions)||[]).filter(w=>w&&X4e(a,w)),y=o3e(_,b,a.include);return{actions:b.map(w=>new Q4e(w,_)),documentation:y}}catch(v){if(zf(v))throw v;return wc(v),FB}})),p=n.onDidChange(()=>{const _=n.all(e);Yi(_,h)||d.cancel()});try{const _=yield Promise.all(g),v=_.map(y=>y.actions).flat(),b=[...RL(_.map(y=>y.documentation)),...s3e(n,e,i,v)];return new sb(v,b,f)}finally{p.dispose(),d.dispose()}})}function n3e(n,e,t){return n.all(e).filter(i=>i.providedCodeActionKinds?i.providedCodeActionKinds.some(s=>Z4e(t,new We(s))):!0)}function*s3e(n,e,t,i){var s,o,r;if(e&&i.length)for(const a of n.all(e))a._getAdditionalMenuItems&&(yield*(s=a._getAdditionalMenuItems)===null||s===void 0?void 0:s.call(a,{trigger:t.type,only:(r=(o=t.filter)===null||o===void 0?void 0:o.include)===null||r===void 0?void 0:r.value},i.map(l=>l.action)))}function o3e(n,e,t){if(!n.documentation)return;const i=n.documentation.map(s=>({kind:new We(s.kind),command:s.command}));if(t){let s;for(const o of i)o.kind.contains(t)&&(s?s.kind.contains(o.kind)&&(s=o):s=o);if(s)return s==null?void 0:s.command}for(const s of e)if(s.kind){for(const o of i)if(o.kind.contains(new We(s.kind)))return o.command}}var Bx;(function(n){n.OnSave="onSave",n.FromProblemsView="fromProblemsView",n.FromCodeActions="fromCodeActions"})(Bx||(Bx={}));function r3e(n,e,t,i,s=rn.None){var o;return Fx(this,void 0,void 0,function*(){const r=n.get(uG),a=n.get(fs),l=n.get(Cc),c=n.get(xn);if(l.publicLog2("codeAction.applyCodeAction",{codeActionTitle:e.action.title,codeActionKind:e.action.kind,codeActionIsPreferred:!!e.action.isPreferred,reason:t}),yield e.resolve(s),!s.isCancellationRequested&&!(!((o=e.action.edit)===null||o===void 0)&&o.edits.length&&!(yield r.apply(e.action.edit,{editor:i==null?void 0:i.editor,label:e.action.title,quotableLabel:e.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:t!==Bx.OnSave,showPreview:i==null?void 0:i.preview})).isApplied)&&e.action.command)try{yield a.executeCommand(e.action.command.id,...e.action.command.arguments||[])}catch(d){const u=a3e(d);c.error(typeof u=="string"?u:m("applyCodeActionFailed","An unknown error occurred while applying the code action"))}})}function a3e(n){return typeof n=="string"?n:n instanceof Error&&typeof n.message=="string"?n.message:void 0}Yt.registerCommand("_executeCodeActionProvider",function(n,e,t,i,s){return Fx(this,void 0,void 0,function*(){if(!(e instanceof Ue))throw rc();const{codeActionProvider:o}=n.get(it),r=n.get(hs).getModel(e);if(!r)throw rc();const a=lt.isISelection(t)?lt.liftSelection(t):N.isIRange(t)?r.validateRange(t):void 0;if(!a)throw rc();const l=typeof i=="string"?new We(i):void 0,c=yield ob(o,r,a,{type:1,triggerAction:cu.Default,filter:{includeSourceActions:!0,include:l}},Ap.None,rn.None),d=[],u=Math.min(c.validActions.length,typeof s=="number"?s:0);for(let h=0;hh.action)}finally{setTimeout(()=>c.dispose(),100)}})});var l3e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},c3e=function(n,e){return function(t,i){e(t,i,n)}},BR;let Wx=BR=class{constructor(e){this.keybindingService=e}getResolver(){const e=new Hf(()=>this.keybindingService.getKeybindings().filter(t=>BR.codeActionCommands.indexOf(t.command)>=0).filter(t=>t.resolvedKeybinding).map(t=>{let i=t.commandArgs;return t.command===TY?i={kind:We.SourceOrganizeImports.value}:t.command===NY&&(i={kind:We.SourceFixAll.value}),Object.assign({resolvedKeybinding:t.resolvedKeybinding},bh.fromUser(i,{kind:We.None,apply:"never"}))}));return t=>{if(t.kind){const i=this.bestKeybindingForCodeAction(t,e.value);return i==null?void 0:i.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new We(e.kind);return t.filter(s=>s.kind.contains(i)).filter(s=>s.preferred?e.isPreferred:!0).reduceRight((s,o)=>s?s.kind.contains(o.kind)?o:s:o,void 0)}};Wx.codeActionCommands=[t3e,J4e,i3e,TY,NY];Wx=BR=l3e([c3e(0,bi)],Wx);E("symbolIcon.arrayForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.arrayForeground","The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.booleanForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.booleanForeground","The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},m("symbolIcon.classForeground","The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.colorForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.colorForeground","The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.constantForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.constantForeground","The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},m("symbolIcon.constructorForeground","The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},m("symbolIcon.enumeratorForeground","The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},m("symbolIcon.enumeratorMemberForeground","The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},m("symbolIcon.eventForeground","The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},m("symbolIcon.fieldForeground","The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.fileForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.fileForeground","The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.folderForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.folderForeground","The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},m("symbolIcon.functionForeground","The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},m("symbolIcon.interfaceForeground","The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.keyForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.keyForeground","The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.keywordForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.keywordForeground","The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},m("symbolIcon.methodForeground","The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.moduleForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.moduleForeground","The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.namespaceForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.namespaceForeground","The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.nullForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.nullForeground","The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.numberForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.numberForeground","The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.objectForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.objectForeground","The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.operatorForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.operatorForeground","The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.packageForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.packageForeground","The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.propertyForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.propertyForeground","The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.referenceForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.referenceForeground","The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.snippetForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.snippetForeground","The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.stringForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.stringForeground","The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.structForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.structForeground","The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.textForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.textForeground","The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.typeParameterForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.typeParameterForeground","The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.unitForeground",{dark:ee,light:ee,hcDark:ee,hcLight:ee},m("symbolIcon.unitForeground","The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));E("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},m("symbolIcon.variableForeground","The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));const RY=Object.freeze({kind:We.Empty,title:m("codeAction.widget.id.more","More Actions...")}),d3e=Object.freeze([{kind:We.QuickFix,title:m("codeAction.widget.id.quickfix","Quick Fix")},{kind:We.RefactorExtract,title:m("codeAction.widget.id.extract","Extract"),icon:se.wrench},{kind:We.RefactorInline,title:m("codeAction.widget.id.inline","Inline"),icon:se.wrench},{kind:We.RefactorRewrite,title:m("codeAction.widget.id.convert","Rewrite"),icon:se.wrench},{kind:We.RefactorMove,title:m("codeAction.widget.id.move","Move"),icon:se.wrench},{kind:We.SurroundWith,title:m("codeAction.widget.id.surround","Surround With"),icon:se.symbolSnippet},{kind:We.Source,title:m("codeAction.widget.id.source","Source Action"),icon:se.symbolFile},RY]);function u3e(n,e,t){if(!e)return n.map(o=>{var r;return{kind:"action",item:o,group:RY,disabled:!!o.action.disabled,label:o.action.disabled||o.action.title,canPreview:!!(!((r=o.action.edit)===null||r===void 0)&&r.edits.length)}});const i=d3e.map(o=>({group:o,actions:[]}));for(const o of n){const r=o.action.kind?new We(o.action.kind):We.None;for(const a of i)if(a.group.kind.contains(r)){a.actions.push(o);break}}const s=[];for(const o of i)if(o.actions.length){s.push({kind:"header",group:o.group});for(const r of o.actions)s.push({kind:"action",item:r,group:o.group,label:r.action.title,disabled:!!r.action.disabled,keybinding:t(r.action)})}return s}var h3e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},f3e=function(n,e){return function(t,i){e(t,i,n)}},WR,ap;(function(n){n.Hidden={type:0};class e{constructor(i,s,o,r){this.actions=i,this.trigger=s,this.editorPosition=o,this.widgetPosition=r,this.type=1}}n.Showing=e})(ap||(ap={}));let Uv=WR=class extends Y{constructor(e,t){super(),this._editor=e,this._onClick=this._register(new B),this.onClick=this._onClick.event,this._state=ap.Hidden,this._domNode=ye("div.lightBulbWidget"),this._register(Rt.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent(i=>{const s=this._editor.getModel();(this.state.type!==1||!s||this.state.editorPosition.lineNumber>=s.getLineCount())&&this.hide()})),this._register(kme(this._domNode,i=>{if(this.state.type!==1)return;this._editor.focus(),i.preventDefault();const{top:s,height:o}=Tn(this._domNode),r=this._editor.getOption(66);let a=Math.floor(r/3);this.state.widgetPosition.position!==null&&this.state.widgetPosition.position.lineNumber{(i.buttons&1)===1&&this.hide()})),this._register(this._editor.onDidChangeConfiguration(i=>{i.hasChanged(64)&&!this._editor.getOption(64).enabled&&this.hide()})),this._register(ue.runAndSubscribe(t.onDidUpdateKeybindings,()=>{var i,s,o,r;this._preferredKbLabel=(s=(i=t.lookupKeybinding(e3e))===null||i===void 0?void 0:i.getLabel())!==null&&s!==void 0?s:void 0,this._quickFixKbLabel=(r=(o=t.lookupKeybinding(IY))===null||o===void 0?void 0:o.getLabel())!==null&&r!==void 0?r:void 0,this._updateLightBulbTitleAndIcon()}))}dispose(){super.dispose(),this._editor.removeContentWidget(this)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return this._state.type===1?this._state.widgetPosition:null}update(e,t,i){if(e.validActions.length<=0)return this.hide();const s=this._editor.getOptions();if(!s.get(64).enabled)return this.hide();const o=this._editor.getModel();if(!o)return this.hide();const{lineNumber:r,column:a}=o.validatePosition(i),l=o.getOptions().tabSize,c=s.get(50),d=o.getLineContent(r),u=mD(d,l),h=c.spaceWidth*u>22,f=p=>p>2&&this._editor.getTopForLineNumber(p)===this._editor.getTopForLineNumber(p-1);let g=r;if(!h){if(r>1&&!f(r-1))g-=1;else if(!f(r+1))g+=1;else if(a*c.spaceWidth<22)return this.hide()}this.state=new ap.Showing(e,t,i,{position:{lineNumber:g,column:1},preference:WR._posPref}),this._editor.layoutContentWidget(this)}hide(){this.state!==ap.Hidden&&(this.state=ap.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(...Te.asClassNameArray(se.lightBulb)),this._domNode.classList.add(...Te.asClassNameArray(se.lightbulbAutofix)),this._preferredKbLabel)){this.title=m("preferredcodeActionWithKb","Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel);return}this._domNode.classList.remove(...Te.asClassNameArray(se.lightbulbAutofix)),this._domNode.classList.add(...Te.asClassNameArray(se.lightBulb)),this._quickFixKbLabel?this.title=m("codeActionWithKb","Show Code Actions ({0})",this._quickFixKbLabel):this.title=m("codeAction","Show Code Actions")}set title(e){this._domNode.title=e}};Uv.ID="editor.contrib.lightbulbWidget";Uv._posPref=[0];Uv=WR=h3e([f3e(1,bi)],Uv);var MY=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},VR=function(n,e){return function(t,i){e(t,i,n)}},g3e=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const PY="acceptSelectedCodeAction",OY="previewSelectedCodeAction";class p3e{get templateId(){return"header"}renderTemplate(e){e.classList.add("group-header");const t=document.createElement("span");return e.append(t),{container:e,text:t}}renderElement(e,t,i){var s,o;i.text.textContent=(o=(s=e.group)===null||s===void 0?void 0:s.title)!==null&&o!==void 0?o:""}disposeTemplate(e){}}let zR=class{get templateId(){return"action"}constructor(e,t){this._supportsPreview=e,this._keybindingService=t}renderTemplate(e){e.classList.add(this.templateId);const t=document.createElement("div");t.className="icon",e.append(t);const i=document.createElement("span");i.className="title",e.append(i);const s=new uy(e,bo);return{container:e,icon:t,text:i,keybinding:s}}renderElement(e,t,i){var s,o,r;if(!((s=e.group)===null||s===void 0)&&s.icon?(i.icon.className=Te.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=re(e.group.icon.color.id))):(i.icon.className=Te.asClassName(se.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;i.text.textContent=FY(e.label),i.keybinding.set(e.keybinding),Bme(!!e.keybinding,i.keybinding.element);const a=(o=this._keybindingService.lookupKeybinding(PY))===null||o===void 0?void 0:o.getLabel(),l=(r=this._keybindingService.lookupKeybinding(OY))===null||r===void 0?void 0:r.getLabel();i.container.classList.toggle("option-disabled",e.disabled),e.disabled?i.container.title=e.label:a&&l?this._supportsPreview&&e.canPreview?i.container.title=m({key:"label-preview",comment:['placeholders are keybindings, e.g "F2 to apply, Shift+F2 to preview"']},"{0} to apply, {1} to preview",a,l):i.container.title=m({key:"label",comment:['placeholder is a keybinding, e.g "F2 to apply"']},"{0} to apply",a):i.container.title=""}disposeTemplate(e){}};zR=MY([VR(1,bi)],zR);class m3e extends UIEvent{constructor(){super("acceptSelectedAction")}}class BB extends UIEvent{constructor(){super("previewSelectedAction")}}function _3e(n){if(n.kind==="action")return n.label}let HR=class extends Y{constructor(e,t,i,s,o,r){super(),this._delegate=s,this._contextViewService=o,this._keybindingService=r,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new Ar),this.domNode=document.createElement("div"),this.domNode.classList.add("actionList");const a={getHeight:l=>l.kind==="header"?this._headerLineHeight:this._actionLineHeight,getTemplateId:l=>l.kind};this._list=this._register(new ha(e,this.domNode,a,[new zR(t,this._keybindingService),new p3e],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:_3e},accessibilityProvider:{getAriaLabel:l=>{if(l.kind==="action"){let c=l.label?FY(l==null?void 0:l.label):"";return l.disabled&&(c=m({key:"customQuickFixWidget.labels",comment:["Action widget labels for accessibility."]},"{0}, Disabled Reason: {1}",c,l.disabled)),c}return null},getWidgetAriaLabel:()=>m({key:"customQuickFixWidget",comment:["An action widget option"]},"Action Widget"),getRole:l=>l.kind==="action"?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(ig),this._register(this._list.onMouseClick(l=>this.onListClick(l))),this._register(this._list.onMouseOver(l=>this.onListHover(l))),this._register(this._list.onDidChangeFocus(()=>this.onFocus())),this._register(this._list.onDidChangeSelection(l=>this.onListSelection(l))),this._allMenuItems=i,this._list.splice(0,this._list.length,this._allMenuItems),this._list.length&&this.focusNext()}focusCondition(e){return!e.disabled&&e.kind==="action"}hide(e){this._delegate.onHide(e),this.cts.cancel(),this._contextViewService.hideContextView()}layout(e){const t=this._allMenuItems.filter(c=>c.kind==="header").length,s=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight;this._list.layout(s);const o=this._allMenuItems.map((c,d)=>{const u=document.getElementById(this._list.getElementID(d));if(u){u.style.width="auto";const h=u.getBoundingClientRect().width;return u.style.width="",h}return 0}),r=Math.max(...o,e),l=Math.min(s,document.body.clientHeight*.7);return this._list.layout(l,r),this.domNode.style.height=`${l}px`,this._list.domFocus(),r}focusPrevious(){this._list.focusPrevious(1,!0,void 0,this.focusCondition)}focusNext(){this._list.focusNext(1,!0,void 0,this.focusCondition)}acceptSelected(e){const t=this._list.getFocus();if(t.length===0)return;const i=t[0],s=this._list.element(i);if(!this.focusCondition(s))return;const o=e?new BB:new m3e;this._list.setSelection([i],o)}onListSelection(e){if(!e.elements.length)return;const t=e.elements[0];t.item&&this.focusCondition(t)?this._delegate.onSelect(t.item,e.browserEvent instanceof BB):this._list.setSelection([])}onFocus(){var e,t;this._list.domFocus();const i=this._list.getFocus();if(i.length===0)return;const s=i[0],o=this._list.element(s);(t=(e=this._delegate).onFocus)===null||t===void 0||t.call(e,o.item)}onListHover(e){return g3e(this,void 0,void 0,function*(){const t=e.element;if(t&&t.item&&this.focusCondition(t)){if(this._delegate.onHover&&!t.disabled&&t.kind==="action"){const i=yield this._delegate.onHover(t.item,this.cts.token);t.canPreview=i?i.canPreview:void 0}e.index&&this._list.splice(e.index,1,[t])}this._list.setFocus(typeof e.index=="number"?[e.index]:[])})}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}};HR=MY([VR(4,Tu),VR(5,bi)],HR);function FY(n){return n.replace(/\r\n|\r|\n/g," ")}var b3e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},wE=function(n,e){return function(t,i){e(t,i,n)}};E("actionBar.toggledBackground",{dark:kh,light:kh,hcDark:kh,hcLight:kh},m("actionBar.toggledBackground","Background color for toggled action items in action bar."));const Mf={Visible:new _e("codeActionMenuVisible",!1,m("codeActionMenuVisible","Whether the action widget list is visible"))},lg=rt("actionWidgetService");let Pf=class extends Y{get isVisible(){return Mf.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new sa)}show(e,t,i,s,o,r,a){const l=Mf.Visible.bindTo(this._contextKeyService),c=this._instantiationService.createInstance(HR,e,t,i,s);this._contextViewService.showContextView({getAnchor:()=>o,render:d=>(l.set(!0),this._renderWidget(d,c,a??[])),onHide:d=>{l.reset(),this._onWidgetClosed(d)}},r,!1)}acceptSelected(e){var t;(t=this._list.value)===null||t===void 0||t.acceptSelected(e)}focusPrevious(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusPrevious()}focusNext(){var e,t;(t=(e=this._list)===null||e===void 0?void 0:e.value)===null||t===void 0||t.focusNext()}hide(){var e;(e=this._list.value)===null||e===void 0||e.hide(),this._list.clear()}_renderWidget(e,t,i){var s;const o=document.createElement("div");if(o.classList.add("action-widget"),e.appendChild(o),this._list.value=t,this._list.value)o.appendChild(this._list.value.domNode);else throw new Error("List has no value");const r=new pe,a=document.createElement("div"),l=e.appendChild(a);l.classList.add("context-view-block"),r.add(K(l,de.MOUSE_DOWN,g=>g.stopPropagation()));const c=document.createElement("div"),d=e.appendChild(c);d.classList.add("context-view-pointerBlock"),r.add(K(d,de.POINTER_MOVE,()=>d.remove())),r.add(K(d,de.MOUSE_DOWN,()=>d.remove()));let u=0;if(i.length){const g=this._createActionBar(".action-widget-action-bar",i);g&&(o.appendChild(g.getContainer().parentElement),r.add(g),u=g.getContainer().offsetWidth)}const h=(s=this._list.value)===null||s===void 0?void 0:s.layout(u);o.style.width=`${h}px`;const f=r.add(iu(e));return r.add(f.onDidBlur(()=>this.hide())),r}_createActionBar(e,t){if(!t.length)return;const i=ye(e),s=new al(i);return s.push(t,{icon:!1,label:!0}),s}_onWidgetClosed(e){var t;(t=this._list.value)===null||t===void 0||t.hide(e)}};Pf=b3e([wE(0,Tu),wE(1,et),wE(2,vt)],Pf);ft(lg,Pf,1);const yy=1100;Bs(class extends r0{constructor(){super({id:"hideCodeActionWidget",title:{value:m("hideCodeActionWidget.title","Hide action widget"),original:"Hide action widget"},precondition:Mf.Visible,keybinding:{weight:yy,primary:9,secondary:[1033]}})}run(n){n.get(lg).hide()}});Bs(class extends r0{constructor(){super({id:"selectPrevCodeAction",title:{value:m("selectPrevCodeAction.title","Select previous action"),original:"Select previous action"},precondition:Mf.Visible,keybinding:{weight:yy,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(n){const e=n.get(lg);e instanceof Pf&&e.focusPrevious()}});Bs(class extends r0{constructor(){super({id:"selectNextCodeAction",title:{value:m("selectNextCodeAction.title","Select next action"),original:"Select next action"},precondition:Mf.Visible,keybinding:{weight:yy,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(n){const e=n.get(lg);e instanceof Pf&&e.focusNext()}});Bs(class extends r0{constructor(){super({id:PY,title:{value:m("acceptSelected.title","Accept selected action"),original:"Accept selected action"},precondition:Mf.Visible,keybinding:{weight:yy,primary:3,secondary:[2137]}})}run(n){const e=n.get(lg);e instanceof Pf&&e.acceptSelected()}});Bs(class extends r0{constructor(){super({id:OY,title:{value:m("previewSelected.title","Preview selected action"),original:"Preview selected action"},precondition:Mf.Visible,keybinding:{weight:yy,primary:2051}})}run(n){const e=n.get(lg);e instanceof Pf&&e.acceptSelected(!0)}});var v3e=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};const y3e=new _e("supportedCodeAction","");class w3e extends Y{constructor(e,t,i,s=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=s,this._autoTriggerTimer=this._register(new Lc),this._register(this._markerService.onMarkerChanged(o=>this._onMarkerChanges(o))),this._register(this._editor.onDidChangeCursorPosition(()=>this._tryAutoTrigger()))}trigger(e){const t=this._getRangeOfSelectionUnlessWhitespaceEnclosed(e);this._signalChange(t?{trigger:e,selection:t}:void 0)}_onMarkerChanges(e){const t=this._editor.getModel();t&&e.some(i=>A3(i,t.uri))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet(()=>{this.trigger({type:2,triggerAction:cu.Default})},this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=this._editor.getSelection();if(i.isEmpty()&&e.type===2){const{lineNumber:s,column:o}=i.getPosition(),r=t.getLineContent(s);if(r.length===0)return;if(o===1){if(/\s/.test(r[0]))return}else if(o===t.getLineMaxColumn(s)){if(/\s/.test(r[r.length-1]))return}else if(/\s/.test(r[o-2])&&/\s/.test(r[o-1]))return}return i}}var vh;(function(n){n.Empty={type:0};class e{constructor(i,s,o){this.trigger=i,this.position=s,this._cancellablePromise=o,this.type=1,this.actions=o.catch(r=>{if(zf(r))return BY;throw r})}cancel(){this._cancellablePromise.cancel()}}n.Triggered=e})(vh||(vh={}));const BY=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1});class C3e extends Y{constructor(e,t,i,s,o,r){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=o,this._configurationService=r,this._codeActionOracle=this._register(new sa),this._state=vh.Empty,this._onDidChangeState=this._register(new B),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=y3e.bindTo(s),this._register(this._editor.onDidChangeModel(()=>this._update())),this._register(this._editor.onDidChangeModelLanguage(()=>this._update())),this._register(this._registry.onDidChange(()=>this._update())),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(vh.Empty,!0))}_settingEnabledNearbyQuickfixes(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService?this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickfixes",{resource:t==null?void 0:t.uri}):!1}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(vh.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(90)){const t=this._registry.all(e).flatMap(i=>{var s;return(s=i.providedCodeActionKinds)!==null&&s!==void 0?s:[]});this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new w3e(this._editor,this._markerService,i=>{var s;if(!i){this.setState(vh.Empty);return}const o=i.selection.getStartPosition(),r=xc(a=>v3e(this,void 0,void 0,function*(){var l,c,d,u,h,f;if(this._settingEnabledNearbyQuickfixes()&&i.trigger.type===1&&(i.trigger.triggerAction===cu.QuickFix||!((c=(l=i.trigger.filter)===null||l===void 0?void 0:l.include)===null||c===void 0)&&c.contains(We.QuickFix))){const g=yield ob(this._registry,e,i.selection,i.trigger,Ap.None,a);if(a.isCancellationRequested)return BY;if(!((d=g.validActions)===null||d===void 0?void 0:d.some(_=>_.action.kind?We.QuickFix.contains(new We(_.action.kind)):!1))){const _=this._markerService.read({resource:e.uri});if(_.length>0){const v=i.selection.getPosition();let b=v,y=Number.MAX_VALUE,w=!1;for(const S of _){const L=S.endColumn,x=S.endLineNumber,D=S.startLineNumber;(x===v.lineNumber||D===v.lineNumber)&&Math.abs(v.column-L){k.highlightRange=k.action.isPreferred}),D.push(...x.validActions)),{validActions:D,allActions:g.allActions,documentation:g.documentation,hasAutoFix:g.hasAutoFix,dispose:()=>{g.dispose()}}}}}}return ob(this._registry,e,i.selection,i.trigger,Ap.None,a)}));i.trigger.type===1&&((s=this._progressService)===null||s===void 0||s.showWhile(r,250)),this.setState(new vh.Triggered(i.trigger,o,r))},void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:cu.Default})}else this._supportedCodeActions.reset()}trigger(e){var t;(t=this._codeActionOracle.value)===null||t===void 0||t.trigger(e)}setState(e,t){e!==this._state&&(this._state.type===1&&this._state.cancel(),this._state=e,!t&&!this._disposed&&this._onDidChangeState.fire(e))}}var S3e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Dl=function(n,e){return function(t,i){e(t,i,n)}},Z0=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},NC;const x3e="quickfix-edit-highlight";let jv=NC=class extends Y{static get(e){return e.getContribution(NC.ID)}constructor(e,t,i,s,o,r,a,l,c,d){super(),this._commandService=a,this._configurationService=l,this._actionWidgetService=c,this._instantiationService=d,this._activeCodeActions=this._register(new sa),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new C3e(this._editor,o.codeActionProvider,t,i,r,l)),this._register(this._model.onDidChangeState(u=>this.update(u))),this._lightBulbWidget=new Hf(()=>{const u=this._editor.getContribution(Uv.ID);return u&&this._register(u.onClick(h=>this.showCodeActionList(h.actions,h,{includeDisabledActions:!1,fromLightbulb:!0}))),u}),this._resolver=s.createInstance(Wx),this._register(this._editor.onDidLayoutChange(()=>this._actionWidgetService.hide()))}dispose(){this._disposed=!0,super.dispose()}showCodeActions(e,t,i){return this.showCodeActionList(t,i,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,i,s){var o;if(!this._editor.hasModel())return;(o=vr.get(this._editor))===null||o===void 0||o.closeMessage();const r=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:i,autoApply:s,context:{notAvailableMessage:e,position:r}})}_trigger(e){return this._model.trigger(e)}_applyCodeAction(e,t,i){return Z0(this,void 0,void 0,function*(){try{yield this._instantiationService.invokeFunction(r3e,e,Bx.FromCodeActions,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:cu.QuickFix,filter:{}})}})}update(e){var t,i,s,o,r,a,l;return Z0(this,void 0,void 0,function*(){if(e.type!==1){(t=this._lightBulbWidget.rawValue)===null||t===void 0||t.hide();return}let c;try{c=yield e.actions}catch(d){mt(d);return}if(!this._disposed)if((i=this._lightBulbWidget.value)===null||i===void 0||i.update(c,e.trigger,e.position),e.trigger.type===1){if(!((s=e.trigger.filter)===null||s===void 0)&&s.include){const u=this.tryGetValidActionToApply(e.trigger,c);if(u){try{(o=this._lightBulbWidget.value)===null||o===void 0||o.hide(),yield this._applyCodeAction(u,!1,!1)}finally{c.dispose()}return}if(e.trigger.context){const h=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,c);if(h&&h.action.disabled){(r=vr.get(this._editor))===null||r===void 0||r.showMessage(h.action.disabled,e.trigger.context.position),c.dispose();return}}}const d=!!(!((a=e.trigger.filter)===null||a===void 0)&&a.include);if(e.trigger.context&&(!c.allActions.length||!d&&!c.validActions.length)){(l=vr.get(this._editor))===null||l===void 0||l.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=c,c.dispose();return}this._activeCodeActions.value=c,this.showCodeActionList(c,this.toCoords(e.position),{includeDisabledActions:d,fromLightbulb:!1})}else this._actionWidgetService.isVisible?c.dispose():this._activeCodeActions.value=c})}getInvalidActionThatWouldHaveBeenApplied(e,t){if(t.allActions.length&&(e.autoApply==="first"&&t.validActions.length===0||e.autoApply==="ifSingle"&&t.allActions.length===1))return t.allActions.find(({action: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){return Z0(this,void 0,void 0,function*(){const s=this._editor.createDecorationsCollection(),o=this._editor.getDomNode();if(!o)return;const r=i.includeDisabledActions&&(this._showDisabled||e.validActions.length===0)?e.allActions:e.validActions;if(!r.length)return;const a=V.isIPosition(t)?this.toCoords(t):t,l={onSelect:(c,d)=>Z0(this,void 0,void 0,function*(){this._applyCodeAction(c,!0,!!d),this._actionWidgetService.hide(),s.clear()}),onHide:()=>{var c;(c=this._editor)===null||c===void 0||c.focus(),s.clear()},onHover:(c,d)=>Z0(this,void 0,void 0,function*(){var u;if(yield c.resolve(d),!d.isCancellationRequested)return{canPreview:!!(!((u=c.action.edit)===null||u===void 0)&&u.edits.length)}}),onFocus:c=>{var d,u;if(c&&c.highlightRange&&c.action.diagnostics){const h=[{range:c.action.diagnostics[0],options:NC.DECORATION}];s.set(h);const f=c.action.diagnostics[0],g=(u=(d=this._editor.getModel())===null||d===void 0?void 0:d.getWordAtPosition({lineNumber:f.startLineNumber,column:f.startColumn}))===null||u===void 0?void 0:u.word;nv(m("editingNewSelection","Context: {0} at line {1} and column {2}.",g,f.startLineNumber,f.startColumn))}else s.clear()}};this._actionWidgetService.show("codeActionWidget",!0,u3e(r,this._shouldShowHeaders(),this._resolver.getResolver()),l,a,o,this._getActionBarActions(e,t,i))})}toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,1),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),i=Tn(this._editor.getDomNode()),s=i.left+t.left,o=i.top+t.top+t.height;return{x:s,y:o}}_shouldShowHeaders(){var e;const t=(e=this._editor)===null||e===void 0?void 0:e.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:t==null?void 0:t.uri})}_getActionBarActions(e,t,i){if(i.fromLightbulb)return[];const s=e.documentation.map(o=>{var r;return{id:o.id,label:o.title,tooltip:(r=o.tooltip)!==null&&r!==void 0?r:"",class:void 0,enabled:!0,run:()=>{var a;return this._commandService.executeCommand(o.id,...(a=o.arguments)!==null&&a!==void 0?a:[])}}});return i.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&s.push(this._showDisabled?{id:"hideMoreActions",label:m("hideMoreActions","Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,i))}:{id:"showMoreActions",label:m("showMoreActions","Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,i))}),s}};jv.ID="editor.contrib.codeActionController";jv.DECORATION=Je.register({description:"quickfix-highlight",className:x3e});jv=NC=S3e([Dl(1,ml),Dl(2,et),Dl(3,vt),Dl(4,it),Dl(5,oy),Dl(6,fs),Dl(7,ii),Dl(8,lg),Dl(9,vt)],jv);Tr((n,e)=>{((s,o)=>{o&&e.addRule(`.monaco-editor ${s} { background-color: ${o}; }`)})(".quickfix-edit-highlight",n.getColor(Ha));const i=n.getColor(gd);i&&e.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${lc(n.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`)});var WY=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Vx=function(n,e){return function(t,i){e(t,i,n)}};class WB{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let $R=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new B,this.onDidChange=this._onDidChange.event,this._dispoables=new pe,this._markers=[],this._nextIdx=-1,Ue.isUri(e)?this._resourceFilter=a=>a.toString()===e.toString():e&&(this._resourceFilter=e);const s=this._configService.getValue("problems.sortOrder"),o=(a,l)=>{let c=zb(a.resource.toString(),l.resource.toString());return c===0&&(s==="position"?c=N.compareRangesUsingStarts(a,l)||ei.compare(a.severity,l.severity):c=ei.compare(a.severity,l.severity)||N.compareRangesUsingStarts(a,l)),c},r=()=>{this._markers=this._markerService.read({resource:Ue.isUri(e)?e:void 0,severities:ei.Error|ei.Warning|ei.Info}),typeof e=="function"&&(this._markers=this._markers.filter(a=>this._resourceFilter(a.resource))),this._markers.sort(o)};r(),this._dispoables.add(t.onMarkerChanged(a=>{(!this._resourceFilter||a.some(l=>this._resourceFilter(l)))&&(r(),this._nextIdx=-1,this._onDidChange.fire())}))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(e){return!this._resourceFilter&&!e?!0:!this._resourceFilter||!e?!1:this._resourceFilter(e)}get selected(){const e=this._markers[this._nextIdx];return e&&new WB(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let s=!1,o=this._markers.findIndex(r=>r.resource.toString()===e.uri.toString());o<0&&(o=K$(this._markers,{resource:e.uri},(r,a)=>zb(r.resource.toString(),a.resource.toString())),o<0&&(o=~o));for(let r=o;rs.resource.toString()===e.toString());if(!(i<0)){for(;i=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},kg=function(n,e){return function(t,i){e(t,i,n)}},qR;class D3e{constructor(e,t,i,s,o){this._openerService=s,this._labelService=o,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new pe,this._editor=t;const r=document.createElement("div");r.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),r.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),r.appendChild(this._relatedBlock),this._disposables.add(Ui(this._relatedBlock,"click",a=>{a.preventDefault();const l=this._relatedDiagnostics.get(a.target);l&&i(l)})),this._scrollable=new rq(r,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll(a=>{r.style.left=`-${a.scrollLeft}px`,r.style.top=`-${a.scrollTop}px`})),this._disposables.add(this._scrollable)}dispose(){Ft(this._disposables)}update(e){const{source:t,message:i,relatedInformation:s,code:o}=e;let r=((t==null?void 0:t.length)||0)+2;o&&(typeof o=="string"?r+=o.length:r+=o.value.length);const a=$f(i);this._lines=a.length,this._longestLineLength=0;for(const h of a)this._longestLineLength=Math.max(h.length+r,this._longestLineLength);xo(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let l=this._messageBlock;for(const h of a)l=document.createElement("div"),l.innerText=h,h===""&&(l.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(l);if(t||o){const h=document.createElement("span");if(h.classList.add("details"),l.appendChild(h),t){const f=document.createElement("span");f.innerText=t,f.classList.add("source"),h.appendChild(f)}if(o)if(typeof o=="string"){const f=document.createElement("span");f.innerText=`(${o})`,f.classList.add("code"),h.appendChild(f)}else{this._codeLink=ye("a.code-link"),this._codeLink.setAttribute("href",`${o.target.toString()}`),this._codeLink.onclick=g=>{this._openerService.open(o.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()};const f=le(this._codeLink,ye("span"));f.innerText=o.value,h.appendChild(this._codeLink)}}if(xo(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),oc(s)){const h=this._relatedBlock.appendChild(document.createElement("div"));h.style.paddingTop=`${Math.floor(this._editor.getOption(66)*.66)}px`,this._lines+=1;for(const f of s){const g=document.createElement("div"),p=document.createElement("a");p.classList.add("filename"),p.innerText=`${this._labelService.getUriBasenameLabel(f.resource)}(${f.startLineNumber}, ${f.startColumn}): `,p.title=this._labelService.getUriLabel(f.resource),this._relatedDiagnostics.set(p,f);const _=document.createElement("span");_.innerText=f.message,g.appendChild(p),g.appendChild(_),this._lines+=1,h.appendChild(g)}}const c=this._editor.getOption(50),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 ei.Error:t=m("Error","Error");break;case ei.Warning:t=m("Warning","Warning");break;case ei.Info:t=m("Info","Info");break;case ei.Hint:t=m("Hint","Hint");break}let i=m("marker aria","{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const s=this._editor.getModel();return s&&e.startLineNumber<=s.getLineCount()&&e.startLineNumber>=1&&(i=`${s.getLineContent(e.startLineNumber)}, ${i}`),i}}let jm=qR=class extends Rx{constructor(e,t,i,s,o,r,a){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},o),this._themeService=t,this._openerService=i,this._menuService=s,this._contextKeyService=r,this._labelService=a,this._callOnDispose=new pe,this._onDidSelectRelatedInformation=new B,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=ei.Warning,this._backgroundColor=H.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(I3e);let t=GR,i=k3e;this._severity===ei.Warning?(t=RC,i=E3e):this._severity===ei.Info&&(t=KR,i=A3e);const s=e.getColor(t),o=e.getColor(i);this.style({arrowColor:s,frameColor:s,headerBackgroundColor:o,primaryHeadingColor:e.getColor(fY),secondaryHeadingColor:e.getColor(gY)})}_applyStyles(){this._parentContainer&&(this._parentContainer.style.backgroundColor=this._backgroundColor?this._backgroundColor.toString():""),super._applyStyles()}dispose(){this._callOnDispose.dispose(),super.dispose()}_fillHead(e){super._fillHead(e),this._disposables.add(this._actionbarWidget.actionRunner.onWillRun(s=>this.editor.focus()));const t=[],i=this._menuService.createMenu(qR.TitleMenu,this._contextKeyService);FG(i,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),i.dispose()}_fillTitleIcon(e){this._icon=le(e,ye(""))}_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 D3e(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 s=N.lift(e),o=this.editor.getPosition(),r=o&&s.containsPosition(o)?o:s.getStartPosition();super.show(r,this.computeRequiredHeight());const a=this.editor.getModel();if(a){const l=i>1?m("problems","{0} of {1} problems",t,i):m("change","{0} of {1} problem",t,i);this.setTitle(ra(a.uri),l)}this._icon.className=`codicon ${jR.className(ei.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(r,0),this.editor.focus()}updateMarker(e){this._container.classList.remove("stale"),this._message.update(e)}showStale(){this._container.classList.add("stale"),this._relayout()}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._heightInPixel=e,this._message.layout(e,t),this._container.style.height=`${e}px`}_onWidth(e){this._message.layout(this._heightInPixel,e)}_relayout(){super._relayout(this.computeRequiredHeight())}computeRequiredHeight(){return 3+this._message.getHeightInLines()}};jm.TitleMenu=new I("gotoErrorTitleMenu");jm=qR=L3e([kg(1,ro),kg(2,Dc),kg(3,Du),kg(4,vt),kg(5,et),kg(6,CD)],jm);const VB=av(Va,vve),zB=av(yo,ov),HB=av(ks,rv),GR=E("editorMarkerNavigationError.background",{dark:VB,light:VB,hcDark:Qe,hcLight:Qe},m("editorMarkerNavigationError","Editor marker navigation widget error color.")),k3e=E("editorMarkerNavigationError.headerBackground",{dark:we(GR,.1),light:we(GR,.1),hcDark:null,hcLight:null},m("editorMarkerNavigationErrorHeaderBackground","Editor marker navigation widget error heading background.")),RC=E("editorMarkerNavigationWarning.background",{dark:zB,light:zB,hcDark:Qe,hcLight:Qe},m("editorMarkerNavigationWarning","Editor marker navigation widget warning color.")),E3e=E("editorMarkerNavigationWarning.headerBackground",{dark:we(RC,.1),light:we(RC,.1),hcDark:"#0C141F",hcLight:we(RC,.2)},m("editorMarkerNavigationWarningBackground","Editor marker navigation widget warning heading background.")),KR=E("editorMarkerNavigationInfo.background",{dark:HB,light:HB,hcDark:Qe,hcLight:Qe},m("editorMarkerNavigationInfo","Editor marker navigation widget info color.")),A3e=E("editorMarkerNavigationInfo.headerBackground",{dark:we(KR,.1),light:we(KR,.1),hcDark:null,hcLight:null},m("editorMarkerNavigationInfoHeaderBackground","Editor marker navigation widget info heading background.")),I3e=E("editorMarkerNavigation.background",{dark:Ki,light:Ki,hcDark:Ki,hcLight:Ki},m("editorMarkerNavigationBackground","Editor marker navigation widget background."));var T3e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Uw=function(n,e){return function(t,i){e(t,i,n)}},zY=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})},D_;let du=D_=class{static get(e){return e.getContribution(D_.ID)}constructor(e,t,i,s,o){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=s,this._instantiationService=o,this._sessionDispoables=new pe,this._editor=e,this._widgetVisible=HY.bindTo(this._contextKeyService)}dispose(){this._cleanUp(),this._sessionDispoables.dispose()}_cleanUp(){this._widgetVisible.reset(),this._sessionDispoables.clear(),this._widget=void 0,this._model=void 0}_getOrCreateModel(e){if(this._model&&this._model.matches(e))return this._model;let t=!1;return this._model&&(t=!0,this._cleanUp()),this._model=this._markerNavigationService.getMarkerList(e),t&&this._model.move(!0,this._editor.getModel(),this._editor.getPosition()),this._widget=this._instantiationService.createInstance(jm,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 s,o,r;(!(!((s=this._model)===null||s===void 0)&&s.selected)||!N.containsPosition((o=this._model)===null||o===void 0?void 0:o.selected.marker,i.position))&&((r=this._model)===null||r===void 0||r.resetIndex())})),this._sessionDispoables.add(this._model.onDidChange(()=>{if(!this._widget||!this._widget.position||!this._model)return;const i=this._model.find(this._editor.getModel().uri,this._widget.position);i?this._widget.updateMarker(i.marker):this._widget.showStale()})),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation(i=>{this._editorService.openCodeEditor({resource:i.resource,options:{pinned:!0,revealIfOpened:!0,selection:N.lift(i).collapseToStart()}},this._editor),this.close(!1)})),this._sessionDispoables.add(this._editor.onDidChangeModel(()=>this._cleanUp())),this._model}close(e=!0){this._cleanUp(),e&&this._editor.focus()}showAtMarker(e){if(this._editor.hasModel()){const t=this._getOrCreateModel(this._editor.getModel().uri);t.resetIndex(),t.move(!0,this._editor.getModel(),new V(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}nagivate(e,t){var i,s;return zY(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 r=yield this._editorService.openCodeEditor({resource:o.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:o.selected.marker}},this._editor);r&&((i=D_.get(r))===null||i===void 0||i.close(),(s=D_.get(r))===null||s===void 0||s.nagivate(e,t))}else this._widget.showAtMarker(o.selected.marker,o.selected.index,o.selected.total)}})}};du.ID="editor.contrib.markerController";du=D_=T3e([Uw(1,VY),Uw(2,et),Uw(3,jt),Uw(4,vt)],du);class tk extends Qt{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}run(e,t){var i;return zY(this,void 0,void 0,function*(){t.hasModel()&&((i=du.get(t))===null||i===void 0||i.nagivate(this._next,this._multiFile))})}}class Vd extends tk{constructor(){super(!0,!1,{id:Vd.ID,label:Vd.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:$.focus,primary:578,weight:100},menuOpts:{menuId:jm.TitleMenu,title:Vd.LABEL,icon:Zi("marker-navigation-next",se.arrowDown,m("nextMarkerIcon","Icon for goto next marker.")),group:"navigation",order:1}})}}Vd.ID="editor.action.marker.next";Vd.LABEL=m("markerAction.next.label","Go to Next Problem (Error, Warning, Info)");class lf extends tk{constructor(){super(!1,!1,{id:lf.ID,label:lf.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:$.focus,primary:1602,weight:100},menuOpts:{menuId:jm.TitleMenu,title:lf.LABEL,icon:Zi("marker-navigation-previous",se.arrowUp,m("previousMarkerIcon","Icon for goto previous marker.")),group:"navigation",order:2}})}}lf.ID="editor.action.marker.prev";lf.LABEL=m("markerAction.previous.label","Go to Previous Problem (Error, Warning, Info)");class N3e extends tk{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:m("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:$.focus,primary:66,weight:100},menuOpts:{menuId:I.MenubarGoMenu,title:m({key:"miGotoNextProblem",comment:["&& denotes a mnemonic"]},"Next &&Problem"),group:"6_problem_nav",order:1}})}}class R3e extends tk{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:m("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:$.focus,primary:1090,weight:100},menuOpts:{menuId:I.MenubarGoMenu,title:m({key:"miGotoPreviousProblem",comment:["&& denotes a mnemonic"]},"Previous &&Problem"),group:"6_problem_nav",order:2}})}}Ir(du.ID,du,4);Ze(Vd);Ze(lf);Ze(N3e);Ze(R3e);const HY=new _e("markersNavigationVisible",!1),M3e=kr.bindToContribution(du.get);Ee(new M3e({id:"closeMarkersNavigation",precondition:HY,handler:n=>n.close(),kbOpts:{weight:150,kbExpr:$.focus,primary:9,secondary:[1033]}}));var P3e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},CE=function(n,e){return function(t,i){e(t,i,n)}};const ir=ye;class O3e{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 $B={type:1,filter:{include:We.QuickFix},triggerAction:cu.QuickFixHover};let YR=class{constructor(e,t,i,s){this._editor=e,this._markerDecorationsService=t,this._openerService=i,this._languageFeaturesService=s,this.hoverOrdinal=1,this.recentMarkerCodeActionsInfo=void 0}computeSync(e,t){if(!this._editor.hasModel()||e.type!==1&&!e.supportsMarkerHover)return[];const i=this._editor.getModel(),s=e.range.startLineNumber,o=i.getLineMaxColumn(s),r=[];for(const a of t){const l=a.range.startLineNumber===s?a.range.startColumn:1,c=a.range.endLineNumber===s?a.range.endColumn:o,d=this._markerDecorationsService.getMarker(i.uri,a);if(!d)continue;const u=new N(e.range.startLineNumber,l,e.range.startLineNumber,c);r.push(new O3e(this,u,d))}return r}renderHoverParts(e,t){if(!t.length)return Y.None;const i=new pe;t.forEach(o=>e.fragment.appendChild(this.renderMarkerHover(o,i)));const s=t.length===1?t[0]:t.sort((o,r)=>ei.compare(o.marker.severity,r.marker.severity))[0];return this.renderMarkerStatusbar(e,s,i),i}renderMarkerHover(e,t){const i=ir("div.hover-row"),s=le(i,ir("div.marker.hover-contents")),{source:o,message:r,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(s);const c=le(s,ir("span"));if(c.style.whiteSpace="pre-wrap",c.innerText=r,o||a)if(a&&typeof a!="string"){const d=ir("span");if(o){const g=le(d,ir("span"));g.innerText=o}const u=le(d,ir("a.code-link"));u.setAttribute("href",a.target.toString()),t.add(K(u,"click",g=>{this._openerService.open(a.target,{allowCommands:!0}),g.preventDefault(),g.stopPropagation()}));const h=le(u,ir("span"));h.innerText=a.value;const f=le(s,d);f.style.opacity="0.6",f.style.paddingLeft="6px"}else{const d=le(s,ir("span"));d.style.opacity="0.6",d.style.paddingLeft="6px",d.innerText=o&&a?`${o}(${a})`:o||`(${a})`}if(oc(l))for(const{message:d,resource:u,startLineNumber:h,startColumn:f}of l){const g=le(s,ir("div"));g.style.marginTop="8px";const p=le(g,ir("a"));p.innerText=`${ra(u)}(${h}, ${f}): `,p.style.cursor="pointer",t.add(K(p,"click",v=>{v.stopPropagation(),v.preventDefault(),this._openerService&&this._openerService.open(u,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:h,startColumn:f}}}).catch(mt)}));const _=le(g,ir("span"));_.innerText=d,this._editor.applyFontInfo(_)}return i}renderMarkerStatusbar(e,t,i){if((t.marker.severity===ei.Error||t.marker.severity===ei.Warning||t.marker.severity===ei.Info)&&e.statusBar.addAction({label:m("view problem","View Problem"),commandId:Vd.ID,run:()=>{var s;e.hide(),(s=du.get(this._editor))===null||s===void 0||s.showAtMarker(t.marker),this._editor.focus()}}),!this._editor.getOption(90)){const s=e.statusBar.append(ir("div"));this.recentMarkerCodeActionsInfo&&(px.makeKey(this.recentMarkerCodeActionsInfo.marker)===px.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(s.textContent=m("noQuickFixes","No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const o=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?Y.None:i.add(kS(()=>s.textContent=m("checkingForQuickFixes","Checking for quick fixes..."),200));s.textContent||(s.textContent=" ");const r=this.getCodeActions(t.marker);i.add(Ye(()=>r.cancel())),r.then(a=>{if(o.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:a.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions){a.dispose(),s.textContent=m("noQuickFixes","No quick fixes available");return}s.style.display="none";let l=!1;i.add(Ye(()=>{l||a.dispose()})),e.statusBar.addAction({label:m("quick fixes","Quick Fix..."),commandId:IY,run:c=>{l=!0;const d=jv.get(this._editor),u=Tn(c);e.hide(),d==null||d.showCodeActions($B,a,{x:u.left,y:u.top,width:u.width,height:u.height})}})},mt)}}getCodeActions(e){return xc(t=>ob(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new N(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),$B,Ap.None,t))}};YR=P3e([CE(1,d3),CE(2,Dc),CE(3,it)],YR);const F3e="editor.action.inlineSuggest.showPrevious",B3e="editor.action.inlineSuggest.showNext";var W3e=function(n,e,t,i){function s(o){return o instanceof t?o:new t(function(r){r(o)})}return new(t||(t=Promise))(function(o,r){function a(d){try{c(i.next(d))}catch(u){r(u)}}function l(d){try{c(i.throw(d))}catch(u){r(u)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((i=i.apply(n,e||[])).next())})};class V3e extends Y{constructor(e,t,i={orientation:0}){super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new Lge),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new pe),this.options=i,this.lookupKeybindings=typeof this.options.getKeyBinding=="function",this.toggleMenuAction=this._register(new qv(()=>{var s;return(s=this.toggleMenuActionViewItem)===null||s===void 0?void 0:s.show()},i.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new al(this.element,{orientation:i.orientation,ariaLabel:i.ariaLabel,actionRunner:i.actionRunner,allowContextMenu:i.allowContextMenu,highlightToggledItems:i.highlightToggledItems,actionViewItemProvider:(s,o)=>{var r;if(s.id===qv.ID)return this.toggleMenuActionViewItem=new cx(s,s.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:Te.asClassNameArray((r=i.moreIcon)!==null&&r!==void 0?r:se.toolBarMore),anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry}),this.toggleMenuActionViewItem.setActionContext(this.actionBar.context),this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)),this.toggleMenuActionViewItem;if(i.actionViewItemProvider){const a=i.actionViewItemProvider(s,o);if(a)return a}if(s instanceof WL){const a=new cx(s,s.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:s.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry});return a.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(a),this.disposables.add(this._onDidChangeDropdownVisibility.add(a.onDidChangeVisibility)),a}}}))}set actionRunner(e){this.actionBar.actionRunner=e}get actionRunner(){return this.actionBar.actionRunner}getElement(){return this.element}getItemAction(e){return this.actionBar.getAction(e)}setActions(e,t){this.clear();const i=e?e.slice(0):[];this.hasSecondaryActions=!!(t&&t.length>0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),i.push(this.toggleMenuAction)),i.forEach(s=>{this.actionBar.push(s,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(s)})})}getKeybindingLabel(e){var t,i,s;const o=this.lookupKeybindings?(i=(t=this.options).getKeyBinding)===null||i===void 0?void 0:i.call(t,e):void 0;return(s=o==null?void 0:o.getLabel())!==null&&s!==void 0?s:void 0}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}class qv extends So{constructor(e,t){t=t||m("moreActions","More Actions..."),super(qv.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}run(){return W3e(this,void 0,void 0,function*(){this.toggleDropdownMenu()})}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}}qv.ID="toolbar.toggle.more";var z3e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},X0=function(n,e){return function(t,i){e(t,i,n)}};let ZR=class extends V3e{constructor(e,t,i,s,o,r,a){super(e,o,Object.assign(Object.assign({getKeyBinding:c=>{var d;return(d=r.lookupKeybinding(c.id))!==null&&d!==void 0?d:void 0}},t),{allowContextMenu:!0,skipTelemetry:typeof(t==null?void 0:t.telemetrySource)=="string"})),this._options=t,this._menuService=i,this._contextKeyService=s,this._contextMenuService=o,this._sessionDisposables=this._store.add(new pe);const l=t==null?void 0:t.telemetrySource;l&&this._store.add(this.actionBar.onDidRun(c=>a.publicLog2("workbenchActionExecuted",{id:c.action.id,from:l})))}setActions(e,t=[],i){var s,o,r;this._sessionDisposables.clear();const a=e.slice(),l=t.slice(),c=[];let d=0;const u=[];let h=!1;if(((s=this._options)===null||s===void 0?void 0:s.hiddenItemStrategy)!==-1)for(let f=0;f_==null?void 0:_.id)),g=this._options.overflowBehavior.maxItems-f.size;let p=0;for(let _=0;_=g&&(a[_]=void 0,u[_]=v))}}kF(a),kF(u),super.setActions(a,Rn.join(u,l)),c.length>0&&this._sessionDisposables.add(K(this.getElement(),"contextmenu",f=>{var g,p,_,v,b;const y=new dr(f),w=this.getItemAction(y.target);if(!w)return;y.preventDefault(),y.stopPropagation();let S=!1;if(d===1&&((g=this._options)===null||g===void 0?void 0:g.hiddenItemStrategy)===0){S=!0;for(let D=0;Dthis._menuService.resetHiddenStates(i)}))),this._contextMenuService.showContextMenu({getAnchor:()=>y,getActions:()=>x,menuId:(_=this._options)===null||_===void 0?void 0:_.contextMenu,menuActionOptions:Object.assign({renderShortTitle:!0},(v=this._options)===null||v===void 0?void 0:v.menuOptions),skipTelemetry:typeof((b=this._options)===null||b===void 0?void 0:b.telemetrySource)=="string",contextKeyService:this._contextKeyService})}))}};ZR=z3e([X0(2,Du),X0(3,et),X0(4,Nu),X0(5,bi),X0(6,Cc)],ZR);var KP=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},Qr=function(n,e){return function(t,i){e(t,i,n)}},MC;let UB=class extends Y{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=As(this.editor.onDidChangeConfiguration,()=>this.editor.getOption(62).showToolbar==="always"),this.sessionPosition=void 0,this.position=_t(this,s=>{var o,r,a;const l=(o=this.model.read(s))===null||o===void 0?void 0:o.ghostText.read(s);if(!this.alwaysShowToolbar.read(s)||!l||l.parts.length===0)return this.sessionPosition=void 0,null;const c=l.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==l.lineNumber&&(this.sessionPosition=void 0);const d=new V(l.lineNumber,Math.min(c,(a=(r=this.sessionPosition)===null||r===void 0?void 0:r.column)!==null&&a!==void 0?a:Number.MAX_SAFE_INTEGER));return this.sessionPosition=d,d}),this._register($s((s,o)=>{const r=this.model.read(s);if(!r||!this.alwaysShowToolbar.read(s))return;const a=o.add(this.instantiationService.createInstance(qm,this.editor,!0,this.position,r.selectedInlineCompletionIndex,r.inlineCompletionsCount,r.selectedInlineCompletion.map(l=>{var c;return(c=l==null?void 0:l.inlineCompletion.source.inlineCompletions.commands)!==null&&c!==void 0?c:[]})));e.addContentWidget(a),o.add(Ye(()=>e.removeContentWidget(a))),o.add(di(l=>{this.position.read(l)&&r.lastTriggerKind.read(l)!==cI.Explicit&&r.triggerExplicitly()}))}))}};UB=KP([Qr(2,vt)],UB);const H3e=Zi("inline-suggestion-hints-next",se.chevronRight,m("parameterHintsNextIcon","Icon for show next parameter hint.")),$3e=Zi("inline-suggestion-hints-previous",se.chevronLeft,m("parameterHintsPreviousIcon","Icon for show previous parameter hint."));let qm=MC=class extends Y{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){const s=new So(e,t,i,!0,()=>this._commandService.executeCommand(e)),o=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let r=t;return o&&(r=m({key:"content",comment:["A label","A keybinding"]},"{0} ({1})",t,o.getLabel())),s.tooltip=r,s}constructor(e,t,i,s,o,r,a,l,c,d,u){super(),this.editor=e,this.withBorder=t,this._position=i,this._currentSuggestionIdx=s,this._suggestionCount=o,this._extraCommands=r,this._commandService=a,this.keybindingService=c,this._contextKeyService=d,this._menuService=u,this.id=`InlineSuggestionHintsContentWidget${MC.id++}`,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=dn("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[dn("div@toolBar")]),this.previousAction=this.createCommandAction(F3e,m("previous","Previous"),Te.asClassName($3e)),this.availableSuggestionCountAction=new So("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(B3e,m("next","Next"),Te.asClassName(H3e)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(I.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new Li(()=>{this.availableSuggestionCountAction.label=""},100)),this.disableButtonsDebounced=this._register(new Li(()=>{this.previousAction.enabled=this.nextAction.enabled=!1},100)),this.lastCommands=[],this.toolBar=this._register(l.createInstance(XR,this.nodes.toolBar,I.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:h=>h.startsWith("primary")},actionViewItemProvider:(h,f)=>{if(h instanceof il)return l.createInstance(j3e,h,void 0);if(h===this.availableSuggestionCountAction){const g=new U3e(void 0,h,{label:!0,icon:!1});return g.setClass("availableSuggestionCount"),g}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility(h=>{MC._dropDownVisible=h})),this._register(di(h=>{this._position.read(h),this.editor.layoutContentWidget(this)})),this._register(di(h=>{const f=this._suggestionCount.read(h),g=this._currentSuggestionIdx.read(h);f!==void 0?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${g+1}/${f}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),f!==void 0&&f>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()})),this._register(di(h=>{const f=this._extraCommands.read(h);if(Yi(this.lastCommands,f))return;this.lastCommands=f;const g=f.map(p=>({class:void 0,id:p.id,enabled:!0,tooltip:p.tooltip||"",label:p.title,run:_=>this._commandService.executeCommand(p.id)}));for(const[p,_]of this.inlineCompletionsActionsMenus.getActions())for(const v of _)v instanceof il&&g.push(v);g.length>0&&g.unshift(new Rn),this.toolBar.setAdditionalSecondaryActions(g)}))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};qm._dropDownVisible=!1;qm.id=0;qm=MC=KP([Qr(6,fs),Qr(7,vt),Qr(8,bi),Qr(9,et),Qr(10,Du)],qm);class U3e extends LD{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}}class j3e extends Bm{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=dn("div.keybinding").root;new uy(t,bo,Object.assign({disableTitle:!0},bEe)).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}}let XR=class extends ZR{constructor(e,t,i,s,o,r,a,l){super(e,Object.assign({resetMenu:t},i),s,o,r,a,l),this.menuId=t,this.options2=i,this.menuService=s,this.contextKeyService=o,this.menu=this._store.add(this.menuService.createMenu(this.menuId,this.contextKeyService,{emitEventsForSubmenuChanges:!0})),this.additionalActions=[],this.prependedPrimaryActions=[],this._store.add(this.menu.onDidChange(()=>this.updateToolbar())),this.updateToolbar()}updateToolbar(){var e,t,i,s,o,r,a;const l=[],c=[];FG(this.menu,(e=this.options2)===null||e===void 0?void 0:e.menuOptions,{primary:l,secondary:c},(i=(t=this.options2)===null||t===void 0?void 0:t.toolbarOptions)===null||i===void 0?void 0:i.primaryGroup,(o=(s=this.options2)===null||s===void 0?void 0:s.toolbarOptions)===null||o===void 0?void 0:o.shouldInlineSubmenu,(a=(r=this.options2)===null||r===void 0?void 0:r.toolbarOptions)===null||a===void 0?void 0:a.useSeparatorsInPrimaryActions),c.push(...this.additionalActions),l.unshift(...this.prependedPrimaryActions),this.setActions(l,c)}setPrependedPrimaryActions(e){Yi(this.prependedPrimaryActions,e,(t,i)=>t===i)||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){Yi(this.additionalActions,e,(t,i)=>t===i)||(this.additionalActions=e,this.updateToolbar())}};XR=KP([Qr(3,Du),Qr(4,et),Qr(5,Nu),Qr(6,bi),Qr(7,Cc)],XR);var q3e=function(n,e,t,i){var s=arguments.length,o=s<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(r=n[a])&&(o=(s<3?r(o):s>3?r(e,t,o):r(e,t))||o);return s>3&&o&&Object.defineProperty(e,t,o),o},jw=function(n,e){return function(t,i){e(t,i,n)}},QR;const G3e=!1;let to=QR=class extends Y{static get(e){return e.getContribution(QR.ID)}constructor(e,t,i,s,o){super(),this._editor=e,this._instantiationService=t,this._openerService=i,this._languageService=s,this._keybindingService=o,this._toUnhook=new pe,this._hoverActivatedByColorDecoratorClick=!1,this._isMouseDown=!1,this._hoverClicked=!1,this._contentWidget=null,this._glyphWidget=null,this._reactToEditorMouseMoveRunner=this._register(new Li(()=>this._reactToEditorMouseMove(this._mouseMoveEvent),0)),this._hookEvents(),this._register(this._editor.onDidChangeConfiguration(r=>{r.hasChanged(60)&&(this._unhookEvents(),this._hookEvents())})),this._register(this._editor.onMouseLeave(()=>{this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()}))}_hookEvents(){const e=()=>this._hideWidgets(),t=this._editor.getOption(60);this._isHoverEnabled=t.enabled,this._isHoverSticky=t.sticky,this._hidingDelay=t.hidingDelay,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){var t;this._isMouseDown=!0;const i=e.target;if(i.type===9&&i.detail===Wd.ID){this._hoverClicked=!0;return}i.type===12&&i.detail===Op.ID||(i.type!==12&&(this._hoverClicked=!1),!((t=this._contentWidget)===null||t===void 0)&&t.widget.isResizing||this._hideWidgets())}_onEditorMouseUp(e){this._isMouseDown=!1}_onEditorMouseLeave(e){var t,i;const s=e.event.browserEvent.relatedTarget;!((t=this._contentWidget)===null||t===void 0)&&t.widget.isResizing||!((i=this._contentWidget)===null||i===void 0)&&i.containsNode(s)||this._hideWidgets()}_isMouseOverWidget(e){var t,i,s,o,r;const a=e.target;return!!(this._isHoverSticky&&a.type===9&&a.detail===Wd.ID||this._isHoverSticky&&(!((t=this._contentWidget)===null||t===void 0)&&t.containsNode((i=e.event.browserEvent.view)===null||i===void 0?void 0:i.document.activeElement))&&!(!((o=(s=e.event.browserEvent.view)===null||s===void 0?void 0:s.getSelection())===null||o===void 0)&&o.isCollapsed)||!this._isHoverSticky&&a.type===9&&a.detail===Wd.ID&&(!((r=this._contentWidget)===null||r===void 0)&&r.isColorPickerVisible)||this._isHoverSticky&&a.type===12&&a.detail===Op.ID)}_onEditorMouseMove(e){var t,i,s,o;if(this._mouseMoveEvent=e,!((t=this._contentWidget)===null||t===void 0)&&t.isFocused||!((i=this._contentWidget)===null||i===void 0)&&i.isResizing||this._isMouseDown&&this._hoverClicked||this._isHoverSticky&&(!((s=this._contentWidget)===null||s===void 0)&&s.isVisibleFromKeyboard))return;if(this._isMouseOverWidget(e)){this._reactToEditorMouseMoveRunner.cancel();return}if(!((o=this._contentWidget)===null||o===void 0)&&o.isVisible&&this._isHoverSticky&&this._hidingDelay>0){this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(this._hidingDelay);return}this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){var t,i,s;if(!e)return;const o=e.target,r=(t=o.element)===null||t===void 0?void 0:t.classList.contains("colorpicker-color-decoration"),a=this._editor.getOption(146);if(r&&(a==="click"&&!this._hoverActivatedByColorDecoratorClick||a==="hover"&&!this._isHoverEnabled&&!G3e||a==="clickAndHover"&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick)||!r&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick){this._hideWidgets();return}if(this._getOrCreateContentWidget().maybeShowAt(e)){(i=this._glyphWidget)===null||i===void 0||i.hide();return}if(o.type===2&&o.position){(s=this._contentWidget)===null||s===void 0||s.hide(),this._glyphWidget||(this._glyphWidget=new Op(this._editor,this._languageService,this._openerService)),this._glyphWidget.startShowingAt(o.position.lineNumber);return}this._hideWidgets()}_onKeyDown(e){var t;if(!this._editor.hasModel())return;const i=this._keybindingService.softDispatch(e,this._editor.getDomNode()),s=i.kind===1||i.kind===2&&i.commandId==="editor.action.showHover"&&((t=this._contentWidget)===null||t===void 0?void 0:t.isVisible);e.keyCode!==5&&e.keyCode!==6&&e.keyCode!==57&&e.keyCode!==4&&!s&&this._hideWidgets()}_hideWidgets(){var e,t,i;this._isMouseDown&&this._hoverClicked&&(!((e=this._contentWidget)===null||e===void 0)&&e.isColorPickerVisible)||qm.dropDownVisible||(this._hoverActivatedByColorDecoratorClick=!1,this._hoverClicked=!1,(t=this._glyphWidget)===null||t===void 0||t.hide(),(i=this._contentWidget)===null||i===void 0||i.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(Px,this._editor)),this._contentWidget}showContentHover(e,t,i,s,o=!1){this._hoverActivatedByColorDecoratorClick=o,this._getOrCreateContentWidget().startShowingAtRange(e,t,i,s)}focus(){var e;(e=this._contentWidget)===null||e===void 0||e.focus()}scrollUp(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollUp()}scrollDown(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollDown()}scrollLeft(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollLeft()}scrollRight(){var e;(e=this._contentWidget)===null||e===void 0||e.scrollRight()}pageUp(){var e;(e=this._contentWidget)===null||e===void 0||e.pageUp()}pageDown(){var e;(e=this._contentWidget)===null||e===void 0||e.pageDown()}goToTop(){var e;(e=this._contentWidget)===null||e===void 0||e.goToTop()}goToBottom(){var e;(e=this._contentWidget)===null||e===void 0||e.goToBottom()}get isColorPickerVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isColorPickerVisible}get isHoverVisible(){var e;return(e=this._contentWidget)===null||e===void 0?void 0:e.isVisible}dispose(){var e,t;super.dispose(),this._unhookEvents(),this._toUnhook.dispose(),(e=this._glyphWidget)===null||e===void 0||e.dispose(),(t=this._contentWidget)===null||t===void 0||t.dispose()}};to.ID="editor.contrib.hover";to=QR=q3e([jw(1,vt),jw(2,Dc),jw(3,Ni),jw(4,bi)],to);class K3e extends Qt{constructor(){super({id:"editor.action.showHover",label:m({key:"showOrFocusHover",comment:["Label for action that will trigger the showing/focusing of a hover in the editor.","If the hover is not visible, it will show the hover.","This allows for users to show the hover without using the mouse.","If the hover is already visible, it will take focus."]},"Show or Focus Hover"),description:{description:"Show or Focus Hover",args:[{name:"args",schema:{type:"object",properties:{focus:{description:"Controls if when triggered with the keyboard, the hover should take focus immediately.",type:"boolean",default:!1}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:$.editorTextFocus,primary:Pn(2089,2087),weight:100}})}run(e,t,i){if(!t.hasModel())return;const s=to.get(t);if(!s)return;const o=t.getPosition(),r=new N(o.lineNumber,o.column,o.lineNumber,o.column),a=t.getOption(2)===2||!!(i!=null&&i.focus);s.isHoverVisible?s.focus():s.showContentHover(r,1,1,a)}}class Y3e extends Qt{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:m({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=to.get(t);if(!i)return;const s=t.getPosition();if(!s)return;const o=new N(s.lineNumber,s.column,s.lineNumber,s.column),r=Rf.get(t);if(!r)return;r.startFindDefinitionFromCursor(s).then(()=>{i.showContentHover(o,1,1,!0)})}}class Z3e extends Qt{constructor(){super({id:"editor.action.scrollUpHover",label:m({key:"scrollUpHover",comment:["Action that allows to scroll up in the hover widget with the up arrow when the hover widget is focused."]},"Scroll Up Hover"),alias:"Scroll Up Hover",precondition:$.hoverFocused,kbOpts:{kbExpr:$.hoverFocused,primary:16,weight:100}})}run(e,t){const i=to.get(t);i&&i.scrollUp()}}class X3e extends Qt{constructor(){super({id:"editor.action.scrollDownHover",label:m({key:"scrollDownHover",comment:["Action that allows to scroll down in the hover widget with the up arrow when the hover widget is focused."]},"Scroll Down Hover"),alias:"Scroll Down Hover",precondition:$.hoverFocused,kbOpts:{kbExpr:$.hoverFocused,primary:18,weight:100}})}run(e,t){const i=to.get(t);i&&i.scrollDown()}}class Q3e extends Qt{constructor(){super({id:"editor.action.scrollLeftHover",label:m({key:"scrollLeftHover",comment:["Action that allows to scroll left in the hover widget with the left arrow when the hover widget is focused."]},"Scroll Left Hover"),alias:"Scroll Left Hover",precondition:$.hoverFocused,kbOpts:{kbExpr:$.hoverFocused,primary:15,weight:100}})}run(e,t){const i=to.get(t);i&&i.scrollLeft()}}class J3e extends Qt{constructor(){super({id:"editor.action.scrollRightHover",label:m({key:"scrollRightHover",comment:["Action that allows to scroll right in the hover widget with the right arrow when the hover widget is focused."]},"Scroll Right Hover"),alias:"Scroll Right Hover",precondition:$.hoverFocused,kbOpts:{kbExpr:$.hoverFocused,primary:17,weight:100}})}run(e,t){const i=to.get(t);i&&i.scrollRight()}}class ePe extends Qt{constructor(){super({id:"editor.action.pageUpHover",label:m({key:"pageUpHover",comment:["Action that allows to page up in the hover widget with the page up command when the hover widget is focused."]},"Page Up Hover"),alias:"Page Up Hover",precondition:$.hoverFocused,kbOpts:{kbExpr:$.hoverFocused,primary:11,secondary:[528],weight:100}})}run(e,t){const i=to.get(t);i&&i.pageUp()}}class tPe extends Qt{constructor(){super({id:"editor.action.pageDownHover",label:m({key:"pageDownHover",comment:["Action that allows to page down in the hover widget with the page down command when the hover widget is focused."]},"Page Down Hover"),alias:"Page Down Hover",precondition:$.hoverFocused,kbOpts:{kbExpr:$.hoverFocused,primary:12,secondary:[530],weight:100}})}run(e,t){const i=to.get(t);i&&i.pageDown()}}class iPe extends Qt{constructor(){super({id:"editor.action.goToTopHover",label:m({key:"goToTopHover",comment:["Action that allows to go to the top of the hover widget with the home command when the hover widget is focused."]},"Go To Top Hover"),alias:"Go To Bottom Hover",precondition:$.hoverFocused,kbOpts:{kbExpr:$.hoverFocused,primary:14,secondary:[2064],weight:100}})}run(e,t){const i=to.get(t);i&&i.goToTop()}}class nPe extends Qt{constructor(){super({id:"editor.action.goToBottomHover",label:m({key:"goToBottomHover",comment:["Action that allows to go to the bottom in the hover widget with the end command when the hover widget is focused."]},"Go To Bottom Hover"),alias:"Go To Bottom Hover",precondition:$.hoverFocused,kbOpts:{kbExpr:$.hoverFocused,primary:13,secondary:[2066],weight:100}})}run(e,t){const i=to.get(t);i&&i.goToBottom()}}Ir(to.ID,to,2);Ze(K3e);Ze(Y3e);Ze(Z3e);Ze(X3e);Ze(Q3e);Ze(J3e);Ze(ePe);Ze(tPe);Ze(iPe);Ze(nPe);qP.register(FR);qP.register(YR);Tr((n,e)=>{const t=n.getColor(Mve);t&&(e.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${t.transparent(.5)}; }`),e.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${t.transparent(.5)}; }`))});function sPe(n){return new Worker(""+new URL("json.worker-B_4HR3xd.js",import.meta.url).href,{name:n==null?void 0:n.name})}self.MonacoEnvironment={getWorker(n,e){if(e==="json")return new sPe;throw new Error("Unsupported language: "+e)}};class oPe extends zh{constructor(){super();Ei(this,"_editor");Ei(this,"_initialValue")}set value(t){this._editor?this._editor.setValue(t):this._initialValue=t}get value(){var t;return((t=this._editor)==null?void 0:t.getValue())??this._initialValue}createRenderRoot(){return this}disconnectedCallback(){var t,i,s;(t=this._editor)==null||t.dispose(),(s=(i=this._editor)==null?void 0:i.getModel())==null||s.dispose()}render(){return zi}firstUpdated(){this._editor=zK.create(this,{value:this._initialValue,language:"json",minimap:{enabled:!1},fontFamily:"'Source Code Pro', monospace",fontSize:12,tabSize:2,autoIndent:"advanced"}),this._editor.getModel().onDidChangeContent(()=>{this.dispatchEvent(new CustomEvent("change",{detail:{}}))}),new ResizeObserver(i=>{this._editor.layout()}).observe(this)}}customElements.define("code-editor",oPe);/** * @license * Copyright 2021 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */function*VPe(n,e){if(n!==void 0){let t=0;for(const i of n)yield e(i,t++)}}var Wl;class HY extends rp{constructor(){super();Oe(this,Wl);zi(this,"files");this.missingFiles=new Set}createRenderRoot(){return this}render(){return It` -
    - ${Object.keys(this.files).map(t=>It` + */function*rPe(n,e){if(n!==void 0){let t=0;for(const i of n)yield e(i,t++)}}var Vl;class $Y extends zh{constructor(){super();Pe(this,Vl);Ei(this,"files");this.missingFiles=new Set}createRenderRoot(){return this}render(){return Lt` +
    + - -
    - ${Object.keys(this.files).map(t=>It` -
    this._changeTab(t)} + >Add new files - ${HPe(this.files[t].data)} -
    - `)} - -
    - ${this.missingFiles.size?It`
    -

    Please add the following files:

    -
      - ${VPe(this.missingFiles,t=>It`
    • ${t}
    • `)} -
    -
    `:$i} - ${zPe(t=>this._handleFiles(t))} + +
  • +
+ +
+ ${Object.keys(this.files).map(t=>Lt` +
+ ${lPe(this.files[t].data)} +
+ `)} + +
+ ${this.missingFiles.size?Lt`
+

Please add the following files:

+
    + ${rPe(this.missingFiles,t=>Lt`
  • ${t}
  • `)} +
+
`:zi} + ${aPe(t=>this._handleFiles(t))} +
- `}async _handleFiles(t){const s=t.target.files;for(const o of s){const r=await $Pe(o),a=LM(r,{type:UPe(r,o.name),parse:"auto"});this.files[o.name]={metadata:o,data:a},ut(this,Wl,o.name)}this.requestUpdate(),this.dispatchEvent(new CustomEvent("upload",{detail:{}}))}_changeTab(t){const s=t.target.parentElement.dataset.name;ut(this,Wl,s),t.preventDefault(),this.requestUpdate()}}Wl=new WeakMap,zi(HY,"properties",{missingFiles:{type:Set,attribute:!1}});customElements.define("file-pane",HY);function zPe(n){return It`
+ `}async _handleFiles(t){const s=t.target.files;for(const o of s){const r=await cPe(o),a=SM(r,{type:dPe(r,o.name),parse:"auto"});this.files[o.name]={metadata:o,data:a},dt(this,Vl,o.name)}this.requestUpdate(),this.dispatchEvent(new CustomEvent("upload",{detail:{}}))}_changeTab(t){const s=t.target.parentElement.dataset.name;dt(this,Vl,s),t.preventDefault(),this.requestUpdate()}}Vl=new WeakMap,Ei($Y,"properties",{missingFiles:{type:Set,attribute:!1}});customElements.define("file-pane",$Y);function aPe(n){return Lt` -
`}function HPe(n){const e=Object.keys(n[0]),t=n.slice(0,30),i=e.map(a=>"text-align: "+(typeof n[0][a]=="number"?"right":"left")),s=a=>It` + `}function lPe(n){const e=Object.keys(n[0]),t=n.slice(0,30),i=e.map(a=>"text-align: "+(typeof n[0][a]=="number"?"right":"left")),s=a=>Lt` - ${e.map((l,c)=>It`${a[l]} `)} + ${e.map((l,c)=>Lt`${a[l]} `)} - `,o=()=>It` + `,o=()=>Lt` - ${e.map((a,l)=>It`... `)} + ${e.map((a,l)=>Lt`... `)} - `;return It` + `;return Lt` - ${It` + ${Lt` - ${e.map((a,l)=>It` `)} + ${e.map((a,l)=>Lt` `)} `} @@ -3784,55 +3668,76 @@ The flag will not be saved for the future. ${t.length
${a}${a}
- `}function $Pe(n){return new Promise((e,t)=>{let i=new FileReader;i.onload=()=>e(i.result),i.onerror=t,i.readAsText(n)})}function UPe(n,e){return/\.json$/.test(e)?"json":n.indexOf(" ")>=0?"tsv":"csv"}function $Y(n){if(typeof n=="object"&&n!==null){n.description&&(n.markdownDescription=n.description);for(const e in n)n.hasOwnProperty(e)&&(n[e]=$Y(n[e]))}return n}GPe();const UY="playgroundSpec",jY=cW(),X3=cW(),qY={};let Q3=new Set,EE,YB="";const zC=["stacked","parallel","full"];let eM=zC[0],HC,GY="";async function jPe(){const e=new URLSearchParams(window.location.search).get("spec");if(e){const s=await fetch(e);return HC=e.match(/.*\//)[0],s.text()}const t=window.localStorage.getItem(UY);return(t==null?void 0:t.length)>0?t:The}function qPe(){eM=zC[(zC.indexOf(eM)+1)%zC.length],J3(),window.dispatchEvent(new Event("resize"))}function GPe(){$Y(dB),$K.json.jsonDefaults.setDiagnosticsOptions({validate:!0,schemas:[{uri:"https://unpkg.com/@genome-spy/core/dist/schema.json",fileMatch:["*"],schema:dB}]})}function KPe(n){let e=qY[n];return e||Q3.add(n),e==null?void 0:e.data}async function KY(n=!1){var t,i;Q3=new Set,HC&&window.location.search&&window.history.replaceState(null,"",window.location.pathname);const e=(t=X3.value)==null?void 0:t.value;e&&window.localStorage.setItem(UY,e);try{const s=JSON.parse(e),o=JSON.stringify(s);if(o===YB&&!n)return;YB=o,EE&&EE.finalize(),HC&&!s.baseUrl&&(s.baseUrl=HC),GY=(i=Zs(s.description))==null?void 0:i[0],EE=await Ehe(jY.value,s,{namedDataProvider:KPe,powerPreference:"high-performance"}),J3()}catch(s){console.log(s)}}const YPe=()=>It` + `}function cPe(n){return new Promise((e,t)=>{let i=new FileReader;i.onload=()=>e(i.result),i.onerror=t,i.readAsText(n)})}function dPe(n,e){return/\.json$/.test(e)?"json":n.indexOf(" ")>=0?"tsv":"csv"}function UY(n){if(typeof n=="object"&&n!==null){n.description&&(n.markdownDescription=n.description);for(const e in n)n.hasOwnProperty(e)&&(n[e]=UY(n[e]))}return n}fPe();const jY="playgroundSpec",qY=sW(),Gv=sW(),GY={};let YP=new Set,SE,jB="";const PC=["vertical","horizontal"];let lp=PC[0],OC,KY="";async function uPe(){const e=new URLSearchParams(window.location.search).get("spec");if(e){const s=await fetch(e);return OC=e.match(/.*\//)[0],s.text()}const t=window.localStorage.getItem(jY);return(t==null?void 0:t.length)>0?t:Xhe}function hPe(){lp=PC[(PC.indexOf(lp)+1)%PC.length],ZP(),window.dispatchEvent(new Event("resize"))}function fPe(){UY(rB),HK.json.jsonDefaults.setDiagnosticsOptions({validate:!0,schemas:[{uri:"https://unpkg.com/@genome-spy/core/dist/schema.json",fileMatch:["*"],schema:rB}]})}function gPe(n){let e=GY[n];return e||YP.add(n),e==null?void 0:e.data}async function pPe(){const[n,e,t]=await Promise.all([Zn(()=>import("./standalone-CBDkzVPv.js"),[],import.meta.url),Zn(()=>import("./babel-BeV4PP65.js"),[],import.meta.url),Zn(()=>import("./estree-CXuZGlbU.js"),[],import.meta.url)]),i=await n.format(Gv.value.value,{parser:"json",plugins:[e,t]});Gv.value.value=i}async function YY(n=!1){var t,i;YP=new Set,OC&&window.location.search&&window.history.replaceState(null,"",window.location.pathname);const e=(t=Gv.value)==null?void 0:t.value;e&&window.localStorage.setItem(jY,e);try{const s=JSON.parse(e),o=JSON.stringify(s);if(o===jB&&!n)return;jB=o,SE&&SE.finalize(),OC&&!s.baseUrl&&(s.baseUrl=OC),KY=(i=Ks(s.description))==null?void 0:i[0],SE=await Khe(qY.value,s,{namedDataProvider:gPe,powerPreference:"high-performance"}),ZP()}catch(s){console.log(s)}}const mPe=()=>Lt`
- GenomeSpy + GenomeSpy GenomeSpy Playground - + - ${GY} + ${KY} v${uB.version}v${aB.version} ${$5(oQ).node[0]} Docs${mk(pQ).node[0]} Docs
-`,ZPe=Rb(()=>KY(),500,!1),XPe=()=>It` -
- ${YPe()} -
- -
-
-
-
-
- -
+`,_Pe=Pb(()=>YY(),500,!1),bPe=()=>Lt` +
+ ${mPe()} + +
+ + +
+ +
+
+
-`;function J3(){Qp(XPe(),document.body)}J3();jPe().then(n=>{X3.value.value=n});export{cNe as m}; +`;function ZP(){em(bPe(),document.body)}ZP();uPe().then(n=>{Gv.value.value=n});export{ANe as m}; diff --git a/playground/assets/index-BoBOlxMr.js b/playground/assets/index-BoBOlxMr.js new file mode 100644 index 0000000..6db5103 --- /dev/null +++ b/playground/assets/index-BoBOlxMr.js @@ -0,0 +1,4 @@ +import{b as J}from"./index-CJAFAeH3.js";import{A as Gn,L as Yn}from"./index-D15XeWB2.js";import{L as nr}from"./__vite-browser-external-D80GqXp3.js";import{R as ir}from"./remoteFile-_ulnNXZo.js";import"./_commonjsHelpers-C932wzq6.js";const st=BigInt(32);function rr(e,n,t){const i=+!!t,a=+!t;return BigInt(e.getInt32(n,t)*a+e.getInt32(n+4,t)*i)<>st),r=Number(t&BigInt(4294967295));i?(e.setInt32(n+4,a,i),e.setUint32(n,r,i)):(e.setInt32(n,a,i),e.setUint32(n+4,r,i))}function sr(e,n,t,i){const a=Number(t>>st),r=Number(t&BigInt(4294967295));i?(e.setUint32(n+4,a,i),e.setUint32(n,r,i)):(e.setUint32(n,a,i),e.setUint32(n+4,r,i))}"getBigInt64"in DataView||(DataView.prototype.getBigInt64=function(e,n){return rr(this,e,n)});"getBigUint64"in DataView||(DataView.prototype.getBigUint64=function(e,n){return ar(this,e,n)});"setBigInt64"in DataView||(DataView.prototype.setBigInt64=function(e,n,t){or(this,e,n,t)});"setBigUint64"in DataView||(DataView.prototype.setBigUint64=function(e,n,t){sr(this,e,n,t)});class lr{constructor(n,t){this.code="",this.scopes=[["vars"]],this.bitFields=[],this.tmpVariableCount=0,this.references=new Map,this.imports=[],this.reverseImports=new Map,this.useContextVariables=!1,this.importPath=n,this.useContextVariables=t}generateVariable(n){const t=[...this.scopes[this.scopes.length-1]];return n&&t.push(n),t.join(".")}generateOption(n){switch(typeof n){case"number":return n.toString();case"string":return this.generateVariable(n);case"function":return`${this.addImport(n)}.call(${this.generateVariable()}, vars)`}}generateError(n){this.pushCode(`throw new Error(${n});`)}generateTmpVariable(){return"$tmp"+this.tmpVariableCount++}pushCode(n){this.code+=n+` +`}pushPath(n){n&&this.scopes[this.scopes.length-1].push(n)}popPath(n){n&&this.scopes[this.scopes.length-1].pop()}pushScope(n){this.scopes.push([n])}popScope(){this.scopes.pop()}addImport(n){if(!this.importPath)return`(${n})`;let t=this.reverseImports.get(n);return t||(t=this.imports.push(n)-1,this.reverseImports.set(n,t)),`${this.importPath}[${t}]`}addReference(n){this.references.has(n)||this.references.set(n,{resolved:!1,requested:!1})}markResolved(n){const t=this.references.get(n);t&&(t.resolved=!0)}markRequested(n){n.forEach(t=>{const i=this.references.get(t);i&&(i.requested=!0)})}getUnresolvedReferences(){return Array.from(this.references).filter(([n,t])=>!t.resolved&&!t.requested).map(([n,t])=>n)}}const x=new Map,re="___parser_",M={uint8:1,uint16le:2,uint16be:2,uint32le:4,uint32be:4,int8:1,int16le:2,int16be:2,int32le:4,int32be:4,int64be:8,int64le:8,uint64be:8,uint64le:8,floatle:4,floatbe:4,doublele:8,doublebe:8},Ye={uint8:"Uint8",uint16le:"Uint16",uint16be:"Uint16",uint32le:"Uint32",uint32be:"Uint32",int8:"Int8",int16le:"Int16",int16be:"Int16",int32le:"Int32",int32be:"Int32",int64be:"BigInt64",int64le:"BigInt64",uint64be:"BigUint64",uint64le:"BigUint64",floatle:"Float32",floatbe:"Float32",doublele:"Float64",doublebe:"Float64"},Ke={uint8:!1,uint16le:!0,uint16be:!1,uint32le:!0,uint32be:!1,int8:!1,int16le:!0,int16be:!1,int32le:!0,int32be:!1,int64be:!1,int64le:!0,uint64be:!1,uint64le:!0,floatle:!0,floatbe:!1,doublele:!0,doublebe:!1};class S{constructor(){this.varName="",this.type="",this.options={},this.endian="be",this.useContextVariables=!1}static start(){return new S}primitiveGenerateN(n,t){const i=Ye[n],a=Ke[n];t.pushCode(`${t.generateVariable(this.varName)} = dataView.get${i}(offset, ${a});`),t.pushCode(`offset += ${M[n]};`)}primitiveN(n,t,i){return this.setNextParser(n,t,i)}useThisEndian(n){return n+this.endian.toLowerCase()}uint8(n,t={}){return this.primitiveN("uint8",n,t)}uint16(n,t={}){return this.primitiveN(this.useThisEndian("uint16"),n,t)}uint16le(n,t={}){return this.primitiveN("uint16le",n,t)}uint16be(n,t={}){return this.primitiveN("uint16be",n,t)}uint32(n,t={}){return this.primitiveN(this.useThisEndian("uint32"),n,t)}uint32le(n,t={}){return this.primitiveN("uint32le",n,t)}uint32be(n,t={}){return this.primitiveN("uint32be",n,t)}int8(n,t={}){return this.primitiveN("int8",n,t)}int16(n,t={}){return this.primitiveN(this.useThisEndian("int16"),n,t)}int16le(n,t={}){return this.primitiveN("int16le",n,t)}int16be(n,t={}){return this.primitiveN("int16be",n,t)}int32(n,t={}){return this.primitiveN(this.useThisEndian("int32"),n,t)}int32le(n,t={}){return this.primitiveN("int32le",n,t)}int32be(n,t={}){return this.primitiveN("int32be",n,t)}bigIntVersionCheck(){if(!DataView.prototype.getBigInt64)throw new Error("BigInt64 is unsupported on this runtime")}int64(n,t={}){return this.bigIntVersionCheck(),this.primitiveN(this.useThisEndian("int64"),n,t)}int64be(n,t={}){return this.bigIntVersionCheck(),this.primitiveN("int64be",n,t)}int64le(n,t={}){return this.bigIntVersionCheck(),this.primitiveN("int64le",n,t)}uint64(n,t={}){return this.bigIntVersionCheck(),this.primitiveN(this.useThisEndian("uint64"),n,t)}uint64be(n,t={}){return this.bigIntVersionCheck(),this.primitiveN("uint64be",n,t)}uint64le(n,t={}){return this.bigIntVersionCheck(),this.primitiveN("uint64le",n,t)}floatle(n,t={}){return this.primitiveN("floatle",n,t)}floatbe(n,t={}){return this.primitiveN("floatbe",n,t)}doublele(n,t={}){return this.primitiveN("doublele",n,t)}doublebe(n,t={}){return this.primitiveN("doublebe",n,t)}bitN(n,t,i){return i.length=n,this.setNextParser("bit",t,i)}bit1(n,t={}){return this.bitN(1,n,t)}bit2(n,t={}){return this.bitN(2,n,t)}bit3(n,t={}){return this.bitN(3,n,t)}bit4(n,t={}){return this.bitN(4,n,t)}bit5(n,t={}){return this.bitN(5,n,t)}bit6(n,t={}){return this.bitN(6,n,t)}bit7(n,t={}){return this.bitN(7,n,t)}bit8(n,t={}){return this.bitN(8,n,t)}bit9(n,t={}){return this.bitN(9,n,t)}bit10(n,t={}){return this.bitN(10,n,t)}bit11(n,t={}){return this.bitN(11,n,t)}bit12(n,t={}){return this.bitN(12,n,t)}bit13(n,t={}){return this.bitN(13,n,t)}bit14(n,t={}){return this.bitN(14,n,t)}bit15(n,t={}){return this.bitN(15,n,t)}bit16(n,t={}){return this.bitN(16,n,t)}bit17(n,t={}){return this.bitN(17,n,t)}bit18(n,t={}){return this.bitN(18,n,t)}bit19(n,t={}){return this.bitN(19,n,t)}bit20(n,t={}){return this.bitN(20,n,t)}bit21(n,t={}){return this.bitN(21,n,t)}bit22(n,t={}){return this.bitN(22,n,t)}bit23(n,t={}){return this.bitN(23,n,t)}bit24(n,t={}){return this.bitN(24,n,t)}bit25(n,t={}){return this.bitN(25,n,t)}bit26(n,t={}){return this.bitN(26,n,t)}bit27(n,t={}){return this.bitN(27,n,t)}bit28(n,t={}){return this.bitN(28,n,t)}bit29(n,t={}){return this.bitN(29,n,t)}bit30(n,t={}){return this.bitN(30,n,t)}bit31(n,t={}){return this.bitN(31,n,t)}bit32(n,t={}){return this.bitN(32,n,t)}namely(n){return x.set(n,this),this.alias=n,this}skip(n,t={}){return this.seek(n,t)}seek(n,t={}){if(t.assert)throw new Error("assert option on seek is not allowed.");return this.setNextParser("seek","",{length:n})}string(n,t){if(!t.zeroTerminated&&!t.length&&!t.greedy)throw new Error("One of length, zeroTerminated, or greedy must be defined for string.");if((t.zeroTerminated||t.length)&&t.greedy)throw new Error("greedy is mutually exclusive with length and zeroTerminated for string.");if(t.stripNull&&!(t.length||t.greedy))throw new Error("length or greedy must be defined if stripNull is enabled.");return t.encoding=t.encoding||"utf8",this.setNextParser("string",n,t)}buffer(n,t){if(!t.length&&!t.readUntil)throw new Error("length or readUntil must be defined for buffer.");return this.setNextParser("buffer",n,t)}wrapped(n,t){if(typeof t!="object"&&typeof n=="object"&&(t=n,n=""),!t||!t.wrapper||!t.type)throw new Error("Both wrapper and type must be defined for wrapped.");if(!t.length&&!t.readUntil)throw new Error("length or readUntil must be defined for wrapped.");return this.setNextParser("wrapper",n,t)}array(n,t){if(!t.readUntil&&!t.length&&!t.lengthInBytes)throw new Error("One of readUntil, length and lengthInBytes must be defined for array.");if(!t.type)throw new Error("type is required for array.");if(typeof t.type=="string"&&!x.has(t.type)&&!(t.type in M))throw new Error(`Array element type "${t.type}" is unkown.`);return this.setNextParser("array",n,t)}choice(n,t){if(typeof t!="object"&&typeof n=="object"&&(t=n,n=""),!t)throw new Error("tag and choices are are required for choice.");if(!t.tag)throw new Error("tag is requird for choice.");if(!t.choices)throw new Error("choices is required for choice.");for(const i in t.choices){const a=parseInt(i,10),r=t.choices[a];if(isNaN(a))throw new Error(`Choice key "${i}" is not a number.`);if(typeof r=="string"&&!x.has(r)&&!(r in M))throw new Error(`Choice type "${r}" is unkown.`)}return this.setNextParser("choice",n,t)}nest(n,t){if(typeof t!="object"&&typeof n=="object"&&(t=n,n=""),!t||!t.type)throw new Error("type is required for nest.");if(!(t.type instanceof S)&&!x.has(t.type))throw new Error("type must be a known parser name or a Parser object.");if(!(t.type instanceof S)&&!n)throw new Error("type must be a Parser object if the variable name is omitted.");return this.setNextParser("nest",n,t)}pointer(n,t){if(!t.offset)throw new Error("offset is required for pointer.");if(!t.type)throw new Error("type is required for pointer.");if(typeof t.type=="string"&&!(t.type in M)&&!x.has(t.type))throw new Error(`Pointer type "${t.type}" is unkown.`);return this.setNextParser("pointer",n,t)}saveOffset(n,t={}){return this.setNextParser("saveOffset",n,t)}endianness(n){switch(n.toLowerCase()){case"little":this.endian="le";break;case"big":this.endian="be";break;default:throw new Error('endianness must be one of "little" or "big"')}return this}endianess(n){return this.endianness(n)}useContextVars(n=!0){return this.useContextVariables=n,this}create(n){if(!(n instanceof Function))throw new Error("Constructor must be a Function object.");return this.constructorFn=n,this}getContext(n){const t=new lr(n,this.useContextVariables);return t.pushCode("var dataView = new DataView(buffer.buffer, buffer.byteOffset, buffer.length);"),this.alias?(this.addAliasedCode(t),t.pushCode(`return ${re+this.alias}(0).result;`)):this.addRawCode(t),t}getCode(){return this.getContext("imports").code}addRawCode(n){n.pushCode("var offset = 0;"),n.pushCode(`var vars = ${this.constructorFn?"new constructorFn()":"{}"};`),n.pushCode("vars.$parent = null;"),n.pushCode("vars.$root = vars;"),this.generate(n),this.resolveReferences(n),n.pushCode("delete vars.$parent;"),n.pushCode("delete vars.$root;"),n.pushCode("return vars;")}addAliasedCode(n){return n.pushCode(`function ${re+this.alias}(offset, context) {`),n.pushCode(`var vars = ${this.constructorFn?"new constructorFn()":"{}"};`),n.pushCode("var ctx = Object.assign({$parent: null, $root: vars}, context || {});"),n.pushCode("vars = Object.assign(vars, ctx);"),this.generate(n),n.markResolved(this.alias),this.resolveReferences(n),n.pushCode("Object.keys(ctx).forEach(function (item) { delete vars[item]; });"),n.pushCode("return { offset: offset, result: vars };"),n.pushCode("}"),n}resolveReferences(n){const t=n.getUnresolvedReferences();n.markRequested(t),t.forEach(i=>{var a;(a=x.get(i))===null||a===void 0||a.addAliasedCode(n)})}compile(){const n="imports",t=this.getContext(n);this.compiled=new Function(n,"TextDecoder",`return function (buffer, constructorFn) { ${t.code} };`)(t.imports,TextDecoder)}sizeOf(){let n=NaN;if(Object.keys(M).indexOf(this.type)>=0)n=M[this.type];else if(this.type==="string"&&typeof this.options.length=="number")n=this.options.length;else if(this.type==="buffer"&&typeof this.options.length=="number")n=this.options.length;else if(this.type==="array"&&typeof this.options.length=="number"){let t=NaN;typeof this.options.type=="string"?t=M[this.options.type]:this.options.type instanceof S&&(t=this.options.type.sizeOf()),n=this.options.length*t}else this.type==="seek"?n=this.options.length:this.type==="nest"?n=this.options.type.sizeOf():this.type||(n=0);return this.next&&(n+=this.next.sizeOf()),n}parse(n){return this.compiled||this.compile(),this.compiled(n,this.constructorFn)}setNextParser(n,t,i){const a=new S;return a.type=n,a.varName=t,a.options=i,a.endian=this.endian,this.head?this.head.next=a:this.next=a,this.head=a,this}generate(n){if(this.type){switch(this.type){case"uint8":case"uint16le":case"uint16be":case"uint32le":case"uint32be":case"int8":case"int16le":case"int16be":case"int32le":case"int32be":case"int64be":case"int64le":case"uint64be":case"uint64le":case"floatle":case"floatbe":case"doublele":case"doublebe":this.primitiveGenerateN(this.type,n);break;case"bit":this.generateBit(n);break;case"string":this.generateString(n);break;case"buffer":this.generateBuffer(n);break;case"seek":this.generateSeek(n);break;case"nest":this.generateNest(n);break;case"array":this.generateArray(n);break;case"choice":this.generateChoice(n);break;case"pointer":this.generatePointer(n);break;case"saveOffset":this.generateSaveOffset(n);break;case"wrapper":this.generateWrapper(n);break}this.type!=="bit"&&this.generateAssert(n)}const t=n.generateVariable(this.varName);return this.options.formatter&&this.type!=="bit"&&this.generateFormatter(n,t,this.options.formatter),this.generateNext(n)}generateAssert(n){if(!this.options.assert)return;const t=n.generateVariable(this.varName);switch(typeof this.options.assert){case"function":{const i=n.addImport(this.options.assert);n.pushCode(`if (!${i}.call(vars, ${t})) {`)}break;case"number":n.pushCode(`if (${this.options.assert} !== ${t}) {`);break;case"string":n.pushCode(`if (${JSON.stringify(this.options.assert)} !== ${t}) {`);break;default:throw new Error("assert option must be a string, number or a function.")}n.generateError(`"Assertion error: ${t} is " + ${JSON.stringify(this.options.assert.toString())}`),n.pushCode("}")}generateNext(n){return this.next&&(n=this.next.generate(n)),n}generateBit(n){const t=JSON.parse(JSON.stringify(this));if(t.options=this.options,t.generateAssert=this.generateAssert.bind(this),t.generateFormatter=this.generateFormatter.bind(this),t.varName=n.generateVariable(t.varName),n.bitFields.push(t),!this.next||this.next&&["bit","nest"].indexOf(this.next.type)<0){const i=n.generateTmpVariable();n.pushCode(`var ${i} = 0;`);const a=(f=0)=>{let _=0;for(let c=f;c32)break;_+=h}return _},r=f=>(f<=8?(n.pushCode(`${i} = dataView.getUint8(offset);`),f=8):f<=16?(n.pushCode(`${i} = dataView.getUint16(offset);`),f=16):f<=24?(n.pushCode(`${i} = (dataView.getUint16(offset) << 8) | dataView.getUint8(offset + 2);`),f=24):(n.pushCode(`${i} = dataView.getUint32(offset);`),f=32),n.pushCode(`offset += ${f/8};`),f);let o=0;const l=this.endian==="be";let u=0,s=0;n.bitFields.forEach((f,_)=>{let c=f.options.length;if(c>s){if(s){const g=-1>>>32-s;n.pushCode(`${f.varName} = (${i} & 0x${g.toString(16)}) << ${c-s};`),c-=s}o=0,s=u=r(a(_)-s)}const h=l?u-o-c:o,d=-1>>>32-c;n.pushCode(`${f.varName} ${c> ${h} & 0x${d.toString(16)};`),f.options.length===32&&n.pushCode(`${f.varName} >>>= 0`),f.options.assert&&f.generateAssert(n),f.options.formatter&&f.generateFormatter(n,f.varName,f.options.formatter),o+=c,s-=c}),n.bitFields=[]}}generateSeek(n){const t=n.generateOption(this.options.length);n.pushCode(`offset += ${t};`)}generateString(n){const t=n.generateVariable(this.varName),i=n.generateTmpVariable(),a=this.options.encoding,r=a.toLowerCase()==="hex",o='b => b.toString(16).padStart(2, "0")';if(this.options.length&&this.options.zeroTerminated){const l=this.options.length;n.pushCode(`var ${i} = offset;`),n.pushCode(`while(dataView.getUint8(offset++) !== 0 && offset - ${i} < ${l});`);const u=`offset - ${i} < ${l} ? offset - 1 : offset`;n.pushCode(r?`${t} = Array.from(buffer.subarray(${i}, ${u}), ${o}).join('');`:`${t} = new TextDecoder('${a}').decode(buffer.subarray(${i}, ${u}));`)}else if(this.options.length){const l=n.generateOption(this.options.length);n.pushCode(r?`${t} = Array.from(buffer.subarray(offset, offset + ${l}), ${o}).join('');`:`${t} = new TextDecoder('${a}').decode(buffer.subarray(offset, offset + ${l}));`),n.pushCode(`offset += ${l};`)}else this.options.zeroTerminated?(n.pushCode(`var ${i} = offset;`),n.pushCode("while(dataView.getUint8(offset++) !== 0);"),n.pushCode(r?`${t} = Array.from(buffer.subarray(${i}, offset - 1), ${o}).join('');`:`${t} = new TextDecoder('${a}').decode(buffer.subarray(${i}, offset - 1));`)):this.options.greedy&&(n.pushCode(`var ${i} = offset;`),n.pushCode("while(buffer.length > offset++);"),n.pushCode(r?`${t} = Array.from(buffer.subarray(${i}, offset), ${o}).join('');`:`${t} = new TextDecoder('${a}').decode(buffer.subarray(${i}, offset));`));this.options.stripNull&&n.pushCode(`${t} = ${t}.replace(/\\x00+$/g, '')`)}generateBuffer(n){const t=n.generateVariable(this.varName);if(typeof this.options.readUntil=="function"){const i=this.options.readUntil,a=n.generateTmpVariable(),r=n.generateTmpVariable();n.pushCode(`var ${a} = offset;`),n.pushCode(`var ${r} = 0;`),n.pushCode("while (offset < buffer.length) {"),n.pushCode(`${r} = dataView.getUint8(offset);`);const o=n.addImport(i);n.pushCode(`if (${o}.call(${n.generateVariable()}, ${r}, buffer.subarray(offset))) break;`),n.pushCode("offset += 1;"),n.pushCode("}"),n.pushCode(`${t} = buffer.subarray(${a}, offset);`)}else if(this.options.readUntil==="eof")n.pushCode(`${t} = buffer.subarray(offset);`);else{const i=n.generateOption(this.options.length);n.pushCode(`${t} = buffer.subarray(offset, offset + ${i});`),n.pushCode(`offset += ${i};`)}this.options.clone&&n.pushCode(`${t} = buffer.constructor.from(${t});`)}generateArray(n){const t=n.generateOption(this.options.length),i=n.generateOption(this.options.lengthInBytes),a=this.options.type,r=n.generateTmpVariable(),o=n.generateVariable(this.varName),l=n.generateTmpVariable(),u=this.options.key,s=typeof u=="string";if(s?n.pushCode(`${o} = {};`):n.pushCode(`${o} = [];`),typeof this.options.readUntil=="function"?n.pushCode("do {"):this.options.readUntil==="eof"?n.pushCode(`for (var ${r} = 0; offset < buffer.length; ${r}++) {`):i!==void 0?n.pushCode(`for (var ${r} = offset + ${i}; offset < ${r}; ) {`):n.pushCode(`for (var ${r} = ${t}; ${r} > 0; ${r}--) {`),typeof a=="string")if(x.get(a)){const f=n.generateTmpVariable();if(n.pushCode(`var ${f} = ${re+a}(offset, {`),n.useContextVariables){const _=n.generateVariable();n.pushCode(`$parent: ${_},`),n.pushCode(`$root: ${_}.$root,`),!this.options.readUntil&&i===void 0&&n.pushCode(`$index: ${t} - ${r},`)}n.pushCode("});"),n.pushCode(`var ${l} = ${f}.result; offset = ${f}.offset;`),a!==this.alias&&n.addReference(a)}else{const f=Ye[a],_=Ke[a];n.pushCode(`var ${l} = dataView.get${f}(offset, ${_});`),n.pushCode(`offset += ${M[a]};`)}else if(a instanceof S){n.pushCode(`var ${l} = {};`);const f=n.generateVariable();n.pushScope(l),n.useContextVariables&&(n.pushCode(`${l}.$parent = ${f};`),n.pushCode(`${l}.$root = ${f}.$root;`),!this.options.readUntil&&i===void 0&&n.pushCode(`${l}.$index = ${t} - ${r};`)),a.generate(n),n.useContextVariables&&(n.pushCode(`delete ${l}.$parent;`),n.pushCode(`delete ${l}.$root;`),n.pushCode(`delete ${l}.$index;`)),n.popScope()}if(s?n.pushCode(`${o}[${l}.${u}] = ${l};`):n.pushCode(`${o}.push(${l});`),n.pushCode("}"),typeof this.options.readUntil=="function"){const f=this.options.readUntil,_=n.addImport(f);n.pushCode(`while (!${_}.call(${n.generateVariable()}, ${l}, buffer.subarray(offset)));`)}}generateChoiceCase(n,t,i){if(typeof i=="string"){const a=n.generateVariable(this.varName);if(x.has(i)){const r=n.generateTmpVariable();n.pushCode(`var ${r} = ${re+i}(offset, {`),n.useContextVariables&&(n.pushCode(`$parent: ${a}.$parent,`),n.pushCode(`$root: ${a}.$root,`)),n.pushCode("});"),n.pushCode(`${a} = ${r}.result; offset = ${r}.offset;`),i!==this.alias&&n.addReference(i)}else{const r=Ye[i],o=Ke[i];n.pushCode(`${a} = dataView.get${r}(offset, ${o});`),n.pushCode(`offset += ${M[i]}`)}}else i instanceof S&&(n.pushPath(t),i.generate(n),n.popPath(t))}generateChoice(n){const t=n.generateOption(this.options.tag),i=n.generateVariable(this.varName);if(this.varName&&(n.pushCode(`${i} = {};`),n.useContextVariables)){const a=n.generateVariable();n.pushCode(`${i}.$parent = ${a};`),n.pushCode(`${i}.$root = ${a}.$root;`)}n.pushCode(`switch(${t}) {`);for(const a in this.options.choices){const r=parseInt(a,10),o=this.options.choices[r];n.pushCode(`case ${r}:`),this.generateChoiceCase(n,this.varName,o),n.pushCode("break;")}n.pushCode("default:"),this.options.defaultChoice?this.generateChoiceCase(n,this.varName,this.options.defaultChoice):n.generateError(`"Met undefined tag value " + ${t} + " at choice"`),n.pushCode("}"),this.varName&&n.useContextVariables&&(n.pushCode(`delete ${i}.$parent;`),n.pushCode(`delete ${i}.$root;`))}generateNest(n){const t=n.generateVariable(this.varName);if(this.options.type instanceof S){if(this.varName&&(n.pushCode(`${t} = {};`),n.useContextVariables)){const i=n.generateVariable();n.pushCode(`${t}.$parent = ${i};`),n.pushCode(`${t}.$root = ${i}.$root;`)}n.pushPath(this.varName),this.options.type.generate(n),n.popPath(this.varName),this.varName&&n.useContextVariables&&n.useContextVariables&&(n.pushCode(`delete ${t}.$parent;`),n.pushCode(`delete ${t}.$root;`))}else if(x.has(this.options.type)){const i=n.generateTmpVariable();if(n.pushCode(`var ${i} = ${re+this.options.type}(offset, {`),n.useContextVariables){const a=n.generateVariable();n.pushCode(`$parent: ${a},`),n.pushCode(`$root: ${a}.$root,`)}n.pushCode("});"),n.pushCode(`${t} = ${i}.result; offset = ${i}.offset;`),this.options.type!==this.alias&&n.addReference(this.options.type)}}generateWrapper(n){const t=n.generateVariable(this.varName),i=n.generateTmpVariable();if(typeof this.options.readUntil=="function"){const u=this.options.readUntil,s=n.generateTmpVariable(),f=n.generateTmpVariable();n.pushCode(`var ${s} = offset;`),n.pushCode(`var ${f} = 0;`),n.pushCode("while (offset < buffer.length) {"),n.pushCode(`${f} = dataView.getUint8(offset);`);const _=n.addImport(u);n.pushCode(`if (${_}.call(${n.generateVariable()}, ${f}, buffer.subarray(offset))) break;`),n.pushCode("offset += 1;"),n.pushCode("}"),n.pushCode(`${i} = buffer.subarray(${s}, offset);`)}else if(this.options.readUntil==="eof")n.pushCode(`${i} = buffer.subarray(offset);`);else{const u=n.generateOption(this.options.length);n.pushCode(`${i} = buffer.subarray(offset, offset + ${u});`),n.pushCode(`offset += ${u};`)}this.options.clone&&n.pushCode(`${i} = buffer.constructor.from(${i});`);const a=n.generateTmpVariable(),r=n.generateTmpVariable(),o=n.generateTmpVariable(),l=n.addImport(this.options.wrapper);if(n.pushCode(`${i} = ${l}.call(this, ${i}).subarray(0);`),n.pushCode(`var ${a} = buffer;`),n.pushCode(`var ${r} = offset;`),n.pushCode(`var ${o} = dataView;`),n.pushCode(`buffer = ${i};`),n.pushCode("offset = 0;"),n.pushCode("dataView = new DataView(buffer.buffer, buffer.byteOffset, buffer.length);"),this.options.type instanceof S)this.varName&&n.pushCode(`${t} = {};`),n.pushPath(this.varName),this.options.type.generate(n),n.popPath(this.varName);else if(x.has(this.options.type)){const u=n.generateTmpVariable();n.pushCode(`var ${u} = ${re+this.options.type}(0);`),n.pushCode(`${t} = ${u}.result;`),this.options.type!==this.alias&&n.addReference(this.options.type)}n.pushCode(`buffer = ${a};`),n.pushCode(`dataView = ${o};`),n.pushCode(`offset = ${r};`)}generateFormatter(n,t,i){if(typeof i=="function"){const a=n.addImport(i);n.pushCode(`${t} = ${a}.call(${n.generateVariable()}, ${t});`)}}generatePointer(n){const t=this.options.type,i=n.generateOption(this.options.offset),a=n.generateTmpVariable(),r=n.generateVariable(this.varName);if(n.pushCode(`var ${a} = offset;`),n.pushCode(`offset = ${i};`),this.options.type instanceof S){if(n.pushCode(`${r} = {};`),n.useContextVariables){const o=n.generateVariable();n.pushCode(`${r}.$parent = ${o};`),n.pushCode(`${r}.$root = ${o}.$root;`)}n.pushPath(this.varName),this.options.type.generate(n),n.popPath(this.varName),n.useContextVariables&&(n.pushCode(`delete ${r}.$parent;`),n.pushCode(`delete ${r}.$root;`))}else if(x.has(this.options.type)){const o=n.generateTmpVariable();if(n.pushCode(`var ${o} = ${re+this.options.type}(offset, {`),n.useContextVariables){const l=n.generateVariable();n.pushCode(`$parent: ${l},`),n.pushCode(`$root: ${l}.$root,`)}n.pushCode("});"),n.pushCode(`${r} = ${o}.result; offset = ${o}.offset;`),this.options.type!==this.alias&&n.addReference(this.options.type)}else if(Object.keys(M).indexOf(this.options.type)>=0){const o=Ye[t],l=Ke[t];n.pushCode(`${r} = dataView.get${o}(offset, ${l});`),n.pushCode(`offset += ${M[t]};`)}n.pushCode(`offset = ${a};`)}generateSaveOffset(n){const t=n.generateVariable(this.varName);n.pushCode(`${t} = offset`)}}class pe{constructor(n){this.ranges=n}get min(){return this.ranges[0].min}get max(){return this.ranges[this.ranges.length-1].max}contains(n){for(const t of this.ranges)if(t.min<=n&&t.max>=n)return!0;return!1}isContiguous(){return this.ranges.length>1}getRanges(){return this.ranges.map(n=>new pe([{min:n.min,max:n.max}]))}toString(){return this.ranges.map(n=>`[${n.min}-${n.max}]`).join(",")}union(n){const t=[...this.getRanges(),...n.getRanges()].sort((r,o)=>r.mino.min?1:r.maxr.max?1:0),i=[];let a=t[0];for(const r of t)r.min>a.max+1?(i.push(a),a=r):r.max>a.max&&(a=new pe([{min:a.min,max:r.max}]));return i.push(a),i.length===1?i[0]:new pe(i)}}/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const fr=4,Qt=0,en=1,ur=2;function ye(e){let n=e.length;for(;--n>=0;)e[n]=0}const hr=0,Kn=1,cr=2,dr=3,pr=258,Zt=29,Ze=256,Oe=Ze+1+Zt,_e=30,xt=19,Wn=2*Oe+1,ae=15,ht=16,_r=7,Mt=256,Xn=16,qn=17,Jn=18,Tt=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),nt=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),br=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Qn=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),gr=512,W=new Array((Oe+2)*2);ye(W);const Ie=new Array(_e*2);ye(Ie);const ze=new Array(gr);ye(ze);const Re=new Array(pr-dr+1);ye(Re);const Ht=new Array(Zt);ye(Ht);const it=new Array(_e);ye(it);function ct(e,n,t,i,a){this.static_tree=e,this.extra_bits=n,this.extra_base=t,this.elems=i,this.max_length=a,this.has_stree=e&&e.length}let ei,ti,ni;function dt(e,n){this.dyn_tree=e,this.max_code=0,this.stat_desc=n}const ii=e=>e<256?ze[e]:ze[256+(e>>>7)],Be=(e,n)=>{e.pending_buf[e.pending++]=n&255,e.pending_buf[e.pending++]=n>>>8&255},D=(e,n,t)=>{e.bi_valid>ht-t?(e.bi_buf|=n<>ht-e.bi_valid,e.bi_valid+=t-ht):(e.bi_buf|=n<{D(e,t[n*2],t[n*2+1])},ri=(e,n)=>{let t=0;do t|=e&1,e>>>=1,t<<=1;while(--n>0);return t>>>1},wr=e=>{e.bi_valid===16?(Be(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},mr=(e,n)=>{const t=n.dyn_tree,i=n.max_code,a=n.stat_desc.static_tree,r=n.stat_desc.has_stree,o=n.stat_desc.extra_bits,l=n.stat_desc.extra_base,u=n.stat_desc.max_length;let s,f,_,c,h,d,g=0;for(c=0;c<=ae;c++)e.bl_count[c]=0;for(t[e.heap[e.heap_max]*2+1]=0,s=e.heap_max+1;su&&(c=u,g++),t[f*2+1]=c,!(f>i)&&(e.bl_count[c]++,h=0,f>=l&&(h=o[f-l]),d=t[f*2],e.opt_len+=d*(c+h),r&&(e.static_len+=d*(a[f*2+1]+h)));if(g!==0){do{for(c=u-1;e.bl_count[c]===0;)c--;e.bl_count[c]--,e.bl_count[c+1]+=2,e.bl_count[u]--,g-=2}while(g>0);for(c=u;c!==0;c--)for(f=e.bl_count[c];f!==0;)_=e.heap[--s],!(_>i)&&(t[_*2+1]!==c&&(e.opt_len+=(c-t[_*2+1])*t[_*2],t[_*2+1]=c),f--)}},ai=(e,n,t)=>{const i=new Array(ae+1);let a=0,r,o;for(r=1;r<=ae;r++)a=a+t[r-1]<<1,i[r]=a;for(o=0;o<=n;o++){let l=e[o*2+1];l!==0&&(e[o*2]=ri(i[l]++,l))}},yr=()=>{let e,n,t,i,a;const r=new Array(ae+1);for(t=0,i=0;i>=7;i<_e;i++)for(it[i]=a<<7,e=0;e<1<{let n;for(n=0;n{e.bi_valid>8?Be(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},tn=(e,n,t,i)=>{const a=n*2,r=t*2;return e[a]{const i=e.heap[t];let a=t<<1;for(;a<=e.heap_len&&(a{let i,a,r=0,o,l;if(e.sym_next!==0)do i=e.pending_buf[e.sym_buf+r++]&255,i+=(e.pending_buf[e.sym_buf+r++]&255)<<8,a=e.pending_buf[e.sym_buf+r++],i===0?j(e,a,n):(o=Re[a],j(e,o+Ze+1,n),l=Tt[o],l!==0&&(a-=Ht[o],D(e,a,l)),i--,o=ii(i),j(e,o,t),l=nt[o],l!==0&&(i-=it[o],D(e,i,l)));while(r{const t=n.dyn_tree,i=n.stat_desc.static_tree,a=n.stat_desc.has_stree,r=n.stat_desc.elems;let o,l,u=-1,s;for(e.heap_len=0,e.heap_max=Wn,o=0;o>1;o>=1;o--)pt(e,t,o);s=r;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],pt(e,t,1),l=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=l,t[s*2]=t[o*2]+t[l*2],e.depth[s]=(e.depth[o]>=e.depth[l]?e.depth[o]:e.depth[l])+1,t[o*2+1]=t[l*2+1]=s,e.heap[1]=s++,pt(e,t,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],mr(e,n),ai(t,u,e.bl_count)},rn=(e,n,t)=>{let i,a=-1,r,o=n[0*2+1],l=0,u=7,s=4;for(o===0&&(u=138,s=3),n[(t+1)*2+1]=65535,i=0;i<=t;i++)r=o,o=n[(i+1)*2+1],!(++l{let i,a=-1,r,o=n[0*2+1],l=0,u=7,s=4;for(o===0&&(u=138,s=3),i=0;i<=t;i++)if(r=o,o=n[(i+1)*2+1],!(++l{let n;for(rn(e,e.dyn_ltree,e.l_desc.max_code),rn(e,e.dyn_dtree,e.d_desc.max_code),At(e,e.bl_desc),n=xt-1;n>=3&&e.bl_tree[Qn[n]*2+1]===0;n--);return e.opt_len+=3*(n+1)+5+5+4,n},kr=(e,n,t,i)=>{let a;for(D(e,n-257,5),D(e,t-1,5),D(e,i-4,4),a=0;a{let n=4093624447,t;for(t=0;t<=31;t++,n>>>=1)if(n&1&&e.dyn_ltree[t*2]!==0)return Qt;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return en;for(t=32;t{on||(yr(),on=!0),e.l_desc=new dt(e.dyn_ltree,ei),e.d_desc=new dt(e.dyn_dtree,ti),e.bl_desc=new dt(e.bl_tree,ni),e.bi_buf=0,e.bi_valid=0,oi(e)},li=(e,n,t,i)=>{D(e,(hr<<1)+(i?1:0),3),si(e),Be(e,t),Be(e,~t),t&&e.pending_buf.set(e.window.subarray(n,n+t),e.pending),e.pending+=t},Cr=e=>{D(e,Kn<<1,3),j(e,Mt,W),wr(e)},Sr=(e,n,t,i)=>{let a,r,o=0;e.level>0?(e.strm.data_type===ur&&(e.strm.data_type=$r(e)),At(e,e.l_desc),At(e,e.d_desc),o=vr(e),a=e.opt_len+3+7>>>3,r=e.static_len+3+7>>>3,r<=a&&(a=r)):a=r=t+5,t+4<=a&&n!==-1?li(e,n,t,i):e.strategy===fr||r===a?(D(e,(Kn<<1)+(i?1:0),3),nn(e,W,Ie)):(D(e,(cr<<1)+(i?1:0),3),kr(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),nn(e,e.dyn_ltree,e.dyn_dtree)),oi(e),i&&si(e)},Nr=(e,n,t)=>(e.pending_buf[e.sym_buf+e.sym_next++]=n,e.pending_buf[e.sym_buf+e.sym_next++]=n>>8,e.pending_buf[e.sym_buf+e.sym_next++]=t,n===0?e.dyn_ltree[t*2]++:(e.matches++,n--,e.dyn_ltree[(Re[t]+Ze+1)*2]++,e.dyn_dtree[ii(n)*2]++),e.sym_next===e.sym_end);var Ir=Er,Tr=li,Ar=Sr,Or=Nr,zr=Cr,Rr={_tr_init:Ir,_tr_stored_block:Tr,_tr_flush_block:Ar,_tr_tally:Or,_tr_align:zr};const Br=(e,n,t,i)=>{let a=e&65535|0,r=e>>>16&65535|0,o=0;for(;t!==0;){o=t>2e3?2e3:t,t-=o;do a=a+n[i++]|0,r=r+a|0;while(--o);a%=65521,r%=65521}return a|r<<16|0};var Ue=Br;const Ur=()=>{let e,n=[];for(var t=0;t<256;t++){e=t;for(var i=0;i<8;i++)e=e&1?3988292384^e>>>1:e>>>1;n[t]=e}return n},Dr=new Uint32Array(Ur()),Vr=(e,n,t,i)=>{const a=Dr,r=i+t;e^=-1;for(let o=i;o>>8^a[(e^n[o])&255];return e^-1};var R=Vr,ge={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},xe={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:Fr,_tr_stored_block:Ot,_tr_flush_block:Lr,_tr_tally:ee,_tr_align:Pr}=Rr,{Z_NO_FLUSH:te,Z_PARTIAL_FLUSH:Zr,Z_FULL_FLUSH:xr,Z_FINISH:L,Z_BLOCK:sn,Z_OK:B,Z_STREAM_END:ln,Z_STREAM_ERROR:G,Z_DATA_ERROR:Mr,Z_BUF_ERROR:_t,Z_DEFAULT_COMPRESSION:Hr,Z_FILTERED:jr,Z_HUFFMAN_ONLY:We,Z_RLE:Gr,Z_FIXED:Yr,Z_DEFAULT_STRATEGY:Kr,Z_UNKNOWN:Wr,Z_DEFLATED:lt}=xe,Xr=9,qr=15,Jr=8,Qr=29,ea=256,zt=ea+1+Qr,ta=30,na=19,ia=2*zt+1,ra=15,T=3,Q=258,Y=Q+T+1,aa=32,we=42,jt=57,Rt=69,Bt=73,Ut=91,Dt=103,oe=113,Se=666,U=1,ve=2,fe=3,ke=4,oa=3,se=(e,n)=>(e.msg=ge[n],n),fn=e=>e*2-(e>4?9:0),q=e=>{let n=e.length;for(;--n>=0;)e[n]=0},sa=e=>{let n,t,i,a=e.w_size;n=e.hash_size,i=n;do t=e.head[--i],e.head[i]=t>=a?t-a:0;while(--n);n=a,i=n;do t=e.prev[--i],e.prev[i]=t>=a?t-a:0;while(--n)};let la=(e,n,t)=>(n<{const n=e.state;let t=n.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.output.set(n.pending_buf.subarray(n.pending_out,n.pending_out+t),e.next_out),e.next_out+=t,n.pending_out+=t,e.total_out+=t,e.avail_out-=t,n.pending-=t,n.pending===0&&(n.pending_out=0))},F=(e,n)=>{Lr(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,n),e.block_start=e.strstart,V(e.strm)},A=(e,n)=>{e.pending_buf[e.pending++]=n},Ce=(e,n)=>{e.pending_buf[e.pending++]=n>>>8&255,e.pending_buf[e.pending++]=n&255},Vt=(e,n,t,i)=>{let a=e.avail_in;return a>i&&(a=i),a===0?0:(e.avail_in-=a,n.set(e.input.subarray(e.next_in,e.next_in+a),t),e.state.wrap===1?e.adler=Ue(e.adler,n,a,t):e.state.wrap===2&&(e.adler=R(e.adler,n,a,t)),e.next_in+=a,e.total_in+=a,a)},fi=(e,n)=>{let t=e.max_chain_length,i=e.strstart,a,r,o=e.prev_length,l=e.nice_match;const u=e.strstart>e.w_size-Y?e.strstart-(e.w_size-Y):0,s=e.window,f=e.w_mask,_=e.prev,c=e.strstart+Q;let h=s[i+o-1],d=s[i+o];e.prev_length>=e.good_match&&(t>>=2),l>e.lookahead&&(l=e.lookahead);do if(a=n,!(s[a+o]!==d||s[a+o-1]!==h||s[a]!==s[i]||s[++a]!==s[i+1])){i+=2,a++;do;while(s[++i]===s[++a]&&s[++i]===s[++a]&&s[++i]===s[++a]&&s[++i]===s[++a]&&s[++i]===s[++a]&&s[++i]===s[++a]&&s[++i]===s[++a]&&s[++i]===s[++a]&&io){if(e.match_start=n,o=r,r>=l)break;h=s[i+o-1],d=s[i+o]}}while((n=_[n&f])>u&&--t!==0);return o<=e.lookahead?o:e.lookahead},me=e=>{const n=e.w_size;let t,i,a;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=n+(n-Y)&&(e.window.set(e.window.subarray(n,n+n-i),0),e.match_start-=n,e.strstart-=n,e.block_start-=n,e.insert>e.strstart&&(e.insert=e.strstart),sa(e),i+=n),e.strm.avail_in===0)break;if(t=Vt(e.strm,e.window,e.strstart+e.lookahead,i),e.lookahead+=t,e.lookahead+e.insert>=T)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=ne(e,e.ins_h,e.window[a+1]);e.insert&&(e.ins_h=ne(e,e.ins_h,e.window[a+T-1]),e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(e.lookahead+e.insert{let t=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,i,a,r,o=0,l=e.strm.avail_in;do{if(i=65535,r=e.bi_valid+42>>3,e.strm.avail_outa+e.strm.avail_in&&(i=a+e.strm.avail_in),i>r&&(i=r),i>8,e.pending_buf[e.pending-2]=~i,e.pending_buf[e.pending-1]=~i>>8,V(e.strm),a&&(a>i&&(a=i),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+a),e.strm.next_out),e.strm.next_out+=a,e.strm.avail_out-=a,e.strm.total_out+=a,e.block_start+=a,i-=a),i&&(Vt(e.strm,e.strm.output,e.strm.next_out,i),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i)}while(o===0);return l-=e.strm.avail_in,l&&(l>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=l&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-l,e.strm.next_in),e.strstart),e.strstart+=l,e.insert+=l>e.w_size-e.insert?e.w_size-e.insert:l),e.block_start=e.strstart),e.high_waterr&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,r+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),r>e.strm.avail_in&&(r=e.strm.avail_in),r&&(Vt(e.strm,e.window,e.strstart,r),e.strstart+=r,e.insert+=r>e.w_size-e.insert?e.w_size-e.insert:r),e.high_water>3,r=e.pending_buf_size-r>65535?65535:e.pending_buf_size-r,t=r>e.w_size?e.w_size:r,a=e.strstart-e.block_start,(a>=t||(a||n===L)&&n!==te&&e.strm.avail_in===0&&a<=r)&&(i=a>r?r:a,o=n===L&&e.strm.avail_in===0&&i===a?1:0,Ot(e,e.block_start,i,o),e.block_start+=i,V(e.strm)),o?fe:U)},bt=(e,n)=>{let t,i;for(;;){if(e.lookahead=T&&(e.ins_h=ne(e,e.ins_h,e.window[e.strstart+T-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),t!==0&&e.strstart-t<=e.w_size-Y&&(e.match_length=fi(e,t)),e.match_length>=T)if(i=ee(e,e.strstart-e.match_start,e.match_length-T),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=T){e.match_length--;do e.strstart++,e.ins_h=ne(e,e.ins_h,e.window[e.strstart+T-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=ne(e,e.ins_h,e.window[e.strstart+1]);else i=ee(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(F(e,!1),e.strm.avail_out===0))return U}return e.insert=e.strstart{let t,i,a;for(;;){if(e.lookahead=T&&(e.ins_h=ne(e,e.ins_h,e.window[e.strstart+T-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=T-1,t!==0&&e.prev_length4096)&&(e.match_length=T-1)),e.prev_length>=T&&e.match_length<=e.prev_length){a=e.strstart+e.lookahead-T,i=ee(e,e.strstart-1-e.prev_match,e.prev_length-T),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=a&&(e.ins_h=ne(e,e.ins_h,e.window[e.strstart+T-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=T-1,e.strstart++,i&&(F(e,!1),e.strm.avail_out===0))return U}else if(e.match_available){if(i=ee(e,0,e.window[e.strstart-1]),i&&F(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return U}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(i=ee(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart{let t,i,a,r;const o=e.window;for(;;){if(e.lookahead<=Q){if(me(e),e.lookahead<=Q&&n===te)return U;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=T&&e.strstart>0&&(a=e.strstart-1,i=o[a],i===o[++a]&&i===o[++a]&&i===o[++a])){r=e.strstart+Q;do;while(i===o[++a]&&i===o[++a]&&i===o[++a]&&i===o[++a]&&i===o[++a]&&i===o[++a]&&i===o[++a]&&i===o[++a]&&ae.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=T?(t=ee(e,1,e.match_length-T),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(t=ee(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),t&&(F(e,!1),e.strm.avail_out===0))return U}return e.insert=0,n===L?(F(e,!0),e.strm.avail_out===0?fe:ke):e.sym_next&&(F(e,!1),e.strm.avail_out===0)?U:ve},ua=(e,n)=>{let t;for(;;){if(e.lookahead===0&&(me(e),e.lookahead===0)){if(n===te)return U;break}if(e.match_length=0,t=ee(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,t&&(F(e,!1),e.strm.avail_out===0))return U}return e.insert=0,n===L?(F(e,!0),e.strm.avail_out===0?fe:ke):e.sym_next&&(F(e,!1),e.strm.avail_out===0)?U:ve};function H(e,n,t,i,a){this.good_length=e,this.max_lazy=n,this.nice_length=t,this.max_chain=i,this.func=a}const Ne=[new H(0,0,0,0,ui),new H(4,4,8,4,bt),new H(4,5,16,8,bt),new H(4,6,32,32,bt),new H(4,4,16,16,ce),new H(8,16,32,32,ce),new H(8,16,128,128,ce),new H(8,32,128,256,ce),new H(32,128,258,1024,ce),new H(32,258,258,4096,ce)],ha=e=>{e.window_size=2*e.w_size,q(e.head),e.max_lazy_match=Ne[e.level].max_lazy,e.good_match=Ne[e.level].good_length,e.nice_match=Ne[e.level].nice_length,e.max_chain_length=Ne[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=T-1,e.match_available=0,e.ins_h=0};function ca(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=lt,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(ia*2),this.dyn_dtree=new Uint16Array((2*ta+1)*2),this.bl_tree=new Uint16Array((2*na+1)*2),q(this.dyn_ltree),q(this.dyn_dtree),q(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(ra+1),this.heap=new Uint16Array(2*zt+1),q(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*zt+1),q(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Me=e=>{if(!e)return 1;const n=e.state;return!n||n.strm!==e||n.status!==we&&n.status!==jt&&n.status!==Rt&&n.status!==Bt&&n.status!==Ut&&n.status!==Dt&&n.status!==oe&&n.status!==Se?1:0},hi=e=>{if(Me(e))return se(e,G);e.total_in=e.total_out=0,e.data_type=Wr;const n=e.state;return n.pending=0,n.pending_out=0,n.wrap<0&&(n.wrap=-n.wrap),n.status=n.wrap===2?jt:n.wrap?we:oe,e.adler=n.wrap===2?0:1,n.last_flush=-2,Fr(n),B},ci=e=>{const n=hi(e);return n===B&&ha(e.state),n},da=(e,n)=>Me(e)||e.state.wrap!==2?G:(e.state.gzhead=n,B),di=(e,n,t,i,a,r)=>{if(!e)return G;let o=1;if(n===Hr&&(n=6),i<0?(o=0,i=-i):i>15&&(o=2,i-=16),a<1||a>Xr||t!==lt||i<8||i>15||n<0||n>9||r<0||r>Yr||i===8&&o!==1)return se(e,G);i===8&&(i=9);const l=new ca;return e.state=l,l.strm=e,l.status=we,l.wrap=o,l.gzhead=null,l.w_bits=i,l.w_size=1<di(e,n,lt,qr,Jr,Kr),_a=(e,n)=>{if(Me(e)||n>sn||n<0)return e?se(e,G):G;const t=e.state;if(!e.output||e.avail_in!==0&&!e.input||t.status===Se&&n!==L)return se(e,e.avail_out===0?_t:G);const i=t.last_flush;if(t.last_flush=n,t.pending!==0){if(V(e),e.avail_out===0)return t.last_flush=-1,B}else if(e.avail_in===0&&fn(n)<=fn(i)&&n!==L)return se(e,_t);if(t.status===Se&&e.avail_in!==0)return se(e,_t);if(t.status===we&&t.wrap===0&&(t.status=oe),t.status===we){let a=lt+(t.w_bits-8<<4)<<8,r=-1;if(t.strategy>=We||t.level<2?r=0:t.level<6?r=1:t.level===6?r=2:r=3,a|=r<<6,t.strstart!==0&&(a|=aa),a+=31-a%31,Ce(t,a),t.strstart!==0&&(Ce(t,e.adler>>>16),Ce(t,e.adler&65535)),e.adler=1,t.status=oe,V(e),t.pending!==0)return t.last_flush=-1,B}if(t.status===jt){if(e.adler=0,A(t,31),A(t,139),A(t,8),t.gzhead)A(t,(t.gzhead.text?1:0)+(t.gzhead.hcrc?2:0)+(t.gzhead.extra?4:0)+(t.gzhead.name?8:0)+(t.gzhead.comment?16:0)),A(t,t.gzhead.time&255),A(t,t.gzhead.time>>8&255),A(t,t.gzhead.time>>16&255),A(t,t.gzhead.time>>24&255),A(t,t.level===9?2:t.strategy>=We||t.level<2?4:0),A(t,t.gzhead.os&255),t.gzhead.extra&&t.gzhead.extra.length&&(A(t,t.gzhead.extra.length&255),A(t,t.gzhead.extra.length>>8&255)),t.gzhead.hcrc&&(e.adler=R(e.adler,t.pending_buf,t.pending,0)),t.gzindex=0,t.status=Rt;else if(A(t,0),A(t,0),A(t,0),A(t,0),A(t,0),A(t,t.level===9?2:t.strategy>=We||t.level<2?4:0),A(t,oa),t.status=oe,V(e),t.pending!==0)return t.last_flush=-1,B}if(t.status===Rt){if(t.gzhead.extra){let a=t.pending,r=(t.gzhead.extra.length&65535)-t.gzindex;for(;t.pending+r>t.pending_buf_size;){let l=t.pending_buf_size-t.pending;if(t.pending_buf.set(t.gzhead.extra.subarray(t.gzindex,t.gzindex+l),t.pending),t.pending=t.pending_buf_size,t.gzhead.hcrc&&t.pending>a&&(e.adler=R(e.adler,t.pending_buf,t.pending-a,a)),t.gzindex+=l,V(e),t.pending!==0)return t.last_flush=-1,B;a=0,r-=l}let o=new Uint8Array(t.gzhead.extra);t.pending_buf.set(o.subarray(t.gzindex,t.gzindex+r),t.pending),t.pending+=r,t.gzhead.hcrc&&t.pending>a&&(e.adler=R(e.adler,t.pending_buf,t.pending-a,a)),t.gzindex=0}t.status=Bt}if(t.status===Bt){if(t.gzhead.name){let a=t.pending,r;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>a&&(e.adler=R(e.adler,t.pending_buf,t.pending-a,a)),V(e),t.pending!==0)return t.last_flush=-1,B;a=0}t.gzindexa&&(e.adler=R(e.adler,t.pending_buf,t.pending-a,a)),t.gzindex=0}t.status=Ut}if(t.status===Ut){if(t.gzhead.comment){let a=t.pending,r;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>a&&(e.adler=R(e.adler,t.pending_buf,t.pending-a,a)),V(e),t.pending!==0)return t.last_flush=-1,B;a=0}t.gzindexa&&(e.adler=R(e.adler,t.pending_buf,t.pending-a,a))}t.status=Dt}if(t.status===Dt){if(t.gzhead.hcrc){if(t.pending+2>t.pending_buf_size&&(V(e),t.pending!==0))return t.last_flush=-1,B;A(t,e.adler&255),A(t,e.adler>>8&255),e.adler=0}if(t.status=oe,V(e),t.pending!==0)return t.last_flush=-1,B}if(e.avail_in!==0||t.lookahead!==0||n!==te&&t.status!==Se){let a=t.level===0?ui(t,n):t.strategy===We?ua(t,n):t.strategy===Gr?fa(t,n):Ne[t.level].func(t,n);if((a===fe||a===ke)&&(t.status=Se),a===U||a===fe)return e.avail_out===0&&(t.last_flush=-1),B;if(a===ve&&(n===Zr?Pr(t):n!==sn&&(Ot(t,0,0,!1),n===xr&&(q(t.head),t.lookahead===0&&(t.strstart=0,t.block_start=0,t.insert=0))),V(e),e.avail_out===0))return t.last_flush=-1,B}return n!==L?B:t.wrap<=0?ln:(t.wrap===2?(A(t,e.adler&255),A(t,e.adler>>8&255),A(t,e.adler>>16&255),A(t,e.adler>>24&255),A(t,e.total_in&255),A(t,e.total_in>>8&255),A(t,e.total_in>>16&255),A(t,e.total_in>>24&255)):(Ce(t,e.adler>>>16),Ce(t,e.adler&65535)),V(e),t.wrap>0&&(t.wrap=-t.wrap),t.pending!==0?B:ln)},ba=e=>{if(Me(e))return G;const n=e.state.status;return e.state=null,n===oe?se(e,Mr):B},ga=(e,n)=>{let t=n.length;if(Me(e))return G;const i=e.state,a=i.wrap;if(a===2||a===1&&i.status!==we||i.lookahead)return G;if(a===1&&(e.adler=Ue(e.adler,n,t,0)),i.wrap=0,t>=i.w_size){a===0&&(q(i.head),i.strstart=0,i.block_start=0,i.insert=0);let u=new Uint8Array(i.w_size);u.set(n.subarray(t-i.w_size,t),0),n=u,t=i.w_size}const r=e.avail_in,o=e.next_in,l=e.input;for(e.avail_in=t,e.next_in=0,e.input=n,me(i);i.lookahead>=T;){let u=i.strstart,s=i.lookahead-(T-1);do i.ins_h=ne(i,i.ins_h,i.window[u+T-1]),i.prev[u&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=u,u++;while(--s);i.strstart=u,i.lookahead=T-1,me(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=T-1,i.match_available=0,e.next_in=o,e.input=l,e.avail_in=r,i.wrap=a,B};var wa=pa,ma=di,ya=ci,va=hi,ka=da,$a=_a,Ea=ba,Ca=ga,Sa="pako deflate (from Nodeca project)",Te={deflateInit:wa,deflateInit2:ma,deflateReset:ya,deflateResetKeep:va,deflateSetHeader:ka,deflate:$a,deflateEnd:Ea,deflateSetDictionary:Ca,deflateInfo:Sa};const Na=(e,n)=>Object.prototype.hasOwnProperty.call(e,n);var Ia=function(e){const n=Array.prototype.slice.call(arguments,1);for(;n.length;){const t=n.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(const i in t)Na(t,i)&&(e[i]=t[i])}}return e},Ta=e=>{let n=0;for(let i=0,a=e.length;i=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;De[254]=De[254]=1;var Aa=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let n,t,i,a,r,o=e.length,l=0;for(a=0;a>>6,n[r++]=128|t&63):t<65536?(n[r++]=224|t>>>12,n[r++]=128|t>>>6&63,n[r++]=128|t&63):(n[r++]=240|t>>>18,n[r++]=128|t>>>12&63,n[r++]=128|t>>>6&63,n[r++]=128|t&63);return n};const Oa=(e,n)=>{if(n<65534&&e.subarray&&pi)return String.fromCharCode.apply(null,e.length===n?e:e.subarray(0,n));let t="";for(let i=0;i{const t=n||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,n));let i,a;const r=new Array(t*2);for(a=0,i=0;i4){r[a++]=65533,i+=l-1;continue}for(o&=l===2?31:l===3?15:7;l>1&&i1){r[a++]=65533;continue}o<65536?r[a++]=o:(o-=65536,r[a++]=55296|o>>10&1023,r[a++]=56320|o&1023)}return Oa(r,a)},Ra=(e,n)=>{n=n||e.length,n>e.length&&(n=e.length);let t=n-1;for(;t>=0&&(e[t]&192)===128;)t--;return t<0||t===0?n:t+De[e[t]]>n?t:n},Ve={string2buf:Aa,buf2string:za,utf8border:Ra};function Ba(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var _i=Ba;const bi=Object.prototype.toString,{Z_NO_FLUSH:Ua,Z_SYNC_FLUSH:Da,Z_FULL_FLUSH:Va,Z_FINISH:Fa,Z_OK:rt,Z_STREAM_END:La,Z_DEFAULT_COMPRESSION:Pa,Z_DEFAULT_STRATEGY:Za,Z_DEFLATED:xa}=xe;function Gt(e){this.options=ft.assign({level:Pa,method:xa,chunkSize:16384,windowBits:15,memLevel:8,strategy:Za},e||{});let n=this.options;n.raw&&n.windowBits>0?n.windowBits=-n.windowBits:n.gzip&&n.windowBits>0&&n.windowBits<16&&(n.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new _i,this.strm.avail_out=0;let t=Te.deflateInit2(this.strm,n.level,n.method,n.windowBits,n.memLevel,n.strategy);if(t!==rt)throw new Error(ge[t]);if(n.header&&Te.deflateSetHeader(this.strm,n.header),n.dictionary){let i;if(typeof n.dictionary=="string"?i=Ve.string2buf(n.dictionary):bi.call(n.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(n.dictionary):i=n.dictionary,t=Te.deflateSetDictionary(this.strm,i),t!==rt)throw new Error(ge[t]);this._dict_set=!0}}Gt.prototype.push=function(e,n){const t=this.strm,i=this.options.chunkSize;let a,r;if(this.ended)return!1;for(n===~~n?r=n:r=n===!0?Fa:Ua,typeof e=="string"?t.input=Ve.string2buf(e):bi.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){if(t.avail_out===0&&(t.output=new Uint8Array(i),t.next_out=0,t.avail_out=i),(r===Da||r===Va)&&t.avail_out<=6){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(a=Te.deflate(t,r),a===La)return t.next_out>0&&this.onData(t.output.subarray(0,t.next_out)),a=Te.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===rt;if(t.avail_out===0){this.onData(t.output);continue}if(r>0&&t.next_out>0){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(t.avail_in===0)break}return!0};Gt.prototype.onData=function(e){this.chunks.push(e)};Gt.prototype.onEnd=function(e){e===rt&&(this.result=ft.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const Xe=16209,Ma=16191;var Ha=function(n,t){let i,a,r,o,l,u,s,f,_,c,h,d,g,k,y,E,C,p,$,N,b,m,w,v;const I=n.state;i=n.next_in,w=n.input,a=i+(n.avail_in-5),r=n.next_out,v=n.output,o=r-(t-n.avail_out),l=r+(n.avail_out-257),u=I.dmax,s=I.wsize,f=I.whave,_=I.wnext,c=I.window,h=I.hold,d=I.bits,g=I.lencode,k=I.distcode,y=(1<>>24,h>>>=p,d-=p,p=C>>>16&255,p===0)v[r++]=C&65535;else if(p&16){$=C&65535,p&=15,p&&(d>>=p,d-=p),d<15&&(h+=w[i++]<>>24,h>>>=p,d-=p,p=C>>>16&255,p&16){if(N=C&65535,p&=15,du){n.msg="invalid distance too far back",I.mode=Xe;break e}if(h>>>=p,d-=p,p=r-o,N>p){if(p=N-p,p>f&&I.sane){n.msg="invalid distance too far back",I.mode=Xe;break e}if(b=0,m=c,_===0){if(b+=s-p,p<$){$-=p;do v[r++]=c[b++];while(--p);b=r-N,m=v}}else if(_2;)v[r++]=m[b++],v[r++]=m[b++],v[r++]=m[b++],$-=3;$&&(v[r++]=m[b++],$>1&&(v[r++]=m[b++]))}else{b=r-N;do v[r++]=v[b++],v[r++]=v[b++],v[r++]=v[b++],$-=3;while($>2);$&&(v[r++]=v[b++],$>1&&(v[r++]=v[b++]))}}else if(p&64){n.msg="invalid distance code",I.mode=Xe;break e}else{C=k[(C&65535)+(h&(1<>3,i-=$,d-=$<<3,h&=(1<{const u=l.bits;let s=0,f=0,_=0,c=0,h=0,d=0,g=0,k=0,y=0,E=0,C,p,$,N,b,m=null,w;const v=new Uint16Array(de+1),I=new Uint16Array(de+1);let ie=null,Jt,je,Ge;for(s=0;s<=de;s++)v[s]=0;for(f=0;f=1&&v[c]===0;c--);if(h>c&&(h=c),c===0)return a[r++]=1<<24|64<<16|0,a[r++]=1<<24|64<<16|0,l.bits=1,0;for(_=1;_0&&(e===cn||c!==1))return-1;for(I[1]=0,s=1;sun||e===dn&&y>hn)return 1;for(;;){Jt=s-g,o[f]+1=w?(je=ie[o[f]-w],Ge=m[o[f]-w]):(je=96,Ge=0),C=1<>g)+p]=Jt<<24|je<<16|Ge|0;while(p!==0);for(C=1<>=1;if(C!==0?(E&=C-1,E+=C):E=0,f++,--v[s]===0){if(s===c)break;s=n[t+o[f]]}if(s>h&&(E&N)!==$){for(g===0&&(g=h),b+=_,d=s-g,k=1<un||e===dn&&y>hn)return 1;$=E&N,a[$]=h<<24|d<<16|b-r|0}}return E!==0&&(a[b+E]=s-g<<24|64<<16|0),l.bits=h,0};var Ae=Wa;const Xa=0,gi=1,wi=2,{Z_FINISH:pn,Z_BLOCK:qa,Z_TREES:qe,Z_OK:ue,Z_STREAM_END:Ja,Z_NEED_DICT:Qa,Z_STREAM_ERROR:P,Z_DATA_ERROR:mi,Z_MEM_ERROR:yi,Z_BUF_ERROR:eo,Z_DEFLATED:_n}=xe,ut=16180,bn=16181,gn=16182,wn=16183,mn=16184,yn=16185,vn=16186,kn=16187,$n=16188,En=16189,at=16190,K=16191,wt=16192,Cn=16193,mt=16194,Sn=16195,Nn=16196,In=16197,Tn=16198,Je=16199,Qe=16200,An=16201,On=16202,zn=16203,Rn=16204,Bn=16205,yt=16206,Un=16207,Dn=16208,O=16209,vi=16210,ki=16211,to=852,no=592,io=15,ro=io,Vn=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function ao(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const he=e=>{if(!e)return 1;const n=e.state;return!n||n.strm!==e||n.modeki?1:0},$i=e=>{if(he(e))return P;const n=e.state;return e.total_in=e.total_out=n.total=0,e.msg="",n.wrap&&(e.adler=n.wrap&1),n.mode=ut,n.last=0,n.havedict=0,n.flags=-1,n.dmax=32768,n.head=null,n.hold=0,n.bits=0,n.lencode=n.lendyn=new Int32Array(to),n.distcode=n.distdyn=new Int32Array(no),n.sane=1,n.back=-1,ue},Ei=e=>{if(he(e))return P;const n=e.state;return n.wsize=0,n.whave=0,n.wnext=0,$i(e)},Ci=(e,n)=>{let t;if(he(e))return P;const i=e.state;return n<0?(t=0,n=-n):(t=(n>>4)+5,n<48&&(n&=15)),n&&(n<8||n>15)?P:(i.window!==null&&i.wbits!==n&&(i.window=null),i.wrap=t,i.wbits=n,Ei(e))},Si=(e,n)=>{if(!e)return P;const t=new ao;e.state=t,t.strm=e,t.window=null,t.mode=ut;const i=Ci(e,n);return i!==ue&&(e.state=null),i},oo=e=>Si(e,ro);let Fn=!0,vt,kt;const so=e=>{if(Fn){vt=new Int32Array(512),kt=new Int32Array(32);let n=0;for(;n<144;)e.lens[n++]=8;for(;n<256;)e.lens[n++]=9;for(;n<280;)e.lens[n++]=7;for(;n<288;)e.lens[n++]=8;for(Ae(gi,e.lens,0,288,vt,0,e.work,{bits:9}),n=0;n<32;)e.lens[n++]=5;Ae(wi,e.lens,0,32,kt,0,e.work,{bits:5}),Fn=!1}e.lencode=vt,e.lenbits=9,e.distcode=kt,e.distbits=5},Ni=(e,n,t,i)=>{let a;const r=e.state;return r.window===null&&(r.wsize=1<=r.wsize?(r.window.set(n.subarray(t-r.wsize,t),0),r.wnext=0,r.whave=r.wsize):(a=r.wsize-r.wnext,a>i&&(a=i),r.window.set(n.subarray(t-i,t-i+a),r.wnext),i-=a,i?(r.window.set(n.subarray(t-i,t),0),r.wnext=i,r.whave=r.wsize):(r.wnext+=a,r.wnext===r.wsize&&(r.wnext=0),r.whave{let t,i,a,r,o,l,u,s,f,_,c,h,d,g,k=0,y,E,C,p,$,N,b,m;const w=new Uint8Array(4);let v,I;const ie=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(he(e)||!e.output||!e.input&&e.avail_in!==0)return P;t=e.state,t.mode===K&&(t.mode=wt),o=e.next_out,a=e.output,u=e.avail_out,r=e.next_in,i=e.input,l=e.avail_in,s=t.hold,f=t.bits,_=l,c=u,m=ue;e:for(;;)switch(t.mode){case ut:if(t.wrap===0){t.mode=wt;break}for(;f<16;){if(l===0)break e;l--,s+=i[r++]<>>8&255,t.check=R(t.check,w,2,0),s=0,f=0,t.mode=bn;break}if(t.head&&(t.head.done=!1),!(t.wrap&1)||(((s&255)<<8)+(s>>8))%31){e.msg="incorrect header check",t.mode=O;break}if((s&15)!==_n){e.msg="unknown compression method",t.mode=O;break}if(s>>>=4,f-=4,b=(s&15)+8,t.wbits===0&&(t.wbits=b),b>15||b>t.wbits){e.msg="invalid window size",t.mode=O;break}t.dmax=1<>8&1),t.flags&512&&t.wrap&4&&(w[0]=s&255,w[1]=s>>>8&255,t.check=R(t.check,w,2,0)),s=0,f=0,t.mode=gn;case gn:for(;f<32;){if(l===0)break e;l--,s+=i[r++]<>>8&255,w[2]=s>>>16&255,w[3]=s>>>24&255,t.check=R(t.check,w,4,0)),s=0,f=0,t.mode=wn;case wn:for(;f<16;){if(l===0)break e;l--,s+=i[r++]<>8),t.flags&512&&t.wrap&4&&(w[0]=s&255,w[1]=s>>>8&255,t.check=R(t.check,w,2,0)),s=0,f=0,t.mode=mn;case mn:if(t.flags&1024){for(;f<16;){if(l===0)break e;l--,s+=i[r++]<>>8&255,t.check=R(t.check,w,2,0)),s=0,f=0}else t.head&&(t.head.extra=null);t.mode=yn;case yn:if(t.flags&1024&&(h=t.length,h>l&&(h=l),h&&(t.head&&(b=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(i.subarray(r,r+h),b)),t.flags&512&&t.wrap&4&&(t.check=R(t.check,i,h,r)),l-=h,r+=h,t.length-=h),t.length))break e;t.length=0,t.mode=vn;case vn:if(t.flags&2048){if(l===0)break e;h=0;do b=i[r+h++],t.head&&b&&t.length<65536&&(t.head.name+=String.fromCharCode(b));while(b&&h>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=K;break;case En:for(;f<32;){if(l===0)break e;l--,s+=i[r++]<>>=f&7,f-=f&7,t.mode=yt;break}for(;f<3;){if(l===0)break e;l--,s+=i[r++]<>>=1,f-=1,s&3){case 0:t.mode=Cn;break;case 1:if(so(t),t.mode=Je,n===qe){s>>>=2,f-=2;break e}break;case 2:t.mode=Nn;break;case 3:e.msg="invalid block type",t.mode=O}s>>>=2,f-=2;break;case Cn:for(s>>>=f&7,f-=f&7;f<32;){if(l===0)break e;l--,s+=i[r++]<>>16^65535)){e.msg="invalid stored block lengths",t.mode=O;break}if(t.length=s&65535,s=0,f=0,t.mode=mt,n===qe)break e;case mt:t.mode=Sn;case Sn:if(h=t.length,h){if(h>l&&(h=l),h>u&&(h=u),h===0)break e;a.set(i.subarray(r,r+h),o),l-=h,r+=h,u-=h,o+=h,t.length-=h;break}t.mode=K;break;case Nn:for(;f<14;){if(l===0)break e;l--,s+=i[r++]<>>=5,f-=5,t.ndist=(s&31)+1,s>>>=5,f-=5,t.ncode=(s&15)+4,s>>>=4,f-=4,t.nlen>286||t.ndist>30){e.msg="too many length or distance symbols",t.mode=O;break}t.have=0,t.mode=In;case In:for(;t.have>>=3,f-=3}for(;t.have<19;)t.lens[ie[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,v={bits:t.lenbits},m=Ae(Xa,t.lens,0,19,t.lencode,0,t.work,v),t.lenbits=v.bits,m){e.msg="invalid code lengths set",t.mode=O;break}t.have=0,t.mode=Tn;case Tn:for(;t.have>>24,E=k>>>16&255,C=k&65535,!(y<=f);){if(l===0)break e;l--,s+=i[r++]<>>=y,f-=y,t.lens[t.have++]=C;else{if(C===16){for(I=y+2;f>>=y,f-=y,t.have===0){e.msg="invalid bit length repeat",t.mode=O;break}b=t.lens[t.have-1],h=3+(s&3),s>>>=2,f-=2}else if(C===17){for(I=y+3;f>>=y,f-=y,b=0,h=3+(s&7),s>>>=3,f-=3}else{for(I=y+7;f>>=y,f-=y,b=0,h=11+(s&127),s>>>=7,f-=7}if(t.have+h>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=O;break}for(;h--;)t.lens[t.have++]=b}}if(t.mode===O)break;if(t.lens[256]===0){e.msg="invalid code -- missing end-of-block",t.mode=O;break}if(t.lenbits=9,v={bits:t.lenbits},m=Ae(gi,t.lens,0,t.nlen,t.lencode,0,t.work,v),t.lenbits=v.bits,m){e.msg="invalid literal/lengths set",t.mode=O;break}if(t.distbits=6,t.distcode=t.distdyn,v={bits:t.distbits},m=Ae(wi,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,v),t.distbits=v.bits,m){e.msg="invalid distances set",t.mode=O;break}if(t.mode=Je,n===qe)break e;case Je:t.mode=Qe;case Qe:if(l>=6&&u>=258){e.next_out=o,e.avail_out=u,e.next_in=r,e.avail_in=l,t.hold=s,t.bits=f,Ha(e,c),o=e.next_out,a=e.output,u=e.avail_out,r=e.next_in,i=e.input,l=e.avail_in,s=t.hold,f=t.bits,t.mode===K&&(t.back=-1);break}for(t.back=0;k=t.lencode[s&(1<>>24,E=k>>>16&255,C=k&65535,!(y<=f);){if(l===0)break e;l--,s+=i[r++]<>p)],y=k>>>24,E=k>>>16&255,C=k&65535,!(p+y<=f);){if(l===0)break e;l--,s+=i[r++]<>>=p,f-=p,t.back+=p}if(s>>>=y,f-=y,t.back+=y,t.length=C,E===0){t.mode=Bn;break}if(E&32){t.back=-1,t.mode=K;break}if(E&64){e.msg="invalid literal/length code",t.mode=O;break}t.extra=E&15,t.mode=An;case An:if(t.extra){for(I=t.extra;f>>=t.extra,f-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=On;case On:for(;k=t.distcode[s&(1<>>24,E=k>>>16&255,C=k&65535,!(y<=f);){if(l===0)break e;l--,s+=i[r++]<>p)],y=k>>>24,E=k>>>16&255,C=k&65535,!(p+y<=f);){if(l===0)break e;l--,s+=i[r++]<>>=p,f-=p,t.back+=p}if(s>>>=y,f-=y,t.back+=y,E&64){e.msg="invalid distance code",t.mode=O;break}t.offset=C,t.extra=E&15,t.mode=zn;case zn:if(t.extra){for(I=t.extra;f>>=t.extra,f-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back",t.mode=O;break}t.mode=Rn;case Rn:if(u===0)break e;if(h=c-u,t.offset>h){if(h=t.offset-h,h>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=O;break}h>t.wnext?(h-=t.wnext,d=t.wsize-h):d=t.wnext-h,h>t.length&&(h=t.length),g=t.window}else g=a,d=o-t.offset,h=t.length;h>u&&(h=u),u-=h,t.length-=h;do a[o++]=g[d++];while(--h);t.length===0&&(t.mode=Qe);break;case Bn:if(u===0)break e;a[o++]=t.length,u--,t.mode=Qe;break;case yt:if(t.wrap){for(;f<32;){if(l===0)break e;l--,s|=i[r++]<{if(he(e))return P;let n=e.state;return n.window&&(n.window=null),e.state=null,ue},uo=(e,n)=>{if(he(e))return P;const t=e.state;return t.wrap&2?(t.head=n,n.done=!1,ue):P},ho=(e,n)=>{const t=n.length;let i,a,r;return he(e)||(i=e.state,i.wrap!==0&&i.mode!==at)?P:i.mode===at&&(a=1,a=Ue(a,n,t,0),a!==i.check)?mi:(r=Ni(e,n,t,t),r?(i.mode=vi,yi):(i.havedict=1,ue))};var co=Ei,po=Ci,_o=$i,bo=oo,go=Si,wo=lo,mo=fo,yo=uo,vo=ho,ko="pako inflate (from Nodeca project)",X={inflateReset:co,inflateReset2:po,inflateResetKeep:_o,inflateInit:bo,inflateInit2:go,inflate:wo,inflateEnd:mo,inflateGetHeader:yo,inflateSetDictionary:vo,inflateInfo:ko};function $o(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var Eo=$o;const Ii=Object.prototype.toString,{Z_NO_FLUSH:Co,Z_FINISH:So,Z_OK:Fe,Z_STREAM_END:$t,Z_NEED_DICT:Et,Z_STREAM_ERROR:No,Z_DATA_ERROR:Ln,Z_MEM_ERROR:Io}=xe;function He(e){this.options=ft.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const n=this.options;n.raw&&n.windowBits>=0&&n.windowBits<16&&(n.windowBits=-n.windowBits,n.windowBits===0&&(n.windowBits=-15)),n.windowBits>=0&&n.windowBits<16&&!(e&&e.windowBits)&&(n.windowBits+=32),n.windowBits>15&&n.windowBits<48&&(n.windowBits&15||(n.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new _i,this.strm.avail_out=0;let t=X.inflateInit2(this.strm,n.windowBits);if(t!==Fe)throw new Error(ge[t]);if(this.header=new Eo,X.inflateGetHeader(this.strm,this.header),n.dictionary&&(typeof n.dictionary=="string"?n.dictionary=Ve.string2buf(n.dictionary):Ii.call(n.dictionary)==="[object ArrayBuffer]"&&(n.dictionary=new Uint8Array(n.dictionary)),n.raw&&(t=X.inflateSetDictionary(this.strm,n.dictionary),t!==Fe)))throw new Error(ge[t])}He.prototype.push=function(e,n){const t=this.strm,i=this.options.chunkSize,a=this.options.dictionary;let r,o,l;if(this.ended)return!1;for(n===~~n?o=n:o=n===!0?So:Co,Ii.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(i),t.next_out=0,t.avail_out=i),r=X.inflate(t,o),r===Et&&a&&(r=X.inflateSetDictionary(t,a),r===Fe?r=X.inflate(t,o):r===Ln&&(r=Et));t.avail_in>0&&r===$t&&t.state.wrap>0&&e[t.next_in]!==0;)X.inflateReset(t),r=X.inflate(t,o);switch(r){case No:case Ln:case Et:case Io:return this.onEnd(r),this.ended=!0,!1}if(l=t.avail_out,t.next_out&&(t.avail_out===0||r===$t))if(this.options.to==="string"){let u=Ve.utf8border(t.output,t.next_out),s=t.next_out-u,f=Ve.buf2string(t.output,u);t.next_out=s,t.avail_out=i-s,s&&t.output.set(t.output.subarray(u,u+s),0),this.onData(f)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(!(r===Fe&&l===0)){if(r===$t)return r=X.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,!0;if(t.avail_in===0)break}}return!0};He.prototype.onData=function(e){this.chunks.push(e)};He.prototype.onEnd=function(e){e===Fe&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=ft.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Yt(e,n){const t=new He(n);if(t.push(e),t.err)throw t.msg||ge[t.err];return t.result}function To(e,n){return n=n||{},n.raw=!0,Yt(e,n)}var Ao=He,Oo=Yt,zo=To,Ro=Yt,Bo=xe,Uo={Inflate:Ao,inflate:Oo,inflateRaw:zo,ungzip:Ro,constants:Bo};const{Inflate:Ds,inflate:Vs,inflateRaw:Do,ungzip:Fs}=Uo;var Vo=Do;function Fo(e){return Vo(e.subarray(2))}class Lo extends Error{constructor(n){super(n),this.code="ERR_ABORTED"}}function Po(e){e.sort((a,r)=>Number(a.offset)-Number(r.offset));const n=[];let t,i;for(const a of e)t&&i&&Number(a.offset)-i<=2e3?(t.length=BigInt(Number(t.length)+Number(a.length)-i+Number(a.offset)),t.blocks.push(a)):n.push(t={blocks:[a],length:a.length,offset:a.offset}),i=Number(t.offset)+Number(t.length);return n}function et(e){if(e&&e.aborted)if(typeof DOMException>"u"){const n=new Lo("aborted");throw n.code="ERR_ABORTED",n}else throw new DOMException("aborted","AbortError")}const Zo=1,xo=2,Mo=3;function Ct(e,n,t,i){return e=t}function Ho(e){const n=e?"big":"little",t=new S().endianess(n).uint32("chromId").uint32("start").uint32("end").uint32("validCnt").floatle("minScore").floatle("maxScore").floatle("sumData").floatle("sumSqData").saveOffset("offset"),i=new S().endianess(n).uint8("isLeaf").skip(1).uint16("cnt").choice({tag:"isLeaf",choices:{1:new S().endianess(n).array("blocksToFetch",{length:"cnt",type:new S().endianess(n).uint32("startChrom").uint32("startBase").uint32("endChrom").uint32("endBase").uint64("blockOffset").uint64("blockSize").saveOffset("offset")}),0:new S().array("recurOffsets",{length:"cnt",type:new S().endianess(n).uint32("startChrom").uint32("startBase").uint32("endChrom").uint32("endBase").uint64("blockOffset").saveOffset("offset")})}}),a=new S().endianess(n).uint32("chromId").int32("start").int32("end").string("rest",{zeroTerminated:!0}).saveOffset("offset");return{bigWigParser:new S().endianess(n).skip(4).int32("blockStart").skip(4).uint32("itemStep").uint32("itemSpan").uint8("blockType").skip(1).uint16("itemCount").choice({tag:"blockType",choices:{[Mo]:new S().array("items",{length:"itemCount",type:new S().floatle("score")}),[xo]:new S().array("items",{length:"itemCount",type:new S().endianess(n).int32("start").floatle("score")}),[Zo]:new S().array("items",{length:"itemCount",type:new S().endianess(n).int32("start").int32("end").floatle("score")})}}),bigBedParser:a,summaryParser:t,leafParser:i}}class Ti{constructor(n,t,i,a,r,o){if(this.bbi=n,this.refsByName=t,this.cirTreeOffset=i,this.isBigEndian=a,this.isCompressed=r,this.blockType=o,this.featureCache=new Gn({cache:new Yn({maxSize:1e3}),fill:async(u,s)=>{const f=Number(u.length),_=Number(u.offset),{buffer:c}=await this.bbi.read(J.Buffer.alloc(f),0,f,_,{signal:s});return c}}),!(i>=0))throw new Error("invalid cirTreeOffset!");const l=Ho(a);this.leafParser=l.leafParser,this.bigBedParser=l.bigBedParser}async readWigData(n,t,i,a,r){try{const{refsByName:o,bbi:l,cirTreeOffset:u,isBigEndian:s}=this,f=o[n];f===void 0&&a.complete();const _={chrId:f,start:t,end:i};this.cirTreePromise||(this.cirTreePromise=l.read(J.Buffer.alloc(48),0,48,Number(u),r));const{buffer:c}=await this.cirTreePromise,h=s?c.readUInt32BE(4):c.readUInt32LE(4);let d=[],g=0;const k=(p,$,N)=>{try{const b=p.subarray($),m=this.leafParser.parse(b);if(m.blocksToFetch&&(d=d.concat(m.blocksToFetch.filter(w=>y(w)).map(w=>({offset:w.blockOffset,length:w.blockSize})))),m.recurOffsets){const w=m.recurOffsets.filter(v=>y(v)).map(v=>Number(v.blockOffset));w.length>0&&C(w,N+1)}}catch(b){a.error(b)}},y=p=>{const{startChrom:$,startBase:N,endChrom:b,endBase:m}=p;return($f||b===f&&m>=t)},E=async(p,$,N)=>{try{const b=$.max-$.min,m=$.min,w=await this.featureCache.get(`${b}_${m}`,{length:b,offset:m},r==null?void 0:r.signal);for(const v of p)$.contains(v)&&(k(w,v-m,N),g-=1,g===0&&this.readFeatures(a,d,{...r,request:_}).catch(I=>a.error(I)))}catch(b){a.error(b)}},C=(p,$)=>{try{g+=p.length;const N=4+Number(h)*32;let b=new pe([{min:p[0],max:p[0]+N}]);for(let m=1;mE(p,m,$))}catch(N){a.error(N)}};return C([Number(u)+48],1)}catch(o){a.error(o)}}parseSummaryBlock(n,t,i){const a=[];let r=t;const o=new DataView(n.buffer,n.byteOffset,n.length);for(;rCt(l.start,l.end,a.start,a.end)):r}parseBigWigBlock(n,t,i){const a=n.subarray(t),r=new DataView(a.buffer,a.byteOffset,a.length);let o=0;o+=4;const l=r.getInt32(o,!0);o+=8;const u=r.getUint32(o,!0);o+=4;const s=r.getUint32(o,!0);o+=4;const f=r.getUint8(o);o+=2;const _=r.getUint16(o,!0);o+=2;const c=new Array(_);switch(f){case 1:{for(let h=0;h<_;h++){const d=r.getInt32(o,!0);o+=4;const g=r.getInt32(o,!0);o+=4;const k=r.getFloat32(o,!0);o+=4,c[h]={start:d,end:g,score:k}}break}case 2:{for(let h=0;h<_;h++){const d=r.getInt32(o,!0);o+=4;const g=r.getFloat32(o,!0);o+=4,c[h]={score:g,start:d,end:d+s}}break}case 3:{for(let h=0;h<_;h++){const d=r.getFloat32(o,!0);o+=4;const g=l+h*u;c[h]={score:d,start:g,end:g+s}}break}}return i?c.filter(h=>Ct(h.start,h.end,i.start,i.end)):c}async readFeatures(n,t,i={}){try{const{blockType:a,isCompressed:r}=this,{signal:o,request:l}=i,u=Po(t);et(o),await Promise.all(u.map(async s=>{et(o);const{length:f,offset:_}=s,c=await this.featureCache.get(`${f}_${_}`,s,o);for(const h of s.blocks){et(o);let d=Number(h.offset)-Number(s.offset),g=c;switch(r&&(g=Fo(c.subarray(d)),d=0),et(o),a){case"summary":{n.next(this.parseSummaryBlock(g,d,l));break}case"bigwig":{n.next(this.parseBigWigBlock(g,d,l));break}case"bigbed":{n.next(this.parseBigBedBlock(g,d,Number(h.offset)*256,l));break}default:console.warn(`Don't know what to do with ${a}`)}}})),n.complete()}catch(a){n.error(a)}}}var Ft=function(e,n){return Ft=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(t[a]=i[a])},Ft(e,n)};function Kt(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");Ft(e,n);function t(){this.constructor=e}e.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}function jo(e,n,t,i){function a(r){return r instanceof t?r:new t(function(o){o(r)})}return new(t||(t=Promise))(function(r,o){function l(f){try{s(i.next(f))}catch(_){o(_)}}function u(f){try{s(i.throw(f))}catch(_){o(_)}}function s(f){f.done?r(f.value):a(f.value).then(l,u)}s((i=i.apply(e,n||[])).next())})}function Ai(e,n){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,a,r,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=l(0),o.throw=l(1),o.return=l(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(s){return function(f){return u([s,f])}}function u(s){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(t=0)),t;)try{if(i=1,a&&(r=s[0]&2?a.return:s[0]?a.throw||((r=a.return)&&r.call(a),0):a.next)&&!(r=r.call(a,s[1])).done)return r;switch(a=0,r&&(s=[s[0]&2,r.value]),s[0]){case 0:case 1:r=s;break;case 4:return t.label++,{value:s[1],done:!1};case 5:t.label++,a=s[1],s=[0];continue;case 7:s=t.ops.pop(),t.trys.pop();continue;default:if(r=t.trys,!(r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){t=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function Lt(e,n){var t=typeof Symbol=="function"&&e[Symbol.iterator];if(!t)return e;var i=t.call(e),a,r=[],o;try{for(;(n===void 0||n-- >0)&&!(a=i.next()).done;)r.push(a.value)}catch(l){o={error:l}}finally{try{a&&!a.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return r}function Pt(e,n,t){if(t||arguments.length===2)for(var i=0,a=n.length,r;i1||u(h,g)})},d&&(a[h]=d(a[h])))}function u(h,d){try{s(i[h](d))}catch(g){c(r[0][3],g)}}function s(h){h.value instanceof be?Promise.resolve(h.value.v).then(f,_):c(r[0][2],h)}function f(h){u("next",h)}function _(h){u("throw",h)}function c(h,d){h(d),r.shift(),r.length&&u(r[0][0],r[0][1])}}function Yo(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=e[Symbol.asyncIterator],t;return n?n.call(e):(e=typeof Le=="function"?Le(e):e[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(r){t[r]=e[r]&&function(o){return new Promise(function(l,u){o=e[r](o),a(l,u,o.done,o.value)})}}function a(r,o,l,u){Promise.resolve(u).then(function(s){r({value:s,done:l})},o)}}function z(e){return typeof e=="function"}function Oi(e){var n=function(i){Error.call(i),i.stack=new Error().stack},t=e(n);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var St=Oi(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription: +`+t.map(function(i,a){return a+1+") "+i.toString()}).join(` + `):"",this.name="UnsubscriptionError",this.errors=t}});function Pn(e,n){if(e){var t=e.indexOf(n);0<=t&&e.splice(t,1)}}var Wt=function(){function e(n){this.initialTeardown=n,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var n,t,i,a,r;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var l=Le(o),u=l.next();!u.done;u=l.next()){var s=u.value;s.remove(this)}}catch(g){n={error:g}}finally{try{u&&!u.done&&(t=l.return)&&t.call(l)}finally{if(n)throw n.error}}else o.remove(this);var f=this.initialTeardown;if(z(f))try{f()}catch(g){r=g instanceof St?g.errors:[g]}var _=this._finalizers;if(_){this._finalizers=null;try{for(var c=Le(_),h=c.next();!h.done;h=c.next()){var d=h.value;try{Zn(d)}catch(g){r=r??[],g instanceof St?r=Pt(Pt([],Lt(r)),Lt(g.errors)):r.push(g)}}}catch(g){i={error:g}}finally{try{h&&!h.done&&(a=c.return)&&a.call(c)}finally{if(i)throw i.error}}}if(r)throw new St(r)}},e.prototype.add=function(n){var t;if(n&&n!==this)if(this.closed)Zn(n);else{if(n instanceof e){if(n.closed||n._hasParent(this))return;n._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(n)}},e.prototype._hasParent=function(n){var t=this._parentage;return t===n||Array.isArray(t)&&t.includes(n)},e.prototype._addParent=function(n){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(n),t):t?[t,n]:n},e.prototype._removeParent=function(n){var t=this._parentage;t===n?this._parentage=null:Array.isArray(t)&&Pn(t,n)},e.prototype.remove=function(n){var t=this._finalizers;t&&Pn(t,n),n instanceof e&&n._removeParent(this)},e.EMPTY=function(){var n=new e;return n.closed=!0,n}(),e}();Wt.EMPTY;function zi(e){return e instanceof Wt||e&&"closed"in e&&z(e.remove)&&z(e.add)&&z(e.unsubscribe)}function Zn(e){z(e)?e():e.unsubscribe()}var Ri={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Bi={setTimeout:function(e,n){for(var t=[],i=2;i=2,!1,!0))}var Ns=function(e,n){return e.push(n),e};function Is(){return $e(function(e,n){er(Ns,[])(e).subscribe(n)})}const Hn=-2003829722,It=-2021002517;function Ts(e){return new TextDecoder().decode(e)}function jn(e){const n=e?"big":"little",t=new S().endianess(n).int32("magic").uint16("version").uint16("numZoomLevels").uint64("chromTreeOffset").uint64("unzoomedDataOffset").uint64("unzoomedIndexOffset").uint16("fieldCount").uint16("definedFieldCount").uint64("asOffset").uint64("totalSummaryOffset").uint32("uncompressBufSize").uint64("extHeaderOffset").array("zoomLevels",{length:"numZoomLevels",type:new S().endianess(n).uint32("reductionLevel").uint32("reserved").uint64("dataOffset").uint64("indexOffset")}),i=new S().endianess(n).uint64("basesCovered").doublele("scoreMin").doublele("scoreMax").doublele("scoreSum").doublele("scoreSumSquares"),a=new S().endianess(n).uint32("magic").uint32("blockSize").uint32("keySize").uint32("valSize").uint64("itemCount"),r=new S().endianess(n).uint8("isLeafNode").skip(1).uint16("cnt").saveOffset("offset");return{chromTreeParser:a,totalSummaryParser:i,headerParser:t,isLeafNode:r}}class tr{getHeader(n){return this.headerP||(this.headerP=this._getHeader(n).catch(t=>{throw this.headerP=void 0,t})),this.headerP}constructor(n){const{filehandle:t,renameRefSeqs:i=o=>o,path:a,url:r}=n;if(this.renameRefSeqs=i,t)this.bbi=t;else if(r)this.bbi=new ir(r);else if(a)this.bbi=new nr(a);else throw new Error("no file given")}async _getHeader(n){const t=await this._getMainHeader(n),i=await this._readChromTree(t,n);return{...t,...i}}async _getMainHeader(n,t=2e3){const{buffer:i}=await this.bbi.read(J.Buffer.alloc(t),0,t,0,n),a=this._isBigEndian(i),r=jn(a),o=r.headerParser.parse(i),{magic:l,asOffset:u,totalSummaryOffset:s}=o;if(o.fileType=l===It?"bigbed":"bigwig",u>t||s>t)return this._getMainHeader(n,t*2);if(u){const f=Number(o.asOffset);o.autoSql=Ts(i.subarray(f,i.indexOf(0,f)))}if(o.totalSummaryOffset>t-8*5)return this._getMainHeader(n,t*2);if(o.totalSummaryOffset){const f=i.subarray(Number(o.totalSummaryOffset)),_=r.totalSummaryParser.parse(f);o.totalSummary={..._,basesCovered:Number(_.basesCovered)}}return{...o,isBigEndian:a}}_isBigEndian(n){let t=n.readInt32LE(0);if(t===Hn||t===It)return!1;if(t=n.readInt32BE(0),t===Hn||t===It)return!0;throw new Error("not a BigWig/BigBed file")}async _readChromTree(n,t){const i=n.isBigEndian,a=i?"big":"little",r=[],o={};let l=Number(n.unzoomedDataOffset);const u=Number(n.chromTreeOffset);for(;l%4!==0;)l+=1;const s=l-u,{buffer:f}=await this.bbi.read(J.Buffer.alloc(s),0,s,Number(u),t),_=jn(i),{keySize:c}=_.chromTreeParser.parse(f),h=new S().endianess(a).string("key",{stripNull:!0,length:c}).uint32("refId").uint32("refSize").saveOffset("offset"),d=new S().endianess(a).skip(c).uint64("childOffset").saveOffset("offset"),g=32,k=async y=>{let E=y;if(E>=f.length)throw new Error("reading beyond end of buffer");const C=_.isLeafNode.parse(f.subarray(E)),{isLeafNode:p,cnt:$}=C;if(E+=C.offset,p)for(let N=0;N<$;N+=1){const b=h.parse(f.subarray(E));E+=b.offset;const{key:m,refId:w,refSize:v}=b,I={name:m,id:w,length:v};o[this.renameRefSeqs(m)]=w,r[w]=I}else{const N=[];for(let b=0;b<$;b+=1){const m=d.parse(f.subarray(E)),{childOffset:w}=m;E+=m.offset,N.push(k(Number(w)-Number(u)))}await Promise.all(N)}};return await k(g),{refsByName:o,refsByNumber:r}}async getUnzoomedView(n){const{unzoomedIndexOffset:t,refsByName:i,uncompressBufSize:a,isBigEndian:r,fileType:o}=await this.getHeader(n);return new Ti(this.bbi,i,t,r,a>0,o)}async getFeatureStream(n,t,i,a){await this.getHeader(a);const r=this.renameRefSeqs(n);let o;const{basesPerSpan:l,scale:u}=a||{};return l?o=await this.getView(1/l,a):u?o=await this.getView(u,a):o=await this.getView(1,a),new Z(s=>{o.readWigData(r,t,i,s,a).catch(f=>s.error(f))})}async getFeatures(n,t,i,a){const r=await this.getFeatureStream(n,t,i,a);return(await qi(r.pipe(Is()))).flat()}}class Ls extends tr{async getView(n,t){const{zoomLevels:i,refsByName:a,fileSize:r,isBigEndian:o,uncompressBufSize:l}=await this.getHeader(t),u=1/n;let s=i.length;r||(s-=1);for(let f=s;f>=0;f-=1){const _=i[f];if(_&&_.reductionLevel<=2*u){const c=Number(_.indexOffset);return new Ti(this.bbi,a,c,o,l>0,"summary")}}return this.getUnzoomedView(t)}}function As(e){return e.filter(n=>!!n)}class Ps extends tr{constructor(){super(...arguments),this.readIndicesCache=new Gn({cache:new Yn({maxSize:1}),fill:(n,t)=>this._readIndices({...n,signal:t})})}readIndices(n={}){const{signal:t,...i}=n;return this.readIndicesCache.get(JSON.stringify(i),n,t)}async getView(n,t){return this.getUnzoomedView(t)}async _readIndices(n){const{extHeaderOffset:t,isBigEndian:i}=await this.getHeader(n),{buffer:a}=await this.bbi.read(J.Buffer.alloc(64),0,64,Number(t)),r=i?"big":"little",o=new S().endianess(r).uint16("size").uint16("count").uint64("offset").parse(a),{count:l,offset:u}=o;if(l===0)return[];const s=20,f=s*l,{buffer:_}=await this.bbi.read(J.Buffer.alloc(f),0,f,Number(u)),c=new S().endianess(r).int16("type").int16("fieldcount").uint64("offset").skip(4).int16("field"),h=[];for(let d=0;d{const{offset:l,field:u}=o,{buffer:s}=await this.bbi.read(J.Buffer.alloc(32),0,32,Number(l),t),f=i?"big":"little",_=new S().endianess(f).int32("magic").int32("blockSize").int32("keySize").int32("valSize").uint64("itemCount"),{blockSize:c,keySize:h,valSize:d}=_.parse(s),g=new S().endianess(f).int8("nodeType").skip(1).int16("cnt").choice({tag:"nodeType",choices:{0:new S().array("leafkeys",{length:"cnt",type:new S().endianess(f).string("key",{length:h,stripNull:!0}).uint64("offset")}),1:new S().array("keys",{length:"cnt",type:new S().endianess(f).string("key",{length:h,stripNull:!0}).uint64("offset").uint32("length").uint32("reserved")})}}),k=async E=>{const C=Number(E),p=4+c*(h+d),{buffer:$}=await this.bbi.read(J.Buffer.alloc(p),0,p,C,t),N=g.parse($);if(N.leafkeys){let b;for(const{key:m,offset:w}of N.leafkeys){if(n.localeCompare(m)<0&&b)return k(b);b=w}return k(b)}for(const b of N.keys)if(b.key===n)return{...b,field:u}};return k(Number(l)+32)});return As(await Promise.all(r))}async searchExtraIndex(n,t={}){const i=await this.searchExtraIndexBlocks(n,t);if(i.length===0)return[];const a=await this.getUnzoomedView(t),r=i.map(l=>new Z(u=>{a.readFeatures(u,[l],t).catch(s=>u.error(s))}).pipe(er((u,s)=>u.concat(s)),Ji(u=>{for(const s of u)s.field=l.field;return u})));return(await qi(Cs(...r))).filter(l=>{var u;return((u=l.rest)===null||u===void 0?void 0:u.split(" ")[(l.field||0)-3])===n})}}export{Ps as BigBed,Ls as BigWig}; diff --git a/playground/assets/index-Bz61Bwul.js b/playground/assets/index-Bz61Bwul.js deleted file mode 100644 index b9da370..0000000 --- a/playground/assets/index-Bz61Bwul.js +++ /dev/null @@ -1,4 +0,0 @@ -import{b as J}from"./index-BHN4ZNUB.js";import{_ as Gn,L as Yn}from"./index-BzsNbVpR.js";import{L as nr}from"./__vite-browser-external-D80GqXp3.js";import{R as ir}from"./remoteFile-Dv8-F_G9.js";import"./_commonjsHelpers-DM6icglO.js";const st=BigInt(32);function rr(e,n,t){const i=+!!t,a=+!t;return BigInt(e.getInt32(n,t)*a+e.getInt32(n+4,t)*i)<>st),r=Number(t&BigInt(4294967295));i?(e.setInt32(n+4,a,i),e.setUint32(n,r,i)):(e.setInt32(n,a,i),e.setUint32(n+4,r,i))}function sr(e,n,t,i){const a=Number(t>>st),r=Number(t&BigInt(4294967295));i?(e.setUint32(n+4,a,i),e.setUint32(n,r,i)):(e.setUint32(n,a,i),e.setUint32(n+4,r,i))}"getBigInt64"in DataView||(DataView.prototype.getBigInt64=function(e,n){return rr(this,e,n)});"getBigUint64"in DataView||(DataView.prototype.getBigUint64=function(e,n){return ar(this,e,n)});"setBigInt64"in DataView||(DataView.prototype.setBigInt64=function(e,n,t){or(this,e,n,t)});"setBigUint64"in DataView||(DataView.prototype.setBigUint64=function(e,n,t){sr(this,e,n,t)});class lr{constructor(n,t){this.code="",this.scopes=[["vars"]],this.bitFields=[],this.tmpVariableCount=0,this.references=new Map,this.imports=[],this.reverseImports=new Map,this.useContextVariables=!1,this.importPath=n,this.useContextVariables=t}generateVariable(n){const t=[...this.scopes[this.scopes.length-1]];return n&&t.push(n),t.join(".")}generateOption(n){switch(typeof n){case"number":return n.toString();case"string":return this.generateVariable(n);case"function":return`${this.addImport(n)}.call(${this.generateVariable()}, vars)`}}generateError(n){this.pushCode(`throw new Error(${n});`)}generateTmpVariable(){return"$tmp"+this.tmpVariableCount++}pushCode(n){this.code+=n+` -`}pushPath(n){n&&this.scopes[this.scopes.length-1].push(n)}popPath(n){n&&this.scopes[this.scopes.length-1].pop()}pushScope(n){this.scopes.push([n])}popScope(){this.scopes.pop()}addImport(n){if(!this.importPath)return`(${n})`;let t=this.reverseImports.get(n);return t||(t=this.imports.push(n)-1,this.reverseImports.set(n,t)),`${this.importPath}[${t}]`}addReference(n){this.references.has(n)||this.references.set(n,{resolved:!1,requested:!1})}markResolved(n){const t=this.references.get(n);t&&(t.resolved=!0)}markRequested(n){n.forEach(t=>{const i=this.references.get(t);i&&(i.requested=!0)})}getUnresolvedReferences(){return Array.from(this.references).filter(([n,t])=>!t.resolved&&!t.requested).map(([n,t])=>n)}}const x=new Map,re="___parser_",M={uint8:1,uint16le:2,uint16be:2,uint32le:4,uint32be:4,int8:1,int16le:2,int16be:2,int32le:4,int32be:4,int64be:8,int64le:8,uint64be:8,uint64le:8,floatle:4,floatbe:4,doublele:8,doublebe:8},Ye={uint8:"Uint8",uint16le:"Uint16",uint16be:"Uint16",uint32le:"Uint32",uint32be:"Uint32",int8:"Int8",int16le:"Int16",int16be:"Int16",int32le:"Int32",int32be:"Int32",int64be:"BigInt64",int64le:"BigInt64",uint64be:"BigUint64",uint64le:"BigUint64",floatle:"Float32",floatbe:"Float32",doublele:"Float64",doublebe:"Float64"},Ke={uint8:!1,uint16le:!0,uint16be:!1,uint32le:!0,uint32be:!1,int8:!1,int16le:!0,int16be:!1,int32le:!0,int32be:!1,int64be:!1,int64le:!0,uint64be:!1,uint64le:!0,floatle:!0,floatbe:!1,doublele:!0,doublebe:!1};class N{constructor(){this.varName="",this.type="",this.options={},this.endian="be",this.useContextVariables=!1}static start(){return new N}primitiveGenerateN(n,t){const i=Ye[n],a=Ke[n];t.pushCode(`${t.generateVariable(this.varName)} = dataView.get${i}(offset, ${a});`),t.pushCode(`offset += ${M[n]};`)}primitiveN(n,t,i){return this.setNextParser(n,t,i)}useThisEndian(n){return n+this.endian.toLowerCase()}uint8(n,t={}){return this.primitiveN("uint8",n,t)}uint16(n,t={}){return this.primitiveN(this.useThisEndian("uint16"),n,t)}uint16le(n,t={}){return this.primitiveN("uint16le",n,t)}uint16be(n,t={}){return this.primitiveN("uint16be",n,t)}uint32(n,t={}){return this.primitiveN(this.useThisEndian("uint32"),n,t)}uint32le(n,t={}){return this.primitiveN("uint32le",n,t)}uint32be(n,t={}){return this.primitiveN("uint32be",n,t)}int8(n,t={}){return this.primitiveN("int8",n,t)}int16(n,t={}){return this.primitiveN(this.useThisEndian("int16"),n,t)}int16le(n,t={}){return this.primitiveN("int16le",n,t)}int16be(n,t={}){return this.primitiveN("int16be",n,t)}int32(n,t={}){return this.primitiveN(this.useThisEndian("int32"),n,t)}int32le(n,t={}){return this.primitiveN("int32le",n,t)}int32be(n,t={}){return this.primitiveN("int32be",n,t)}bigIntVersionCheck(){if(!DataView.prototype.getBigInt64)throw new Error("BigInt64 is unsupported on this runtime")}int64(n,t={}){return this.bigIntVersionCheck(),this.primitiveN(this.useThisEndian("int64"),n,t)}int64be(n,t={}){return this.bigIntVersionCheck(),this.primitiveN("int64be",n,t)}int64le(n,t={}){return this.bigIntVersionCheck(),this.primitiveN("int64le",n,t)}uint64(n,t={}){return this.bigIntVersionCheck(),this.primitiveN(this.useThisEndian("uint64"),n,t)}uint64be(n,t={}){return this.bigIntVersionCheck(),this.primitiveN("uint64be",n,t)}uint64le(n,t={}){return this.bigIntVersionCheck(),this.primitiveN("uint64le",n,t)}floatle(n,t={}){return this.primitiveN("floatle",n,t)}floatbe(n,t={}){return this.primitiveN("floatbe",n,t)}doublele(n,t={}){return this.primitiveN("doublele",n,t)}doublebe(n,t={}){return this.primitiveN("doublebe",n,t)}bitN(n,t,i){return i.length=n,this.setNextParser("bit",t,i)}bit1(n,t={}){return this.bitN(1,n,t)}bit2(n,t={}){return this.bitN(2,n,t)}bit3(n,t={}){return this.bitN(3,n,t)}bit4(n,t={}){return this.bitN(4,n,t)}bit5(n,t={}){return this.bitN(5,n,t)}bit6(n,t={}){return this.bitN(6,n,t)}bit7(n,t={}){return this.bitN(7,n,t)}bit8(n,t={}){return this.bitN(8,n,t)}bit9(n,t={}){return this.bitN(9,n,t)}bit10(n,t={}){return this.bitN(10,n,t)}bit11(n,t={}){return this.bitN(11,n,t)}bit12(n,t={}){return this.bitN(12,n,t)}bit13(n,t={}){return this.bitN(13,n,t)}bit14(n,t={}){return this.bitN(14,n,t)}bit15(n,t={}){return this.bitN(15,n,t)}bit16(n,t={}){return this.bitN(16,n,t)}bit17(n,t={}){return this.bitN(17,n,t)}bit18(n,t={}){return this.bitN(18,n,t)}bit19(n,t={}){return this.bitN(19,n,t)}bit20(n,t={}){return this.bitN(20,n,t)}bit21(n,t={}){return this.bitN(21,n,t)}bit22(n,t={}){return this.bitN(22,n,t)}bit23(n,t={}){return this.bitN(23,n,t)}bit24(n,t={}){return this.bitN(24,n,t)}bit25(n,t={}){return this.bitN(25,n,t)}bit26(n,t={}){return this.bitN(26,n,t)}bit27(n,t={}){return this.bitN(27,n,t)}bit28(n,t={}){return this.bitN(28,n,t)}bit29(n,t={}){return this.bitN(29,n,t)}bit30(n,t={}){return this.bitN(30,n,t)}bit31(n,t={}){return this.bitN(31,n,t)}bit32(n,t={}){return this.bitN(32,n,t)}namely(n){return x.set(n,this),this.alias=n,this}skip(n,t={}){return this.seek(n,t)}seek(n,t={}){if(t.assert)throw new Error("assert option on seek is not allowed.");return this.setNextParser("seek","",{length:n})}string(n,t){if(!t.zeroTerminated&&!t.length&&!t.greedy)throw new Error("One of length, zeroTerminated, or greedy must be defined for string.");if((t.zeroTerminated||t.length)&&t.greedy)throw new Error("greedy is mutually exclusive with length and zeroTerminated for string.");if(t.stripNull&&!(t.length||t.greedy))throw new Error("length or greedy must be defined if stripNull is enabled.");return t.encoding=t.encoding||"utf8",this.setNextParser("string",n,t)}buffer(n,t){if(!t.length&&!t.readUntil)throw new Error("length or readUntil must be defined for buffer.");return this.setNextParser("buffer",n,t)}wrapped(n,t){if(typeof t!="object"&&typeof n=="object"&&(t=n,n=""),!t||!t.wrapper||!t.type)throw new Error("Both wrapper and type must be defined for wrapped.");if(!t.length&&!t.readUntil)throw new Error("length or readUntil must be defined for wrapped.");return this.setNextParser("wrapper",n,t)}array(n,t){if(!t.readUntil&&!t.length&&!t.lengthInBytes)throw new Error("One of readUntil, length and lengthInBytes must be defined for array.");if(!t.type)throw new Error("type is required for array.");if(typeof t.type=="string"&&!x.has(t.type)&&!(t.type in M))throw new Error(`Array element type "${t.type}" is unkown.`);return this.setNextParser("array",n,t)}choice(n,t){if(typeof t!="object"&&typeof n=="object"&&(t=n,n=""),!t)throw new Error("tag and choices are are required for choice.");if(!t.tag)throw new Error("tag is requird for choice.");if(!t.choices)throw new Error("choices is required for choice.");for(const i in t.choices){const a=parseInt(i,10),r=t.choices[a];if(isNaN(a))throw new Error(`Choice key "${i}" is not a number.`);if(typeof r=="string"&&!x.has(r)&&!(r in M))throw new Error(`Choice type "${r}" is unkown.`)}return this.setNextParser("choice",n,t)}nest(n,t){if(typeof t!="object"&&typeof n=="object"&&(t=n,n=""),!t||!t.type)throw new Error("type is required for nest.");if(!(t.type instanceof N)&&!x.has(t.type))throw new Error("type must be a known parser name or a Parser object.");if(!(t.type instanceof N)&&!n)throw new Error("type must be a Parser object if the variable name is omitted.");return this.setNextParser("nest",n,t)}pointer(n,t){if(!t.offset)throw new Error("offset is required for pointer.");if(!t.type)throw new Error("type is required for pointer.");if(typeof t.type=="string"&&!(t.type in M)&&!x.has(t.type))throw new Error(`Pointer type "${t.type}" is unkown.`);return this.setNextParser("pointer",n,t)}saveOffset(n,t={}){return this.setNextParser("saveOffset",n,t)}endianness(n){switch(n.toLowerCase()){case"little":this.endian="le";break;case"big":this.endian="be";break;default:throw new Error('endianness must be one of "little" or "big"')}return this}endianess(n){return this.endianness(n)}useContextVars(n=!0){return this.useContextVariables=n,this}create(n){if(!(n instanceof Function))throw new Error("Constructor must be a Function object.");return this.constructorFn=n,this}getContext(n){const t=new lr(n,this.useContextVariables);return t.pushCode("var dataView = new DataView(buffer.buffer, buffer.byteOffset, buffer.length);"),this.alias?(this.addAliasedCode(t),t.pushCode(`return ${re+this.alias}(0).result;`)):this.addRawCode(t),t}getCode(){return this.getContext("imports").code}addRawCode(n){n.pushCode("var offset = 0;"),n.pushCode(`var vars = ${this.constructorFn?"new constructorFn()":"{}"};`),n.pushCode("vars.$parent = null;"),n.pushCode("vars.$root = vars;"),this.generate(n),this.resolveReferences(n),n.pushCode("delete vars.$parent;"),n.pushCode("delete vars.$root;"),n.pushCode("return vars;")}addAliasedCode(n){return n.pushCode(`function ${re+this.alias}(offset, context) {`),n.pushCode(`var vars = ${this.constructorFn?"new constructorFn()":"{}"};`),n.pushCode("var ctx = Object.assign({$parent: null, $root: vars}, context || {});"),n.pushCode("vars = Object.assign(vars, ctx);"),this.generate(n),n.markResolved(this.alias),this.resolveReferences(n),n.pushCode("Object.keys(ctx).forEach(function (item) { delete vars[item]; });"),n.pushCode("return { offset: offset, result: vars };"),n.pushCode("}"),n}resolveReferences(n){const t=n.getUnresolvedReferences();n.markRequested(t),t.forEach(i=>{var a;(a=x.get(i))===null||a===void 0||a.addAliasedCode(n)})}compile(){const n="imports",t=this.getContext(n);this.compiled=new Function(n,"TextDecoder",`return function (buffer, constructorFn) { ${t.code} };`)(t.imports,TextDecoder)}sizeOf(){let n=NaN;if(Object.keys(M).indexOf(this.type)>=0)n=M[this.type];else if(this.type==="string"&&typeof this.options.length=="number")n=this.options.length;else if(this.type==="buffer"&&typeof this.options.length=="number")n=this.options.length;else if(this.type==="array"&&typeof this.options.length=="number"){let t=NaN;typeof this.options.type=="string"?t=M[this.options.type]:this.options.type instanceof N&&(t=this.options.type.sizeOf()),n=this.options.length*t}else this.type==="seek"?n=this.options.length:this.type==="nest"?n=this.options.type.sizeOf():this.type||(n=0);return this.next&&(n+=this.next.sizeOf()),n}parse(n){return this.compiled||this.compile(),this.compiled(n,this.constructorFn)}setNextParser(n,t,i){const a=new N;return a.type=n,a.varName=t,a.options=i,a.endian=this.endian,this.head?this.head.next=a:this.next=a,this.head=a,this}generate(n){if(this.type){switch(this.type){case"uint8":case"uint16le":case"uint16be":case"uint32le":case"uint32be":case"int8":case"int16le":case"int16be":case"int32le":case"int32be":case"int64be":case"int64le":case"uint64be":case"uint64le":case"floatle":case"floatbe":case"doublele":case"doublebe":this.primitiveGenerateN(this.type,n);break;case"bit":this.generateBit(n);break;case"string":this.generateString(n);break;case"buffer":this.generateBuffer(n);break;case"seek":this.generateSeek(n);break;case"nest":this.generateNest(n);break;case"array":this.generateArray(n);break;case"choice":this.generateChoice(n);break;case"pointer":this.generatePointer(n);break;case"saveOffset":this.generateSaveOffset(n);break;case"wrapper":this.generateWrapper(n);break}this.type!=="bit"&&this.generateAssert(n)}const t=n.generateVariable(this.varName);return this.options.formatter&&this.type!=="bit"&&this.generateFormatter(n,t,this.options.formatter),this.generateNext(n)}generateAssert(n){if(!this.options.assert)return;const t=n.generateVariable(this.varName);switch(typeof this.options.assert){case"function":{const i=n.addImport(this.options.assert);n.pushCode(`if (!${i}.call(vars, ${t})) {`)}break;case"number":n.pushCode(`if (${this.options.assert} !== ${t}) {`);break;case"string":n.pushCode(`if (${JSON.stringify(this.options.assert)} !== ${t}) {`);break;default:throw new Error("assert option must be a string, number or a function.")}n.generateError(`"Assertion error: ${t} is " + ${JSON.stringify(this.options.assert.toString())}`),n.pushCode("}")}generateNext(n){return this.next&&(n=this.next.generate(n)),n}generateBit(n){const t=JSON.parse(JSON.stringify(this));if(t.options=this.options,t.generateAssert=this.generateAssert.bind(this),t.generateFormatter=this.generateFormatter.bind(this),t.varName=n.generateVariable(t.varName),n.bitFields.push(t),!this.next||this.next&&["bit","nest"].indexOf(this.next.type)<0){const i=n.generateTmpVariable();n.pushCode(`var ${i} = 0;`);const a=(f=0)=>{let p=0;for(let c=f;c32)break;p+=h}return p},r=f=>(f<=8?(n.pushCode(`${i} = dataView.getUint8(offset);`),f=8):f<=16?(n.pushCode(`${i} = dataView.getUint16(offset);`),f=16):f<=24?(n.pushCode(`${i} = (dataView.getUint16(offset) << 8) | dataView.getUint8(offset + 2);`),f=24):(n.pushCode(`${i} = dataView.getUint32(offset);`),f=32),n.pushCode(`offset += ${f/8};`),f);let o=0;const l=this.endian==="be";let u=0,s=0;n.bitFields.forEach((f,p)=>{let c=f.options.length;if(c>s){if(s){const g=-1>>>32-s;n.pushCode(`${f.varName} = (${i} & 0x${g.toString(16)}) << ${c-s};`),c-=s}o=0,s=u=r(a(p)-s)}const h=l?u-o-c:o,_=-1>>>32-c;n.pushCode(`${f.varName} ${c> ${h} & 0x${_.toString(16)};`),f.options.length===32&&n.pushCode(`${f.varName} >>>= 0`),f.options.assert&&f.generateAssert(n),f.options.formatter&&f.generateFormatter(n,f.varName,f.options.formatter),o+=c,s-=c}),n.bitFields=[]}}generateSeek(n){const t=n.generateOption(this.options.length);n.pushCode(`offset += ${t};`)}generateString(n){const t=n.generateVariable(this.varName),i=n.generateTmpVariable(),a=this.options.encoding,r=a.toLowerCase()==="hex",o='b => b.toString(16).padStart(2, "0")';if(this.options.length&&this.options.zeroTerminated){const l=this.options.length;n.pushCode(`var ${i} = offset;`),n.pushCode(`while(dataView.getUint8(offset++) !== 0 && offset - ${i} < ${l});`);const u=`offset - ${i} < ${l} ? offset - 1 : offset`;n.pushCode(r?`${t} = Array.from(buffer.subarray(${i}, ${u}), ${o}).join('');`:`${t} = new TextDecoder('${a}').decode(buffer.subarray(${i}, ${u}));`)}else if(this.options.length){const l=n.generateOption(this.options.length);n.pushCode(r?`${t} = Array.from(buffer.subarray(offset, offset + ${l}), ${o}).join('');`:`${t} = new TextDecoder('${a}').decode(buffer.subarray(offset, offset + ${l}));`),n.pushCode(`offset += ${l};`)}else this.options.zeroTerminated?(n.pushCode(`var ${i} = offset;`),n.pushCode("while(dataView.getUint8(offset++) !== 0);"),n.pushCode(r?`${t} = Array.from(buffer.subarray(${i}, offset - 1), ${o}).join('');`:`${t} = new TextDecoder('${a}').decode(buffer.subarray(${i}, offset - 1));`)):this.options.greedy&&(n.pushCode(`var ${i} = offset;`),n.pushCode("while(buffer.length > offset++);"),n.pushCode(r?`${t} = Array.from(buffer.subarray(${i}, offset), ${o}).join('');`:`${t} = new TextDecoder('${a}').decode(buffer.subarray(${i}, offset));`));this.options.stripNull&&n.pushCode(`${t} = ${t}.replace(/\\x00+$/g, '')`)}generateBuffer(n){const t=n.generateVariable(this.varName);if(typeof this.options.readUntil=="function"){const i=this.options.readUntil,a=n.generateTmpVariable(),r=n.generateTmpVariable();n.pushCode(`var ${a} = offset;`),n.pushCode(`var ${r} = 0;`),n.pushCode("while (offset < buffer.length) {"),n.pushCode(`${r} = dataView.getUint8(offset);`);const o=n.addImport(i);n.pushCode(`if (${o}.call(${n.generateVariable()}, ${r}, buffer.subarray(offset))) break;`),n.pushCode("offset += 1;"),n.pushCode("}"),n.pushCode(`${t} = buffer.subarray(${a}, offset);`)}else if(this.options.readUntil==="eof")n.pushCode(`${t} = buffer.subarray(offset);`);else{const i=n.generateOption(this.options.length);n.pushCode(`${t} = buffer.subarray(offset, offset + ${i});`),n.pushCode(`offset += ${i};`)}this.options.clone&&n.pushCode(`${t} = buffer.constructor.from(${t});`)}generateArray(n){const t=n.generateOption(this.options.length),i=n.generateOption(this.options.lengthInBytes),a=this.options.type,r=n.generateTmpVariable(),o=n.generateVariable(this.varName),l=n.generateTmpVariable(),u=this.options.key,s=typeof u=="string";if(s?n.pushCode(`${o} = {};`):n.pushCode(`${o} = [];`),typeof this.options.readUntil=="function"?n.pushCode("do {"):this.options.readUntil==="eof"?n.pushCode(`for (var ${r} = 0; offset < buffer.length; ${r}++) {`):i!==void 0?n.pushCode(`for (var ${r} = offset + ${i}; offset < ${r}; ) {`):n.pushCode(`for (var ${r} = ${t}; ${r} > 0; ${r}--) {`),typeof a=="string")if(x.get(a)){const f=n.generateTmpVariable();if(n.pushCode(`var ${f} = ${re+a}(offset, {`),n.useContextVariables){const p=n.generateVariable();n.pushCode(`$parent: ${p},`),n.pushCode(`$root: ${p}.$root,`),!this.options.readUntil&&i===void 0&&n.pushCode(`$index: ${t} - ${r},`)}n.pushCode("});"),n.pushCode(`var ${l} = ${f}.result; offset = ${f}.offset;`),a!==this.alias&&n.addReference(a)}else{const f=Ye[a],p=Ke[a];n.pushCode(`var ${l} = dataView.get${f}(offset, ${p});`),n.pushCode(`offset += ${M[a]};`)}else if(a instanceof N){n.pushCode(`var ${l} = {};`);const f=n.generateVariable();n.pushScope(l),n.useContextVariables&&(n.pushCode(`${l}.$parent = ${f};`),n.pushCode(`${l}.$root = ${f}.$root;`),!this.options.readUntil&&i===void 0&&n.pushCode(`${l}.$index = ${t} - ${r};`)),a.generate(n),n.useContextVariables&&(n.pushCode(`delete ${l}.$parent;`),n.pushCode(`delete ${l}.$root;`),n.pushCode(`delete ${l}.$index;`)),n.popScope()}if(s?n.pushCode(`${o}[${l}.${u}] = ${l};`):n.pushCode(`${o}.push(${l});`),n.pushCode("}"),typeof this.options.readUntil=="function"){const f=this.options.readUntil,p=n.addImport(f);n.pushCode(`while (!${p}.call(${n.generateVariable()}, ${l}, buffer.subarray(offset)));`)}}generateChoiceCase(n,t,i){if(typeof i=="string"){const a=n.generateVariable(this.varName);if(x.has(i)){const r=n.generateTmpVariable();n.pushCode(`var ${r} = ${re+i}(offset, {`),n.useContextVariables&&(n.pushCode(`$parent: ${a}.$parent,`),n.pushCode(`$root: ${a}.$root,`)),n.pushCode("});"),n.pushCode(`${a} = ${r}.result; offset = ${r}.offset;`),i!==this.alias&&n.addReference(i)}else{const r=Ye[i],o=Ke[i];n.pushCode(`${a} = dataView.get${r}(offset, ${o});`),n.pushCode(`offset += ${M[i]}`)}}else i instanceof N&&(n.pushPath(t),i.generate(n),n.popPath(t))}generateChoice(n){const t=n.generateOption(this.options.tag),i=n.generateVariable(this.varName);if(this.varName&&(n.pushCode(`${i} = {};`),n.useContextVariables)){const a=n.generateVariable();n.pushCode(`${i}.$parent = ${a};`),n.pushCode(`${i}.$root = ${a}.$root;`)}n.pushCode(`switch(${t}) {`);for(const a in this.options.choices){const r=parseInt(a,10),o=this.options.choices[r];n.pushCode(`case ${r}:`),this.generateChoiceCase(n,this.varName,o),n.pushCode("break;")}n.pushCode("default:"),this.options.defaultChoice?this.generateChoiceCase(n,this.varName,this.options.defaultChoice):n.generateError(`"Met undefined tag value " + ${t} + " at choice"`),n.pushCode("}"),this.varName&&n.useContextVariables&&(n.pushCode(`delete ${i}.$parent;`),n.pushCode(`delete ${i}.$root;`))}generateNest(n){const t=n.generateVariable(this.varName);if(this.options.type instanceof N){if(this.varName&&(n.pushCode(`${t} = {};`),n.useContextVariables)){const i=n.generateVariable();n.pushCode(`${t}.$parent = ${i};`),n.pushCode(`${t}.$root = ${i}.$root;`)}n.pushPath(this.varName),this.options.type.generate(n),n.popPath(this.varName),this.varName&&n.useContextVariables&&n.useContextVariables&&(n.pushCode(`delete ${t}.$parent;`),n.pushCode(`delete ${t}.$root;`))}else if(x.has(this.options.type)){const i=n.generateTmpVariable();if(n.pushCode(`var ${i} = ${re+this.options.type}(offset, {`),n.useContextVariables){const a=n.generateVariable();n.pushCode(`$parent: ${a},`),n.pushCode(`$root: ${a}.$root,`)}n.pushCode("});"),n.pushCode(`${t} = ${i}.result; offset = ${i}.offset;`),this.options.type!==this.alias&&n.addReference(this.options.type)}}generateWrapper(n){const t=n.generateVariable(this.varName),i=n.generateTmpVariable();if(typeof this.options.readUntil=="function"){const u=this.options.readUntil,s=n.generateTmpVariable(),f=n.generateTmpVariable();n.pushCode(`var ${s} = offset;`),n.pushCode(`var ${f} = 0;`),n.pushCode("while (offset < buffer.length) {"),n.pushCode(`${f} = dataView.getUint8(offset);`);const p=n.addImport(u);n.pushCode(`if (${p}.call(${n.generateVariable()}, ${f}, buffer.subarray(offset))) break;`),n.pushCode("offset += 1;"),n.pushCode("}"),n.pushCode(`${i} = buffer.subarray(${s}, offset);`)}else if(this.options.readUntil==="eof")n.pushCode(`${i} = buffer.subarray(offset);`);else{const u=n.generateOption(this.options.length);n.pushCode(`${i} = buffer.subarray(offset, offset + ${u});`),n.pushCode(`offset += ${u};`)}this.options.clone&&n.pushCode(`${i} = buffer.constructor.from(${i});`);const a=n.generateTmpVariable(),r=n.generateTmpVariable(),o=n.generateTmpVariable(),l=n.addImport(this.options.wrapper);if(n.pushCode(`${i} = ${l}.call(this, ${i}).subarray(0);`),n.pushCode(`var ${a} = buffer;`),n.pushCode(`var ${r} = offset;`),n.pushCode(`var ${o} = dataView;`),n.pushCode(`buffer = ${i};`),n.pushCode("offset = 0;"),n.pushCode("dataView = new DataView(buffer.buffer, buffer.byteOffset, buffer.length);"),this.options.type instanceof N)this.varName&&n.pushCode(`${t} = {};`),n.pushPath(this.varName),this.options.type.generate(n),n.popPath(this.varName);else if(x.has(this.options.type)){const u=n.generateTmpVariable();n.pushCode(`var ${u} = ${re+this.options.type}(0);`),n.pushCode(`${t} = ${u}.result;`),this.options.type!==this.alias&&n.addReference(this.options.type)}n.pushCode(`buffer = ${a};`),n.pushCode(`dataView = ${o};`),n.pushCode(`offset = ${r};`)}generateFormatter(n,t,i){if(typeof i=="function"){const a=n.addImport(i);n.pushCode(`${t} = ${a}.call(${n.generateVariable()}, ${t});`)}}generatePointer(n){const t=this.options.type,i=n.generateOption(this.options.offset),a=n.generateTmpVariable(),r=n.generateVariable(this.varName);if(n.pushCode(`var ${a} = offset;`),n.pushCode(`offset = ${i};`),this.options.type instanceof N){if(n.pushCode(`${r} = {};`),n.useContextVariables){const o=n.generateVariable();n.pushCode(`${r}.$parent = ${o};`),n.pushCode(`${r}.$root = ${o}.$root;`)}n.pushPath(this.varName),this.options.type.generate(n),n.popPath(this.varName),n.useContextVariables&&(n.pushCode(`delete ${r}.$parent;`),n.pushCode(`delete ${r}.$root;`))}else if(x.has(this.options.type)){const o=n.generateTmpVariable();if(n.pushCode(`var ${o} = ${re+this.options.type}(offset, {`),n.useContextVariables){const l=n.generateVariable();n.pushCode(`$parent: ${l},`),n.pushCode(`$root: ${l}.$root,`)}n.pushCode("});"),n.pushCode(`${r} = ${o}.result; offset = ${o}.offset;`),this.options.type!==this.alias&&n.addReference(this.options.type)}else if(Object.keys(M).indexOf(this.options.type)>=0){const o=Ye[t],l=Ke[t];n.pushCode(`${r} = dataView.get${o}(offset, ${l});`),n.pushCode(`offset += ${M[t]};`)}n.pushCode(`offset = ${a};`)}generateSaveOffset(n){const t=n.generateVariable(this.varName);n.pushCode(`${t} = offset`)}}class pe{constructor(n){this.ranges=n}get min(){return this.ranges[0].min}get max(){return this.ranges[this.ranges.length-1].max}contains(n){for(const t of this.ranges)if(t.min<=n&&t.max>=n)return!0;return!1}isContiguous(){return this.ranges.length>1}getRanges(){return this.ranges.map(n=>new pe([{min:n.min,max:n.max}]))}toString(){return this.ranges.map(n=>`[${n.min}-${n.max}]`).join(",")}union(n){const t=[...this.getRanges(),...n.getRanges()].sort((r,o)=>r.mino.min?1:r.maxr.max?1:0),i=[];let a=t[0];for(let r=1;ra.max+1?(i.push(a),a=o):o.max>a.max&&(a=new pe([{min:a.min,max:o.max}]))}return i.push(a),i.length===1?i[0]:new pe(i)}}/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const fr=4,Qt=0,en=1,ur=2;function ye(e){let n=e.length;for(;--n>=0;)e[n]=0}const hr=0,Kn=1,cr=2,dr=3,pr=258,Zt=29,Ze=256,Oe=Ze+1+Zt,_e=30,xt=19,Wn=2*Oe+1,ae=15,ht=16,_r=7,Mt=256,Xn=16,qn=17,Jn=18,Tt=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),nt=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),br=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Qn=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),gr=512,W=new Array((Oe+2)*2);ye(W);const Ie=new Array(_e*2);ye(Ie);const ze=new Array(gr);ye(ze);const Re=new Array(pr-dr+1);ye(Re);const Ht=new Array(Zt);ye(Ht);const it=new Array(_e);ye(it);function ct(e,n,t,i,a){this.static_tree=e,this.extra_bits=n,this.extra_base=t,this.elems=i,this.max_length=a,this.has_stree=e&&e.length}let ei,ti,ni;function dt(e,n){this.dyn_tree=e,this.max_code=0,this.stat_desc=n}const ii=e=>e<256?ze[e]:ze[256+(e>>>7)],Be=(e,n)=>{e.pending_buf[e.pending++]=n&255,e.pending_buf[e.pending++]=n>>>8&255},D=(e,n,t)=>{e.bi_valid>ht-t?(e.bi_buf|=n<>ht-e.bi_valid,e.bi_valid+=t-ht):(e.bi_buf|=n<{D(e,t[n*2],t[n*2+1])},ri=(e,n)=>{let t=0;do t|=e&1,e>>>=1,t<<=1;while(--n>0);return t>>>1},wr=e=>{e.bi_valid===16?(Be(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},mr=(e,n)=>{const t=n.dyn_tree,i=n.max_code,a=n.stat_desc.static_tree,r=n.stat_desc.has_stree,o=n.stat_desc.extra_bits,l=n.stat_desc.extra_base,u=n.stat_desc.max_length;let s,f,p,c,h,_,g=0;for(c=0;c<=ae;c++)e.bl_count[c]=0;for(t[e.heap[e.heap_max]*2+1]=0,s=e.heap_max+1;su&&(c=u,g++),t[f*2+1]=c,!(f>i)&&(e.bl_count[c]++,h=0,f>=l&&(h=o[f-l]),_=t[f*2],e.opt_len+=_*(c+h),r&&(e.static_len+=_*(a[f*2+1]+h)));if(g!==0){do{for(c=u-1;e.bl_count[c]===0;)c--;e.bl_count[c]--,e.bl_count[c+1]+=2,e.bl_count[u]--,g-=2}while(g>0);for(c=u;c!==0;c--)for(f=e.bl_count[c];f!==0;)p=e.heap[--s],!(p>i)&&(t[p*2+1]!==c&&(e.opt_len+=(c-t[p*2+1])*t[p*2],t[p*2+1]=c),f--)}},ai=(e,n,t)=>{const i=new Array(ae+1);let a=0,r,o;for(r=1;r<=ae;r++)a=a+t[r-1]<<1,i[r]=a;for(o=0;o<=n;o++){let l=e[o*2+1];l!==0&&(e[o*2]=ri(i[l]++,l))}},yr=()=>{let e,n,t,i,a;const r=new Array(ae+1);for(t=0,i=0;i>=7;i<_e;i++)for(it[i]=a<<7,e=0;e<1<{let n;for(n=0;n{e.bi_valid>8?Be(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},tn=(e,n,t,i)=>{const a=n*2,r=t*2;return e[a]{const i=e.heap[t];let a=t<<1;for(;a<=e.heap_len&&(a{let i,a,r=0,o,l;if(e.sym_next!==0)do i=e.pending_buf[e.sym_buf+r++]&255,i+=(e.pending_buf[e.sym_buf+r++]&255)<<8,a=e.pending_buf[e.sym_buf+r++],i===0?j(e,a,n):(o=Re[a],j(e,o+Ze+1,n),l=Tt[o],l!==0&&(a-=Ht[o],D(e,a,l)),i--,o=ii(i),j(e,o,t),l=nt[o],l!==0&&(i-=it[o],D(e,i,l)));while(r{const t=n.dyn_tree,i=n.stat_desc.static_tree,a=n.stat_desc.has_stree,r=n.stat_desc.elems;let o,l,u=-1,s;for(e.heap_len=0,e.heap_max=Wn,o=0;o>1;o>=1;o--)pt(e,t,o);s=r;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],pt(e,t,1),l=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=l,t[s*2]=t[o*2]+t[l*2],e.depth[s]=(e.depth[o]>=e.depth[l]?e.depth[o]:e.depth[l])+1,t[o*2+1]=t[l*2+1]=s,e.heap[1]=s++,pt(e,t,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],mr(e,n),ai(t,u,e.bl_count)},rn=(e,n,t)=>{let i,a=-1,r,o=n[0*2+1],l=0,u=7,s=4;for(o===0&&(u=138,s=3),n[(t+1)*2+1]=65535,i=0;i<=t;i++)r=o,o=n[(i+1)*2+1],!(++l{let i,a=-1,r,o=n[0*2+1],l=0,u=7,s=4;for(o===0&&(u=138,s=3),i=0;i<=t;i++)if(r=o,o=n[(i+1)*2+1],!(++l{let n;for(rn(e,e.dyn_ltree,e.l_desc.max_code),rn(e,e.dyn_dtree,e.d_desc.max_code),At(e,e.bl_desc),n=xt-1;n>=3&&e.bl_tree[Qn[n]*2+1]===0;n--);return e.opt_len+=3*(n+1)+5+5+4,n},kr=(e,n,t,i)=>{let a;for(D(e,n-257,5),D(e,t-1,5),D(e,i-4,4),a=0;a{let n=4093624447,t;for(t=0;t<=31;t++,n>>>=1)if(n&1&&e.dyn_ltree[t*2]!==0)return Qt;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return en;for(t=32;t{on||(yr(),on=!0),e.l_desc=new dt(e.dyn_ltree,ei),e.d_desc=new dt(e.dyn_dtree,ti),e.bl_desc=new dt(e.bl_tree,ni),e.bi_buf=0,e.bi_valid=0,oi(e)},li=(e,n,t,i)=>{D(e,(hr<<1)+(i?1:0),3),si(e),Be(e,t),Be(e,~t),t&&e.pending_buf.set(e.window.subarray(n,n+t),e.pending),e.pending+=t},Cr=e=>{D(e,Kn<<1,3),j(e,Mt,W),wr(e)},Sr=(e,n,t,i)=>{let a,r,o=0;e.level>0?(e.strm.data_type===ur&&(e.strm.data_type=$r(e)),At(e,e.l_desc),At(e,e.d_desc),o=vr(e),a=e.opt_len+3+7>>>3,r=e.static_len+3+7>>>3,r<=a&&(a=r)):a=r=t+5,t+4<=a&&n!==-1?li(e,n,t,i):e.strategy===fr||r===a?(D(e,(Kn<<1)+(i?1:0),3),nn(e,W,Ie)):(D(e,(cr<<1)+(i?1:0),3),kr(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),nn(e,e.dyn_ltree,e.dyn_dtree)),oi(e),i&&si(e)},Nr=(e,n,t)=>(e.pending_buf[e.sym_buf+e.sym_next++]=n,e.pending_buf[e.sym_buf+e.sym_next++]=n>>8,e.pending_buf[e.sym_buf+e.sym_next++]=t,n===0?e.dyn_ltree[t*2]++:(e.matches++,n--,e.dyn_ltree[(Re[t]+Ze+1)*2]++,e.dyn_dtree[ii(n)*2]++),e.sym_next===e.sym_end);var Ir=Er,Tr=li,Ar=Sr,Or=Nr,zr=Cr,Rr={_tr_init:Ir,_tr_stored_block:Tr,_tr_flush_block:Ar,_tr_tally:Or,_tr_align:zr};const Br=(e,n,t,i)=>{let a=e&65535|0,r=e>>>16&65535|0,o=0;for(;t!==0;){o=t>2e3?2e3:t,t-=o;do a=a+n[i++]|0,r=r+a|0;while(--o);a%=65521,r%=65521}return a|r<<16|0};var Ue=Br;const Ur=()=>{let e,n=[];for(var t=0;t<256;t++){e=t;for(var i=0;i<8;i++)e=e&1?3988292384^e>>>1:e>>>1;n[t]=e}return n},Dr=new Uint32Array(Ur()),Vr=(e,n,t,i)=>{const a=Dr,r=i+t;e^=-1;for(let o=i;o>>8^a[(e^n[o])&255];return e^-1};var R=Vr,ge={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},xe={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:Fr,_tr_stored_block:Ot,_tr_flush_block:Lr,_tr_tally:ee,_tr_align:Pr}=Rr,{Z_NO_FLUSH:te,Z_PARTIAL_FLUSH:Zr,Z_FULL_FLUSH:xr,Z_FINISH:L,Z_BLOCK:sn,Z_OK:B,Z_STREAM_END:ln,Z_STREAM_ERROR:G,Z_DATA_ERROR:Mr,Z_BUF_ERROR:_t,Z_DEFAULT_COMPRESSION:Hr,Z_FILTERED:jr,Z_HUFFMAN_ONLY:We,Z_RLE:Gr,Z_FIXED:Yr,Z_DEFAULT_STRATEGY:Kr,Z_UNKNOWN:Wr,Z_DEFLATED:lt}=xe,Xr=9,qr=15,Jr=8,Qr=29,ea=256,zt=ea+1+Qr,ta=30,na=19,ia=2*zt+1,ra=15,T=3,Q=258,Y=Q+T+1,aa=32,we=42,jt=57,Rt=69,Bt=73,Ut=91,Dt=103,oe=113,Se=666,U=1,ve=2,fe=3,ke=4,oa=3,se=(e,n)=>(e.msg=ge[n],n),fn=e=>e*2-(e>4?9:0),q=e=>{let n=e.length;for(;--n>=0;)e[n]=0},sa=e=>{let n,t,i,a=e.w_size;n=e.hash_size,i=n;do t=e.head[--i],e.head[i]=t>=a?t-a:0;while(--n);n=a,i=n;do t=e.prev[--i],e.prev[i]=t>=a?t-a:0;while(--n)};let la=(e,n,t)=>(n<{const n=e.state;let t=n.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.output.set(n.pending_buf.subarray(n.pending_out,n.pending_out+t),e.next_out),e.next_out+=t,n.pending_out+=t,e.total_out+=t,e.avail_out-=t,n.pending-=t,n.pending===0&&(n.pending_out=0))},F=(e,n)=>{Lr(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,n),e.block_start=e.strstart,V(e.strm)},A=(e,n)=>{e.pending_buf[e.pending++]=n},Ce=(e,n)=>{e.pending_buf[e.pending++]=n>>>8&255,e.pending_buf[e.pending++]=n&255},Vt=(e,n,t,i)=>{let a=e.avail_in;return a>i&&(a=i),a===0?0:(e.avail_in-=a,n.set(e.input.subarray(e.next_in,e.next_in+a),t),e.state.wrap===1?e.adler=Ue(e.adler,n,a,t):e.state.wrap===2&&(e.adler=R(e.adler,n,a,t)),e.next_in+=a,e.total_in+=a,a)},fi=(e,n)=>{let t=e.max_chain_length,i=e.strstart,a,r,o=e.prev_length,l=e.nice_match;const u=e.strstart>e.w_size-Y?e.strstart-(e.w_size-Y):0,s=e.window,f=e.w_mask,p=e.prev,c=e.strstart+Q;let h=s[i+o-1],_=s[i+o];e.prev_length>=e.good_match&&(t>>=2),l>e.lookahead&&(l=e.lookahead);do if(a=n,!(s[a+o]!==_||s[a+o-1]!==h||s[a]!==s[i]||s[++a]!==s[i+1])){i+=2,a++;do;while(s[++i]===s[++a]&&s[++i]===s[++a]&&s[++i]===s[++a]&&s[++i]===s[++a]&&s[++i]===s[++a]&&s[++i]===s[++a]&&s[++i]===s[++a]&&s[++i]===s[++a]&&io){if(e.match_start=n,o=r,r>=l)break;h=s[i+o-1],_=s[i+o]}}while((n=p[n&f])>u&&--t!==0);return o<=e.lookahead?o:e.lookahead},me=e=>{const n=e.w_size;let t,i,a;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=n+(n-Y)&&(e.window.set(e.window.subarray(n,n+n-i),0),e.match_start-=n,e.strstart-=n,e.block_start-=n,e.insert>e.strstart&&(e.insert=e.strstart),sa(e),i+=n),e.strm.avail_in===0)break;if(t=Vt(e.strm,e.window,e.strstart+e.lookahead,i),e.lookahead+=t,e.lookahead+e.insert>=T)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=ne(e,e.ins_h,e.window[a+1]);e.insert&&(e.ins_h=ne(e,e.ins_h,e.window[a+T-1]),e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(e.lookahead+e.insert{let t=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,i,a,r,o=0,l=e.strm.avail_in;do{if(i=65535,r=e.bi_valid+42>>3,e.strm.avail_outa+e.strm.avail_in&&(i=a+e.strm.avail_in),i>r&&(i=r),i>8,e.pending_buf[e.pending-2]=~i,e.pending_buf[e.pending-1]=~i>>8,V(e.strm),a&&(a>i&&(a=i),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+a),e.strm.next_out),e.strm.next_out+=a,e.strm.avail_out-=a,e.strm.total_out+=a,e.block_start+=a,i-=a),i&&(Vt(e.strm,e.strm.output,e.strm.next_out,i),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i)}while(o===0);return l-=e.strm.avail_in,l&&(l>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=l&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-l,e.strm.next_in),e.strstart),e.strstart+=l,e.insert+=l>e.w_size-e.insert?e.w_size-e.insert:l),e.block_start=e.strstart),e.high_waterr&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,r+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),r>e.strm.avail_in&&(r=e.strm.avail_in),r&&(Vt(e.strm,e.window,e.strstart,r),e.strstart+=r,e.insert+=r>e.w_size-e.insert?e.w_size-e.insert:r),e.high_water>3,r=e.pending_buf_size-r>65535?65535:e.pending_buf_size-r,t=r>e.w_size?e.w_size:r,a=e.strstart-e.block_start,(a>=t||(a||n===L)&&n!==te&&e.strm.avail_in===0&&a<=r)&&(i=a>r?r:a,o=n===L&&e.strm.avail_in===0&&i===a?1:0,Ot(e,e.block_start,i,o),e.block_start+=i,V(e.strm)),o?fe:U)},bt=(e,n)=>{let t,i;for(;;){if(e.lookahead=T&&(e.ins_h=ne(e,e.ins_h,e.window[e.strstart+T-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),t!==0&&e.strstart-t<=e.w_size-Y&&(e.match_length=fi(e,t)),e.match_length>=T)if(i=ee(e,e.strstart-e.match_start,e.match_length-T),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=T){e.match_length--;do e.strstart++,e.ins_h=ne(e,e.ins_h,e.window[e.strstart+T-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=ne(e,e.ins_h,e.window[e.strstart+1]);else i=ee(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(F(e,!1),e.strm.avail_out===0))return U}return e.insert=e.strstart{let t,i,a;for(;;){if(e.lookahead=T&&(e.ins_h=ne(e,e.ins_h,e.window[e.strstart+T-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=T-1,t!==0&&e.prev_length4096)&&(e.match_length=T-1)),e.prev_length>=T&&e.match_length<=e.prev_length){a=e.strstart+e.lookahead-T,i=ee(e,e.strstart-1-e.prev_match,e.prev_length-T),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=a&&(e.ins_h=ne(e,e.ins_h,e.window[e.strstart+T-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=T-1,e.strstart++,i&&(F(e,!1),e.strm.avail_out===0))return U}else if(e.match_available){if(i=ee(e,0,e.window[e.strstart-1]),i&&F(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return U}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(i=ee(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart{let t,i,a,r;const o=e.window;for(;;){if(e.lookahead<=Q){if(me(e),e.lookahead<=Q&&n===te)return U;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=T&&e.strstart>0&&(a=e.strstart-1,i=o[a],i===o[++a]&&i===o[++a]&&i===o[++a])){r=e.strstart+Q;do;while(i===o[++a]&&i===o[++a]&&i===o[++a]&&i===o[++a]&&i===o[++a]&&i===o[++a]&&i===o[++a]&&i===o[++a]&&ae.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=T?(t=ee(e,1,e.match_length-T),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(t=ee(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),t&&(F(e,!1),e.strm.avail_out===0))return U}return e.insert=0,n===L?(F(e,!0),e.strm.avail_out===0?fe:ke):e.sym_next&&(F(e,!1),e.strm.avail_out===0)?U:ve},ua=(e,n)=>{let t;for(;;){if(e.lookahead===0&&(me(e),e.lookahead===0)){if(n===te)return U;break}if(e.match_length=0,t=ee(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,t&&(F(e,!1),e.strm.avail_out===0))return U}return e.insert=0,n===L?(F(e,!0),e.strm.avail_out===0?fe:ke):e.sym_next&&(F(e,!1),e.strm.avail_out===0)?U:ve};function H(e,n,t,i,a){this.good_length=e,this.max_lazy=n,this.nice_length=t,this.max_chain=i,this.func=a}const Ne=[new H(0,0,0,0,ui),new H(4,4,8,4,bt),new H(4,5,16,8,bt),new H(4,6,32,32,bt),new H(4,4,16,16,ce),new H(8,16,32,32,ce),new H(8,16,128,128,ce),new H(8,32,128,256,ce),new H(32,128,258,1024,ce),new H(32,258,258,4096,ce)],ha=e=>{e.window_size=2*e.w_size,q(e.head),e.max_lazy_match=Ne[e.level].max_lazy,e.good_match=Ne[e.level].good_length,e.nice_match=Ne[e.level].nice_length,e.max_chain_length=Ne[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=T-1,e.match_available=0,e.ins_h=0};function ca(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=lt,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(ia*2),this.dyn_dtree=new Uint16Array((2*ta+1)*2),this.bl_tree=new Uint16Array((2*na+1)*2),q(this.dyn_ltree),q(this.dyn_dtree),q(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(ra+1),this.heap=new Uint16Array(2*zt+1),q(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*zt+1),q(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Me=e=>{if(!e)return 1;const n=e.state;return!n||n.strm!==e||n.status!==we&&n.status!==jt&&n.status!==Rt&&n.status!==Bt&&n.status!==Ut&&n.status!==Dt&&n.status!==oe&&n.status!==Se?1:0},hi=e=>{if(Me(e))return se(e,G);e.total_in=e.total_out=0,e.data_type=Wr;const n=e.state;return n.pending=0,n.pending_out=0,n.wrap<0&&(n.wrap=-n.wrap),n.status=n.wrap===2?jt:n.wrap?we:oe,e.adler=n.wrap===2?0:1,n.last_flush=-2,Fr(n),B},ci=e=>{const n=hi(e);return n===B&&ha(e.state),n},da=(e,n)=>Me(e)||e.state.wrap!==2?G:(e.state.gzhead=n,B),di=(e,n,t,i,a,r)=>{if(!e)return G;let o=1;if(n===Hr&&(n=6),i<0?(o=0,i=-i):i>15&&(o=2,i-=16),a<1||a>Xr||t!==lt||i<8||i>15||n<0||n>9||r<0||r>Yr||i===8&&o!==1)return se(e,G);i===8&&(i=9);const l=new ca;return e.state=l,l.strm=e,l.status=we,l.wrap=o,l.gzhead=null,l.w_bits=i,l.w_size=1<di(e,n,lt,qr,Jr,Kr),_a=(e,n)=>{if(Me(e)||n>sn||n<0)return e?se(e,G):G;const t=e.state;if(!e.output||e.avail_in!==0&&!e.input||t.status===Se&&n!==L)return se(e,e.avail_out===0?_t:G);const i=t.last_flush;if(t.last_flush=n,t.pending!==0){if(V(e),e.avail_out===0)return t.last_flush=-1,B}else if(e.avail_in===0&&fn(n)<=fn(i)&&n!==L)return se(e,_t);if(t.status===Se&&e.avail_in!==0)return se(e,_t);if(t.status===we&&t.wrap===0&&(t.status=oe),t.status===we){let a=lt+(t.w_bits-8<<4)<<8,r=-1;if(t.strategy>=We||t.level<2?r=0:t.level<6?r=1:t.level===6?r=2:r=3,a|=r<<6,t.strstart!==0&&(a|=aa),a+=31-a%31,Ce(t,a),t.strstart!==0&&(Ce(t,e.adler>>>16),Ce(t,e.adler&65535)),e.adler=1,t.status=oe,V(e),t.pending!==0)return t.last_flush=-1,B}if(t.status===jt){if(e.adler=0,A(t,31),A(t,139),A(t,8),t.gzhead)A(t,(t.gzhead.text?1:0)+(t.gzhead.hcrc?2:0)+(t.gzhead.extra?4:0)+(t.gzhead.name?8:0)+(t.gzhead.comment?16:0)),A(t,t.gzhead.time&255),A(t,t.gzhead.time>>8&255),A(t,t.gzhead.time>>16&255),A(t,t.gzhead.time>>24&255),A(t,t.level===9?2:t.strategy>=We||t.level<2?4:0),A(t,t.gzhead.os&255),t.gzhead.extra&&t.gzhead.extra.length&&(A(t,t.gzhead.extra.length&255),A(t,t.gzhead.extra.length>>8&255)),t.gzhead.hcrc&&(e.adler=R(e.adler,t.pending_buf,t.pending,0)),t.gzindex=0,t.status=Rt;else if(A(t,0),A(t,0),A(t,0),A(t,0),A(t,0),A(t,t.level===9?2:t.strategy>=We||t.level<2?4:0),A(t,oa),t.status=oe,V(e),t.pending!==0)return t.last_flush=-1,B}if(t.status===Rt){if(t.gzhead.extra){let a=t.pending,r=(t.gzhead.extra.length&65535)-t.gzindex;for(;t.pending+r>t.pending_buf_size;){let l=t.pending_buf_size-t.pending;if(t.pending_buf.set(t.gzhead.extra.subarray(t.gzindex,t.gzindex+l),t.pending),t.pending=t.pending_buf_size,t.gzhead.hcrc&&t.pending>a&&(e.adler=R(e.adler,t.pending_buf,t.pending-a,a)),t.gzindex+=l,V(e),t.pending!==0)return t.last_flush=-1,B;a=0,r-=l}let o=new Uint8Array(t.gzhead.extra);t.pending_buf.set(o.subarray(t.gzindex,t.gzindex+r),t.pending),t.pending+=r,t.gzhead.hcrc&&t.pending>a&&(e.adler=R(e.adler,t.pending_buf,t.pending-a,a)),t.gzindex=0}t.status=Bt}if(t.status===Bt){if(t.gzhead.name){let a=t.pending,r;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>a&&(e.adler=R(e.adler,t.pending_buf,t.pending-a,a)),V(e),t.pending!==0)return t.last_flush=-1,B;a=0}t.gzindexa&&(e.adler=R(e.adler,t.pending_buf,t.pending-a,a)),t.gzindex=0}t.status=Ut}if(t.status===Ut){if(t.gzhead.comment){let a=t.pending,r;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>a&&(e.adler=R(e.adler,t.pending_buf,t.pending-a,a)),V(e),t.pending!==0)return t.last_flush=-1,B;a=0}t.gzindexa&&(e.adler=R(e.adler,t.pending_buf,t.pending-a,a))}t.status=Dt}if(t.status===Dt){if(t.gzhead.hcrc){if(t.pending+2>t.pending_buf_size&&(V(e),t.pending!==0))return t.last_flush=-1,B;A(t,e.adler&255),A(t,e.adler>>8&255),e.adler=0}if(t.status=oe,V(e),t.pending!==0)return t.last_flush=-1,B}if(e.avail_in!==0||t.lookahead!==0||n!==te&&t.status!==Se){let a=t.level===0?ui(t,n):t.strategy===We?ua(t,n):t.strategy===Gr?fa(t,n):Ne[t.level].func(t,n);if((a===fe||a===ke)&&(t.status=Se),a===U||a===fe)return e.avail_out===0&&(t.last_flush=-1),B;if(a===ve&&(n===Zr?Pr(t):n!==sn&&(Ot(t,0,0,!1),n===xr&&(q(t.head),t.lookahead===0&&(t.strstart=0,t.block_start=0,t.insert=0))),V(e),e.avail_out===0))return t.last_flush=-1,B}return n!==L?B:t.wrap<=0?ln:(t.wrap===2?(A(t,e.adler&255),A(t,e.adler>>8&255),A(t,e.adler>>16&255),A(t,e.adler>>24&255),A(t,e.total_in&255),A(t,e.total_in>>8&255),A(t,e.total_in>>16&255),A(t,e.total_in>>24&255)):(Ce(t,e.adler>>>16),Ce(t,e.adler&65535)),V(e),t.wrap>0&&(t.wrap=-t.wrap),t.pending!==0?B:ln)},ba=e=>{if(Me(e))return G;const n=e.state.status;return e.state=null,n===oe?se(e,Mr):B},ga=(e,n)=>{let t=n.length;if(Me(e))return G;const i=e.state,a=i.wrap;if(a===2||a===1&&i.status!==we||i.lookahead)return G;if(a===1&&(e.adler=Ue(e.adler,n,t,0)),i.wrap=0,t>=i.w_size){a===0&&(q(i.head),i.strstart=0,i.block_start=0,i.insert=0);let u=new Uint8Array(i.w_size);u.set(n.subarray(t-i.w_size,t),0),n=u,t=i.w_size}const r=e.avail_in,o=e.next_in,l=e.input;for(e.avail_in=t,e.next_in=0,e.input=n,me(i);i.lookahead>=T;){let u=i.strstart,s=i.lookahead-(T-1);do i.ins_h=ne(i,i.ins_h,i.window[u+T-1]),i.prev[u&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=u,u++;while(--s);i.strstart=u,i.lookahead=T-1,me(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=T-1,i.match_available=0,e.next_in=o,e.input=l,e.avail_in=r,i.wrap=a,B};var wa=pa,ma=di,ya=ci,va=hi,ka=da,$a=_a,Ea=ba,Ca=ga,Sa="pako deflate (from Nodeca project)",Te={deflateInit:wa,deflateInit2:ma,deflateReset:ya,deflateResetKeep:va,deflateSetHeader:ka,deflate:$a,deflateEnd:Ea,deflateSetDictionary:Ca,deflateInfo:Sa};const Na=(e,n)=>Object.prototype.hasOwnProperty.call(e,n);var Ia=function(e){const n=Array.prototype.slice.call(arguments,1);for(;n.length;){const t=n.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(const i in t)Na(t,i)&&(e[i]=t[i])}}return e},Ta=e=>{let n=0;for(let i=0,a=e.length;i=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;De[254]=De[254]=1;var Aa=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let n,t,i,a,r,o=e.length,l=0;for(a=0;a>>6,n[r++]=128|t&63):t<65536?(n[r++]=224|t>>>12,n[r++]=128|t>>>6&63,n[r++]=128|t&63):(n[r++]=240|t>>>18,n[r++]=128|t>>>12&63,n[r++]=128|t>>>6&63,n[r++]=128|t&63);return n};const Oa=(e,n)=>{if(n<65534&&e.subarray&&pi)return String.fromCharCode.apply(null,e.length===n?e:e.subarray(0,n));let t="";for(let i=0;i{const t=n||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,n));let i,a;const r=new Array(t*2);for(a=0,i=0;i4){r[a++]=65533,i+=l-1;continue}for(o&=l===2?31:l===3?15:7;l>1&&i1){r[a++]=65533;continue}o<65536?r[a++]=o:(o-=65536,r[a++]=55296|o>>10&1023,r[a++]=56320|o&1023)}return Oa(r,a)},Ra=(e,n)=>{n=n||e.length,n>e.length&&(n=e.length);let t=n-1;for(;t>=0&&(e[t]&192)===128;)t--;return t<0||t===0?n:t+De[e[t]]>n?t:n},Ve={string2buf:Aa,buf2string:za,utf8border:Ra};function Ba(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var _i=Ba;const bi=Object.prototype.toString,{Z_NO_FLUSH:Ua,Z_SYNC_FLUSH:Da,Z_FULL_FLUSH:Va,Z_FINISH:Fa,Z_OK:rt,Z_STREAM_END:La,Z_DEFAULT_COMPRESSION:Pa,Z_DEFAULT_STRATEGY:Za,Z_DEFLATED:xa}=xe;function Gt(e){this.options=ft.assign({level:Pa,method:xa,chunkSize:16384,windowBits:15,memLevel:8,strategy:Za},e||{});let n=this.options;n.raw&&n.windowBits>0?n.windowBits=-n.windowBits:n.gzip&&n.windowBits>0&&n.windowBits<16&&(n.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new _i,this.strm.avail_out=0;let t=Te.deflateInit2(this.strm,n.level,n.method,n.windowBits,n.memLevel,n.strategy);if(t!==rt)throw new Error(ge[t]);if(n.header&&Te.deflateSetHeader(this.strm,n.header),n.dictionary){let i;if(typeof n.dictionary=="string"?i=Ve.string2buf(n.dictionary):bi.call(n.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(n.dictionary):i=n.dictionary,t=Te.deflateSetDictionary(this.strm,i),t!==rt)throw new Error(ge[t]);this._dict_set=!0}}Gt.prototype.push=function(e,n){const t=this.strm,i=this.options.chunkSize;let a,r;if(this.ended)return!1;for(n===~~n?r=n:r=n===!0?Fa:Ua,typeof e=="string"?t.input=Ve.string2buf(e):bi.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){if(t.avail_out===0&&(t.output=new Uint8Array(i),t.next_out=0,t.avail_out=i),(r===Da||r===Va)&&t.avail_out<=6){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(a=Te.deflate(t,r),a===La)return t.next_out>0&&this.onData(t.output.subarray(0,t.next_out)),a=Te.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===rt;if(t.avail_out===0){this.onData(t.output);continue}if(r>0&&t.next_out>0){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(t.avail_in===0)break}return!0};Gt.prototype.onData=function(e){this.chunks.push(e)};Gt.prototype.onEnd=function(e){e===rt&&(this.result=ft.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const Xe=16209,Ma=16191;var Ha=function(n,t){let i,a,r,o,l,u,s,f,p,c,h,_,g,k,v,E,C,d,$,S,b,w,m,y;const I=n.state;i=n.next_in,m=n.input,a=i+(n.avail_in-5),r=n.next_out,y=n.output,o=r-(t-n.avail_out),l=r+(n.avail_out-257),u=I.dmax,s=I.wsize,f=I.whave,p=I.wnext,c=I.window,h=I.hold,_=I.bits,g=I.lencode,k=I.distcode,v=(1<>>24,h>>>=d,_-=d,d=C>>>16&255,d===0)y[r++]=C&65535;else if(d&16){$=C&65535,d&=15,d&&(_>>=d,_-=d),_<15&&(h+=m[i++]<<_,_+=8,h+=m[i++]<<_,_+=8),C=k[h&E];n:for(;;){if(d=C>>>24,h>>>=d,_-=d,d=C>>>16&255,d&16){if(S=C&65535,d&=15,_u){n.msg="invalid distance too far back",I.mode=Xe;break e}if(h>>>=d,_-=d,d=r-o,S>d){if(d=S-d,d>f&&I.sane){n.msg="invalid distance too far back",I.mode=Xe;break e}if(b=0,w=c,p===0){if(b+=s-d,d<$){$-=d;do y[r++]=c[b++];while(--d);b=r-S,w=y}}else if(p2;)y[r++]=w[b++],y[r++]=w[b++],y[r++]=w[b++],$-=3;$&&(y[r++]=w[b++],$>1&&(y[r++]=w[b++]))}else{b=r-S;do y[r++]=y[b++],y[r++]=y[b++],y[r++]=y[b++],$-=3;while($>2);$&&(y[r++]=y[b++],$>1&&(y[r++]=y[b++]))}}else if(d&64){n.msg="invalid distance code",I.mode=Xe;break e}else{C=k[(C&65535)+(h&(1<>3,i-=$,_-=$<<3,h&=(1<<_)-1,n.next_in=i,n.next_out=r,n.avail_in=i{const u=l.bits;let s=0,f=0,p=0,c=0,h=0,_=0,g=0,k=0,v=0,E=0,C,d,$,S,b,w=null,m;const y=new Uint16Array(de+1),I=new Uint16Array(de+1);let ie=null,Jt,je,Ge;for(s=0;s<=de;s++)y[s]=0;for(f=0;f=1&&y[c]===0;c--);if(h>c&&(h=c),c===0)return a[r++]=1<<24|64<<16|0,a[r++]=1<<24|64<<16|0,l.bits=1,0;for(p=1;p0&&(e===cn||c!==1))return-1;for(I[1]=0,s=1;sun||e===dn&&v>hn)return 1;for(;;){Jt=s-g,o[f]+1=m?(je=ie[o[f]-m],Ge=w[o[f]-m]):(je=96,Ge=0),C=1<>g)+d]=Jt<<24|je<<16|Ge|0;while(d!==0);for(C=1<>=1;if(C!==0?(E&=C-1,E+=C):E=0,f++,--y[s]===0){if(s===c)break;s=n[t+o[f]]}if(s>h&&(E&S)!==$){for(g===0&&(g=h),b+=p,_=s-g,k=1<<_;_+gun||e===dn&&v>hn)return 1;$=E&S,a[$]=h<<24|_<<16|b-r|0}}return E!==0&&(a[b+E]=s-g<<24|64<<16|0),l.bits=h,0};var Ae=Wa;const Xa=0,gi=1,wi=2,{Z_FINISH:pn,Z_BLOCK:qa,Z_TREES:qe,Z_OK:ue,Z_STREAM_END:Ja,Z_NEED_DICT:Qa,Z_STREAM_ERROR:P,Z_DATA_ERROR:mi,Z_MEM_ERROR:yi,Z_BUF_ERROR:eo,Z_DEFLATED:_n}=xe,ut=16180,bn=16181,gn=16182,wn=16183,mn=16184,yn=16185,vn=16186,kn=16187,$n=16188,En=16189,at=16190,K=16191,wt=16192,Cn=16193,mt=16194,Sn=16195,Nn=16196,In=16197,Tn=16198,Je=16199,Qe=16200,An=16201,On=16202,zn=16203,Rn=16204,Bn=16205,yt=16206,Un=16207,Dn=16208,O=16209,vi=16210,ki=16211,to=852,no=592,io=15,ro=io,Vn=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function ao(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const he=e=>{if(!e)return 1;const n=e.state;return!n||n.strm!==e||n.modeki?1:0},$i=e=>{if(he(e))return P;const n=e.state;return e.total_in=e.total_out=n.total=0,e.msg="",n.wrap&&(e.adler=n.wrap&1),n.mode=ut,n.last=0,n.havedict=0,n.flags=-1,n.dmax=32768,n.head=null,n.hold=0,n.bits=0,n.lencode=n.lendyn=new Int32Array(to),n.distcode=n.distdyn=new Int32Array(no),n.sane=1,n.back=-1,ue},Ei=e=>{if(he(e))return P;const n=e.state;return n.wsize=0,n.whave=0,n.wnext=0,$i(e)},Ci=(e,n)=>{let t;if(he(e))return P;const i=e.state;return n<0?(t=0,n=-n):(t=(n>>4)+5,n<48&&(n&=15)),n&&(n<8||n>15)?P:(i.window!==null&&i.wbits!==n&&(i.window=null),i.wrap=t,i.wbits=n,Ei(e))},Si=(e,n)=>{if(!e)return P;const t=new ao;e.state=t,t.strm=e,t.window=null,t.mode=ut;const i=Ci(e,n);return i!==ue&&(e.state=null),i},oo=e=>Si(e,ro);let Fn=!0,vt,kt;const so=e=>{if(Fn){vt=new Int32Array(512),kt=new Int32Array(32);let n=0;for(;n<144;)e.lens[n++]=8;for(;n<256;)e.lens[n++]=9;for(;n<280;)e.lens[n++]=7;for(;n<288;)e.lens[n++]=8;for(Ae(gi,e.lens,0,288,vt,0,e.work,{bits:9}),n=0;n<32;)e.lens[n++]=5;Ae(wi,e.lens,0,32,kt,0,e.work,{bits:5}),Fn=!1}e.lencode=vt,e.lenbits=9,e.distcode=kt,e.distbits=5},Ni=(e,n,t,i)=>{let a;const r=e.state;return r.window===null&&(r.wsize=1<=r.wsize?(r.window.set(n.subarray(t-r.wsize,t),0),r.wnext=0,r.whave=r.wsize):(a=r.wsize-r.wnext,a>i&&(a=i),r.window.set(n.subarray(t-i,t-i+a),r.wnext),i-=a,i?(r.window.set(n.subarray(t-i,t),0),r.wnext=i,r.whave=r.wsize):(r.wnext+=a,r.wnext===r.wsize&&(r.wnext=0),r.whave{let t,i,a,r,o,l,u,s,f,p,c,h,_,g,k=0,v,E,C,d,$,S,b,w;const m=new Uint8Array(4);let y,I;const ie=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(he(e)||!e.output||!e.input&&e.avail_in!==0)return P;t=e.state,t.mode===K&&(t.mode=wt),o=e.next_out,a=e.output,u=e.avail_out,r=e.next_in,i=e.input,l=e.avail_in,s=t.hold,f=t.bits,p=l,c=u,w=ue;e:for(;;)switch(t.mode){case ut:if(t.wrap===0){t.mode=wt;break}for(;f<16;){if(l===0)break e;l--,s+=i[r++]<>>8&255,t.check=R(t.check,m,2,0),s=0,f=0,t.mode=bn;break}if(t.head&&(t.head.done=!1),!(t.wrap&1)||(((s&255)<<8)+(s>>8))%31){e.msg="incorrect header check",t.mode=O;break}if((s&15)!==_n){e.msg="unknown compression method",t.mode=O;break}if(s>>>=4,f-=4,b=(s&15)+8,t.wbits===0&&(t.wbits=b),b>15||b>t.wbits){e.msg="invalid window size",t.mode=O;break}t.dmax=1<>8&1),t.flags&512&&t.wrap&4&&(m[0]=s&255,m[1]=s>>>8&255,t.check=R(t.check,m,2,0)),s=0,f=0,t.mode=gn;case gn:for(;f<32;){if(l===0)break e;l--,s+=i[r++]<>>8&255,m[2]=s>>>16&255,m[3]=s>>>24&255,t.check=R(t.check,m,4,0)),s=0,f=0,t.mode=wn;case wn:for(;f<16;){if(l===0)break e;l--,s+=i[r++]<>8),t.flags&512&&t.wrap&4&&(m[0]=s&255,m[1]=s>>>8&255,t.check=R(t.check,m,2,0)),s=0,f=0,t.mode=mn;case mn:if(t.flags&1024){for(;f<16;){if(l===0)break e;l--,s+=i[r++]<>>8&255,t.check=R(t.check,m,2,0)),s=0,f=0}else t.head&&(t.head.extra=null);t.mode=yn;case yn:if(t.flags&1024&&(h=t.length,h>l&&(h=l),h&&(t.head&&(b=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(i.subarray(r,r+h),b)),t.flags&512&&t.wrap&4&&(t.check=R(t.check,i,h,r)),l-=h,r+=h,t.length-=h),t.length))break e;t.length=0,t.mode=vn;case vn:if(t.flags&2048){if(l===0)break e;h=0;do b=i[r+h++],t.head&&b&&t.length<65536&&(t.head.name+=String.fromCharCode(b));while(b&&h>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=K;break;case En:for(;f<32;){if(l===0)break e;l--,s+=i[r++]<>>=f&7,f-=f&7,t.mode=yt;break}for(;f<3;){if(l===0)break e;l--,s+=i[r++]<>>=1,f-=1,s&3){case 0:t.mode=Cn;break;case 1:if(so(t),t.mode=Je,n===qe){s>>>=2,f-=2;break e}break;case 2:t.mode=Nn;break;case 3:e.msg="invalid block type",t.mode=O}s>>>=2,f-=2;break;case Cn:for(s>>>=f&7,f-=f&7;f<32;){if(l===0)break e;l--,s+=i[r++]<>>16^65535)){e.msg="invalid stored block lengths",t.mode=O;break}if(t.length=s&65535,s=0,f=0,t.mode=mt,n===qe)break e;case mt:t.mode=Sn;case Sn:if(h=t.length,h){if(h>l&&(h=l),h>u&&(h=u),h===0)break e;a.set(i.subarray(r,r+h),o),l-=h,r+=h,u-=h,o+=h,t.length-=h;break}t.mode=K;break;case Nn:for(;f<14;){if(l===0)break e;l--,s+=i[r++]<>>=5,f-=5,t.ndist=(s&31)+1,s>>>=5,f-=5,t.ncode=(s&15)+4,s>>>=4,f-=4,t.nlen>286||t.ndist>30){e.msg="too many length or distance symbols",t.mode=O;break}t.have=0,t.mode=In;case In:for(;t.have>>=3,f-=3}for(;t.have<19;)t.lens[ie[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,y={bits:t.lenbits},w=Ae(Xa,t.lens,0,19,t.lencode,0,t.work,y),t.lenbits=y.bits,w){e.msg="invalid code lengths set",t.mode=O;break}t.have=0,t.mode=Tn;case Tn:for(;t.have>>24,E=k>>>16&255,C=k&65535,!(v<=f);){if(l===0)break e;l--,s+=i[r++]<>>=v,f-=v,t.lens[t.have++]=C;else{if(C===16){for(I=v+2;f>>=v,f-=v,t.have===0){e.msg="invalid bit length repeat",t.mode=O;break}b=t.lens[t.have-1],h=3+(s&3),s>>>=2,f-=2}else if(C===17){for(I=v+3;f>>=v,f-=v,b=0,h=3+(s&7),s>>>=3,f-=3}else{for(I=v+7;f>>=v,f-=v,b=0,h=11+(s&127),s>>>=7,f-=7}if(t.have+h>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=O;break}for(;h--;)t.lens[t.have++]=b}}if(t.mode===O)break;if(t.lens[256]===0){e.msg="invalid code -- missing end-of-block",t.mode=O;break}if(t.lenbits=9,y={bits:t.lenbits},w=Ae(gi,t.lens,0,t.nlen,t.lencode,0,t.work,y),t.lenbits=y.bits,w){e.msg="invalid literal/lengths set",t.mode=O;break}if(t.distbits=6,t.distcode=t.distdyn,y={bits:t.distbits},w=Ae(wi,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,y),t.distbits=y.bits,w){e.msg="invalid distances set",t.mode=O;break}if(t.mode=Je,n===qe)break e;case Je:t.mode=Qe;case Qe:if(l>=6&&u>=258){e.next_out=o,e.avail_out=u,e.next_in=r,e.avail_in=l,t.hold=s,t.bits=f,Ha(e,c),o=e.next_out,a=e.output,u=e.avail_out,r=e.next_in,i=e.input,l=e.avail_in,s=t.hold,f=t.bits,t.mode===K&&(t.back=-1);break}for(t.back=0;k=t.lencode[s&(1<>>24,E=k>>>16&255,C=k&65535,!(v<=f);){if(l===0)break e;l--,s+=i[r++]<>d)],v=k>>>24,E=k>>>16&255,C=k&65535,!(d+v<=f);){if(l===0)break e;l--,s+=i[r++]<>>=d,f-=d,t.back+=d}if(s>>>=v,f-=v,t.back+=v,t.length=C,E===0){t.mode=Bn;break}if(E&32){t.back=-1,t.mode=K;break}if(E&64){e.msg="invalid literal/length code",t.mode=O;break}t.extra=E&15,t.mode=An;case An:if(t.extra){for(I=t.extra;f>>=t.extra,f-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=On;case On:for(;k=t.distcode[s&(1<>>24,E=k>>>16&255,C=k&65535,!(v<=f);){if(l===0)break e;l--,s+=i[r++]<>d)],v=k>>>24,E=k>>>16&255,C=k&65535,!(d+v<=f);){if(l===0)break e;l--,s+=i[r++]<>>=d,f-=d,t.back+=d}if(s>>>=v,f-=v,t.back+=v,E&64){e.msg="invalid distance code",t.mode=O;break}t.offset=C,t.extra=E&15,t.mode=zn;case zn:if(t.extra){for(I=t.extra;f>>=t.extra,f-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back",t.mode=O;break}t.mode=Rn;case Rn:if(u===0)break e;if(h=c-u,t.offset>h){if(h=t.offset-h,h>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=O;break}h>t.wnext?(h-=t.wnext,_=t.wsize-h):_=t.wnext-h,h>t.length&&(h=t.length),g=t.window}else g=a,_=o-t.offset,h=t.length;h>u&&(h=u),u-=h,t.length-=h;do a[o++]=g[_++];while(--h);t.length===0&&(t.mode=Qe);break;case Bn:if(u===0)break e;a[o++]=t.length,u--,t.mode=Qe;break;case yt:if(t.wrap){for(;f<32;){if(l===0)break e;l--,s|=i[r++]<{if(he(e))return P;let n=e.state;return n.window&&(n.window=null),e.state=null,ue},uo=(e,n)=>{if(he(e))return P;const t=e.state;return t.wrap&2?(t.head=n,n.done=!1,ue):P},ho=(e,n)=>{const t=n.length;let i,a,r;return he(e)||(i=e.state,i.wrap!==0&&i.mode!==at)?P:i.mode===at&&(a=1,a=Ue(a,n,t,0),a!==i.check)?mi:(r=Ni(e,n,t,t),r?(i.mode=vi,yi):(i.havedict=1,ue))};var co=Ei,po=Ci,_o=$i,bo=oo,go=Si,wo=lo,mo=fo,yo=uo,vo=ho,ko="pako inflate (from Nodeca project)",X={inflateReset:co,inflateReset2:po,inflateResetKeep:_o,inflateInit:bo,inflateInit2:go,inflate:wo,inflateEnd:mo,inflateGetHeader:yo,inflateSetDictionary:vo,inflateInfo:ko};function $o(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var Eo=$o;const Ii=Object.prototype.toString,{Z_NO_FLUSH:Co,Z_FINISH:So,Z_OK:Fe,Z_STREAM_END:$t,Z_NEED_DICT:Et,Z_STREAM_ERROR:No,Z_DATA_ERROR:Ln,Z_MEM_ERROR:Io}=xe;function He(e){this.options=ft.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const n=this.options;n.raw&&n.windowBits>=0&&n.windowBits<16&&(n.windowBits=-n.windowBits,n.windowBits===0&&(n.windowBits=-15)),n.windowBits>=0&&n.windowBits<16&&!(e&&e.windowBits)&&(n.windowBits+=32),n.windowBits>15&&n.windowBits<48&&(n.windowBits&15||(n.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new _i,this.strm.avail_out=0;let t=X.inflateInit2(this.strm,n.windowBits);if(t!==Fe)throw new Error(ge[t]);if(this.header=new Eo,X.inflateGetHeader(this.strm,this.header),n.dictionary&&(typeof n.dictionary=="string"?n.dictionary=Ve.string2buf(n.dictionary):Ii.call(n.dictionary)==="[object ArrayBuffer]"&&(n.dictionary=new Uint8Array(n.dictionary)),n.raw&&(t=X.inflateSetDictionary(this.strm,n.dictionary),t!==Fe)))throw new Error(ge[t])}He.prototype.push=function(e,n){const t=this.strm,i=this.options.chunkSize,a=this.options.dictionary;let r,o,l;if(this.ended)return!1;for(n===~~n?o=n:o=n===!0?So:Co,Ii.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(i),t.next_out=0,t.avail_out=i),r=X.inflate(t,o),r===Et&&a&&(r=X.inflateSetDictionary(t,a),r===Fe?r=X.inflate(t,o):r===Ln&&(r=Et));t.avail_in>0&&r===$t&&t.state.wrap>0&&e[t.next_in]!==0;)X.inflateReset(t),r=X.inflate(t,o);switch(r){case No:case Ln:case Et:case Io:return this.onEnd(r),this.ended=!0,!1}if(l=t.avail_out,t.next_out&&(t.avail_out===0||r===$t))if(this.options.to==="string"){let u=Ve.utf8border(t.output,t.next_out),s=t.next_out-u,f=Ve.buf2string(t.output,u);t.next_out=s,t.avail_out=i-s,s&&t.output.set(t.output.subarray(u,u+s),0),this.onData(f)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(!(r===Fe&&l===0)){if(r===$t)return r=X.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,!0;if(t.avail_in===0)break}}return!0};He.prototype.onData=function(e){this.chunks.push(e)};He.prototype.onEnd=function(e){e===Fe&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=ft.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Yt(e,n){const t=new He(n);if(t.push(e),t.err)throw t.msg||ge[t.err];return t.result}function To(e,n){return n=n||{},n.raw=!0,Yt(e,n)}var Ao=He,Oo=Yt,zo=To,Ro=Yt,Bo=xe,Uo={Inflate:Ao,inflate:Oo,inflateRaw:zo,ungzip:Ro,constants:Bo};const{Inflate:Ds,inflate:Vs,inflateRaw:Do,ungzip:Fs}=Uo;var Vo=Do;function Fo(e){return Vo(e.subarray(2))}class Lo extends Error{constructor(n){super(n),this.code="ERR_ABORTED"}}function Po(e){e.sort((a,r)=>Number(a.offset)-Number(r.offset));const n=[];let t,i;for(const a of e)t&&i&&Number(a.offset)-i<=2e3?(t.length=BigInt(Number(t.length)+Number(a.length)-i+Number(a.offset)),t.blocks.push(a)):n.push(t={blocks:[a],length:a.length,offset:a.offset}),i=Number(t.offset)+Number(t.length);return n}function et(e){if(e&&e.aborted)if(typeof DOMException>"u"){const n=new Lo("aborted");throw n.code="ERR_ABORTED",n}else throw new DOMException("aborted","AbortError")}const Zo=1,xo=2,Mo=3;function Ct(e,n,t,i){return e=t}function Ho(e){const n=e?"big":"little",t=new N().endianess(n).uint32("chromId").uint32("start").uint32("end").uint32("validCnt").floatle("minScore").floatle("maxScore").floatle("sumData").floatle("sumSqData").saveOffset("offset"),i=new N().endianess(n).uint8("isLeaf").skip(1).uint16("cnt").choice({tag:"isLeaf",choices:{1:new N().endianess(n).array("blocksToFetch",{length:"cnt",type:new N().endianess(n).uint32("startChrom").uint32("startBase").uint32("endChrom").uint32("endBase").uint64("blockOffset").uint64("blockSize").saveOffset("offset")}),0:new N().array("recurOffsets",{length:"cnt",type:new N().endianess(n).uint32("startChrom").uint32("startBase").uint32("endChrom").uint32("endBase").uint64("blockOffset").saveOffset("offset")})}}),a=new N().endianess(n).uint32("chromId").int32("start").int32("end").string("rest",{zeroTerminated:!0}).saveOffset("offset");return{bigWigParser:new N().endianess(n).skip(4).int32("blockStart").skip(4).uint32("itemStep").uint32("itemSpan").uint8("blockType").skip(1).uint16("itemCount").choice({tag:"blockType",choices:{[Mo]:new N().array("items",{length:"itemCount",type:new N().floatle("score")}),[xo]:new N().array("items",{length:"itemCount",type:new N().endianess(n).int32("start").floatle("score")}),[Zo]:new N().array("items",{length:"itemCount",type:new N().endianess(n).int32("start").int32("end").floatle("score")})}}),bigBedParser:a,summaryParser:t,leafParser:i}}class Ti{constructor(n,t,i,a,r,o){if(this.bbi=n,this.refsByName=t,this.cirTreeOffset=i,this.isBigEndian=a,this.isCompressed=r,this.blockType=o,this.featureCache=new Gn({cache:new Yn({maxSize:1e3}),fill:async(u,s)=>{const f=Number(u.length),p=Number(u.offset),{buffer:c}=await this.bbi.read(J.Buffer.alloc(f),0,f,p,{signal:s});return c}}),!(i>=0))throw new Error("invalid cirTreeOffset!");const l=Ho(a);this.leafParser=l.leafParser,this.bigBedParser=l.bigBedParser}async readWigData(n,t,i,a,r){try{const{refsByName:o,bbi:l,cirTreeOffset:u,isBigEndian:s}=this,f=o[n];f===void 0&&a.complete();const p={chrId:f,start:t,end:i};this.cirTreePromise||(this.cirTreePromise=l.read(J.Buffer.alloc(48),0,48,Number(u),r));const{buffer:c}=await this.cirTreePromise,h=s?c.readUInt32BE(4):c.readUInt32LE(4);let _=[],g=0;const k=(d,$,S)=>{try{const b=d.subarray($),w=this.leafParser.parse(b);if(w.blocksToFetch&&(_=_.concat(w.blocksToFetch.filter(m=>v(m)).map(m=>({offset:m.blockOffset,length:m.blockSize})))),w.recurOffsets){const m=w.recurOffsets.filter(y=>v(y)).map(y=>Number(y.blockOffset));m.length>0&&C(m,S+1)}}catch(b){a.error(b)}},v=d=>{const{startChrom:$,startBase:S,endChrom:b,endBase:w}=d;return($f||b===f&&w>=t)},E=async(d,$,S)=>{try{const b=$.max-$.min,w=$.min,m=await this.featureCache.get(`${b}_${w}`,{length:b,offset:w},r==null?void 0:r.signal);for(const y of d)$.contains(y)&&(k(m,y-w,S),g-=1,g===0&&this.readFeatures(a,_,{...r,request:p}).catch(I=>a.error(I)))}catch(b){a.error(b)}},C=(d,$)=>{try{g+=d.length;const S=4+Number(h)*32;let b=new pe([{min:d[0],max:d[0]+S}]);for(let w=1;wE(d,w,$))}catch(S){a.error(S)}};return C([Number(u)+48],1)}catch(o){a.error(o)}}parseSummaryBlock(n,t,i){const a=[];let r=t;const o=new DataView(n.buffer,n.byteOffset,n.length);for(;rCt(l.start,l.end,a.start,a.end)):r}parseBigWigBlock(n,t,i){const a=n.subarray(t),r=new DataView(a.buffer,a.byteOffset,a.length);let o=0;o+=4;const l=r.getInt32(o,!0);o+=8;const u=r.getUint32(o,!0);o+=4;const s=r.getUint32(o,!0);o+=4;const f=r.getUint8(o);o+=2;const p=r.getUint16(o,!0);o+=2;const c=new Array(p);switch(f){case 1:{for(let h=0;hCt(h.start,h.end,i.start,i.end)):c}async readFeatures(n,t,i={}){try{const{blockType:a,isCompressed:r}=this,{signal:o,request:l}=i,u=Po(t);et(o),await Promise.all(u.map(async s=>{et(o);const{length:f,offset:p}=s,c=await this.featureCache.get(`${f}_${p}`,s,o);for(const h of s.blocks){et(o);let _=Number(h.offset)-Number(s.offset),g=c;switch(r&&(g=Fo(c.subarray(_)),_=0),et(o),a){case"summary":{n.next(this.parseSummaryBlock(g,_,l));break}case"bigwig":{n.next(this.parseBigWigBlock(g,_,l));break}case"bigbed":{n.next(this.parseBigBedBlock(g,_,Number(h.offset)*256,l));break}default:console.warn(`Don't know what to do with ${a}`)}}})),n.complete()}catch(a){n.error(a)}}}var Ft=function(e,n){return Ft=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(t[a]=i[a])},Ft(e,n)};function Kt(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");Ft(e,n);function t(){this.constructor=e}e.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}function jo(e,n,t,i){function a(r){return r instanceof t?r:new t(function(o){o(r)})}return new(t||(t=Promise))(function(r,o){function l(f){try{s(i.next(f))}catch(p){o(p)}}function u(f){try{s(i.throw(f))}catch(p){o(p)}}function s(f){f.done?r(f.value):a(f.value).then(l,u)}s((i=i.apply(e,n||[])).next())})}function Ai(e,n){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,a,r,o;return o={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(s){return function(f){return u([s,f])}}function u(s){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(t=0)),t;)try{if(i=1,a&&(r=s[0]&2?a.return:s[0]?a.throw||((r=a.return)&&r.call(a),0):a.next)&&!(r=r.call(a,s[1])).done)return r;switch(a=0,r&&(s=[s[0]&2,r.value]),s[0]){case 0:case 1:r=s;break;case 4:return t.label++,{value:s[1],done:!1};case 5:t.label++,a=s[1],s=[0];continue;case 7:s=t.ops.pop(),t.trys.pop();continue;default:if(r=t.trys,!(r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){t=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function Lt(e,n){var t=typeof Symbol=="function"&&e[Symbol.iterator];if(!t)return e;var i=t.call(e),a,r=[],o;try{for(;(n===void 0||n-- >0)&&!(a=i.next()).done;)r.push(a.value)}catch(l){o={error:l}}finally{try{a&&!a.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return r}function Pt(e,n,t){if(t||arguments.length===2)for(var i=0,a=n.length,r;i1||l(c,h)})})}function l(c,h){try{u(i[c](h))}catch(_){p(r[0][3],_)}}function u(c){c.value instanceof be?Promise.resolve(c.value.v).then(s,f):p(r[0][2],c)}function s(c){l("next",c)}function f(c){l("throw",c)}function p(c,h){c(h),r.shift(),r.length&&l(r[0][0],r[0][1])}}function Yo(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=e[Symbol.asyncIterator],t;return n?n.call(e):(e=typeof Le=="function"?Le(e):e[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(r){t[r]=e[r]&&function(o){return new Promise(function(l,u){o=e[r](o),a(l,u,o.done,o.value)})}}function a(r,o,l,u){Promise.resolve(u).then(function(s){r({value:s,done:l})},o)}}function z(e){return typeof e=="function"}function Oi(e){var n=function(i){Error.call(i),i.stack=new Error().stack},t=e(n);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var St=Oi(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription: -`+t.map(function(i,a){return a+1+") "+i.toString()}).join(` - `):"",this.name="UnsubscriptionError",this.errors=t}});function Pn(e,n){if(e){var t=e.indexOf(n);0<=t&&e.splice(t,1)}}var Wt=function(){function e(n){this.initialTeardown=n,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var n,t,i,a,r;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var l=Le(o),u=l.next();!u.done;u=l.next()){var s=u.value;s.remove(this)}}catch(g){n={error:g}}finally{try{u&&!u.done&&(t=l.return)&&t.call(l)}finally{if(n)throw n.error}}else o.remove(this);var f=this.initialTeardown;if(z(f))try{f()}catch(g){r=g instanceof St?g.errors:[g]}var p=this._finalizers;if(p){this._finalizers=null;try{for(var c=Le(p),h=c.next();!h.done;h=c.next()){var _=h.value;try{Zn(_)}catch(g){r=r??[],g instanceof St?r=Pt(Pt([],Lt(r)),Lt(g.errors)):r.push(g)}}}catch(g){i={error:g}}finally{try{h&&!h.done&&(a=c.return)&&a.call(c)}finally{if(i)throw i.error}}}if(r)throw new St(r)}},e.prototype.add=function(n){var t;if(n&&n!==this)if(this.closed)Zn(n);else{if(n instanceof e){if(n.closed||n._hasParent(this))return;n._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(n)}},e.prototype._hasParent=function(n){var t=this._parentage;return t===n||Array.isArray(t)&&t.includes(n)},e.prototype._addParent=function(n){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(n),t):t?[t,n]:n},e.prototype._removeParent=function(n){var t=this._parentage;t===n?this._parentage=null:Array.isArray(t)&&Pn(t,n)},e.prototype.remove=function(n){var t=this._finalizers;t&&Pn(t,n),n instanceof e&&n._removeParent(this)},e.EMPTY=function(){var n=new e;return n.closed=!0,n}(),e}();Wt.EMPTY;function zi(e){return e instanceof Wt||e&&"closed"in e&&z(e.remove)&&z(e.add)&&z(e.unsubscribe)}function Zn(e){z(e)?e():e.unsubscribe()}var Ri={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Bi={setTimeout:function(e,n){for(var t=[],i=2;i=2,!1,!0))}var Ns=function(e,n){return e.push(n),e};function Is(){return $e(function(e,n){er(Ns,[])(e).subscribe(n)})}const Hn=-2003829722,It=-2021002517;function Ts(e){return new TextDecoder().decode(e)}function jn(e){const n=e?"big":"little",t=new N().endianess(n).int32("magic").uint16("version").uint16("numZoomLevels").uint64("chromTreeOffset").uint64("unzoomedDataOffset").uint64("unzoomedIndexOffset").uint16("fieldCount").uint16("definedFieldCount").uint64("asOffset").uint64("totalSummaryOffset").uint32("uncompressBufSize").uint64("extHeaderOffset").array("zoomLevels",{length:"numZoomLevels",type:new N().endianess(n).uint32("reductionLevel").uint32("reserved").uint64("dataOffset").uint64("indexOffset")}),i=new N().endianess(n).uint64("basesCovered").doublele("scoreMin").doublele("scoreMax").doublele("scoreSum").doublele("scoreSumSquares"),a=new N().endianess(n).uint32("magic").uint32("blockSize").uint32("keySize").uint32("valSize").uint64("itemCount"),r=new N().endianess(n).uint8("isLeafNode").skip(1).uint16("cnt").saveOffset("offset");return{chromTreeParser:a,totalSummaryParser:i,headerParser:t,isLeafNode:r}}class tr{getHeader(n){return this.headerP||(this.headerP=this._getHeader(n).catch(t=>{throw this.headerP=void 0,t})),this.headerP}constructor(n){const{filehandle:t,renameRefSeqs:i=o=>o,path:a,url:r}=n;if(this.renameRefSeqs=i,t)this.bbi=t;else if(r)this.bbi=new ir(r);else if(a)this.bbi=new nr(a);else throw new Error("no file given")}async _getHeader(n){const t=await this._getMainHeader(n),i=await this._readChromTree(t,n);return{...t,...i}}async _getMainHeader(n,t=2e3){const{buffer:i}=await this.bbi.read(J.Buffer.alloc(t),0,t,0,n),a=this._isBigEndian(i),r=jn(a),o=r.headerParser.parse(i),{magic:l,asOffset:u,totalSummaryOffset:s}=o;if(o.fileType=l===It?"bigbed":"bigwig",u>t||s>t)return this._getMainHeader(n,t*2);if(u){const f=Number(o.asOffset);o.autoSql=Ts(i.subarray(f,i.indexOf(0,f)))}if(o.totalSummaryOffset>t-8*5)return this._getMainHeader(n,t*2);if(o.totalSummaryOffset){const f=i.subarray(Number(o.totalSummaryOffset)),p=r.totalSummaryParser.parse(f);o.totalSummary={...p,basesCovered:Number(p.basesCovered)}}return{...o,isBigEndian:a}}_isBigEndian(n){let t=n.readInt32LE(0);if(t===Hn||t===It)return!1;if(t=n.readInt32BE(0),t===Hn||t===It)return!0;throw new Error("not a BigWig/BigBed file")}async _readChromTree(n,t){const i=n.isBigEndian,a=i?"big":"little",r=[],o={};let l=Number(n.unzoomedDataOffset);const u=Number(n.chromTreeOffset);for(;l%4!==0;)l+=1;const s=l-u,{buffer:f}=await this.bbi.read(J.Buffer.alloc(s),0,s,Number(u),t),p=jn(i),{keySize:c}=p.chromTreeParser.parse(f),h=new N().endianess(a).string("key",{stripNull:!0,length:c}).uint32("refId").uint32("refSize").saveOffset("offset"),_=new N().endianess(a).skip(c).uint64("childOffset").saveOffset("offset"),g=32,k=async v=>{let E=v;if(E>=f.length)throw new Error("reading beyond end of buffer");const C=p.isLeafNode.parse(f.subarray(E)),{isLeafNode:d,cnt:$}=C;if(E+=C.offset,d)for(let S=0;S<$;S+=1){const b=h.parse(f.subarray(E));E+=b.offset;const{key:w,refId:m,refSize:y}=b,I={name:w,id:m,length:y};o[this.renameRefSeqs(w)]=m,r[m]=I}else{const S=[];for(let b=0;b<$;b+=1){const w=_.parse(f.subarray(E)),{childOffset:m}=w;E+=w.offset,S.push(k(Number(m)-Number(u)))}await Promise.all(S)}};return await k(g),{refsByName:o,refsByNumber:r}}async getUnzoomedView(n){const{unzoomedIndexOffset:t,refsByName:i,uncompressBufSize:a,isBigEndian:r,fileType:o}=await this.getHeader(n);return new Ti(this.bbi,i,t,r,a>0,o)}async getFeatureStream(n,t,i,a){await this.getHeader(a);const r=this.renameRefSeqs(n);let o;const{basesPerSpan:l,scale:u}=a||{};return l?o=await this.getView(1/l,a):u?o=await this.getView(u,a):o=await this.getView(1,a),new Z(s=>{o.readWigData(r,t,i,s,a)})}async getFeatures(n,t,i,a){const r=await this.getFeatureStream(n,t,i,a);return(await qi(r.pipe(Is()))).flat()}}class Ls extends tr{async getView(n,t){const{zoomLevels:i,refsByName:a,fileSize:r,isBigEndian:o,uncompressBufSize:l}=await this.getHeader(t),u=1/n;let s=i.length;r||(s-=1);for(let f=s;f>=0;f-=1){const p=i[f];if(p&&p.reductionLevel<=2*u){const c=Number(p.indexOffset);return new Ti(this.bbi,a,c,o,l>0,"summary")}}return this.getUnzoomedView(t)}}function As(e){return e.filter(n=>!!n)}class Ps extends tr{constructor(){super(...arguments),this.readIndicesCache=new Gn({cache:new Yn({maxSize:1}),fill:(n,t)=>this._readIndices({...n,signal:t})})}readIndices(n={}){const{signal:t,...i}=n;return this.readIndicesCache.get(JSON.stringify(i),n,t)}async getView(n,t){return this.getUnzoomedView(t)}async _readIndices(n){const{extHeaderOffset:t,isBigEndian:i}=await this.getHeader(n),{buffer:a}=await this.bbi.read(J.Buffer.alloc(64),0,64,Number(t)),r=i?"big":"little",o=new N().endianess(r).uint16("size").uint16("count").uint64("offset").parse(a),{count:l,offset:u}=o;if(l===0)return[];const s=20,f=s*l,{buffer:p}=await this.bbi.read(J.Buffer.alloc(f),0,f,Number(u)),c=new N().endianess(r).int16("type").int16("fieldcount").uint64("offset").skip(4).int16("field"),h=[];for(let _=0;_{const{offset:l,field:u}=o,{buffer:s}=await this.bbi.read(J.Buffer.alloc(32),0,32,Number(l),t),f=i?"big":"little",p=new N().endianess(f).int32("magic").int32("blockSize").int32("keySize").int32("valSize").uint64("itemCount"),{blockSize:c,keySize:h,valSize:_}=p.parse(s),g=new N().endianess(f).int8("nodeType").skip(1).int16("cnt").choice({tag:"nodeType",choices:{0:new N().array("leafkeys",{length:"cnt",type:new N().endianess(f).string("key",{length:h,stripNull:!0}).uint64("offset")}),1:new N().array("keys",{length:"cnt",type:new N().endianess(f).string("key",{length:h,stripNull:!0}).uint64("offset").uint32("length").uint32("reserved")})}}),k=async E=>{const C=Number(E),d=4+c*(h+_),{buffer:$}=await this.bbi.read(J.Buffer.alloc(d),0,d,C,t),S=g.parse($);if(S.leafkeys){let b;for(let w=0;wnew Z(u=>{a.readFeatures(u,[l],t)}).pipe(er((u,s)=>u.concat(s)),Ji(u=>{for(const s of u)s.field=l.field;return u})));return(await qi(Cs(...r))).filter(l=>{var u;return((u=l.rest)===null||u===void 0?void 0:u.split(" ")[(l.field||0)-3])===n})}}export{Ps as BigBed,Ls as BigWig}; diff --git a/playground/assets/index-BzsNbVpR.js b/playground/assets/index-BzsNbVpR.js deleted file mode 100644 index aafbe6d..0000000 --- a/playground/assets/index-BzsNbVpR.js +++ /dev/null @@ -1 +0,0 @@ -import{c as v,g as x}from"./_commonjsHelpers-DM6icglO.js";var T={},m={},h={},g={};Object.defineProperty(g,"__esModule",{value:!0});function A(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function D(r,e){for(var t=0;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function p(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function Y(r,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return p(r)}function G(r){var e=$();return function(){var o=d(r),n;if(e){var a=d(this).constructor;n=Reflect.construct(o,arguments,a)}else n=o.apply(this,arguments);return Y(this,n)}}function U(r,e){for(;!Object.prototype.hasOwnProperty.call(r,e)&&(r=d(r),r!==null););return r}function y(){return typeof Reflect<"u"&&Reflect.get?y=Reflect.get.bind():y=function(e,t,o){var n=U(e,t);if(n){var a=Object.getOwnPropertyDescriptor(n,t);return a.get?a.get.call(arguments.length<3?e:o):a.value}},y.apply(this,arguments)}var P=function(){function r(){A(this,r),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return E(r,[{key:"addEventListener",value:function(t,o,n){t in this.listeners||(this.listeners[t]=[]),this.listeners[t].push({callback:o,options:n})}},{key:"removeEventListener",value:function(t,o){if(t in this.listeners){for(var n=this.listeners[t],a=0,c=n.length;a"u")n=new Error("This operation was aborted"),n.name="AbortError";else try{n=new DOMException("signal is aborted without reason")}catch{n=new Error("This operation was aborted"),n.name="AbortError"}this.signal.reason=n,this.signal.dispatchEvent(o)}},{key:"toString",value:function(){return"[object AbortController]"}}]),r}();typeof Symbol<"u"&&Symbol.toStringTag&&(j.prototype[Symbol.toStringTag]="AbortController",R.prototype[Symbol.toStringTag]="AbortSignal");function Q(r){return r.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof r.Request=="function"&&!r.Request.prototype.hasOwnProperty("signal")||!r.AbortController}function H(r){typeof r=="function"&&(r={fetch:r});var e=r,t=e.fetch,o=e.Request,n=o===void 0?t.Request:o,a=e.AbortController,c=e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL,i=c===void 0?!1:c;if(!Q({fetch:t,Request:n,AbortController:a,__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL:i}))return{fetch:t,Request:l};var l=n;(l&&!l.prototype.hasOwnProperty("signal")||i)&&(l=function(b,s){var f;s&&s.signal&&(f=s.signal,delete s.signal);var u=new n(b,s);return f&&Object.defineProperty(u,"signal",{writable:!1,enumerable:!1,configurable:!0,value:f}),u},l.prototype=n.prototype);var L=t,z=function(b,s){var f=l&&l.prototype.isPrototypeOf(b)?b.signal:s?s.signal:void 0;if(f){var u;try{u=new DOMException("Aborted","AbortError")}catch{u=new Error("Aborted"),u.name="AbortError"}if(f.aborted)return Promise.reject(u);var M=new Promise(function(q,I){f.addEventListener("abort",function(){return I(u)},{once:!0})});return s&&s.signal&&delete s.signal,Promise.race([M,L(b,s)])}return L(b,s)};return{fetch:z,Request:l}}g.AbortController=j;g.AbortSignal=R;g.abortableFetch=H;Object.defineProperty(h,"__esModule",{value:!0});h.AbortSignal=h.AbortController=void 0;const k=g;var _=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof globalThis<"u")return globalThis;throw new Error("unable to locate global object")};let J=typeof _().AbortController>"u"?k.AbortController:_().AbortController;h.AbortController=J;let K=typeof _().AbortController>"u"?k.AbortSignal:_().AbortSignal;h.AbortSignal=K;var S={};Object.defineProperty(S,"__esModule",{value:!0});const V=h;class W{}class X{constructor(){this.signals=new Set,this.abortController=new V.AbortController}addSignal(e=new W){if(this.signal.aborted)throw new Error("cannot add a signal, already aborted!");this.signals.add(e),e.aborted?this.handleAborted(e):typeof e.addEventListener=="function"&&e.addEventListener("abort",()=>{this.handleAborted(e)})}handleAborted(e){this.signals.delete(e),this.signals.size===0&&this.abortController.abort()}get signal(){return this.abortController.signal}abort(){this.abortController.abort()}}S.default=X;var C={};Object.defineProperty(C,"__esModule",{value:!0});class Z{constructor(){this.callbacks=new Set}addCallback(e=()=>{}){this.callbacks.add(e),e(this.currentMessage)}callback(e){this.currentMessage=e,this.callbacks.forEach(t=>{t(e)})}}C.default=Z;var F=v&&v.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(m,"__esModule",{value:!0});const ee=h,te=F(S),re=F(C);class O{constructor({fill:e,cache:t}){if(typeof e!="function")throw new TypeError("must pass a fill function");if(typeof t!="object")throw new TypeError("must pass a cache object");if(typeof t.get!="function"||typeof t.set!="function"||typeof t.delete!="function")throw new TypeError("cache must implement get(key), set(key, val), and and delete(key)");this.cache=t,this.fillCallback=e}static isAbortException(e){return e.name==="AbortError"||e.code==="ERR_ABORTED"||e.message==="AbortError: aborted"||e.message==="Error: aborted"}evict(e,t){this.cache.get(e)===t&&this.cache.delete(e)}fill(e,t,o,n){const a=new te.default,c=new re.default;c.addCallback(n);const i={aborter:a,promise:this.fillCallback(t,a.signal,l=>{c.callback(l)}),settled:!1,statusReporter:c,get aborted(){return this.aborter.signal.aborted}};i.aborter.addSignal(o),i.aborter.signal.addEventListener("abort",()=>{i.settled||this.evict(e,i)}),i.promise.then(()=>{i.settled=!0},()=>{i.settled=!0,this.evict(e,i)}).catch(l=>{throw console.error(l),l}),this.cache.set(e,i)}static checkSinglePromise(e,t){function o(){if(t&&t.aborted)throw Object.assign(new Error("aborted"),{code:"ERR_ABORTED"})}return e.then(n=>(o(),n),n=>{throw o(),n})}has(e){return this.cache.has(e)}get(e,t,o,n){if(!o&&t instanceof ee.AbortSignal)throw new TypeError("second get argument appears to be an AbortSignal, perhaps you meant to pass `null` for the fill data?");const a=this.cache.get(e);return a?a.aborted&&!a.settled?(this.evict(e,a),this.get(e,t,o,n)):a.settled?a.promise:(a.aborter.addSignal(o),a.statusReporter.addCallback(n),O.checkSinglePromise(a.promise,o)):(this.fill(e,t,o,n),O.checkSinglePromise(this.cache.get(e).promise,o))}delete(e){const t=this.cache.get(e);t&&(t.settled||t.aborter.abort(),this.cache.delete(e))}clear(){const e=this.cache.keys();let t=0;for(let o=e.next();!o.done;o=e.next())this.delete(o.value),t+=1;return t}}m.default=O;var oe=v&&v.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(T,"__esModule",{value:!0});const ne=oe(m);var se=T.default=ne.default;class ae{constructor(e={}){if(!(e.maxSize&&e.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=e.maxSize,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(e,t){this.cache.set(e,t),this._size++,this._size>=this.maxSize&&(this._size=0,this.oldCache=this.cache,this.cache=new Map)}get(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e)){const t=this.oldCache.get(e);return this.oldCache.delete(e),this._set(e,t),t}}set(e,t){return this.cache.has(e)?this.cache.set(e,t):this._set(e,t),this}has(e){return this.cache.has(e)||this.oldCache.has(e)}peek(e){if(this.cache.has(e))return this.cache.get(e);if(this.oldCache.has(e))return this.oldCache.get(e)}delete(e){const t=this.cache.delete(e);return t&&this._size--,this.oldCache.delete(e)||t}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(const[e]of this)yield e}*values(){for(const[,e]of this)yield e}*[Symbol.iterator](){for(const e of this.cache)yield e;for(const e of this.oldCache){const[t]=e;this.cache.has(t)||(yield e)}}get size(){let e=0;for(const t of this.oldCache.keys())this.cache.has(t)||e++;return this._size+e}}var ie=ae;const ce=x(ie);export{ce as L,se as _}; diff --git a/playground/assets/index-C3Wx-3vw.js b/playground/assets/index-C8ZlFX0-.js similarity index 91% rename from playground/assets/index-C3Wx-3vw.js rename to playground/assets/index-C8ZlFX0-.js index b346851..b11deb0 100644 --- a/playground/assets/index-C3Wx-3vw.js +++ b/playground/assets/index-C8ZlFX0-.js @@ -1 +1 @@ -import{L as d}from"./__vite-browser-external-D80GqXp3.js";import{R as b}from"./remoteFile-Dv8-F_G9.js";import{b as s}from"./index-BHN4ZNUB.js";import"./_commonjsHelpers-DM6icglO.js";function a(o){const r=new FileReader;return new Promise((n,e)=>{r.onerror=()=>{r.abort(),e(new Error("problem reading blob"))},r.onabort=()=>{e(new Error("blob reading was aborted"))},r.onload=()=>{r.result&&typeof r.result!="string"?n(r.result):e(new Error("unknown error reading blob"))},r.readAsArrayBuffer(o)})}function c(o){const r=new FileReader;return new Promise((n,e)=>{r.onerror=()=>{r.abort(),e(new Error("problem reading blob"))},r.onabort=()=>{e(new Error("blob reading was aborted"))},r.onload=()=>{r.result&&typeof r.result=="string"?n(r.result):e(new Error("unknown error reading blob"))},r.readAsText(o)})}class E{constructor(r){this.blob=r,this.size=r.size}async read(r,n=0,e,u=0){if(!e)return{bytesRead:0,buffer:r};const t=u,f=t+e,l=await a(this.blob.slice(t,f)),i=s.Buffer.from(l);return{bytesRead:i.copy(r,n),buffer:i}}async readFile(r){const n=typeof r=="string"?r:r==null?void 0:r.encoding;if(n==="utf8")return c(this.blob);if(n)throw new Error(`unsupported encoding: ${n}`);const e=await a(this.blob);return s.Buffer.from(e)}async stat(){return{size:this.size}}async close(){}}function w(o,r={}){return new b(o,r)}function R(o,r,n,e={}){if(n!==void 0)return n;if(o!==void 0)return w(o,e);if(r!==void 0)return new d(r,e);throw new Error("no url, path, or filehandle provided, cannot open")}export{E as BlobFile,d as LocalFile,b as RemoteFile,w as fromUrl,R as open}; +import{L as d}from"./__vite-browser-external-D80GqXp3.js";import{R as b}from"./remoteFile-_ulnNXZo.js";import{b as s}from"./index-CJAFAeH3.js";import"./_commonjsHelpers-C932wzq6.js";function a(o){const r=new FileReader;return new Promise((n,e)=>{r.onerror=()=>{r.abort(),e(new Error("problem reading blob"))},r.onabort=()=>{e(new Error("blob reading was aborted"))},r.onload=()=>{r.result&&typeof r.result!="string"?n(r.result):e(new Error("unknown error reading blob"))},r.readAsArrayBuffer(o)})}function c(o){const r=new FileReader;return new Promise((n,e)=>{r.onerror=()=>{r.abort(),e(new Error("problem reading blob"))},r.onabort=()=>{e(new Error("blob reading was aborted"))},r.onload=()=>{r.result&&typeof r.result=="string"?n(r.result):e(new Error("unknown error reading blob"))},r.readAsText(o)})}class E{constructor(r){this.blob=r,this.size=r.size}async read(r,n=0,e,u=0){if(!e)return{bytesRead:0,buffer:r};const t=u,f=t+e,l=await a(this.blob.slice(t,f)),i=s.Buffer.from(l);return{bytesRead:i.copy(r,n),buffer:i}}async readFile(r){const n=typeof r=="string"?r:r==null?void 0:r.encoding;if(n==="utf8")return c(this.blob);if(n)throw new Error(`unsupported encoding: ${n}`);const e=await a(this.blob);return s.Buffer.from(e)}async stat(){return{size:this.size}}async close(){}}function w(o,r={}){return new b(o,r)}function R(o,r,n,e={}){if(n!==void 0)return n;if(o!==void 0)return w(o,e);if(r!==void 0)return new d(r,e);throw new Error("no url, path, or filehandle provided, cannot open")}export{E as BlobFile,d as LocalFile,b as RemoteFile,w as fromUrl,R as open}; diff --git a/playground/assets/index-BHN4ZNUB.js b/playground/assets/index-CJAFAeH3.js similarity index 99% rename from playground/assets/index-BHN4ZNUB.js rename to playground/assets/index-CJAFAeH3.js index e9f50a2..fbe7935 100644 --- a/playground/assets/index-BHN4ZNUB.js +++ b/playground/assets/index-CJAFAeH3.js @@ -1,4 +1,4 @@ -import{g as _r}from"./_commonjsHelpers-DM6icglO.js";function Sr(c,f){for(var s=0;sw[y]})}}}return Object.freeze(Object.defineProperty(c,Symbol.toStringTag,{value:"Module"}))}var V={},j={};j.byteLength=Nr;j.toByteArray=kr;j.fromByteArray=$r;var _=[],R=[],Lr=typeof Uint8Array<"u"?Uint8Array:Array,H="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var k=0,br=H.length;k0)throw new Error("Invalid string. Length must be a multiple of 4");var s=c.indexOf("=");s===-1&&(s=f);var w=s===f?0:4-s%4;return[s,w]}function Nr(c){var f=hr(c),s=f[0],w=f[1];return(s+w)*3/4-w}function Mr(c,f,s){return(f+s)*3/4-s}function kr(c){var f,s=hr(c),w=s[0],y=s[1],l=new Lr(Mr(c,w,y)),p=0,o=y>0?w-4:w,B;for(B=0;B>16&255,l[p++]=f>>8&255,l[p++]=f&255;return y===2&&(f=R[c.charCodeAt(B)]<<2|R[c.charCodeAt(B+1)]>>4,l[p++]=f&255),y===1&&(f=R[c.charCodeAt(B)]<<10|R[c.charCodeAt(B+1)]<<4|R[c.charCodeAt(B+2)]>>2,l[p++]=f>>8&255,l[p++]=f&255),l}function Dr(c){return _[c>>18&63]+_[c>>12&63]+_[c>>6&63]+_[c&63]}function Pr(c,f,s){for(var w,y=[],l=f;lo?o:p+l));return w===1?(f=c[s-1],y.push(_[f>>2]+_[f<<4&63]+"==")):w===2&&(f=(c[s-2]<<8)+c[s-1],y.push(_[f>>10]+_[f>>4&63]+_[f<<2&63]+"=")),y.join("")}var X={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */X.read=function(c,f,s,w,y){var l,p,o=y*8-w-1,B=(1<>1,I=-7,F=s?y-1:0,S=s?-1:1,A=c[f+F];for(F+=S,l=A&(1<<-I)-1,A>>=-I,I+=o;I>0;l=l*256+c[f+F],F+=S,I-=8);for(p=l&(1<<-I)-1,l>>=-I,I+=w;I>0;p=p*256+c[f+F],F+=S,I-=8);if(l===0)l=1-T;else{if(l===B)return p?NaN:(A?-1:1)*(1/0);p=p+Math.pow(2,w),l=l-T}return(A?-1:1)*p*Math.pow(2,l-w)};X.write=function(c,f,s,w,y,l){var p,o,B,T=l*8-y-1,I=(1<>1,S=y===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=w?0:l-1,D=w?1:-1,P=f<0||f===0&&1/f<0?1:0;for(f=Math.abs(f),isNaN(f)||f===1/0?(o=isNaN(f)?1:0,p=I):(p=Math.floor(Math.log(f)/Math.LN2),f*(B=Math.pow(2,-p))<1&&(p--,B*=2),p+F>=1?f+=S/B:f+=S*Math.pow(2,1-F),f*B>=2&&(p++,B/=2),p+F>=I?(o=0,p=I):p+F>=1?(o=(f*B-1)*Math.pow(2,y),p=p+F):(o=f*Math.pow(2,F-1)*Math.pow(2,y),p=0));y>=8;c[s+A]=o&255,A+=D,o/=256,y-=8);for(p=p<0;c[s+A]=p&255,A+=D,p/=256,T-=8);c[s+A-D]|=P*128};/*! +import{g as _r}from"./_commonjsHelpers-C932wzq6.js";function Sr(c,f){for(var s=0;sw[y]})}}}return Object.freeze(Object.defineProperty(c,Symbol.toStringTag,{value:"Module"}))}var V={},j={};j.byteLength=Nr;j.toByteArray=kr;j.fromByteArray=$r;var _=[],R=[],Lr=typeof Uint8Array<"u"?Uint8Array:Array,H="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var k=0,br=H.length;k0)throw new Error("Invalid string. Length must be a multiple of 4");var s=c.indexOf("=");s===-1&&(s=f);var w=s===f?0:4-s%4;return[s,w]}function Nr(c){var f=hr(c),s=f[0],w=f[1];return(s+w)*3/4-w}function Mr(c,f,s){return(f+s)*3/4-s}function kr(c){var f,s=hr(c),w=s[0],y=s[1],l=new Lr(Mr(c,w,y)),p=0,o=y>0?w-4:w,B;for(B=0;B>16&255,l[p++]=f>>8&255,l[p++]=f&255;return y===2&&(f=R[c.charCodeAt(B)]<<2|R[c.charCodeAt(B+1)]>>4,l[p++]=f&255),y===1&&(f=R[c.charCodeAt(B)]<<10|R[c.charCodeAt(B+1)]<<4|R[c.charCodeAt(B+2)]>>2,l[p++]=f>>8&255,l[p++]=f&255),l}function Dr(c){return _[c>>18&63]+_[c>>12&63]+_[c>>6&63]+_[c&63]}function Pr(c,f,s){for(var w,y=[],l=f;lo?o:p+l));return w===1?(f=c[s-1],y.push(_[f>>2]+_[f<<4&63]+"==")):w===2&&(f=(c[s-2]<<8)+c[s-1],y.push(_[f>>10]+_[f>>4&63]+_[f<<2&63]+"=")),y.join("")}var X={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */X.read=function(c,f,s,w,y){var l,p,o=y*8-w-1,B=(1<>1,I=-7,F=s?y-1:0,S=s?-1:1,A=c[f+F];for(F+=S,l=A&(1<<-I)-1,A>>=-I,I+=o;I>0;l=l*256+c[f+F],F+=S,I-=8);for(p=l&(1<<-I)-1,l>>=-I,I+=w;I>0;p=p*256+c[f+F],F+=S,I-=8);if(l===0)l=1-T;else{if(l===B)return p?NaN:(A?-1:1)*(1/0);p=p+Math.pow(2,w),l=l-T}return(A?-1:1)*p*Math.pow(2,l-w)};X.write=function(c,f,s,w,y,l){var p,o,B,T=l*8-y-1,I=(1<>1,S=y===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=w?0:l-1,D=w?1:-1,P=f<0||f===0&&1/f<0?1:0;for(f=Math.abs(f),isNaN(f)||f===1/0?(o=isNaN(f)?1:0,p=I):(p=Math.floor(Math.log(f)/Math.LN2),f*(B=Math.pow(2,-p))<1&&(p--,B*=2),p+F>=1?f+=S/B:f+=S*Math.pow(2,1-F),f*B>=2&&(p++,B/=2),p+F>=I?(o=0,p=I):p+F>=1?(o=(f*B-1)*Math.pow(2,y),p=p+F):(o=f*Math.pow(2,F-1)*Math.pow(2,y),p=0));y>=8;c[s+A]=o&255,A+=D,o/=256,y-=8);for(p=p<0;c[s+A]=p&255,A+=D,p/=256,T-=8);c[s+A-D]|=P*128};/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh diff --git a/playground/assets/index-CP8tDUB0.js b/playground/assets/index-CP8tDUB0.js deleted file mode 100644 index 5861618..0000000 --- a/playground/assets/index-CP8tDUB0.js +++ /dev/null @@ -1,2 +0,0 @@ -import{_ as Y,L as J}from"./index-BzsNbVpR.js";import{b as K}from"./index-BHN4ZNUB.js";import{L as P}from"./__vite-browser-external-D80GqXp3.js";import{u as F,L as G,a as Q}from"./long-DmGCVeXr.js";import"./_commonjsHelpers-DM6icglO.js";function H(a){if(a.greaterThan(Number.MAX_SAFE_INTEGER)||a.lessThan(Number.MIN_SAFE_INTEGER))throw new Error("integer overflow");return a.toNumber()}class Z extends Error{}function L(a){if(a&&a.aborted){if(typeof DOMException<"u")throw new DOMException("aborted","AbortError");{const e=new Z("aborted");throw e.code="ERR_ABORTED",e}}}function ee(a,e){return e.minv.blockPosition-a.maxv.blockPosition<65e3&&e.maxv.blockPosition-a.minv.blockPosition<5e6}function j(a,e){const t=[];let n=null;return a.length===0?a:(a.sort(function(i,r){const s=i.minv.blockPosition-r.minv.blockPosition;return s!==0?s:i.minv.dataPosition-r.minv.dataPosition}),a.forEach(i=>{(!e||i.maxv.compareTo(e)>0)&&(n===null?(t.push(i),n=i):ee(n,i)?i.maxv.compareTo(n.maxv)>0&&(n.maxv=i.maxv):(t.push(i),n=i))}),t)}class M{constructor(e,t){this.blockPosition=e,this.dataPosition=t}toString(){return`${this.blockPosition}:${this.dataPosition}`}compareTo(e){return this.blockPosition-e.blockPosition||this.dataPosition-e.dataPosition}static min(...e){let t,n=0;for(;!t;n+=1)t=e[n];for(;n0&&(t=e[n]);return t}}function T(a,e=0,t=!1){if(t)throw new Error("big-endian virtual file offsets not implemented");return new M(a[e+7]*1099511627776+a[e+6]*4294967296+a[e+5]*16777216+a[e+4]*65536+a[e+3]*256+a[e+2],a[e+1]<<8|a[e])}class B{constructor(e,t,n,i=void 0){this.minv=e,this.maxv=t,this.bin=n,this._fetchedSize=i}toUniqueString(){return`${this.minv}..${this.maxv} (bin ${this.bin}, fetchedSize ${this.fetchedSize()})`}toString(){return this.toUniqueString()}compareTo(e){return this.minv.compareTo(e.minv)||this.maxv.compareTo(e.maxv)||this.bin-e.bin}fetchedSize(){return this._fetchedSize!==void 0?this._fetchedSize:this.maxv.blockPosition+65536-this.minv.blockPosition}}class X{constructor({filehandle:e,renameRefSeqs:t=n=>n}){this.filehandle=e,this.renameRefSeq=t}async getMetadata(e={}){const{indices:t,...n}=await this.parse(e);return n}_findFirstData(e,t){return e?e.compareTo(t)>0?t:e:t}async parse(e={}){return this.parseP||(this.parseP=this._parse(e).catch(t=>{throw this.parseP=void 0,t})),this.parseP}async hasRefSeq(e,t={}){var n;return!!(!((n=(await this.parse(t)).indices[e])===null||n===void 0)&&n.binIndex)}}const te=21578324,q=14;function ne(a,e){return a+=1,e-=1,[[0,0],[1+(a>>26),1+(e>>26)],[9+(a>>23),9+(e>>23)],[73+(a>>20),73+(e>>20)],[585+(a>>17),585+(e>>17)],[4681+(a>>14),4681+(e>>14)]]}class z extends X{async lineCount(e,t={}){const n=await this.parse(t);if(!n)return-1;const i=n.refNameToId[e];if(!n.indices[i])return-1;const{stats:s}=n.indices[i];return s?s.lineCount:-1}async _parse(e={}){const t=await this.filehandle.readFile(e),n=await F(t);if(L(e.signal),n.readUInt32LE(0)!==te)throw new Error("Not a TBI file");const i=n.readInt32LE(4),r=n.readInt32LE(8),s=r&65536?"zero-based-half-open":"1-based-closed",f={0:"generic",1:"SAM",2:"VCF"}[r&15];if(!f)throw new Error(`invalid Tabix preset format flags ${r}`);const c={ref:n.readInt32LE(12),start:n.readInt32LE(16),end:n.readInt32LE(20)},m=n.readInt32LE(24),l=5,d=((1<<(l+1)*3)-1)/7,b=2**(14+l*3),w=m?String.fromCharCode(m):null,u=n.readInt32LE(28),I=n.readInt32LE(32),{refNameToId:x,refIdToName:p}=this._parseNameBytes(n.slice(36,36+I));let h=36+I,g;return{indices:new Array(i).fill(0).map(()=>{const N=n.readInt32LE(h);h+=4;const S={};let E;for(let v=0;vd+1)throw new Error("tabix index contains too many bins, please use a CSI index");if(_===d+1){const k=n.readInt32LE(h);h+=4,k===2&&(E=this.parsePseudoBin(n,h)),h+=16*k}else{const k=n.readInt32LE(h);h+=4;const $=new Array(k);for(let D=0;D>q>=o.linearIndex.length?o.linearIndex.length-1:t>>q]:new M(0,0))||console.warn("querying outside of possible tabix range");const c=ne(t,n),m=[];for(const[u,I]of c)for(let x=u;x<=I;x++)if(o.binIndex[x])for(const p of o.binIndex[x])m.push(new B(p.minv,p.maxv,x));const l=o.linearIndex.length;let d=null;const b=Math.min(t>>14,l-1),w=Math.min(n>>14,l-1);for(let u=b;u<=w;++u){const I=o.linearIndex[u];I&&(!d||I.compareTo(d)<0)&&(d=I)}return j(m,d)}}const ie=21582659,re=38359875;function oe(a,e){return a*2**e}function O(a,e){return Math.floor(a/2**e)}class U extends X{constructor(e){super(e),this.maxBinNumber=0,this.depth=0,this.minShift=0}async lineCount(e,t={}){const n=await this.parse(t);if(!n)return-1;const i=n.refNameToId[e];if(!n.indices[i])return-1;const{stats:s}=n.indices[i];return s?s.lineCount:-1}indexCov(){throw new Error("CSI indexes do not support indexcov")}parseAuxData(e,t){const n=e.readInt32LE(t),i=n&65536?"zero-based-half-open":"1-based-closed",r={0:"generic",1:"SAM",2:"VCF"}[n&15];if(!r)throw new Error(`invalid Tabix preset format flags ${n}`);const s={ref:e.readInt32LE(t+4),start:e.readInt32LE(t+8),end:e.readInt32LE(t+12)},o=e.readInt32LE(t+16),f=o?String.fromCharCode(o):null,c=e.readInt32LE(t+20),m=e.readInt32LE(t+24),{refIdToName:l,refNameToId:d}=this._parseNameBytes(e.slice(t+28,t+28+m));return{refIdToName:l,refNameToId:d,skipLines:c,metaChar:f,columnNumbers:s,format:r,coordinateType:i}}_parseNameBytes(e){let t=0,n=0;const i=[],r={};for(let s=0;s=30?this.parseAuxData(t,16):{refIdToName:[],refNameToId:{},metaChar:null,columnNumbers:{ref:0,start:1,end:2},coordinateType:"zero-based-half-open",format:"generic"},o=t.readInt32LE(16+r);let f,c=16+r+4;const m=new Array(o).fill(0).map(()=>{const l=t.readInt32LE(c);c+=4;const d={};let b;for(let w=0;wthis.maxBinNumber)b=this.parsePseudoBin(t,c+4),c+=48;else{const I=T(t,c+4);f=this._findFirstData(f,I);const x=t.readInt32LE(c+12);c+=16;const p=new Array(x);for(let h=0;h2**50&&(t=2**34),t-=1;let n=0,i=0,r=this.minShift+this.depth*3;const s=[];for(;n<=this.depth;r-=3,i+=oe(1,n*3),n+=1){const o=i+O(e,r),f=i+O(t,r);if(f-o+s.length>this.maxBinNumber)throw new Error(`query ${e}-${t} is too large for current binning scheme (shift ${this.minShift}, depth ${this.depth}), try a smaller query or a coarser index binning scheme`);s.push([o,f])}return s}}const R=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function se(a){return new Promise(e=>setTimeout(e,a))}class he{constructor({path:e,filehandle:t,tbiPath:n,tbiFilehandle:i,csiPath:r,csiFilehandle:s,yieldTime:o=500,chunkSizeLimit:f=5e7,renameRefSeqs:c=l=>l,chunkCacheSize:m=5*2**20}){if(t)this.filehandle=t;else if(e)this.filehandle=new P(e);else throw new TypeError("must provide either filehandle or path");if(i)this.index=new z({filehandle:i,renameRefSeqs:c});else if(s)this.index=new U({filehandle:s,renameRefSeqs:c});else if(n)this.index=new z({filehandle:new P(n),renameRefSeqs:c});else if(r)this.index=new U({filehandle:new P(r),renameRefSeqs:c});else if(e)this.index=new z({filehandle:new P(`${e}.tbi`),renameRefSeqs:c});else throw new TypeError("must provide one of tbiFilehandle, tbiPath, csiFilehandle, or csiPath");this.chunkSizeLimit=f,this.renameRefSeq=c,this.yieldTime=o,this.chunkCache=new Y({cache:new J({maxSize:Math.floor(m/65536)}),fill:(l,d)=>this.readChunk(l,{signal:d})})}async getLines(e,t,n,i){var r;let s,o={},f;if(i===void 0)throw new TypeError("line callback must be provided");if(typeof i=="function"?f=i:(o=i,f=i.lineCallback,s=i.signal),e===void 0)throw new TypeError("must provide a reference sequence name");if(!f)throw new TypeError("line callback must be provided");const c=await this.index.getMetadata(o);L(s);const m=t??0,l=n??c.maxRefLength;if(!(m<=l))throw new TypeError("invalid start and end coordinates. start must be less than or equal to end");if(m===l)return;const d=await this.index.blocksForRange(e,m,l,o);L(s);for(const w of d){const u=w.fetchedSize();if(u>this.chunkSizeLimit)throw new Error(`Too much data. Chunk size ${u.toLocaleString()} bytes exceeds chunkSizeLimit of ${this.chunkSizeLimit.toLocaleString()}.`)}let b=Date.now();for(const w of d){let u;const{buffer:I,cpositions:x,dpositions:p}=await this.chunkCache.get(w.toString(),w,s);L(s);let h=0,g=0;for(;h=p[g++];);g--}const{startCoordinate:E,overlaps:y}=this.checkLine(c,e,m,l,S);if(u!==void 0&&E!==void 0&&u>E)throw new Error(`Lines not sorted by start coordinate (${u} > ${E}), this file is not usable with Tabix.`);if(u=E,y)f(S.trim(),x[g]*256+(h-p[g])+w.minv.dataPosition+1);else if(E!==void 0&&E>=l)return;this.yieldTime&&b-Date.now()>this.yieldTime&&(b=Date.now(),L(s),await se(1)),h=C+1}}}async getMetadata(e={}){return this.index.getMetadata(e)}async getHeaderBuffer(e={}){const{firstDataLine:t,metaChar:n,maxBlockSize:i}=await this.getMetadata(e);L(e.signal);const r=((t==null?void 0:t.blockPosition)||0)+i,s=await this._readRegion(0,r,e),o=await F(s);if(n){let f=-1;const c=10,m=n.charCodeAt(0);for(let l=0;l=i)return{startCoordinate:x,overlaps:!1};if((d===0||d===l)&&x+1<=n)return{startCoordinate:x,overlaps:!1}}else if(c==="VCF"&&w===4)I=r.slice(u,p);else if(w===d&&(c==="VCF"?this._getVcfEnd(x,I,r.slice(u,p)):parseInt(r.slice(u,p),10))<=n)return{overlaps:!1};if(u=p+1,w+=1,w>b)break}return{startCoordinate:x,overlaps:!0}}_getVcfEnd(e,t,n){let i=e+t.length;const r=n.includes("SVTYPE=TRA");if(n[0]!=="."&&!r){let s=";";for(let o=0;o0){for(S=1,v=1;S0){for(S=1,v=1;SA&&(A=r,Z=[]),Z.push(e))}function $t(e,o,i){return new B(B.buildMessage(e,o),e,o,i)}function Ne(){var e,o,i,n,a,d,b,E,R,x,T,q,z,N;return e=r,o=u(),o!==t?(i=Fe(),i!==t?(n=u(),n!==t?(a=De(),a!==t?(d=u(),d!==t?(b=L(),b!==t?(E=u(),E!==t?(s.charCodeAt(r)===40?(R=w,r++):(R=t,c===0&&l(p)),R!==t?(x=u(),x!==t?(T=yt(),T!==t?(q=u(),q!==t?(s.charCodeAt(r)===41?(z=k,r++):(z=t,c===0&&l(D)),z!==t?(N=u(),N!==t?($=e,o=f(i,a,b,T),e=o):(r=e,e=t)):(r=e,e=t)):(r=e,e=t)):(r=e,e=t)):(r=e,e=t)):(r=e,e=t)):(r=e,e=t)):(r=e,e=t)):(r=e,e=t)):(r=e,e=t)):(r=e,e=t)):(r=e,e=t)):(r=e,e=t),e}function Fe(){var e;return s.substr(r,6)===m?(e=m,r+=6):(e=t,c===0&&l(S)),e===t&&(s.substr(r,6)===v?(e=v,r+=6):(e=t,c===0&&l(O)),e===t&&(s.substr(r,5)===I?(e=I,r+=5):(e=t,c===0&&l(Be)))),e}function De(){var e,o,i,n;return e=C(),e===t&&(e=r,o=C(),o!==t?(i=Re(),i!==t?(o=[o,i],e=o):(r=e,e=t)):(r=e,e=t),e===t&&(e=r,o=C(),o!==t?(s.substr(r,4)===G?(i=G,r+=4):(i=t,c===0&&l(H)),i!==t?(o=[o,i],e=o):(r=e,e=t)):(r=e,e=t),e===t&&(e=r,o=C(),o!==t?(i=Re(),i!==t?(s.substr(r,4)===G?(n=G,r+=4):(n=t,c===0&&l(H)),n!==t?(o=[o,i,n],e=o):(r=e,e=t)):(r=e,e=t)):(r=e,e=t)))),e}function Re(){var e;return s.substr(r,7)===J?(e=J,r+=7):(e=t,c===0&&l(Ie)),e===t&&(s.substr(r,5)===K?(e=K,r+=5):(e=t,c===0&&l(Pe)),e===t&&(s.substr(r,6)===ee?(e=ee,r+=6):(e=t,c===0&&l(Ge)))),e}function L(){var e;return e=Te(),e===t&&(e=u()),e}function yt(){var e,o,i,n,a,d,b;if(e=r,o=Q(),o!==t)if(i=u(),i!==t){for(n=[],a=r,d=u(),d!==t?(b=Q(),b!==t?($=a,d=_(o,b),a=d):(r=a,a=t)):(r=a,a=t);a!==t;)n.push(a),a=r,d=u(),d!==t?(b=Q(),b!==t?($=a,d=_(o,b),a=d):(r=a,a=t)):(r=a,a=t);n!==t?(a=u(),a!==t?($=e,o=_e(o,n),e=o):(r=e,e=t)):(r=e,e=t)}else r=e,e=t;else r=e,e=t;return e}function Et(){var e;return s.charCodeAt(r)===35?(e=Me,r++):(e=t,c===0&&l(je)),e}function kt(){var e,o,i,n,a;return e=r,o=u(),o!==t?(i=Et(),i!==t?(n=Te(),n!==t?(a=u(),a!==t?(o=[o,i,n,a],e=o):(r=e,e=t)):(r=e,e=t)):(r=e,e=t)):(r=e,e=t),e}function Q(){var e,o,i,n,a,d,b,E,R,x,T,q,z,N;return e=r,o=W(),o!==t?(i=u(),i!==t?(n=C(),n!==t?(a=u(),a!==t?(s.charCodeAt(r)===59?(d=U,r++):(d=t,c===0&&l(V)),d!==t?(b=u(),b!==t?(E=L(),E!==t?($=e,o=Le(o,n,E),e=o):(r=e,e=t)):(r=e,e=t)):(r=e,e=t)):(r=e,e=t)):(r=e,e=t)):(r=e,e=t)):(r=e,e=t),e===t&&(e=r,o=W(),o!==t?(i=u(),i!==t?(s.charCodeAt(r)===91?(n=Oe,r++):(n=t,c===0&&l(Ue)),n!==t?(a=u(),a!==t?(d=wt(),d!==t?(b=u(),b!==t?(s.charCodeAt(r)===93?(E=Ve,r++):(E=t,c===0&&l(Ze)),E!==t?(R=u(),R!==t?(x=C(),x!==t?(T=u(),T!==t?(s.charCodeAt(r)===59?(q=U,r++):(q=t,c===0&&l(V)),q!==t?(z=u(),z!==t?(N=L(),N!==t?($=e,o=Qe(o,d,x,N),e=o):(r=e,e=t)):(r=e,e=t)):(r=e,e=t)):(r=e,e=t)):(r=e,e=t)):(r=e,e=t)):(r=e,e=t)):(r=e,e=t)):(r=e,e=t)):(r=e,e=t)):(r=e,e=t)):(r=e,e=t)):(r=e,e=t),e===t&&(e=r,o=W(),o!==t?(i=u(),i!==t?(s.charCodeAt(r)===40?(n=w,r++):(n=t,c===0&&l(p)),n!==t?(a=u(),a!==t?(d=Ct(),d!==t?(b=u(),b!==t?(s.charCodeAt(r)===41?(E=k,r++):(E=t,c===0&&l(D)),E!==t?(R=u(),R!==t?(x=C(),x!==t?(T=u(),T!==t?(s.charCodeAt(r)===59?(q=U,r++):(q=t,c===0&&l(V)),q!==t?(z=u(),z!==t?(N=L(),N!==t?($=e,o=We(o,d,x,N),e=o):(r=e,e=t)):(r=e,e=t)):(r=e,e=t)):(r=e,e=t)):(r=e,e=t)):(r=e,e=t)):(r=e,e=t)):(r=e,e=t)):(r=e,e=t)):(r=e,e=t)):(r=e,e=t)):(r=e,e=t)):(r=e,e=t),e===t&&(e=kt()))),e}function Ct(){var e,o,i,n,a,d,b;if(e=r,o=C(),o!==t){for(i=[],n=r,s.charCodeAt(r)===44?(a=te,r++):(a=t,c===0&&l(re)),a!==t?(d=u(),d!==t?(b=C(),b!==t?($=n,a=_(o,b),n=a):(r=n,n=t)):(r=n,n=t)):(r=n,n=t);n!==t;)i.push(n),n=r,s.charCodeAt(r)===44?(a=te,r++):(a=t,c===0&&l(re)),a!==t?(d=u(),d!==t?(b=C(),b!==t?($=n,a=_(o,b),n=a):(r=n,n=t)):(r=n,n=t)):(r=n,n=t);i!==t?($=e,o=Xe(o,i),e=o):(r=e,e=t)}else r=e,e=t;return e}function W(){var e,o,i,n;return s.substr(r,3)===oe?(e=oe,r+=3):(e=t,c===0&&l(Ye)),e===t&&(s.substr(r,4)===ie?(e=ie,r+=4):(e=t,c===0&&l(He)),e===t&&(s.substr(r,5)===se?(e=se,r+=5):(e=t,c===0&&l(Je)),e===t&&(s.substr(r,6)===ne?(e=ne,r+=6):(e=t,c===0&&l(Ke)),e===t&&(s.substr(r,4)===ae?(e=ae,r+=4):(e=t,c===0&&l(et)),e===t&&(s.substr(r,5)===ce?(e=ce,r+=5):(e=t,c===0&&l(tt)),e===t&&(s.substr(r,5)===fe?(e=fe,r+=5):(e=t,c===0&&l(rt)),e===t&&(s.substr(r,4)===le?(e=le,r+=4):(e=t,c===0&&l(ot)),e===t&&(s.substr(r,6)===ue?(e=ue,r+=6):(e=t,c===0&&l(it)),e===t&&(s.substr(r,7)===he?(e=he,r+=7):(e=t,c===0&&l(st)),e===t&&(s.substr(r,4)===me?(e=me,r+=4):(e=t,c===0&&l(nt)),e===t&&(s.substr(r,6)===ge?(e=ge,r+=6):(e=t,c===0&&l(at)),e===t&&(s.substr(r,6)===pe?(e=pe,r+=6):(e=t,c===0&&l(ct)),e===t&&(s.substr(r,3)===de?(e=de,r+=3):(e=t,c===0&&l(ft)),e===t&&(e=r,o=Fe(),o!==t?(i=u(),i!==t?(n=De(),n!==t?($=e,o=lt(o,n),e=o):(r=e,e=t)):(r=e,e=t)):(r=e,e=t))))))))))))))),e}function wt(){var e;return e=At(),e===t&&(e=C()),e}function C(){var e,o,i,n,a;if(e=r,o=r,ut.test(s.charAt(r))?(i=s.charAt(r),r++):(i=t,c===0&&l(ht)),i!==t){for(n=[],be.test(s.charAt(r))?(a=s.charAt(r),r++):(a=t,c===0&&l(Se));a!==t;)n.push(a),be.test(s.charAt(r))?(a=s.charAt(r),r++):(a=t,c===0&&l(Se));n!==t?(i=[i,n],o=i):(r=o,o=t)}else r=o,o=t;return o!==t&&($=e,o=mt()),e=o,e}function Te(){var e,o,i;for(e=r,o=[],$e.test(s.charAt(r))?(i=s.charAt(r),r++):(i=t,c===0&&l(ye));i!==t;)o.push(i),$e.test(s.charAt(r))?(i=s.charAt(r),r++):(i=t,c===0&&l(ye));return o!==t&&($=e,o=gt(o)),e=o,e}function At(){var e,o,i,n;if(c++,e=r,o=u(),o!==t){if(i=[],Ee.test(s.charAt(r))?(n=s.charAt(r),r++):(n=t,c===0&&l(ke)),n!==t)for(;n!==t;)i.push(n),Ee.test(s.charAt(r))?(n=s.charAt(r),r++):(n=t,c===0&&l(ke));else i=t;i!==t?($=e,o=dt(),e=o):(r=e,e=t)}else r=e,e=t;return c--,e===t&&(o=t,c===0&&l(pt)),e}function u(){var e,o;for(c++,e=[],Ce.test(s.charAt(r))?(o=s.charAt(r),r++):(o=t,c===0&&l(we));o!==t;)e.push(o),Ce.test(s.charAt(r))?(o=s.charAt(r),r++):(o=t,c===0&&l(we));return c--,e===t&&(o=t,c===0&&l(bt)),e}if(j=F(),j!==t&&r===s.length)return j;throw j!==t&&rNumber.MAX_SAFE_INTEGER)throw new TypeError("integer overflow");e=w.Buffer.allocUnsafe(n),await this.filehandle.read(e,0,n,8);for(let r=0;r{const p=h[m],x=u?u[m]:1/0;return p<=t&&x>t?0:p0?f=a-1:d<0&&(l=a+1),a=Math.ceil((f-l)/2)+l,d=i(n[a],n[a+1]);r.push(n[a]);let c=a+1;for(;c=s));c+=1);return r[r.length-1][m]=n?0:n-c,u=Math.min(n+s,c+d.length)-c;h>=0&&h/\S/.test(i)).map(i=>i.split(" ")).filter(i=>i[0]!=="").map(i=>((!n||n.name!==i[0])&&(n={name:i[0],id:s},s+=1),{id:n.id,name:i[0],length:+i[1],start:0,end:+i[1],offset:+i[2],lineLength:+i[3],lineBytes:+i[4]}));return{name:Object.fromEntries(r.map(i=>[i.name,i])),id:Object.fromEntries(r.map(i=>[i.id,i]))}}class B{constructor({fasta:e,fai:t,path:s,faiPath:n}){if(e)this.fasta=e;else if(s)this.fasta=new g(s);else throw new Error("Need to pass filehandle for fasta or path to localfile");if(t)this.fai=t;else if(n)this.fai=new g(n);else if(s)this.fai=new g(`${s}.fai`);else throw new Error("Need to pass filehandle for or path to localfile")}async _getIndexes(e){return this.indexes||(this.indexes=S(this.fai,e)),this.indexes}async getSequenceNames(e){return Object.keys((await this._getIndexes(e)).name)}async getSequenceSizes(e){const t={},s=await this._getIndexes(e),n=Object.values(s.id);for(let r=0;re.length)&&(r=e.length),t>=r)return"";const i=b(e,t),l=b(e,r)-i,f=Buffer.allocUnsafe(l);return await this.fasta.read(f,0,l,i,n),f.toString("utf8").replace(/\s+/g,"")}}class k extends B{constructor({fasta:e,path:t,fai:s,faiPath:n,gzi:r,gziPath:i}){super({fasta:e,path:t,fai:s,faiPath:n}),e&&r?this.fasta=new y({filehandle:e,gziFilehandle:r}):t&&i&&(this.fasta=new y({path:t,gziPath:i}))}}function F(o){return o.split(">").filter(e=>/\S/.test(e)).map(e=>{const[t,...s]=e.split(` -`),[n,...r]=t.split(" "),i=s.join("").replace(/\s/g,"");return{id:n,description:r.join(" "),sequence:i}})}class v{constructor({fasta:e,path:t}){if(e)this.fasta=e;else if(t)this.fasta=new g(t);else throw new Error("Need to pass fasta or path");this.data=this.fasta.readFile().then(s=>{const n=s.toString("utf8");return F(n)})}async fetch(e,t,s){const r=(await this.data).find(l=>l.id===e),i=s-t;if(!r)throw new Error(`no sequence with id ${e} exists`);return r.sequence.substr(t,i)}async getSequenceNames(){return(await this.data).map(t=>t.id)}}export{k as BgzipIndexedFasta,v as FetchableSmallFasta,B as IndexedFasta,F as parseSmallFasta}; diff --git a/playground/assets/index-ClLbYkVu.js b/playground/assets/index-ClLbYkVu.js new file mode 100644 index 0000000..c0b2b4b --- /dev/null +++ b/playground/assets/index-ClLbYkVu.js @@ -0,0 +1,2 @@ +import{L as g}from"./__vite-browser-external-D80GqXp3.js";import{b as m}from"./index-CJAFAeH3.js";import{L as _,u as b}from"./long-eu6Hf4GH.js";import"./_commonjsHelpers-C932wzq6.js";const w=1;class I{constructor({filehandle:e,path:t}){if(e)this.filehandle=e;else if(t)this.filehandle=new g(t);else throw new TypeError("either filehandle or path must be defined")}_readLongWithOverflow(e,t=0,s=!0){const n=_.fromBytesLE(e.slice(t,t+8),s);if(n.greaterThan(Number.MAX_SAFE_INTEGER)||n.lessThan(Number.MIN_SAFE_INTEGER))throw new TypeError("integer overflow");return n.toNumber()}_getIndex(){return this.index||(this.index=this._readIndex()),this.index}async _readIndex(){let e=m.Buffer.allocUnsafe(8);await this.filehandle.read(e,0,8,0);const t=this._readLongWithOverflow(e,0,!0);if(!t)return[[0,0]];const s=new Array(t+1);s[0]=[0,0];const n=8*2*t;if(n>Number.MAX_SAFE_INTEGER)throw new TypeError("integer overflow");e=m.Buffer.allocUnsafe(n),await this.filehandle.read(e,0,n,8);for(let r=0;r{const p=h[w],E=u?u[w]:1/0;return p<=t&&E>t?0:p0?f=a-1:d<0&&(l=a+1),a=Math.ceil((f-l)/2)+l,d=i(n[a],n[a+1]);r.push(n[a]);let c=a+1;for(;c=s));c+=1);return r[r.length-1][w]=n?0:n-c,u=Math.min(n+s,c+d.length)-c;h>=0&&h/\S/.test(i)).map(i=>i.split(" ")).filter(i=>i[0]!=="").map(i=>((!n||n.name!==i[0])&&(n={name:i[0],id:s},s+=1),{id:n.id,name:i[0],length:+i[1],start:0,end:+i[1],offset:+i[2],lineLength:+i[3],lineBytes:+i[4]}));return{name:Object.fromEntries(r.map(i=>[i.name,i])),id:Object.fromEntries(r.map(i=>[i.id,i]))}}class B{constructor({fasta:e,fai:t,path:s,faiPath:n}){if(e)this.fasta=e;else if(s)this.fasta=new g(s);else throw new Error("Need to pass filehandle for fasta or path to localfile");if(t)this.fai=t;else if(n)this.fai=new g(n);else if(s)this.fai=new g(`${s}.fai`);else throw new Error("Need to pass filehandle for or path to localfile")}async _getIndexes(e){return this.indexes||(this.indexes=S(this.fai,e)),this.indexes}async getSequenceNames(e){return Object.keys((await this._getIndexes(e)).name)}async getSequenceSizes(e){const t={},s=await this._getIndexes(e);for(const n of Object.values(s.id))t[n.name]=n.length;return t}async getSequenceSize(e,t){var s;return(s=(await this._getIndexes(t)).name[e])===null||s===void 0?void 0:s.length}async hasReferenceSequence(e,t){return!!(await this._getIndexes(t)).name[e]}async getResiduesById(e,t,s,n){const r=(await this._getIndexes(n)).id[e];if(r)return this._fetchFromIndexEntry(r,t,s,n)}async getResiduesByName(e,t,s,n){const r=(await this._getIndexes(n)).name[e];if(r)return this._fetchFromIndexEntry(r,t,s,n)}async getSequence(e,t,s,n){return this.getResiduesByName(e,t,s,n)}async _fetchFromIndexEntry(e,t=0,s,n){let r=s;if(t<0)throw new TypeError("regionStart cannot be less than 0");if((r===void 0||r>e.length)&&(r=e.length),t>=r)return"";const i=x(e,t),l=x(e,r)-i,f=m.Buffer.allocUnsafe(l);return await this.fasta.read(f,0,l,i,n),f.toString("utf8").replace(/\s+/g,"")}}class O extends B{constructor({fasta:e,path:t,fai:s,faiPath:n,gzi:r,gziPath:i}){super({fasta:e,path:t,fai:s,faiPath:n}),e&&r?this.fasta=new y({filehandle:e,gziFilehandle:r}):t&&i&&(this.fasta=new y({path:t,gziPath:i}))}}function F(o){return o.split(">").filter(e=>/\S/.test(e)).map(e=>{const[t,...s]=e.split(` +`),[n,...r]=t.split(" "),i=s.join("").replace(/\s/g,"");return{id:n,description:r.join(" "),sequence:i}})}class k{constructor({fasta:e,path:t}){if(e)this.fasta=e;else if(t)this.fasta=new g(t);else throw new Error("Need to pass fasta or path");this.data=this.fasta.readFile().then(s=>{const n=s.toString("utf8");return F(n)})}async fetch(e,t,s){const r=(await this.data).find(l=>l.id===e),i=s-t;if(!r)throw new Error(`no sequence with id ${e} exists`);return r.sequence.slice(t,i)}async getSequenceNames(){return(await this.data).map(t=>t.id)}}export{O as BgzipIndexedFasta,k as FetchableSmallFasta,B as IndexedFasta,F as parseSmallFasta}; diff --git a/playground/assets/index-D15XeWB2.js b/playground/assets/index-D15XeWB2.js new file mode 100644 index 0000000..6e925ca --- /dev/null +++ b/playground/assets/index-D15XeWB2.js @@ -0,0 +1 @@ +import{g as l}from"./_commonjsHelpers-C932wzq6.js";class d{}class f{constructor(){this.signals=new Set,this.abortController=new AbortController}addSignal(t=new d){if(this.signal.aborted)throw new Error("cannot add a signal, already aborted!");this.signals.add(t),t.aborted?this.handleAborted(t):typeof t.addEventListener=="function"&&t.addEventListener("abort",()=>{this.handleAborted(t)})}handleAborted(t){this.signals.delete(t),this.signals.size===0&&this.abortController.abort()}get signal(){return this.abortController.signal}abort(){this.abortController.abort()}}class u{constructor(){this.callbacks=new Set}addCallback(t=()=>{}){this.callbacks.add(t),t(this.currentMessage)}callback(t){this.currentMessage=t;for(const e of this.callbacks)e(t)}}class n{constructor({fill:t,cache:e}){if(typeof t!="function")throw new TypeError("must pass a fill function");if(typeof e!="object")throw new TypeError("must pass a cache object");if(typeof e.get!="function"||typeof e.set!="function"||typeof e.delete!="function")throw new TypeError("cache must implement get(key), set(key, val), and and delete(key)");this.cache=e,this.fillCallback=t}static isAbortException(t){return t.name==="AbortError"||t.code==="ERR_ABORTED"||t.message==="AbortError: aborted"||t.message==="Error: aborted"}evict(t,e){this.cache.get(t)===e&&this.cache.delete(t)}fill(t,e,r,a){const s=new f,c=new u;c.addCallback(a);const i={aborter:s,promise:this.fillCallback(e,s.signal,o=>{c.callback(o)}),settled:!1,statusReporter:c,get aborted(){return this.aborter.signal.aborted}};i.aborter.addSignal(r),i.aborter.signal.addEventListener("abort",()=>{i.settled||this.evict(t,i)}),i.promise.then(()=>{i.settled=!0},()=>{i.settled=!0,this.evict(t,i)}).catch(o=>{throw console.error(o),o}),this.cache.set(t,i)}static checkSinglePromise(t,e){function r(){if(e!=null&&e.aborted)throw Object.assign(new Error("aborted"),{code:"ERR_ABORTED"})}return t.then(a=>(r(),a),a=>{throw r(),a})}has(t){return this.cache.has(t)}get(t,e,r,a){if(!r&&e instanceof AbortSignal)throw new TypeError("second get argument appears to be an AbortSignal, perhaps you meant to pass `null` for the fill data?");const s=this.cache.get(t);return s?s.aborted&&!s.settled?(this.evict(t,s),this.get(t,e,r,a)):s.settled?s.promise:(s.aborter.addSignal(r),s.statusReporter.addCallback(a),n.checkSinglePromise(s.promise,r)):(this.fill(t,e,r,a),n.checkSinglePromise(this.cache.get(t).promise,r))}delete(t){const e=this.cache.get(t);e&&(e.settled||e.aborter.abort(),this.cache.delete(t))}clear(){const t=this.cache.keys();let e=0;for(let r=t.next();!r.done;r=t.next())this.delete(r.value),e+=1;return e}}class b{constructor(t={}){if(!(t.maxSize&&t.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");this.maxSize=t.maxSize,this.cache=new Map,this.oldCache=new Map,this._size=0}_set(t,e){this.cache.set(t,e),this._size++,this._size>=this.maxSize&&(this._size=0,this.oldCache=this.cache,this.cache=new Map)}get(t){if(this.cache.has(t))return this.cache.get(t);if(this.oldCache.has(t)){const e=this.oldCache.get(t);return this.oldCache.delete(t),this._set(t,e),e}}set(t,e){return this.cache.has(t)?this.cache.set(t,e):this._set(t,e),this}has(t){return this.cache.has(t)||this.oldCache.has(t)}peek(t){if(this.cache.has(t))return this.cache.get(t);if(this.oldCache.has(t))return this.oldCache.get(t)}delete(t){const e=this.cache.delete(t);return e&&this._size--,this.oldCache.delete(t)||e}clear(){this.cache.clear(),this.oldCache.clear(),this._size=0}*keys(){for(const[t]of this)yield t}*values(){for(const[,t]of this)yield t}*[Symbol.iterator](){for(const t of this.cache)yield t;for(const t of this.oldCache){const[e]=t;this.cache.has(e)||(yield t)}}get size(){let t=0;for(const e of this.oldCache.keys())this.cache.has(e)||t++;return this._size+t}}var g=b;const p=l(g);export{n as A,p as L}; diff --git a/playground/assets/index-DuacAevT.js b/playground/assets/index-DuacAevT.js deleted file mode 100644 index d7d573e..0000000 --- a/playground/assets/index-DuacAevT.js +++ /dev/null @@ -1 +0,0 @@ -import{L as V,u as k,a as Q}from"./long-DmGCVeXr.js";import{b as I}from"./index-BHN4ZNUB.js";import{L as A}from"./__vite-browser-external-D80GqXp3.js";import{R}from"./remoteFile-Dv8-F_G9.js";import{_ as Y,L as W}from"./index-BzsNbVpR.js";import"./_commonjsHelpers-DM6icglO.js";class D{constructor(e,t){this.blockPosition=e,this.dataPosition=t}toString(){return`${this.blockPosition}:${this.dataPosition}`}compareTo(e){return this.blockPosition-e.blockPosition||this.dataPosition-e.dataPosition}static min(...e){let t,n=0;for(;!t;n+=1)t=e[n];for(;n0&&(t=e[n]);return t}}function x(o,e=0,t=!1){if(t)throw new Error("big-endian virtual file offsets not implemented");return new D(o[e+7]*1099511627776+o[e+6]*4294967296+o[e+5]*16777216+o[e+4]*65536+o[e+3]*256+o[e+2],o[e+1]<<8|o[e])}class ${constructor(e,t,n,r){this.minv=e,this.maxv=t,this.bin=n,this._fetchedSize=r}toUniqueString(){return`${this.minv.toString()}..${this.maxv.toString()} (bin ${this.bin}, fetchedSize ${this.fetchedSize()})`}toString(){return this.toUniqueString()}compareTo(e){return this.minv.compareTo(e.minv)||this.maxv.compareTo(e.maxv)||this.bin-e.bin}fetchedSize(){return this._fetchedSize!==void 0?this._fetchedSize:this.maxv.blockPosition+65536-this.minv.blockPosition}}function X(o){return new Promise(e=>setTimeout(e,o))}function J(o){if(o.greaterThan(Number.MAX_SAFE_INTEGER)||o.lessThan(Number.MIN_SAFE_INTEGER))throw new Error("integer overflow");return o.toNumber()}function K(o){if(o&&o.aborted)if(typeof DOMException>"u"){const e=new Error("aborted");throw e.code="ERR_ABORTED",e}else throw new DOMException("aborted","AbortError")}function Z(o,e){return e.minv.blockPosition-o.maxv.blockPosition<65e3&&e.maxv.blockPosition-o.minv.blockPosition<5e6}function ee(o={}){return"aborted"in o?{signal:o}:o}function U(o,e){const t=[];let n;if(o.length===0)return o;o.sort((r,s)=>{const a=r.minv.blockPosition-s.minv.blockPosition;return a===0?r.minv.dataPosition-s.minv.dataPosition:a});for(const r of o)(!e||r.maxv.compareTo(e)>0)&&(n===void 0?(t.push(r),n=r):Z(n,r)?r.maxv.compareTo(n.maxv)>0&&(n.maxv=r.maxv):(t.push(r),n=r));return t}function z(o,e){return{lineCount:J(V.fromBytesLE(Array.prototype.slice.call(o,e,e+8),!0))}}function L(o,e){return o?o.compareTo(e)>0?e:o:e}function te(o,e=t=>t){let t=0,n=0;const r=[],s={};for(let a=0;an}){this.filehandle=e,this.renameRefSeq=t}}const ne=21578050;function re(o,e){return o-o%e}function se(o,e){return o-o%e+e}function ie(o,e){return e-=1,[[0,0],[1+(o>>26),1+(e>>26)],[9+(o>>23),9+(e>>23)],[73+(o>>20),73+(e>>20)],[585+(o>>17),585+(e>>17)],[4681+(o>>14),4681+(e>>14)]]}class v extends O{async lineCount(e,t){var n,r;return((r=(n=(await this.parse(t)).indices[e])===null||n===void 0?void 0:n.stats)===null||r===void 0?void 0:r.lineCount)||0}async _parse(e){const t=await this.filehandle.readFile(e);if(t.readUInt32LE(0)!==ne)throw new Error("Not a BAI file");const n=t.readInt32LE(4),s=((1<<(5+1)*3)-1)/7;let a=8,h;const c=new Array(n);for(let i=0;is+1)throw new Error("bai index contains too many bins, please use CSI");{const p=t.readInt32LE(a);a+=4;const w=new Array(p);for(let E=0;E(i.length-1)*16384)throw new Error("query outside of range of linear index");let g=i[f/16384].blockPosition;for(let m=f/16384,p=0;m({...m,score:m.score*((l==null?void 0:l.lineCount)||0)/_}))}async blocksForRange(e,t,n,r={}){t<0&&(t=0);const s=await this.parse(r);if(!s)return[];const a=s.indices[e];if(!a)return[];const h=ie(t,n),c=[];for(const[d,_]of h)for(let g=d;g<=_;g++)if(a.binIndex[g]){const m=a.binIndex[g];for(const p of m)c.push(p)}const i=a.linearIndex.length;let l;const u=Math.min(t>>14,i-1),f=Math.min(n>>14,i-1);for(let d=u;d<=f;++d){const _=a.linearIndex[d];_&&(!l||_.compareTo(l)<0)&&(l=_)}return U(c,l)}async parse(e={}){return this.setupP||(this.setupP=this._parse(e).catch(t=>{throw this.setupP=void 0,t})),this.setupP}async hasRefSeq(e,t={}){var n;return!!(!((n=(await this.parse(t)).indices[e])===null||n===void 0)&&n.binIndex)}}function ae(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}const oe=new Int32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]);function H(o){if(Buffer.isBuffer(o))return o;if(typeof o=="number")return Buffer.alloc(o);if(typeof o=="string")return Buffer.from(o);throw new Error("input must be buffer, number, or string, received "+typeof o)}function ce(o){const e=H(4);return e.writeInt32BE(o,0),e}function T(o,e){o=H(o),Buffer.isBuffer(e)&&(e=e.readUInt32BE(0));let t=~~e^-1;for(var n=0;n>>8;return t^-1}function M(){return ce(T.apply(null,arguments))}M.signed=function(){return T.apply(null,arguments)};M.unsigned=function(){return T.apply(null,arguments)>>>0};var he=M;const de=ae(he),fe=21582659,le=38359875;function ue(o,e){return o*2**e}function B(o,e){return Math.floor(o/2**e)}class P extends O{constructor(){super(...arguments),this.maxBinNumber=0,this.depth=0,this.minShift=0}async lineCount(e,t){var n,r;return((r=(n=(await this.parse(t)).indices[e])===null||n===void 0?void 0:n.stats)===null||r===void 0?void 0:r.lineCount)||0}async indexCov(){return[]}parseAuxData(e,t){const n=e.readInt32LE(t),r=n&65536?"zero-based-half-open":"1-based-closed",s={0:"generic",1:"SAM",2:"VCF"}[n&15];if(!s)throw new Error(`invalid Tabix preset format flags ${n}`);const a={ref:e.readInt32LE(t+4),start:e.readInt32LE(t+8),end:e.readInt32LE(t+12)},h=e.readInt32LE(t+16),c=h?String.fromCharCode(h):"",i=e.readInt32LE(t+20),l=e.readInt32LE(t+24);return{columnNumbers:a,coordinateType:r,metaValue:h,metaChar:c,skipLines:i,format:s,formatFlags:n,...te(e.subarray(t+28,t+28+l),this.renameRefSeq)}}async _parse(e){const t=await this.filehandle.readFile(e),n=await k(t);let r;if(n.readUInt32LE(0)===fe)r=1;else if(n.readUInt32LE(0)===le)r=2;else throw new Error("Not a CSI file");this.minShift=n.readInt32LE(4),this.depth=n.readInt32LE(8),this.maxBinNumber=((1<<(this.depth+1)*3)-1)/7;const s=n.readInt32LE(12),a=s>=30?this.parseAuxData(n,16):void 0,h=n.readInt32LE(16+s);let c=16+s+4,i;const l=new Array(h);for(let u=0;uthis.maxBinNumber)_=z(n,c+28),c+=44;else{i=L(i,x(n,c)),c+=8;const p=n.readInt32LE(c);c+=4;const w=new Array(p);for(let E=0;E2**50&&(t=2**34),t-=1;let n=0,r=0,s=this.minShift+this.depth*3;const a=[];for(;n<=this.depth;s-=3,r+=ue(1,n*3),n+=1){const h=r+B(e,s),c=r+B(t,s);if(c-h+a.length>this.maxBinNumber)throw new Error(`query ${e}-${t} is too large for current binning scheme (shift ${this.minShift}, depth ${this.depth}), try a smaller query or a coarser index binning scheme`);a.push([h,c])}return a}async parse(e={}){return this.setupP||(this.setupP=this._parse(e).catch(t=>{throw this.setupP=void 0,t})),this.setupP}async hasRefSeq(e,t={}){var n;return!!(!((n=(await this.parse(t)).indices[e])===null||n===void 0)&&n.binIndex)}}const b={BAM_FPAIRED:1,BAM_FPROPER_PAIR:2,BAM_FUNMAP:4,BAM_FMUNMAP:8,BAM_FREVERSE:16,BAM_FMREVERSE:32,BAM_FREAD1:64,BAM_FREAD2:128,BAM_FSECONDARY:256,BAM_FQCFAIL:512,BAM_FDUP:1024,BAM_FSUPPLEMENTARY:2048},F="=ACMGRSVTWYHKDBN".split(""),C="MIDNSHP=X???????".split("");class me{constructor(e){this.data={},this._tagList=[],this._allTagsParsed=!1;const{bytes:t,fileOffset:n}=e,{byteArray:r,start:s}=t;this.data={},this.bytes=t,this._id=n,this._refID=r.readInt32LE(s+4),this.data.start=r.readInt32LE(s+8),this.flags=(r.readInt32LE(s+16)&4294901760)>>16}get(e){return this[e]?this.data[e]?this.data[e]:(this.data[e]=this[e](),this.data[e]):this._get(e.toLowerCase())}end(){return this.get("start")+this.get("length_on_ref")}seq_id(){return this._refID}_get(e){return e in this.data?this.data[e]:(this.data[e]=this._parseTag(e),this.data[e])}_tags(){this._parseAllTags();let e=["seq"];this.isSegmentUnmapped()||e.push("start","end","strand","score","qual","MQ","CIGAR","length_on_ref","template_length"),this.isPaired()&&e.push("next_segment_position","pair_orientation"),e=e.concat(this._tagList||[]);for(const n of Object.keys(this.data))!n.startsWith("_")&&n!=="next_seq_id"&&e.push(n);const t={};return e.filter(n=>{if(n in this.data&&this.data[n]===void 0||n==="CG"||n==="cg")return!1;const r=n.toLowerCase(),s=t[r];return t[r]=!0,!s})}parent(){}children(){return this.get("subfeatures")}id(){return this._id}mq(){const e=(this.get("_bin_mq_nl")&65280)>>8;return e===255?void 0:e}score(){return this.get("mq")}qual(){var e;return(e=this.qualRaw())===null||e===void 0?void 0:e.join(" ")}qualRaw(){if(this.isSegmentUnmapped())return;const{start:e,byteArray:t}=this.bytes,n=e+36+this.get("_l_read_name")+this.get("_n_cigar_op")*4+this.get("_seq_bytes"),r=this.get("seq_length");return t.subarray(n,n+r)}strand(){return this.isReverseComplemented()?-1:1}multi_segment_next_segment_strand(){if(!this.isMateUnmapped())return this.isMateReverseComplemented()?-1:1}name(){return this.get("_read_name")}_read_name(){const e=this.get("_l_read_name"),{byteArray:t,start:n}=this.bytes;return t.toString("ascii",n+36,n+36+e-1)}_parseTag(e){if(this._allTagsParsed)return;const{byteArray:t,start:n}=this.bytes;let r=this._tagOffset||n+36+this.get("_l_read_name")+this.get("_n_cigar_op")*4+this.get("_seq_bytes")+this.get("seq_length");const s=this.bytes.end;let a;for(;r>4,m=C[_&15];i+=g+m,r+=4}else for(let d=0;d>4,m=C[_&15];i+=g+m,r+=4}else for(let d=0;d[t.match(/\D/)[0].toUpperCase(),Number.parseInt(t,10)])}isPaired(){return!!(this.flags&b.BAM_FPAIRED)}isProperlyPaired(){return!!(this.flags&b.BAM_FPROPER_PAIR)}isSegmentUnmapped(){return!!(this.flags&b.BAM_FUNMAP)}isMateUnmapped(){return!!(this.flags&b.BAM_FMUNMAP)}isReverseComplemented(){return!!(this.flags&b.BAM_FREVERSE)}isMateReverseComplemented(){return!!(this.flags&b.BAM_FMREVERSE)}isRead1(){return!!(this.flags&b.BAM_FREAD1)}isRead2(){return!!(this.flags&b.BAM_FREAD2)}isSecondary(){return!!(this.flags&b.BAM_FSECONDARY)}isFailedQc(){return!!(this.flags&b.BAM_FQCFAIL)}isDuplicate(){return!!(this.flags&b.BAM_FDUP)}isSupplementary(){return!!(this.flags&b.BAM_FSUPPLEMENTARY)}cigar(){if(this.isSegmentUnmapped())return;const{byteArray:e,start:t}=this.bytes,n=this.get("_n_cigar_op");let r=t+36+this.get("_l_read_name");const s=this.get("seq_length");let a="",h=0,c=e.readInt32LE(r),i=c>>4,l=C[c&15];if(l==="S"&&i===s)return r+=4,c=e.readInt32LE(r),i=c>>4,l=C[c&15],l!=="N"&&console.warn("CG tag with no N tag"),this.data.length_on_ref=i,this.get("CG");for(let u=0;u>4,l=C[c&15],a+=i+l,l!=="H"&&l!=="S"&&l!=="I"&&(h+=i),r+=4;return this.data.length_on_ref=h,a}length_on_ref(){return this.data.length_on_ref?this.data.length_on_ref:(this.get("cigar"),this.data.length_on_ref)}_n_cigar_op(){return this.get("_flag_nc")&65535}_l_read_name(){return this.get("_bin_mq_nl")&255}_seq_bytes(){return this.get("seq_length")+1>>1}getReadBases(){return this.seq()}seq(){const{byteArray:e,start:t}=this.bytes,n=t+36+this.get("_l_read_name")+this.get("_n_cigar_op")*4,r=this.get("_seq_bytes"),s=this.get("seq_length");let a="",h=0;for(let c=0;c>4],h++,h0?(s[0]=e,s[1]=n,s[2]=t,s[3]=r):(s[2]=e,s[3]=n,s[0]=t,s[1]=r),s.join("")}return""}_bin_mq_nl(){return this.bytes.byteArray.readInt32LE(this.bytes.start+12)}_flag_nc(){return this.bytes.byteArray.readInt32LE(this.bytes.start+16)}seq_length(){return this.bytes.byteArray.readInt32LE(this.bytes.start+20)}_next_refid(){return this.bytes.byteArray.readInt32LE(this.bytes.start+24)}_next_pos(){return this.bytes.byteArray.readInt32LE(this.bytes.start+28)}template_length(){return this.bytes.byteArray.readInt32LE(this.bytes.start+32)}toJSON(){const e={};for(const t of Object.keys(this))t.startsWith("_")||t==="bytes"||(e[t]=this[t]);return e}}function G(o){const e=o.split(/\r?\n/),t=[];for(const n of e){const[r,...s]=n.split(/\t/);r&&t.push({tag:r.slice(1),data:s.map(a=>{const h=a.indexOf(":"),c=a.slice(0,h),i=a.slice(h+1);return{tag:c,value:i}})})}return t}const j=21840194,q=65536;async function ge(o){let e=[];for await(const t of o)e=e.concat(t);return e}class _e{read(){throw new Error("never called")}stat(){throw new Error("never called")}readFile(){throw new Error("never called")}close(){throw new Error("never called")}}class pe{constructor({bamFilehandle:e,bamPath:t,bamUrl:n,baiPath:r,baiFilehandle:s,baiUrl:a,csiPath:h,csiFilehandle:c,csiUrl:i,htsget:l,yieldThreadTime:u=100,renameRefSeqs:f=d=>d}){if(this.htsget=!1,this.featureCache=new Y({cache:new W({maxSize:50}),fill:async(d,_)=>{const{chunk:g,opts:m}=d,{data:p,cpositions:w,dpositions:E}=await this._readChunk({chunk:g,opts:{...m,signal:_}});return this.readBamFeatures(p,w,E,g)}}),this.renameRefSeq=f,e)this.bam=e;else if(t)this.bam=new A(t);else if(n)this.bam=new R(n);else if(l)this.htsget=!0,this.bam=new _e;else throw new Error("unable to initialize bam");if(c)this.index=new P({filehandle:c});else if(h)this.index=new P({filehandle:new A(h)});else if(i)this.index=new P({filehandle:new R(i)});else if(s)this.index=new v({filehandle:s});else if(r)this.index=new v({filehandle:new A(r)});else if(a)this.index=new v({filehandle:new R(a)});else if(t)this.index=new v({filehandle:new A(`${t}.bai`)});else if(n)this.index=new v({filehandle:new R(`${n}.bai`)});else if(l)this.htsget=!0;else throw new Error("unable to infer index format");this.yieldThreadTime=u}async getHeaderPre(e){const t=ee(e);if(!this.index)return;const n=await this.index.parse(t),r=n.firstDataLine?n.firstDataLine.blockPosition+65535:void 0;let s;if(r){const l=r+q,u=await this.bam.read(I.Buffer.alloc(l),0,l,0,t);if(!u.bytesRead)throw new Error("Error reading header");s=u.buffer.subarray(0,Math.min(u.bytesRead,r))}else s=await this.bam.readFile(t);const a=await k(s);if(a.readInt32LE(0)!==j)throw new Error("Not a BAM file");const h=a.readInt32LE(4);this.header=a.toString("utf8",8,8+h);const{chrToIndex:c,indexToChr:i}=await this._readRefSeqs(h+8,65535,t);return this.chrToIndex=c,this.indexToChr=i,G(this.header)}getHeader(e){return this.headerP||(this.headerP=this.getHeaderPre(e).catch(t=>{throw this.headerP=void 0,t})),this.headerP}async getHeaderText(e={}){return await this.getHeader(e),this.header}async _readRefSeqs(e,t,n){if(e>t)return this._readRefSeqs(e,t*2,n);const r=t+q,{bytesRead:s,buffer:a}=await this.bam.read(I.Buffer.alloc(r),0,t,0,n);if(!s)throw new Error("Error reading refseqs from header");const h=await k(a.subarray(0,Math.min(s,t))),c=h.readInt32LE(e);let i=e+4;const l={},u=[];for(let f=0;fh.length)return console.warn(`BAM header is very big. Re-fetching ${t} bytes.`),this._readRefSeqs(e,t*2,n)}return{chrToIndex:l,indexToChr:u}}async getRecordsForRange(e,t,n,r){return ge(this.streamRecordsForRange(e,t,n,r))}async*streamRecordsForRange(e,t,n,r){var s;await this.getHeader(r);const a=(s=this.chrToIndex)===null||s===void 0?void 0:s[e];if(a===void 0||!this.index)yield[];else{const h=await this.index.blocksForRange(a,t-1,n,r);yield*this._fetchChunkFeatures(h,a,t,n,r)}}async*_fetchChunkFeatures(e,t,n,r,s={}){const{viewAsPairs:a}=s,h=[];let c=!1;for(const i of e){const l=await this.featureCache.get(i.toString(),{chunk:i,opts:s},s.signal),u=[];for(const f of l)if(f.seq_id()===t)if(f.get("start")>=r){c=!0;break}else f.get("end")>=n&&u.push(f);if(h.push(u),yield u,c)break}K(s.signal),a&&(yield this.fetchPairs(t,h,s))}async fetchPairs(e,t,n){const{pairAcrossChr:r,maxInsertSize:s=2e5}=n,a={},h={};t.map(f=>{const d={};for(const _ of f){const g=_.name(),m=_.id();d[g]||(d[g]=0),d[g]++,h[m]=1}for(const[_,g]of Object.entries(d))g===1&&(a[_]=!0)});const c=[];t.map(f=>{for(const d of f){const _=d.name(),g=d.get("start"),m=d._next_pos(),p=d._next_refid();this.index&&a[_]&&(r||p===e&&Math.abs(g-m){const{data:d,cpositions:_,dpositions:g,chunk:m}=await this._readChunk({chunk:f,opts:n}),p=[];for(const w of await this.readBamFeatures(d,_,g,m))a[w.get("name")]&&!h[w.id()]&&p.push(w);return p}))).flat()}async _readRegion(e,t,n={}){const{bytesRead:r,buffer:s}=await this.bam.read(I.Buffer.alloc(t),0,t,e,n);return s.subarray(0,Math.min(r,t))}async _readChunk({chunk:e,opts:t}){const n=await this._readRegion(e.minv.blockPosition,e.fetchedSize(),t),{buffer:r,cpositions:s,dpositions:a}=await Q(n,e);return{data:r,cpositions:s,dpositions:a,chunk:e}}async readBamFeatures(e,t,n,r){let s=0;const a=[];let h=0,c=+Date.now();for(;s+4=n[h++];);h--}if(l0?t[h]*256+(s-n[h])+r.minv.dataPosition+1:de.signed(e.slice(s,l))});a.push(u),this.yieldThreadTime&&+Date.now()-c>this.yieldThreadTime&&(await X(1),c=+Date.now())}s=l+1}return a}async hasRefSeq(e){var t,n;const r=(t=this.chrToIndex)===null||t===void 0?void 0:t[e];return r===void 0?!1:(n=this.index)===null||n===void 0?void 0:n.hasRefSeq(r)}async lineCount(e){var t;const n=(t=this.chrToIndex)===null||t===void 0?void 0:t[e];return n===void 0||!this.index?0:this.index.lineCount(n)}async indexCov(e,t,n){var r;if(!this.index)return[];await this.index.parse();const s=(r=this.chrToIndex)===null||r===void 0?void 0:r[e];return s===void 0?[]:this.index.indexCov(s,t,n)}async blocksForRange(e,t,n,r){var s;if(!this.index)return[];await this.index.parse();const a=(s=this.chrToIndex)===null||s===void 0?void 0:s[e];return a===void 0?[]:this.index.blocksForRange(a,t,n,r)}}async function N(o,e){const t=await Promise.all(o.map(async n=>{const{url:r,headers:s}=n;if(r.startsWith("data:"))return I.Buffer.from(r.split(",")[1],"base64");{const{referer:a,...h}=s,c=await fetch(r,{...e,headers:{...e==null?void 0:e.headers,...h}});if(!c.ok)throw new Error(`HTTP ${c.status} fetching ${r}: ${await c.text()}`);return I.Buffer.from(await c.arrayBuffer())}}));return I.Buffer.concat(await Promise.all(t.map(n=>k(n))))}class ve extends pe{constructor(e){super({htsget:!0}),this.baseUrl=e.baseUrl,this.trackId=e.trackId}async*streamRecordsForRange(e,t,n,r){var s;const h=`${`${this.baseUrl}/${this.trackId}`}?referenceName=${e}&start=${t}&end=${n}&format=BAM`,c=(s=this.chrToIndex)===null||s===void 0?void 0:s[e];if(c===void 0)yield[];else{const i=await fetch(h,{...r});if(!i.ok)throw new Error(`HTTP ${i.status} fetching ${h}: ${await i.text()}`);const l=await i.json(),u=await N(l.htsget.urls.slice(1),r);yield*this._fetchChunkFeatures([{buffer:u,_fetchedSize:void 0,bin:0,compareTo(){return 0},toUniqueString(){return`${e}_${t}_${n}`},fetchedSize(){return 0},minv:{dataPosition:0,blockPosition:0,compareTo:()=>0},maxv:{dataPosition:Number.MAX_SAFE_INTEGER,blockPosition:0,compareTo:()=>0},toString(){return`${e}_${t}_${n}`}}],c,t,n,r)}}async _readChunk({chunk:e}){if(!e.buffer)throw new Error("expected chunk.buffer in htsget");return{data:e.buffer,cpositions:[],dpositions:[],chunk:e}}async getHeader(e={}){const t=`${this.baseUrl}/${this.trackId}?referenceName=na&class=header`,n=await fetch(t,e);if(!n.ok)throw new Error(`HTTP ${n.status} fetching ${t}: ${await n.text()}`);const r=await n.json(),s=await N(r.htsget.urls,e);if(s.readInt32LE(0)!==j)throw new Error("Not a BAM file");const a=s.readInt32LE(4),h=s.toString("utf8",8,8+a),c=G(h),i=[],l={},u=c.filter(f=>f.tag==="SQ");for(const[f,d]of u.entries()){let _="",g=0;for(const m of d.data)m.tag==="SN"?_=m.value:m.tag==="LN"&&(g=+m.value);l[_]=f,i[f]={refName:_,length:g}}return this.chrToIndex=l,this.indexToChr=i,c}}export{v as BAI,pe as BamFile,me as BamRecord,P as CSI,ve as HtsgetFile}; diff --git a/playground/assets/index-N9VUB_9p.js b/playground/assets/index-N9VUB_9p.js new file mode 100644 index 0000000..013d80e --- /dev/null +++ b/playground/assets/index-N9VUB_9p.js @@ -0,0 +1 @@ +import{L as j,u as R,a as V}from"./long-eu6Hf4GH.js";import{b as I}from"./index-CJAFAeH3.js";import{L as C}from"./__vite-browser-external-D80GqXp3.js";import{R as k}from"./remoteFile-_ulnNXZo.js";import{A as Q,L as Y}from"./index-D15XeWB2.js";import"./_commonjsHelpers-C932wzq6.js";class D{constructor(e,t){this.blockPosition=e,this.dataPosition=t}toString(){return`${this.blockPosition}:${this.dataPosition}`}compareTo(e){return this.blockPosition-e.blockPosition||this.dataPosition-e.dataPosition}static min(...e){let t,n=0;for(;!t;n+=1)t=e[n];for(;n0&&(t=e[n]);return t}}function E(o,e=0,t=!1){if(t)throw new Error("big-endian virtual file offsets not implemented");return new D(o[e+7]*1099511627776+o[e+6]*4294967296+o[e+5]*16777216+o[e+4]*65536+o[e+3]*256+o[e+2],o[e+1]<<8|o[e])}class ${constructor(e,t,n,r){this.minv=e,this.maxv=t,this.bin=n,this._fetchedSize=r}toUniqueString(){return`${this.minv.toString()}..${this.maxv.toString()} (bin ${this.bin}, fetchedSize ${this.fetchedSize()})`}toString(){return this.toUniqueString()}compareTo(e){return this.minv.compareTo(e.minv)||this.maxv.compareTo(e.maxv)||this.bin-e.bin}fetchedSize(){return this._fetchedSize!==void 0?this._fetchedSize:this.maxv.blockPosition+65536-this.minv.blockPosition}}function W(o){return new Promise(e=>setTimeout(e,o))}function X(o){if(o.greaterThan(Number.MAX_SAFE_INTEGER)||o.lessThan(Number.MIN_SAFE_INTEGER))throw new Error("integer overflow");return o.toNumber()}function J(o){if(o&&o.aborted)if(typeof DOMException>"u"){const e=new Error("aborted");throw e.code="ERR_ABORTED",e}else throw new DOMException("aborted","AbortError")}function K(o,e){return e.minv.blockPosition-o.maxv.blockPosition<65e3&&e.maxv.blockPosition-o.minv.blockPosition<5e6}function Z(o={}){return"aborted"in o?{signal:o}:o}function U(o,e){const t=[];let n;if(o.length===0)return o;o.sort((r,s)=>{const i=r.minv.blockPosition-s.minv.blockPosition;return i===0?r.minv.dataPosition-s.minv.dataPosition:i});for(const r of o)(!e||r.maxv.compareTo(e)>0)&&(n===void 0?(t.push(r),n=r):K(n,r)?r.maxv.compareTo(n.maxv)>0&&(n.maxv=r.maxv):(t.push(r),n=r));return t}function z(o,e){return{lineCount:X(j.fromBytesLE(Array.prototype.slice.call(o,e,e+8),!0))}}function L(o,e){return o?o.compareTo(e)>0?e:o:e}function ee(o,e=t=>t){let t=0,n=0;const r=[],s={};for(let i=0;in}){this.filehandle=e,this.renameRefSeq=t}}const te=21578050;function ne(o,e){return o-o%e}function re(o,e){return o-o%e+e}function se(o,e){return e-=1,[[0,0],[1+(o>>26),1+(e>>26)],[9+(o>>23),9+(e>>23)],[73+(o>>20),73+(e>>20)],[585+(o>>17),585+(e>>17)],[4681+(o>>14),4681+(e>>14)]]}class v extends O{async lineCount(e,t){var n,r;return((r=(n=(await this.parse(t)).indices[e])===null||n===void 0?void 0:n.stats)===null||r===void 0?void 0:r.lineCount)||0}async _parse(e){const t=await this.filehandle.readFile(e);if(t.readUInt32LE(0)!==te)throw new Error("Not a BAI file");const n=t.readInt32LE(4),s=((1<<(5+1)*3)-1)/7;let i=8,c;const d=new Array(n);for(let a=0;as+1)throw new Error("bai index contains too many bins, please use CSI");{const g=t.readInt32LE(i);i+=4;const p=new Array(g);for(let w=0;w(a.length-1)*16384)throw new Error("query outside of range of linear index");let b=a[h/16384].blockPosition;for(let u=h/16384,g=0;u({...u,score:u.score*((l==null?void 0:l.lineCount)||0)/m}))}async blocksForRange(e,t,n,r={}){t<0&&(t=0);const s=await this.parse(r);if(!s)return[];const i=s.indices[e];if(!i)return[];const c=se(t,n),d=[];for(const[f,m]of c)for(let b=f;b<=m;b++)if(i.binIndex[b]){const u=i.binIndex[b];for(const g of u)d.push(g)}const a=i.linearIndex.length;let l;const x=Math.min(t>>14,a-1),h=Math.min(n>>14,a-1);for(let f=x;f<=h;++f){const m=i.linearIndex[f];m&&(!l||m.compareTo(l)<0)&&(l=m)}return U(d,l)}async parse(e={}){return this.setupP||(this.setupP=this._parse(e).catch(t=>{throw this.setupP=void 0,t})),this.setupP}async hasRefSeq(e,t={}){var n;return!!(!((n=(await this.parse(t)).indices[e])===null||n===void 0)&&n.binIndex)}}let T=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];typeof Int32Array<"u"&&(T=new Int32Array(T));const ae=(o,e)=>{let t=e===0?0:~~e^-1;for(let n=0;n>>8;return t^-1},M=(o,e)=>I.Buffer.from(o,e);function ie(o,e){const t=(n,r)=>e(M(n),r)>>>0;return t.signed=(n,r)=>e(M(n),r),t.unsigned=t,t.model=o,t}const oe=ie("crc-32",ae),de=21582659,ce=38359875;function fe(o,e){return o*2**e}function F(o,e){return Math.floor(o/2**e)}class P extends O{constructor(){super(...arguments),this.maxBinNumber=0,this.depth=0,this.minShift=0}async lineCount(e,t){var n,r;return((r=(n=(await this.parse(t)).indices[e])===null||n===void 0?void 0:n.stats)===null||r===void 0?void 0:r.lineCount)||0}async indexCov(){return[]}parseAuxData(e,t){const n=e.readInt32LE(t),r=n&65536?"zero-based-half-open":"1-based-closed",s={0:"generic",1:"SAM",2:"VCF"}[n&15];if(!s)throw new Error(`invalid Tabix preset format flags ${n}`);const i={ref:e.readInt32LE(t+4),start:e.readInt32LE(t+8),end:e.readInt32LE(t+12)},c=e.readInt32LE(t+16),d=c?String.fromCharCode(c):"",a=e.readInt32LE(t+20),l=e.readInt32LE(t+24);return{columnNumbers:i,coordinateType:r,metaValue:c,metaChar:d,skipLines:a,format:s,formatFlags:n,...ee(e.subarray(t+28,t+28+l),this.renameRefSeq)}}async _parse(e){const t=await this.filehandle.readFile(e),n=await R(t);let r;if(n.readUInt32LE(0)===de)r=1;else if(n.readUInt32LE(0)===ce)r=2;else throw new Error("Not a CSI file");this.minShift=n.readInt32LE(4),this.depth=n.readInt32LE(8),this.maxBinNumber=((1<<(this.depth+1)*3)-1)/7;const s=n.readInt32LE(12),i=s>=30?this.parseAuxData(n,16):void 0,c=n.readInt32LE(16+s);let d=16+s+4,a;const l=new Array(c);for(let x=0;xthis.maxBinNumber)m=z(n,d+28),d+=44;else{a=L(a,E(n,d)),d+=8;const g=n.readInt32LE(d);d+=4;const p=new Array(g);for(let w=0;w2**50&&(t=2**34),t-=1;let n=0,r=0,s=this.minShift+this.depth*3;const i=[];for(;n<=this.depth;s-=3,r+=fe(1,n*3),n+=1){const c=r+F(e,s),d=r+F(t,s);if(d-c+i.length>this.maxBinNumber)throw new Error(`query ${e}-${t} is too large for current binning scheme (shift ${this.minShift}, depth ${this.depth}), try a smaller query or a coarser index binning scheme`);i.push([c,d])}return i}async parse(e={}){return this.setupP||(this.setupP=this._parse(e).catch(t=>{throw this.setupP=void 0,t})),this.setupP}async hasRefSeq(e,t={}){var n;return!!(!((n=(await this.parse(t)).indices[e])===null||n===void 0)&&n.binIndex)}}const _={BAM_FPAIRED:1,BAM_FPROPER_PAIR:2,BAM_FUNMAP:4,BAM_FMUNMAP:8,BAM_FREVERSE:16,BAM_FMREVERSE:32,BAM_FREAD1:64,BAM_FREAD2:128,BAM_FSECONDARY:256,BAM_FQCFAIL:512,BAM_FDUP:1024,BAM_FSUPPLEMENTARY:2048},B="=ACMGRSVTWYHKDBN".split(""),A="MIDNSHP=X???????".split("");class he{constructor(e){this.data={},this._tagList=[],this._allTagsParsed=!1;const{bytes:t,fileOffset:n}=e,{byteArray:r,start:s}=t;this.data={start:r.readInt32LE(s+8)},this.bytes=t,this._id=n,this._refID=r.readInt32LE(s+4),this.flags=(r.readInt32LE(s+16)&4294901760)>>16}get(e){return this[e]?this.data[e]?this.data[e]:(this.data[e]=this[e](),this.data[e]):this._get(e.toLowerCase())}end(){return this.get("start")+this.get("length_on_ref")}seq_id(){return this._refID}_get(e){return e in this.data?this.data[e]:(this.data[e]=this._parseTag(e),this.data[e])}_tags(){this._parseAllTags();let e=["seq"];this.isSegmentUnmapped()||e.push("start","end","strand","score","qual","MQ","CIGAR","length_on_ref","template_length"),this.isPaired()&&e.push("next_segment_position","pair_orientation"),e=e.concat(this._tagList||[]);for(const n of Object.keys(this.data))!n.startsWith("_")&&n!=="next_seq_id"&&e.push(n);const t={};return e.filter(n=>{if(n in this.data&&this.data[n]===void 0||n==="CG"||n==="cg")return!1;const r=n.toLowerCase(),s=t[r];return t[r]=!0,!s})}parent(){}children(){return this.get("subfeatures")}id(){return this._id}mq(){const e=(this.get("_bin_mq_nl")&65280)>>8;return e===255?void 0:e}score(){return this.get("mq")}qual(){var e;return(e=this.qualRaw())===null||e===void 0?void 0:e.join(" ")}qualRaw(){if(this.isSegmentUnmapped())return;const{start:e,byteArray:t}=this.bytes,n=e+36+this.get("_l_read_name")+this.get("_n_cigar_op")*4+this.get("_seq_bytes"),r=this.get("seq_length");return t.subarray(n,n+r)}strand(){return this.isReverseComplemented()?-1:1}multi_segment_next_segment_strand(){if(!this.isMateUnmapped())return this.isMateReverseComplemented()?-1:1}name(){return this.get("_read_name")}_read_name(){const e=this.get("_l_read_name"),{byteArray:t,start:n}=this.bytes;return t.toString("ascii",n+36,n+36+e-1)}_parseTag(e){if(this._allTagsParsed)return;const{byteArray:t,start:n}=this.bytes;let r=this._tagOffset||n+36+this.get("_l_read_name")+this.get("_n_cigar_op")*4+this.get("_seq_bytes")+this.get("seq_length");const s=this.bytes.end;let i;for(;r>4,u=A[m&15];a+=b+u,r+=4}else for(let f=0;f>4,u=A[m&15];a+=b+u,r+=4}else for(let f=0;f[/\D/.exec(t)[0].toUpperCase(),Number.parseInt(t,10)])}isPaired(){return!!(this.flags&_.BAM_FPAIRED)}isProperlyPaired(){return!!(this.flags&_.BAM_FPROPER_PAIR)}isSegmentUnmapped(){return!!(this.flags&_.BAM_FUNMAP)}isMateUnmapped(){return!!(this.flags&_.BAM_FMUNMAP)}isReverseComplemented(){return!!(this.flags&_.BAM_FREVERSE)}isMateReverseComplemented(){return!!(this.flags&_.BAM_FMREVERSE)}isRead1(){return!!(this.flags&_.BAM_FREAD1)}isRead2(){return!!(this.flags&_.BAM_FREAD2)}isSecondary(){return!!(this.flags&_.BAM_FSECONDARY)}isFailedQc(){return!!(this.flags&_.BAM_FQCFAIL)}isDuplicate(){return!!(this.flags&_.BAM_FDUP)}isSupplementary(){return!!(this.flags&_.BAM_FSUPPLEMENTARY)}cigar(){if(this.isSegmentUnmapped())return;const{byteArray:e,start:t}=this.bytes,n=this.get("_n_cigar_op");let r=t+36+this.get("_l_read_name");const s=this.get("seq_length");let i="",c=0,d=e.readInt32LE(r),a=d>>4,l=A[d&15];if(l==="S"&&a===s)return r+=4,d=e.readInt32LE(r),a=d>>4,l=A[d&15],l!=="N"&&console.warn("CG tag with no N tag"),this.data.length_on_ref=a,this.get("CG");for(let x=0;x>4,l=A[d&15],i+=a+l,l!=="H"&&l!=="S"&&l!=="I"&&(c+=a),r+=4;return this.data.length_on_ref=c,i}length_on_ref(){return this.data.length_on_ref?this.data.length_on_ref:(this.get("cigar"),this.data.length_on_ref)}_n_cigar_op(){return this.get("_flag_nc")&65535}_l_read_name(){return this.get("_bin_mq_nl")&255}_seq_bytes(){return this.get("seq_length")+1>>1}getReadBases(){return this.seq()}seq(){const{byteArray:e,start:t}=this.bytes,n=t+36+this.get("_l_read_name")+this.get("_n_cigar_op")*4,r=this.get("_seq_bytes"),s=this.get("seq_length");let i="",c=0;for(let d=0;d>4],c++,c0?(s[0]=e,s[1]=n,s[2]=t,s[3]=r):(s[2]=e,s[3]=n,s[0]=t,s[1]=r),s.join("")}return""}_bin_mq_nl(){return this.bytes.byteArray.readInt32LE(this.bytes.start+12)}_flag_nc(){return this.bytes.byteArray.readInt32LE(this.bytes.start+16)}seq_length(){return this.bytes.byteArray.readInt32LE(this.bytes.start+20)}_next_refid(){return this.bytes.byteArray.readInt32LE(this.bytes.start+24)}_next_pos(){return this.bytes.byteArray.readInt32LE(this.bytes.start+28)}template_length(){return this.bytes.byteArray.readInt32LE(this.bytes.start+32)}toJSON(){const e={};for(const t of Object.keys(this))t.startsWith("_")||t==="bytes"||(e[t]=this[t]);return e}}function H(o){const e=o.split(/\r?\n/),t=[];for(const n of e){const[r,...s]=n.split(/\t/);r&&t.push({tag:r.slice(1),data:s.map(i=>{const c=i.indexOf(":"),d=i.slice(0,c),a=i.slice(c+1);return{tag:d,value:a}})})}return t}const G=21840194,q=65536;async function le(o){let e=[];for await(const t of o)e=e.concat(t);return e}class xe{read(){throw new Error("never called")}stat(){throw new Error("never called")}readFile(){throw new Error("never called")}close(){throw new Error("never called")}}class ue{constructor({bamFilehandle:e,bamPath:t,bamUrl:n,baiPath:r,baiFilehandle:s,baiUrl:i,csiPath:c,csiFilehandle:d,csiUrl:a,htsget:l,yieldThreadTime:x=100,renameRefSeqs:h=f=>f}){if(this.htsget=!1,this.featureCache=new Q({cache:new Y({maxSize:50}),fill:async(f,m)=>{const{chunk:b,opts:u}=f,{data:g,cpositions:p,dpositions:w}=await this._readChunk({chunk:b,opts:{...u,signal:m}});return this.readBamFeatures(g,p,w,b)}}),this.renameRefSeq=h,e)this.bam=e;else if(t)this.bam=new C(t);else if(n)this.bam=new k(n);else if(l)this.htsget=!0,this.bam=new xe;else throw new Error("unable to initialize bam");if(d)this.index=new P({filehandle:d});else if(c)this.index=new P({filehandle:new C(c)});else if(a)this.index=new P({filehandle:new k(a)});else if(s)this.index=new v({filehandle:s});else if(r)this.index=new v({filehandle:new C(r)});else if(i)this.index=new v({filehandle:new k(i)});else if(t)this.index=new v({filehandle:new C(`${t}.bai`)});else if(n)this.index=new v({filehandle:new k(`${n}.bai`)});else if(l)this.htsget=!0;else throw new Error("unable to infer index format");this.yieldThreadTime=x}async getHeaderPre(e){const t=Z(e);if(!this.index)return;const n=await this.index.parse(t),r=n.firstDataLine?n.firstDataLine.blockPosition+65535:void 0;let s;if(r){const l=r+q,x=await this.bam.read(I.Buffer.alloc(l),0,l,0,t);if(!x.bytesRead)throw new Error("Error reading header");s=x.buffer.subarray(0,Math.min(x.bytesRead,r))}else s=await this.bam.readFile(t);const i=await R(s);if(i.readInt32LE(0)!==G)throw new Error("Not a BAM file");const c=i.readInt32LE(4);this.header=i.toString("utf8",8,8+c);const{chrToIndex:d,indexToChr:a}=await this._readRefSeqs(c+8,65535,t);return this.chrToIndex=d,this.indexToChr=a,H(this.header)}getHeader(e){return this.headerP||(this.headerP=this.getHeaderPre(e).catch(t=>{throw this.headerP=void 0,t})),this.headerP}async getHeaderText(e={}){return await this.getHeader(e),this.header}async _readRefSeqs(e,t,n){if(e>t)return this._readRefSeqs(e,t*2,n);const r=t+q,{bytesRead:s,buffer:i}=await this.bam.read(I.Buffer.alloc(r),0,t,0,n);if(!s)throw new Error("Error reading refseqs from header");const c=await R(i.subarray(0,Math.min(s,t))),d=c.readInt32LE(e);let a=e+4;const l={},x=[];for(let h=0;hc.length)return console.warn(`BAM header is very big. Re-fetching ${t} bytes.`),this._readRefSeqs(e,t*2,n)}return{chrToIndex:l,indexToChr:x}}async getRecordsForRange(e,t,n,r){return le(this.streamRecordsForRange(e,t,n,r))}async*streamRecordsForRange(e,t,n,r){var s;await this.getHeader(r);const i=(s=this.chrToIndex)===null||s===void 0?void 0:s[e];if(i===void 0||!this.index)yield[];else{const c=await this.index.blocksForRange(i,t-1,n,r);yield*this._fetchChunkFeatures(c,i,t,n,r)}}async*_fetchChunkFeatures(e,t,n,r,s={}){const{viewAsPairs:i}=s,c=[];let d=!1;for(const a of e){const l=await this.featureCache.get(a.toString(),{chunk:a,opts:s},s.signal),x=[];for(const h of l)if(h.seq_id()===t)if(h.get("start")>=r){d=!0;break}else h.get("end")>=n&&x.push(h);if(c.push(x),yield x,d)break}J(s.signal),i&&(yield this.fetchPairs(t,c,s))}async fetchPairs(e,t,n){const{pairAcrossChr:r,maxInsertSize:s=2e5}=n,i={},c={};t.map(h=>{const f={};for(const m of h){const b=m.name(),u=m.id();f[b]||(f[b]=0),f[b]++,c[u]=1}for(const[m,b]of Object.entries(f))b===1&&(i[m]=!0)});const d=[];t.map(h=>{for(const f of h){const m=f.name(),b=f.get("start"),u=f._next_pos(),g=f._next_refid();this.index&&i[m]&&(r||g===e&&Math.abs(b-u){const{data:f,cpositions:m,dpositions:b,chunk:u}=await this._readChunk({chunk:h,opts:n}),g=[];for(const p of await this.readBamFeatures(f,m,b,u))i[p.get("name")]&&!c[p.id()]&&g.push(p);return g}))).flat()}async _readRegion(e,t,n={}){const{bytesRead:r,buffer:s}=await this.bam.read(I.Buffer.alloc(t),0,t,e,n);return s.subarray(0,Math.min(r,t))}async _readChunk({chunk:e,opts:t}){const n=await this._readRegion(e.minv.blockPosition,e.fetchedSize(),t),{buffer:r,cpositions:s,dpositions:i}=await V(n,e);return{data:r,cpositions:s,dpositions:i,chunk:e}}async readBamFeatures(e,t,n,r){let s=0;const i=[];let c=0,d=+Date.now();for(;s+4=n[c++];);c--}if(l0?t[c]*256+(s-n[c])+r.minv.dataPosition+1:oe.signed(e.slice(s,l))});i.push(x),this.yieldThreadTime&&+Date.now()-d>this.yieldThreadTime&&(await W(1),d=+Date.now())}s=l+1}return i}async hasRefSeq(e){var t,n;const r=(t=this.chrToIndex)===null||t===void 0?void 0:t[e];return r===void 0?!1:(n=this.index)===null||n===void 0?void 0:n.hasRefSeq(r)}async lineCount(e){var t;const n=(t=this.chrToIndex)===null||t===void 0?void 0:t[e];return n===void 0||!this.index?0:this.index.lineCount(n)}async indexCov(e,t,n){var r;if(!this.index)return[];await this.index.parse();const s=(r=this.chrToIndex)===null||r===void 0?void 0:r[e];return s===void 0?[]:this.index.indexCov(s,t,n)}async blocksForRange(e,t,n,r){var s;if(!this.index)return[];await this.index.parse();const i=(s=this.chrToIndex)===null||s===void 0?void 0:s[e];return i===void 0?[]:this.index.blocksForRange(i,t,n,r)}}async function N(o,e){const t=await Promise.all(o.map(async n=>{const{url:r,headers:s}=n;if(r.startsWith("data:"))return I.Buffer.from(r.split(",")[1],"base64");{const{referer:i,...c}=s,d=await fetch(r,{...e,headers:{...e==null?void 0:e.headers,...c}});if(!d.ok)throw new Error(`HTTP ${d.status} fetching ${r}: ${await d.text()}`);return I.Buffer.from(await d.arrayBuffer())}}));return I.Buffer.concat(await Promise.all(t.map(n=>R(n))))}class Ie extends ue{constructor(e){super({htsget:!0}),this.baseUrl=e.baseUrl,this.trackId=e.trackId}async*streamRecordsForRange(e,t,n,r){var s;const c=`${`${this.baseUrl}/${this.trackId}`}?referenceName=${e}&start=${t}&end=${n}&format=BAM`,d=(s=this.chrToIndex)===null||s===void 0?void 0:s[e];if(d===void 0)yield[];else{const a=await fetch(c,{...r});if(!a.ok)throw new Error(`HTTP ${a.status} fetching ${c}: ${await a.text()}`);const l=await a.json(),x=await N(l.htsget.urls.slice(1),r);yield*this._fetchChunkFeatures([{buffer:x,_fetchedSize:void 0,bin:0,compareTo(){return 0},toUniqueString(){return`${e}_${t}_${n}`},fetchedSize(){return 0},minv:{dataPosition:0,blockPosition:0,compareTo:()=>0},maxv:{dataPosition:Number.MAX_SAFE_INTEGER,blockPosition:0,compareTo:()=>0},toString(){return`${e}_${t}_${n}`}}],d,t,n,r)}}async _readChunk({chunk:e}){if(!e.buffer)throw new Error("expected chunk.buffer in htsget");return{data:e.buffer,cpositions:[],dpositions:[],chunk:e}}async getHeader(e={}){const t=`${this.baseUrl}/${this.trackId}?referenceName=na&class=header`,n=await fetch(t,e);if(!n.ok)throw new Error(`HTTP ${n.status} fetching ${t}: ${await n.text()}`);const r=await n.json(),s=await N(r.htsget.urls,e);if(s.readInt32LE(0)!==G)throw new Error("Not a BAM file");const i=s.readInt32LE(4),c=s.toString("utf8",8,8+i),d=H(c),a=[],l={},x=d.filter(h=>h.tag==="SQ");for(const[h,f]of x.entries()){let m="",b=0;for(const u of f.data)u.tag==="SN"?m=u.value:u.tag==="LN"&&(b=+u.value);l[m]=h,a[h]={refName:m,length:b}}return this.chrToIndex=l,this.indexToChr=a,d}}export{v as BAI,ue as BamFile,he as BamRecord,P as CSI,Ie as HtsgetFile}; diff --git a/playground/assets/index-CdYj4d87.js b/playground/assets/index-bwxybPiq.js similarity index 99% rename from playground/assets/index-CdYj4d87.js rename to playground/assets/index-bwxybPiq.js index 5fae74b..25de8c1 100644 --- a/playground/assets/index-CdYj4d87.js +++ b/playground/assets/index-bwxybPiq.js @@ -1,4 +1,4 @@ -import{b as ce}from"./index-BHN4ZNUB.js";import{_ as Vt}from"./__vite-browser-external-D80GqXp3.js";import{a as Gt}from"./_commonjsHelpers-DM6icglO.js";var He={exports:{}},z=typeof Reflect=="object"?Reflect:null,Je=z&&typeof z.apply=="function"?z.apply:function(e,r,a){return Function.prototype.apply.call(e,r,a)},ue;z&&typeof z.ownKeys=="function"?ue=z.ownKeys:Object.getOwnPropertySymbols?ue=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:ue=function(e){return Object.getOwnPropertyNames(e)};function Kt(t){console&&console.warn&&console.warn(t)}var bt=Number.isNaN||function(e){return e!==e};function q(){q.init.call(this)}He.exports=q;He.exports.once=Jt;q.EventEmitter=q;q.prototype._events=void 0;q.prototype._eventsCount=0;q.prototype._maxListeners=void 0;var Qe=10;function he(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(q,"defaultMaxListeners",{enumerable:!0,get:function(){return Qe},set:function(t){if(typeof t!="number"||t<0||bt(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Qe=t}});q.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};q.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||bt(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function gt(t){return t._maxListeners===void 0?q.defaultMaxListeners:t._maxListeners}q.prototype.getMaxListeners=function(){return gt(this)};q.prototype.emit=function(e){for(var r=[],a=1;a0&&(f=r[0]),f instanceof Error)throw f;var u=new Error("Unhandled error."+(f?" ("+f.message+")":""));throw u.context=f,u}var l=s[e];if(l===void 0)return!1;if(typeof l=="function")Je(l,this,r);else for(var h=l.length,g=St(l,h),a=0;a0&&f.length>o&&!f.warned){f.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+f.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=f.length,Kt(u)}return t}q.prototype.addListener=function(e,r){return yt(this,e,r,!1)};q.prototype.on=q.prototype.addListener;q.prototype.prependListener=function(e,r){return yt(this,e,r,!0)};function Yt(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function wt(t,e,r){var a={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},o=Yt.bind(a);return o.listener=r,a.wrapFn=o,o}q.prototype.once=function(e,r){return he(r),this.on(e,wt(this,e,r)),this};q.prototype.prependOnceListener=function(e,r){return he(r),this.prependListener(e,wt(this,e,r)),this};q.prototype.removeListener=function(e,r){var a,o,s,f,u;if(he(r),o=this._events,o===void 0)return this;if(a=o[e],a===void 0)return this;if(a===r||a.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete o[e],o.removeListener&&this.emit("removeListener",e,a.listener||r));else if(typeof a!="function"){for(s=-1,f=a.length-1;f>=0;f--)if(a[f]===r||a[f].listener===r){u=a[f].listener,s=f;break}if(s<0)return this;s===0?a.shift():zt(a,s),a.length===1&&(o[e]=a[0]),o.removeListener!==void 0&&this.emit("removeListener",e,u||r)}return this};q.prototype.off=q.prototype.removeListener;q.prototype.removeAllListeners=function(e){var r,a,o;if(a=this._events,a===void 0)return this;if(a.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):a[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete a[e]),this;if(arguments.length===0){var s=Object.keys(a),f;for(o=0;o=0;o--)this.removeListener(e,r[o]);return this};function mt(t,e,r){var a=t._events;if(a===void 0)return[];var o=a[e];return o===void 0?[]:typeof o=="function"?r?[o.listener||o]:[o]:r?Xt(o):St(o,o.length)}q.prototype.listeners=function(e){return mt(this,e,!0)};q.prototype.rawListeners=function(e){return mt(this,e,!1)};q.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):Et.call(t,e)};q.prototype.listenerCount=Et;function Et(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}q.prototype.eventNames=function(){return this._eventsCount>0?ue(this._events):[]};function St(t,e){for(var r=new Array(e),a=0;a0?this.tail.next=w:this.head=w,this.tail=w,++this.length}},{key:"unshift",value:function(b){var w={data:b,next:this.head};this.length===0&&(this.tail=w),this.head=w,++this.length}},{key:"shift",value:function(){if(this.length!==0){var b=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,b}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(b){if(this.length===0)return"";for(var w=this.head,T=""+w.data;w=w.next;)T+=b+w.data;return T}},{key:"concat",value:function(b){if(this.length===0)return h.alloc(0);for(var w=h.allocUnsafe(b>>>0),T=this.head,L=0;T;)M(T.data,w,L),L+=T.data.length,T=T.next;return w}},{key:"consume",value:function(b,w){var T;return bR.length?R.length:b;if(A===R.length?L+=R:L+=R.slice(0,b),b-=A,b===0){A===R.length?(++T,w.next?this.head=w.next:this.head=this.tail=null):(this.head=w,w.data=R.slice(A));break}++T}return this.length-=T,L}},{key:"_getBuffer",value:function(b){var w=h.allocUnsafe(b),T=this.head,L=1;for(T.data.copy(w),b-=T.data.length;T=T.next;){var R=T.data,A=b>R.length?R.length:b;if(R.copy(w,w.length-b,0,A),b-=A,b===0){A===R.length?(++L,T.next?this.head=T.next:this.head=this.tail=null):(this.head=T,T.data=R.slice(A));break}++L}return this.length-=L,w}},{key:_,value:function(b,w){return y(this,e(e({},w),{},{depth:0,customInspect:!1}))}}]),m}(),Re}var Le,tt;function Ct(){if(tt)return Le;tt=1;function t(f,u){var l=this,h=this._readableState&&this._readableState.destroyed,g=this._writableState&&this._writableState.destroyed;return h||g?(u?u(f):f&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(o,this,f)):process.nextTick(o,this,f)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(f||null,function(y){!u&&y?l._writableState?l._writableState.errorEmitted?process.nextTick(r,l):(l._writableState.errorEmitted=!0,process.nextTick(e,l,y)):process.nextTick(e,l,y):u?(process.nextTick(r,l),u(y)):process.nextTick(r,l)}),this)}function e(f,u){o(f,u),r(f)}function r(f){f._writableState&&!f._writableState.emitClose||f._readableState&&!f._readableState.emitClose||f.emit("close")}function a(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function o(f,u){f.emit("error",u)}function s(f,u){var l=f._readableState,h=f._writableState;l&&l.autoDestroy||h&&h.autoDestroy?f.destroy(u):f.emit("error",u)}return Le={destroy:t,undestroy:a,errorOrDestroy:s},Le}var Te={},rt;function Q(){if(rt)return Te;rt=1;function t(u,l){u.prototype=Object.create(l.prototype),u.prototype.constructor=u,u.__proto__=l}var e={};function r(u,l,h){h||(h=Error);function g(_,M,m){return typeof l=="string"?l:l(_,M,m)}var y=function(_){t(M,_);function M(m,S,b){return _.call(this,g(m,S,b))||this}return M}(h);y.prototype.name=h.name,y.prototype.code=u,e[u]=y}function a(u,l){if(Array.isArray(u)){var h=u.length;return u=u.map(function(g){return String(g)}),h>2?"one of ".concat(l," ").concat(u.slice(0,h-1).join(", "),", or ")+u[h-1]:h===2?"one of ".concat(l," ").concat(u[0]," or ").concat(u[1]):"of ".concat(l," ").concat(u[0])}else return"of ".concat(l," ").concat(String(u))}function o(u,l,h){return u.substr(0,l.length)===l}function s(u,l,h){return(h===void 0||h>u.length)&&(h=u.length),u.substring(h-l.length,h)===l}function f(u,l,h){return typeof h!="number"&&(h=0),h+l.length>u.length?!1:u.indexOf(l,h)!==-1}return r("ERR_INVALID_OPT_VALUE",function(u,l){return'The value "'+l+'" is invalid for option "'+u+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(u,l,h){var g;typeof l=="string"&&o(l,"not ")?(g="must not be",l=l.replace(/^not /,"")):g="must be";var y;if(s(u," argument"))y="The ".concat(u," ").concat(g," ").concat(a(l,"type"));else{var _=f(u,".")?"property":"argument";y='The "'.concat(u,'" ').concat(_," ").concat(g," ").concat(a(l,"type"))}return y+=". Received type ".concat(typeof h),y},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(u){return"The "+u+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(u){return"Cannot call "+u+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(u){return"Unknown encoding: "+u},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Te.codes=e,Te}var Ce,nt;function At(){if(nt)return Ce;nt=1;var t=Q().codes.ERR_INVALID_OPT_VALUE;function e(a,o,s){return a.highWaterMark!=null?a.highWaterMark:o?a[s]:null}function r(a,o,s,f){var u=e(o,f,s);if(u!=null){if(!(isFinite(u)&&Math.floor(u)===u)||u<0){var l=f?s:"highWaterMark";throw new t(l,u)}return Math.floor(u)}return a.objectMode?16:16*1024}return Ce={getHighWaterMark:r},Ce}var Ae,it;function er(){if(it)return Ae;it=1,Ae=t;function t(r,a){if(e("noDeprecation"))return r;var o=!1;function s(){if(!o){if(e("throwDeprecation"))throw new Error(a);e("traceDeprecation")?console.trace(a):console.warn(a),o=!0}return r.apply(this,arguments)}return s}function e(r){try{if(!globalThis.localStorage)return!1}catch{return!1}var a=globalThis.localStorage[r];return a==null?!1:String(a).toLowerCase()==="true"}return Ae}var Me,at;function Mt(){if(at)return Me;at=1,Me=N;function t(c){var d=this;this.next=null,this.entry=null,this.finish=function(){ye(d,c)}}var e;N.WritableState=O;var r={deprecate:er()},a=Lt(),o=ce.Buffer,s=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function f(c){return o.from(c)}function u(c){return o.isBuffer(c)||c instanceof s}var l=Ct(),h=At(),g=h.getHighWaterMark,y=Q().codes,_=y.ERR_INVALID_ARG_TYPE,M=y.ERR_METHOD_NOT_IMPLEMENTED,m=y.ERR_MULTIPLE_CALLBACK,S=y.ERR_STREAM_CANNOT_PIPE,b=y.ERR_STREAM_DESTROYED,w=y.ERR_STREAM_NULL_VALUES,T=y.ERR_STREAM_WRITE_AFTER_END,L=y.ERR_UNKNOWN_ENCODING,R=l.errorOrDestroy;J(N,a);function A(){}function O(c,d,v){e=e||X(),c=c||{},typeof v!="boolean"&&(v=d instanceof e),this.objectMode=!!c.objectMode,v&&(this.objectMode=this.objectMode||!!c.writableObjectMode),this.highWaterMark=g(this,c,"writableHighWaterMark",v),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var C=c.decodeStrings===!1;this.decodeStrings=!C,this.defaultEncoding=c.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(P){_e(d,P)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=c.emitClose!==!1,this.autoDestroy=!!c.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}O.prototype.getBuffer=function(){for(var d=this.bufferedRequest,v=[];d;)v.push(d),d=d.next;return v},function(){try{Object.defineProperty(O.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var I;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(I=Function.prototype[Symbol.hasInstance],Object.defineProperty(N,Symbol.hasInstance,{value:function(d){return I.call(this,d)?!0:this!==N?!1:d&&d._writableState instanceof O}})):I=function(d){return d instanceof this};function N(c){e=e||X();var d=this instanceof e;if(!d&&!I.call(N,this))return new N(c);this._writableState=new O(c,this,d),this.writable=!0,c&&(typeof c.write=="function"&&(this._write=c.write),typeof c.writev=="function"&&(this._writev=c.writev),typeof c.destroy=="function"&&(this._destroy=c.destroy),typeof c.final=="function"&&(this._final=c.final)),a.call(this)}N.prototype.pipe=function(){R(this,new S)};function D(c,d){var v=new T;R(c,v),process.nextTick(d,v)}function B(c,d,v,C){var P;return v===null?P=new w:typeof v!="string"&&!d.objectMode&&(P=new _("chunk",["string","Buffer"],v)),P?(R(c,P),process.nextTick(C,P),!1):!0}N.prototype.write=function(c,d,v){var C=this._writableState,P=!1,n=!C.objectMode&&u(c);return n&&!o.isBuffer(c)&&(c=f(c)),typeof d=="function"&&(v=d,d=null),n?d="buffer":d||(d=C.defaultEncoding),typeof v!="function"&&(v=A),C.ending?D(this,v):(n||B(this,C,c,v))&&(C.pendingcb++,P=pe(this,C,n,c,d,v)),P},N.prototype.cork=function(){this._writableState.corked++},N.prototype.uncork=function(){var c=this._writableState;c.corked&&(c.corked--,!c.writing&&!c.corked&&!c.bufferProcessing&&c.bufferedRequest&&V(this,c))},N.prototype.setDefaultEncoding=function(d){if(typeof d=="string"&&(d=d.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((d+"").toLowerCase())>-1))throw new L(d);return this._writableState.defaultEncoding=d,this},Object.defineProperty(N.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Z(c,d,v){return!c.objectMode&&c.decodeStrings!==!1&&typeof d=="string"&&(d=o.from(d,v)),d}Object.defineProperty(N.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function pe(c,d,v,C,P,n){if(!v){var i=Z(d,C,P);C!==i&&(v=!0,P="buffer",C=i)}var p=d.objectMode?1:C.length;d.length+=p;var E=d.length */(function(t,e){var r=ce,a=r.Buffer;function o(f,u){for(var l in f)u[l]=f[l]}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?t.exports=r:(o(r,e),e.Buffer=s);function s(f,u,l){return a(f,u,l)}s.prototype=Object.create(a.prototype),o(a,s),s.from=function(f,u,l){if(typeof f=="number")throw new TypeError("Argument must not be a number");return a(f,u,l)},s.alloc=function(f,u,l){if(typeof f!="number")throw new TypeError("Argument must be a number");var h=a(f);return u!==void 0?typeof l=="string"?h.fill(u,l):h.fill(u):h.fill(0),h},s.allocUnsafe=function(f){if(typeof f!="number")throw new TypeError("Argument must be a number");return a(f)},s.allocUnsafeSlow=function(f){if(typeof f!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(f)}})(We,We.exports);var tr=We.exports,Ve=tr.Buffer,ot=Ve.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function rr(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function nr(t){var e=rr(t);if(typeof e!="string"&&(Ve.isEncoding===ot||!ot(t)))throw new Error("Unknown encoding: "+t);return e||t}var ir=Be.StringDecoder=ne;function ne(t){this.encoding=nr(t);var e;switch(this.encoding){case"utf16le":this.text=lr,this.end=dr,e=4;break;case"utf8":this.fillLast=or,e=4;break;case"base64":this.text=cr,this.end=hr,e=3;break;default:this.write=pr,this.end=vr;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Ve.allocUnsafe(e)}ne.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function ar(t,e,r){var a=e.length-1;if(a=0?(o>0&&(t.lastNeed=o-1),o):--a=0?(o>0&&(t.lastNeed=o-2),o):--a=0?(o>0&&(o===2?o=0:t.lastNeed=o-3),o):0))}function sr(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"�"}}function or(t){var e=this.lastTotal-this.lastNeed,r=sr(this,t);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function fr(t,e){var r=ar(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var a=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,a),t.toString("utf8",e,a)}function ur(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e}function lr(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var a=r.charCodeAt(r.length-1);if(a>=55296&&a<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function dr(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function cr(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function hr(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function pr(t){return t.toString(this.encoding)}function vr(t){return t&&t.length?this.write(t):""}var xe,ft;function Ge(){if(ft)return xe;ft=1;var t=Q().codes.ERR_STREAM_PREMATURE_CLOSE;function e(s){var f=!1;return function(){if(!f){f=!0;for(var u=arguments.length,l=new Array(u),h=0;h0)if(typeof i!="string"&&!x.objectMode&&Object.getPrototypeOf(i)!==a.prototype&&(i=s(i)),E)x.endEmitted?A(n,new w):Z(n,x,i,!0);else if(x.ended)A(n,new S);else{if(x.destroyed)return!1;x.reading=!1,x.decoder&&!p?(i=x.decoder.write(i),x.objectMode||i.length!==0?Z(n,x,i,!1):V(n,x)):Z(n,x,i,!1)}else E||(x.reading=!1,V(n,x))}return!x.ended&&(x.length=$?n=$:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}function ie(n,i){return n<=0||i.length===0&&i.ended?0:i.objectMode?1:n!==n?i.flowing&&i.length?i.buffer.head.data.length:i.length:(n>i.highWaterMark&&(i.highWaterMark=ve(n)),n<=i.length?n:i.ended?i.length:(i.needReadable=!0,0))}D.prototype.read=function(n){l("read",n),n=parseInt(n,10);var i=this._readableState,p=n;if(n!==0&&(i.emittedReadable=!1),n===0&&i.needReadable&&((i.highWaterMark!==0?i.length>=i.highWaterMark:i.length>0)||i.ended))return l("read: emitReadable",i.length,i.ended),i.length===0&&i.ended?v(this):U(this),null;if(n=ie(n,i),n===0&&i.ended)return i.length===0&&v(this),null;var E=i.needReadable;l("need readable",E),(i.length===0||i.length-n0?j=d(n,i):j=null,j===null?(i.needReadable=i.length<=i.highWaterMark,n=0):(i.length-=n,i.awaitDrain=0),i.length===0&&(i.ended||(i.needReadable=!0),p!==n&&i.ended&&v(this)),j!==null&&this.emit("data",j),j};function _e(n,i){if(l("onEofChunk"),!i.ended){if(i.decoder){var p=i.decoder.end();p&&p.length&&(i.buffer.push(p),i.length+=i.objectMode?1:p.length)}i.ended=!0,i.sync?U(n):(i.needReadable=!1,i.emittedReadable||(i.emittedReadable=!0,ae(n)))}}function U(n){var i=n._readableState;l("emitReadable",i.needReadable,i.emittedReadable),i.needReadable=!1,i.emittedReadable||(l("emitReadable",i.flowing),i.emittedReadable=!0,process.nextTick(ae,n))}function ae(n){var i=n._readableState;l("emitReadable_",i.destroyed,i.length,i.ended),!i.destroyed&&(i.length||i.ended)&&(n.emit("readable"),i.emittedReadable=!1),i.needReadable=!i.flowing&&!i.ended&&i.length<=i.highWaterMark,c(n)}function V(n,i){i.readingMore||(i.readingMore=!0,process.nextTick(se,n,i))}function se(n,i){for(;!i.reading&&!i.ended&&(i.length1&&P(E.pipes,n)!==-1)&&!ze&&(l("false write response, pause",E.awaitDrain),E.awaitDrain++),p.pause())}function we(K){l("onerror",K),ee(),n.removeListener("error",we),e(n,"error")===0&&A(n,K)}I(n,"error",we);function me(){n.removeListener("finish",Ee),ee()}n.once("close",me);function Ee(){l("onfinish"),n.removeListener("close",me),ee()}n.once("finish",Ee);function ee(){l("unpipe"),p.unpipe(n)}return n.emit("pipe",p),E.flowing||(l("pipe resume"),p.resume()),n};function be(n){return function(){var p=n._readableState;l("pipeOnDrain",p.awaitDrain),p.awaitDrain&&p.awaitDrain--,p.awaitDrain===0&&e(n,"data")&&(p.flowing=!0,c(n))}}D.prototype.unpipe=function(n){var i=this._readableState,p={hasUnpiped:!1};if(i.pipesCount===0)return this;if(i.pipesCount===1)return n&&n!==i.pipes?this:(n||(n=i.pipes),i.pipes=null,i.pipesCount=0,i.flowing=!1,n&&n.emit("unpipe",this,p),this);if(!n){var E=i.pipes,j=i.pipesCount;i.pipes=null,i.pipesCount=0,i.flowing=!1;for(var x=0;x0,E.flowing!==!1&&this.resume()):n==="readable"&&!E.endEmitted&&!E.readableListening&&(E.readableListening=E.needReadable=!0,E.flowing=!1,E.emittedReadable=!1,l("on readable",E.length,E.reading),E.length?U(this):E.reading||process.nextTick(H,this)),p},D.prototype.addListener=D.prototype.on,D.prototype.removeListener=function(n,i){var p=r.prototype.removeListener.call(this,n,i);return n==="readable"&&process.nextTick(oe,this),p},D.prototype.removeAllListeners=function(n){var i=r.prototype.removeAllListeners.apply(this,arguments);return(n==="readable"||n===void 0)&&process.nextTick(oe,this),i};function oe(n){var i=n._readableState;i.readableListening=n.listenerCount("readable")>0,i.resumeScheduled&&!i.paused?i.flowing=!0:n.listenerCount("data")>0&&n.resume()}function H(n){l("readable nexttick read 0"),n.read(0)}D.prototype.resume=function(){var n=this._readableState;return n.flowing||(l("resume"),n.flowing=!n.readableListening,ge(this,n)),n.paused=!1,this};function ge(n,i){i.resumeScheduled||(i.resumeScheduled=!0,process.nextTick(ye,n,i))}function ye(n,i){l("resume",i.reading),i.reading||n.read(0),i.resumeScheduled=!1,n.emit("resume"),c(n),i.flowing&&!i.reading&&n.read(0)}D.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function c(n){var i=n._readableState;for(l("flow",i.flowing);i.flowing&&n.read()!==null;);}D.prototype.wrap=function(n){var i=this,p=this._readableState,E=!1;n.on("end",function(){if(l("wrapped end"),p.decoder&&!p.ended){var k=p.decoder.end();k&&k.length&&i.push(k)}i.push(null)}),n.on("data",function(k){if(l("wrapped data"),p.decoder&&(k=p.decoder.write(k)),!(p.objectMode&&k==null)&&!(!p.objectMode&&(!k||!k.length))){var G=i.push(k);G||(E=!0,n.pause())}});for(var j in n)this[j]===void 0&&typeof n[j]=="function"&&(this[j]=function(G){return function(){return n[G].apply(n,arguments)}}(j));for(var x=0;x=i.length?(i.decoder?p=i.buffer.join(""):i.buffer.length===1?p=i.buffer.first():p=i.buffer.concat(i.length),i.buffer.clear()):p=i.buffer.consume(n,i.decoder),p}function v(n){var i=n._readableState;l("endReadable",i.endEmitted),i.endEmitted||(i.ended=!0,process.nextTick(C,i,n))}function C(n,i){if(l("endReadableNT",n.endEmitted,n.length),!n.endEmitted&&n.length===0&&(n.endEmitted=!0,i.readable=!1,i.emit("end"),n.autoDestroy)){var p=i._writableState;(!p||p.autoDestroy&&p.finished)&&i.destroy()}}typeof Symbol=="function"&&(D.from=function(n,i){return R===void 0&&(R=br()),R(D,n,i)});function P(n,i){for(var p=0,E=n.length;p0;return u(T,R,A,function(O){b||(b=O),O&&w.forEach(l),!R&&(w.forEach(l),S(b))})});return M.reduce(h)}return Ie=y,Ie}var xt=F,Ke=$e.EventEmitter,wr=J;wr(F,Ke);F.Readable=Ot();F.Writable=Mt();F.Duplex=X();F.Transform=Dt();F.PassThrough=gr();F.finished=Ge();F.pipeline=yr();F.Stream=F;function F(){Ke.call(this)}F.prototype.pipe=function(t,e){var r=this;function a(g){t.writable&&t.write(g)===!1&&r.pause&&r.pause()}r.on("data",a);function o(){r.readable&&r.resume&&r.resume()}t.on("drain",o),!t._isStdio&&(!e||e.end!==!1)&&(r.on("end",f),r.on("close",u));var s=!1;function f(){s||(s=!0,t.end())}function u(){s||(s=!0,typeof t.destroy=="function"&&t.destroy())}function l(g){if(h(),Ke.listenerCount(this,"error")===0)throw g}r.on("error",l),t.on("error",l);function h(){r.removeListener("data",a),t.removeListener("drain",o),r.removeListener("end",f),r.removeListener("close",u),r.removeListener("error",l),t.removeListener("error",l),r.removeListener("end",h),r.removeListener("close",h),t.removeListener("close",h)}return r.on("end",h),r.on("close",h),t.on("close",h),t.emit("pipe",r),t};function re(t){return t.replace(/%([0-9A-Fa-f]{2})/g,(e,r)=>String.fromCharCode(parseInt(r,16)))}function Pt(t,e){return String(e).replace(t,r=>`%${r.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0")}`)}function te(t){return Pt(/[\n;\r\t=%&,\x00-\x1f\x7f-\xff]/g,t)}function W(t){return Pt(/[\n\r\t%\x00-\x1f\x7f-\xff]/g,t)}function Nt(t){if(!(t&&t.length)||t===".")return{};const e={};return t.replace(/\r?\n$/,"").split(";").forEach(r=>{const a=r.split("=",2);if(!(a[1]&&a[1].length))return;a[0]=a[0].trim();let o=e[a[0].trim()];o||(o=[],e[a[0]]=o),o.push(...a[1].split(",").map(s=>s.trim()).map(re))}),e}function qt(t){const e=t.split(" ").map(a=>a==="."||a===""?null:a);return{seq_id:e[0]&&re(e[0]),source:e[1]&&re(e[1]),type:e[2]&&re(e[2]),start:e[3]===null?null:parseInt(e[3],10),end:e[4]===null?null:parseInt(e[4],10),score:e[5]===null?null:parseFloat(e[5]),strand:e[6],phase:e[7],attributes:e[8]===null?null:Nt(e[8])}}function kt(t){const e=/^\s*##\s*(\S+)\s*(.*)/.exec(t);if(!e)return null;const[,r]=e;let[,,a]=e;const o={directive:r};if(a.length&&(a=a.replace(/\r?\n$/,""),o.value=a),r==="sequence-region"){const s=a.split(/\s+/,3);return{...o,seq_id:s[0],start:s[1]&&s[1].replace(/\D/g,""),end:s[2]&&s[2].replace(/\D/g,"")}}else if(r==="genome-build"){const[s,f]=a.split(/\s+/,2);return{...o,source:s,buildName:f}}return o}function jt(t){const e=[];return Object.entries(t).forEach(([r,a])=>{if(!a)return;let o;a.hasOwnProperty("toString")?o=te(a.toString()):Array.isArray(a)?o=a.map(te).join(","):o=te(a),e.push(`${te(r)}=${o}`)}),e.length?e.join(";"):"."}function mr(t,e){const r=t.attributes===null||t.attributes===void 0?".":jt(t.attributes),o=`${[t.seq_id===null?".":W(t.seq_id),t.source===null?".":W(t.source),t.type===null?".":W(t.type),t.start===null?".":W(t.start),t.end===null?".":W(t.end),t.score===null?".":W(t.score),t.strand===null?".":W(t.strand),t.phase===null?".":W(t.phase),r].join(" ")} +import{b as ce}from"./index-CJAFAeH3.js";import{_ as Vt}from"./__vite-browser-external-D80GqXp3.js";import{a as Gt}from"./_commonjsHelpers-C932wzq6.js";var He={exports:{}},z=typeof Reflect=="object"?Reflect:null,Je=z&&typeof z.apply=="function"?z.apply:function(e,r,a){return Function.prototype.apply.call(e,r,a)},ue;z&&typeof z.ownKeys=="function"?ue=z.ownKeys:Object.getOwnPropertySymbols?ue=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:ue=function(e){return Object.getOwnPropertyNames(e)};function Kt(t){console&&console.warn&&console.warn(t)}var bt=Number.isNaN||function(e){return e!==e};function q(){q.init.call(this)}He.exports=q;He.exports.once=Jt;q.EventEmitter=q;q.prototype._events=void 0;q.prototype._eventsCount=0;q.prototype._maxListeners=void 0;var Qe=10;function he(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(q,"defaultMaxListeners",{enumerable:!0,get:function(){return Qe},set:function(t){if(typeof t!="number"||t<0||bt(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Qe=t}});q.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};q.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||bt(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function gt(t){return t._maxListeners===void 0?q.defaultMaxListeners:t._maxListeners}q.prototype.getMaxListeners=function(){return gt(this)};q.prototype.emit=function(e){for(var r=[],a=1;a0&&(f=r[0]),f instanceof Error)throw f;var u=new Error("Unhandled error."+(f?" ("+f.message+")":""));throw u.context=f,u}var l=s[e];if(l===void 0)return!1;if(typeof l=="function")Je(l,this,r);else for(var h=l.length,g=St(l,h),a=0;a0&&f.length>o&&!f.warned){f.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+f.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=f.length,Kt(u)}return t}q.prototype.addListener=function(e,r){return yt(this,e,r,!1)};q.prototype.on=q.prototype.addListener;q.prototype.prependListener=function(e,r){return yt(this,e,r,!0)};function Yt(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function wt(t,e,r){var a={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},o=Yt.bind(a);return o.listener=r,a.wrapFn=o,o}q.prototype.once=function(e,r){return he(r),this.on(e,wt(this,e,r)),this};q.prototype.prependOnceListener=function(e,r){return he(r),this.prependListener(e,wt(this,e,r)),this};q.prototype.removeListener=function(e,r){var a,o,s,f,u;if(he(r),o=this._events,o===void 0)return this;if(a=o[e],a===void 0)return this;if(a===r||a.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete o[e],o.removeListener&&this.emit("removeListener",e,a.listener||r));else if(typeof a!="function"){for(s=-1,f=a.length-1;f>=0;f--)if(a[f]===r||a[f].listener===r){u=a[f].listener,s=f;break}if(s<0)return this;s===0?a.shift():zt(a,s),a.length===1&&(o[e]=a[0]),o.removeListener!==void 0&&this.emit("removeListener",e,u||r)}return this};q.prototype.off=q.prototype.removeListener;q.prototype.removeAllListeners=function(e){var r,a,o;if(a=this._events,a===void 0)return this;if(a.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):a[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete a[e]),this;if(arguments.length===0){var s=Object.keys(a),f;for(o=0;o=0;o--)this.removeListener(e,r[o]);return this};function mt(t,e,r){var a=t._events;if(a===void 0)return[];var o=a[e];return o===void 0?[]:typeof o=="function"?r?[o.listener||o]:[o]:r?Xt(o):St(o,o.length)}q.prototype.listeners=function(e){return mt(this,e,!0)};q.prototype.rawListeners=function(e){return mt(this,e,!1)};q.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):Et.call(t,e)};q.prototype.listenerCount=Et;function Et(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}q.prototype.eventNames=function(){return this._eventsCount>0?ue(this._events):[]};function St(t,e){for(var r=new Array(e),a=0;a0?this.tail.next=w:this.head=w,this.tail=w,++this.length}},{key:"unshift",value:function(b){var w={data:b,next:this.head};this.length===0&&(this.tail=w),this.head=w,++this.length}},{key:"shift",value:function(){if(this.length!==0){var b=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,b}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(b){if(this.length===0)return"";for(var w=this.head,T=""+w.data;w=w.next;)T+=b+w.data;return T}},{key:"concat",value:function(b){if(this.length===0)return h.alloc(0);for(var w=h.allocUnsafe(b>>>0),T=this.head,L=0;T;)M(T.data,w,L),L+=T.data.length,T=T.next;return w}},{key:"consume",value:function(b,w){var T;return bR.length?R.length:b;if(A===R.length?L+=R:L+=R.slice(0,b),b-=A,b===0){A===R.length?(++T,w.next?this.head=w.next:this.head=this.tail=null):(this.head=w,w.data=R.slice(A));break}++T}return this.length-=T,L}},{key:"_getBuffer",value:function(b){var w=h.allocUnsafe(b),T=this.head,L=1;for(T.data.copy(w),b-=T.data.length;T=T.next;){var R=T.data,A=b>R.length?R.length:b;if(R.copy(w,w.length-b,0,A),b-=A,b===0){A===R.length?(++L,T.next?this.head=T.next:this.head=this.tail=null):(this.head=T,T.data=R.slice(A));break}++L}return this.length-=L,w}},{key:_,value:function(b,w){return y(this,e(e({},w),{},{depth:0,customInspect:!1}))}}]),m}(),Re}var Le,tt;function Ct(){if(tt)return Le;tt=1;function t(f,u){var l=this,h=this._readableState&&this._readableState.destroyed,g=this._writableState&&this._writableState.destroyed;return h||g?(u?u(f):f&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(o,this,f)):process.nextTick(o,this,f)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(f||null,function(y){!u&&y?l._writableState?l._writableState.errorEmitted?process.nextTick(r,l):(l._writableState.errorEmitted=!0,process.nextTick(e,l,y)):process.nextTick(e,l,y):u?(process.nextTick(r,l),u(y)):process.nextTick(r,l)}),this)}function e(f,u){o(f,u),r(f)}function r(f){f._writableState&&!f._writableState.emitClose||f._readableState&&!f._readableState.emitClose||f.emit("close")}function a(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function o(f,u){f.emit("error",u)}function s(f,u){var l=f._readableState,h=f._writableState;l&&l.autoDestroy||h&&h.autoDestroy?f.destroy(u):f.emit("error",u)}return Le={destroy:t,undestroy:a,errorOrDestroy:s},Le}var Te={},rt;function Q(){if(rt)return Te;rt=1;function t(u,l){u.prototype=Object.create(l.prototype),u.prototype.constructor=u,u.__proto__=l}var e={};function r(u,l,h){h||(h=Error);function g(_,M,m){return typeof l=="string"?l:l(_,M,m)}var y=function(_){t(M,_);function M(m,S,b){return _.call(this,g(m,S,b))||this}return M}(h);y.prototype.name=h.name,y.prototype.code=u,e[u]=y}function a(u,l){if(Array.isArray(u)){var h=u.length;return u=u.map(function(g){return String(g)}),h>2?"one of ".concat(l," ").concat(u.slice(0,h-1).join(", "),", or ")+u[h-1]:h===2?"one of ".concat(l," ").concat(u[0]," or ").concat(u[1]):"of ".concat(l," ").concat(u[0])}else return"of ".concat(l," ").concat(String(u))}function o(u,l,h){return u.substr(0,l.length)===l}function s(u,l,h){return(h===void 0||h>u.length)&&(h=u.length),u.substring(h-l.length,h)===l}function f(u,l,h){return typeof h!="number"&&(h=0),h+l.length>u.length?!1:u.indexOf(l,h)!==-1}return r("ERR_INVALID_OPT_VALUE",function(u,l){return'The value "'+l+'" is invalid for option "'+u+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(u,l,h){var g;typeof l=="string"&&o(l,"not ")?(g="must not be",l=l.replace(/^not /,"")):g="must be";var y;if(s(u," argument"))y="The ".concat(u," ").concat(g," ").concat(a(l,"type"));else{var _=f(u,".")?"property":"argument";y='The "'.concat(u,'" ').concat(_," ").concat(g," ").concat(a(l,"type"))}return y+=". Received type ".concat(typeof h),y},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(u){return"The "+u+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(u){return"Cannot call "+u+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(u){return"Unknown encoding: "+u},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),Te.codes=e,Te}var Ce,nt;function At(){if(nt)return Ce;nt=1;var t=Q().codes.ERR_INVALID_OPT_VALUE;function e(a,o,s){return a.highWaterMark!=null?a.highWaterMark:o?a[s]:null}function r(a,o,s,f){var u=e(o,f,s);if(u!=null){if(!(isFinite(u)&&Math.floor(u)===u)||u<0){var l=f?s:"highWaterMark";throw new t(l,u)}return Math.floor(u)}return a.objectMode?16:16*1024}return Ce={getHighWaterMark:r},Ce}var Ae,it;function er(){if(it)return Ae;it=1,Ae=t;function t(r,a){if(e("noDeprecation"))return r;var o=!1;function s(){if(!o){if(e("throwDeprecation"))throw new Error(a);e("traceDeprecation")?console.trace(a):console.warn(a),o=!0}return r.apply(this,arguments)}return s}function e(r){try{if(!globalThis.localStorage)return!1}catch{return!1}var a=globalThis.localStorage[r];return a==null?!1:String(a).toLowerCase()==="true"}return Ae}var Me,at;function Mt(){if(at)return Me;at=1,Me=N;function t(c){var d=this;this.next=null,this.entry=null,this.finish=function(){ye(d,c)}}var e;N.WritableState=O;var r={deprecate:er()},a=Lt(),o=ce.Buffer,s=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function f(c){return o.from(c)}function u(c){return o.isBuffer(c)||c instanceof s}var l=Ct(),h=At(),g=h.getHighWaterMark,y=Q().codes,_=y.ERR_INVALID_ARG_TYPE,M=y.ERR_METHOD_NOT_IMPLEMENTED,m=y.ERR_MULTIPLE_CALLBACK,S=y.ERR_STREAM_CANNOT_PIPE,b=y.ERR_STREAM_DESTROYED,w=y.ERR_STREAM_NULL_VALUES,T=y.ERR_STREAM_WRITE_AFTER_END,L=y.ERR_UNKNOWN_ENCODING,R=l.errorOrDestroy;J(N,a);function A(){}function O(c,d,v){e=e||X(),c=c||{},typeof v!="boolean"&&(v=d instanceof e),this.objectMode=!!c.objectMode,v&&(this.objectMode=this.objectMode||!!c.writableObjectMode),this.highWaterMark=g(this,c,"writableHighWaterMark",v),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var C=c.decodeStrings===!1;this.decodeStrings=!C,this.defaultEncoding=c.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(P){_e(d,P)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=c.emitClose!==!1,this.autoDestroy=!!c.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}O.prototype.getBuffer=function(){for(var d=this.bufferedRequest,v=[];d;)v.push(d),d=d.next;return v},function(){try{Object.defineProperty(O.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var I;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(I=Function.prototype[Symbol.hasInstance],Object.defineProperty(N,Symbol.hasInstance,{value:function(d){return I.call(this,d)?!0:this!==N?!1:d&&d._writableState instanceof O}})):I=function(d){return d instanceof this};function N(c){e=e||X();var d=this instanceof e;if(!d&&!I.call(N,this))return new N(c);this._writableState=new O(c,this,d),this.writable=!0,c&&(typeof c.write=="function"&&(this._write=c.write),typeof c.writev=="function"&&(this._writev=c.writev),typeof c.destroy=="function"&&(this._destroy=c.destroy),typeof c.final=="function"&&(this._final=c.final)),a.call(this)}N.prototype.pipe=function(){R(this,new S)};function D(c,d){var v=new T;R(c,v),process.nextTick(d,v)}function B(c,d,v,C){var P;return v===null?P=new w:typeof v!="string"&&!d.objectMode&&(P=new _("chunk",["string","Buffer"],v)),P?(R(c,P),process.nextTick(C,P),!1):!0}N.prototype.write=function(c,d,v){var C=this._writableState,P=!1,n=!C.objectMode&&u(c);return n&&!o.isBuffer(c)&&(c=f(c)),typeof d=="function"&&(v=d,d=null),n?d="buffer":d||(d=C.defaultEncoding),typeof v!="function"&&(v=A),C.ending?D(this,v):(n||B(this,C,c,v))&&(C.pendingcb++,P=pe(this,C,n,c,d,v)),P},N.prototype.cork=function(){this._writableState.corked++},N.prototype.uncork=function(){var c=this._writableState;c.corked&&(c.corked--,!c.writing&&!c.corked&&!c.bufferProcessing&&c.bufferedRequest&&V(this,c))},N.prototype.setDefaultEncoding=function(d){if(typeof d=="string"&&(d=d.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((d+"").toLowerCase())>-1))throw new L(d);return this._writableState.defaultEncoding=d,this},Object.defineProperty(N.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Z(c,d,v){return!c.objectMode&&c.decodeStrings!==!1&&typeof d=="string"&&(d=o.from(d,v)),d}Object.defineProperty(N.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function pe(c,d,v,C,P,n){if(!v){var i=Z(d,C,P);C!==i&&(v=!0,P="buffer",C=i)}var p=d.objectMode?1:C.length;d.length+=p;var E=d.length */(function(t,e){var r=ce,a=r.Buffer;function o(f,u){for(var l in f)u[l]=f[l]}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?t.exports=r:(o(r,e),e.Buffer=s);function s(f,u,l){return a(f,u,l)}s.prototype=Object.create(a.prototype),o(a,s),s.from=function(f,u,l){if(typeof f=="number")throw new TypeError("Argument must not be a number");return a(f,u,l)},s.alloc=function(f,u,l){if(typeof f!="number")throw new TypeError("Argument must be a number");var h=a(f);return u!==void 0?typeof l=="string"?h.fill(u,l):h.fill(u):h.fill(0),h},s.allocUnsafe=function(f){if(typeof f!="number")throw new TypeError("Argument must be a number");return a(f)},s.allocUnsafeSlow=function(f){if(typeof f!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(f)}})(We,We.exports);var tr=We.exports,Ve=tr.Buffer,ot=Ve.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function rr(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function nr(t){var e=rr(t);if(typeof e!="string"&&(Ve.isEncoding===ot||!ot(t)))throw new Error("Unknown encoding: "+t);return e||t}var ir=Be.StringDecoder=ne;function ne(t){this.encoding=nr(t);var e;switch(this.encoding){case"utf16le":this.text=lr,this.end=dr,e=4;break;case"utf8":this.fillLast=or,e=4;break;case"base64":this.text=cr,this.end=hr,e=3;break;default:this.write=pr,this.end=vr;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Ve.allocUnsafe(e)}ne.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function ar(t,e,r){var a=e.length-1;if(a=0?(o>0&&(t.lastNeed=o-1),o):--a=0?(o>0&&(t.lastNeed=o-2),o):--a=0?(o>0&&(o===2?o=0:t.lastNeed=o-3),o):0))}function sr(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"�"}}function or(t){var e=this.lastTotal-this.lastNeed,r=sr(this,t);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function fr(t,e){var r=ar(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var a=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,a),t.toString("utf8",e,a)}function ur(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e}function lr(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var a=r.charCodeAt(r.length-1);if(a>=55296&&a<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function dr(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function cr(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function hr(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function pr(t){return t.toString(this.encoding)}function vr(t){return t&&t.length?this.write(t):""}var xe,ft;function Ge(){if(ft)return xe;ft=1;var t=Q().codes.ERR_STREAM_PREMATURE_CLOSE;function e(s){var f=!1;return function(){if(!f){f=!0;for(var u=arguments.length,l=new Array(u),h=0;h0)if(typeof i!="string"&&!x.objectMode&&Object.getPrototypeOf(i)!==a.prototype&&(i=s(i)),E)x.endEmitted?A(n,new w):Z(n,x,i,!0);else if(x.ended)A(n,new S);else{if(x.destroyed)return!1;x.reading=!1,x.decoder&&!p?(i=x.decoder.write(i),x.objectMode||i.length!==0?Z(n,x,i,!1):V(n,x)):Z(n,x,i,!1)}else E||(x.reading=!1,V(n,x))}return!x.ended&&(x.length=$?n=$:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}function ie(n,i){return n<=0||i.length===0&&i.ended?0:i.objectMode?1:n!==n?i.flowing&&i.length?i.buffer.head.data.length:i.length:(n>i.highWaterMark&&(i.highWaterMark=ve(n)),n<=i.length?n:i.ended?i.length:(i.needReadable=!0,0))}D.prototype.read=function(n){l("read",n),n=parseInt(n,10);var i=this._readableState,p=n;if(n!==0&&(i.emittedReadable=!1),n===0&&i.needReadable&&((i.highWaterMark!==0?i.length>=i.highWaterMark:i.length>0)||i.ended))return l("read: emitReadable",i.length,i.ended),i.length===0&&i.ended?v(this):U(this),null;if(n=ie(n,i),n===0&&i.ended)return i.length===0&&v(this),null;var E=i.needReadable;l("need readable",E),(i.length===0||i.length-n0?j=d(n,i):j=null,j===null?(i.needReadable=i.length<=i.highWaterMark,n=0):(i.length-=n,i.awaitDrain=0),i.length===0&&(i.ended||(i.needReadable=!0),p!==n&&i.ended&&v(this)),j!==null&&this.emit("data",j),j};function _e(n,i){if(l("onEofChunk"),!i.ended){if(i.decoder){var p=i.decoder.end();p&&p.length&&(i.buffer.push(p),i.length+=i.objectMode?1:p.length)}i.ended=!0,i.sync?U(n):(i.needReadable=!1,i.emittedReadable||(i.emittedReadable=!0,ae(n)))}}function U(n){var i=n._readableState;l("emitReadable",i.needReadable,i.emittedReadable),i.needReadable=!1,i.emittedReadable||(l("emitReadable",i.flowing),i.emittedReadable=!0,process.nextTick(ae,n))}function ae(n){var i=n._readableState;l("emitReadable_",i.destroyed,i.length,i.ended),!i.destroyed&&(i.length||i.ended)&&(n.emit("readable"),i.emittedReadable=!1),i.needReadable=!i.flowing&&!i.ended&&i.length<=i.highWaterMark,c(n)}function V(n,i){i.readingMore||(i.readingMore=!0,process.nextTick(se,n,i))}function se(n,i){for(;!i.reading&&!i.ended&&(i.length1&&P(E.pipes,n)!==-1)&&!ze&&(l("false write response, pause",E.awaitDrain),E.awaitDrain++),p.pause())}function we(K){l("onerror",K),ee(),n.removeListener("error",we),e(n,"error")===0&&A(n,K)}I(n,"error",we);function me(){n.removeListener("finish",Ee),ee()}n.once("close",me);function Ee(){l("onfinish"),n.removeListener("close",me),ee()}n.once("finish",Ee);function ee(){l("unpipe"),p.unpipe(n)}return n.emit("pipe",p),E.flowing||(l("pipe resume"),p.resume()),n};function be(n){return function(){var p=n._readableState;l("pipeOnDrain",p.awaitDrain),p.awaitDrain&&p.awaitDrain--,p.awaitDrain===0&&e(n,"data")&&(p.flowing=!0,c(n))}}D.prototype.unpipe=function(n){var i=this._readableState,p={hasUnpiped:!1};if(i.pipesCount===0)return this;if(i.pipesCount===1)return n&&n!==i.pipes?this:(n||(n=i.pipes),i.pipes=null,i.pipesCount=0,i.flowing=!1,n&&n.emit("unpipe",this,p),this);if(!n){var E=i.pipes,j=i.pipesCount;i.pipes=null,i.pipesCount=0,i.flowing=!1;for(var x=0;x0,E.flowing!==!1&&this.resume()):n==="readable"&&!E.endEmitted&&!E.readableListening&&(E.readableListening=E.needReadable=!0,E.flowing=!1,E.emittedReadable=!1,l("on readable",E.length,E.reading),E.length?U(this):E.reading||process.nextTick(H,this)),p},D.prototype.addListener=D.prototype.on,D.prototype.removeListener=function(n,i){var p=r.prototype.removeListener.call(this,n,i);return n==="readable"&&process.nextTick(oe,this),p},D.prototype.removeAllListeners=function(n){var i=r.prototype.removeAllListeners.apply(this,arguments);return(n==="readable"||n===void 0)&&process.nextTick(oe,this),i};function oe(n){var i=n._readableState;i.readableListening=n.listenerCount("readable")>0,i.resumeScheduled&&!i.paused?i.flowing=!0:n.listenerCount("data")>0&&n.resume()}function H(n){l("readable nexttick read 0"),n.read(0)}D.prototype.resume=function(){var n=this._readableState;return n.flowing||(l("resume"),n.flowing=!n.readableListening,ge(this,n)),n.paused=!1,this};function ge(n,i){i.resumeScheduled||(i.resumeScheduled=!0,process.nextTick(ye,n,i))}function ye(n,i){l("resume",i.reading),i.reading||n.read(0),i.resumeScheduled=!1,n.emit("resume"),c(n),i.flowing&&!i.reading&&n.read(0)}D.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function c(n){var i=n._readableState;for(l("flow",i.flowing);i.flowing&&n.read()!==null;);}D.prototype.wrap=function(n){var i=this,p=this._readableState,E=!1;n.on("end",function(){if(l("wrapped end"),p.decoder&&!p.ended){var k=p.decoder.end();k&&k.length&&i.push(k)}i.push(null)}),n.on("data",function(k){if(l("wrapped data"),p.decoder&&(k=p.decoder.write(k)),!(p.objectMode&&k==null)&&!(!p.objectMode&&(!k||!k.length))){var G=i.push(k);G||(E=!0,n.pause())}});for(var j in n)this[j]===void 0&&typeof n[j]=="function"&&(this[j]=function(G){return function(){return n[G].apply(n,arguments)}}(j));for(var x=0;x=i.length?(i.decoder?p=i.buffer.join(""):i.buffer.length===1?p=i.buffer.first():p=i.buffer.concat(i.length),i.buffer.clear()):p=i.buffer.consume(n,i.decoder),p}function v(n){var i=n._readableState;l("endReadable",i.endEmitted),i.endEmitted||(i.ended=!0,process.nextTick(C,i,n))}function C(n,i){if(l("endReadableNT",n.endEmitted,n.length),!n.endEmitted&&n.length===0&&(n.endEmitted=!0,i.readable=!1,i.emit("end"),n.autoDestroy)){var p=i._writableState;(!p||p.autoDestroy&&p.finished)&&i.destroy()}}typeof Symbol=="function"&&(D.from=function(n,i){return R===void 0&&(R=br()),R(D,n,i)});function P(n,i){for(var p=0,E=n.length;p0;return u(T,R,A,function(O){b||(b=O),O&&w.forEach(l),!R&&(w.forEach(l),S(b))})});return M.reduce(h)}return Ie=y,Ie}var xt=F,Ke=$e.EventEmitter,wr=J;wr(F,Ke);F.Readable=Ot();F.Writable=Mt();F.Duplex=X();F.Transform=Dt();F.PassThrough=gr();F.finished=Ge();F.pipeline=yr();F.Stream=F;function F(){Ke.call(this)}F.prototype.pipe=function(t,e){var r=this;function a(g){t.writable&&t.write(g)===!1&&r.pause&&r.pause()}r.on("data",a);function o(){r.readable&&r.resume&&r.resume()}t.on("drain",o),!t._isStdio&&(!e||e.end!==!1)&&(r.on("end",f),r.on("close",u));var s=!1;function f(){s||(s=!0,t.end())}function u(){s||(s=!0,typeof t.destroy=="function"&&t.destroy())}function l(g){if(h(),Ke.listenerCount(this,"error")===0)throw g}r.on("error",l),t.on("error",l);function h(){r.removeListener("data",a),t.removeListener("drain",o),r.removeListener("end",f),r.removeListener("close",u),r.removeListener("error",l),t.removeListener("error",l),r.removeListener("end",h),r.removeListener("close",h),t.removeListener("close",h)}return r.on("end",h),r.on("close",h),t.on("close",h),t.emit("pipe",r),t};function re(t){return t.replace(/%([0-9A-Fa-f]{2})/g,(e,r)=>String.fromCharCode(parseInt(r,16)))}function Pt(t,e){return String(e).replace(t,r=>`%${r.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0")}`)}function te(t){return Pt(/[\n;\r\t=%&,\x00-\x1f\x7f-\xff]/g,t)}function W(t){return Pt(/[\n\r\t%\x00-\x1f\x7f-\xff]/g,t)}function Nt(t){if(!(t&&t.length)||t===".")return{};const e={};return t.replace(/\r?\n$/,"").split(";").forEach(r=>{const a=r.split("=",2);if(!(a[1]&&a[1].length))return;a[0]=a[0].trim();let o=e[a[0].trim()];o||(o=[],e[a[0]]=o),o.push(...a[1].split(",").map(s=>s.trim()).map(re))}),e}function qt(t){const e=t.split(" ").map(a=>a==="."||a===""?null:a);return{seq_id:e[0]&&re(e[0]),source:e[1]&&re(e[1]),type:e[2]&&re(e[2]),start:e[3]===null?null:parseInt(e[3],10),end:e[4]===null?null:parseInt(e[4],10),score:e[5]===null?null:parseFloat(e[5]),strand:e[6],phase:e[7],attributes:e[8]===null?null:Nt(e[8])}}function kt(t){const e=/^\s*##\s*(\S+)\s*(.*)/.exec(t);if(!e)return null;const[,r]=e;let[,,a]=e;const o={directive:r};if(a.length&&(a=a.replace(/\r?\n$/,""),o.value=a),r==="sequence-region"){const s=a.split(/\s+/,3);return{...o,seq_id:s[0],start:s[1]&&s[1].replace(/\D/g,""),end:s[2]&&s[2].replace(/\D/g,"")}}else if(r==="genome-build"){const[s,f]=a.split(/\s+/,2);return{...o,source:s,buildName:f}}return o}function jt(t){const e=[];return Object.entries(t).forEach(([r,a])=>{if(!a)return;let o;a.hasOwnProperty("toString")?o=te(a.toString()):Array.isArray(a)?o=a.map(te).join(","):o=te(a),e.push(`${te(r)}=${o}`)}),e.length?e.join(";"):"."}function mr(t,e){const r=t.attributes===null||t.attributes===void 0?".":jt(t.attributes),o=`${[t.seq_id===null?".":W(t.seq_id),t.source===null?".":W(t.source),t.type===null?".":W(t.type),t.start===null?".":W(t.start),t.end===null?".":W(t.end),t.score===null?".":W(t.score),t.strand===null?".":W(t.strand),t.phase===null?".":W(t.phase),r].join(" ")} `;return e[o]?"":(e[o]=!0,o)}function le(t,e){if(Array.isArray(t))return t.map(a=>le(a,e)).join("");const r=[mr(t,e)];return Er(t)&&r.push(...t.child_features.map(a=>le(a,e)),...t.derived_features.map(a=>le(a,e))),r.join("")}function It(t){return le(t,{})}function Ft(t){let e=`##${t.directive}`;return t.value&&(e+=` ${t.value}`),e+=` `,e}function Bt(t){return`# ${t.comment} `}function Ye(t){return`>${t.id}${t.description?` ${t.description}`:""} diff --git a/playground/assets/index-CNXZc5nO.css b/playground/assets/index-kqcclp89.css similarity index 95% rename from playground/assets/index-CNXZc5nO.css rename to playground/assets/index-kqcclp89.css index 05433d7..db6da4d 100644 --- a/playground/assets/index-CNXZc5nO.css +++ b/playground/assets/index-kqcclp89.css @@ -1 +1 @@ -@import"https://fonts.googleapis.com/css?family=Medula+One&display=swap";.monaco-editor{font-family:-apple-system,BlinkMacSystemFont,Segoe WPC,Segoe UI,HelveticaNeue-Light,system-ui,Ubuntu,Droid Sans,sans-serif;--monaco-monospace-font: "SF Mono", Monaco, Menlo, Consolas, "Ubuntu Mono", "Liberation Mono", "DejaVu Sans Mono", "Courier New", monospace}.monaco-menu .monaco-action-bar.vertical .action-item .action-menu-item:focus .action-label{stroke-width:1.2px}.monaco-editor.vs-dark .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-editor.hc-black .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-editor.hc-light .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label{stroke-width:1.2px}.monaco-hover p{margin:0}.monaco-aria-container{position:absolute!important;top:0;height:1px;width:1px;margin:-1px;overflow:hidden;padding:0;clip:rect(1px,1px,1px,1px);clip-path:inset(50%)}.monaco-aria-container{position:absolute;left:-999em}::-ms-clear{display:none}.monaco-editor .editor-widget input{color:inherit}.monaco-editor{position:relative;overflow:visible;-webkit-text-size-adjust:100%;color:var(--vscode-editor-foreground);background-color:var(--vscode-editor-background)}.monaco-editor-background{background-color:var(--vscode-editor-background)}.monaco-editor .rangeHighlight{background-color:var(--vscode-editor-rangeHighlightBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-rangeHighlightBorder)}.monaco-editor.hc-black .rangeHighlight,.monaco-editor.hc-light .rangeHighlight{border-style:dotted}.monaco-editor .symbolHighlight{background-color:var(--vscode-editor-symbolHighlightBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-symbolHighlightBorder)}.monaco-editor.hc-black .symbolHighlight,.monaco-editor.hc-light .symbolHighlight{border-style:dotted}.monaco-editor .overflow-guard{position:relative;overflow:hidden}.monaco-editor .view-overlays{position:absolute;top:0}.monaco-editor .squiggly-error{border-bottom:4px double var(--vscode-editorError-border)}.monaco-editor .squiggly-error:before{display:block;content:"";width:100%;height:100%;background:var(--vscode-editorError-background)}.monaco-editor .squiggly-warning{border-bottom:4px double var(--vscode-editorWarning-border)}.monaco-editor .squiggly-warning:before{display:block;content:"";width:100%;height:100%;background:var(--vscode-editorWarning-background)}.monaco-editor .squiggly-info{border-bottom:4px double var(--vscode-editorInfo-border)}.monaco-editor .squiggly-info:before{display:block;content:"";width:100%;height:100%;background:var(--vscode-editorInfo-background)}.monaco-editor .squiggly-hint{border-bottom:2px dotted var(--vscode-editorHint-border)}.monaco-editor.showUnused .squiggly-unnecessary{border-bottom:2px dashed var(--vscode-editorUnnecessaryCode-border)}.monaco-editor.showDeprecated .squiggly-inline-deprecated{text-decoration:line-through;text-decoration-color:var(--vscode-editor-foreground, inherit)}.monaco-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.monaco-scrollable-element>.visible{opacity:1;background:#0000;transition:opacity .1s linear;z-index:11}.monaco-scrollable-element>.invisible{opacity:0;pointer-events:none}.monaco-scrollable-element>.invisible.fade{transition:opacity .8s linear}.monaco-scrollable-element>.shadow{position:absolute;display:none}.monaco-scrollable-element>.shadow.top{display:block;top:0;left:3px;height:3px;width:100%;box-shadow:var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset}.monaco-scrollable-element>.shadow.left{display:block;top:3px;left:0;height:100%;width:3px;box-shadow:var(--vscode-scrollbar-shadow) 6px 0 6px -6px inset}.monaco-scrollable-element>.shadow.top-left-corner{display:block;top:0;left:0;height:3px;width:3px}.monaco-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow) 6px 0 6px -6px inset}.monaco-scrollable-element>.scrollbar>.slider{background:var(--vscode-scrollbarSlider-background)}.monaco-scrollable-element>.scrollbar>.slider:hover{background:var(--vscode-scrollbarSlider-hoverBackground)}.monaco-scrollable-element>.scrollbar>.slider.active{background:var(--vscode-scrollbarSlider-activeBackground)}.monaco-editor .inputarea{min-width:0;min-height:0;margin:0;padding:0;position:absolute;outline:none!important;resize:none;border:none;overflow:hidden;color:transparent;background-color:transparent;z-index:-10}.monaco-editor .inputarea.ime-input{z-index:10;caret-color:var(--vscode-editorCursor-foreground);color:var(--vscode-editor-foreground)}.monaco-editor .margin-view-overlays .line-numbers{font-variant-numeric:tabular-nums;position:absolute;text-align:right;display:inline-block;vertical-align:middle;box-sizing:border-box;cursor:default;height:100%}.monaco-editor .relative-current-line-number{text-align:left;display:inline-block;width:100%}.monaco-editor .margin-view-overlays .line-numbers.lh-odd{margin-top:1px}.monaco-editor .line-numbers{color:var(--vscode-editorLineNumber-foreground)}.monaco-editor .line-numbers.active-line-number{color:var(--vscode-editorLineNumber-activeForeground)}.monaco-editor .margin{background-color:var(--vscode-editorGutter-background)}.monaco-mouse-cursor-text{cursor:text}.monaco-editor .view-overlays .current-line,.monaco-editor .margin-view-overlays .current-line{display:block;position:absolute;left:0;top:0;box-sizing:border-box}.monaco-editor .margin-view-overlays .current-line.current-line-margin.current-line-margin-both{border-right:0}.monaco-editor .lines-content .cdr{position:absolute}.monaco-editor .lines-content .core-guide{position:absolute;box-sizing:border-box}.mtkcontrol{color:#fff!important;background:#960000!important}.mtkoverflow{background-color:var(--vscode-button-background, var(--vscode-editor-background));color:var(--vscode-button-foreground, var(--vscode-editor-foreground));border-width:1px;border-style:solid;border-color:var(--vscode-contrastBorder);border-radius:2px;padding:4px;cursor:pointer}.mtkoverflow:hover{background-color:var(--vscode-button-hoverBackground)}.monaco-editor.no-user-select .lines-content,.monaco-editor.no-user-select .view-line,.monaco-editor.no-user-select .view-lines{user-select:none;-webkit-user-select:none}.monaco-editor.mac .lines-content:hover,.monaco-editor.mac .view-line:hover,.monaco-editor.mac .view-lines:hover{user-select:text;-webkit-user-select:text;-ms-user-select:text}.monaco-editor.enable-user-select{user-select:initial;-webkit-user-select:initial}.monaco-editor .view-lines{white-space:nowrap}.monaco-editor .view-line{position:absolute;width:100%}.monaco-editor .mtkw{color:var(--vscode-editorWhitespace-foreground)!important}.monaco-editor .mtkz{display:inline-block;color:var(--vscode-editorWhitespace-foreground)!important}.monaco-editor .lines-decorations{position:absolute;top:0;background:#fff}.monaco-editor .margin-view-overlays .cldr{position:absolute;height:100%}.monaco-editor .glyph-margin{position:absolute;top:0}.monaco-editor .glyph-margin-widgets .cgmr{position:absolute;display:flex;align-items:center;justify-content:center}.monaco-editor .glyph-margin-widgets .cgmr.codicon-modifier-spin:before{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.monaco-editor .margin-view-overlays .cmdr{position:absolute;left:0;width:100%;height:100%}.monaco-editor .minimap.slider-mouseover .minimap-slider{opacity:0;transition:opacity .1s linear}.monaco-editor .minimap.slider-mouseover:hover .minimap-slider,.monaco-editor .minimap.slider-mouseover .minimap-slider.active{opacity:1}.monaco-editor .minimap-slider .minimap-slider-horizontal{background:var(--vscode-minimapSlider-background)}.monaco-editor .minimap-slider:hover .minimap-slider-horizontal{background:var(--vscode-minimapSlider-hoverBackground)}.monaco-editor .minimap-slider.active .minimap-slider-horizontal{background:var(--vscode-minimapSlider-activeBackground)}.monaco-editor .minimap-shadow-visible{box-shadow:var(--vscode-scrollbar-shadow) -6px 0 6px -6px inset}.monaco-editor .minimap-shadow-hidden{position:absolute;width:0}.monaco-editor .minimap-shadow-visible{position:absolute;left:-6px;width:6px}.monaco-editor.no-minimap-shadow .minimap-shadow-visible{position:absolute;left:-1px;width:1px}.minimap.autohide{opacity:0;transition:opacity .5s}.minimap.autohide:hover{opacity:1}.monaco-editor .minimap{z-index:5}.monaco-editor .overlayWidgets{position:absolute;top:0;left:0}.monaco-editor .view-ruler{position:absolute;top:0;box-shadow:1px 0 0 0 var(--vscode-editorRuler-foreground) inset}.monaco-editor .scroll-decoration{position:absolute;top:0;left:0;height:6px;box-shadow:var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset}.monaco-editor .lines-content .cslr{position:absolute}.monaco-editor .focused .selected-text{background-color:var(--vscode-editor-selectionBackground)}.monaco-editor .selected-text{background-color:var(--vscode-editor-inactiveSelectionBackground)}.monaco-editor .top-left-radius{border-top-left-radius:3px}.monaco-editor .bottom-left-radius{border-bottom-left-radius:3px}.monaco-editor .top-right-radius{border-top-right-radius:3px}.monaco-editor .bottom-right-radius{border-bottom-right-radius:3px}.monaco-editor.hc-black .top-left-radius{border-top-left-radius:0}.monaco-editor.hc-black .bottom-left-radius{border-bottom-left-radius:0}.monaco-editor.hc-black .top-right-radius{border-top-right-radius:0}.monaco-editor.hc-black .bottom-right-radius{border-bottom-right-radius:0}.monaco-editor.hc-light .top-left-radius{border-top-left-radius:0}.monaco-editor.hc-light .bottom-left-radius{border-bottom-left-radius:0}.monaco-editor.hc-light .top-right-radius{border-top-right-radius:0}.monaco-editor.hc-light .bottom-right-radius{border-bottom-right-radius:0}.monaco-editor .cursors-layer{position:absolute;top:0}.monaco-editor .cursors-layer>.cursor{position:absolute;overflow:hidden;box-sizing:border-box}.monaco-editor .cursors-layer.cursor-smooth-caret-animation>.cursor{transition:all 80ms}.monaco-editor .cursors-layer.cursor-block-outline-style>.cursor{background:transparent!important;border-style:solid;border-width:1px}.monaco-editor .cursors-layer.cursor-underline-style>.cursor{border-bottom-width:2px;border-bottom-style:solid;background:transparent!important}.monaco-editor .cursors-layer.cursor-underline-thin-style>.cursor{border-bottom-width:1px;border-bottom-style:solid;background:transparent!important}@keyframes monaco-cursor-smooth{0%,20%{opacity:1}60%,to{opacity:0}}@keyframes monaco-cursor-phase{0%,20%{opacity:1}90%,to{opacity:0}}@keyframes monaco-cursor-expand{0%,20%{transform:scaleY(1)}80%,to{transform:scaleY(0)}}.cursor-smooth{animation:monaco-cursor-smooth .5s ease-in-out 0s 20 alternate}.cursor-phase{animation:monaco-cursor-phase .5s ease-in-out 0s 20 alternate}.cursor-expand>.cursor{animation:monaco-cursor-expand .5s ease-in-out 0s 20 alternate}.monaco-editor .blockDecorations-container{position:absolute;top:0;pointer-events:none}.monaco-editor .blockDecorations-block{position:absolute;box-sizing:border-box}.monaco-editor .mwh{position:absolute;color:var(--vscode-editorWhitespace-foreground)!important}.context-view{position:absolute}.context-view.fixed{all:initial;font-family:inherit;font-size:13px;position:fixed;color:inherit}.monaco-list{position:relative;height:100%;width:100%;white-space:nowrap}.monaco-list.mouse-support{user-select:none;-webkit-user-select:none}.monaco-list>.monaco-scrollable-element{height:100%}.monaco-list-rows{position:relative;width:100%;height:100%}.monaco-list.horizontal-scrolling .monaco-list-rows{width:auto;min-width:100%}.monaco-list-row{position:absolute;box-sizing:border-box;overflow:hidden;width:100%}.monaco-list.mouse-support .monaco-list-row{cursor:pointer;touch-action:none}.monaco-list-row.scrolling{display:none!important}.monaco-list.element-focused,.monaco-list.selection-single,.monaco-list.selection-multiple{outline:0!important}.monaco-drag-image{display:inline-block;padding:1px 7px;border-radius:10px;font-size:12px;position:absolute;z-index:1000}.monaco-list-type-filter-message{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;padding:40px 1em 1em;text-align:center;white-space:normal;opacity:.7;pointer-events:none}.monaco-list-type-filter-message:empty{display:none}.monaco-select-box-dropdown-padding{--dropdown-padding-top: 1px;--dropdown-padding-bottom: 1px}.hc-black .monaco-select-box-dropdown-padding,.hc-light .monaco-select-box-dropdown-padding{--dropdown-padding-top: 3px;--dropdown-padding-bottom: 4px}.monaco-select-box-dropdown-container{display:none;box-sizing:border-box}.monaco-select-box-dropdown-container>.select-box-details-pane>.select-box-description-markdown *{margin:0}.monaco-select-box-dropdown-container>.select-box-details-pane>.select-box-description-markdown a:focus{outline:1px solid -webkit-focus-ring-color;outline-offset:-1px}.monaco-select-box-dropdown-container>.select-box-details-pane>.select-box-description-markdown code{line-height:15px;font-family:var(--monaco-monospace-font)}.monaco-select-box-dropdown-container.visible{display:flex;flex-direction:column;text-align:left;width:1px;overflow:hidden;border-bottom-left-radius:3px;border-bottom-right-radius:3px}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container{flex:0 0 auto;align-self:flex-start;padding-top:var(--dropdown-padding-top);padding-bottom:var(--dropdown-padding-bottom);padding-left:1px;padding-right:1px;width:100%;overflow:hidden;box-sizing:border-box}.monaco-select-box-dropdown-container>.select-box-details-pane{padding:5px}.hc-black .monaco-select-box-dropdown-container>.select-box-dropdown-list-container{padding-top:var(--dropdown-padding-top);padding-bottom:var(--dropdown-padding-bottom)}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row{cursor:pointer}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.option-text{text-overflow:ellipsis;overflow:hidden;padding-left:3.5px;white-space:nowrap;float:left}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.option-detail{text-overflow:ellipsis;overflow:hidden;padding-left:3.5px;white-space:nowrap;float:left;opacity:.7}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.option-decorator-right{text-overflow:ellipsis;overflow:hidden;padding-right:10px;white-space:nowrap;float:right}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.visually-hidden{position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden}.monaco-select-box-dropdown-container>.select-box-dropdown-container-width-control{flex:1 1 auto;align-self:flex-start;opacity:0}.monaco-select-box-dropdown-container>.select-box-dropdown-container-width-control>.width-control-div{overflow:hidden;max-height:0px}.monaco-select-box-dropdown-container>.select-box-dropdown-container-width-control>.width-control-div>.option-text-width-control{padding-left:4px;padding-right:8px;white-space:nowrap}.monaco-select-box{width:100%;cursor:pointer;border-radius:2px}.monaco-select-box-dropdown-container{font-size:13px;font-weight:400;text-transform:none}.monaco-action-bar .action-item.select-container{cursor:default}.monaco-action-bar .action-item .monaco-select-box{cursor:pointer;min-width:100px;min-height:18px;padding:2px 23px 2px 8px}.mac .monaco-action-bar .action-item .monaco-select-box{font-size:11px;border-radius:5px}.monaco-action-bar{white-space:nowrap;height:100%}.monaco-action-bar .actions-container{display:flex;margin:0 auto;padding:0;height:100%;width:100%;align-items:center}.monaco-action-bar.vertical .actions-container{display:inline-block}.monaco-action-bar .action-item{display:block;align-items:center;justify-content:center;cursor:pointer;position:relative}.monaco-action-bar .action-item.disabled{cursor:default}.monaco-action-bar .action-item .icon,.monaco-action-bar .action-item .codicon{display:block}.monaco-action-bar .action-item .codicon{display:flex;align-items:center;width:16px;height:16px}.monaco-action-bar .action-label{display:flex;font-size:11px;padding:3px;border-radius:5px}.monaco-action-bar .action-item.disabled .action-label,.monaco-action-bar .action-item.disabled .action-label:before,.monaco-action-bar .action-item.disabled .action-label:hover{opacity:.6}.monaco-action-bar.vertical{text-align:left}.monaco-action-bar.vertical .action-item{display:block}.monaco-action-bar.vertical .action-label.separator{display:block;border-bottom:1px solid #bbb;padding-top:1px;margin-left:.8em;margin-right:.8em}.monaco-action-bar .action-item .action-label.separator{width:1px;height:16px;margin:5px 4px!important;cursor:default;min-width:1px;padding:0;background-color:#bbb}.secondary-actions .monaco-action-bar .action-label{margin-left:6px}.monaco-action-bar .action-item.select-container{overflow:hidden;flex:1;max-width:170px;min-width:60px;display:flex;align-items:center;justify-content:center;margin-right:10px}.monaco-action-bar .action-item.action-dropdown-item{display:flex}.monaco-action-bar .action-item.action-dropdown-item>.action-dropdown-item-separator{display:flex;align-items:center;cursor:default}.monaco-action-bar .action-item.action-dropdown-item>.action-dropdown-item-separator>div{width:1px}.monaco-dropdown{height:100%;padding:0}.monaco-dropdown>.dropdown-label{cursor:pointer;height:100%;display:flex;align-items:center;justify-content:center}.monaco-dropdown>.dropdown-label>.action-label.disabled{cursor:default}.monaco-dropdown-with-primary{display:flex!important;flex-direction:row;border-radius:5px}.monaco-dropdown-with-primary>.action-container>.action-label{margin-right:0}.monaco-dropdown-with-primary>.dropdown-action-container>.monaco-dropdown>.dropdown-label .codicon[class*=codicon-]{font-size:12px;padding-left:0;padding-right:0;line-height:16px;margin-left:-3px}.monaco-dropdown-with-primary>.dropdown-action-container>.monaco-dropdown>.dropdown-label>.action-label{display:block;background-size:16px;background-position:center center;background-repeat:no-repeat}.monaco-action-bar .action-item.menu-entry .action-label.icon{width:16px;height:16px;background-repeat:no-repeat;background-position:50%;background-size:16px}.monaco-dropdown-with-default{display:flex!important;flex-direction:row;border-radius:5px}.monaco-dropdown-with-default>.action-container>.action-label{margin-right:0}.monaco-dropdown-with-default>.action-container.menu-entry>.action-label.icon{width:16px;height:16px;background-repeat:no-repeat;background-position:50%;background-size:16px}.monaco-dropdown-with-default>.dropdown-action-container>.monaco-dropdown>.dropdown-label .codicon[class*=codicon-]{font-size:12px;padding-left:0;padding-right:0;line-height:16px;margin-left:-3px}.monaco-dropdown-with-default>.dropdown-action-container>.monaco-dropdown>.dropdown-label>.action-label{display:block;background-size:16px;background-position:center center;background-repeat:no-repeat}.quick-input-widget{font-size:13px}.quick-input-widget .monaco-highlighted-label .highlight{color:#0066bf}.vs .quick-input-widget .monaco-list-row.focused .monaco-highlighted-label .highlight{color:#9dddff}.vs-dark .quick-input-widget .monaco-highlighted-label .highlight{color:#0097fb}.hc-black .quick-input-widget .monaco-highlighted-label .highlight{color:#f38518}.hc-light .quick-input-widget .monaco-highlighted-label .highlight{color:#0f4a85}.monaco-keybinding>.monaco-keybinding-key{background-color:#ddd6;border:solid 1px rgba(204,204,204,.4);border-bottom-color:#bbb6;box-shadow:inset 0 -1px #bbb6;color:#555}.hc-black .monaco-keybinding>.monaco-keybinding-key{background-color:transparent;border:solid 1px rgb(111,195,223);box-shadow:none;color:#fff}.hc-light .monaco-keybinding>.monaco-keybinding-key{background-color:transparent;border:solid 1px #0F4A85;box-shadow:none;color:#292929}.vs-dark .monaco-keybinding>.monaco-keybinding-key{background-color:#8080802b;border:solid 1px rgba(51,51,51,.6);border-bottom-color:#4449;box-shadow:inset 0 -1px #4449;color:#ccc}:root{--vscode-sash-size: 4px;--vscode-sash-hover-size: 4px}.monaco-sash{position:absolute;z-index:35;touch-action:none}.monaco-sash.disabled{pointer-events:none}.monaco-sash.mac.vertical{cursor:col-resize}.monaco-sash.vertical.minimum{cursor:e-resize}.monaco-sash.vertical.maximum{cursor:w-resize}.monaco-sash.mac.horizontal{cursor:row-resize}.monaco-sash.horizontal.minimum{cursor:s-resize}.monaco-sash.horizontal.maximum{cursor:n-resize}.monaco-sash.disabled{cursor:default!important;pointer-events:none!important}.monaco-sash.vertical{cursor:ew-resize;top:0;width:var(--vscode-sash-size);height:100%}.monaco-sash.horizontal{cursor:ns-resize;left:0;width:100%;height:var(--vscode-sash-size)}.monaco-sash:not(.disabled)>.orthogonal-drag-handle{content:" ";height:calc(var(--vscode-sash-size) * 2);width:calc(var(--vscode-sash-size) * 2);z-index:100;display:block;cursor:all-scroll;position:absolute}.monaco-sash.horizontal.orthogonal-edge-north:not(.disabled)>.orthogonal-drag-handle.start,.monaco-sash.horizontal.orthogonal-edge-south:not(.disabled)>.orthogonal-drag-handle.end{cursor:nwse-resize}.monaco-sash.horizontal.orthogonal-edge-north:not(.disabled)>.orthogonal-drag-handle.end,.monaco-sash.horizontal.orthogonal-edge-south:not(.disabled)>.orthogonal-drag-handle.start{cursor:nesw-resize}.monaco-sash.vertical>.orthogonal-drag-handle.start{left:calc(var(--vscode-sash-size) * -.5);top:calc(var(--vscode-sash-size) * -1)}.monaco-sash.vertical>.orthogonal-drag-handle.end{left:calc(var(--vscode-sash-size) * -.5);bottom:calc(var(--vscode-sash-size) * -1)}.monaco-sash.horizontal>.orthogonal-drag-handle.start{top:calc(var(--vscode-sash-size) * -.5);left:calc(var(--vscode-sash-size) * -1)}.monaco-sash.horizontal>.orthogonal-drag-handle.end{top:calc(var(--vscode-sash-size) * -.5);right:calc(var(--vscode-sash-size) * -1)}.monaco-sash:before{content:"";pointer-events:none;position:absolute;width:100%;height:100%;background:transparent}.monaco-workbench:not(.reduce-motion) .monaco-sash:before{transition:background-color .1s ease-out}.monaco-sash.hover:before,.monaco-sash.active:before{background:var(--vscode-sash-hoverBorder)}.monaco-sash.vertical:before{width:var(--vscode-sash-hover-size);left:calc(50% - (var(--vscode-sash-hover-size) / 2))}.monaco-sash.horizontal:before{height:var(--vscode-sash-hover-size);top:calc(50% - (var(--vscode-sash-hover-size) / 2))}.pointer-events-disabled{pointer-events:none!important}.monaco-sash.debug{background:#0ff}.monaco-sash.debug.disabled{background:#0ff3}.monaco-sash.debug:not(.disabled)>.orthogonal-drag-handle{background:red}.monaco-split-view2{position:relative;width:100%;height:100%}.monaco-split-view2>.sash-container{position:absolute;width:100%;height:100%;pointer-events:none}.monaco-split-view2>.sash-container>.monaco-sash{pointer-events:initial}.monaco-split-view2>.monaco-scrollable-element{width:100%;height:100%}.monaco-split-view2>.monaco-scrollable-element>.split-view-container{width:100%;height:100%;white-space:nowrap;position:relative}.monaco-split-view2>.monaco-scrollable-element>.split-view-container>.split-view-view{white-space:initial;position:absolute}.monaco-split-view2>.monaco-scrollable-element>.split-view-container>.split-view-view:not(.visible){display:none}.monaco-split-view2.vertical>.monaco-scrollable-element>.split-view-container>.split-view-view{width:100%}.monaco-split-view2.horizontal>.monaco-scrollable-element>.split-view-container>.split-view-view{height:100%}.monaco-split-view2.separator-border>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{content:" ";position:absolute;top:0;left:0;z-index:5;pointer-events:none;background-color:var(--separator-border)}.monaco-split-view2.separator-border.horizontal>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{height:100%;width:1px}.monaco-split-view2.separator-border.vertical>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{height:1px;width:100%}.monaco-table{display:flex;flex-direction:column;position:relative;height:100%;width:100%;white-space:nowrap;overflow:hidden}.monaco-table>.monaco-split-view2{border-bottom:1px solid transparent}.monaco-table>.monaco-list{flex:1}.monaco-table-tr{display:flex;height:100%}.monaco-table-th{width:100%;height:100%;font-weight:700;overflow:hidden;text-overflow:ellipsis}.monaco-table-th,.monaco-table-td{box-sizing:border-box;flex-shrink:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.monaco-table>.monaco-split-view2 .monaco-sash.vertical:before{content:"";position:absolute;left:calc(var(--vscode-sash-size) / 2);width:0;border-left:1px solid transparent}.monaco-workbench:not(.reduce-motion) .monaco-table>.monaco-split-view2,.monaco-workbench:not(.reduce-motion) .monaco-table>.monaco-split-view2 .monaco-sash.vertical:before{transition:border-color .2s ease-out}.monaco-custom-toggle{margin-left:2px;float:left;cursor:pointer;overflow:hidden;width:20px;height:20px;border-radius:3px;border:1px solid transparent;padding:1px;box-sizing:border-box;user-select:none;-webkit-user-select:none}.monaco-custom-toggle:hover{background-color:var(--vscode-inputOption-hoverBackground)}.hc-black .monaco-custom-toggle:hover,.hc-light .monaco-custom-toggle:hover{border:1px dashed var(--vscode-focusBorder)}.hc-black .monaco-custom-toggle,.hc-light .monaco-custom-toggle,.hc-black .monaco-custom-toggle:hover,.hc-light .monaco-custom-toggle:hover{background:none}.monaco-custom-toggle.monaco-checkbox{height:18px;width:18px;border:1px solid transparent;border-radius:3px;margin-right:9px;margin-left:0;padding:0;opacity:1;background-size:16px!important}.monaco-custom-toggle.monaco-checkbox:not(.checked):before{visibility:hidden}.monaco-inputbox{position:relative;display:block;padding:0;box-sizing:border-box;border-radius:2px;font-size:inherit}.monaco-inputbox>.ibwrapper>.input,.monaco-inputbox>.ibwrapper>.mirror{padding:4px 6px}.monaco-inputbox>.ibwrapper{position:relative;width:100%;height:100%}.monaco-inputbox>.ibwrapper>.input{display:inline-block;box-sizing:border-box;width:100%;height:100%;line-height:inherit;border:none;font-family:inherit;font-size:inherit;resize:none;color:inherit}.monaco-inputbox>.ibwrapper>input{text-overflow:ellipsis}.monaco-inputbox>.ibwrapper>textarea.input{display:block;scrollbar-width:none;outline:none}.monaco-inputbox>.ibwrapper>textarea.input::-webkit-scrollbar{display:none}.monaco-inputbox>.ibwrapper>textarea.input.empty{white-space:nowrap}.monaco-inputbox>.ibwrapper>.mirror{position:absolute;display:inline-block;width:100%;top:0;left:0;box-sizing:border-box;white-space:pre-wrap;visibility:hidden;word-wrap:break-word}.monaco-inputbox-container{text-align:right}.monaco-inputbox-container .monaco-inputbox-message{display:inline-block;overflow:hidden;text-align:left;width:100%;box-sizing:border-box;padding:.4em;font-size:12px;line-height:17px;margin-top:-1px;word-wrap:break-word}.monaco-inputbox .monaco-action-bar{position:absolute;right:2px;top:4px}.monaco-inputbox .monaco-action-bar .action-item{margin-left:2px}.monaco-inputbox .monaco-action-bar .action-item .codicon{background-repeat:no-repeat;width:16px;height:16px}.monaco-findInput{position:relative}.monaco-findInput .monaco-inputbox{font-size:13px;width:100%}.monaco-findInput>.controls{position:absolute;top:3px;right:2px}.vs .monaco-findInput.disabled{background-color:#e1e1e1}.vs-dark .monaco-findInput.disabled{background-color:#333}.monaco-findInput.highlight-0 .controls,.hc-light .monaco-findInput.highlight-0 .controls{animation:monaco-findInput-highlight-0 .1s linear 0s}.monaco-findInput.highlight-1 .controls,.hc-light .monaco-findInput.highlight-1 .controls{animation:monaco-findInput-highlight-1 .1s linear 0s}.hc-black .monaco-findInput.highlight-0 .controls,.vs-dark .monaco-findInput.highlight-0 .controls{animation:monaco-findInput-highlight-dark-0 .1s linear 0s}.hc-black .monaco-findInput.highlight-1 .controls,.vs-dark .monaco-findInput.highlight-1 .controls{animation:monaco-findInput-highlight-dark-1 .1s linear 0s}@keyframes monaco-findInput-highlight-0{0%{background:#fdff00cc}to{background:transparent}}@keyframes monaco-findInput-highlight-1{0%{background:#fdff00cc}99%{background:transparent}}@keyframes monaco-findInput-highlight-dark-0{0%{background:#ffffff70}to{background:transparent}}@keyframes monaco-findInput-highlight-dark-1{0%{background:#ffffff70}99%{background:transparent}}.monaco-tl-row{display:flex;height:100%;align-items:center;position:relative}.monaco-tl-row.disabled{cursor:default}.monaco-tl-indent{height:100%;position:absolute;top:0;left:16px;pointer-events:none}.hide-arrows .monaco-tl-indent{left:12px}.monaco-tl-indent>.indent-guide{display:inline-block;box-sizing:border-box;height:100%;border-left:1px solid transparent}.monaco-workbench:not(.reduce-motion) .monaco-tl-indent>.indent-guide{transition:border-color .1s linear}.monaco-tl-twistie,.monaco-tl-contents{height:100%}.monaco-tl-twistie{font-size:10px;text-align:right;padding-right:6px;flex-shrink:0;width:16px;display:flex!important;align-items:center;justify-content:center;transform:translate(3px)}.monaco-tl-contents{flex:1;overflow:hidden}.monaco-tl-twistie:before{border-radius:20px}.monaco-tl-twistie.collapsed:before{transform:rotate(-90deg)}.monaco-tl-twistie.codicon-tree-item-loading:before{animation:codicon-spin 1.25s steps(30) infinite}.monaco-tree-type-filter{position:absolute;top:0;display:flex;padding:3px;max-width:200px;z-index:100;margin:0 6px;border:1px solid var(--vscode-widget-border);border-bottom-left-radius:4px;border-bottom-right-radius:4px}.monaco-workbench:not(.reduce-motion) .monaco-tree-type-filter{transition:top .3s}.monaco-tree-type-filter.disabled{top:-40px!important}.monaco-tree-type-filter-grab{display:flex!important;align-items:center;justify-content:center;cursor:grab;margin-right:2px}.monaco-tree-type-filter-grab.grabbing{cursor:grabbing}.monaco-tree-type-filter-input{flex:1}.monaco-tree-type-filter-input .monaco-inputbox{height:23px}.monaco-tree-type-filter-input .monaco-inputbox>.ibwrapper>.input,.monaco-tree-type-filter-input .monaco-inputbox>.ibwrapper>.mirror{padding:2px 4px}.monaco-tree-type-filter-input .monaco-findInput>.controls{top:2px}.monaco-tree-type-filter-actionbar{margin-left:4px}.monaco-tree-type-filter-actionbar .monaco-action-bar .action-label{padding:2px}.monaco-text-button{box-sizing:border-box;display:flex;width:100%;padding:4px;border-radius:2px;text-align:center;cursor:pointer;justify-content:center;align-items:center;border:1px solid var(--vscode-button-border, transparent);line-height:18px}.monaco-text-button:focus{outline-offset:2px!important}.monaco-text-button:hover{text-decoration:none!important}.monaco-button.disabled:focus,.monaco-button.disabled{opacity:.4!important;cursor:default}.monaco-text-button .codicon{margin:0 .2em;color:inherit!important}.monaco-text-button.monaco-text-button-with-short-label{flex-direction:row;flex-wrap:wrap;padding:0 4px;overflow:hidden;height:28px}.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label{flex-basis:100%}.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label-short{flex-grow:1;width:0;overflow:hidden}.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label,.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label-short{display:flex;justify-content:center;align-items:center;font-weight:400;font-style:inherit;padding:4px 0}.monaco-button-dropdown{display:flex;cursor:pointer}.monaco-button-dropdown.disabled{cursor:default}.monaco-button-dropdown>.monaco-button:focus{outline-offset:-1px!important}.monaco-button-dropdown.disabled>.monaco-button.disabled,.monaco-button-dropdown.disabled>.monaco-button.disabled:focus,.monaco-button-dropdown.disabled>.monaco-button-dropdown-separator{opacity:.4!important}.monaco-button-dropdown>.monaco-button.monaco-text-button{border-right-width:0!important}.monaco-button-dropdown .monaco-button-dropdown-separator{padding:4px 0;cursor:default}.monaco-button-dropdown .monaco-button-dropdown-separator>div{height:100%;width:1px}.monaco-button-dropdown>.monaco-button.monaco-dropdown-button{border:1px solid var(--vscode-button-border, transparent);border-left-width:0!important;border-radius:0 2px 2px 0}.monaco-button-dropdown>.monaco-button.monaco-text-button{border-radius:2px 0 0 2px}.monaco-description-button{display:flex;flex-direction:column;align-items:center;margin:4px 5px}.monaco-description-button .monaco-button-description{font-style:italic;font-size:11px;padding:4px 20px}.monaco-description-button .monaco-button-label,.monaco-description-button .monaco-button-description{display:flex;justify-content:center;align-items:center}.monaco-description-button .monaco-button-label>.codicon,.monaco-description-button .monaco-button-description>.codicon{margin:0 .2em;color:inherit!important}.monaco-button.default-colors,.monaco-button-dropdown.default-colors>.monaco-button{color:var(--vscode-button-foreground);background-color:var(--vscode-button-background)}.monaco-button.default-colors:hover,.monaco-button-dropdown.default-colors>.monaco-button:hover{background-color:var(--vscode-button-hoverBackground)}.monaco-button.default-colors.secondary,.monaco-button-dropdown.default-colors>.monaco-button.secondary{color:var(--vscode-button-secondaryForeground);background-color:var(--vscode-button-secondaryBackground)}.monaco-button.default-colors.secondary:hover,.monaco-button-dropdown.default-colors>.monaco-button.secondary:hover{background-color:var(--vscode-button-secondaryHoverBackground)}.monaco-button-dropdown.default-colors .monaco-button-dropdown-separator{background-color:var(--vscode-button-background);border-top:1px solid var(--vscode-button-border);border-bottom:1px solid var(--vscode-button-border)}.monaco-button-dropdown.default-colors .monaco-button.secondary+.monaco-button-dropdown-separator{background-color:var(--vscode-button-secondaryBackground)}.monaco-button-dropdown.default-colors .monaco-button-dropdown-separator>div{background-color:var(--vscode-button-separator)}.monaco-count-badge{padding:3px 6px;border-radius:11px;font-size:11px;min-width:18px;min-height:18px;line-height:11px;font-weight:400;text-align:center;display:inline-block;box-sizing:border-box}.monaco-count-badge.long{padding:2px 3px;border-radius:2px;min-height:auto;line-height:normal}.monaco-progress-container{width:100%;height:5px;overflow:hidden}.monaco-progress-container .progress-bit{width:2%;height:5px;position:absolute;left:0;display:none}.monaco-progress-container.active .progress-bit{display:inherit}.monaco-progress-container.discrete .progress-bit{left:0;transition:width .1s linear}.monaco-progress-container.discrete.done .progress-bit{width:100%}.monaco-progress-container.infinite .progress-bit{animation-name:progress;animation-duration:4s;animation-iteration-count:infinite;transform:translateZ(0);animation-timing-function:linear}.monaco-progress-container.infinite.infinite-long-running .progress-bit{animation-timing-function:steps(100)}@keyframes progress{0%{transform:translate(0) scaleX(1)}50%{transform:translate(2500%) scaleX(3)}to{transform:translate(4900%) scaleX(1)}}.quick-input-widget{position:absolute;width:600px;z-index:2550;left:50%;margin-left:-300px;-webkit-app-region:no-drag;border-radius:6px}.quick-input-titlebar{display:flex;align-items:center;border-top-left-radius:5px;border-top-right-radius:5px}.quick-input-left-action-bar{display:flex;margin-left:4px;flex:1}.quick-input-title{padding:3px 0;text-align:center;text-overflow:ellipsis;overflow:hidden}.quick-input-right-action-bar{display:flex;margin-right:4px;flex:1}.quick-input-right-action-bar>.actions-container{justify-content:flex-end}.quick-input-titlebar .monaco-action-bar .action-label.codicon{background-position:center;background-repeat:no-repeat;padding:2px}.quick-input-description{margin:6px 6px 6px 11px}.quick-input-header .quick-input-description{margin:4px 2px;flex:1}.quick-input-header{display:flex;padding:8px 6px 6px}.quick-input-widget.hidden-input .quick-input-header{padding:0;margin-bottom:0}.quick-input-and-message{display:flex;flex-direction:column;flex-grow:1;min-width:0;position:relative}.quick-input-check-all{align-self:center;margin:0}.quick-input-filter{flex-grow:1;display:flex;position:relative}.quick-input-box{flex-grow:1}.quick-input-widget.show-checkboxes .quick-input-box,.quick-input-widget.show-checkboxes .quick-input-message{margin-left:5px}.quick-input-visible-count{position:absolute;left:-10000px}.quick-input-count{align-self:center;position:absolute;right:4px;display:flex;align-items:center}.quick-input-count .monaco-count-badge{vertical-align:middle;padding:2px 4px;border-radius:2px;min-height:auto;line-height:normal}.quick-input-action{margin-left:6px}.quick-input-action .monaco-text-button{font-size:11px;padding:0 6px;display:flex;height:25px;align-items:center}.quick-input-message{margin-top:-1px;padding:5px;overflow-wrap:break-word}.quick-input-message>.codicon{margin:0 .2em;vertical-align:text-bottom}.quick-input-message a{color:inherit}.quick-input-progress.monaco-progress-container{position:relative}.quick-input-progress.monaco-progress-container,.quick-input-progress.monaco-progress-container .progress-bit{height:2px}.quick-input-list{line-height:22px}.quick-input-widget.hidden-input .quick-input-list{margin-top:4px;padding-bottom:4px}.quick-input-list .monaco-list{overflow:hidden;max-height:440px;padding-bottom:5px}.quick-input-list .monaco-scrollable-element{padding:0 5px}.quick-input-list .quick-input-list-entry{box-sizing:border-box;overflow:hidden;display:flex;height:100%;padding:0 6px}.quick-input-list .quick-input-list-entry.quick-input-list-separator-border{border-top-width:1px;border-top-style:solid}.quick-input-list .monaco-list-row{border-radius:3px}.quick-input-list .monaco-list-row[data-index="0"] .quick-input-list-entry.quick-input-list-separator-border{border-top-style:none}.quick-input-list .quick-input-list-label{overflow:hidden;display:flex;height:100%;flex:1}.quick-input-list .quick-input-list-checkbox{align-self:center;margin:0}.quick-input-list .quick-input-list-icon{background-size:16px;background-position:left center;background-repeat:no-repeat;padding-right:6px;width:16px;height:22px;display:flex;align-items:center;justify-content:center}.quick-input-list .quick-input-list-rows{overflow:hidden;text-overflow:ellipsis;display:flex;flex-direction:column;height:100%;flex:1;margin-left:5px}.quick-input-widget.show-checkboxes .quick-input-list .quick-input-list-rows{margin-left:10px}.quick-input-widget .quick-input-list .quick-input-list-checkbox{display:none}.quick-input-widget.show-checkboxes .quick-input-list .quick-input-list-checkbox{display:inline}.quick-input-list .quick-input-list-rows>.quick-input-list-row{display:flex;align-items:center}.quick-input-list .quick-input-list-rows>.quick-input-list-row .monaco-icon-label,.quick-input-list .quick-input-list-rows>.quick-input-list-row .monaco-icon-label .monaco-icon-label-container>.monaco-icon-name-container{flex:1}.quick-input-list .quick-input-list-rows>.quick-input-list-row .codicon[class*=codicon-]{vertical-align:text-bottom}.quick-input-list .quick-input-list-rows .monaco-highlighted-label>span{opacity:1}.quick-input-list .quick-input-list-entry .quick-input-list-entry-keybinding{margin-right:8px}.quick-input-list .quick-input-list-label-meta{opacity:.7;line-height:normal;text-overflow:ellipsis;overflow:hidden}.quick-input-list .monaco-highlighted-label .highlight{font-weight:700}.quick-input-list .quick-input-list-entry .quick-input-list-separator{margin-right:4px}.quick-input-list .quick-input-list-entry-action-bar{display:flex;flex:0;overflow:visible}.quick-input-list .quick-input-list-entry-action-bar .action-label{display:none}.quick-input-list .quick-input-list-entry-action-bar .action-label.codicon{margin-right:4px;padding:0 2px 2px}.quick-input-list .quick-input-list-entry-action-bar{margin-top:1px}.quick-input-list .quick-input-list-entry-action-bar{margin-right:4px}.quick-input-list .quick-input-list-entry .quick-input-list-entry-action-bar .action-label.always-visible,.quick-input-list .quick-input-list-entry:hover .quick-input-list-entry-action-bar .action-label,.quick-input-list .monaco-list-row.focused .quick-input-list-entry-action-bar .action-label{display:flex}.quick-input-list .monaco-list-row.focused .monaco-keybinding-key,.quick-input-list .monaco-list-row.focused .quick-input-list-entry .quick-input-list-separator{color:inherit}.quick-input-list .monaco-list-row.focused .monaco-keybinding-key{background:none}.quick-input-list .quick-input-list-separator-as-item{font-weight:600;font-size:12px}.monaco-icon-label{display:flex;overflow:hidden;text-overflow:ellipsis}.monaco-icon-label:before{background-size:16px;background-position:left center;background-repeat:no-repeat;padding-right:6px;width:16px;height:22px;line-height:inherit!important;display:inline-block;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:top;flex-shrink:0}.monaco-icon-label-container.disabled{color:var(--vscode-disabledForeground)}.monaco-icon-label>.monaco-icon-label-container{min-width:0;overflow:hidden;text-overflow:ellipsis;flex:1}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-name-container>.label-name{color:inherit;white-space:pre}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-name-container>.label-name>.label-separator{margin:0 2px;opacity:.5}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{opacity:.7;margin-left:.5em;font-size:.9em;white-space:pre}.monaco-icon-label.nowrap>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{white-space:nowrap}.vs .monaco-icon-label>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{opacity:.95}.monaco-icon-label.italic>.monaco-icon-label-container>.monaco-icon-name-container>.label-name,.monaco-icon-label.italic>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{font-style:italic}.monaco-icon-label.deprecated{text-decoration:line-through;opacity:.66}.monaco-icon-label.italic:after{font-style:italic}.monaco-icon-label.strikethrough>.monaco-icon-label-container>.monaco-icon-name-container>.label-name,.monaco-icon-label.strikethrough>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{text-decoration:line-through}.monaco-icon-label:after{opacity:.75;font-size:90%;font-weight:600;margin:auto 16px 0 5px;text-align:center}.monaco-list:focus .selected .monaco-icon-label,.monaco-list:focus .selected .monaco-icon-label:after{color:inherit!important}.monaco-list-row.focused.selected .label-description,.monaco-list-row.selected .label-description{opacity:.8}.monaco-keybinding{display:flex;align-items:center;line-height:10px}.monaco-keybinding>.monaco-keybinding-key{display:inline-block;border-style:solid;border-width:1px;border-radius:3px;vertical-align:middle;font-size:11px;padding:3px 5px;margin:0 2px}.monaco-keybinding>.monaco-keybinding-key:first-child{margin-left:0}.monaco-keybinding>.monaco-keybinding-key:last-child{margin-right:0}.monaco-keybinding>.monaco-keybinding-key-separator{display:inline-block}.monaco-keybinding>.monaco-keybinding-key-chord-separator{width:6px}.monaco-editor .diff-hidden-lines-widget{width:100%}.monaco-editor .diff-hidden-lines{height:0px;transform:translateY(-10px);font-size:13px;line-height:14px}.monaco-editor .diff-hidden-lines:not(.dragging) .top:hover,.monaco-editor .diff-hidden-lines:not(.dragging) .bottom:hover,.monaco-editor .diff-hidden-lines .top.dragging,.monaco-editor .diff-hidden-lines .bottom.dragging{background-color:var(--vscode-focusBorder)}.monaco-editor .diff-hidden-lines .top,.monaco-editor .diff-hidden-lines .bottom{transition:background-color .1s ease-out;height:4px;background-color:transparent;background-clip:padding-box;border-bottom:2px solid transparent;border-top:4px solid transparent;cursor:ns-resize}.monaco-editor .diff-hidden-lines .top{transform:translateY(4px)}.monaco-editor .diff-hidden-lines .bottom{transform:translateY(-6px)}.monaco-editor .diff-unchanged-lines{background:var(--vscode-diffEditor-unchangedCodeBackground)}.monaco-editor .noModificationsOverlay{z-index:1;background:var(--vscode-editor-background);display:flex;justify-content:center;align-items:center}.monaco-editor .diff-hidden-lines .center{background:var(--vscode-diffEditor-unchangedRegionBackground);color:var(--vscode-diffEditor-unchangedRegionForeground);overflow:hidden;display:block;text-overflow:ellipsis;white-space:nowrap;height:24px}.monaco-editor .diff-hidden-lines .center span.codicon{vertical-align:middle}.monaco-editor .diff-hidden-lines .center a:hover .codicon{cursor:pointer;color:var(--vscode-editorLink-activeForeground)!important}.monaco-editor .diff-hidden-lines div.breadcrumb-item{cursor:pointer}.monaco-editor .diff-hidden-lines div.breadcrumb-item:hover{color:var(--vscode-editorLink-activeForeground)}.monaco-editor .movedOriginal,.monaco-editor .movedModified{border:2px solid var(--vscode-diffEditor-move-border)}.monaco-editor .movedOriginal.currentMove,.monaco-editor .movedModified.currentMove{border:2px solid var(--vscode-diffEditor-moveActive-border)}.monaco-diff-editor .moved-blocks-lines path.currentMove{stroke:var(--vscode-diffEditor-moveActive-border)}.monaco-diff-editor .moved-blocks-lines path{pointer-events:visiblestroke}.monaco-diff-editor .moved-blocks-lines .arrow{fill:var(--vscode-diffEditor-move-border)}.monaco-diff-editor .moved-blocks-lines .arrow.currentMove{fill:var(--vscode-diffEditor-moveActive-border)}.monaco-diff-editor .moved-blocks-lines .arrow-rectangle{fill:var(--vscode-editor-background)}.monaco-diff-editor .moved-blocks-lines{position:absolute;pointer-events:none}.monaco-diff-editor .moved-blocks-lines path{fill:none;stroke:var(--vscode-diffEditor-move-border);stroke-width:2}.monaco-editor .char-delete.diff-range-empty{margin-left:-1px;border-left:solid var(--vscode-diffEditor-removedTextBackground) 3px}.monaco-editor .char-insert.diff-range-empty{border-left:solid var(--vscode-diffEditor-insertedTextBackground) 3px}.monaco-editor .fold-unchanged{cursor:pointer}.monaco-diff-editor .diff-moved-code-block{display:flex;justify-content:flex-end;margin-top:-4px}.monaco-diff-editor .diff-moved-code-block .action-bar .action-label.codicon{width:12px;height:12px;font-size:12px}.monaco-diff-editor .diffOverview{z-index:9}.monaco-diff-editor .diffOverview .diffViewport{z-index:10}.monaco-diff-editor.vs .diffOverview{background:#00000008}.monaco-diff-editor.vs-dark .diffOverview{background:#ffffff03}.monaco-scrollable-element.modified-in-monaco-diff-editor.vs .scrollbar,.monaco-scrollable-element.modified-in-monaco-diff-editor.vs-dark .scrollbar{background:#0000}.monaco-scrollable-element.modified-in-monaco-diff-editor.hc-black .scrollbar,.monaco-scrollable-element.modified-in-monaco-diff-editor.hc-light .scrollbar{background:none}.monaco-scrollable-element.modified-in-monaco-diff-editor .slider{z-index:10}.modified-in-monaco-diff-editor .slider.active{background:#ababab66}.modified-in-monaco-diff-editor.hc-black .slider.active,.modified-in-monaco-diff-editor.hc-light .slider.active{background:none}.monaco-editor .insert-sign,.monaco-diff-editor .insert-sign,.monaco-editor .delete-sign,.monaco-diff-editor .delete-sign{font-size:11px!important;opacity:.7!important;display:flex!important;align-items:center}.monaco-editor.hc-black .insert-sign,.monaco-diff-editor.hc-black .insert-sign,.monaco-editor.hc-black .delete-sign,.monaco-diff-editor.hc-black .delete-sign,.monaco-editor.hc-light .insert-sign,.monaco-diff-editor.hc-light .insert-sign,.monaco-editor.hc-light .delete-sign,.monaco-diff-editor.hc-light .delete-sign{opacity:1}.monaco-editor .inline-deleted-margin-view-zone,.monaco-editor .inline-added-margin-view-zone{text-align:right}.monaco-editor .arrow-revert-change{z-index:10;position:absolute}.monaco-editor .arrow-revert-change:hover{cursor:pointer}.monaco-editor .view-zones .view-lines .view-line span{display:inline-block}.monaco-editor .margin-view-zones .lightbulb-glyph:hover{cursor:pointer}.monaco-editor .char-insert,.monaco-diff-editor .char-insert{background-color:var(--vscode-diffEditor-insertedTextBackground)}.monaco-editor .line-insert,.monaco-diff-editor .line-insert{background-color:var(--vscode-diffEditor-insertedLineBackground, var(--vscode-diffEditor-insertedTextBackground))}.monaco-editor .line-insert,.monaco-editor .char-insert{box-sizing:border-box;border:1px solid var(--vscode-diffEditor-insertedTextBorder)}.monaco-editor.hc-black .line-insert,.monaco-editor.hc-light .line-insert,.monaco-editor.hc-black .char-insert,.monaco-editor.hc-light .char-insert{border-style:dashed}.monaco-editor .line-delete,.monaco-editor .char-delete{box-sizing:border-box;border:1px solid var(--vscode-diffEditor-removedTextBorder)}.monaco-editor.hc-black .line-delete,.monaco-editor.hc-light .line-delete,.monaco-editor.hc-black .char-delete,.monaco-editor.hc-light .char-delete{border-style:dashed}.monaco-editor .inline-added-margin-view-zone,.monaco-editor .gutter-insert,.monaco-diff-editor .gutter-insert{background-color:var(--vscode-diffEditorGutter-insertedLineBackground, var(--vscode-diffEditor-insertedLineBackground), var(--vscode-diffEditor-insertedTextBackground))}.monaco-editor .char-delete,.monaco-diff-editor .char-delete{background-color:var(--vscode-diffEditor-removedTextBackground)}.monaco-editor .line-delete,.monaco-diff-editor .line-delete{background-color:var(--vscode-diffEditor-removedLineBackground, var(--vscode-diffEditor-removedTextBackground))}.monaco-editor .inline-deleted-margin-view-zone,.monaco-editor .gutter-delete,.monaco-diff-editor .gutter-delete{background-color:var(--vscode-diffEditorGutter-removedLineBackground, var(--vscode-diffEditor-removedLineBackground), var(--vscode-diffEditor-removedTextBackground))}.monaco-diff-editor.side-by-side .editor.modified{box-shadow:-6px 0 5px -5px var(--vscode-scrollbar-shadow);border-left:1px solid var(--vscode-diffEditor-border)}.monaco-diff-editor .diffViewport{background:var(--vscode-scrollbarSlider-background)}.monaco-diff-editor .diffViewport:hover{background:var(--vscode-scrollbarSlider-hoverBackground)}.monaco-diff-editor .diffViewport:active{background:var(--vscode-scrollbarSlider-activeBackground)}.monaco-editor .diagonal-fill{background-image:linear-gradient(-45deg,var(--vscode-diffEditor-diagonalFill) 12.5%,#0000 12.5%,#0000 50%,var(--vscode-diffEditor-diagonalFill) 50%,var(--vscode-diffEditor-diagonalFill) 62.5%,#0000 62.5%,#0000 100%);background-size:8px 8px}.monaco-diff-editor .diff-review-line-number{text-align:right;display:inline-block;color:var(--vscode-editorLineNumber-foreground)}.monaco-diff-editor .diff-review{position:absolute;user-select:none;-webkit-user-select:none;z-index:99}.monaco-diff-editor .diff-review-summary{padding-left:10px}.monaco-diff-editor .diff-review-shadow{position:absolute;box-shadow:var(--vscode-scrollbar-shadow) 0 -6px 6px -6px inset}.monaco-diff-editor .diff-review-row{white-space:pre}.monaco-diff-editor .diff-review-table{display:table;min-width:100%}.monaco-diff-editor .diff-review-row{display:table-row;width:100%}.monaco-diff-editor .diff-review-spacer{display:inline-block;width:10px;vertical-align:middle}.monaco-diff-editor .diff-review-spacer>.codicon{font-size:9px!important}.monaco-diff-editor .diff-review-actions{display:inline-block;position:absolute;right:10px;top:2px;z-index:100}.monaco-diff-editor .diff-review-actions .action-label{width:16px;height:16px;margin:2px 0}.monaco-editor .margin-view-overlays .codicon-folding-manual-collapsed,.monaco-editor .margin-view-overlays .codicon-folding-manual-expanded,.monaco-editor .margin-view-overlays .codicon-folding-expanded,.monaco-editor .margin-view-overlays .codicon-folding-collapsed{cursor:pointer;opacity:0;transition:opacity .5s;display:flex;align-items:center;justify-content:center;font-size:140%;margin-left:2px}.monaco-workbench.reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-manual-collapsed,.monaco-workbench.reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-manual-expanded,.monaco-workbench.reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-expanded,.monaco-workbench.reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-collapsed{transition:initial}.monaco-editor .margin-view-overlays:hover .codicon,.monaco-editor .margin-view-overlays .codicon.codicon-folding-collapsed,.monaco-editor .margin-view-overlays .codicon.codicon-folding-manual-collapsed,.monaco-editor .margin-view-overlays .codicon.alwaysShowFoldIcons{opacity:1}.monaco-editor .inline-folded:after{color:gray;margin:.1em .2em 0;content:"⋯";display:inline;line-height:1em;cursor:pointer}.monaco-editor .folded-background{background-color:var(--vscode-editor-foldBackground)}.monaco-editor .cldr.codicon.codicon-folding-expanded,.monaco-editor .cldr.codicon.codicon-folding-collapsed,.monaco-editor .cldr.codicon.codicon-folding-manual-expanded,.monaco-editor .cldr.codicon.codicon-folding-manual-collapsed{color:var(--vscode-editorGutter-foldingControlForeground)!important}.monaco-editor .findOptionsWidget{background-color:var(--vscode-editorWidget-background);color:var(--vscode-editorWidget-foreground);box-shadow:0 0 8px 2px var(--vscode-widget-shadow);border:2px solid var(--vscode-contrastBorder)}.monaco-editor .find-widget{position:absolute;z-index:35;height:33px;overflow:hidden;line-height:19px;transition:transform .2s linear;padding:0 4px;box-sizing:border-box;transform:translateY(calc(-100% - 10px));border-bottom-left-radius:4px;border-bottom-right-radius:4px}.monaco-workbench.reduce-motion .monaco-editor .find-widget{transition:transform 0ms linear}.monaco-editor .find-widget textarea{margin:0}.monaco-editor .find-widget.hiddenEditor{display:none}.monaco-editor .find-widget.replaceToggled>.replace-part{display:flex}.monaco-editor .find-widget.visible{transform:translateY(0)}.monaco-editor .find-widget .monaco-inputbox.synthetic-focus{outline:1px solid -webkit-focus-ring-color;outline-offset:-1px}.monaco-editor .find-widget .monaco-inputbox .input{background-color:transparent;min-height:0}.monaco-editor .find-widget .monaco-findInput .input{font-size:13px}.monaco-editor .find-widget>.find-part,.monaco-editor .find-widget>.replace-part{margin:3px 25px 0 17px;font-size:12px;display:flex}.monaco-editor .find-widget>.find-part .monaco-inputbox,.monaco-editor .find-widget>.replace-part .monaco-inputbox{min-height:25px}.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.mirror{padding-right:22px}.monaco-editor .find-widget>.find-part .monaco-inputbox>.ibwrapper>.input,.monaco-editor .find-widget>.find-part .monaco-inputbox>.ibwrapper>.mirror,.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.input,.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.mirror{padding-top:2px;padding-bottom:2px}.monaco-editor .find-widget>.find-part .find-actions{height:25px;display:flex;align-items:center}.monaco-editor .find-widget>.replace-part .replace-actions{height:25px;display:flex;align-items:center}.monaco-editor .find-widget .monaco-findInput{vertical-align:middle;display:flex;flex:1}.monaco-editor .find-widget .monaco-findInput .monaco-scrollable-element{width:100%}.monaco-editor .find-widget .monaco-findInput .monaco-scrollable-element .scrollbar.vertical{opacity:0}.monaco-editor .find-widget .matchesCount{display:flex;flex:initial;margin:0 0 0 3px;padding:2px 0 0 2px;height:25px;vertical-align:middle;box-sizing:border-box;text-align:center;line-height:23px}.monaco-editor .find-widget .button{width:16px;height:16px;padding:3px;border-radius:5px;flex:initial;margin-left:3px;background-position:center center;background-repeat:no-repeat;cursor:pointer;display:flex;align-items:center;justify-content:center}.monaco-editor .find-widget .codicon-find-selection{width:22px;height:22px;padding:3px;border-radius:5px}.monaco-editor .find-widget .button.left{margin-left:0;margin-right:3px}.monaco-editor .find-widget .button.wide{width:auto;padding:1px 6px;top:-1px}.monaco-editor .find-widget .button.toggle{position:absolute;top:0;left:3px;width:18px;height:100%;border-radius:0;box-sizing:border-box}.monaco-editor .find-widget .button.toggle.disabled{display:none}.monaco-editor .find-widget .disabled{color:var(--vscode-disabledForeground);cursor:default}.monaco-editor .find-widget>.replace-part{display:none}.monaco-editor .find-widget>.replace-part>.monaco-findInput{position:relative;display:flex;vertical-align:middle;flex:auto;flex-grow:0;flex-shrink:0}.monaco-editor .find-widget>.replace-part>.monaco-findInput>.controls{position:absolute;top:3px;right:2px}.monaco-editor .find-widget.reduced-find-widget .matchesCount{display:none}.monaco-editor .find-widget.narrow-find-widget{max-width:257px!important}.monaco-editor .find-widget.collapsed-find-widget{max-width:170px!important}.monaco-editor .find-widget.collapsed-find-widget .button.previous,.monaco-editor .find-widget.collapsed-find-widget .button.next,.monaco-editor .find-widget.collapsed-find-widget .button.replace,.monaco-editor .find-widget.collapsed-find-widget .button.replace-all,.monaco-editor .find-widget.collapsed-find-widget>.find-part .monaco-findInput .controls{display:none}.monaco-editor .findMatch{animation-duration:0;animation-name:inherit!important}.monaco-editor .find-widget .monaco-sash{left:0!important}.monaco-editor.hc-black .find-widget .button:before{position:relative;top:1px;left:2px}.monaco-editor .find-widget>.button.codicon-widget-close{position:absolute;top:5px;right:4px}.monaco-editor .focused .selectionHighlight{background-color:var(--vscode-editor-selectionHighlightBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-selectionHighlightBorder)}.monaco-editor.hc-black .focused .selectionHighlight,.monaco-editor.hc-light .focused .selectionHighlight{border-style:dotted}.monaco-editor .wordHighlight{background-color:var(--vscode-editor-wordHighlightBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-wordHighlightBorder)}.monaco-editor.hc-black .wordHighlight,.monaco-editor.hc-light .wordHighlight{border-style:dotted}.monaco-editor .wordHighlightStrong{background-color:var(--vscode-editor-wordHighlightStrongBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-wordHighlightStrongBorder)}.monaco-editor.hc-black .wordHighlightStrong,.monaco-editor.hc-light .wordHighlightStrong{border-style:dotted}.monaco-editor .wordHighlightText{background-color:var(--vscode-editor-wordHighlightTextBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-wordHighlightTextBorder)}.monaco-editor.hc-black .wordHighlightText,.monaco-editor.hc-light .wordHighlightText{border-style:dotted}.monaco-editor .bracket-match{box-sizing:border-box;background-color:var(--vscode-editorBracketMatch-background);border:1px solid var(--vscode-editorBracketMatch-border)}.monaco-editor .goto-definition-link{text-decoration:underline;cursor:pointer;color:var(--vscode-editorLink-activeForeground)!important}.monaco-editor .peekview-widget .head{box-sizing:border-box;display:flex;justify-content:space-between;flex-wrap:nowrap}.monaco-editor .peekview-widget .head .peekview-title{display:flex;align-items:baseline;font-size:13px;margin-left:20px;min-width:0;text-overflow:ellipsis;overflow:hidden}.monaco-editor .peekview-widget .head .peekview-title.clickable{cursor:pointer}.monaco-editor .peekview-widget .head .peekview-title .dirname:not(:empty){font-size:.9em;margin-left:.5em}.monaco-editor .peekview-widget .head .peekview-title .meta{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.monaco-editor .peekview-widget .head .peekview-title .dirname,.monaco-editor .peekview-widget .head .peekview-title .filename{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-editor .peekview-widget .head .peekview-title .meta:not(:empty):before{content:"-";padding:0 .3em}.monaco-editor .peekview-widget .head .peekview-actions{flex:1;text-align:right;padding-right:2px}.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar{display:inline-block}.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar,.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar>.actions-container{height:100%}.monaco-editor .peekview-widget>.body{border-top:1px solid;position:relative}.monaco-editor .peekview-widget .head .peekview-title .codicon{margin-right:4px;align-self:center}.monaco-editor .peekview-widget .monaco-list .monaco-list-row.focused .codicon{color:inherit!important}.monaco-editor .zone-widget{position:absolute;z-index:10}.monaco-editor .zone-widget .zone-widget-container{border-top-style:solid;border-bottom-style:solid;border-top-width:0;border-bottom-width:0;position:relative}.monaco-editor .zone-widget .zone-widget-container.reference-zone-widget{border-top-width:1px;border-bottom-width:1px}.monaco-editor .reference-zone-widget .inline{display:inline-block;vertical-align:top}.monaco-editor .reference-zone-widget .messages{height:100%;width:100%;text-align:center;padding:3em 0}.monaco-editor .reference-zone-widget .ref-tree{line-height:23px;background-color:var(--vscode-peekViewResult-background);color:var(--vscode-peekViewResult-lineForeground)}.monaco-editor .reference-zone-widget .ref-tree .reference{text-overflow:ellipsis;overflow:hidden}.monaco-editor .reference-zone-widget .ref-tree .reference-file{display:inline-flex;width:100%;height:100%;color:var(--vscode-peekViewResult-fileForeground)}.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .selected .reference-file{color:inherit!important}.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .monaco-list-rows>.monaco-list-row.selected:not(.highlighted){background-color:var(--vscode-peekViewResult-selectionBackground);color:var(--vscode-peekViewResult-selectionForeground)!important}.monaco-editor .reference-zone-widget .ref-tree .reference-file .count{margin-right:12px;margin-left:auto}.monaco-editor .reference-zone-widget .ref-tree .referenceMatch .highlight{background-color:var(--vscode-peekViewResult-matchHighlightBackground)}.monaco-editor .reference-zone-widget .preview .reference-decoration{background-color:var(--vscode-peekViewEditor-matchHighlightBackground);border:2px solid var(--vscode-peekViewEditor-matchHighlightBorder);box-sizing:border-box}.monaco-editor .reference-zone-widget .preview .monaco-editor .monaco-editor-background,.monaco-editor .reference-zone-widget .preview .monaco-editor .inputarea.ime-input{background-color:var(--vscode-peekViewEditor-background)}.monaco-editor .reference-zone-widget .preview .monaco-editor .margin{background-color:var(--vscode-peekViewEditorGutter-background)}.monaco-editor.hc-black .reference-zone-widget .ref-tree .reference-file,.monaco-editor.hc-light .reference-zone-widget .ref-tree .reference-file{font-weight:700}.monaco-editor.hc-black .reference-zone-widget .ref-tree .referenceMatch .highlight,.monaco-editor.hc-light .reference-zone-widget .ref-tree .referenceMatch .highlight{border:1px dotted var(--vscode-contrastActiveBorder, transparent);box-sizing:border-box}.monaco-editor .monaco-editor-overlaymessage{padding-bottom:8px;z-index:10000}.monaco-editor .monaco-editor-overlaymessage.below{padding-bottom:0;padding-top:8px;z-index:10000}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.monaco-editor .monaco-editor-overlaymessage.fadeIn{animation:fadeIn .15s ease-out}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}.monaco-editor .monaco-editor-overlaymessage.fadeOut{animation:fadeOut .1s ease-out}.monaco-editor .monaco-editor-overlaymessage .message{padding:2px 4px;color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-inputValidation-infoBorder);border-radius:3px}.monaco-editor .monaco-editor-overlaymessage .message p{margin-block:0px}.monaco-editor .monaco-editor-overlaymessage .message a{color:var(--vscode-textLink-foreground)}.monaco-editor .monaco-editor-overlaymessage .message a:hover{color:var(--vscode-textLink-activeForeground)}.monaco-editor.hc-black .monaco-editor-overlaymessage .message,.monaco-editor.hc-light .monaco-editor-overlaymessage .message{border-width:2px}.monaco-editor .monaco-editor-overlaymessage .anchor{width:0!important;height:0!important;border-color:transparent;border-style:solid;z-index:1000;border-width:8px;position:absolute;left:2px}.monaco-editor .monaco-editor-overlaymessage .anchor.top{border-bottom-color:var(--vscode-inputValidation-infoBorder)}.monaco-editor .monaco-editor-overlaymessage .anchor.below{border-top-color:var(--vscode-inputValidation-infoBorder)}.monaco-editor .monaco-editor-overlaymessage:not(.below) .anchor.top,.monaco-editor .monaco-editor-overlaymessage.below .anchor.below{display:none}.monaco-editor .monaco-editor-overlaymessage.below .anchor.top{display:inherit;top:-8px}.monaco-editor .rendered-markdown kbd{background-color:var(--vscode-keybindingLabel-background);color:var(--vscode-keybindingLabel-foreground);border-style:solid;border-width:1px;border-radius:3px;border-color:var(--vscode-keybindingLabel-border);border-bottom-color:var(--vscode-keybindingLabel-bottomBorder);box-shadow:inset 0 -1px 0 var(--vscode-widget-shadow);vertical-align:middle;padding:1px 3px}.monaco-hover{cursor:default;position:absolute;overflow:hidden;user-select:text;-webkit-user-select:text;box-sizing:border-box;animation:fadein .1s linear;line-height:1.5em;white-space:var(--vscode-hover-whiteSpace, normal)}.monaco-hover.hidden{display:none}.monaco-hover a:hover:not(.disabled){cursor:pointer}.monaco-hover .hover-contents:not(.html-hover-contents){padding:4px 8px}.monaco-hover .markdown-hover>.hover-contents:not(.code-hover-contents){max-width:var(--vscode-hover-maxWidth, 500px);word-wrap:break-word}.monaco-hover .markdown-hover>.hover-contents:not(.code-hover-contents) hr{min-width:100%}.monaco-hover p,.monaco-hover .code,.monaco-hover ul,.monaco-hover h1,.monaco-hover h2,.monaco-hover h3,.monaco-hover h4,.monaco-hover h5,.monaco-hover h6{margin:8px 0}.monaco-hover h1,.monaco-hover h2,.monaco-hover h3,.monaco-hover h4,.monaco-hover h5,.monaco-hover h6{line-height:1.1}.monaco-hover code{font-family:var(--monaco-monospace-font)}.monaco-hover hr{box-sizing:border-box;border-left:0px;border-right:0px;margin:4px -8px -4px;height:1px}.monaco-hover p:first-child,.monaco-hover .code:first-child,.monaco-hover ul:first-child{margin-top:0}.monaco-hover p:last-child,.monaco-hover .code:last-child,.monaco-hover ul:last-child{margin-bottom:0}.monaco-hover ul,.monaco-hover ol{padding-left:20px}.monaco-hover li>p{margin-bottom:0}.monaco-hover li>ul{margin-top:0}.monaco-hover code{border-radius:3px;padding:0 .4em}.monaco-hover .monaco-tokenized-source{white-space:var(--vscode-hover-sourceWhiteSpace, pre-wrap)}.monaco-hover .hover-row.status-bar{font-size:12px;line-height:22px}.monaco-hover .hover-row.status-bar .info{font-style:italic;padding:0 8px}.monaco-hover .hover-row.status-bar .actions{display:flex;padding:0 8px}.monaco-hover .hover-row.status-bar .actions .action-container{margin-right:16px;cursor:pointer}.monaco-hover .hover-row.status-bar .actions .action-container .action .icon{padding-right:4px}.monaco-hover .markdown-hover .hover-contents .codicon{color:inherit;font-size:inherit;vertical-align:middle}.monaco-hover .hover-contents a.code-link:hover,.monaco-hover .hover-contents a.code-link{color:inherit}.monaco-hover .hover-contents a.code-link:before{content:"("}.monaco-hover .hover-contents a.code-link:after{content:")"}.monaco-hover .hover-contents a.code-link>span{text-decoration:underline;border-bottom:1px solid transparent;text-underline-position:under;color:var(--vscode-textLink-foreground)}.monaco-hover .hover-contents a.code-link>span:hover{color:var(--vscode-textLink-activeForeground)}.monaco-hover .markdown-hover .hover-contents:not(.code-hover-contents):not(.html-hover-contents) span{margin-bottom:4px;display:inline-block}.monaco-hover-content .action-container a{-webkit-user-select:none;user-select:none}.monaco-hover-content .action-container.disabled{pointer-events:none;opacity:.4;cursor:default}@font-face{font-family:codicon;font-display:block;src:url(./codicon-BuT2v_Yt.ttf) format("truetype")}.codicon[class*=codicon-]{font: 16px/1 codicon;display:inline-block;text-decoration:none;text-rendering:auto;text-align:center;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;user-select:none;-webkit-user-select:none}.codicon-wrench-subaction{opacity:.5}@keyframes codicon-spin{to{transform:rotate(360deg)}}.codicon-sync.codicon-modifier-spin,.codicon-loading.codicon-modifier-spin,.codicon-gear.codicon-modifier-spin,.codicon-notebook-state-executing.codicon-modifier-spin{animation:codicon-spin 1.5s steps(30) infinite}.codicon-modifier-disabled{opacity:.4}.codicon-loading,.codicon-tree-item-loading:before{animation-duration:1s!important;animation-timing-function:cubic-bezier(.53,.21,.29,.67)!important}.monaco-editor .codicon.codicon-symbol-array,.monaco-workbench .codicon.codicon-symbol-array{color:var(--vscode-symbolIcon-arrayForeground)}.monaco-editor .codicon.codicon-symbol-boolean,.monaco-workbench .codicon.codicon-symbol-boolean{color:var(--vscode-symbolIcon-booleanForeground)}.monaco-editor .codicon.codicon-symbol-class,.monaco-workbench .codicon.codicon-symbol-class{color:var(--vscode-symbolIcon-classForeground)}.monaco-editor .codicon.codicon-symbol-method,.monaco-workbench .codicon.codicon-symbol-method{color:var(--vscode-symbolIcon-methodForeground)}.monaco-editor .codicon.codicon-symbol-color,.monaco-workbench .codicon.codicon-symbol-color{color:var(--vscode-symbolIcon-colorForeground)}.monaco-editor .codicon.codicon-symbol-constant,.monaco-workbench .codicon.codicon-symbol-constant{color:var(--vscode-symbolIcon-constantForeground)}.monaco-editor .codicon.codicon-symbol-constructor,.monaco-workbench .codicon.codicon-symbol-constructor{color:var(--vscode-symbolIcon-constructorForeground)}.monaco-editor .codicon.codicon-symbol-value,.monaco-workbench .codicon.codicon-symbol-value,.monaco-editor .codicon.codicon-symbol-enum,.monaco-workbench .codicon.codicon-symbol-enum{color:var(--vscode-symbolIcon-enumeratorForeground)}.monaco-editor .codicon.codicon-symbol-enum-member,.monaco-workbench .codicon.codicon-symbol-enum-member{color:var(--vscode-symbolIcon-enumeratorMemberForeground)}.monaco-editor .codicon.codicon-symbol-event,.monaco-workbench .codicon.codicon-symbol-event{color:var(--vscode-symbolIcon-eventForeground)}.monaco-editor .codicon.codicon-symbol-field,.monaco-workbench .codicon.codicon-symbol-field{color:var(--vscode-symbolIcon-fieldForeground)}.monaco-editor .codicon.codicon-symbol-file,.monaco-workbench .codicon.codicon-symbol-file{color:var(--vscode-symbolIcon-fileForeground)}.monaco-editor .codicon.codicon-symbol-folder,.monaco-workbench .codicon.codicon-symbol-folder{color:var(--vscode-symbolIcon-folderForeground)}.monaco-editor .codicon.codicon-symbol-function,.monaco-workbench .codicon.codicon-symbol-function{color:var(--vscode-symbolIcon-functionForeground)}.monaco-editor .codicon.codicon-symbol-interface,.monaco-workbench .codicon.codicon-symbol-interface{color:var(--vscode-symbolIcon-interfaceForeground)}.monaco-editor .codicon.codicon-symbol-key,.monaco-workbench .codicon.codicon-symbol-key{color:var(--vscode-symbolIcon-keyForeground)}.monaco-editor .codicon.codicon-symbol-keyword,.monaco-workbench .codicon.codicon-symbol-keyword{color:var(--vscode-symbolIcon-keywordForeground)}.monaco-editor .codicon.codicon-symbol-module,.monaco-workbench .codicon.codicon-symbol-module{color:var(--vscode-symbolIcon-moduleForeground)}.monaco-editor .codicon.codicon-symbol-namespace,.monaco-workbench .codicon.codicon-symbol-namespace{color:var(--vscode-symbolIcon-namespaceForeground)}.monaco-editor .codicon.codicon-symbol-null,.monaco-workbench .codicon.codicon-symbol-null{color:var(--vscode-symbolIcon-nullForeground)}.monaco-editor .codicon.codicon-symbol-number,.monaco-workbench .codicon.codicon-symbol-number{color:var(--vscode-symbolIcon-numberForeground)}.monaco-editor .codicon.codicon-symbol-object,.monaco-workbench .codicon.codicon-symbol-object{color:var(--vscode-symbolIcon-objectForeground)}.monaco-editor .codicon.codicon-symbol-operator,.monaco-workbench .codicon.codicon-symbol-operator{color:var(--vscode-symbolIcon-operatorForeground)}.monaco-editor .codicon.codicon-symbol-package,.monaco-workbench .codicon.codicon-symbol-package{color:var(--vscode-symbolIcon-packageForeground)}.monaco-editor .codicon.codicon-symbol-property,.monaco-workbench .codicon.codicon-symbol-property{color:var(--vscode-symbolIcon-propertyForeground)}.monaco-editor .codicon.codicon-symbol-reference,.monaco-workbench .codicon.codicon-symbol-reference{color:var(--vscode-symbolIcon-referenceForeground)}.monaco-editor .codicon.codicon-symbol-snippet,.monaco-workbench .codicon.codicon-symbol-snippet{color:var(--vscode-symbolIcon-snippetForeground)}.monaco-editor .codicon.codicon-symbol-string,.monaco-workbench .codicon.codicon-symbol-string{color:var(--vscode-symbolIcon-stringForeground)}.monaco-editor .codicon.codicon-symbol-struct,.monaco-workbench .codicon.codicon-symbol-struct{color:var(--vscode-symbolIcon-structForeground)}.monaco-editor .codicon.codicon-symbol-text,.monaco-workbench .codicon.codicon-symbol-text{color:var(--vscode-symbolIcon-textForeground)}.monaco-editor .codicon.codicon-symbol-type-parameter,.monaco-workbench .codicon.codicon-symbol-type-parameter{color:var(--vscode-symbolIcon-typeParameterForeground)}.monaco-editor .codicon.codicon-symbol-unit,.monaco-workbench .codicon.codicon-symbol-unit{color:var(--vscode-symbolIcon-unitForeground)}.monaco-editor .codicon.codicon-symbol-variable,.monaco-workbench .codicon.codicon-symbol-variable{color:var(--vscode-symbolIcon-variableForeground)}.monaco-editor .lightBulbWidget{display:flex;align-items:center;justify-content:center}.monaco-editor .lightBulbWidget:hover{cursor:pointer}.monaco-editor .lightBulbWidget.codicon-light-bulb{color:var(--vscode-editorLightBulb-foreground)}.monaco-editor .lightBulbWidget.codicon-lightbulb-autofix{color:var(--vscode-editorLightBulbAutoFix-foreground, var(--vscode-editorLightBulb-foreground))}.monaco-editor .lightBulbWidget:before{position:relative;z-index:2}.monaco-editor .lightBulbWidget:after{position:absolute;top:0;left:0;content:"";display:block;width:100%;height:100%;opacity:.3;background-color:var(--vscode-editor-background);z-index:1}.action-widget{font-size:13px;min-width:160px;max-width:80vw;z-index:40;display:block;width:100%;border:1px solid var(--vscode-editorWidget-border)!important;border-radius:2px;background-color:var(--vscode-editorWidget-background);color:var(--vscode-editorWidget-foreground)}.context-view-block{position:fixed;cursor:initial;left:0;top:0;width:100%;height:100%;z-index:-1}.context-view-pointerBlock{position:fixed;cursor:initial;left:0;top:0;width:100%;height:100%;z-index:2}.action-widget .monaco-list{user-select:none;-webkit-user-select:none;border:none!important;border-width:0!important}.action-widget .monaco-list:focus:before{outline:0!important}.action-widget .monaco-list .monaco-scrollable-element{overflow:visible}.action-widget .monaco-list .monaco-list-row{padding:0 10px;white-space:nowrap;cursor:pointer;touch-action:none;width:100%}.action-widget .monaco-list .monaco-list-row.action.focused:not(.option-disabled){background-color:var(--vscode-quickInputList-focusBackground)!important;color:var(--vscode-quickInputList-focusForeground);outline:1px solid var(--vscode-menu-selectionBorder, transparent);outline-offset:-1px}.action-widget .monaco-list-row.group-header{color:var(--vscode-descriptionForeground)!important;font-weight:600}.action-widget .monaco-list .group-header,.action-widget .monaco-list .option-disabled,.action-widget .monaco-list .option-disabled:before,.action-widget .monaco-list .option-disabled .focused,.action-widget .monaco-list .option-disabled .focused:before{cursor:default!important;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;background-color:transparent!important;outline:0 solid!important}.action-widget .monaco-list-row.action{display:flex;gap:6px;align-items:center}.action-widget .monaco-list-row.action.option-disabled,.action-widget .monaco-list:focus .monaco-list-row.focused.action.option-disabled,.action-widget .monaco-list-row.action.option-disabled .codicon,.action-widget .monaco-list:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused).option-disabled{color:var(--vscode-disabledForeground)}.action-widget .monaco-list-row.action:not(.option-disabled) .codicon{color:inherit}.action-widget .monaco-list-row.action .title{flex:1;overflow:hidden;text-overflow:ellipsis}.action-widget .action-widget-action-bar{background-color:var(--vscode-editorHoverWidget-statusBarBackground);border-top:1px solid var(--vscode-editorHoverWidget-border)}.action-widget .action-widget-action-bar:before{display:block;content:"";width:100%}.action-widget .action-widget-action-bar .actions-container{padding:0 8px}.action-widget-action-bar .action-label{color:var(--vscode-textLink-activeForeground);font-size:12px;line-height:22px;padding:0;pointer-events:all}.action-widget-action-bar .action-item{margin-right:16px;pointer-events:none}.action-widget-action-bar .action-label:hover{background-color:transparent!important}.monaco-action-bar .actions-container.highlight-toggled .action-label.checked{background:var(--vscode-actionBar-toggledBackground)!important}.monaco-editor .peekview-widget .head .peekview-title .severity-icon{display:inline-block;vertical-align:text-top;margin-right:4px}.monaco-editor .marker-widget{text-overflow:ellipsis;white-space:nowrap}.monaco-editor .marker-widget>.stale{opacity:.6;font-style:italic}.monaco-editor .marker-widget .title{display:inline-block;padding-right:5px}.monaco-editor .marker-widget .descriptioncontainer{position:absolute;white-space:pre;user-select:text;-webkit-user-select:text;padding:8px 12px 0 20px}.monaco-editor .marker-widget .descriptioncontainer .message{display:flex;flex-direction:column}.monaco-editor .marker-widget .descriptioncontainer .message .details{padding-left:6px}.monaco-editor .marker-widget .descriptioncontainer .message .source,.monaco-editor .marker-widget .descriptioncontainer .message span.code{opacity:.6}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link{opacity:.6;color:inherit}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link:before{content:"("}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link:after{content:")"}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link>span{text-decoration:underline;border-bottom:1px solid transparent;text-underline-position:under;color:var(--vscode-textLink-foreground)}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link>span{color:var(--vscode-textLink-activeForeground)}.monaco-editor .marker-widget .descriptioncontainer .filename{cursor:pointer}.monaco-editor .zone-widget .codicon.codicon-error,.markers-panel .marker-icon.error,.markers-panel .marker-icon .codicon.codicon-error,.text-search-provider-messages .providerMessage .codicon.codicon-error,.extensions-viewlet>.extensions .codicon.codicon-error,.extension-editor .codicon.codicon-error,.preferences-editor .codicon.codicon-error{color:var(--vscode-problemsErrorIcon-foreground)}.monaco-editor .zone-widget .codicon.codicon-warning,.markers-panel .marker-icon.warning,.markers-panel .marker-icon .codicon.codicon-warning,.text-search-provider-messages .providerMessage .codicon.codicon-warning,.extensions-viewlet>.extensions .codicon.codicon-warning,.extension-editor .codicon.codicon-warning,.preferences-editor .codicon.codicon-warning{color:var(--vscode-problemsWarningIcon-foreground)}.monaco-editor .zone-widget .codicon.codicon-info,.markers-panel .marker-icon.info,.markers-panel .marker-icon .codicon.codicon-info,.text-search-provider-messages .providerMessage .codicon.codicon-info,.extensions-viewlet>.extensions .codicon.codicon-info,.extension-editor .codicon.codicon-info,.preferences-editor .codicon.codicon-info{color:var(--vscode-problemsInfoIcon-foreground)}.monaco-editor .inlineSuggestionsHints.withBorder{z-index:39;color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border)}.monaco-editor .inlineSuggestionsHints a,.monaco-editor .inlineSuggestionsHints a:hover{color:var(--vscode-foreground)}.monaco-editor .inlineSuggestionsHints .keybinding{display:flex;margin-left:4px;opacity:.6}.monaco-editor .inlineSuggestionsHints .keybinding .monaco-keybinding-key{font-size:8px;padding:2px 3px}.monaco-editor .inlineSuggestionsHints .availableSuggestionCount a{display:flex;min-width:19px;justify-content:center}.monaco-editor .inlineSuggestionStatusBarItemLabel{margin-right:2px}.monaco-toolbar{height:100%}.monaco-toolbar .toolbar-toggle-more{display:inline-block;padding:0}.monaco-editor .hoverHighlight{background-color:var(--vscode-editor-hoverHighlightBackground)}.monaco-editor .monaco-hover{color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border);border-radius:3px}.monaco-editor .monaco-hover a{color:var(--vscode-textLink-foreground)}.monaco-editor .monaco-hover a:hover{color:var(--vscode-textLink-activeForeground)}.monaco-editor .monaco-hover .hover-row .actions{background-color:var(--vscode-editorHoverWidget-statusBarBackground)}.monaco-editor .monaco-hover code{background-color:var(--vscode-textCodeBlock-background)}body{margin:0;padding:0;font-family:sans-serif}#playground-layout{display:grid;height:100vh}#playground-layout.parallel{grid-template-columns:1fr 1fr;grid-template-rows:46px 2fr 1fr;grid-template-areas:"toolbar toolbar" "editor genome-spy" "files genome-spy"}#playground-layout.stacked{grid-template-rows:46px 1fr 1fr;grid-template-columns:1fr 500px;grid-template-areas:"toolbar toolbar" "genome-spy genome-spy" "editor files"}#playground-layout.full{grid-template-rows:46px 1fr;grid-template-areas:"toolbar" "genome-spy"}#playground-layout>*{position:relative}@media (max-width: 600px){#playground-layout.parallel,#playground-layout.stacked{grid-template-rows:46px 1fr 1fr;grid-template-columns:1fr;grid-template-areas:"toolbar" "genome-spy" "editor"}#playground-layout #file-pane{display:none}}#editor-pane{grid-area:editor;min-width:0;min-height:0}.full #editor-pane{display:none}#editor-pane>code-editor{position:absolute;top:0;right:0;bottom:0;left:0}#genome-spy-pane{grid-area:genome-spy;position:relative}.stacked #genome-spy-pane{border-bottom:1px solid lightgray}.parallel #genome-spy-pane{border-left:1px solid lightgray}#genome-spy-pane>div{position:absolute;top:0;right:0;bottom:0;left:0;overflow:hidden}#file-pane{grid-area:files;padding:10px}.stacked #file-pane{border-left:1px solid lightgray}.parallel #file-pane{border-top:1px solid lightgray}.full #file-pane{display:none}.toolbar{grid-area:toolbar;background-color:#548fcc;color:#fff;box-shadow:0 0 6px #0006;display:flex;align-items:center}.toolbar a,.toolbar button,.toolbar span{text-shadow:0 1px 2px rgba(0,0,0,.2)}.toolbar .genome-spy-icon img{display:block;height:40px;transform:rotate(0);transition:.5s ease-in-out}.toolbar .genome-spy-icon img:hover{transform:rotate(360deg)}.toolbar>*{margin-left:10px;display:block;flex-shrink:0}.toolbar>:last-child{margin-right:10px}.toolbar>.vis-title{flex-grow:1;flex-shrink:1;font-style:italic;font-size:85%}.toolbar .tool-button{display:flex;align-items:center;color:#fff;font-size:16px;border:none;background-color:#548fcc;padding-left:10px;padding-right:10px;height:100%}.toolbar .tool-button:hover{background-color:#689cd2}.toolbar .tool-button:focus{outline:none}.toolbar .tool-button svg{font-size:120%}.toolbar .tool-button>:not(:first-child){margin-left:.5em}.toolbar .tool-button:active{box-shadow:inset 0 3px 3px #0000001a}.toolbar .tool-button:active>*{position:relative;top:1px}.toolbar a{text-decoration:none}.toolbar .title{font-family:Medula One,cursive;font-size:30px;margin-right:10px}.toolbar .version{font-size:85%}@media (max-width: 600px){.toolbar .hide-mobile{display:none}}ul.tabs{display:flex;margin:0 0 10px;padding:0;font-size:13px}ul.tabs li{display:block;margin:0;padding:5px 10px;border-bottom:2px solid #eee}ul.tabs li.selected{border-bottom-color:#ccc;background-color:#eee}ul.tabs a{color:#000;text-decoration:none}.tab-pages>div{font-size:.9rem;display:none;overflow:auto}.tab-pages>div.selected{display:block}.stacked .tab-pages>div{height:calc(50vh - 80px)}.parallel .tab-pages>div{height:25vh}.data-sample-table{font-size:11px;border-collapse:collapse}.data-sample-table td,.data-sample-table th{text-align:left;border-top:1px solid #ddd;border-bottom:1px solid #ddd;padding:5px}.missing-files{border:1px solid orange;border-radius:.5em;padding:.8em}.missing-files>:first-child{margin-top:0}.missing-files>:last-child{margin-bottom:0}.missing-files ul{font-family:monospace;padding-left:2em}.upload-form #upload-button-wrapper{display:flex;align-items:center;justify-content:center;height:70px}.upload-form p{color:#444}.upload-form pre{background-color:#f8f8f8;padding:10px}.btn{background-color:#548fcc;padding:8px 1em;color:#fff;border:0;border-radius:3px;font-weight:700;font-size:13px}.btn:hover{background-color:#6097d0}.btn:focus{outline:none;box-shadow:0 0 4px #0af}.btn:active{padding-top:9px;padding-bottom:7px;box-shadow:0 0 4px #0af,inset 0 3px 3px #0003} +@import"https://fonts.googleapis.com/css?family=Medula+One&display=swap";.monaco-editor{font-family:-apple-system,BlinkMacSystemFont,Segoe WPC,Segoe UI,HelveticaNeue-Light,system-ui,Ubuntu,Droid Sans,sans-serif;--monaco-monospace-font: "SF Mono", Monaco, Menlo, Consolas, "Ubuntu Mono", "Liberation Mono", "DejaVu Sans Mono", "Courier New", monospace}.monaco-menu .monaco-action-bar.vertical .action-item .action-menu-item:focus .action-label{stroke-width:1.2px}.monaco-editor.vs-dark .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-editor.hc-black .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label,.monaco-editor.hc-light .monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .action-label{stroke-width:1.2px}.monaco-hover p{margin:0}.monaco-aria-container{position:absolute!important;top:0;height:1px;width:1px;margin:-1px;overflow:hidden;padding:0;clip:rect(1px,1px,1px,1px);clip-path:inset(50%)}.monaco-aria-container{position:absolute;left:-999em}::-ms-clear{display:none}.monaco-editor .editor-widget input{color:inherit}.monaco-editor{position:relative;overflow:visible;-webkit-text-size-adjust:100%;color:var(--vscode-editor-foreground);background-color:var(--vscode-editor-background)}.monaco-editor-background{background-color:var(--vscode-editor-background)}.monaco-editor .rangeHighlight{background-color:var(--vscode-editor-rangeHighlightBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-rangeHighlightBorder)}.monaco-editor.hc-black .rangeHighlight,.monaco-editor.hc-light .rangeHighlight{border-style:dotted}.monaco-editor .symbolHighlight{background-color:var(--vscode-editor-symbolHighlightBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-symbolHighlightBorder)}.monaco-editor.hc-black .symbolHighlight,.monaco-editor.hc-light .symbolHighlight{border-style:dotted}.monaco-editor .overflow-guard{position:relative;overflow:hidden}.monaco-editor .view-overlays{position:absolute;top:0}.monaco-editor .squiggly-error{border-bottom:4px double var(--vscode-editorError-border)}.monaco-editor .squiggly-error:before{display:block;content:"";width:100%;height:100%;background:var(--vscode-editorError-background)}.monaco-editor .squiggly-warning{border-bottom:4px double var(--vscode-editorWarning-border)}.monaco-editor .squiggly-warning:before{display:block;content:"";width:100%;height:100%;background:var(--vscode-editorWarning-background)}.monaco-editor .squiggly-info{border-bottom:4px double var(--vscode-editorInfo-border)}.monaco-editor .squiggly-info:before{display:block;content:"";width:100%;height:100%;background:var(--vscode-editorInfo-background)}.monaco-editor .squiggly-hint{border-bottom:2px dotted var(--vscode-editorHint-border)}.monaco-editor.showUnused .squiggly-unnecessary{border-bottom:2px dashed var(--vscode-editorUnnecessaryCode-border)}.monaco-editor.showDeprecated .squiggly-inline-deprecated{text-decoration:line-through;text-decoration-color:var(--vscode-editor-foreground, inherit)}.monaco-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.monaco-scrollable-element>.visible{opacity:1;background:#0000;transition:opacity .1s linear;z-index:11}.monaco-scrollable-element>.invisible{opacity:0;pointer-events:none}.monaco-scrollable-element>.invisible.fade{transition:opacity .8s linear}.monaco-scrollable-element>.shadow{position:absolute;display:none}.monaco-scrollable-element>.shadow.top{display:block;top:0;left:3px;height:3px;width:100%;box-shadow:var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset}.monaco-scrollable-element>.shadow.left{display:block;top:3px;left:0;height:100%;width:3px;box-shadow:var(--vscode-scrollbar-shadow) 6px 0 6px -6px inset}.monaco-scrollable-element>.shadow.top-left-corner{display:block;top:0;left:0;height:3px;width:3px}.monaco-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow) 6px 0 6px -6px inset}.monaco-scrollable-element>.scrollbar>.slider{background:var(--vscode-scrollbarSlider-background)}.monaco-scrollable-element>.scrollbar>.slider:hover{background:var(--vscode-scrollbarSlider-hoverBackground)}.monaco-scrollable-element>.scrollbar>.slider.active{background:var(--vscode-scrollbarSlider-activeBackground)}.monaco-editor .inputarea{min-width:0;min-height:0;margin:0;padding:0;position:absolute;outline:none!important;resize:none;border:none;overflow:hidden;color:transparent;background-color:transparent;z-index:-10}.monaco-editor .inputarea.ime-input{z-index:10;caret-color:var(--vscode-editorCursor-foreground);color:var(--vscode-editor-foreground)}.monaco-editor .margin-view-overlays .line-numbers{font-variant-numeric:tabular-nums;position:absolute;text-align:right;display:inline-block;vertical-align:middle;box-sizing:border-box;cursor:default;height:100%}.monaco-editor .relative-current-line-number{text-align:left;display:inline-block;width:100%}.monaco-editor .margin-view-overlays .line-numbers.lh-odd{margin-top:1px}.monaco-editor .line-numbers{color:var(--vscode-editorLineNumber-foreground)}.monaco-editor .line-numbers.active-line-number{color:var(--vscode-editorLineNumber-activeForeground)}.monaco-editor .margin{background-color:var(--vscode-editorGutter-background)}.monaco-mouse-cursor-text{cursor:text}.monaco-editor .view-overlays .current-line,.monaco-editor .margin-view-overlays .current-line{display:block;position:absolute;left:0;top:0;box-sizing:border-box}.monaco-editor .margin-view-overlays .current-line.current-line-margin.current-line-margin-both{border-right:0}.monaco-editor .lines-content .cdr{position:absolute}.monaco-editor .lines-content .core-guide{position:absolute;box-sizing:border-box}.mtkcontrol{color:#fff!important;background:#960000!important}.mtkoverflow{background-color:var(--vscode-button-background, var(--vscode-editor-background));color:var(--vscode-button-foreground, var(--vscode-editor-foreground));border-width:1px;border-style:solid;border-color:var(--vscode-contrastBorder);border-radius:2px;padding:4px;cursor:pointer}.mtkoverflow:hover{background-color:var(--vscode-button-hoverBackground)}.monaco-editor.no-user-select .lines-content,.monaco-editor.no-user-select .view-line,.monaco-editor.no-user-select .view-lines{user-select:none;-webkit-user-select:none}.monaco-editor.mac .lines-content:hover,.monaco-editor.mac .view-line:hover,.monaco-editor.mac .view-lines:hover{user-select:text;-webkit-user-select:text;-ms-user-select:text}.monaco-editor.enable-user-select{user-select:initial;-webkit-user-select:initial}.monaco-editor .view-lines{white-space:nowrap}.monaco-editor .view-line{position:absolute;width:100%}.monaco-editor .mtkw{color:var(--vscode-editorWhitespace-foreground)!important}.monaco-editor .mtkz{display:inline-block;color:var(--vscode-editorWhitespace-foreground)!important}.monaco-editor .lines-decorations{position:absolute;top:0;background:#fff}.monaco-editor .margin-view-overlays .cldr{position:absolute;height:100%}.monaco-editor .glyph-margin{position:absolute;top:0}.monaco-editor .glyph-margin-widgets .cgmr{position:absolute;display:flex;align-items:center;justify-content:center}.monaco-editor .glyph-margin-widgets .cgmr.codicon-modifier-spin:before{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.monaco-editor .margin-view-overlays .cmdr{position:absolute;left:0;width:100%;height:100%}.monaco-editor .minimap.slider-mouseover .minimap-slider{opacity:0;transition:opacity .1s linear}.monaco-editor .minimap.slider-mouseover:hover .minimap-slider,.monaco-editor .minimap.slider-mouseover .minimap-slider.active{opacity:1}.monaco-editor .minimap-slider .minimap-slider-horizontal{background:var(--vscode-minimapSlider-background)}.monaco-editor .minimap-slider:hover .minimap-slider-horizontal{background:var(--vscode-minimapSlider-hoverBackground)}.monaco-editor .minimap-slider.active .minimap-slider-horizontal{background:var(--vscode-minimapSlider-activeBackground)}.monaco-editor .minimap-shadow-visible{box-shadow:var(--vscode-scrollbar-shadow) -6px 0 6px -6px inset}.monaco-editor .minimap-shadow-hidden{position:absolute;width:0}.monaco-editor .minimap-shadow-visible{position:absolute;left:-6px;width:6px}.monaco-editor.no-minimap-shadow .minimap-shadow-visible{position:absolute;left:-1px;width:1px}.minimap.autohide{opacity:0;transition:opacity .5s}.minimap.autohide:hover{opacity:1}.monaco-editor .minimap{z-index:5}.monaco-editor .overlayWidgets{position:absolute;top:0;left:0}.monaco-editor .view-ruler{position:absolute;top:0;box-shadow:1px 0 0 0 var(--vscode-editorRuler-foreground) inset}.monaco-editor .scroll-decoration{position:absolute;top:0;left:0;height:6px;box-shadow:var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset}.monaco-editor .lines-content .cslr{position:absolute}.monaco-editor .focused .selected-text{background-color:var(--vscode-editor-selectionBackground)}.monaco-editor .selected-text{background-color:var(--vscode-editor-inactiveSelectionBackground)}.monaco-editor .top-left-radius{border-top-left-radius:3px}.monaco-editor .bottom-left-radius{border-bottom-left-radius:3px}.monaco-editor .top-right-radius{border-top-right-radius:3px}.monaco-editor .bottom-right-radius{border-bottom-right-radius:3px}.monaco-editor.hc-black .top-left-radius{border-top-left-radius:0}.monaco-editor.hc-black .bottom-left-radius{border-bottom-left-radius:0}.monaco-editor.hc-black .top-right-radius{border-top-right-radius:0}.monaco-editor.hc-black .bottom-right-radius{border-bottom-right-radius:0}.monaco-editor.hc-light .top-left-radius{border-top-left-radius:0}.monaco-editor.hc-light .bottom-left-radius{border-bottom-left-radius:0}.monaco-editor.hc-light .top-right-radius{border-top-right-radius:0}.monaco-editor.hc-light .bottom-right-radius{border-bottom-right-radius:0}.monaco-editor .cursors-layer{position:absolute;top:0}.monaco-editor .cursors-layer>.cursor{position:absolute;overflow:hidden;box-sizing:border-box}.monaco-editor .cursors-layer.cursor-smooth-caret-animation>.cursor{transition:all 80ms}.monaco-editor .cursors-layer.cursor-block-outline-style>.cursor{background:transparent!important;border-style:solid;border-width:1px}.monaco-editor .cursors-layer.cursor-underline-style>.cursor{border-bottom-width:2px;border-bottom-style:solid;background:transparent!important}.monaco-editor .cursors-layer.cursor-underline-thin-style>.cursor{border-bottom-width:1px;border-bottom-style:solid;background:transparent!important}@keyframes monaco-cursor-smooth{0%,20%{opacity:1}60%,to{opacity:0}}@keyframes monaco-cursor-phase{0%,20%{opacity:1}90%,to{opacity:0}}@keyframes monaco-cursor-expand{0%,20%{transform:scaleY(1)}80%,to{transform:scaleY(0)}}.cursor-smooth{animation:monaco-cursor-smooth .5s ease-in-out 0s 20 alternate}.cursor-phase{animation:monaco-cursor-phase .5s ease-in-out 0s 20 alternate}.cursor-expand>.cursor{animation:monaco-cursor-expand .5s ease-in-out 0s 20 alternate}.monaco-editor .blockDecorations-container{position:absolute;top:0;pointer-events:none}.monaco-editor .blockDecorations-block{position:absolute;box-sizing:border-box}.monaco-editor .mwh{position:absolute;color:var(--vscode-editorWhitespace-foreground)!important}.context-view{position:absolute}.context-view.fixed{all:initial;font-family:inherit;font-size:13px;position:fixed;color:inherit}.monaco-list{position:relative;height:100%;width:100%;white-space:nowrap}.monaco-list.mouse-support{user-select:none;-webkit-user-select:none}.monaco-list>.monaco-scrollable-element{height:100%}.monaco-list-rows{position:relative;width:100%;height:100%}.monaco-list.horizontal-scrolling .monaco-list-rows{width:auto;min-width:100%}.monaco-list-row{position:absolute;box-sizing:border-box;overflow:hidden;width:100%}.monaco-list.mouse-support .monaco-list-row{cursor:pointer;touch-action:none}.monaco-list-row.scrolling{display:none!important}.monaco-list.element-focused,.monaco-list.selection-single,.monaco-list.selection-multiple{outline:0!important}.monaco-drag-image{display:inline-block;padding:1px 7px;border-radius:10px;font-size:12px;position:absolute;z-index:1000}.monaco-list-type-filter-message{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;padding:40px 1em 1em;text-align:center;white-space:normal;opacity:.7;pointer-events:none}.monaco-list-type-filter-message:empty{display:none}.monaco-select-box-dropdown-padding{--dropdown-padding-top: 1px;--dropdown-padding-bottom: 1px}.hc-black .monaco-select-box-dropdown-padding,.hc-light .monaco-select-box-dropdown-padding{--dropdown-padding-top: 3px;--dropdown-padding-bottom: 4px}.monaco-select-box-dropdown-container{display:none;box-sizing:border-box}.monaco-select-box-dropdown-container>.select-box-details-pane>.select-box-description-markdown *{margin:0}.monaco-select-box-dropdown-container>.select-box-details-pane>.select-box-description-markdown a:focus{outline:1px solid -webkit-focus-ring-color;outline-offset:-1px}.monaco-select-box-dropdown-container>.select-box-details-pane>.select-box-description-markdown code{line-height:15px;font-family:var(--monaco-monospace-font)}.monaco-select-box-dropdown-container.visible{display:flex;flex-direction:column;text-align:left;width:1px;overflow:hidden;border-bottom-left-radius:3px;border-bottom-right-radius:3px}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container{flex:0 0 auto;align-self:flex-start;padding-top:var(--dropdown-padding-top);padding-bottom:var(--dropdown-padding-bottom);padding-left:1px;padding-right:1px;width:100%;overflow:hidden;box-sizing:border-box}.monaco-select-box-dropdown-container>.select-box-details-pane{padding:5px}.hc-black .monaco-select-box-dropdown-container>.select-box-dropdown-list-container{padding-top:var(--dropdown-padding-top);padding-bottom:var(--dropdown-padding-bottom)}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row{cursor:pointer}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.option-text{text-overflow:ellipsis;overflow:hidden;padding-left:3.5px;white-space:nowrap;float:left}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.option-detail{text-overflow:ellipsis;overflow:hidden;padding-left:3.5px;white-space:nowrap;float:left;opacity:.7}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.option-decorator-right{text-overflow:ellipsis;overflow:hidden;padding-right:10px;white-space:nowrap;float:right}.monaco-select-box-dropdown-container>.select-box-dropdown-list-container .monaco-list .monaco-list-row>.visually-hidden{position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden}.monaco-select-box-dropdown-container>.select-box-dropdown-container-width-control{flex:1 1 auto;align-self:flex-start;opacity:0}.monaco-select-box-dropdown-container>.select-box-dropdown-container-width-control>.width-control-div{overflow:hidden;max-height:0px}.monaco-select-box-dropdown-container>.select-box-dropdown-container-width-control>.width-control-div>.option-text-width-control{padding-left:4px;padding-right:8px;white-space:nowrap}.monaco-select-box{width:100%;cursor:pointer;border-radius:2px}.monaco-select-box-dropdown-container{font-size:13px;font-weight:400;text-transform:none}.monaco-action-bar .action-item.select-container{cursor:default}.monaco-action-bar .action-item .monaco-select-box{cursor:pointer;min-width:100px;min-height:18px;padding:2px 23px 2px 8px}.mac .monaco-action-bar .action-item .monaco-select-box{font-size:11px;border-radius:5px}.monaco-action-bar{white-space:nowrap;height:100%}.monaco-action-bar .actions-container{display:flex;margin:0 auto;padding:0;height:100%;width:100%;align-items:center}.monaco-action-bar.vertical .actions-container{display:inline-block}.monaco-action-bar .action-item{display:block;align-items:center;justify-content:center;cursor:pointer;position:relative}.monaco-action-bar .action-item.disabled{cursor:default}.monaco-action-bar .action-item .icon,.monaco-action-bar .action-item .codicon{display:block}.monaco-action-bar .action-item .codicon{display:flex;align-items:center;width:16px;height:16px}.monaco-action-bar .action-label{display:flex;font-size:11px;padding:3px;border-radius:5px}.monaco-action-bar .action-item.disabled .action-label,.monaco-action-bar .action-item.disabled .action-label:before,.monaco-action-bar .action-item.disabled .action-label:hover{opacity:.6}.monaco-action-bar.vertical{text-align:left}.monaco-action-bar.vertical .action-item{display:block}.monaco-action-bar.vertical .action-label.separator{display:block;border-bottom:1px solid #bbb;padding-top:1px;margin-left:.8em;margin-right:.8em}.monaco-action-bar .action-item .action-label.separator{width:1px;height:16px;margin:5px 4px!important;cursor:default;min-width:1px;padding:0;background-color:#bbb}.secondary-actions .monaco-action-bar .action-label{margin-left:6px}.monaco-action-bar .action-item.select-container{overflow:hidden;flex:1;max-width:170px;min-width:60px;display:flex;align-items:center;justify-content:center;margin-right:10px}.monaco-action-bar .action-item.action-dropdown-item{display:flex}.monaco-action-bar .action-item.action-dropdown-item>.action-dropdown-item-separator{display:flex;align-items:center;cursor:default}.monaco-action-bar .action-item.action-dropdown-item>.action-dropdown-item-separator>div{width:1px}.monaco-dropdown{height:100%;padding:0}.monaco-dropdown>.dropdown-label{cursor:pointer;height:100%;display:flex;align-items:center;justify-content:center}.monaco-dropdown>.dropdown-label>.action-label.disabled{cursor:default}.monaco-dropdown-with-primary{display:flex!important;flex-direction:row;border-radius:5px}.monaco-dropdown-with-primary>.action-container>.action-label{margin-right:0}.monaco-dropdown-with-primary>.dropdown-action-container>.monaco-dropdown>.dropdown-label .codicon[class*=codicon-]{font-size:12px;padding-left:0;padding-right:0;line-height:16px;margin-left:-3px}.monaco-dropdown-with-primary>.dropdown-action-container>.monaco-dropdown>.dropdown-label>.action-label{display:block;background-size:16px;background-position:center center;background-repeat:no-repeat}.monaco-action-bar .action-item.menu-entry .action-label.icon{width:16px;height:16px;background-repeat:no-repeat;background-position:50%;background-size:16px}.monaco-dropdown-with-default{display:flex!important;flex-direction:row;border-radius:5px}.monaco-dropdown-with-default>.action-container>.action-label{margin-right:0}.monaco-dropdown-with-default>.action-container.menu-entry>.action-label.icon{width:16px;height:16px;background-repeat:no-repeat;background-position:50%;background-size:16px}.monaco-dropdown-with-default>.dropdown-action-container>.monaco-dropdown>.dropdown-label .codicon[class*=codicon-]{font-size:12px;padding-left:0;padding-right:0;line-height:16px;margin-left:-3px}.monaco-dropdown-with-default>.dropdown-action-container>.monaco-dropdown>.dropdown-label>.action-label{display:block;background-size:16px;background-position:center center;background-repeat:no-repeat}.quick-input-widget{font-size:13px}.quick-input-widget .monaco-highlighted-label .highlight{color:#0066bf}.vs .quick-input-widget .monaco-list-row.focused .monaco-highlighted-label .highlight{color:#9dddff}.vs-dark .quick-input-widget .monaco-highlighted-label .highlight{color:#0097fb}.hc-black .quick-input-widget .monaco-highlighted-label .highlight{color:#f38518}.hc-light .quick-input-widget .monaco-highlighted-label .highlight{color:#0f4a85}.monaco-keybinding>.monaco-keybinding-key{background-color:#ddd6;border:solid 1px rgba(204,204,204,.4);border-bottom-color:#bbb6;box-shadow:inset 0 -1px #bbb6;color:#555}.hc-black .monaco-keybinding>.monaco-keybinding-key{background-color:transparent;border:solid 1px rgb(111,195,223);box-shadow:none;color:#fff}.hc-light .monaco-keybinding>.monaco-keybinding-key{background-color:transparent;border:solid 1px #0F4A85;box-shadow:none;color:#292929}.vs-dark .monaco-keybinding>.monaco-keybinding-key{background-color:#8080802b;border:solid 1px rgba(51,51,51,.6);border-bottom-color:#4449;box-shadow:inset 0 -1px #4449;color:#ccc}:root{--vscode-sash-size: 4px;--vscode-sash-hover-size: 4px}.monaco-sash{position:absolute;z-index:35;touch-action:none}.monaco-sash.disabled{pointer-events:none}.monaco-sash.mac.vertical{cursor:col-resize}.monaco-sash.vertical.minimum{cursor:e-resize}.monaco-sash.vertical.maximum{cursor:w-resize}.monaco-sash.mac.horizontal{cursor:row-resize}.monaco-sash.horizontal.minimum{cursor:s-resize}.monaco-sash.horizontal.maximum{cursor:n-resize}.monaco-sash.disabled{cursor:default!important;pointer-events:none!important}.monaco-sash.vertical{cursor:ew-resize;top:0;width:var(--vscode-sash-size);height:100%}.monaco-sash.horizontal{cursor:ns-resize;left:0;width:100%;height:var(--vscode-sash-size)}.monaco-sash:not(.disabled)>.orthogonal-drag-handle{content:" ";height:calc(var(--vscode-sash-size) * 2);width:calc(var(--vscode-sash-size) * 2);z-index:100;display:block;cursor:all-scroll;position:absolute}.monaco-sash.horizontal.orthogonal-edge-north:not(.disabled)>.orthogonal-drag-handle.start,.monaco-sash.horizontal.orthogonal-edge-south:not(.disabled)>.orthogonal-drag-handle.end{cursor:nwse-resize}.monaco-sash.horizontal.orthogonal-edge-north:not(.disabled)>.orthogonal-drag-handle.end,.monaco-sash.horizontal.orthogonal-edge-south:not(.disabled)>.orthogonal-drag-handle.start{cursor:nesw-resize}.monaco-sash.vertical>.orthogonal-drag-handle.start{left:calc(var(--vscode-sash-size) * -.5);top:calc(var(--vscode-sash-size) * -1)}.monaco-sash.vertical>.orthogonal-drag-handle.end{left:calc(var(--vscode-sash-size) * -.5);bottom:calc(var(--vscode-sash-size) * -1)}.monaco-sash.horizontal>.orthogonal-drag-handle.start{top:calc(var(--vscode-sash-size) * -.5);left:calc(var(--vscode-sash-size) * -1)}.monaco-sash.horizontal>.orthogonal-drag-handle.end{top:calc(var(--vscode-sash-size) * -.5);right:calc(var(--vscode-sash-size) * -1)}.monaco-sash:before{content:"";pointer-events:none;position:absolute;width:100%;height:100%;background:transparent}.monaco-workbench:not(.reduce-motion) .monaco-sash:before{transition:background-color .1s ease-out}.monaco-sash.hover:before,.monaco-sash.active:before{background:var(--vscode-sash-hoverBorder)}.monaco-sash.vertical:before{width:var(--vscode-sash-hover-size);left:calc(50% - (var(--vscode-sash-hover-size) / 2))}.monaco-sash.horizontal:before{height:var(--vscode-sash-hover-size);top:calc(50% - (var(--vscode-sash-hover-size) / 2))}.pointer-events-disabled{pointer-events:none!important}.monaco-sash.debug{background:#0ff}.monaco-sash.debug.disabled{background:#0ff3}.monaco-sash.debug:not(.disabled)>.orthogonal-drag-handle{background:red}.monaco-split-view2{position:relative;width:100%;height:100%}.monaco-split-view2>.sash-container{position:absolute;width:100%;height:100%;pointer-events:none}.monaco-split-view2>.sash-container>.monaco-sash{pointer-events:initial}.monaco-split-view2>.monaco-scrollable-element{width:100%;height:100%}.monaco-split-view2>.monaco-scrollable-element>.split-view-container{width:100%;height:100%;white-space:nowrap;position:relative}.monaco-split-view2>.monaco-scrollable-element>.split-view-container>.split-view-view{white-space:initial;position:absolute}.monaco-split-view2>.monaco-scrollable-element>.split-view-container>.split-view-view:not(.visible){display:none}.monaco-split-view2.vertical>.monaco-scrollable-element>.split-view-container>.split-view-view{width:100%}.monaco-split-view2.horizontal>.monaco-scrollable-element>.split-view-container>.split-view-view{height:100%}.monaco-split-view2.separator-border>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{content:" ";position:absolute;top:0;left:0;z-index:5;pointer-events:none;background-color:var(--separator-border)}.monaco-split-view2.separator-border.horizontal>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{height:100%;width:1px}.monaco-split-view2.separator-border.vertical>.monaco-scrollable-element>.split-view-container>.split-view-view:not(:first-child):before{height:1px;width:100%}.monaco-table{display:flex;flex-direction:column;position:relative;height:100%;width:100%;white-space:nowrap;overflow:hidden}.monaco-table>.monaco-split-view2{border-bottom:1px solid transparent}.monaco-table>.monaco-list{flex:1}.monaco-table-tr{display:flex;height:100%}.monaco-table-th{width:100%;height:100%;font-weight:700;overflow:hidden;text-overflow:ellipsis}.monaco-table-th,.monaco-table-td{box-sizing:border-box;flex-shrink:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.monaco-table>.monaco-split-view2 .monaco-sash.vertical:before{content:"";position:absolute;left:calc(var(--vscode-sash-size) / 2);width:0;border-left:1px solid transparent}.monaco-workbench:not(.reduce-motion) .monaco-table>.monaco-split-view2,.monaco-workbench:not(.reduce-motion) .monaco-table>.monaco-split-view2 .monaco-sash.vertical:before{transition:border-color .2s ease-out}.monaco-custom-toggle{margin-left:2px;float:left;cursor:pointer;overflow:hidden;width:20px;height:20px;border-radius:3px;border:1px solid transparent;padding:1px;box-sizing:border-box;user-select:none;-webkit-user-select:none}.monaco-custom-toggle:hover{background-color:var(--vscode-inputOption-hoverBackground)}.hc-black .monaco-custom-toggle:hover,.hc-light .monaco-custom-toggle:hover{border:1px dashed var(--vscode-focusBorder)}.hc-black .monaco-custom-toggle,.hc-light .monaco-custom-toggle,.hc-black .monaco-custom-toggle:hover,.hc-light .monaco-custom-toggle:hover{background:none}.monaco-custom-toggle.monaco-checkbox{height:18px;width:18px;border:1px solid transparent;border-radius:3px;margin-right:9px;margin-left:0;padding:0;opacity:1;background-size:16px!important}.monaco-custom-toggle.monaco-checkbox:not(.checked):before{visibility:hidden}.monaco-inputbox{position:relative;display:block;padding:0;box-sizing:border-box;border-radius:2px;font-size:inherit}.monaco-inputbox>.ibwrapper>.input,.monaco-inputbox>.ibwrapper>.mirror{padding:4px 6px}.monaco-inputbox>.ibwrapper{position:relative;width:100%;height:100%}.monaco-inputbox>.ibwrapper>.input{display:inline-block;box-sizing:border-box;width:100%;height:100%;line-height:inherit;border:none;font-family:inherit;font-size:inherit;resize:none;color:inherit}.monaco-inputbox>.ibwrapper>input{text-overflow:ellipsis}.monaco-inputbox>.ibwrapper>textarea.input{display:block;scrollbar-width:none;outline:none}.monaco-inputbox>.ibwrapper>textarea.input::-webkit-scrollbar{display:none}.monaco-inputbox>.ibwrapper>textarea.input.empty{white-space:nowrap}.monaco-inputbox>.ibwrapper>.mirror{position:absolute;display:inline-block;width:100%;top:0;left:0;box-sizing:border-box;white-space:pre-wrap;visibility:hidden;word-wrap:break-word}.monaco-inputbox-container{text-align:right}.monaco-inputbox-container .monaco-inputbox-message{display:inline-block;overflow:hidden;text-align:left;width:100%;box-sizing:border-box;padding:.4em;font-size:12px;line-height:17px;margin-top:-1px;word-wrap:break-word}.monaco-inputbox .monaco-action-bar{position:absolute;right:2px;top:4px}.monaco-inputbox .monaco-action-bar .action-item{margin-left:2px}.monaco-inputbox .monaco-action-bar .action-item .codicon{background-repeat:no-repeat;width:16px;height:16px}.monaco-findInput{position:relative}.monaco-findInput .monaco-inputbox{font-size:13px;width:100%}.monaco-findInput>.controls{position:absolute;top:3px;right:2px}.vs .monaco-findInput.disabled{background-color:#e1e1e1}.vs-dark .monaco-findInput.disabled{background-color:#333}.monaco-findInput.highlight-0 .controls,.hc-light .monaco-findInput.highlight-0 .controls{animation:monaco-findInput-highlight-0 .1s linear 0s}.monaco-findInput.highlight-1 .controls,.hc-light .monaco-findInput.highlight-1 .controls{animation:monaco-findInput-highlight-1 .1s linear 0s}.hc-black .monaco-findInput.highlight-0 .controls,.vs-dark .monaco-findInput.highlight-0 .controls{animation:monaco-findInput-highlight-dark-0 .1s linear 0s}.hc-black .monaco-findInput.highlight-1 .controls,.vs-dark .monaco-findInput.highlight-1 .controls{animation:monaco-findInput-highlight-dark-1 .1s linear 0s}@keyframes monaco-findInput-highlight-0{0%{background:#fdff00cc}to{background:transparent}}@keyframes monaco-findInput-highlight-1{0%{background:#fdff00cc}99%{background:transparent}}@keyframes monaco-findInput-highlight-dark-0{0%{background:#ffffff70}to{background:transparent}}@keyframes monaco-findInput-highlight-dark-1{0%{background:#ffffff70}99%{background:transparent}}.monaco-tl-row{display:flex;height:100%;align-items:center;position:relative}.monaco-tl-row.disabled{cursor:default}.monaco-tl-indent{height:100%;position:absolute;top:0;left:16px;pointer-events:none}.hide-arrows .monaco-tl-indent{left:12px}.monaco-tl-indent>.indent-guide{display:inline-block;box-sizing:border-box;height:100%;border-left:1px solid transparent}.monaco-workbench:not(.reduce-motion) .monaco-tl-indent>.indent-guide{transition:border-color .1s linear}.monaco-tl-twistie,.monaco-tl-contents{height:100%}.monaco-tl-twistie{font-size:10px;text-align:right;padding-right:6px;flex-shrink:0;width:16px;display:flex!important;align-items:center;justify-content:center;transform:translate(3px)}.monaco-tl-contents{flex:1;overflow:hidden}.monaco-tl-twistie:before{border-radius:20px}.monaco-tl-twistie.collapsed:before{transform:rotate(-90deg)}.monaco-tl-twistie.codicon-tree-item-loading:before{animation:codicon-spin 1.25s steps(30) infinite}.monaco-tree-type-filter{position:absolute;top:0;display:flex;padding:3px;max-width:200px;z-index:100;margin:0 6px;border:1px solid var(--vscode-widget-border);border-bottom-left-radius:4px;border-bottom-right-radius:4px}.monaco-workbench:not(.reduce-motion) .monaco-tree-type-filter{transition:top .3s}.monaco-tree-type-filter.disabled{top:-40px!important}.monaco-tree-type-filter-grab{display:flex!important;align-items:center;justify-content:center;cursor:grab;margin-right:2px}.monaco-tree-type-filter-grab.grabbing{cursor:grabbing}.monaco-tree-type-filter-input{flex:1}.monaco-tree-type-filter-input .monaco-inputbox{height:23px}.monaco-tree-type-filter-input .monaco-inputbox>.ibwrapper>.input,.monaco-tree-type-filter-input .monaco-inputbox>.ibwrapper>.mirror{padding:2px 4px}.monaco-tree-type-filter-input .monaco-findInput>.controls{top:2px}.monaco-tree-type-filter-actionbar{margin-left:4px}.monaco-tree-type-filter-actionbar .monaco-action-bar .action-label{padding:2px}.monaco-text-button{box-sizing:border-box;display:flex;width:100%;padding:4px;border-radius:2px;text-align:center;cursor:pointer;justify-content:center;align-items:center;border:1px solid var(--vscode-button-border, transparent);line-height:18px}.monaco-text-button:focus{outline-offset:2px!important}.monaco-text-button:hover{text-decoration:none!important}.monaco-button.disabled:focus,.monaco-button.disabled{opacity:.4!important;cursor:default}.monaco-text-button .codicon{margin:0 .2em;color:inherit!important}.monaco-text-button.monaco-text-button-with-short-label{flex-direction:row;flex-wrap:wrap;padding:0 4px;overflow:hidden;height:28px}.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label{flex-basis:100%}.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label-short{flex-grow:1;width:0;overflow:hidden}.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label,.monaco-text-button.monaco-text-button-with-short-label>.monaco-button-label-short{display:flex;justify-content:center;align-items:center;font-weight:400;font-style:inherit;padding:4px 0}.monaco-button-dropdown{display:flex;cursor:pointer}.monaco-button-dropdown.disabled{cursor:default}.monaco-button-dropdown>.monaco-button:focus{outline-offset:-1px!important}.monaco-button-dropdown.disabled>.monaco-button.disabled,.monaco-button-dropdown.disabled>.monaco-button.disabled:focus,.monaco-button-dropdown.disabled>.monaco-button-dropdown-separator{opacity:.4!important}.monaco-button-dropdown>.monaco-button.monaco-text-button{border-right-width:0!important}.monaco-button-dropdown .monaco-button-dropdown-separator{padding:4px 0;cursor:default}.monaco-button-dropdown .monaco-button-dropdown-separator>div{height:100%;width:1px}.monaco-button-dropdown>.monaco-button.monaco-dropdown-button{border:1px solid var(--vscode-button-border, transparent);border-left-width:0!important;border-radius:0 2px 2px 0}.monaco-button-dropdown>.monaco-button.monaco-text-button{border-radius:2px 0 0 2px}.monaco-description-button{display:flex;flex-direction:column;align-items:center;margin:4px 5px}.monaco-description-button .monaco-button-description{font-style:italic;font-size:11px;padding:4px 20px}.monaco-description-button .monaco-button-label,.monaco-description-button .monaco-button-description{display:flex;justify-content:center;align-items:center}.monaco-description-button .monaco-button-label>.codicon,.monaco-description-button .monaco-button-description>.codicon{margin:0 .2em;color:inherit!important}.monaco-button.default-colors,.monaco-button-dropdown.default-colors>.monaco-button{color:var(--vscode-button-foreground);background-color:var(--vscode-button-background)}.monaco-button.default-colors:hover,.monaco-button-dropdown.default-colors>.monaco-button:hover{background-color:var(--vscode-button-hoverBackground)}.monaco-button.default-colors.secondary,.monaco-button-dropdown.default-colors>.monaco-button.secondary{color:var(--vscode-button-secondaryForeground);background-color:var(--vscode-button-secondaryBackground)}.monaco-button.default-colors.secondary:hover,.monaco-button-dropdown.default-colors>.monaco-button.secondary:hover{background-color:var(--vscode-button-secondaryHoverBackground)}.monaco-button-dropdown.default-colors .monaco-button-dropdown-separator{background-color:var(--vscode-button-background);border-top:1px solid var(--vscode-button-border);border-bottom:1px solid var(--vscode-button-border)}.monaco-button-dropdown.default-colors .monaco-button.secondary+.monaco-button-dropdown-separator{background-color:var(--vscode-button-secondaryBackground)}.monaco-button-dropdown.default-colors .monaco-button-dropdown-separator>div{background-color:var(--vscode-button-separator)}.monaco-count-badge{padding:3px 6px;border-radius:11px;font-size:11px;min-width:18px;min-height:18px;line-height:11px;font-weight:400;text-align:center;display:inline-block;box-sizing:border-box}.monaco-count-badge.long{padding:2px 3px;border-radius:2px;min-height:auto;line-height:normal}.monaco-progress-container{width:100%;height:5px;overflow:hidden}.monaco-progress-container .progress-bit{width:2%;height:5px;position:absolute;left:0;display:none}.monaco-progress-container.active .progress-bit{display:inherit}.monaco-progress-container.discrete .progress-bit{left:0;transition:width .1s linear}.monaco-progress-container.discrete.done .progress-bit{width:100%}.monaco-progress-container.infinite .progress-bit{animation-name:progress;animation-duration:4s;animation-iteration-count:infinite;transform:translateZ(0);animation-timing-function:linear}.monaco-progress-container.infinite.infinite-long-running .progress-bit{animation-timing-function:steps(100)}@keyframes progress{0%{transform:translate(0) scaleX(1)}50%{transform:translate(2500%) scaleX(3)}to{transform:translate(4900%) scaleX(1)}}.quick-input-widget{position:absolute;width:600px;z-index:2550;left:50%;margin-left:-300px;-webkit-app-region:no-drag;border-radius:6px}.quick-input-titlebar{display:flex;align-items:center;border-top-left-radius:5px;border-top-right-radius:5px}.quick-input-left-action-bar{display:flex;margin-left:4px;flex:1}.quick-input-title{padding:3px 0;text-align:center;text-overflow:ellipsis;overflow:hidden}.quick-input-right-action-bar{display:flex;margin-right:4px;flex:1}.quick-input-right-action-bar>.actions-container{justify-content:flex-end}.quick-input-titlebar .monaco-action-bar .action-label.codicon{background-position:center;background-repeat:no-repeat;padding:2px}.quick-input-description{margin:6px 6px 6px 11px}.quick-input-header .quick-input-description{margin:4px 2px;flex:1}.quick-input-header{display:flex;padding:8px 6px 6px}.quick-input-widget.hidden-input .quick-input-header{padding:0;margin-bottom:0}.quick-input-and-message{display:flex;flex-direction:column;flex-grow:1;min-width:0;position:relative}.quick-input-check-all{align-self:center;margin:0}.quick-input-filter{flex-grow:1;display:flex;position:relative}.quick-input-box{flex-grow:1}.quick-input-widget.show-checkboxes .quick-input-box,.quick-input-widget.show-checkboxes .quick-input-message{margin-left:5px}.quick-input-visible-count{position:absolute;left:-10000px}.quick-input-count{align-self:center;position:absolute;right:4px;display:flex;align-items:center}.quick-input-count .monaco-count-badge{vertical-align:middle;padding:2px 4px;border-radius:2px;min-height:auto;line-height:normal}.quick-input-action{margin-left:6px}.quick-input-action .monaco-text-button{font-size:11px;padding:0 6px;display:flex;height:25px;align-items:center}.quick-input-message{margin-top:-1px;padding:5px;overflow-wrap:break-word}.quick-input-message>.codicon{margin:0 .2em;vertical-align:text-bottom}.quick-input-message a{color:inherit}.quick-input-progress.monaco-progress-container{position:relative}.quick-input-progress.monaco-progress-container,.quick-input-progress.monaco-progress-container .progress-bit{height:2px}.quick-input-list{line-height:22px}.quick-input-widget.hidden-input .quick-input-list{margin-top:4px;padding-bottom:4px}.quick-input-list .monaco-list{overflow:hidden;max-height:440px;padding-bottom:5px}.quick-input-list .monaco-scrollable-element{padding:0 5px}.quick-input-list .quick-input-list-entry{box-sizing:border-box;overflow:hidden;display:flex;height:100%;padding:0 6px}.quick-input-list .quick-input-list-entry.quick-input-list-separator-border{border-top-width:1px;border-top-style:solid}.quick-input-list .monaco-list-row{border-radius:3px}.quick-input-list .monaco-list-row[data-index="0"] .quick-input-list-entry.quick-input-list-separator-border{border-top-style:none}.quick-input-list .quick-input-list-label{overflow:hidden;display:flex;height:100%;flex:1}.quick-input-list .quick-input-list-checkbox{align-self:center;margin:0}.quick-input-list .quick-input-list-icon{background-size:16px;background-position:left center;background-repeat:no-repeat;padding-right:6px;width:16px;height:22px;display:flex;align-items:center;justify-content:center}.quick-input-list .quick-input-list-rows{overflow:hidden;text-overflow:ellipsis;display:flex;flex-direction:column;height:100%;flex:1;margin-left:5px}.quick-input-widget.show-checkboxes .quick-input-list .quick-input-list-rows{margin-left:10px}.quick-input-widget .quick-input-list .quick-input-list-checkbox{display:none}.quick-input-widget.show-checkboxes .quick-input-list .quick-input-list-checkbox{display:inline}.quick-input-list .quick-input-list-rows>.quick-input-list-row{display:flex;align-items:center}.quick-input-list .quick-input-list-rows>.quick-input-list-row .monaco-icon-label,.quick-input-list .quick-input-list-rows>.quick-input-list-row .monaco-icon-label .monaco-icon-label-container>.monaco-icon-name-container{flex:1}.quick-input-list .quick-input-list-rows>.quick-input-list-row .codicon[class*=codicon-]{vertical-align:text-bottom}.quick-input-list .quick-input-list-rows .monaco-highlighted-label>span{opacity:1}.quick-input-list .quick-input-list-entry .quick-input-list-entry-keybinding{margin-right:8px}.quick-input-list .quick-input-list-label-meta{opacity:.7;line-height:normal;text-overflow:ellipsis;overflow:hidden}.quick-input-list .monaco-highlighted-label .highlight{font-weight:700}.quick-input-list .quick-input-list-entry .quick-input-list-separator{margin-right:4px}.quick-input-list .quick-input-list-entry-action-bar{display:flex;flex:0;overflow:visible}.quick-input-list .quick-input-list-entry-action-bar .action-label{display:none}.quick-input-list .quick-input-list-entry-action-bar .action-label.codicon{margin-right:4px;padding:0 2px 2px}.quick-input-list .quick-input-list-entry-action-bar{margin-top:1px}.quick-input-list .quick-input-list-entry-action-bar{margin-right:4px}.quick-input-list .quick-input-list-entry .quick-input-list-entry-action-bar .action-label.always-visible,.quick-input-list .quick-input-list-entry:hover .quick-input-list-entry-action-bar .action-label,.quick-input-list .monaco-list-row.focused .quick-input-list-entry-action-bar .action-label{display:flex}.quick-input-list .monaco-list-row.focused .monaco-keybinding-key,.quick-input-list .monaco-list-row.focused .quick-input-list-entry .quick-input-list-separator{color:inherit}.quick-input-list .monaco-list-row.focused .monaco-keybinding-key{background:none}.quick-input-list .quick-input-list-separator-as-item{font-weight:600;font-size:12px}.monaco-icon-label{display:flex;overflow:hidden;text-overflow:ellipsis}.monaco-icon-label:before{background-size:16px;background-position:left center;background-repeat:no-repeat;padding-right:6px;width:16px;height:22px;line-height:inherit!important;display:inline-block;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;vertical-align:top;flex-shrink:0}.monaco-icon-label-container.disabled{color:var(--vscode-disabledForeground)}.monaco-icon-label>.monaco-icon-label-container{min-width:0;overflow:hidden;text-overflow:ellipsis;flex:1}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-name-container>.label-name{color:inherit;white-space:pre}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-name-container>.label-name>.label-separator{margin:0 2px;opacity:.5}.monaco-icon-label>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{opacity:.7;margin-left:.5em;font-size:.9em;white-space:pre}.monaco-icon-label.nowrap>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{white-space:nowrap}.vs .monaco-icon-label>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{opacity:.95}.monaco-icon-label.italic>.monaco-icon-label-container>.monaco-icon-name-container>.label-name,.monaco-icon-label.italic>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{font-style:italic}.monaco-icon-label.deprecated{text-decoration:line-through;opacity:.66}.monaco-icon-label.italic:after{font-style:italic}.monaco-icon-label.strikethrough>.monaco-icon-label-container>.monaco-icon-name-container>.label-name,.monaco-icon-label.strikethrough>.monaco-icon-label-container>.monaco-icon-description-container>.label-description{text-decoration:line-through}.monaco-icon-label:after{opacity:.75;font-size:90%;font-weight:600;margin:auto 16px 0 5px;text-align:center}.monaco-list:focus .selected .monaco-icon-label,.monaco-list:focus .selected .monaco-icon-label:after{color:inherit!important}.monaco-list-row.focused.selected .label-description,.monaco-list-row.selected .label-description{opacity:.8}.monaco-keybinding{display:flex;align-items:center;line-height:10px}.monaco-keybinding>.monaco-keybinding-key{display:inline-block;border-style:solid;border-width:1px;border-radius:3px;vertical-align:middle;font-size:11px;padding:3px 5px;margin:0 2px}.monaco-keybinding>.monaco-keybinding-key:first-child{margin-left:0}.monaco-keybinding>.monaco-keybinding-key:last-child{margin-right:0}.monaco-keybinding>.monaco-keybinding-key-separator{display:inline-block}.monaco-keybinding>.monaco-keybinding-key-chord-separator{width:6px}.monaco-editor .diff-hidden-lines-widget{width:100%}.monaco-editor .diff-hidden-lines{height:0px;transform:translateY(-10px);font-size:13px;line-height:14px}.monaco-editor .diff-hidden-lines:not(.dragging) .top:hover,.monaco-editor .diff-hidden-lines:not(.dragging) .bottom:hover,.monaco-editor .diff-hidden-lines .top.dragging,.monaco-editor .diff-hidden-lines .bottom.dragging{background-color:var(--vscode-focusBorder)}.monaco-editor .diff-hidden-lines .top,.monaco-editor .diff-hidden-lines .bottom{transition:background-color .1s ease-out;height:4px;background-color:transparent;background-clip:padding-box;border-bottom:2px solid transparent;border-top:4px solid transparent;cursor:ns-resize}.monaco-editor .diff-hidden-lines .top{transform:translateY(4px)}.monaco-editor .diff-hidden-lines .bottom{transform:translateY(-6px)}.monaco-editor .diff-unchanged-lines{background:var(--vscode-diffEditor-unchangedCodeBackground)}.monaco-editor .noModificationsOverlay{z-index:1;background:var(--vscode-editor-background);display:flex;justify-content:center;align-items:center}.monaco-editor .diff-hidden-lines .center{background:var(--vscode-diffEditor-unchangedRegionBackground);color:var(--vscode-diffEditor-unchangedRegionForeground);overflow:hidden;display:block;text-overflow:ellipsis;white-space:nowrap;height:24px}.monaco-editor .diff-hidden-lines .center span.codicon{vertical-align:middle}.monaco-editor .diff-hidden-lines .center a:hover .codicon{cursor:pointer;color:var(--vscode-editorLink-activeForeground)!important}.monaco-editor .diff-hidden-lines div.breadcrumb-item{cursor:pointer}.monaco-editor .diff-hidden-lines div.breadcrumb-item:hover{color:var(--vscode-editorLink-activeForeground)}.monaco-editor .movedOriginal,.monaco-editor .movedModified{border:2px solid var(--vscode-diffEditor-move-border)}.monaco-editor .movedOriginal.currentMove,.monaco-editor .movedModified.currentMove{border:2px solid var(--vscode-diffEditor-moveActive-border)}.monaco-diff-editor .moved-blocks-lines path.currentMove{stroke:var(--vscode-diffEditor-moveActive-border)}.monaco-diff-editor .moved-blocks-lines path{pointer-events:visiblestroke}.monaco-diff-editor .moved-blocks-lines .arrow{fill:var(--vscode-diffEditor-move-border)}.monaco-diff-editor .moved-blocks-lines .arrow.currentMove{fill:var(--vscode-diffEditor-moveActive-border)}.monaco-diff-editor .moved-blocks-lines .arrow-rectangle{fill:var(--vscode-editor-background)}.monaco-diff-editor .moved-blocks-lines{position:absolute;pointer-events:none}.monaco-diff-editor .moved-blocks-lines path{fill:none;stroke:var(--vscode-diffEditor-move-border);stroke-width:2}.monaco-editor .char-delete.diff-range-empty{margin-left:-1px;border-left:solid var(--vscode-diffEditor-removedTextBackground) 3px}.monaco-editor .char-insert.diff-range-empty{border-left:solid var(--vscode-diffEditor-insertedTextBackground) 3px}.monaco-editor .fold-unchanged{cursor:pointer}.monaco-diff-editor .diff-moved-code-block{display:flex;justify-content:flex-end;margin-top:-4px}.monaco-diff-editor .diff-moved-code-block .action-bar .action-label.codicon{width:12px;height:12px;font-size:12px}.monaco-diff-editor .diffOverview{z-index:9}.monaco-diff-editor .diffOverview .diffViewport{z-index:10}.monaco-diff-editor.vs .diffOverview{background:#00000008}.monaco-diff-editor.vs-dark .diffOverview{background:#ffffff03}.monaco-scrollable-element.modified-in-monaco-diff-editor.vs .scrollbar,.monaco-scrollable-element.modified-in-monaco-diff-editor.vs-dark .scrollbar{background:#0000}.monaco-scrollable-element.modified-in-monaco-diff-editor.hc-black .scrollbar,.monaco-scrollable-element.modified-in-monaco-diff-editor.hc-light .scrollbar{background:none}.monaco-scrollable-element.modified-in-monaco-diff-editor .slider{z-index:10}.modified-in-monaco-diff-editor .slider.active{background:#ababab66}.modified-in-monaco-diff-editor.hc-black .slider.active,.modified-in-monaco-diff-editor.hc-light .slider.active{background:none}.monaco-editor .insert-sign,.monaco-diff-editor .insert-sign,.monaco-editor .delete-sign,.monaco-diff-editor .delete-sign{font-size:11px!important;opacity:.7!important;display:flex!important;align-items:center}.monaco-editor.hc-black .insert-sign,.monaco-diff-editor.hc-black .insert-sign,.monaco-editor.hc-black .delete-sign,.monaco-diff-editor.hc-black .delete-sign,.monaco-editor.hc-light .insert-sign,.monaco-diff-editor.hc-light .insert-sign,.monaco-editor.hc-light .delete-sign,.monaco-diff-editor.hc-light .delete-sign{opacity:1}.monaco-editor .inline-deleted-margin-view-zone,.monaco-editor .inline-added-margin-view-zone{text-align:right}.monaco-editor .arrow-revert-change{z-index:10;position:absolute}.monaco-editor .arrow-revert-change:hover{cursor:pointer}.monaco-editor .view-zones .view-lines .view-line span{display:inline-block}.monaco-editor .margin-view-zones .lightbulb-glyph:hover{cursor:pointer}.monaco-editor .char-insert,.monaco-diff-editor .char-insert{background-color:var(--vscode-diffEditor-insertedTextBackground)}.monaco-editor .line-insert,.monaco-diff-editor .line-insert{background-color:var(--vscode-diffEditor-insertedLineBackground, var(--vscode-diffEditor-insertedTextBackground))}.monaco-editor .line-insert,.monaco-editor .char-insert{box-sizing:border-box;border:1px solid var(--vscode-diffEditor-insertedTextBorder)}.monaco-editor.hc-black .line-insert,.monaco-editor.hc-light .line-insert,.monaco-editor.hc-black .char-insert,.monaco-editor.hc-light .char-insert{border-style:dashed}.monaco-editor .line-delete,.monaco-editor .char-delete{box-sizing:border-box;border:1px solid var(--vscode-diffEditor-removedTextBorder)}.monaco-editor.hc-black .line-delete,.monaco-editor.hc-light .line-delete,.monaco-editor.hc-black .char-delete,.monaco-editor.hc-light .char-delete{border-style:dashed}.monaco-editor .inline-added-margin-view-zone,.monaco-editor .gutter-insert,.monaco-diff-editor .gutter-insert{background-color:var(--vscode-diffEditorGutter-insertedLineBackground, var(--vscode-diffEditor-insertedLineBackground), var(--vscode-diffEditor-insertedTextBackground))}.monaco-editor .char-delete,.monaco-diff-editor .char-delete{background-color:var(--vscode-diffEditor-removedTextBackground)}.monaco-editor .line-delete,.monaco-diff-editor .line-delete{background-color:var(--vscode-diffEditor-removedLineBackground, var(--vscode-diffEditor-removedTextBackground))}.monaco-editor .inline-deleted-margin-view-zone,.monaco-editor .gutter-delete,.monaco-diff-editor .gutter-delete{background-color:var(--vscode-diffEditorGutter-removedLineBackground, var(--vscode-diffEditor-removedLineBackground), var(--vscode-diffEditor-removedTextBackground))}.monaco-diff-editor.side-by-side .editor.modified{box-shadow:-6px 0 5px -5px var(--vscode-scrollbar-shadow);border-left:1px solid var(--vscode-diffEditor-border)}.monaco-diff-editor .diffViewport{background:var(--vscode-scrollbarSlider-background)}.monaco-diff-editor .diffViewport:hover{background:var(--vscode-scrollbarSlider-hoverBackground)}.monaco-diff-editor .diffViewport:active{background:var(--vscode-scrollbarSlider-activeBackground)}.monaco-editor .diagonal-fill{background-image:linear-gradient(-45deg,var(--vscode-diffEditor-diagonalFill) 12.5%,#0000 12.5%,#0000 50%,var(--vscode-diffEditor-diagonalFill) 50%,var(--vscode-diffEditor-diagonalFill) 62.5%,#0000 62.5%,#0000 100%);background-size:8px 8px}.monaco-diff-editor .diff-review-line-number{text-align:right;display:inline-block;color:var(--vscode-editorLineNumber-foreground)}.monaco-diff-editor .diff-review{position:absolute;user-select:none;-webkit-user-select:none;z-index:99}.monaco-diff-editor .diff-review-summary{padding-left:10px}.monaco-diff-editor .diff-review-shadow{position:absolute;box-shadow:var(--vscode-scrollbar-shadow) 0 -6px 6px -6px inset}.monaco-diff-editor .diff-review-row{white-space:pre}.monaco-diff-editor .diff-review-table{display:table;min-width:100%}.monaco-diff-editor .diff-review-row{display:table-row;width:100%}.monaco-diff-editor .diff-review-spacer{display:inline-block;width:10px;vertical-align:middle}.monaco-diff-editor .diff-review-spacer>.codicon{font-size:9px!important}.monaco-diff-editor .diff-review-actions{display:inline-block;position:absolute;right:10px;top:2px;z-index:100}.monaco-diff-editor .diff-review-actions .action-label{width:16px;height:16px;margin:2px 0}.monaco-editor .margin-view-overlays .codicon-folding-manual-collapsed,.monaco-editor .margin-view-overlays .codicon-folding-manual-expanded,.monaco-editor .margin-view-overlays .codicon-folding-expanded,.monaco-editor .margin-view-overlays .codicon-folding-collapsed{cursor:pointer;opacity:0;transition:opacity .5s;display:flex;align-items:center;justify-content:center;font-size:140%;margin-left:2px}.monaco-workbench.reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-manual-collapsed,.monaco-workbench.reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-manual-expanded,.monaco-workbench.reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-expanded,.monaco-workbench.reduce-motion .monaco-editor .margin-view-overlays .codicon-folding-collapsed{transition:initial}.monaco-editor .margin-view-overlays:hover .codicon,.monaco-editor .margin-view-overlays .codicon.codicon-folding-collapsed,.monaco-editor .margin-view-overlays .codicon.codicon-folding-manual-collapsed,.monaco-editor .margin-view-overlays .codicon.alwaysShowFoldIcons{opacity:1}.monaco-editor .inline-folded:after{color:gray;margin:.1em .2em 0;content:"⋯";display:inline;line-height:1em;cursor:pointer}.monaco-editor .folded-background{background-color:var(--vscode-editor-foldBackground)}.monaco-editor .cldr.codicon.codicon-folding-expanded,.monaco-editor .cldr.codicon.codicon-folding-collapsed,.monaco-editor .cldr.codicon.codicon-folding-manual-expanded,.monaco-editor .cldr.codicon.codicon-folding-manual-collapsed{color:var(--vscode-editorGutter-foldingControlForeground)!important}.monaco-editor .findOptionsWidget{background-color:var(--vscode-editorWidget-background);color:var(--vscode-editorWidget-foreground);box-shadow:0 0 8px 2px var(--vscode-widget-shadow);border:2px solid var(--vscode-contrastBorder)}.monaco-editor .find-widget{position:absolute;z-index:35;height:33px;overflow:hidden;line-height:19px;transition:transform .2s linear;padding:0 4px;box-sizing:border-box;transform:translateY(calc(-100% - 10px));border-bottom-left-radius:4px;border-bottom-right-radius:4px}.monaco-workbench.reduce-motion .monaco-editor .find-widget{transition:transform 0ms linear}.monaco-editor .find-widget textarea{margin:0}.monaco-editor .find-widget.hiddenEditor{display:none}.monaco-editor .find-widget.replaceToggled>.replace-part{display:flex}.monaco-editor .find-widget.visible{transform:translateY(0)}.monaco-editor .find-widget .monaco-inputbox.synthetic-focus{outline:1px solid -webkit-focus-ring-color;outline-offset:-1px}.monaco-editor .find-widget .monaco-inputbox .input{background-color:transparent;min-height:0}.monaco-editor .find-widget .monaco-findInput .input{font-size:13px}.monaco-editor .find-widget>.find-part,.monaco-editor .find-widget>.replace-part{margin:3px 25px 0 17px;font-size:12px;display:flex}.monaco-editor .find-widget>.find-part .monaco-inputbox,.monaco-editor .find-widget>.replace-part .monaco-inputbox{min-height:25px}.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.mirror{padding-right:22px}.monaco-editor .find-widget>.find-part .monaco-inputbox>.ibwrapper>.input,.monaco-editor .find-widget>.find-part .monaco-inputbox>.ibwrapper>.mirror,.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.input,.monaco-editor .find-widget>.replace-part .monaco-inputbox>.ibwrapper>.mirror{padding-top:2px;padding-bottom:2px}.monaco-editor .find-widget>.find-part .find-actions{height:25px;display:flex;align-items:center}.monaco-editor .find-widget>.replace-part .replace-actions{height:25px;display:flex;align-items:center}.monaco-editor .find-widget .monaco-findInput{vertical-align:middle;display:flex;flex:1}.monaco-editor .find-widget .monaco-findInput .monaco-scrollable-element{width:100%}.monaco-editor .find-widget .monaco-findInput .monaco-scrollable-element .scrollbar.vertical{opacity:0}.monaco-editor .find-widget .matchesCount{display:flex;flex:initial;margin:0 0 0 3px;padding:2px 0 0 2px;height:25px;vertical-align:middle;box-sizing:border-box;text-align:center;line-height:23px}.monaco-editor .find-widget .button{width:16px;height:16px;padding:3px;border-radius:5px;flex:initial;margin-left:3px;background-position:center center;background-repeat:no-repeat;cursor:pointer;display:flex;align-items:center;justify-content:center}.monaco-editor .find-widget .codicon-find-selection{width:22px;height:22px;padding:3px;border-radius:5px}.monaco-editor .find-widget .button.left{margin-left:0;margin-right:3px}.monaco-editor .find-widget .button.wide{width:auto;padding:1px 6px;top:-1px}.monaco-editor .find-widget .button.toggle{position:absolute;top:0;left:3px;width:18px;height:100%;border-radius:0;box-sizing:border-box}.monaco-editor .find-widget .button.toggle.disabled{display:none}.monaco-editor .find-widget .disabled{color:var(--vscode-disabledForeground);cursor:default}.monaco-editor .find-widget>.replace-part{display:none}.monaco-editor .find-widget>.replace-part>.monaco-findInput{position:relative;display:flex;vertical-align:middle;flex:auto;flex-grow:0;flex-shrink:0}.monaco-editor .find-widget>.replace-part>.monaco-findInput>.controls{position:absolute;top:3px;right:2px}.monaco-editor .find-widget.reduced-find-widget .matchesCount{display:none}.monaco-editor .find-widget.narrow-find-widget{max-width:257px!important}.monaco-editor .find-widget.collapsed-find-widget{max-width:170px!important}.monaco-editor .find-widget.collapsed-find-widget .button.previous,.monaco-editor .find-widget.collapsed-find-widget .button.next,.monaco-editor .find-widget.collapsed-find-widget .button.replace,.monaco-editor .find-widget.collapsed-find-widget .button.replace-all,.monaco-editor .find-widget.collapsed-find-widget>.find-part .monaco-findInput .controls{display:none}.monaco-editor .findMatch{animation-duration:0;animation-name:inherit!important}.monaco-editor .find-widget .monaco-sash{left:0!important}.monaco-editor.hc-black .find-widget .button:before{position:relative;top:1px;left:2px}.monaco-editor .find-widget>.button.codicon-widget-close{position:absolute;top:5px;right:4px}.monaco-editor .focused .selectionHighlight{background-color:var(--vscode-editor-selectionHighlightBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-selectionHighlightBorder)}.monaco-editor.hc-black .focused .selectionHighlight,.monaco-editor.hc-light .focused .selectionHighlight{border-style:dotted}.monaco-editor .wordHighlight{background-color:var(--vscode-editor-wordHighlightBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-wordHighlightBorder)}.monaco-editor.hc-black .wordHighlight,.monaco-editor.hc-light .wordHighlight{border-style:dotted}.monaco-editor .wordHighlightStrong{background-color:var(--vscode-editor-wordHighlightStrongBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-wordHighlightStrongBorder)}.monaco-editor.hc-black .wordHighlightStrong,.monaco-editor.hc-light .wordHighlightStrong{border-style:dotted}.monaco-editor .wordHighlightText{background-color:var(--vscode-editor-wordHighlightTextBackground);box-sizing:border-box;border:1px solid var(--vscode-editor-wordHighlightTextBorder)}.monaco-editor.hc-black .wordHighlightText,.monaco-editor.hc-light .wordHighlightText{border-style:dotted}.monaco-editor .bracket-match{box-sizing:border-box;background-color:var(--vscode-editorBracketMatch-background);border:1px solid var(--vscode-editorBracketMatch-border)}.monaco-editor .goto-definition-link{text-decoration:underline;cursor:pointer;color:var(--vscode-editorLink-activeForeground)!important}.monaco-editor .peekview-widget .head{box-sizing:border-box;display:flex;justify-content:space-between;flex-wrap:nowrap}.monaco-editor .peekview-widget .head .peekview-title{display:flex;align-items:baseline;font-size:13px;margin-left:20px;min-width:0;text-overflow:ellipsis;overflow:hidden}.monaco-editor .peekview-widget .head .peekview-title.clickable{cursor:pointer}.monaco-editor .peekview-widget .head .peekview-title .dirname:not(:empty){font-size:.9em;margin-left:.5em}.monaco-editor .peekview-widget .head .peekview-title .meta{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.monaco-editor .peekview-widget .head .peekview-title .dirname,.monaco-editor .peekview-widget .head .peekview-title .filename{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.monaco-editor .peekview-widget .head .peekview-title .meta:not(:empty):before{content:"-";padding:0 .3em}.monaco-editor .peekview-widget .head .peekview-actions{flex:1;text-align:right;padding-right:2px}.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar{display:inline-block}.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar,.monaco-editor .peekview-widget .head .peekview-actions>.monaco-action-bar>.actions-container{height:100%}.monaco-editor .peekview-widget>.body{border-top:1px solid;position:relative}.monaco-editor .peekview-widget .head .peekview-title .codicon{margin-right:4px;align-self:center}.monaco-editor .peekview-widget .monaco-list .monaco-list-row.focused .codicon{color:inherit!important}.monaco-editor .zone-widget{position:absolute;z-index:10}.monaco-editor .zone-widget .zone-widget-container{border-top-style:solid;border-bottom-style:solid;border-top-width:0;border-bottom-width:0;position:relative}.monaco-editor .zone-widget .zone-widget-container.reference-zone-widget{border-top-width:1px;border-bottom-width:1px}.monaco-editor .reference-zone-widget .inline{display:inline-block;vertical-align:top}.monaco-editor .reference-zone-widget .messages{height:100%;width:100%;text-align:center;padding:3em 0}.monaco-editor .reference-zone-widget .ref-tree{line-height:23px;background-color:var(--vscode-peekViewResult-background);color:var(--vscode-peekViewResult-lineForeground)}.monaco-editor .reference-zone-widget .ref-tree .reference{text-overflow:ellipsis;overflow:hidden}.monaco-editor .reference-zone-widget .ref-tree .reference-file{display:inline-flex;width:100%;height:100%;color:var(--vscode-peekViewResult-fileForeground)}.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .selected .reference-file{color:inherit!important}.monaco-editor .reference-zone-widget .ref-tree .monaco-list:focus .monaco-list-rows>.monaco-list-row.selected:not(.highlighted){background-color:var(--vscode-peekViewResult-selectionBackground);color:var(--vscode-peekViewResult-selectionForeground)!important}.monaco-editor .reference-zone-widget .ref-tree .reference-file .count{margin-right:12px;margin-left:auto}.monaco-editor .reference-zone-widget .ref-tree .referenceMatch .highlight{background-color:var(--vscode-peekViewResult-matchHighlightBackground)}.monaco-editor .reference-zone-widget .preview .reference-decoration{background-color:var(--vscode-peekViewEditor-matchHighlightBackground);border:2px solid var(--vscode-peekViewEditor-matchHighlightBorder);box-sizing:border-box}.monaco-editor .reference-zone-widget .preview .monaco-editor .monaco-editor-background,.monaco-editor .reference-zone-widget .preview .monaco-editor .inputarea.ime-input{background-color:var(--vscode-peekViewEditor-background)}.monaco-editor .reference-zone-widget .preview .monaco-editor .margin{background-color:var(--vscode-peekViewEditorGutter-background)}.monaco-editor.hc-black .reference-zone-widget .ref-tree .reference-file,.monaco-editor.hc-light .reference-zone-widget .ref-tree .reference-file{font-weight:700}.monaco-editor.hc-black .reference-zone-widget .ref-tree .referenceMatch .highlight,.monaco-editor.hc-light .reference-zone-widget .ref-tree .referenceMatch .highlight{border:1px dotted var(--vscode-contrastActiveBorder, transparent);box-sizing:border-box}.monaco-editor .monaco-editor-overlaymessage{padding-bottom:8px;z-index:10000}.monaco-editor .monaco-editor-overlaymessage.below{padding-bottom:0;padding-top:8px;z-index:10000}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.monaco-editor .monaco-editor-overlaymessage.fadeIn{animation:fadeIn .15s ease-out}@keyframes fadeOut{0%{opacity:1}to{opacity:0}}.monaco-editor .monaco-editor-overlaymessage.fadeOut{animation:fadeOut .1s ease-out}.monaco-editor .monaco-editor-overlaymessage .message{padding:2px 4px;color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-inputValidation-infoBorder);border-radius:3px}.monaco-editor .monaco-editor-overlaymessage .message p{margin-block:0px}.monaco-editor .monaco-editor-overlaymessage .message a{color:var(--vscode-textLink-foreground)}.monaco-editor .monaco-editor-overlaymessage .message a:hover{color:var(--vscode-textLink-activeForeground)}.monaco-editor.hc-black .monaco-editor-overlaymessage .message,.monaco-editor.hc-light .monaco-editor-overlaymessage .message{border-width:2px}.monaco-editor .monaco-editor-overlaymessage .anchor{width:0!important;height:0!important;border-color:transparent;border-style:solid;z-index:1000;border-width:8px;position:absolute;left:2px}.monaco-editor .monaco-editor-overlaymessage .anchor.top{border-bottom-color:var(--vscode-inputValidation-infoBorder)}.monaco-editor .monaco-editor-overlaymessage .anchor.below{border-top-color:var(--vscode-inputValidation-infoBorder)}.monaco-editor .monaco-editor-overlaymessage:not(.below) .anchor.top,.monaco-editor .monaco-editor-overlaymessage.below .anchor.below{display:none}.monaco-editor .monaco-editor-overlaymessage.below .anchor.top{display:inherit;top:-8px}.monaco-editor .rendered-markdown kbd{background-color:var(--vscode-keybindingLabel-background);color:var(--vscode-keybindingLabel-foreground);border-style:solid;border-width:1px;border-radius:3px;border-color:var(--vscode-keybindingLabel-border);border-bottom-color:var(--vscode-keybindingLabel-bottomBorder);box-shadow:inset 0 -1px 0 var(--vscode-widget-shadow);vertical-align:middle;padding:1px 3px}.monaco-hover{cursor:default;position:absolute;overflow:hidden;user-select:text;-webkit-user-select:text;box-sizing:border-box;animation:fadein .1s linear;line-height:1.5em;white-space:var(--vscode-hover-whiteSpace, normal)}.monaco-hover.hidden{display:none}.monaco-hover a:hover:not(.disabled){cursor:pointer}.monaco-hover .hover-contents:not(.html-hover-contents){padding:4px 8px}.monaco-hover .markdown-hover>.hover-contents:not(.code-hover-contents){max-width:var(--vscode-hover-maxWidth, 500px);word-wrap:break-word}.monaco-hover .markdown-hover>.hover-contents:not(.code-hover-contents) hr{min-width:100%}.monaco-hover p,.monaco-hover .code,.monaco-hover ul,.monaco-hover h1,.monaco-hover h2,.monaco-hover h3,.monaco-hover h4,.monaco-hover h5,.monaco-hover h6{margin:8px 0}.monaco-hover h1,.monaco-hover h2,.monaco-hover h3,.monaco-hover h4,.monaco-hover h5,.monaco-hover h6{line-height:1.1}.monaco-hover code{font-family:var(--monaco-monospace-font)}.monaco-hover hr{box-sizing:border-box;border-left:0px;border-right:0px;margin:4px -8px -4px;height:1px}.monaco-hover p:first-child,.monaco-hover .code:first-child,.monaco-hover ul:first-child{margin-top:0}.monaco-hover p:last-child,.monaco-hover .code:last-child,.monaco-hover ul:last-child{margin-bottom:0}.monaco-hover ul,.monaco-hover ol{padding-left:20px}.monaco-hover li>p{margin-bottom:0}.monaco-hover li>ul{margin-top:0}.monaco-hover code{border-radius:3px;padding:0 .4em}.monaco-hover .monaco-tokenized-source{white-space:var(--vscode-hover-sourceWhiteSpace, pre-wrap)}.monaco-hover .hover-row.status-bar{font-size:12px;line-height:22px}.monaco-hover .hover-row.status-bar .info{font-style:italic;padding:0 8px}.monaco-hover .hover-row.status-bar .actions{display:flex;padding:0 8px}.monaco-hover .hover-row.status-bar .actions .action-container{margin-right:16px;cursor:pointer}.monaco-hover .hover-row.status-bar .actions .action-container .action .icon{padding-right:4px}.monaco-hover .markdown-hover .hover-contents .codicon{color:inherit;font-size:inherit;vertical-align:middle}.monaco-hover .hover-contents a.code-link:hover,.monaco-hover .hover-contents a.code-link{color:inherit}.monaco-hover .hover-contents a.code-link:before{content:"("}.monaco-hover .hover-contents a.code-link:after{content:")"}.monaco-hover .hover-contents a.code-link>span{text-decoration:underline;border-bottom:1px solid transparent;text-underline-position:under;color:var(--vscode-textLink-foreground)}.monaco-hover .hover-contents a.code-link>span:hover{color:var(--vscode-textLink-activeForeground)}.monaco-hover .markdown-hover .hover-contents:not(.code-hover-contents):not(.html-hover-contents) span{margin-bottom:4px;display:inline-block}.monaco-hover-content .action-container a{-webkit-user-select:none;user-select:none}.monaco-hover-content .action-container.disabled{pointer-events:none;opacity:.4;cursor:default}@font-face{font-family:codicon;font-display:block;src:url(./codicon-BuT2v_Yt.ttf) format("truetype")}.codicon[class*=codicon-]{font: 16px/1 codicon;display:inline-block;text-decoration:none;text-rendering:auto;text-align:center;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;user-select:none;-webkit-user-select:none}.codicon-wrench-subaction{opacity:.5}@keyframes codicon-spin{to{transform:rotate(360deg)}}.codicon-sync.codicon-modifier-spin,.codicon-loading.codicon-modifier-spin,.codicon-gear.codicon-modifier-spin,.codicon-notebook-state-executing.codicon-modifier-spin{animation:codicon-spin 1.5s steps(30) infinite}.codicon-modifier-disabled{opacity:.4}.codicon-loading,.codicon-tree-item-loading:before{animation-duration:1s!important;animation-timing-function:cubic-bezier(.53,.21,.29,.67)!important}.monaco-editor .codicon.codicon-symbol-array,.monaco-workbench .codicon.codicon-symbol-array{color:var(--vscode-symbolIcon-arrayForeground)}.monaco-editor .codicon.codicon-symbol-boolean,.monaco-workbench .codicon.codicon-symbol-boolean{color:var(--vscode-symbolIcon-booleanForeground)}.monaco-editor .codicon.codicon-symbol-class,.monaco-workbench .codicon.codicon-symbol-class{color:var(--vscode-symbolIcon-classForeground)}.monaco-editor .codicon.codicon-symbol-method,.monaco-workbench .codicon.codicon-symbol-method{color:var(--vscode-symbolIcon-methodForeground)}.monaco-editor .codicon.codicon-symbol-color,.monaco-workbench .codicon.codicon-symbol-color{color:var(--vscode-symbolIcon-colorForeground)}.monaco-editor .codicon.codicon-symbol-constant,.monaco-workbench .codicon.codicon-symbol-constant{color:var(--vscode-symbolIcon-constantForeground)}.monaco-editor .codicon.codicon-symbol-constructor,.monaco-workbench .codicon.codicon-symbol-constructor{color:var(--vscode-symbolIcon-constructorForeground)}.monaco-editor .codicon.codicon-symbol-value,.monaco-workbench .codicon.codicon-symbol-value,.monaco-editor .codicon.codicon-symbol-enum,.monaco-workbench .codicon.codicon-symbol-enum{color:var(--vscode-symbolIcon-enumeratorForeground)}.monaco-editor .codicon.codicon-symbol-enum-member,.monaco-workbench .codicon.codicon-symbol-enum-member{color:var(--vscode-symbolIcon-enumeratorMemberForeground)}.monaco-editor .codicon.codicon-symbol-event,.monaco-workbench .codicon.codicon-symbol-event{color:var(--vscode-symbolIcon-eventForeground)}.monaco-editor .codicon.codicon-symbol-field,.monaco-workbench .codicon.codicon-symbol-field{color:var(--vscode-symbolIcon-fieldForeground)}.monaco-editor .codicon.codicon-symbol-file,.monaco-workbench .codicon.codicon-symbol-file{color:var(--vscode-symbolIcon-fileForeground)}.monaco-editor .codicon.codicon-symbol-folder,.monaco-workbench .codicon.codicon-symbol-folder{color:var(--vscode-symbolIcon-folderForeground)}.monaco-editor .codicon.codicon-symbol-function,.monaco-workbench .codicon.codicon-symbol-function{color:var(--vscode-symbolIcon-functionForeground)}.monaco-editor .codicon.codicon-symbol-interface,.monaco-workbench .codicon.codicon-symbol-interface{color:var(--vscode-symbolIcon-interfaceForeground)}.monaco-editor .codicon.codicon-symbol-key,.monaco-workbench .codicon.codicon-symbol-key{color:var(--vscode-symbolIcon-keyForeground)}.monaco-editor .codicon.codicon-symbol-keyword,.monaco-workbench .codicon.codicon-symbol-keyword{color:var(--vscode-symbolIcon-keywordForeground)}.monaco-editor .codicon.codicon-symbol-module,.monaco-workbench .codicon.codicon-symbol-module{color:var(--vscode-symbolIcon-moduleForeground)}.monaco-editor .codicon.codicon-symbol-namespace,.monaco-workbench .codicon.codicon-symbol-namespace{color:var(--vscode-symbolIcon-namespaceForeground)}.monaco-editor .codicon.codicon-symbol-null,.monaco-workbench .codicon.codicon-symbol-null{color:var(--vscode-symbolIcon-nullForeground)}.monaco-editor .codicon.codicon-symbol-number,.monaco-workbench .codicon.codicon-symbol-number{color:var(--vscode-symbolIcon-numberForeground)}.monaco-editor .codicon.codicon-symbol-object,.monaco-workbench .codicon.codicon-symbol-object{color:var(--vscode-symbolIcon-objectForeground)}.monaco-editor .codicon.codicon-symbol-operator,.monaco-workbench .codicon.codicon-symbol-operator{color:var(--vscode-symbolIcon-operatorForeground)}.monaco-editor .codicon.codicon-symbol-package,.monaco-workbench .codicon.codicon-symbol-package{color:var(--vscode-symbolIcon-packageForeground)}.monaco-editor .codicon.codicon-symbol-property,.monaco-workbench .codicon.codicon-symbol-property{color:var(--vscode-symbolIcon-propertyForeground)}.monaco-editor .codicon.codicon-symbol-reference,.monaco-workbench .codicon.codicon-symbol-reference{color:var(--vscode-symbolIcon-referenceForeground)}.monaco-editor .codicon.codicon-symbol-snippet,.monaco-workbench .codicon.codicon-symbol-snippet{color:var(--vscode-symbolIcon-snippetForeground)}.monaco-editor .codicon.codicon-symbol-string,.monaco-workbench .codicon.codicon-symbol-string{color:var(--vscode-symbolIcon-stringForeground)}.monaco-editor .codicon.codicon-symbol-struct,.monaco-workbench .codicon.codicon-symbol-struct{color:var(--vscode-symbolIcon-structForeground)}.monaco-editor .codicon.codicon-symbol-text,.monaco-workbench .codicon.codicon-symbol-text{color:var(--vscode-symbolIcon-textForeground)}.monaco-editor .codicon.codicon-symbol-type-parameter,.monaco-workbench .codicon.codicon-symbol-type-parameter{color:var(--vscode-symbolIcon-typeParameterForeground)}.monaco-editor .codicon.codicon-symbol-unit,.monaco-workbench .codicon.codicon-symbol-unit{color:var(--vscode-symbolIcon-unitForeground)}.monaco-editor .codicon.codicon-symbol-variable,.monaco-workbench .codicon.codicon-symbol-variable{color:var(--vscode-symbolIcon-variableForeground)}.monaco-editor .lightBulbWidget{display:flex;align-items:center;justify-content:center}.monaco-editor .lightBulbWidget:hover{cursor:pointer}.monaco-editor .lightBulbWidget.codicon-light-bulb{color:var(--vscode-editorLightBulb-foreground)}.monaco-editor .lightBulbWidget.codicon-lightbulb-autofix{color:var(--vscode-editorLightBulbAutoFix-foreground, var(--vscode-editorLightBulb-foreground))}.monaco-editor .lightBulbWidget:before{position:relative;z-index:2}.monaco-editor .lightBulbWidget:after{position:absolute;top:0;left:0;content:"";display:block;width:100%;height:100%;opacity:.3;background-color:var(--vscode-editor-background);z-index:1}.action-widget{font-size:13px;min-width:160px;max-width:80vw;z-index:40;display:block;width:100%;border:1px solid var(--vscode-editorWidget-border)!important;border-radius:2px;background-color:var(--vscode-editorWidget-background);color:var(--vscode-editorWidget-foreground)}.context-view-block{position:fixed;cursor:initial;left:0;top:0;width:100%;height:100%;z-index:-1}.context-view-pointerBlock{position:fixed;cursor:initial;left:0;top:0;width:100%;height:100%;z-index:2}.action-widget .monaco-list{user-select:none;-webkit-user-select:none;border:none!important;border-width:0!important}.action-widget .monaco-list:focus:before{outline:0!important}.action-widget .monaco-list .monaco-scrollable-element{overflow:visible}.action-widget .monaco-list .monaco-list-row{padding:0 10px;white-space:nowrap;cursor:pointer;touch-action:none;width:100%}.action-widget .monaco-list .monaco-list-row.action.focused:not(.option-disabled){background-color:var(--vscode-quickInputList-focusBackground)!important;color:var(--vscode-quickInputList-focusForeground);outline:1px solid var(--vscode-menu-selectionBorder, transparent);outline-offset:-1px}.action-widget .monaco-list-row.group-header{color:var(--vscode-descriptionForeground)!important;font-weight:600}.action-widget .monaco-list .group-header,.action-widget .monaco-list .option-disabled,.action-widget .monaco-list .option-disabled:before,.action-widget .monaco-list .option-disabled .focused,.action-widget .monaco-list .option-disabled .focused:before{cursor:default!important;-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;background-color:transparent!important;outline:0 solid!important}.action-widget .monaco-list-row.action{display:flex;gap:6px;align-items:center}.action-widget .monaco-list-row.action.option-disabled,.action-widget .monaco-list:focus .monaco-list-row.focused.action.option-disabled,.action-widget .monaco-list-row.action.option-disabled .codicon,.action-widget .monaco-list:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused).option-disabled{color:var(--vscode-disabledForeground)}.action-widget .monaco-list-row.action:not(.option-disabled) .codicon{color:inherit}.action-widget .monaco-list-row.action .title{flex:1;overflow:hidden;text-overflow:ellipsis}.action-widget .action-widget-action-bar{background-color:var(--vscode-editorHoverWidget-statusBarBackground);border-top:1px solid var(--vscode-editorHoverWidget-border)}.action-widget .action-widget-action-bar:before{display:block;content:"";width:100%}.action-widget .action-widget-action-bar .actions-container{padding:0 8px}.action-widget-action-bar .action-label{color:var(--vscode-textLink-activeForeground);font-size:12px;line-height:22px;padding:0;pointer-events:all}.action-widget-action-bar .action-item{margin-right:16px;pointer-events:none}.action-widget-action-bar .action-label:hover{background-color:transparent!important}.monaco-action-bar .actions-container.highlight-toggled .action-label.checked{background:var(--vscode-actionBar-toggledBackground)!important}.monaco-editor .peekview-widget .head .peekview-title .severity-icon{display:inline-block;vertical-align:text-top;margin-right:4px}.monaco-editor .marker-widget{text-overflow:ellipsis;white-space:nowrap}.monaco-editor .marker-widget>.stale{opacity:.6;font-style:italic}.monaco-editor .marker-widget .title{display:inline-block;padding-right:5px}.monaco-editor .marker-widget .descriptioncontainer{position:absolute;white-space:pre;user-select:text;-webkit-user-select:text;padding:8px 12px 0 20px}.monaco-editor .marker-widget .descriptioncontainer .message{display:flex;flex-direction:column}.monaco-editor .marker-widget .descriptioncontainer .message .details{padding-left:6px}.monaco-editor .marker-widget .descriptioncontainer .message .source,.monaco-editor .marker-widget .descriptioncontainer .message span.code{opacity:.6}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link{opacity:.6;color:inherit}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link:before{content:"("}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link:after{content:")"}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link>span{text-decoration:underline;border-bottom:1px solid transparent;text-underline-position:under;color:var(--vscode-textLink-foreground)}.monaco-editor .marker-widget .descriptioncontainer .message a.code-link>span{color:var(--vscode-textLink-activeForeground)}.monaco-editor .marker-widget .descriptioncontainer .filename{cursor:pointer}.monaco-editor .zone-widget .codicon.codicon-error,.markers-panel .marker-icon.error,.markers-panel .marker-icon .codicon.codicon-error,.text-search-provider-messages .providerMessage .codicon.codicon-error,.extensions-viewlet>.extensions .codicon.codicon-error,.extension-editor .codicon.codicon-error,.preferences-editor .codicon.codicon-error{color:var(--vscode-problemsErrorIcon-foreground)}.monaco-editor .zone-widget .codicon.codicon-warning,.markers-panel .marker-icon.warning,.markers-panel .marker-icon .codicon.codicon-warning,.text-search-provider-messages .providerMessage .codicon.codicon-warning,.extensions-viewlet>.extensions .codicon.codicon-warning,.extension-editor .codicon.codicon-warning,.preferences-editor .codicon.codicon-warning{color:var(--vscode-problemsWarningIcon-foreground)}.monaco-editor .zone-widget .codicon.codicon-info,.markers-panel .marker-icon.info,.markers-panel .marker-icon .codicon.codicon-info,.text-search-provider-messages .providerMessage .codicon.codicon-info,.extensions-viewlet>.extensions .codicon.codicon-info,.extension-editor .codicon.codicon-info,.preferences-editor .codicon.codicon-info{color:var(--vscode-problemsInfoIcon-foreground)}.monaco-editor .inlineSuggestionsHints.withBorder{z-index:39;color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border)}.monaco-editor .inlineSuggestionsHints a,.monaco-editor .inlineSuggestionsHints a:hover{color:var(--vscode-foreground)}.monaco-editor .inlineSuggestionsHints .keybinding{display:flex;margin-left:4px;opacity:.6}.monaco-editor .inlineSuggestionsHints .keybinding .monaco-keybinding-key{font-size:8px;padding:2px 3px}.monaco-editor .inlineSuggestionsHints .availableSuggestionCount a{display:flex;min-width:19px;justify-content:center}.monaco-editor .inlineSuggestionStatusBarItemLabel{margin-right:2px}.monaco-toolbar{height:100%}.monaco-toolbar .toolbar-toggle-more{display:inline-block;padding:0}.monaco-editor .hoverHighlight{background-color:var(--vscode-editor-hoverHighlightBackground)}.monaco-editor .monaco-hover{color:var(--vscode-editorHoverWidget-foreground);background-color:var(--vscode-editorHoverWidget-background);border:1px solid var(--vscode-editorHoverWidget-border);border-radius:3px}.monaco-editor .monaco-hover a{color:var(--vscode-textLink-foreground)}.monaco-editor .monaco-hover a:hover{color:var(--vscode-textLink-activeForeground)}.monaco-editor .monaco-hover .hover-row .actions{background-color:var(--vscode-editorHoverWidget-statusBarBackground)}.monaco-editor .monaco-hover code{background-color:var(--vscode-textCodeBlock-background)}body{margin:0;padding:0;font-family:sans-serif}split-panel{--handle-hover-color: rgba(84, 143, 204, .15)}#playground-layout{display:flex;height:100vh;flex-direction:column}#playground-layout>split-panel{flex-grow:1}#genome-spy-container,#editor-and-others,code-editor,file-pane{position:absolute;top:0;right:0;bottom:0;left:0;overflow:hidden}.toolbar{background-color:#548fcc;color:#fff;box-shadow:0 0 6px #0006;display:flex;align-items:center;height:46px}.toolbar a,.toolbar button,.toolbar span{text-shadow:0 1px 2px rgba(0,0,0,.2)}.toolbar .genome-spy-icon img{display:block;height:40px;transform:rotate(0);transition:.5s ease-in-out}.toolbar .genome-spy-icon img:hover{transform:rotate(360deg)}.toolbar>*{margin-left:10px;display:block;flex-shrink:0}.toolbar>:last-child{margin-right:10px}.toolbar>.vis-title{flex-grow:1;flex-shrink:1;font-style:italic;font-size:85%}.toolbar .tool-button{display:flex;align-items:center;color:#fff;font-size:90%;border:none;background-color:#548fcc;padding-left:10px;padding-right:10px;height:100%}.toolbar .tool-button:hover{background-color:#689cd2}.toolbar .tool-button:focus{outline:none}.toolbar .tool-button svg{font-size:120%}.toolbar .tool-button>:not(:first-child){margin-left:.5em}.toolbar .tool-button:active{box-shadow:inset 0 3px 3px #0000001a}.toolbar .tool-button:active>*{position:relative;top:1px}.toolbar a{text-decoration:none}.toolbar .title{font-family:Medula One,cursive;font-size:30px;margin-right:10px}.toolbar .version{font-size:85%}@media (max-width: 600px){.toolbar .hide-mobile{display:none}}file-pane{position:absolute}.tab-wrapper{position:absolute;top:10px;right:10px;bottom:10px;left:10px;display:flex;flex-direction:column;gap:10px}ul.tabs{display:flex;margin:0;padding:0;font-size:13px}ul.tabs li{display:block;margin:0;padding:5px 10px;border-bottom:2px solid #eee}ul.tabs li.selected{border-bottom-color:#ccc;background-color:#eee}ul.tabs a{color:#000;text-decoration:none}.tab-pages{flex:1;overflow:auto}.tab-pages>div{font-size:.9rem;display:none}.tab-pages>div.selected{display:block}.data-sample-table{font-size:11px;border-collapse:collapse}.data-sample-table td,.data-sample-table th{text-align:left;padding:5px;max-width:20em;overflow:hidden;text-overflow:ellipsis;text-wrap:nowrap}.data-sample-table td{border-top:1px solid #f0f0f0;border-bottom:1px solid #f0f0f0}.data-sample-table th{top:0;position:sticky;background-color:#fff;border-bottom:1px solid #c0c0c0}.missing-files{border:1px solid orange;border-radius:.5em;padding:.8em}.missing-files>:first-child{margin-top:0}.missing-files>:last-child{margin-bottom:0}.missing-files ul{font-family:monospace;padding-left:2em}.upload-form #upload-button-wrapper{display:flex;align-items:center;justify-content:center;height:70px}.upload-form p{color:#444}.upload-form pre{background-color:#f8f8f8;padding:10px}.btn{background-color:#548fcc;padding:8px 1em;color:#fff;border:0;border-radius:3px;font-weight:700;font-size:13px}.btn:hover{background-color:#6097d0}.btn:focus{outline:none;box-shadow:0 0 4px #0af}.btn:active{padding-top:9px;padding-bottom:7px;box-shadow:0 0 4px #0af,inset 0 3px 3px #0003} diff --git a/playground/assets/jsonMode-Co5BPlPO.js b/playground/assets/jsonMode-hN_PqfqK.js similarity index 99% rename from playground/assets/jsonMode-Co5BPlPO.js rename to playground/assets/jsonMode-hN_PqfqK.js index 5d67b06..34a936f 100644 --- a/playground/assets/jsonMode-Co5BPlPO.js +++ b/playground/assets/jsonMode-hN_PqfqK.js @@ -1,4 +1,4 @@ -var $e=Object.defineProperty;var Ge=(e,n,i)=>n in e?$e(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i;var C=(e,n,i)=>Ge(e,typeof n!="symbol"?n+"":n,i);import{m as Qe}from"./index-DpynXagb.js";/*!----------------------------------------------------------------------------- +var $e=Object.defineProperty;var Ge=(e,n,i)=>n in e?$e(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i;var C=(e,n,i)=>Ge(e,typeof n!="symbol"?n+"":n,i);import{m as Qe}from"./index-B_ipwRdW.js";/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.44.0(3e047efd345ff102c8c61b5398fb30845aaac166) * Released under the MIT license diff --git a/playground/assets/long-DmGCVeXr.js b/playground/assets/long-eu6Hf4GH.js similarity index 99% rename from playground/assets/long-DmGCVeXr.js rename to playground/assets/long-eu6Hf4GH.js index 2d9fe9f..e2c6fa1 100644 --- a/playground/assets/long-DmGCVeXr.js +++ b/playground/assets/long-eu6Hf4GH.js @@ -1 +1 @@ -import{b as Pi}from"./index-BHN4ZNUB.js";import{g as Da}from"./_commonjsHelpers-DM6icglO.js";var re={};(function(e){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function t(n,h){return Object.prototype.hasOwnProperty.call(n,h)}e.assign=function(n){for(var h=Array.prototype.slice.call(arguments,1);h.length;){var f=h.shift();if(f){if(typeof f!="object")throw new TypeError(f+"must be non-object");for(var _ in f)t(f,_)&&(n[_]=f[_])}}return n},e.shrinkBuf=function(n,h){return n.length===h?n:n.subarray?n.subarray(0,h):(n.length=h,n)};var a={arraySet:function(n,h,f,_,l){if(h.subarray&&n.subarray){n.set(h.subarray(f,f+_),l);return}for(var o=0;o<_;o++)n[l+o]=h[f+o]},flattenChunks:function(n){var h,f,_,l,o,v;for(_=0,h=0,f=n.length;h=0;)e[i]=0}var Ua=0,Ki=1,$a=2,Ma=3,Ha=258,$t=29,Ge=256,He=Ge+1+$t,Ne=30,Mt=19,Yi=2*He+1,se=15,bt=16,Pa=7,Ht=256,Xi=16,qi=17,Gi=18,Ot=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],ft=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Ka=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Wi=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Ya=512,ne=new Array((He+2)*2);Ie(ne);var Be=new Array(Ne*2);Ie(Be);var Pe=new Array(Ya);Ie(Pe);var Ke=new Array(Ha-Ma+1);Ie(Ke);var Pt=new Array($t);Ie(Pt);var ut=new Array(Ne);Ie(ut);function pt(e,i,t,a,r){this.static_tree=e,this.extra_bits=i,this.extra_base=t,this.elems=a,this.max_length=r,this.has_stree=e&&e.length}var ji,Vi,Ji;function xt(e,i){this.dyn_tree=e,this.max_code=0,this.stat_desc=i}function Qi(e){return e<256?Pe[e]:Pe[256+(e>>>7)]}function Ye(e,i){e.pending_buf[e.pending++]=i&255,e.pending_buf[e.pending++]=i>>>8&255}function C(e,i,t){e.bi_valid>bt-t?(e.bi_buf|=i<>bt-e.bi_valid,e.bi_valid+=t-bt):(e.bi_buf|=i<>>=1,t<<=1;while(--i>0);return t>>>1}function Xa(e){e.bi_valid===16?(Ye(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function qa(e,i){var t=i.dyn_tree,a=i.max_code,r=i.stat_desc.static_tree,n=i.stat_desc.has_stree,h=i.stat_desc.extra_bits,f=i.stat_desc.extra_base,_=i.stat_desc.max_length,l,o,v,d,u,g,w=0;for(d=0;d<=se;d++)e.bl_count[d]=0;for(t[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l_&&(d=_,w++),t[o*2+1]=d,!(o>a)&&(e.bl_count[d]++,u=0,o>=f&&(u=h[o-f]),g=t[o*2],e.opt_len+=g*(d+u),n&&(e.static_len+=g*(r[o*2+1]+u)));if(w!==0){do{for(d=_-1;e.bl_count[d]===0;)d--;e.bl_count[d]--,e.bl_count[d+1]+=2,e.bl_count[_]--,w-=2}while(w>0);for(d=_;d!==0;d--)for(o=e.bl_count[d];o!==0;)v=e.heap[--l],!(v>a)&&(t[v*2+1]!==d&&(e.opt_len+=(d-t[v*2+1])*t[v*2],t[v*2+1]=d),o--)}}function ta(e,i,t){var a=new Array(se+1),r=0,n,h;for(n=1;n<=se;n++)a[n]=r=r+t[n-1]<<1;for(h=0;h<=i;h++){var f=e[h*2+1];f!==0&&(e[h*2]=ea(a[f]++,f))}}function Ga(){var e,i,t,a,r,n=new Array(se+1);for(t=0,a=0;a<$t-1;a++)for(Pt[a]=t,e=0;e<1<>=7;a8?Ye(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function Wa(e,i,t,a){aa(e),Ye(e,t),Ye(e,~t),Ra.arraySet(e.pending_buf,e.window,i,t,e.pending),e.pending+=t}function Jt(e,i,t,a){var r=i*2,n=t*2;return e[r]>1;h>=1;h--)kt(e,t,h);l=n;do h=e.heap[1],e.heap[1]=e.heap[e.heap_len--],kt(e,t,1),f=e.heap[1],e.heap[--e.heap_max]=h,e.heap[--e.heap_max]=f,t[l*2]=t[h*2]+t[f*2],e.depth[l]=(e.depth[h]>=e.depth[f]?e.depth[h]:e.depth[f])+1,t[h*2+1]=t[f*2+1]=l,e.heap[1]=l++,kt(e,t,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],qa(e,i),ta(t,_,e.bl_count)}function ei(e,i,t){var a,r=-1,n,h=i[0*2+1],f=0,_=7,l=4;for(h===0&&(_=138,l=3),i[(t+1)*2+1]=65535,a=0;a<=t;a++)n=h,h=i[(a+1)*2+1],!(++f<_&&n===h)&&(f=3&&e.bl_tree[Wi[i]*2+1]===0;i--);return e.opt_len+=3*(i+1)+5+5+4,i}function Va(e,i,t,a){var r;for(C(e,i-257,5),C(e,t-1,5),C(e,a-4,4),r=0;r>>=1)if(i&1&&e.dyn_ltree[t*2]!==0)return jt;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return Vt;for(t=32;t0?(e.strm.data_type===Ca&&(e.strm.data_type=Ja(e)),Zt(e,e.l_desc),Zt(e,e.d_desc),h=ja(e),r=e.opt_len+3+7>>>3,n=e.static_len+3+7>>>3,n<=r&&(r=n)):r=n=t+5,t+4<=r&&i!==-1?na(e,i,t,a):e.strategy===Ba||n===r?(C(e,(Ki<<1)+(a?1:0),3),Qt(e,ne,Be)):(C(e,($a<<1)+(a?1:0),3),Va(e,e.l_desc.max_code+1,e.d_desc.max_code+1,h+1),Qt(e,e.dyn_ltree,e.dyn_dtree)),ia(e),a&&aa(e)}function an(e,i,t){return e.pending_buf[e.d_buf+e.last_lit*2]=i>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=i&255,e.pending_buf[e.l_buf+e.last_lit]=t&255,e.last_lit++,i===0?e.dyn_ltree[t*2]++:(e.matches++,i--,e.dyn_ltree[(Ke[t]+Ge+1)*2]++,e.dyn_dtree[Qi(i)*2]++),e.last_lit===e.lit_bufsize-1}Ze._tr_init=Qa;Ze._tr_stored_block=na;Ze._tr_flush_block=tn;Ze._tr_tally=an;Ze._tr_align=en;function nn(e,i,t,a){for(var r=e&65535|0,n=e>>>16&65535|0,h=0;t!==0;){h=t>2e3?2e3:t,t-=h;do r=r+i[a++]|0,n=n+r|0;while(--h);r%=65521,n%=65521}return r|n<<16|0}var ra=nn;function rn(){for(var e,i=[],t=0;t<256;t++){e=t;for(var a=0;a<8;a++)e=e&1?3988292384^e>>>1:e>>>1;i[t]=e}return i}var fn=rn();function hn(e,i,t,a){var r=fn,n=a+t;e^=-1;for(var h=a;h>>8^r[(e^i[h])&255];return e^-1}var fa=hn,Kt={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},B=re,Y=Ze,ha=ra,he=fa,ln=Kt,ke=0,on=1,_n=3,de=4,ai=5,te=0,ni=1,X=-2,un=-3,Et=-5,dn=-1,sn=1,tt=2,cn=3,vn=4,gn=0,wn=2,vt=8,bn=9,pn=15,xn=8,kn=29,En=256,It=En+1+kn,Sn=30,yn=19,mn=2*It+1,Fn=15,S=3,_e=258,W=_e+S+1,Tn=32,gt=42,Lt=69,ht=73,lt=91,ot=103,ce=113,Re=666,D=1,We=2,ge=3,Le=4,Nn=3;function ue(e,i){return e.msg=ln[i],i}function ri(e){return(e<<1)-(e>4?9:0)}function oe(e){for(var i=e.length;--i>=0;)e[i]=0}function le(e){var i=e.state,t=i.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(B.arraySet(e.output,i.pending_buf,i.pending_out,t,e.next_out),e.next_out+=t,i.pending_out+=t,e.total_out+=t,e.avail_out-=t,i.pending-=t,i.pending===0&&(i.pending_out=0))}function R(e,i){Y._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,i),e.block_start=e.strstart,le(e.strm)}function F(e,i){e.pending_buf[e.pending++]=i}function De(e,i){e.pending_buf[e.pending++]=i>>>8&255,e.pending_buf[e.pending++]=i&255}function zn(e,i,t,a){var r=e.avail_in;return r>a&&(r=a),r===0?0:(e.avail_in-=r,B.arraySet(i,e.input,e.next_in,r,t),e.state.wrap===1?e.adler=ha(e.adler,i,r,t):e.state.wrap===2&&(e.adler=he(e.adler,i,r,t)),e.next_in+=r,e.total_in+=r,r)}function la(e,i){var t=e.max_chain_length,a=e.strstart,r,n,h=e.prev_length,f=e.nice_match,_=e.strstart>e.w_size-W?e.strstart-(e.w_size-W):0,l=e.window,o=e.w_mask,v=e.prev,d=e.strstart+_e,u=l[a+h-1],g=l[a+h];e.prev_length>=e.good_match&&(t>>=2),f>e.lookahead&&(f=e.lookahead);do if(r=i,!(l[r+h]!==g||l[r+h-1]!==u||l[r]!==l[a]||l[++r]!==l[a+1])){a+=2,r++;do;while(l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&ah){if(e.match_start=i,h=n,n>=f)break;u=l[a+h-1],g=l[a+h]}}while((i=v[i&o])>_&&--t!==0);return h<=e.lookahead?h:e.lookahead}function we(e){var i=e.w_size,t,a,r,n,h;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=i+(i-W)){B.arraySet(e.window,e.window,i,i,0),e.match_start-=i,e.strstart-=i,e.block_start-=i,a=e.hash_size,t=a;do r=e.head[--t],e.head[t]=r>=i?r-i:0;while(--a);a=i,t=a;do r=e.prev[--t],e.prev[t]=r>=i?r-i:0;while(--a);n+=i}if(e.strm.avail_in===0)break;if(a=zn(e.strm,e.window,e.strstart+e.lookahead,n),e.lookahead+=a,e.lookahead+e.insert>=S)for(h=e.strstart-e.insert,e.ins_h=e.window[h],e.ins_h=(e.ins_h<e.pending_buf_size-5&&(t=e.pending_buf_size-5);;){if(e.lookahead<=1){if(we(e),e.lookahead===0&&i===ke)return D;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var a=e.block_start+t;if((e.strstart===0||e.strstart>=a)&&(e.lookahead=e.strstart-a,e.strstart=a,R(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-W&&(R(e,!1),e.strm.avail_out===0))return D}return e.insert=0,i===de?(R(e,!0),e.strm.avail_out===0?ge:Le):(e.strstart>e.block_start&&(R(e,!1),e.strm.avail_out===0),D)}function St(e,i){for(var t,a;;){if(e.lookahead=S&&(e.ins_h=(e.ins_h<=S)if(a=Y._tr_tally(e,e.strstart-e.match_start,e.match_length-S),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=S){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<=S&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=S-1)),e.prev_length>=S&&e.match_length<=e.prev_length){r=e.strstart+e.lookahead-S,a=Y._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-S),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=r&&(e.ins_h=(e.ins_h<=S&&e.strstart>0&&(r=e.strstart-1,a=h[r],a===h[++r]&&a===h[++r]&&a===h[++r])){n=e.strstart+_e;do;while(a===h[++r]&&a===h[++r]&&a===h[++r]&&a===h[++r]&&a===h[++r]&&a===h[++r]&&a===h[++r]&&a===h[++r]&&re.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=S?(t=Y._tr_tally(e,1,e.match_length-S),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(t=Y._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),t&&(R(e,!1),e.strm.avail_out===0))return D}return e.insert=0,i===de?(R(e,!0),e.strm.avail_out===0?ge:Le):e.last_lit&&(R(e,!1),e.strm.avail_out===0)?D:We}function Zn(e,i){for(var t;;){if(e.lookahead===0&&(we(e),e.lookahead===0)){if(i===ke)return D;break}if(e.match_length=0,t=Y._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,t&&(R(e,!1),e.strm.avail_out===0))return D}return e.insert=0,i===de?(R(e,!0),e.strm.avail_out===0?ge:Le):e.last_lit&&(R(e,!1),e.strm.avail_out===0)?D:We}function J(e,i,t,a,r){this.good_length=e,this.max_lazy=i,this.nice_length=t,this.max_chain=a,this.func=r}var Fe;Fe=[new J(0,0,0,0,An),new J(4,4,8,4,St),new J(4,5,16,8,St),new J(4,6,32,32,St),new J(4,4,16,16,ye),new J(8,16,32,32,ye),new J(8,16,128,128,ye),new J(8,32,128,256,ye),new J(32,128,258,1024,ye),new J(32,258,258,4096,ye)];function In(e){e.window_size=2*e.w_size,oe(e.head),e.max_lazy_match=Fe[e.level].max_lazy,e.good_match=Fe[e.level].good_length,e.nice_match=Fe[e.level].nice_length,e.max_chain_length=Fe[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=S-1,e.match_available=0,e.ins_h=0}function Ln(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=vt,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new B.Buf16(mn*2),this.dyn_dtree=new B.Buf16((2*Sn+1)*2),this.bl_tree=new B.Buf16((2*yn+1)*2),oe(this.dyn_ltree),oe(this.dyn_dtree),oe(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new B.Buf16(Fn+1),this.heap=new B.Buf16(2*It+1),oe(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new B.Buf16(2*It+1),oe(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function oa(e){var i;return!e||!e.state?ue(e,X):(e.total_in=e.total_out=0,e.data_type=wn,i=e.state,i.pending=0,i.pending_out=0,i.wrap<0&&(i.wrap=-i.wrap),i.status=i.wrap?gt:ce,e.adler=i.wrap===2?0:1,i.last_flush=ke,Y._tr_init(i),te)}function _a(e){var i=oa(e);return i===te&&In(e.state),i}function Dn(e,i){return!e||!e.state||e.state.wrap!==2?X:(e.state.gzhead=i,te)}function ua(e,i,t,a,r,n){if(!e)return X;var h=1;if(i===dn&&(i=6),a<0?(h=0,a=-a):a>15&&(h=2,a-=16),r<1||r>bn||t!==vt||a<8||a>15||i<0||i>9||n<0||n>vn)return ue(e,X);a===8&&(a=9);var f=new Ln;return e.state=f,f.strm=e,f.wrap=h,f.gzhead=null,f.w_bits=a,f.w_size=1<ai||i<0)return e?ue(e,X):X;if(a=e.state,!e.output||!e.input&&e.avail_in!==0||a.status===Re&&i!==de)return ue(e,e.avail_out===0?Et:X);if(a.strm=e,t=a.last_flush,a.last_flush=i,a.status===gt)if(a.wrap===2)e.adler=0,F(a,31),F(a,139),F(a,8),a.gzhead?(F(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),F(a,a.gzhead.time&255),F(a,a.gzhead.time>>8&255),F(a,a.gzhead.time>>16&255),F(a,a.gzhead.time>>24&255),F(a,a.level===9?2:a.strategy>=tt||a.level<2?4:0),F(a,a.gzhead.os&255),a.gzhead.extra&&a.gzhead.extra.length&&(F(a,a.gzhead.extra.length&255),F(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(e.adler=he(e.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=Lt):(F(a,0),F(a,0),F(a,0),F(a,0),F(a,0),F(a,a.level===9?2:a.strategy>=tt||a.level<2?4:0),F(a,Nn),a.status=ce);else{var h=vt+(a.w_bits-8<<4)<<8,f=-1;a.strategy>=tt||a.level<2?f=0:a.level<6?f=1:a.level===6?f=2:f=3,h|=f<<6,a.strstart!==0&&(h|=Tn),h+=31-h%31,a.status=ce,De(a,h),a.strstart!==0&&(De(a,e.adler>>>16),De(a,e.adler&65535)),e.adler=1}if(a.status===Lt)if(a.gzhead.extra){for(r=a.pending;a.gzindex<(a.gzhead.extra.length&65535)&&!(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>r&&(e.adler=he(e.adler,a.pending_buf,a.pending-r,r)),le(e),r=a.pending,a.pending===a.pending_buf_size));)F(a,a.gzhead.extra[a.gzindex]&255),a.gzindex++;a.gzhead.hcrc&&a.pending>r&&(e.adler=he(e.adler,a.pending_buf,a.pending-r,r)),a.gzindex===a.gzhead.extra.length&&(a.gzindex=0,a.status=ht)}else a.status=ht;if(a.status===ht)if(a.gzhead.name){r=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>r&&(e.adler=he(e.adler,a.pending_buf,a.pending-r,r)),le(e),r=a.pending,a.pending===a.pending_buf_size)){n=1;break}a.gzindexr&&(e.adler=he(e.adler,a.pending_buf,a.pending-r,r)),n===0&&(a.gzindex=0,a.status=lt)}else a.status=lt;if(a.status===lt)if(a.gzhead.comment){r=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>r&&(e.adler=he(e.adler,a.pending_buf,a.pending-r,r)),le(e),r=a.pending,a.pending===a.pending_buf_size)){n=1;break}a.gzindexr&&(e.adler=he(e.adler,a.pending_buf,a.pending-r,r)),n===0&&(a.status=ot)}else a.status=ot;if(a.status===ot&&(a.gzhead.hcrc?(a.pending+2>a.pending_buf_size&&le(e),a.pending+2<=a.pending_buf_size&&(F(a,e.adler&255),F(a,e.adler>>8&255),e.adler=0,a.status=ce)):a.status=ce),a.pending!==0){if(le(e),e.avail_out===0)return a.last_flush=-1,te}else if(e.avail_in===0&&ri(i)<=ri(t)&&i!==de)return ue(e,Et);if(a.status===Re&&e.avail_in!==0)return ue(e,Et);if(e.avail_in!==0||a.lookahead!==0||i!==ke&&a.status!==Re){var _=a.strategy===tt?Zn(a,i):a.strategy===cn?On(a,i):Fe[a.level].func(a,i);if((_===ge||_===Le)&&(a.status=Re),_===D||_===ge)return e.avail_out===0&&(a.last_flush=-1),te;if(_===We&&(i===on?Y._tr_align(a):i!==ai&&(Y._tr_stored_block(a,0,0,!1),i===_n&&(oe(a.head),a.lookahead===0&&(a.strstart=0,a.block_start=0,a.insert=0))),le(e),e.avail_out===0))return a.last_flush=-1,te}return i!==de?te:a.wrap<=0?ni:(a.wrap===2?(F(a,e.adler&255),F(a,e.adler>>8&255),F(a,e.adler>>16&255),F(a,e.adler>>24&255),F(a,e.total_in&255),F(a,e.total_in>>8&255),F(a,e.total_in>>16&255),F(a,e.total_in>>24&255)):(De(a,e.adler>>>16),De(a,e.adler&65535)),le(e),a.wrap>0&&(a.wrap=-a.wrap),a.pending!==0?te:ni)}function Cn(e){var i;return!e||!e.state?X:(i=e.state.status,i!==gt&&i!==Lt&&i!==ht&&i!==lt&&i!==ot&&i!==ce&&i!==Re?ue(e,X):(e.state=null,i===ce?ue(e,un):te))}function Un(e,i){var t=i.length,a,r,n,h,f,_,l,o;if(!e||!e.state||(a=e.state,h=a.wrap,h===2||h===1&&a.status!==gt||a.lookahead))return X;for(h===1&&(e.adler=ha(e.adler,i,t,0)),a.wrap=0,t>=a.w_size&&(h===0&&(oe(a.head),a.strstart=0,a.block_start=0,a.insert=0),o=new B.Buf8(a.w_size),B.arraySet(o,i,t-a.w_size,a.w_size,0),i=o,t=a.w_size),f=e.avail_in,_=e.next_in,l=e.input,e.avail_in=t,e.next_in=0,e.input=i,we(a);a.lookahead>=S;){r=a.strstart,n=a.lookahead-(S-1);do a.ins_h=(a.ins_h<=252?6:fe>=248?5:fe>=240?4:fe>=224?3:fe>=192?2:1;Xe[254]=Xe[254]=1;Ee.string2buf=function(e){var i,t,a,r,n,h=e.length,f=0;for(r=0;r>>6,i[n++]=128|t&63):t<65536?(i[n++]=224|t>>>12,i[n++]=128|t>>>6&63,i[n++]=128|t&63):(i[n++]=240|t>>>18,i[n++]=128|t>>>12&63,i[n++]=128|t>>>6&63,i[n++]=128|t&63);return i};function ca(e,i){if(i<65534&&(e.subarray&&sa||!e.subarray&&da))return String.fromCharCode.apply(null,wt.shrinkBuf(e,i));for(var t="",a=0;a4){f[a++]=65533,t+=n-1;continue}for(r&=n===2?31:n===3?15:7;n>1&&t1){f[a++]=65533;continue}r<65536?f[a++]=r:(r-=65536,f[a++]=55296|r>>10&1023,f[a++]=56320|r&1023)}return ca(f,a)};Ee.utf8border=function(e,i){var t;for(i=i||e.length,i>e.length&&(i=e.length),t=i-1;t>=0&&(e[t]&192)===128;)t--;return t<0||t===0?i:t+Xe[e[t]]>i?t:i};function $n(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var va=$n,Ce=ie,Ue=re,Dt=Ee,Rt=Kt,Mn=va,ga=Object.prototype.toString,Hn=0,yt=4,ze=0,fi=1,hi=2,Pn=-1,Kn=0,Yn=8;function be(e){if(!(this instanceof be))return new be(e);this.options=Ue.assign({level:Pn,method:Yn,chunkSize:16384,windowBits:15,memLevel:8,strategy:Kn,to:""},e||{});var i=this.options;i.raw&&i.windowBits>0?i.windowBits=-i.windowBits:i.gzip&&i.windowBits>0&&i.windowBits<16&&(i.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Mn,this.strm.avail_out=0;var t=Ce.deflateInit2(this.strm,i.level,i.method,i.windowBits,i.memLevel,i.strategy);if(t!==ze)throw new Error(Rt[t]);if(i.header&&Ce.deflateSetHeader(this.strm,i.header),i.dictionary){var a;if(typeof i.dictionary=="string"?a=Dt.string2buf(i.dictionary):ga.call(i.dictionary)==="[object ArrayBuffer]"?a=new Uint8Array(i.dictionary):a=i.dictionary,t=Ce.deflateSetDictionary(this.strm,a),t!==ze)throw new Error(Rt[t]);this._dict_set=!0}}be.prototype.push=function(e,i){var t=this.strm,a=this.options.chunkSize,r,n;if(this.ended)return!1;n=i===~~i?i:i===!0?yt:Hn,typeof e=="string"?t.input=Dt.string2buf(e):ga.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;do{if(t.avail_out===0&&(t.output=new Ue.Buf8(a),t.next_out=0,t.avail_out=a),r=Ce.deflate(t,n),r!==fi&&r!==ze)return this.onEnd(r),this.ended=!0,!1;(t.avail_out===0||t.avail_in===0&&(n===yt||n===hi))&&(this.options.to==="string"?this.onData(Dt.buf2binstring(Ue.shrinkBuf(t.output,t.next_out))):this.onData(Ue.shrinkBuf(t.output,t.next_out)))}while((t.avail_in>0||t.avail_out===0)&&r!==fi);return n===yt?(r=Ce.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===ze):(n===hi&&(this.onEnd(ze),t.avail_out=0),!0)};be.prototype.onData=function(e){this.chunks.push(e)};be.prototype.onEnd=function(e){e===ze&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Ue.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Yt(e,i){var t=new be(i);if(t.push(e,!0),t.err)throw t.msg||Rt[t.err];return t.result}function Xn(e,i){return i=i||{},i.raw=!0,Yt(e,i)}function qn(e,i){return i=i||{},i.gzip=!0,Yt(e,i)}qe.Deflate=be;qe.deflate=Yt;qe.deflateRaw=Xn;qe.gzip=qn;var je={},j={},it=30,Gn=12,Wn=function(i,t){var a,r,n,h,f,_,l,o,v,d,u,g,w,k,b,N,z,E,c,T,y,p,m,I,x;a=i.state,r=i.next_in,I=i.input,n=r+(i.avail_in-5),h=i.next_out,x=i.output,f=h-(t-i.avail_out),_=h+(i.avail_out-257),l=a.dmax,o=a.wsize,v=a.whave,d=a.wnext,u=a.window,g=a.hold,w=a.bits,k=a.lencode,b=a.distcode,N=(1<>>24,g>>>=c,w-=c,c=E>>>16&255,c===0)x[h++]=E&65535;else if(c&16){T=E&65535,c&=15,c&&(w>>=c,w-=c),w<15&&(g+=I[r++]<>>24,g>>>=c,w-=c,c=E>>>16&255,c&16){if(y=E&65535,c&=15,wl){i.msg="invalid distance too far back",a.mode=it;break e}if(g>>>=c,w-=c,c=h-f,y>c){if(c=y-c,c>v&&a.sane){i.msg="invalid distance too far back",a.mode=it;break e}if(p=0,m=u,d===0){if(p+=o-c,c2;)x[h++]=m[p++],x[h++]=m[p++],x[h++]=m[p++],T-=3;T&&(x[h++]=m[p++],T>1&&(x[h++]=m[p++]))}else{p=h-y;do x[h++]=x[p++],x[h++]=x[p++],x[h++]=x[p++],T-=3;while(T>2);T&&(x[h++]=x[p++],T>1&&(x[h++]=x[p++]))}}else if(c&64){i.msg="invalid distance code",a.mode=it;break e}else{E=b[(E&65535)+(g&(1<>3,r-=T,w-=T<<3,g&=(1<=1&&G[u]===0;u--);if(g>u&&(g=u),u===0)return n[h++]=1<<24|64<<16|0,n[h++]=1<<24|64<<16|0,_.bits=1,0;for(d=1;d0&&(i===ui||u!==1))return-1;for(Ve[1]=0,o=1;ooi||i===di&&N>_i)return 1;for(;;){Wt=o-k,f[v]x?(Qe=Je[Gt+f[v]],et=m[I+f[v]]):(Qe=96,et=0),E=1<>k)+c]=Wt<<24|Qe<<16|et|0;while(c!==0);for(E=1<>=1;if(E!==0?(z&=E-1,z+=E):z=0,v++,--G[o]===0){if(o===u)break;o=t[a+f[v]]}if(o>g&&(z&y)!==T){for(k===0&&(k=g),p+=d,w=o-k,b=1<oi||i===di&&N>_i)return 1;T=z&y,n[T]=g<<24|w<<16|p-h|0}}return z!==0&&(n[p+z]=o-k<<24|64<<16|0),_.bits=g,0},M=re,Bt=ra,Q=fa,tr=Wn,$e=er,ir=0,wa=1,ba=2,si=4,ar=5,at=6,pe=0,nr=1,rr=2,q=-2,pa=-3,xa=-4,fr=-5,ci=8,ka=1,vi=2,gi=3,wi=4,bi=5,pi=6,xi=7,ki=8,Ei=9,Si=10,dt=11,ae=12,Ft=13,yi=14,Tt=15,mi=16,Fi=17,Ti=18,Ni=19,nt=20,rt=21,zi=22,Ai=23,Oi=24,Zi=25,Ii=26,Nt=27,Li=28,Di=29,Z=30,Ea=31,hr=32,lr=852,or=592,_r=15,ur=_r;function Ri(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function dr(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new M.Buf16(320),this.work=new M.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Sa(e){var i;return!e||!e.state?q:(i=e.state,e.total_in=e.total_out=i.total=0,e.msg="",i.wrap&&(e.adler=i.wrap&1),i.mode=ka,i.last=0,i.havedict=0,i.dmax=32768,i.head=null,i.hold=0,i.bits=0,i.lencode=i.lendyn=new M.Buf32(lr),i.distcode=i.distdyn=new M.Buf32(or),i.sane=1,i.back=-1,pe)}function ya(e){var i;return!e||!e.state?q:(i=e.state,i.wsize=0,i.whave=0,i.wnext=0,Sa(e))}function ma(e,i){var t,a;return!e||!e.state||(a=e.state,i<0?(t=0,i=-i):(t=(i>>4)+1,i<48&&(i&=15)),i&&(i<8||i>15))?q:(a.window!==null&&a.wbits!==i&&(a.window=null),a.wrap=t,a.wbits=i,ya(e))}function Fa(e,i){var t,a;return e?(a=new dr,e.state=a,a.window=null,t=ma(e,i),t!==pe&&(e.state=null),t):q}function sr(e){return Fa(e,ur)}var Bi=!0,zt,At;function cr(e){if(Bi){var i;for(zt=new M.Buf32(512),At=new M.Buf32(32),i=0;i<144;)e.lens[i++]=8;for(;i<256;)e.lens[i++]=9;for(;i<280;)e.lens[i++]=7;for(;i<288;)e.lens[i++]=8;for($e(wa,e.lens,0,288,zt,0,e.work,{bits:9}),i=0;i<32;)e.lens[i++]=5;$e(ba,e.lens,0,32,At,0,e.work,{bits:5}),Bi=!1}e.lencode=zt,e.lenbits=9,e.distcode=At,e.distbits=5}function Ta(e,i,t,a){var r,n=e.state;return n.window===null&&(n.wsize=1<=n.wsize?(M.arraySet(n.window,i,t-n.wsize,n.wsize,0),n.wnext=0,n.whave=n.wsize):(r=n.wsize-n.wnext,r>a&&(r=a),M.arraySet(n.window,i,t-a,r,n.wnext),a-=r,a?(M.arraySet(n.window,i,t-a,a,0),n.wnext=a,n.whave=n.wsize):(n.wnext+=r,n.wnext===n.wsize&&(n.wnext=0),n.whave>>8&255,t.check=Q(t.check,m,2,0),l=0,o=0,t.mode=vi;break}if(t.flags=0,t.head&&(t.head.done=!1),!(t.wrap&1)||(((l&255)<<8)+(l>>8))%31){e.msg="incorrect header check",t.mode=Z;break}if((l&15)!==ci){e.msg="unknown compression method",t.mode=Z;break}if(l>>>=4,o-=4,y=(l&15)+8,t.wbits===0)t.wbits=y;else if(y>t.wbits){e.msg="invalid window size",t.mode=Z;break}t.dmax=1<>8&1),t.flags&512&&(m[0]=l&255,m[1]=l>>>8&255,t.check=Q(t.check,m,2,0)),l=0,o=0,t.mode=gi;case gi:for(;o<32;){if(f===0)break e;f--,l+=a[n++]<>>8&255,m[2]=l>>>16&255,m[3]=l>>>24&255,t.check=Q(t.check,m,4,0)),l=0,o=0,t.mode=wi;case wi:for(;o<16;){if(f===0)break e;f--,l+=a[n++]<>8),t.flags&512&&(m[0]=l&255,m[1]=l>>>8&255,t.check=Q(t.check,m,2,0)),l=0,o=0,t.mode=bi;case bi:if(t.flags&1024){for(;o<16;){if(f===0)break e;f--,l+=a[n++]<>>8&255,t.check=Q(t.check,m,2,0)),l=0,o=0}else t.head&&(t.head.extra=null);t.mode=pi;case pi:if(t.flags&1024&&(u=t.length,u>f&&(u=f),u&&(t.head&&(y=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Array(t.head.extra_len)),M.arraySet(t.head.extra,a,n,u,y)),t.flags&512&&(t.check=Q(t.check,a,u,n)),f-=u,n+=u,t.length-=u),t.length))break e;t.length=0,t.mode=xi;case xi:if(t.flags&2048){if(f===0)break e;u=0;do y=a[n+u++],t.head&&y&&t.length<65536&&(t.head.name+=String.fromCharCode(y));while(y&&u>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=ae;break;case Si:for(;o<32;){if(f===0)break e;f--,l+=a[n++]<>>=o&7,o-=o&7,t.mode=Nt;break}for(;o<3;){if(f===0)break e;f--,l+=a[n++]<>>=1,o-=1,l&3){case 0:t.mode=yi;break;case 1:if(cr(t),t.mode=nt,i===at){l>>>=2,o-=2;break e}break;case 2:t.mode=Fi;break;case 3:e.msg="invalid block type",t.mode=Z}l>>>=2,o-=2;break;case yi:for(l>>>=o&7,o-=o&7;o<32;){if(f===0)break e;f--,l+=a[n++]<>>16^65535)){e.msg="invalid stored block lengths",t.mode=Z;break}if(t.length=l&65535,l=0,o=0,t.mode=Tt,i===at)break e;case Tt:t.mode=mi;case mi:if(u=t.length,u){if(u>f&&(u=f),u>_&&(u=_),u===0)break e;M.arraySet(r,a,n,u,h),f-=u,n+=u,_-=u,h+=u,t.length-=u;break}t.mode=ae;break;case Fi:for(;o<14;){if(f===0)break e;f--,l+=a[n++]<>>=5,o-=5,t.ndist=(l&31)+1,l>>>=5,o-=5,t.ncode=(l&15)+4,l>>>=4,o-=4,t.nlen>286||t.ndist>30){e.msg="too many length or distance symbols",t.mode=Z;break}t.have=0,t.mode=Ti;case Ti:for(;t.have>>=3,o-=3}for(;t.have<19;)t.lens[G[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,I={bits:t.lenbits},p=$e(ir,t.lens,0,19,t.lencode,0,t.work,I),t.lenbits=I.bits,p){e.msg="invalid code lengths set",t.mode=Z;break}t.have=0,t.mode=Ni;case Ni:for(;t.have>>24,N=k>>>16&255,z=k&65535,!(b<=o);){if(f===0)break e;f--,l+=a[n++]<>>=b,o-=b,t.lens[t.have++]=z;else{if(z===16){for(x=b+2;o>>=b,o-=b,t.have===0){e.msg="invalid bit length repeat",t.mode=Z;break}y=t.lens[t.have-1],u=3+(l&3),l>>>=2,o-=2}else if(z===17){for(x=b+3;o>>=b,o-=b,y=0,u=3+(l&7),l>>>=3,o-=3}else{for(x=b+7;o>>=b,o-=b,y=0,u=11+(l&127),l>>>=7,o-=7}if(t.have+u>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=Z;break}for(;u--;)t.lens[t.have++]=y}}if(t.mode===Z)break;if(t.lens[256]===0){e.msg="invalid code -- missing end-of-block",t.mode=Z;break}if(t.lenbits=9,I={bits:t.lenbits},p=$e(wa,t.lens,0,t.nlen,t.lencode,0,t.work,I),t.lenbits=I.bits,p){e.msg="invalid literal/lengths set",t.mode=Z;break}if(t.distbits=6,t.distcode=t.distdyn,I={bits:t.distbits},p=$e(ba,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,I),t.distbits=I.bits,p){e.msg="invalid distances set",t.mode=Z;break}if(t.mode=nt,i===at)break e;case nt:t.mode=rt;case rt:if(f>=6&&_>=258){e.next_out=h,e.avail_out=_,e.next_in=n,e.avail_in=f,t.hold=l,t.bits=o,tr(e,d),h=e.next_out,r=e.output,_=e.avail_out,n=e.next_in,a=e.input,f=e.avail_in,l=t.hold,o=t.bits,t.mode===ae&&(t.back=-1);break}for(t.back=0;k=t.lencode[l&(1<>>24,N=k>>>16&255,z=k&65535,!(b<=o);){if(f===0)break e;f--,l+=a[n++]<>E)],b=k>>>24,N=k>>>16&255,z=k&65535,!(E+b<=o);){if(f===0)break e;f--,l+=a[n++]<>>=E,o-=E,t.back+=E}if(l>>>=b,o-=b,t.back+=b,t.length=z,N===0){t.mode=Ii;break}if(N&32){t.back=-1,t.mode=ae;break}if(N&64){e.msg="invalid literal/length code",t.mode=Z;break}t.extra=N&15,t.mode=zi;case zi:if(t.extra){for(x=t.extra;o>>=t.extra,o-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=Ai;case Ai:for(;k=t.distcode[l&(1<>>24,N=k>>>16&255,z=k&65535,!(b<=o);){if(f===0)break e;f--,l+=a[n++]<>E)],b=k>>>24,N=k>>>16&255,z=k&65535,!(E+b<=o);){if(f===0)break e;f--,l+=a[n++]<>>=E,o-=E,t.back+=E}if(l>>>=b,o-=b,t.back+=b,N&64){e.msg="invalid distance code",t.mode=Z;break}t.offset=z,t.extra=N&15,t.mode=Oi;case Oi:if(t.extra){for(x=t.extra;o>>=t.extra,o-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back",t.mode=Z;break}t.mode=Zi;case Zi:if(_===0)break e;if(u=d-_,t.offset>u){if(u=t.offset-u,u>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=Z;break}u>t.wnext?(u-=t.wnext,g=t.wsize-u):g=t.wnext-u,u>t.length&&(u=t.length),w=t.window}else w=r,g=h-t.offset,u=t.length;u>_&&(u=_),_-=u,t.length-=u;do r[h++]=w[g++];while(--u);t.length===0&&(t.mode=rt);break;case Ii:if(_===0)break e;r[h++]=t.length,_--,t.mode=rt;break;case Nt:if(t.wrap){for(;o<32;){if(f===0)break e;f--,l|=a[n++]<=0&&i.windowBits<16&&(i.windowBits=-i.windowBits,i.windowBits===0&&(i.windowBits=-15)),i.windowBits>=0&&i.windowBits<16&&!(e&&e.windowBits)&&(i.windowBits+=32),i.windowBits>15&&i.windowBits<48&&(i.windowBits&15||(i.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new kr,this.strm.avail_out=0;var t=Ae.inflateInit2(this.strm,i.windowBits);if(t!==L.Z_OK)throw new Error(Ct[t]);if(this.header=new Er,Ae.inflateGetHeader(this.strm,this.header),i.dictionary&&(typeof i.dictionary=="string"?i.dictionary=_t.string2buf(i.dictionary):za.call(i.dictionary)==="[object ArrayBuffer]"&&(i.dictionary=new Uint8Array(i.dictionary)),i.raw&&(t=Ae.inflateSetDictionary(this.strm,i.dictionary),t!==L.Z_OK)))throw new Error(Ct[t])}xe.prototype.push=function(e,i){var t=this.strm,a=this.options.chunkSize,r=this.options.dictionary,n,h,f,_,l,o=!1;if(this.ended)return!1;h=i===~~i?i:i===!0?L.Z_FINISH:L.Z_NO_FLUSH,typeof e=="string"?t.input=_t.binstring2buf(e):za.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;do{if(t.avail_out===0&&(t.output=new Me.Buf8(a),t.next_out=0,t.avail_out=a),n=Ae.inflate(t,L.Z_NO_FLUSH),n===L.Z_NEED_DICT&&r&&(n=Ae.inflateSetDictionary(this.strm,r)),n===L.Z_BUF_ERROR&&o===!0&&(n=L.Z_OK,o=!1),n!==L.Z_STREAM_END&&n!==L.Z_OK)return this.onEnd(n),this.ended=!0,!1;t.next_out&&(t.avail_out===0||n===L.Z_STREAM_END||t.avail_in===0&&(h===L.Z_FINISH||h===L.Z_SYNC_FLUSH))&&(this.options.to==="string"?(f=_t.utf8border(t.output,t.next_out),_=t.next_out-f,l=_t.buf2string(t.output,f),t.next_out=_,t.avail_out=a-_,_&&Me.arraySet(t.output,t.output,f,_,0),this.onData(l)):this.onData(Me.shrinkBuf(t.output,t.next_out))),t.avail_in===0&&t.avail_out===0&&(o=!0)}while((t.avail_in>0||t.avail_out===0)&&n!==L.Z_STREAM_END);return n===L.Z_STREAM_END&&(h=L.Z_FINISH),h===L.Z_FINISH?(n=Ae.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===L.Z_OK):(h===L.Z_SYNC_FLUSH&&(this.onEnd(L.Z_OK),t.avail_out=0),!0)};xe.prototype.onData=function(e){this.chunks.push(e)};xe.prototype.onEnd=function(e){e===L.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Me.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Xt(e,i){var t=new xe(i);if(t.push(e,!0),t.err)throw t.msg||Ct[t.err];return t.result}function Sr(e,i){return i=i||{},i.raw=!0,Xt(e,i)}je.Inflate=xe;je.inflate=Xt;je.inflateRaw=Sr;je.ungzip=Xt;var yr=re.assign,mr=qe,Fr=je,Tr=Na,Aa={};yr(Aa,mr,Fr,Tr);var st=Aa;async function Zr(e){try{let i,t=0,a=0;const r=[];let n=0,h;do{const _=e.subarray(t);if(h=new st.Inflate,{strm:i}=h,h.push(_,st.Z_SYNC_FLUSH),h.err)throw new Error(h.msg);t+=i.next_in,r[a]=h.result,n+=r[a].length,a+=1}while(i.avail_in);const f=new Uint8Array(n);for(let _=0,l=0;_=r.blockPosition){f[v]=f[v].subarray(0,r.blockPosition===a.blockPosition?r.dataPosition-a.dataPosition+1:r.dataPosition+1),_.push(n),l.push(h),o+=f[v].length;break}o+=f[v].length,v++}while(t.avail_in);const d=new Uint8Array(o);for(let g=0,w=0;g>>=0,(r=0<=e&&e<256)&&(a=Ui[e],a)?a:(t=O(e,(e|0)<0?-1:0,!0),r&&(Ui[e]=t),t)):(e|=0,(r=-128<=e&&e<128)&&(a=Ci[e],a)?a:(t=O(e,e<0?-1:0,!1),r&&(Ci[e]=t),t))}A.fromInt=Se;function P(e,i){if(isNaN(e))return i?ve:K;if(i){if(e<0)return ve;if(e>=Oa)return La}else{if(e<=-Mi)return U;if(e+1>=Mi)return Ia}return e<0?P(-e,i).neg():O(e%Oe|0,e/Oe|0,i)}A.fromNumber=P;function O(e,i,t){return new A(e,i,t)}A.fromBits=O;var ct=Math.pow;function qt(e,i,t){if(e.length===0)throw Error("empty string");if(e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return K;if(typeof i=="number"?(t=i,i=!1):i=!!i,t=t||10,t<2||360)throw Error("interior hyphen");if(a===0)return qt(e.substring(1),i,t).neg();for(var r=P(ct(t,8)),n=K,h=0;h>>0:this.low};s.toNumber=function(){return this.unsigned?(this.high>>>0)*Oe+(this.low>>>0):this.high*Oe+(this.low>>>0)};s.toString=function(i){if(i=i||10,i<2||36>>0,o=l.toString(i);if(h=_,h.isZero())return o+f;for(;o.length<6;)o="0"+o;f=""+o+f}};s.getHighBits=function(){return this.high};s.getHighBitsUnsigned=function(){return this.high>>>0};s.getLowBits=function(){return this.low};s.getLowBitsUnsigned=function(){return this.low>>>0};s.getNumBitsAbs=function(){if(this.isNegative())return this.eq(U)?64:this.neg().getNumBitsAbs();for(var i=this.high!=0?this.high:this.low,t=31;t>0&&!(i&1<=0};s.isOdd=function(){return(this.low&1)===1};s.isEven=function(){return(this.low&1)===0};s.equals=function(i){return $(i)||(i=V(i)),this.unsigned!==i.unsigned&&this.high>>>31===1&&i.high>>>31===1?!1:this.high===i.high&&this.low===i.low};s.eq=s.equals;s.notEquals=function(i){return!this.eq(i)};s.neq=s.notEquals;s.ne=s.notEquals;s.lessThan=function(i){return this.comp(i)<0};s.lt=s.lessThan;s.lessThanOrEqual=function(i){return this.comp(i)<=0};s.lte=s.lessThanOrEqual;s.le=s.lessThanOrEqual;s.greaterThan=function(i){return this.comp(i)>0};s.gt=s.greaterThan;s.greaterThanOrEqual=function(i){return this.comp(i)>=0};s.gte=s.greaterThanOrEqual;s.ge=s.greaterThanOrEqual;s.compare=function(i){if($(i)||(i=V(i)),this.eq(i))return 0;var t=this.isNegative(),a=i.isNegative();return t&&!a?-1:!t&&a?1:this.unsigned?i.high>>>0>this.high>>>0||i.high===this.high&&i.low>>>0>this.low>>>0?-1:1:this.sub(i).isNegative()?-1:1};s.comp=s.compare;s.negate=function(){return!this.unsigned&&this.eq(U)?U:this.not().add(Te)};s.neg=s.negate;s.add=function(i){$(i)||(i=V(i));var t=this.high>>>16,a=this.high&65535,r=this.low>>>16,n=this.low&65535,h=i.high>>>16,f=i.high&65535,_=i.low>>>16,l=i.low&65535,o=0,v=0,d=0,u=0;return u+=n+l,d+=u>>>16,u&=65535,d+=r+_,v+=d>>>16,d&=65535,v+=a+f,o+=v>>>16,v&=65535,o+=t+h,o&=65535,O(d<<16|u,o<<16|v,this.unsigned)};s.subtract=function(i){return $(i)||(i=V(i)),this.add(i.neg())};s.sub=s.subtract;s.multiply=function(i){if(this.isZero())return K;if($(i)||(i=V(i)),H){var t=H.mul(this.low,this.high,i.low,i.high);return O(t,H.get_high(),this.unsigned)}if(i.isZero())return K;if(this.eq(U))return i.isOdd()?U:K;if(i.eq(U))return this.isOdd()?U:K;if(this.isNegative())return i.isNegative()?this.neg().mul(i.neg()):this.neg().mul(i).neg();if(i.isNegative())return this.mul(i.neg()).neg();if(this.lt(Hi)&&i.lt(Hi))return P(this.toNumber()*i.toNumber(),this.unsigned);var a=this.high>>>16,r=this.high&65535,n=this.low>>>16,h=this.low&65535,f=i.high>>>16,_=i.high&65535,l=i.low>>>16,o=i.low&65535,v=0,d=0,u=0,g=0;return g+=h*o,u+=g>>>16,g&=65535,u+=n*o,d+=u>>>16,u&=65535,u+=h*l,d+=u>>>16,u&=65535,d+=r*o,v+=d>>>16,d&=65535,d+=n*l,v+=d>>>16,d&=65535,d+=h*_,v+=d>>>16,d&=65535,v+=a*o+r*l+n*_+h*f,v&=65535,O(u<<16|g,v<<16|d,this.unsigned)};s.mul=s.multiply;s.divide=function(i){if($(i)||(i=V(i)),i.isZero())throw Error("division by zero");if(H){if(!this.unsigned&&this.high===-2147483648&&i.low===-1&&i.high===-1)return this;var t=(this.unsigned?H.div_u:H.div_s)(this.low,this.high,i.low,i.high);return O(t,H.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?ve:K;var a,r,n;if(this.unsigned){if(i.unsigned||(i=i.toUnsigned()),i.gt(this))return ve;if(i.gt(this.shru(1)))return Za;n=ve}else{if(this.eq(U)){if(i.eq(Te)||i.eq(Ut))return U;if(i.eq(U))return Te;var h=this.shr(1);return a=h.div(i).shl(1),a.eq(K)?i.isNegative()?Te:Ut:(r=this.sub(i.mul(a)),n=a.add(r.div(i)),n)}else if(i.eq(U))return this.unsigned?ve:K;if(this.isNegative())return i.isNegative()?this.neg().div(i.neg()):this.neg().div(i).neg();if(i.isNegative())return this.div(i.neg()).neg();n=K}for(r=this;r.gte(i);){a=Math.max(1,Math.floor(r.toNumber()/i.toNumber()));for(var f=Math.ceil(Math.log(a)/Math.LN2),_=f<=48?1:ct(2,f-48),l=P(a),o=l.mul(i);o.isNegative()||o.gt(r);)a-=_,l=P(a,this.unsigned),o=l.mul(i);l.isZero()&&(l=Te),n=n.add(l),r=r.sub(o)}return n};s.div=s.divide;s.modulo=function(i){if($(i)||(i=V(i)),H){var t=(this.unsigned?H.rem_u:H.rem_s)(this.low,this.high,i.low,i.high);return O(t,H.get_high(),this.unsigned)}return this.sub(this.div(i).mul(i))};s.mod=s.modulo;s.rem=s.modulo;s.not=function(){return O(~this.low,~this.high,this.unsigned)};s.and=function(i){return $(i)||(i=V(i)),O(this.low&i.low,this.high&i.high,this.unsigned)};s.or=function(i){return $(i)||(i=V(i)),O(this.low|i.low,this.high|i.high,this.unsigned)};s.xor=function(i){return $(i)||(i=V(i)),O(this.low^i.low,this.high^i.high,this.unsigned)};s.shiftLeft=function(i){return $(i)&&(i=i.toInt()),(i&=63)===0?this:i<32?O(this.low<>>32-i,this.unsigned):O(0,this.low<>>i|this.high<<32-i,this.high>>i,this.unsigned):O(this.high>>i-32,this.high>=0?0:-1,this.unsigned)};s.shr=s.shiftRight;s.shiftRightUnsigned=function(i){if($(i)&&(i=i.toInt()),i&=63,i===0)return this;var t=this.high;if(i<32){var a=this.low;return O(a>>>i|t<<32-i,t>>>i,this.unsigned)}else return i===32?O(t,0,this.unsigned):O(t>>>i-32,0,this.unsigned)};s.shru=s.shiftRightUnsigned;s.shr_u=s.shiftRightUnsigned;s.toSigned=function(){return this.unsigned?O(this.low,this.high,!1):this};s.toUnsigned=function(){return this.unsigned?this:O(this.low,this.high,!0)};s.toBytes=function(i){return i?this.toBytesLE():this.toBytesBE()};s.toBytesLE=function(){var i=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,i&255,i>>>8&255,i>>>16&255,i>>>24]};s.toBytesBE=function(){var i=this.high,t=this.low;return[i>>>24,i>>>16&255,i>>>8&255,i&255,t>>>24,t>>>16&255,t>>>8&255,t&255]};A.fromBytes=function(i,t,a){return a?A.fromBytesLE(i,t):A.fromBytesBE(i,t)};A.fromBytesLE=function(i,t){return new A(i[0]|i[1]<<8|i[2]<<16|i[3]<<24,i[4]|i[5]<<8|i[6]<<16|i[7]<<24,t)};A.fromBytesBE=function(i,t){return new A(i[4]<<24|i[5]<<16|i[6]<<8|i[7],i[0]<<24|i[1]<<16|i[2]<<8|i[3],t)};const Lr=Da(Nr);export{Lr as L,Ir as a,Zr as u}; +import{b as Pi}from"./index-CJAFAeH3.js";import{g as Da}from"./_commonjsHelpers-C932wzq6.js";var re={};(function(e){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function t(n,h){return Object.prototype.hasOwnProperty.call(n,h)}e.assign=function(n){for(var h=Array.prototype.slice.call(arguments,1);h.length;){var f=h.shift();if(f){if(typeof f!="object")throw new TypeError(f+"must be non-object");for(var _ in f)t(f,_)&&(n[_]=f[_])}}return n},e.shrinkBuf=function(n,h){return n.length===h?n:n.subarray?n.subarray(0,h):(n.length=h,n)};var a={arraySet:function(n,h,f,_,l){if(h.subarray&&n.subarray){n.set(h.subarray(f,f+_),l);return}for(var o=0;o<_;o++)n[l+o]=h[f+o]},flattenChunks:function(n){var h,f,_,l,o,v;for(_=0,h=0,f=n.length;h=0;)e[i]=0}var Ua=0,Ki=1,$a=2,Ma=3,Ha=258,$t=29,Ge=256,He=Ge+1+$t,Ne=30,Mt=19,Yi=2*He+1,se=15,bt=16,Pa=7,Ht=256,Xi=16,qi=17,Gi=18,Ot=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],ft=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Ka=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Wi=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Ya=512,ne=new Array((He+2)*2);Ie(ne);var Be=new Array(Ne*2);Ie(Be);var Pe=new Array(Ya);Ie(Pe);var Ke=new Array(Ha-Ma+1);Ie(Ke);var Pt=new Array($t);Ie(Pt);var ut=new Array(Ne);Ie(ut);function pt(e,i,t,a,r){this.static_tree=e,this.extra_bits=i,this.extra_base=t,this.elems=a,this.max_length=r,this.has_stree=e&&e.length}var ji,Vi,Ji;function xt(e,i){this.dyn_tree=e,this.max_code=0,this.stat_desc=i}function Qi(e){return e<256?Pe[e]:Pe[256+(e>>>7)]}function Ye(e,i){e.pending_buf[e.pending++]=i&255,e.pending_buf[e.pending++]=i>>>8&255}function C(e,i,t){e.bi_valid>bt-t?(e.bi_buf|=i<>bt-e.bi_valid,e.bi_valid+=t-bt):(e.bi_buf|=i<>>=1,t<<=1;while(--i>0);return t>>>1}function Xa(e){e.bi_valid===16?(Ye(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function qa(e,i){var t=i.dyn_tree,a=i.max_code,r=i.stat_desc.static_tree,n=i.stat_desc.has_stree,h=i.stat_desc.extra_bits,f=i.stat_desc.extra_base,_=i.stat_desc.max_length,l,o,v,d,u,g,w=0;for(d=0;d<=se;d++)e.bl_count[d]=0;for(t[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l_&&(d=_,w++),t[o*2+1]=d,!(o>a)&&(e.bl_count[d]++,u=0,o>=f&&(u=h[o-f]),g=t[o*2],e.opt_len+=g*(d+u),n&&(e.static_len+=g*(r[o*2+1]+u)));if(w!==0){do{for(d=_-1;e.bl_count[d]===0;)d--;e.bl_count[d]--,e.bl_count[d+1]+=2,e.bl_count[_]--,w-=2}while(w>0);for(d=_;d!==0;d--)for(o=e.bl_count[d];o!==0;)v=e.heap[--l],!(v>a)&&(t[v*2+1]!==d&&(e.opt_len+=(d-t[v*2+1])*t[v*2],t[v*2+1]=d),o--)}}function ta(e,i,t){var a=new Array(se+1),r=0,n,h;for(n=1;n<=se;n++)a[n]=r=r+t[n-1]<<1;for(h=0;h<=i;h++){var f=e[h*2+1];f!==0&&(e[h*2]=ea(a[f]++,f))}}function Ga(){var e,i,t,a,r,n=new Array(se+1);for(t=0,a=0;a<$t-1;a++)for(Pt[a]=t,e=0;e<1<>=7;a8?Ye(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function Wa(e,i,t,a){aa(e),Ye(e,t),Ye(e,~t),Ra.arraySet(e.pending_buf,e.window,i,t,e.pending),e.pending+=t}function Jt(e,i,t,a){var r=i*2,n=t*2;return e[r]>1;h>=1;h--)kt(e,t,h);l=n;do h=e.heap[1],e.heap[1]=e.heap[e.heap_len--],kt(e,t,1),f=e.heap[1],e.heap[--e.heap_max]=h,e.heap[--e.heap_max]=f,t[l*2]=t[h*2]+t[f*2],e.depth[l]=(e.depth[h]>=e.depth[f]?e.depth[h]:e.depth[f])+1,t[h*2+1]=t[f*2+1]=l,e.heap[1]=l++,kt(e,t,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],qa(e,i),ta(t,_,e.bl_count)}function ei(e,i,t){var a,r=-1,n,h=i[0*2+1],f=0,_=7,l=4;for(h===0&&(_=138,l=3),i[(t+1)*2+1]=65535,a=0;a<=t;a++)n=h,h=i[(a+1)*2+1],!(++f<_&&n===h)&&(f=3&&e.bl_tree[Wi[i]*2+1]===0;i--);return e.opt_len+=3*(i+1)+5+5+4,i}function Va(e,i,t,a){var r;for(C(e,i-257,5),C(e,t-1,5),C(e,a-4,4),r=0;r>>=1)if(i&1&&e.dyn_ltree[t*2]!==0)return jt;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return Vt;for(t=32;t0?(e.strm.data_type===Ca&&(e.strm.data_type=Ja(e)),Zt(e,e.l_desc),Zt(e,e.d_desc),h=ja(e),r=e.opt_len+3+7>>>3,n=e.static_len+3+7>>>3,n<=r&&(r=n)):r=n=t+5,t+4<=r&&i!==-1?na(e,i,t,a):e.strategy===Ba||n===r?(C(e,(Ki<<1)+(a?1:0),3),Qt(e,ne,Be)):(C(e,($a<<1)+(a?1:0),3),Va(e,e.l_desc.max_code+1,e.d_desc.max_code+1,h+1),Qt(e,e.dyn_ltree,e.dyn_dtree)),ia(e),a&&aa(e)}function an(e,i,t){return e.pending_buf[e.d_buf+e.last_lit*2]=i>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=i&255,e.pending_buf[e.l_buf+e.last_lit]=t&255,e.last_lit++,i===0?e.dyn_ltree[t*2]++:(e.matches++,i--,e.dyn_ltree[(Ke[t]+Ge+1)*2]++,e.dyn_dtree[Qi(i)*2]++),e.last_lit===e.lit_bufsize-1}Ze._tr_init=Qa;Ze._tr_stored_block=na;Ze._tr_flush_block=tn;Ze._tr_tally=an;Ze._tr_align=en;function nn(e,i,t,a){for(var r=e&65535|0,n=e>>>16&65535|0,h=0;t!==0;){h=t>2e3?2e3:t,t-=h;do r=r+i[a++]|0,n=n+r|0;while(--h);r%=65521,n%=65521}return r|n<<16|0}var ra=nn;function rn(){for(var e,i=[],t=0;t<256;t++){e=t;for(var a=0;a<8;a++)e=e&1?3988292384^e>>>1:e>>>1;i[t]=e}return i}var fn=rn();function hn(e,i,t,a){var r=fn,n=a+t;e^=-1;for(var h=a;h>>8^r[(e^i[h])&255];return e^-1}var fa=hn,Kt={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},B=re,Y=Ze,ha=ra,he=fa,ln=Kt,ke=0,on=1,_n=3,de=4,ai=5,te=0,ni=1,X=-2,un=-3,Et=-5,dn=-1,sn=1,tt=2,cn=3,vn=4,gn=0,wn=2,vt=8,bn=9,pn=15,xn=8,kn=29,En=256,It=En+1+kn,Sn=30,yn=19,mn=2*It+1,Fn=15,S=3,_e=258,W=_e+S+1,Tn=32,gt=42,Lt=69,ht=73,lt=91,ot=103,ce=113,Re=666,D=1,We=2,ge=3,Le=4,Nn=3;function ue(e,i){return e.msg=ln[i],i}function ri(e){return(e<<1)-(e>4?9:0)}function oe(e){for(var i=e.length;--i>=0;)e[i]=0}function le(e){var i=e.state,t=i.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(B.arraySet(e.output,i.pending_buf,i.pending_out,t,e.next_out),e.next_out+=t,i.pending_out+=t,e.total_out+=t,e.avail_out-=t,i.pending-=t,i.pending===0&&(i.pending_out=0))}function R(e,i){Y._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,i),e.block_start=e.strstart,le(e.strm)}function F(e,i){e.pending_buf[e.pending++]=i}function De(e,i){e.pending_buf[e.pending++]=i>>>8&255,e.pending_buf[e.pending++]=i&255}function zn(e,i,t,a){var r=e.avail_in;return r>a&&(r=a),r===0?0:(e.avail_in-=r,B.arraySet(i,e.input,e.next_in,r,t),e.state.wrap===1?e.adler=ha(e.adler,i,r,t):e.state.wrap===2&&(e.adler=he(e.adler,i,r,t)),e.next_in+=r,e.total_in+=r,r)}function la(e,i){var t=e.max_chain_length,a=e.strstart,r,n,h=e.prev_length,f=e.nice_match,_=e.strstart>e.w_size-W?e.strstart-(e.w_size-W):0,l=e.window,o=e.w_mask,v=e.prev,d=e.strstart+_e,u=l[a+h-1],g=l[a+h];e.prev_length>=e.good_match&&(t>>=2),f>e.lookahead&&(f=e.lookahead);do if(r=i,!(l[r+h]!==g||l[r+h-1]!==u||l[r]!==l[a]||l[++r]!==l[a+1])){a+=2,r++;do;while(l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&l[++a]===l[++r]&&ah){if(e.match_start=i,h=n,n>=f)break;u=l[a+h-1],g=l[a+h]}}while((i=v[i&o])>_&&--t!==0);return h<=e.lookahead?h:e.lookahead}function we(e){var i=e.w_size,t,a,r,n,h;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=i+(i-W)){B.arraySet(e.window,e.window,i,i,0),e.match_start-=i,e.strstart-=i,e.block_start-=i,a=e.hash_size,t=a;do r=e.head[--t],e.head[t]=r>=i?r-i:0;while(--a);a=i,t=a;do r=e.prev[--t],e.prev[t]=r>=i?r-i:0;while(--a);n+=i}if(e.strm.avail_in===0)break;if(a=zn(e.strm,e.window,e.strstart+e.lookahead,n),e.lookahead+=a,e.lookahead+e.insert>=S)for(h=e.strstart-e.insert,e.ins_h=e.window[h],e.ins_h=(e.ins_h<e.pending_buf_size-5&&(t=e.pending_buf_size-5);;){if(e.lookahead<=1){if(we(e),e.lookahead===0&&i===ke)return D;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var a=e.block_start+t;if((e.strstart===0||e.strstart>=a)&&(e.lookahead=e.strstart-a,e.strstart=a,R(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-W&&(R(e,!1),e.strm.avail_out===0))return D}return e.insert=0,i===de?(R(e,!0),e.strm.avail_out===0?ge:Le):(e.strstart>e.block_start&&(R(e,!1),e.strm.avail_out===0),D)}function St(e,i){for(var t,a;;){if(e.lookahead=S&&(e.ins_h=(e.ins_h<=S)if(a=Y._tr_tally(e,e.strstart-e.match_start,e.match_length-S),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=S){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<=S&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=S-1)),e.prev_length>=S&&e.match_length<=e.prev_length){r=e.strstart+e.lookahead-S,a=Y._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-S),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=r&&(e.ins_h=(e.ins_h<=S&&e.strstart>0&&(r=e.strstart-1,a=h[r],a===h[++r]&&a===h[++r]&&a===h[++r])){n=e.strstart+_e;do;while(a===h[++r]&&a===h[++r]&&a===h[++r]&&a===h[++r]&&a===h[++r]&&a===h[++r]&&a===h[++r]&&a===h[++r]&&re.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=S?(t=Y._tr_tally(e,1,e.match_length-S),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(t=Y._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),t&&(R(e,!1),e.strm.avail_out===0))return D}return e.insert=0,i===de?(R(e,!0),e.strm.avail_out===0?ge:Le):e.last_lit&&(R(e,!1),e.strm.avail_out===0)?D:We}function Zn(e,i){for(var t;;){if(e.lookahead===0&&(we(e),e.lookahead===0)){if(i===ke)return D;break}if(e.match_length=0,t=Y._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,t&&(R(e,!1),e.strm.avail_out===0))return D}return e.insert=0,i===de?(R(e,!0),e.strm.avail_out===0?ge:Le):e.last_lit&&(R(e,!1),e.strm.avail_out===0)?D:We}function J(e,i,t,a,r){this.good_length=e,this.max_lazy=i,this.nice_length=t,this.max_chain=a,this.func=r}var Fe;Fe=[new J(0,0,0,0,An),new J(4,4,8,4,St),new J(4,5,16,8,St),new J(4,6,32,32,St),new J(4,4,16,16,ye),new J(8,16,32,32,ye),new J(8,16,128,128,ye),new J(8,32,128,256,ye),new J(32,128,258,1024,ye),new J(32,258,258,4096,ye)];function In(e){e.window_size=2*e.w_size,oe(e.head),e.max_lazy_match=Fe[e.level].max_lazy,e.good_match=Fe[e.level].good_length,e.nice_match=Fe[e.level].nice_length,e.max_chain_length=Fe[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=S-1,e.match_available=0,e.ins_h=0}function Ln(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=vt,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new B.Buf16(mn*2),this.dyn_dtree=new B.Buf16((2*Sn+1)*2),this.bl_tree=new B.Buf16((2*yn+1)*2),oe(this.dyn_ltree),oe(this.dyn_dtree),oe(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new B.Buf16(Fn+1),this.heap=new B.Buf16(2*It+1),oe(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new B.Buf16(2*It+1),oe(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function oa(e){var i;return!e||!e.state?ue(e,X):(e.total_in=e.total_out=0,e.data_type=wn,i=e.state,i.pending=0,i.pending_out=0,i.wrap<0&&(i.wrap=-i.wrap),i.status=i.wrap?gt:ce,e.adler=i.wrap===2?0:1,i.last_flush=ke,Y._tr_init(i),te)}function _a(e){var i=oa(e);return i===te&&In(e.state),i}function Dn(e,i){return!e||!e.state||e.state.wrap!==2?X:(e.state.gzhead=i,te)}function ua(e,i,t,a,r,n){if(!e)return X;var h=1;if(i===dn&&(i=6),a<0?(h=0,a=-a):a>15&&(h=2,a-=16),r<1||r>bn||t!==vt||a<8||a>15||i<0||i>9||n<0||n>vn)return ue(e,X);a===8&&(a=9);var f=new Ln;return e.state=f,f.strm=e,f.wrap=h,f.gzhead=null,f.w_bits=a,f.w_size=1<ai||i<0)return e?ue(e,X):X;if(a=e.state,!e.output||!e.input&&e.avail_in!==0||a.status===Re&&i!==de)return ue(e,e.avail_out===0?Et:X);if(a.strm=e,t=a.last_flush,a.last_flush=i,a.status===gt)if(a.wrap===2)e.adler=0,F(a,31),F(a,139),F(a,8),a.gzhead?(F(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),F(a,a.gzhead.time&255),F(a,a.gzhead.time>>8&255),F(a,a.gzhead.time>>16&255),F(a,a.gzhead.time>>24&255),F(a,a.level===9?2:a.strategy>=tt||a.level<2?4:0),F(a,a.gzhead.os&255),a.gzhead.extra&&a.gzhead.extra.length&&(F(a,a.gzhead.extra.length&255),F(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(e.adler=he(e.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=Lt):(F(a,0),F(a,0),F(a,0),F(a,0),F(a,0),F(a,a.level===9?2:a.strategy>=tt||a.level<2?4:0),F(a,Nn),a.status=ce);else{var h=vt+(a.w_bits-8<<4)<<8,f=-1;a.strategy>=tt||a.level<2?f=0:a.level<6?f=1:a.level===6?f=2:f=3,h|=f<<6,a.strstart!==0&&(h|=Tn),h+=31-h%31,a.status=ce,De(a,h),a.strstart!==0&&(De(a,e.adler>>>16),De(a,e.adler&65535)),e.adler=1}if(a.status===Lt)if(a.gzhead.extra){for(r=a.pending;a.gzindex<(a.gzhead.extra.length&65535)&&!(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>r&&(e.adler=he(e.adler,a.pending_buf,a.pending-r,r)),le(e),r=a.pending,a.pending===a.pending_buf_size));)F(a,a.gzhead.extra[a.gzindex]&255),a.gzindex++;a.gzhead.hcrc&&a.pending>r&&(e.adler=he(e.adler,a.pending_buf,a.pending-r,r)),a.gzindex===a.gzhead.extra.length&&(a.gzindex=0,a.status=ht)}else a.status=ht;if(a.status===ht)if(a.gzhead.name){r=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>r&&(e.adler=he(e.adler,a.pending_buf,a.pending-r,r)),le(e),r=a.pending,a.pending===a.pending_buf_size)){n=1;break}a.gzindexr&&(e.adler=he(e.adler,a.pending_buf,a.pending-r,r)),n===0&&(a.gzindex=0,a.status=lt)}else a.status=lt;if(a.status===lt)if(a.gzhead.comment){r=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>r&&(e.adler=he(e.adler,a.pending_buf,a.pending-r,r)),le(e),r=a.pending,a.pending===a.pending_buf_size)){n=1;break}a.gzindexr&&(e.adler=he(e.adler,a.pending_buf,a.pending-r,r)),n===0&&(a.status=ot)}else a.status=ot;if(a.status===ot&&(a.gzhead.hcrc?(a.pending+2>a.pending_buf_size&&le(e),a.pending+2<=a.pending_buf_size&&(F(a,e.adler&255),F(a,e.adler>>8&255),e.adler=0,a.status=ce)):a.status=ce),a.pending!==0){if(le(e),e.avail_out===0)return a.last_flush=-1,te}else if(e.avail_in===0&&ri(i)<=ri(t)&&i!==de)return ue(e,Et);if(a.status===Re&&e.avail_in!==0)return ue(e,Et);if(e.avail_in!==0||a.lookahead!==0||i!==ke&&a.status!==Re){var _=a.strategy===tt?Zn(a,i):a.strategy===cn?On(a,i):Fe[a.level].func(a,i);if((_===ge||_===Le)&&(a.status=Re),_===D||_===ge)return e.avail_out===0&&(a.last_flush=-1),te;if(_===We&&(i===on?Y._tr_align(a):i!==ai&&(Y._tr_stored_block(a,0,0,!1),i===_n&&(oe(a.head),a.lookahead===0&&(a.strstart=0,a.block_start=0,a.insert=0))),le(e),e.avail_out===0))return a.last_flush=-1,te}return i!==de?te:a.wrap<=0?ni:(a.wrap===2?(F(a,e.adler&255),F(a,e.adler>>8&255),F(a,e.adler>>16&255),F(a,e.adler>>24&255),F(a,e.total_in&255),F(a,e.total_in>>8&255),F(a,e.total_in>>16&255),F(a,e.total_in>>24&255)):(De(a,e.adler>>>16),De(a,e.adler&65535)),le(e),a.wrap>0&&(a.wrap=-a.wrap),a.pending!==0?te:ni)}function Cn(e){var i;return!e||!e.state?X:(i=e.state.status,i!==gt&&i!==Lt&&i!==ht&&i!==lt&&i!==ot&&i!==ce&&i!==Re?ue(e,X):(e.state=null,i===ce?ue(e,un):te))}function Un(e,i){var t=i.length,a,r,n,h,f,_,l,o;if(!e||!e.state||(a=e.state,h=a.wrap,h===2||h===1&&a.status!==gt||a.lookahead))return X;for(h===1&&(e.adler=ha(e.adler,i,t,0)),a.wrap=0,t>=a.w_size&&(h===0&&(oe(a.head),a.strstart=0,a.block_start=0,a.insert=0),o=new B.Buf8(a.w_size),B.arraySet(o,i,t-a.w_size,a.w_size,0),i=o,t=a.w_size),f=e.avail_in,_=e.next_in,l=e.input,e.avail_in=t,e.next_in=0,e.input=i,we(a);a.lookahead>=S;){r=a.strstart,n=a.lookahead-(S-1);do a.ins_h=(a.ins_h<=252?6:fe>=248?5:fe>=240?4:fe>=224?3:fe>=192?2:1;Xe[254]=Xe[254]=1;Ee.string2buf=function(e){var i,t,a,r,n,h=e.length,f=0;for(r=0;r>>6,i[n++]=128|t&63):t<65536?(i[n++]=224|t>>>12,i[n++]=128|t>>>6&63,i[n++]=128|t&63):(i[n++]=240|t>>>18,i[n++]=128|t>>>12&63,i[n++]=128|t>>>6&63,i[n++]=128|t&63);return i};function ca(e,i){if(i<65534&&(e.subarray&&sa||!e.subarray&&da))return String.fromCharCode.apply(null,wt.shrinkBuf(e,i));for(var t="",a=0;a4){f[a++]=65533,t+=n-1;continue}for(r&=n===2?31:n===3?15:7;n>1&&t1){f[a++]=65533;continue}r<65536?f[a++]=r:(r-=65536,f[a++]=55296|r>>10&1023,f[a++]=56320|r&1023)}return ca(f,a)};Ee.utf8border=function(e,i){var t;for(i=i||e.length,i>e.length&&(i=e.length),t=i-1;t>=0&&(e[t]&192)===128;)t--;return t<0||t===0?i:t+Xe[e[t]]>i?t:i};function $n(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var va=$n,Ce=ie,Ue=re,Dt=Ee,Rt=Kt,Mn=va,ga=Object.prototype.toString,Hn=0,yt=4,ze=0,fi=1,hi=2,Pn=-1,Kn=0,Yn=8;function be(e){if(!(this instanceof be))return new be(e);this.options=Ue.assign({level:Pn,method:Yn,chunkSize:16384,windowBits:15,memLevel:8,strategy:Kn,to:""},e||{});var i=this.options;i.raw&&i.windowBits>0?i.windowBits=-i.windowBits:i.gzip&&i.windowBits>0&&i.windowBits<16&&(i.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Mn,this.strm.avail_out=0;var t=Ce.deflateInit2(this.strm,i.level,i.method,i.windowBits,i.memLevel,i.strategy);if(t!==ze)throw new Error(Rt[t]);if(i.header&&Ce.deflateSetHeader(this.strm,i.header),i.dictionary){var a;if(typeof i.dictionary=="string"?a=Dt.string2buf(i.dictionary):ga.call(i.dictionary)==="[object ArrayBuffer]"?a=new Uint8Array(i.dictionary):a=i.dictionary,t=Ce.deflateSetDictionary(this.strm,a),t!==ze)throw new Error(Rt[t]);this._dict_set=!0}}be.prototype.push=function(e,i){var t=this.strm,a=this.options.chunkSize,r,n;if(this.ended)return!1;n=i===~~i?i:i===!0?yt:Hn,typeof e=="string"?t.input=Dt.string2buf(e):ga.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;do{if(t.avail_out===0&&(t.output=new Ue.Buf8(a),t.next_out=0,t.avail_out=a),r=Ce.deflate(t,n),r!==fi&&r!==ze)return this.onEnd(r),this.ended=!0,!1;(t.avail_out===0||t.avail_in===0&&(n===yt||n===hi))&&(this.options.to==="string"?this.onData(Dt.buf2binstring(Ue.shrinkBuf(t.output,t.next_out))):this.onData(Ue.shrinkBuf(t.output,t.next_out)))}while((t.avail_in>0||t.avail_out===0)&&r!==fi);return n===yt?(r=Ce.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===ze):(n===hi&&(this.onEnd(ze),t.avail_out=0),!0)};be.prototype.onData=function(e){this.chunks.push(e)};be.prototype.onEnd=function(e){e===ze&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Ue.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Yt(e,i){var t=new be(i);if(t.push(e,!0),t.err)throw t.msg||Rt[t.err];return t.result}function Xn(e,i){return i=i||{},i.raw=!0,Yt(e,i)}function qn(e,i){return i=i||{},i.gzip=!0,Yt(e,i)}qe.Deflate=be;qe.deflate=Yt;qe.deflateRaw=Xn;qe.gzip=qn;var je={},j={},it=30,Gn=12,Wn=function(i,t){var a,r,n,h,f,_,l,o,v,d,u,g,w,k,b,N,z,E,c,T,y,p,m,I,x;a=i.state,r=i.next_in,I=i.input,n=r+(i.avail_in-5),h=i.next_out,x=i.output,f=h-(t-i.avail_out),_=h+(i.avail_out-257),l=a.dmax,o=a.wsize,v=a.whave,d=a.wnext,u=a.window,g=a.hold,w=a.bits,k=a.lencode,b=a.distcode,N=(1<>>24,g>>>=c,w-=c,c=E>>>16&255,c===0)x[h++]=E&65535;else if(c&16){T=E&65535,c&=15,c&&(w>>=c,w-=c),w<15&&(g+=I[r++]<>>24,g>>>=c,w-=c,c=E>>>16&255,c&16){if(y=E&65535,c&=15,wl){i.msg="invalid distance too far back",a.mode=it;break e}if(g>>>=c,w-=c,c=h-f,y>c){if(c=y-c,c>v&&a.sane){i.msg="invalid distance too far back",a.mode=it;break e}if(p=0,m=u,d===0){if(p+=o-c,c2;)x[h++]=m[p++],x[h++]=m[p++],x[h++]=m[p++],T-=3;T&&(x[h++]=m[p++],T>1&&(x[h++]=m[p++]))}else{p=h-y;do x[h++]=x[p++],x[h++]=x[p++],x[h++]=x[p++],T-=3;while(T>2);T&&(x[h++]=x[p++],T>1&&(x[h++]=x[p++]))}}else if(c&64){i.msg="invalid distance code",a.mode=it;break e}else{E=b[(E&65535)+(g&(1<>3,r-=T,w-=T<<3,g&=(1<=1&&G[u]===0;u--);if(g>u&&(g=u),u===0)return n[h++]=1<<24|64<<16|0,n[h++]=1<<24|64<<16|0,_.bits=1,0;for(d=1;d0&&(i===ui||u!==1))return-1;for(Ve[1]=0,o=1;ooi||i===di&&N>_i)return 1;for(;;){Wt=o-k,f[v]x?(Qe=Je[Gt+f[v]],et=m[I+f[v]]):(Qe=96,et=0),E=1<>k)+c]=Wt<<24|Qe<<16|et|0;while(c!==0);for(E=1<>=1;if(E!==0?(z&=E-1,z+=E):z=0,v++,--G[o]===0){if(o===u)break;o=t[a+f[v]]}if(o>g&&(z&y)!==T){for(k===0&&(k=g),p+=d,w=o-k,b=1<oi||i===di&&N>_i)return 1;T=z&y,n[T]=g<<24|w<<16|p-h|0}}return z!==0&&(n[p+z]=o-k<<24|64<<16|0),_.bits=g,0},M=re,Bt=ra,Q=fa,tr=Wn,$e=er,ir=0,wa=1,ba=2,si=4,ar=5,at=6,pe=0,nr=1,rr=2,q=-2,pa=-3,xa=-4,fr=-5,ci=8,ka=1,vi=2,gi=3,wi=4,bi=5,pi=6,xi=7,ki=8,Ei=9,Si=10,dt=11,ae=12,Ft=13,yi=14,Tt=15,mi=16,Fi=17,Ti=18,Ni=19,nt=20,rt=21,zi=22,Ai=23,Oi=24,Zi=25,Ii=26,Nt=27,Li=28,Di=29,Z=30,Ea=31,hr=32,lr=852,or=592,_r=15,ur=_r;function Ri(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function dr(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new M.Buf16(320),this.work=new M.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Sa(e){var i;return!e||!e.state?q:(i=e.state,e.total_in=e.total_out=i.total=0,e.msg="",i.wrap&&(e.adler=i.wrap&1),i.mode=ka,i.last=0,i.havedict=0,i.dmax=32768,i.head=null,i.hold=0,i.bits=0,i.lencode=i.lendyn=new M.Buf32(lr),i.distcode=i.distdyn=new M.Buf32(or),i.sane=1,i.back=-1,pe)}function ya(e){var i;return!e||!e.state?q:(i=e.state,i.wsize=0,i.whave=0,i.wnext=0,Sa(e))}function ma(e,i){var t,a;return!e||!e.state||(a=e.state,i<0?(t=0,i=-i):(t=(i>>4)+1,i<48&&(i&=15)),i&&(i<8||i>15))?q:(a.window!==null&&a.wbits!==i&&(a.window=null),a.wrap=t,a.wbits=i,ya(e))}function Fa(e,i){var t,a;return e?(a=new dr,e.state=a,a.window=null,t=ma(e,i),t!==pe&&(e.state=null),t):q}function sr(e){return Fa(e,ur)}var Bi=!0,zt,At;function cr(e){if(Bi){var i;for(zt=new M.Buf32(512),At=new M.Buf32(32),i=0;i<144;)e.lens[i++]=8;for(;i<256;)e.lens[i++]=9;for(;i<280;)e.lens[i++]=7;for(;i<288;)e.lens[i++]=8;for($e(wa,e.lens,0,288,zt,0,e.work,{bits:9}),i=0;i<32;)e.lens[i++]=5;$e(ba,e.lens,0,32,At,0,e.work,{bits:5}),Bi=!1}e.lencode=zt,e.lenbits=9,e.distcode=At,e.distbits=5}function Ta(e,i,t,a){var r,n=e.state;return n.window===null&&(n.wsize=1<=n.wsize?(M.arraySet(n.window,i,t-n.wsize,n.wsize,0),n.wnext=0,n.whave=n.wsize):(r=n.wsize-n.wnext,r>a&&(r=a),M.arraySet(n.window,i,t-a,r,n.wnext),a-=r,a?(M.arraySet(n.window,i,t-a,a,0),n.wnext=a,n.whave=n.wsize):(n.wnext+=r,n.wnext===n.wsize&&(n.wnext=0),n.whave>>8&255,t.check=Q(t.check,m,2,0),l=0,o=0,t.mode=vi;break}if(t.flags=0,t.head&&(t.head.done=!1),!(t.wrap&1)||(((l&255)<<8)+(l>>8))%31){e.msg="incorrect header check",t.mode=Z;break}if((l&15)!==ci){e.msg="unknown compression method",t.mode=Z;break}if(l>>>=4,o-=4,y=(l&15)+8,t.wbits===0)t.wbits=y;else if(y>t.wbits){e.msg="invalid window size",t.mode=Z;break}t.dmax=1<>8&1),t.flags&512&&(m[0]=l&255,m[1]=l>>>8&255,t.check=Q(t.check,m,2,0)),l=0,o=0,t.mode=gi;case gi:for(;o<32;){if(f===0)break e;f--,l+=a[n++]<>>8&255,m[2]=l>>>16&255,m[3]=l>>>24&255,t.check=Q(t.check,m,4,0)),l=0,o=0,t.mode=wi;case wi:for(;o<16;){if(f===0)break e;f--,l+=a[n++]<>8),t.flags&512&&(m[0]=l&255,m[1]=l>>>8&255,t.check=Q(t.check,m,2,0)),l=0,o=0,t.mode=bi;case bi:if(t.flags&1024){for(;o<16;){if(f===0)break e;f--,l+=a[n++]<>>8&255,t.check=Q(t.check,m,2,0)),l=0,o=0}else t.head&&(t.head.extra=null);t.mode=pi;case pi:if(t.flags&1024&&(u=t.length,u>f&&(u=f),u&&(t.head&&(y=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Array(t.head.extra_len)),M.arraySet(t.head.extra,a,n,u,y)),t.flags&512&&(t.check=Q(t.check,a,u,n)),f-=u,n+=u,t.length-=u),t.length))break e;t.length=0,t.mode=xi;case xi:if(t.flags&2048){if(f===0)break e;u=0;do y=a[n+u++],t.head&&y&&t.length<65536&&(t.head.name+=String.fromCharCode(y));while(y&&u>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=ae;break;case Si:for(;o<32;){if(f===0)break e;f--,l+=a[n++]<>>=o&7,o-=o&7,t.mode=Nt;break}for(;o<3;){if(f===0)break e;f--,l+=a[n++]<>>=1,o-=1,l&3){case 0:t.mode=yi;break;case 1:if(cr(t),t.mode=nt,i===at){l>>>=2,o-=2;break e}break;case 2:t.mode=Fi;break;case 3:e.msg="invalid block type",t.mode=Z}l>>>=2,o-=2;break;case yi:for(l>>>=o&7,o-=o&7;o<32;){if(f===0)break e;f--,l+=a[n++]<>>16^65535)){e.msg="invalid stored block lengths",t.mode=Z;break}if(t.length=l&65535,l=0,o=0,t.mode=Tt,i===at)break e;case Tt:t.mode=mi;case mi:if(u=t.length,u){if(u>f&&(u=f),u>_&&(u=_),u===0)break e;M.arraySet(r,a,n,u,h),f-=u,n+=u,_-=u,h+=u,t.length-=u;break}t.mode=ae;break;case Fi:for(;o<14;){if(f===0)break e;f--,l+=a[n++]<>>=5,o-=5,t.ndist=(l&31)+1,l>>>=5,o-=5,t.ncode=(l&15)+4,l>>>=4,o-=4,t.nlen>286||t.ndist>30){e.msg="too many length or distance symbols",t.mode=Z;break}t.have=0,t.mode=Ti;case Ti:for(;t.have>>=3,o-=3}for(;t.have<19;)t.lens[G[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,I={bits:t.lenbits},p=$e(ir,t.lens,0,19,t.lencode,0,t.work,I),t.lenbits=I.bits,p){e.msg="invalid code lengths set",t.mode=Z;break}t.have=0,t.mode=Ni;case Ni:for(;t.have>>24,N=k>>>16&255,z=k&65535,!(b<=o);){if(f===0)break e;f--,l+=a[n++]<>>=b,o-=b,t.lens[t.have++]=z;else{if(z===16){for(x=b+2;o>>=b,o-=b,t.have===0){e.msg="invalid bit length repeat",t.mode=Z;break}y=t.lens[t.have-1],u=3+(l&3),l>>>=2,o-=2}else if(z===17){for(x=b+3;o>>=b,o-=b,y=0,u=3+(l&7),l>>>=3,o-=3}else{for(x=b+7;o>>=b,o-=b,y=0,u=11+(l&127),l>>>=7,o-=7}if(t.have+u>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=Z;break}for(;u--;)t.lens[t.have++]=y}}if(t.mode===Z)break;if(t.lens[256]===0){e.msg="invalid code -- missing end-of-block",t.mode=Z;break}if(t.lenbits=9,I={bits:t.lenbits},p=$e(wa,t.lens,0,t.nlen,t.lencode,0,t.work,I),t.lenbits=I.bits,p){e.msg="invalid literal/lengths set",t.mode=Z;break}if(t.distbits=6,t.distcode=t.distdyn,I={bits:t.distbits},p=$e(ba,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,I),t.distbits=I.bits,p){e.msg="invalid distances set",t.mode=Z;break}if(t.mode=nt,i===at)break e;case nt:t.mode=rt;case rt:if(f>=6&&_>=258){e.next_out=h,e.avail_out=_,e.next_in=n,e.avail_in=f,t.hold=l,t.bits=o,tr(e,d),h=e.next_out,r=e.output,_=e.avail_out,n=e.next_in,a=e.input,f=e.avail_in,l=t.hold,o=t.bits,t.mode===ae&&(t.back=-1);break}for(t.back=0;k=t.lencode[l&(1<>>24,N=k>>>16&255,z=k&65535,!(b<=o);){if(f===0)break e;f--,l+=a[n++]<>E)],b=k>>>24,N=k>>>16&255,z=k&65535,!(E+b<=o);){if(f===0)break e;f--,l+=a[n++]<>>=E,o-=E,t.back+=E}if(l>>>=b,o-=b,t.back+=b,t.length=z,N===0){t.mode=Ii;break}if(N&32){t.back=-1,t.mode=ae;break}if(N&64){e.msg="invalid literal/length code",t.mode=Z;break}t.extra=N&15,t.mode=zi;case zi:if(t.extra){for(x=t.extra;o>>=t.extra,o-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=Ai;case Ai:for(;k=t.distcode[l&(1<>>24,N=k>>>16&255,z=k&65535,!(b<=o);){if(f===0)break e;f--,l+=a[n++]<>E)],b=k>>>24,N=k>>>16&255,z=k&65535,!(E+b<=o);){if(f===0)break e;f--,l+=a[n++]<>>=E,o-=E,t.back+=E}if(l>>>=b,o-=b,t.back+=b,N&64){e.msg="invalid distance code",t.mode=Z;break}t.offset=z,t.extra=N&15,t.mode=Oi;case Oi:if(t.extra){for(x=t.extra;o>>=t.extra,o-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back",t.mode=Z;break}t.mode=Zi;case Zi:if(_===0)break e;if(u=d-_,t.offset>u){if(u=t.offset-u,u>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=Z;break}u>t.wnext?(u-=t.wnext,g=t.wsize-u):g=t.wnext-u,u>t.length&&(u=t.length),w=t.window}else w=r,g=h-t.offset,u=t.length;u>_&&(u=_),_-=u,t.length-=u;do r[h++]=w[g++];while(--u);t.length===0&&(t.mode=rt);break;case Ii:if(_===0)break e;r[h++]=t.length,_--,t.mode=rt;break;case Nt:if(t.wrap){for(;o<32;){if(f===0)break e;f--,l|=a[n++]<=0&&i.windowBits<16&&(i.windowBits=-i.windowBits,i.windowBits===0&&(i.windowBits=-15)),i.windowBits>=0&&i.windowBits<16&&!(e&&e.windowBits)&&(i.windowBits+=32),i.windowBits>15&&i.windowBits<48&&(i.windowBits&15||(i.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new kr,this.strm.avail_out=0;var t=Ae.inflateInit2(this.strm,i.windowBits);if(t!==L.Z_OK)throw new Error(Ct[t]);if(this.header=new Er,Ae.inflateGetHeader(this.strm,this.header),i.dictionary&&(typeof i.dictionary=="string"?i.dictionary=_t.string2buf(i.dictionary):za.call(i.dictionary)==="[object ArrayBuffer]"&&(i.dictionary=new Uint8Array(i.dictionary)),i.raw&&(t=Ae.inflateSetDictionary(this.strm,i.dictionary),t!==L.Z_OK)))throw new Error(Ct[t])}xe.prototype.push=function(e,i){var t=this.strm,a=this.options.chunkSize,r=this.options.dictionary,n,h,f,_,l,o=!1;if(this.ended)return!1;h=i===~~i?i:i===!0?L.Z_FINISH:L.Z_NO_FLUSH,typeof e=="string"?t.input=_t.binstring2buf(e):za.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;do{if(t.avail_out===0&&(t.output=new Me.Buf8(a),t.next_out=0,t.avail_out=a),n=Ae.inflate(t,L.Z_NO_FLUSH),n===L.Z_NEED_DICT&&r&&(n=Ae.inflateSetDictionary(this.strm,r)),n===L.Z_BUF_ERROR&&o===!0&&(n=L.Z_OK,o=!1),n!==L.Z_STREAM_END&&n!==L.Z_OK)return this.onEnd(n),this.ended=!0,!1;t.next_out&&(t.avail_out===0||n===L.Z_STREAM_END||t.avail_in===0&&(h===L.Z_FINISH||h===L.Z_SYNC_FLUSH))&&(this.options.to==="string"?(f=_t.utf8border(t.output,t.next_out),_=t.next_out-f,l=_t.buf2string(t.output,f),t.next_out=_,t.avail_out=a-_,_&&Me.arraySet(t.output,t.output,f,_,0),this.onData(l)):this.onData(Me.shrinkBuf(t.output,t.next_out))),t.avail_in===0&&t.avail_out===0&&(o=!0)}while((t.avail_in>0||t.avail_out===0)&&n!==L.Z_STREAM_END);return n===L.Z_STREAM_END&&(h=L.Z_FINISH),h===L.Z_FINISH?(n=Ae.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===L.Z_OK):(h===L.Z_SYNC_FLUSH&&(this.onEnd(L.Z_OK),t.avail_out=0),!0)};xe.prototype.onData=function(e){this.chunks.push(e)};xe.prototype.onEnd=function(e){e===L.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Me.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Xt(e,i){var t=new xe(i);if(t.push(e,!0),t.err)throw t.msg||Ct[t.err];return t.result}function Sr(e,i){return i=i||{},i.raw=!0,Xt(e,i)}je.Inflate=xe;je.inflate=Xt;je.inflateRaw=Sr;je.ungzip=Xt;var yr=re.assign,mr=qe,Fr=je,Tr=Na,Aa={};yr(Aa,mr,Fr,Tr);var st=Aa;async function Zr(e){try{let i,t=0,a=0;const r=[];let n=0,h;do{const _=e.subarray(t);if(h=new st.Inflate,{strm:i}=h,h.push(_,st.Z_SYNC_FLUSH),h.err)throw new Error(h.msg);t+=i.next_in,r[a]=h.result,n+=r[a].length,a+=1}while(i.avail_in);const f=new Uint8Array(n);for(let _=0,l=0;_=r.blockPosition){f[v]=f[v].subarray(0,r.blockPosition===a.blockPosition?r.dataPosition-a.dataPosition+1:r.dataPosition+1),_.push(n),l.push(h),o+=f[v].length;break}o+=f[v].length,v++}while(t.avail_in);const d=new Uint8Array(o);for(let g=0,w=0;g>>=0,(r=0<=e&&e<256)&&(a=Ui[e],a)?a:(t=O(e,(e|0)<0?-1:0,!0),r&&(Ui[e]=t),t)):(e|=0,(r=-128<=e&&e<128)&&(a=Ci[e],a)?a:(t=O(e,e<0?-1:0,!1),r&&(Ci[e]=t),t))}A.fromInt=Se;function P(e,i){if(isNaN(e))return i?ve:K;if(i){if(e<0)return ve;if(e>=Oa)return La}else{if(e<=-Mi)return U;if(e+1>=Mi)return Ia}return e<0?P(-e,i).neg():O(e%Oe|0,e/Oe|0,i)}A.fromNumber=P;function O(e,i,t){return new A(e,i,t)}A.fromBits=O;var ct=Math.pow;function qt(e,i,t){if(e.length===0)throw Error("empty string");if(e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return K;if(typeof i=="number"?(t=i,i=!1):i=!!i,t=t||10,t<2||360)throw Error("interior hyphen");if(a===0)return qt(e.substring(1),i,t).neg();for(var r=P(ct(t,8)),n=K,h=0;h>>0:this.low};s.toNumber=function(){return this.unsigned?(this.high>>>0)*Oe+(this.low>>>0):this.high*Oe+(this.low>>>0)};s.toString=function(i){if(i=i||10,i<2||36>>0,o=l.toString(i);if(h=_,h.isZero())return o+f;for(;o.length<6;)o="0"+o;f=""+o+f}};s.getHighBits=function(){return this.high};s.getHighBitsUnsigned=function(){return this.high>>>0};s.getLowBits=function(){return this.low};s.getLowBitsUnsigned=function(){return this.low>>>0};s.getNumBitsAbs=function(){if(this.isNegative())return this.eq(U)?64:this.neg().getNumBitsAbs();for(var i=this.high!=0?this.high:this.low,t=31;t>0&&!(i&1<=0};s.isOdd=function(){return(this.low&1)===1};s.isEven=function(){return(this.low&1)===0};s.equals=function(i){return $(i)||(i=V(i)),this.unsigned!==i.unsigned&&this.high>>>31===1&&i.high>>>31===1?!1:this.high===i.high&&this.low===i.low};s.eq=s.equals;s.notEquals=function(i){return!this.eq(i)};s.neq=s.notEquals;s.ne=s.notEquals;s.lessThan=function(i){return this.comp(i)<0};s.lt=s.lessThan;s.lessThanOrEqual=function(i){return this.comp(i)<=0};s.lte=s.lessThanOrEqual;s.le=s.lessThanOrEqual;s.greaterThan=function(i){return this.comp(i)>0};s.gt=s.greaterThan;s.greaterThanOrEqual=function(i){return this.comp(i)>=0};s.gte=s.greaterThanOrEqual;s.ge=s.greaterThanOrEqual;s.compare=function(i){if($(i)||(i=V(i)),this.eq(i))return 0;var t=this.isNegative(),a=i.isNegative();return t&&!a?-1:!t&&a?1:this.unsigned?i.high>>>0>this.high>>>0||i.high===this.high&&i.low>>>0>this.low>>>0?-1:1:this.sub(i).isNegative()?-1:1};s.comp=s.compare;s.negate=function(){return!this.unsigned&&this.eq(U)?U:this.not().add(Te)};s.neg=s.negate;s.add=function(i){$(i)||(i=V(i));var t=this.high>>>16,a=this.high&65535,r=this.low>>>16,n=this.low&65535,h=i.high>>>16,f=i.high&65535,_=i.low>>>16,l=i.low&65535,o=0,v=0,d=0,u=0;return u+=n+l,d+=u>>>16,u&=65535,d+=r+_,v+=d>>>16,d&=65535,v+=a+f,o+=v>>>16,v&=65535,o+=t+h,o&=65535,O(d<<16|u,o<<16|v,this.unsigned)};s.subtract=function(i){return $(i)||(i=V(i)),this.add(i.neg())};s.sub=s.subtract;s.multiply=function(i){if(this.isZero())return K;if($(i)||(i=V(i)),H){var t=H.mul(this.low,this.high,i.low,i.high);return O(t,H.get_high(),this.unsigned)}if(i.isZero())return K;if(this.eq(U))return i.isOdd()?U:K;if(i.eq(U))return this.isOdd()?U:K;if(this.isNegative())return i.isNegative()?this.neg().mul(i.neg()):this.neg().mul(i).neg();if(i.isNegative())return this.mul(i.neg()).neg();if(this.lt(Hi)&&i.lt(Hi))return P(this.toNumber()*i.toNumber(),this.unsigned);var a=this.high>>>16,r=this.high&65535,n=this.low>>>16,h=this.low&65535,f=i.high>>>16,_=i.high&65535,l=i.low>>>16,o=i.low&65535,v=0,d=0,u=0,g=0;return g+=h*o,u+=g>>>16,g&=65535,u+=n*o,d+=u>>>16,u&=65535,u+=h*l,d+=u>>>16,u&=65535,d+=r*o,v+=d>>>16,d&=65535,d+=n*l,v+=d>>>16,d&=65535,d+=h*_,v+=d>>>16,d&=65535,v+=a*o+r*l+n*_+h*f,v&=65535,O(u<<16|g,v<<16|d,this.unsigned)};s.mul=s.multiply;s.divide=function(i){if($(i)||(i=V(i)),i.isZero())throw Error("division by zero");if(H){if(!this.unsigned&&this.high===-2147483648&&i.low===-1&&i.high===-1)return this;var t=(this.unsigned?H.div_u:H.div_s)(this.low,this.high,i.low,i.high);return O(t,H.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?ve:K;var a,r,n;if(this.unsigned){if(i.unsigned||(i=i.toUnsigned()),i.gt(this))return ve;if(i.gt(this.shru(1)))return Za;n=ve}else{if(this.eq(U)){if(i.eq(Te)||i.eq(Ut))return U;if(i.eq(U))return Te;var h=this.shr(1);return a=h.div(i).shl(1),a.eq(K)?i.isNegative()?Te:Ut:(r=this.sub(i.mul(a)),n=a.add(r.div(i)),n)}else if(i.eq(U))return this.unsigned?ve:K;if(this.isNegative())return i.isNegative()?this.neg().div(i.neg()):this.neg().div(i).neg();if(i.isNegative())return this.div(i.neg()).neg();n=K}for(r=this;r.gte(i);){a=Math.max(1,Math.floor(r.toNumber()/i.toNumber()));for(var f=Math.ceil(Math.log(a)/Math.LN2),_=f<=48?1:ct(2,f-48),l=P(a),o=l.mul(i);o.isNegative()||o.gt(r);)a-=_,l=P(a,this.unsigned),o=l.mul(i);l.isZero()&&(l=Te),n=n.add(l),r=r.sub(o)}return n};s.div=s.divide;s.modulo=function(i){if($(i)||(i=V(i)),H){var t=(this.unsigned?H.rem_u:H.rem_s)(this.low,this.high,i.low,i.high);return O(t,H.get_high(),this.unsigned)}return this.sub(this.div(i).mul(i))};s.mod=s.modulo;s.rem=s.modulo;s.not=function(){return O(~this.low,~this.high,this.unsigned)};s.and=function(i){return $(i)||(i=V(i)),O(this.low&i.low,this.high&i.high,this.unsigned)};s.or=function(i){return $(i)||(i=V(i)),O(this.low|i.low,this.high|i.high,this.unsigned)};s.xor=function(i){return $(i)||(i=V(i)),O(this.low^i.low,this.high^i.high,this.unsigned)};s.shiftLeft=function(i){return $(i)&&(i=i.toInt()),(i&=63)===0?this:i<32?O(this.low<>>32-i,this.unsigned):O(0,this.low<>>i|this.high<<32-i,this.high>>i,this.unsigned):O(this.high>>i-32,this.high>=0?0:-1,this.unsigned)};s.shr=s.shiftRight;s.shiftRightUnsigned=function(i){if($(i)&&(i=i.toInt()),i&=63,i===0)return this;var t=this.high;if(i<32){var a=this.low;return O(a>>>i|t<<32-i,t>>>i,this.unsigned)}else return i===32?O(t,0,this.unsigned):O(t>>>i-32,0,this.unsigned)};s.shru=s.shiftRightUnsigned;s.shr_u=s.shiftRightUnsigned;s.toSigned=function(){return this.unsigned?O(this.low,this.high,!1):this};s.toUnsigned=function(){return this.unsigned?this:O(this.low,this.high,!0)};s.toBytes=function(i){return i?this.toBytesLE():this.toBytesBE()};s.toBytesLE=function(){var i=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24,i&255,i>>>8&255,i>>>16&255,i>>>24]};s.toBytesBE=function(){var i=this.high,t=this.low;return[i>>>24,i>>>16&255,i>>>8&255,i&255,t>>>24,t>>>16&255,t>>>8&255,t&255]};A.fromBytes=function(i,t,a){return a?A.fromBytesLE(i,t):A.fromBytesBE(i,t)};A.fromBytesLE=function(i,t){return new A(i[0]|i[1]<<8|i[2]<<16|i[3]<<24,i[4]|i[5]<<8|i[6]<<16|i[7]<<24,t)};A.fromBytesBE=function(i,t){return new A(i[4]<<24|i[5]<<16|i[6]<<8|i[7],i[0]<<24|i[1]<<16|i[2]<<8|i[3],t)};const Lr=Da(Nr);export{Lr as L,Ir as a,Zr as u}; diff --git a/playground/assets/remoteFile-Dv8-F_G9.js b/playground/assets/remoteFile-Dv8-F_G9.js deleted file mode 100644 index f42cda7..0000000 --- a/playground/assets/remoteFile-Dv8-F_G9.js +++ /dev/null @@ -1 +0,0 @@ -import{b as d}from"./index-BHN4ZNUB.js";class b{async getBufferFromResponse(e){const t=await e.arrayBuffer();return d.Buffer.from(t)}constructor(e,t={}){this.baseOverrides={},this.url=e;const r=t.fetch||globalThis.fetch.bind(globalThis);if(!r)throw new TypeError("no fetch function supplied, and none found in global environment");t.overrides&&(this.baseOverrides=t.overrides),this.fetchImplementation=r}async fetch(e,t){let r;try{r=await this.fetchImplementation(e,t)}catch(s){if(`${s}`.includes("Failed to fetch"))console.warn(`generic-filehandle: refetching ${e} to attempt to work around chrome CORS header caching bug`),r=await this.fetchImplementation(e,{...t,cache:"reload"});else throw s}return r}async read(e,t=0,r,s=0,h={}){const{headers:n={},signal:c,overrides:a={}}=h;r<1/0?n.range=`bytes=${s}-${s+r}`:r===1/0&&s!==0&&(n.range=`bytes=${s}-`);const l={...this.baseOverrides,...a,headers:{...n,...a.headers,...this.baseOverrides.headers},method:"GET",redirect:"follow",mode:"cors",signal:c},i=await this.fetch(this.url,l);if(!i.ok)throw new Error(`HTTP ${i.status} ${i.statusText} ${this.url}`);if(i.status===200&&s===0||i.status===206){const f=await this.getBufferFromResponse(i),u=f.copy(e,t,0,Math.min(r,f.length)),w=i.headers.get("content-range"),o=/\/(\d+)$/.exec(w||"");return o!=null&&o[1]&&(this._stat={size:parseInt(o[1],10)}),{bytesRead:u,buffer:e}}throw i.status===200?new Error("${this.url} fetch returned status 200, expected 206"):new Error(`HTTP ${i.status} fetching ${this.url}`)}async readFile(e={}){let t,r;typeof e=="string"?(t=e,r={}):(t=e.encoding,r=e,delete r.encoding);const{headers:s={},signal:h,overrides:n={}}=r,c={headers:s,method:"GET",redirect:"follow",mode:"cors",signal:h,...this.baseOverrides,...n},a=await this.fetch(this.url,c);if(!a)throw new Error("generic-filehandle failed to fetch");if(a.status!==200)throw Object.assign(new Error(`HTTP ${a.status} fetching ${this.url}`),{status:a.status});if(t==="utf8")return a.text();if(t)throw new Error(`unsupported encoding: ${t}`);return this.getBufferFromResponse(a)}async stat(){if(!this._stat){const e=d.Buffer.allocUnsafe(10);if(await this.read(e,0,10,0),!this._stat)throw new Error(`unable to determine size of file at ${this.url}`)}return this._stat}async close(){}}export{b as R}; diff --git a/playground/assets/remoteFile-_ulnNXZo.js b/playground/assets/remoteFile-_ulnNXZo.js new file mode 100644 index 0000000..9f8a9c8 --- /dev/null +++ b/playground/assets/remoteFile-_ulnNXZo.js @@ -0,0 +1 @@ +import{b as d}from"./index-CJAFAeH3.js";function u(n){return(typeof n=="object"&&n!==null&&"message"in n?n.message:`${n}`).replace(/\.$/,"")}class ${async getBufferFromResponse(e){const t=await e.arrayBuffer();return d.Buffer.from(t)}constructor(e,t={}){this.baseOverrides={},this.url=e;const r=t.fetch||globalThis.fetch.bind(globalThis);if(!r)throw new TypeError("no fetch function supplied, and none found in global environment");t.overrides&&(this.baseOverrides=t.overrides),this.fetchImplementation=r}async fetch(e,t){let r;try{r=await this.fetchImplementation(e,t)}catch(s){if(`${s}`.includes("Failed to fetch")){console.warn(`generic-filehandle: refetching ${e} to attempt to work around chrome CORS header caching bug`);try{r=await this.fetchImplementation(e,{...t,cache:"reload"})}catch(i){throw new Error(`${u(i)} fetching ${e}`,{cause:i})}}else throw new Error(`${u(s)} fetching ${e}`,{cause:s})}return r}async read(e,t=0,r,s=0,i={}){const{headers:c={},signal:o,overrides:f={}}=i;r<1/0?c.range=`bytes=${s}-${s+r}`:r===1/0&&s!==0&&(c.range=`bytes=${s}-`);const a=await this.fetch(this.url,{...this.baseOverrides,...f,headers:{...c,...f.headers,...this.baseOverrides.headers},method:"GET",redirect:"follow",mode:"cors",signal:o});if(!a.ok)throw new Error(`HTTP ${a.status} fetching ${this.url}`);if(a.status===200&&s===0||a.status===206){const l=await this.getBufferFromResponse(a),g=l.copy(e,t,0,Math.min(r,l.length)),w=a.headers.get("content-range"),h=/\/(\d+)$/.exec(w||"");return h!=null&&h[1]&&(this._stat={size:parseInt(h[1],10)}),{bytesRead:g,buffer:e}}throw a.status===200?new Error(`${this.url} fetch returned status 200, expected 206`):new Error(`HTTP ${a.status} fetching ${this.url}`)}async readFile(e={}){let t,r;typeof e=="string"?(t=e,r={}):(t=e.encoding,r=e,delete r.encoding);const{headers:s={},signal:i,overrides:c={}}=r,o=await this.fetch(this.url,{headers:s,method:"GET",redirect:"follow",mode:"cors",signal:i,...this.baseOverrides,...c});if(o.status!==200)throw new Error(`HTTP ${o.status} fetching ${this.url}`);if(t==="utf8")return o.text();if(t)throw new Error(`unsupported encoding: ${t}`);return this.getBufferFromResponse(o)}async stat(){if(!this._stat){const e=d.Buffer.allocUnsafe(10);if(await this.read(e,0,10,0),!this._stat)throw new Error(`unable to determine size of file at ${this.url}`)}return this._stat}async close(){}}export{$ as R}; diff --git a/playground/assets/standalone-CBDkzVPv.js b/playground/assets/standalone-CBDkzVPv.js new file mode 100644 index 0000000..3134de5 --- /dev/null +++ b/playground/assets/standalone-CBDkzVPv.js @@ -0,0 +1,39 @@ +var Pt=Object.defineProperty;var $t=(e,u,t)=>u in e?Pt(e,u,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[u]=t;var he=(e,u,t)=>$t(e,typeof u!="symbol"?u+"":u,t);var Lt=Object.create,Xe=Object.defineProperty,Mt=Object.getOwnPropertyDescriptor,Rt=Object.getOwnPropertyNames,Wt=Object.getPrototypeOf,zt=Object.prototype.hasOwnProperty,Gu=e=>{throw TypeError(e)},Hu=(e,u)=>()=>(u||e((u={exports:{}}).exports,u),u.exports),eu=(e,u)=>{for(var t in u)Xe(e,t,{get:u[t],enumerable:!0})},Vt=(e,u,t,r)=>{if(u&&typeof u=="object"||typeof u=="function")for(let D of Rt(u))!zt.call(e,D)&&D!==t&&Xe(e,D,{get:()=>u[D],enumerable:!(r=Mt(u,D))||r.enumerable});return e},we=(e,u,t)=>(t=e!=null?Lt(Wt(e)):{},Vt(Xe(t,"default",{value:e,enumerable:!0}),e)),qt=(e,u,t)=>u.has(e)||Gu("Cannot "+t),Jt=(e,u,t)=>u.has(e)?Gu("Cannot add the same private member more than once"):u instanceof WeakSet?u.add(e):u.set(e,t),le=(e,u,t)=>(qt(e,u,"access private method"),t),uu=Hu((e,u)=>{var t=new Proxy(String,{get:()=>t});u.exports=t}),Kt=Hu(e=>{Object.defineProperty(e,"__esModule",{value:!0});function u(){return new Proxy({},{get:()=>n=>n})}var t=/\r\n|[\n\r\u2028\u2029]/;function r(n,o,a){let i=Object.assign({column:0,line:-1},n.start),s=Object.assign({},i,n.end),{linesAbove:l=2,linesBelow:F=3}=a||{},c=i.line,d=i.column,f=s.line,p=s.column,h=Math.max(c-(l+1),0),g=Math.min(o.length,f+F);c===-1&&(h=0),f===-1&&(g=o.length);let y=f-c,C={};if(y)for(let m=0;m<=y;m++){let E=m+c;if(!d)C[E]=!0;else if(m===0){let v=o[E-1].length;C[E]=[d,v-d+1]}else if(m===y)C[E]=[0,p];else{let v=o[E-m].length;C[E]=[0,v]}}else d===p?d?C[c]=[d,0]:C[c]=!0:C[c]=[d,p-d];return{start:h,end:g,markerLines:C}}function D(n,o,a={}){let i=u(),s=n.split(t),{start:l,end:F,markerLines:c}=r(o,s,a),d=o.start&&typeof o.start.column=="number",f=String(F).length,p=n.split(t,F).slice(l,F).map((h,g)=>{let y=l+1+g,C=` ${` ${y}`.slice(-f)} |`,m=c[y],E=!c[y+1];if(m){let v="";if(Array.isArray(m)){let A=h.slice(0,Math.max(m[0]-1,0)).replace(/[^\t]/g," "),N=m[1]||1;v=[` + `,i.gutter(C.replace(/\d/g," "))," ",A,i.marker("^").repeat(N)].join(""),E&&a.message&&(v+=" "+i.message(a.message))}return[i.marker(">"),i.gutter(C),h.length>0?` ${h}`:"",v].join("")}else return` ${i.gutter(C)}${h.length>0?` ${h}`:""}`}).join(` +`);return a.message&&!d&&(p=`${" ".repeat(f+1)}${a.message} +${p}`),p}e.codeFrameColumns=D}),Yu={};eu(Yu,{__debug:()=>eo,check:()=>QD,doc:()=>Ot,format:()=>Tt,formatWithCursor:()=>jt,getSupportInfo:()=>XD,util:()=>_t,version:()=>wD});var Ut=(e,u,t,r)=>{if(!(e&&u==null))return u.replaceAll?u.replaceAll(t,r):t.global?u.replace(t,r):u.split(t).join(r)},ke=Ut;function _(){}_.prototype={diff:function(e,u){var t,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},D=r.callback;typeof r=="function"&&(D=r,r={});var n=this;function o(C){return C=n.postProcess(C,r),D?(setTimeout(function(){D(C)},0),!0):C}e=this.castInput(e,r),u=this.castInput(u,r),e=this.removeEmpty(this.tokenize(e,r)),u=this.removeEmpty(this.tokenize(u,r));var a=u.length,i=e.length,s=1,l=a+i;r.maxEditLength!=null&&(l=Math.min(l,r.maxEditLength));var F=(t=r.timeout)!==null&&t!==void 0?t:1/0,c=Date.now()+F,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],u,e,0,r);if(d[0].oldPos+1>=i&&f+1>=a)return o(hu(n,d[0].lastComponent,u,e,n.useLongestToken));var p=-1/0,h=1/0;function g(){for(var C=Math.max(p,-s);C<=Math.min(h,s);C+=2){var m=void 0,E=d[C-1],v=d[C+1];E&&(d[C-1]=void 0);var A=!1;if(v){var N=v.oldPos-C;A=v&&0<=N&&N=i&&f+1>=a)return o(hu(n,m.lastComponent,u,e,n.useLongestToken));d[C]=m,m.oldPos+1>=i&&(h=Math.min(h,C-1)),f+1>=a&&(p=Math.max(p,C+1))}s++}if(D)(function C(){setTimeout(function(){if(s>l||Date.now()>c)return D();g()||C()},0)})();else for(;s<=l&&Date.now()<=c;){var y=g();if(y)return y}},addToPath:function(e,u,t,r,D){var n=e.lastComponent;return n&&!D.oneChangePerToken&&n.added===u&&n.removed===t?{oldPos:e.oldPos+r,lastComponent:{count:n.count+1,added:u,removed:t,previousComponent:n.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:u,removed:t,previousComponent:n}}},extractCommon:function(e,u,t,r,D){for(var n=u.length,o=t.length,a=e.oldPos,i=a-r,s=0;i+1d.length?p:d}),F.value=e.join(c)}else F.value=e.join(t.slice(s,s+F.count));s+=F.count,F.added||(l+=F.count)}}return n}function Cu(e,u){var t;for(t=0;tu.length&&(t=e.length-u.length);var r=u.length;e.length0&&u[o]!=u[n];)n=D[n];u[o]==u[n]&&n++}n=0;for(var a=t;a0&&e[a]!=u[n];)n=D[n];e[a]==u[n]&&n++}return n}var Be="a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",Ht=new RegExp("[".concat(Be,"]+|\\s+|[^").concat(Be,"]"),"ug"),Se=new _;Se.equals=function(e,u,t){return t.ignoreCase&&(e=e.toLowerCase(),u=u.toLowerCase()),e.trim()===u.trim()};Se.tokenize=function(e){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t;if(u.intlSegmenter){if(u.intlSegmenter.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');t=Array.from(u.intlSegmenter.segment(e),function(n){return n.segment})}else t=e.match(Ht)||[];var r=[],D=null;return t.forEach(function(n){/\s/.test(n)?D==null?r.push(n):r.push(r.pop()+n):/\s/.test(D)?r[r.length-1]==D?r.push(r.pop()+n):r.push(D+n):r.push(n),D=n}),r};Se.join=function(e){return e.map(function(u,t){return t==0?u:u.replace(/^\s+/,"")}).join("")};Se.postProcess=function(e,u){if(!e||u.oneChangePerToken)return e;var t=null,r=null,D=null;return e.forEach(function(n){n.added?r=n:n.removed?D=n:((r||D)&&Eu(t,D,r,n),t=n,r=null,D=null)}),(r||D)&&Eu(t,D,r,null),e};function Eu(e,u,t,r){if(u&&t){var D=u.value.match(/^\s*/)[0],n=u.value.match(/\s*$/)[0],o=t.value.match(/^\s*/)[0],a=t.value.match(/\s*$/)[0];if(e){var i=Cu(D,o);e.value=Ve(e.value,o,i),u.value=ce(u.value,i),t.value=ce(t.value,i)}if(r){var s=mu(n,a);r.value=ze(r.value,a,s),u.value=Ce(u.value,s),t.value=Ce(t.value,s)}}else if(t)e&&(t.value=t.value.replace(/^\s*/,"")),r&&(r.value=r.value.replace(/^\s*/,""));else if(e&&r){var l=r.value.match(/^\s*/)[0],F=u.value.match(/^\s*/)[0],c=u.value.match(/\s*$/)[0],d=Cu(l,F);u.value=ce(u.value,d);var f=mu(ce(l,d),c);u.value=Ce(u.value,f),r.value=ze(r.value,l,f),e.value=Ve(e.value,l,l.slice(0,l.length-f.length))}else if(r){var p=r.value.match(/^\s*/)[0],h=u.value.match(/\s*$/)[0],g=gu(h,p);u.value=Ce(u.value,g)}else if(e){var y=e.value.match(/\s*$/)[0],C=u.value.match(/^\s*/)[0],m=gu(y,C);u.value=ce(u.value,m)}}var Yt=new _;Yt.tokenize=function(e){var u=new RegExp("(\\r?\\n)|[".concat(Be,"]+|[^\\S\\n\\r]+|[^").concat(Be,"]"),"ug");return e.match(u)||[]};var tu=new _;tu.tokenize=function(e,u){u.stripTrailingCr&&(e=e.replace(/\r\n/g,` +`));var t=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(var D=0;D"u"?t:o}:r;return typeof e=="string"?e:JSON.stringify(Je(e,null,null,D),D," ")};de.equals=function(e,u,t){return _.prototype.equals.call(de,e.replace(/,([\r\n])/g,"$1"),u.replace(/,([\r\n])/g,"$1"),t)};function Je(e,u,t,r,D){u=u||[],t=t||[],r&&(e=r(D,e));var n;for(n=0;nnew Intl.ListFormat("en-US",{type:"disjunction"}).format(e);function nr(e){let u=e===null?"null":typeof e;if(u!=="string"&&u!=="object")return`Unexpected doc '${u}', +Expected it to be 'string' or 'object'.`;if(ee(e))throw new Error("doc is valid.");let t=Object.prototype.toString.call(e);if(t!=="[object Object]")return`Unexpected doc '${t}'.`;let r=rr([...Qu].map(D=>`'${D}'`));return`Unexpected doc.type '${e.type}'. +Expected it to be ${r}.`}var Dr=class extends Error{constructor(u){super(nr(u));he(this,"name","InvalidDocError");this.doc=u}},ae=Dr,yu={};function or(e,u,t,r){let D=[e];for(;D.length>0;){let n=D.pop();if(n===yu){t(D.pop());continue}t&&D.push(n,yu);let o=ee(n);if(!o)throw new ae(n);if((u==null?void 0:u(n))!==!1)switch(o){case P:case j:{let a=o===P?n:n.parts;for(let i=a.length,s=i-1;s>=0;--s)D.push(a[s]);break}case S:D.push(n.flatContents,n.breakContents);break;case k:if(r&&n.expandedStates)for(let a=n.expandedStates.length,i=a-1;i>=0;--i)D.push(n.expandedStates[i]);else D.push(n.contents);break;case L:case $:case R:case T:case W:D.push(n.contents);break;case Q:case X:case M:case z:case b:case x:break;default:throw new ae(n)}}}var nu=or,ar=()=>{},ir=ar;function Ae(e){return{type:$,contents:e}}function ie(e,u){return{type:L,contents:u,n:e}}function Xu(e,u={}){return ir(u.expandedStates),{type:k,id:u.id,contents:e,break:!!u.shouldBreak,expandedStates:u.expandedStates}}function sr(e){return ie(Number.NEGATIVE_INFINITY,e)}function lr(e){return ie({type:"root"},e)}function cr(e){return ie(-1,e)}function fr(e,u){return Xu(e[0],{...u,expandedStates:e})}function dr(e){return{type:j,parts:e}}function Fr(e,u="",t={}){return{type:S,breakContents:e,flatContents:u,groupId:t.groupId}}function pr(e,u){return{type:R,contents:e,groupId:u.groupId,negate:u.negate}}function Ke(e){return{type:W,contents:e}}var hr={type:z},xe={type:x},Cr={type:M},Du={type:b,hard:!0},et={type:b,hard:!0,literal:!0},ut={type:b},mr={type:b,soft:!0},Y=[Du,xe],tt=[et,xe],H={type:X};function rt(e,u){let t=[];for(let r=0;r0){for(let D=0;D0?`, { ${l.join(", ")} }`:"";return`indentIfBreak(${r(n.contents)}${F})`}if(n.type===k){let l=[];n.break&&n.break!=="propagated"&&l.push("shouldBreak: true"),n.id&&l.push(`id: ${D(n.id)}`);let F=l.length>0?`, { ${l.join(", ")} }`:"";return n.expandedStates?`conditionalGroup([${n.expandedStates.map(c=>r(c)).join(",")}]${F})`:`group(${r(n.contents)}${F})`}if(n.type===j)return`fill([${n.parts.map(l=>r(l)).join(", ")}])`;if(n.type===W)return"lineSuffix("+r(n.contents)+")";if(n.type===z)return"lineSuffixBoundary";if(n.type===T)return`label(${JSON.stringify(n.label)}, ${r(n.contents)})`;throw new Error("Unknown doc type "+n.type)}function D(n){if(typeof n!="symbol")return JSON.stringify(String(n));if(n in u)return u[n];let o=n.description||"symbol";for(let a=0;;a++){let i=o+(a>0?` #${a}`:"");if(!t.has(i))return t.add(i),u[n]=`Symbol.for(${JSON.stringify(i)})`}}}var yr=(e,u,t)=>{if(!(e&&u==null))return Array.isArray(u)||typeof u=="string"?u[t<0?u.length+t:t]:u.at(t)},B=yr,vr=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function Br(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function br(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}var Ar=e=>!(Br(e)||br(e)),wr=/[^\x20-\x7F]/u;function kr(e){if(!e)return 0;if(!wr.test(e))return e.length;e=e.replace(vr()," ");let u=0;for(let t of e){let r=t.codePointAt(0);r<=31||r>=127&&r<=159||r>=768&&r<=879||(u+=Ar(r)?1:2)}return u}var ou=kr;function Ne(e,u){if(typeof e=="string")return u(e);let t=new Map;return r(e);function r(n){if(t.has(n))return t.get(n);let o=D(n);return t.set(n,o),o}function D(n){switch(ee(n)){case P:return u(n.map(r));case j:return u({...n,parts:n.parts.map(r)});case S:return u({...n,breakContents:r(n.breakContents),flatContents:r(n.flatContents)});case k:{let{expandedStates:o,contents:a}=n;return o?(o=o.map(r),a=o[0]):a=r(a),u({...n,contents:a,expandedStates:o})}case L:case $:case R:case T:case W:return u({...n,contents:r(n.contents)});case Q:case X:case M:case z:case b:case x:return u(n);default:throw new ae(n)}}}function au(e,u,t){let r=t,D=!1;function n(o){if(D)return!1;let a=u(o);a!==void 0&&(D=!0,r=a)}return nu(e,n),r}function Sr(e){if(e.type===k&&e.break||e.type===b&&e.hard||e.type===x)return!0}function xr(e){return au(e,Sr,!1)}function vu(e){if(e.length>0){let u=B(!1,e,-1);!u.expandedStates&&!u.break&&(u.break="propagated")}return null}function Nr(e){let u=new Set,t=[];function r(n){if(n.type===x&&vu(t),n.type===k){if(t.push(n),u.has(n))return!1;u.add(n)}}function D(n){n.type===k&&t.pop().break&&vu(t)}nu(e,r,D,!0)}function Or(e){return e.type===b&&!e.hard?e.soft?"":" ":e.type===S?e.flatContents:e}function _r(e){return Ne(e,Or)}function Bu(e){for(e=[...e];e.length>=2&&B(!1,e,-2).type===b&&B(!1,e,-1).type===x;)e.length-=2;if(e.length>0){let u=fe(B(!1,e,-1));e[e.length-1]=u}return e}function fe(e){switch(ee(e)){case $:case R:case k:case W:case T:{let u=fe(e.contents);return{...e,contents:u}}case S:return{...e,breakContents:fe(e.breakContents),flatContents:fe(e.flatContents)};case j:return{...e,parts:Bu(e.parts)};case P:return Bu(e);case Q:return e.replace(/[\n\r]*$/u,"");case L:case X:case M:case z:case b:case x:break;default:throw new ae(e)}return e}function Dt(e){return fe(Tr(e))}function jr(e){switch(ee(e)){case j:if(e.parts.every(u=>u===""))return"";break;case k:if(!e.contents&&!e.id&&!e.break&&!e.expandedStates)return"";if(e.contents.type===k&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case L:case $:case R:case W:if(!e.contents)return"";break;case S:if(!e.flatContents&&!e.breakContents)return"";break;case P:{let u=[];for(let t of e){if(!t)continue;let[r,...D]=Array.isArray(t)?t:[t];typeof r=="string"&&typeof B(!1,u,-1)=="string"?u[u.length-1]+=r:u.push(r),u.push(...D)}return u.length===0?"":u.length===1?u[0]:u}case Q:case X:case M:case z:case b:case T:case x:break;default:throw new ae(e)}return e}function Tr(e){return Ne(e,u=>jr(u))}function Ir(e,u=tt){return Ne(e,t=>typeof t=="string"?rt(u,t.split(` +`)):t)}function Pr(e){if(e.type===b)return!0}function $r(e){return au(e,Pr,!1)}function Ee(e,u){return e.type===T?{...e,contents:u(e.contents)}:u(e)}var w=Symbol("MODE_BREAK"),O=Symbol("MODE_FLAT"),te=Symbol("cursor"),bu=Symbol("DOC_FILL_PRINTED_LENGTH");function ot(){return{value:"",length:0,queue:[]}}function Lr(e,u){return Ue(e,{type:"indent"},u)}function Mr(e,u,t){return u===Number.NEGATIVE_INFINITY?e.root||ot():u<0?Ue(e,{type:"dedent"},t):u?u.type==="root"?{...e,root:e}:Ue(e,{type:typeof u=="string"?"stringAlign":"numberAlign",n:u},t):e}function Ue(e,u,t){let r=u.type==="dedent"?e.queue.slice(0,-1):[...e.queue,u],D="",n=0,o=0,a=0;for(let f of r)switch(f.type){case"indent":l(),t.useTabs?i(1):s(t.tabWidth);break;case"stringAlign":l(),D+=f.n,n+=f.n.length;break;case"numberAlign":o+=1,a+=f.n;break;default:throw new Error(`Unexpected type '${f.type}'`)}return c(),{...e,value:D,length:n,queue:r};function i(f){D+=" ".repeat(f),n+=t.tabWidth*f}function s(f){D+=" ".repeat(f),n+=f}function l(){t.useTabs?F():c()}function F(){o>0&&i(o),d()}function c(){a>0&&s(a),d()}function d(){o=0,a=0}}function Ge(e){let u=0,t=0,r=e.length;e:for(;r--;){let D=e[r];if(D===te){t++;continue}for(let n=D.length-1;n>=0;n--){let o=D[n];if(o===" "||o===" ")u++;else{e[r]=D.slice(0,n+1);break e}}}if(u>0||t>0)for(e.length=r+1;t-- >0;)e.push(te);return u}function me(e,u,t,r,D,n){if(t===Number.POSITIVE_INFINITY)return!0;let o=u.length,a=[e],i=[];for(;t>=0;){if(a.length===0){if(o===0)return!0;a.push(u[--o]);continue}let{mode:s,doc:l}=a.pop(),F=ee(l);switch(F){case Q:i.push(l),t-=ou(l);break;case P:case j:{let c=F===P?l:l.parts;for(let d=c.length-1;d>=0;d--)a.push({mode:s,doc:c[d]});break}case $:case L:case R:case T:a.push({mode:s,doc:l.contents});break;case M:t+=Ge(i);break;case k:{if(n&&l.break)return!1;let c=l.break?w:s,d=l.expandedStates&&c===w?B(!1,l.expandedStates,-1):l.contents;a.push({mode:c,doc:d});break}case S:{let c=(l.groupId?D[l.groupId]||O:s)===w?l.breakContents:l.flatContents;c&&a.push({mode:s,doc:c});break}case b:if(s===w||l.hard)return!0;l.soft||(i.push(" "),t--);break;case W:r=!0;break;case z:if(r)return!1;break}}return!1}function Oe(e,u){let t={},r=u.printWidth,D=ru(u.endOfLine),n=0,o=[{ind:ot(),mode:w,doc:e}],a=[],i=!1,s=[],l=0;for(Nr(e);o.length>0;){let{ind:c,mode:d,doc:f}=o.pop();switch(ee(f)){case Q:{let p=D!==` +`?ke(!1,f,` +`,D):f;a.push(p),o.length>0&&(n+=ou(p));break}case P:for(let p=f.length-1;p>=0;p--)o.push({ind:c,mode:d,doc:f[p]});break;case X:if(l>=2)throw new Error("There are too many 'cursor' in doc.");a.push(te),l++;break;case $:o.push({ind:Lr(c,u),mode:d,doc:f.contents});break;case L:o.push({ind:Mr(c,f.n,u),mode:d,doc:f.contents});break;case M:n-=Ge(a);break;case k:switch(d){case O:if(!i){o.push({ind:c,mode:f.break?w:O,doc:f.contents});break}case w:{i=!1;let p={ind:c,mode:O,doc:f.contents},h=r-n,g=s.length>0;if(!f.break&&me(p,o,h,g,t))o.push(p);else if(f.expandedStates){let y=B(!1,f.expandedStates,-1);if(f.break){o.push({ind:c,mode:w,doc:y});break}else for(let C=1;C=f.expandedStates.length){o.push({ind:c,mode:w,doc:y});break}else{let m=f.expandedStates[C],E={ind:c,mode:O,doc:m};if(me(E,o,h,g,t)){o.push(E);break}}}else o.push({ind:c,mode:w,doc:f.contents});break}}f.id&&(t[f.id]=B(!1,o,-1).mode);break;case j:{let p=r-n,h=f[bu]??0,{parts:g}=f,y=g.length-h;if(y===0)break;let C=g[h+0],m=g[h+1],E={ind:c,mode:O,doc:C},v={ind:c,mode:w,doc:C},A=me(E,[],p,s.length>0,t,!0);if(y===1){A?o.push(E):o.push(v);break}let N={ind:c,mode:O,doc:m},ue={ind:c,mode:w,doc:m};if(y===2){A?o.push(N,E):o.push(ue,v);break}let It=g[h+2],Ie={ind:c,mode:d,doc:{...f,[bu]:h+2}};me({ind:c,mode:O,doc:[C,m,It]},[],p,s.length>0,t,!0)?o.push(Ie,N,E):A?o.push(Ie,ue,E):o.push(Ie,ue,v);break}case S:case R:{let p=f.groupId?t[f.groupId]:d;if(p===w){let h=f.type===S?f.breakContents:f.negate?f.contents:Ae(f.contents);h&&o.push({ind:c,mode:d,doc:h})}if(p===O){let h=f.type===S?f.flatContents:f.negate?Ae(f.contents):f.contents;h&&o.push({ind:c,mode:d,doc:h})}break}case W:s.push({ind:c,mode:d,doc:f.contents});break;case z:s.length>0&&o.push({ind:c,mode:d,doc:Du});break;case b:switch(d){case O:if(f.hard)i=!0;else{f.soft||(a.push(" "),n+=1);break}case w:if(s.length>0){o.push({ind:c,mode:d,doc:f},...s.reverse()),s.length=0;break}f.literal?c.root?(a.push(D,c.root.value),n=c.root.length):(a.push(D),n=0):(n-=Ge(a),a.push(D+c.value),n=c.length);break}break;case T:o.push({ind:c,mode:d,doc:f.contents});break;case x:break;default:throw new ae(f)}o.length===0&&s.length>0&&(o.push(...s.reverse()),s.length=0)}let F=a.indexOf(te);if(F!==-1){let c=a.indexOf(te,F+1);if(c===-1)return{formatted:a.filter(h=>h!==te).join("")};let d=a.slice(0,F).join(""),f=a.slice(F+1,c).join(""),p=a.slice(c+1).join("");return{formatted:d+f+p,cursorNodeStart:d.length,cursorNodeText:f}}return{formatted:a.join("")}}function Rr(e,u,t=0){let r=0;for(let D=t;D1?B(!1,e,-2):null}getValue(){return B(!1,this.stack,-1)}getNode(e=0){let u=le(this,K,He).call(this,e);return u===-1?null:this.stack[u]}getParentNode(e=0){return this.getNode(e+1)}call(e,...u){let{stack:t}=this,{length:r}=t,D=B(!1,t,-1);for(let n of u)D=D[n],t.push(n,D);try{return e(this)}finally{t.length=r}}callParent(e,u=0){let t=le(this,K,He).call(this,u+1),r=this.stack.splice(t+1);try{return e(this)}finally{this.stack.push(...r)}}each(e,...u){let{stack:t}=this,{length:r}=t,D=B(!1,t,-1);for(let n of u)D=D[n],t.push(n,D);try{for(let n=0;n{t[D]=e(r,D,n)},...u),t}match(...e){let u=this.stack.length-1,t=null,r=this.stack[u--];for(let D of e){if(r===void 0)return!1;let n=null;if(typeof t=="number"&&(n=t,t=this.stack[u--],r=this.stack[u--]),D&&!D(r,t,n))return!1;t=this.stack[u--],r=this.stack[u--]}return!0}findAncestor(e){for(let u of le(this,K,ye).call(this))if(e(u))return u}hasAncestor(e){for(let u of le(this,K,ye).call(this))if(e(u))return!0;return!1}};K=new WeakSet,He=function(e){let{stack:u}=this;for(let t=u.length-1;t>=0;t-=2)if(!Array.isArray(u[t])&&--e<0)return t;return-1},ye=function*(){let{stack:e}=this;for(let u=e.length-3;u>=0;u-=2){let t=e[u];Array.isArray(t)||(yield t)}};var zr=Wr,at=new Proxy(()=>{},{get:()=>at}),Ye=at;function Vr(e){return e!==null&&typeof e=="object"}var qr=Vr;function*_e(e,u){let{getVisitorKeys:t,filter:r=()=>!0}=u,D=n=>qr(n)&&r(n);for(let n of t(e)){let o=e[n];if(Array.isArray(o))for(let a of o)D(a)&&(yield a);else D(o)&&(yield o)}}function*Jr(e,u){let t=[e];for(let r=0;r{let D=!!(r!=null&&r.backwards);if(t===!1)return!1;let{length:n}=u,o=t;for(;o>=0&&o0}var Zr=Yr,lt=new Set(["tokens","comments","parent","enclosingNode","precedingNode","followingNode"]),Qr=e=>Object.keys(e).filter(u=>!lt.has(u));function Xr(e){return e?u=>e(u,lt):Qr}var je=Xr;function en(e){let u=e.type||e.kind||"(unknown type)",t=String(e.name||e.id&&(typeof e.id=="object"?e.id.name:e.id)||e.key&&(typeof e.key=="object"?e.key.name:e.key)||e.value&&(typeof e.value=="object"?"":String(e.value))||e.operator||"");return t.length>20&&(t=t.slice(0,19)+"…"),u+(t?" "+t:"")}function su(e,u){(e.comments??(e.comments=[])).push(u),u.printed=!1,u.nodeDescription=en(e)}function re(e,u){u.leading=!0,u.trailing=!1,su(e,u)}function U(e,u,t){u.leading=!1,u.trailing=!1,t&&(u.marker=t),su(e,u)}function ne(e,u){u.leading=!1,u.trailing=!0,su(e,u)}var Pe=new WeakMap;function lu(e,u){if(Pe.has(e))return Pe.get(e);let{printer:{getCommentChildNodes:t,canAttachComment:r,getVisitorKeys:D},locStart:n,locEnd:o}=u;if(!r)return[];let a=((t==null?void 0:t(e,u))??[..._e(e,{getVisitorKeys:je(D)})]).flatMap(i=>r(i)?[i]:lu(i,u));return a.sort((i,s)=>n(i)-n(s)||o(i)-o(s)),Pe.set(e,a),a}function ct(e,u,t,r){let{locStart:D,locEnd:n}=t,o=D(u),a=n(u),i=lu(e,t),s,l,F=0,c=i.length;for(;F>1,f=i[d],p=D(f),h=n(f);if(p<=o&&a<=h)return ct(f,u,t,f);if(h<=o){s=f,F=d+1;continue}if(a<=p){l=f,c=d;continue}throw new Error("Comment location overlaps with node location")}if((r==null?void 0:r.type)==="TemplateLiteral"){let{quasis:d}=r,f=Le(d,u,t);s&&Le(d,s,t)!==f&&(s=null),l&&Le(d,l,t)!==f&&(l=null)}return{enclosingNode:r,precedingNode:s,followingNode:l}}var $e=()=>!1;function un(e,u){let{comments:t}=e;if(delete e.comments,!Zr(t)||!u.printer.canAttachComment)return;let r=[],{locStart:D,locEnd:n,printer:{experimentalFeatures:{avoidAstMutation:o=!1}={},handleComments:a={}},originalText:i}=u,{ownLine:s=$e,endOfLine:l=$e,remaining:F=$e}=a,c=t.map((d,f)=>({...ct(e,d,u),comment:d,text:i,options:u,ast:e,isLastComment:t.length-1===f}));for(let[d,f]of c.entries()){let{comment:p,precedingNode:h,enclosingNode:g,followingNode:y,text:C,options:m,ast:E,isLastComment:v}=f;if(m.parser==="json"||m.parser==="json5"||m.parser==="jsonc"||m.parser==="__js_expression"||m.parser==="__ts_expression"||m.parser==="__vue_expression"||m.parser==="__vue_ts_expression"){if(D(p)-D(E)<=0){re(E,p);continue}if(n(p)-n(E)>=0){ne(E,p);continue}}let A;if(o?A=[f]:(p.enclosingNode=g,p.precedingNode=h,p.followingNode=y,A=[p,C,m,E,v]),tn(C,m,c,d))p.placement="ownLine",s(...A)||(y?re(y,p):h?ne(h,p):U(g||E,p));else if(rn(C,m,c,d))p.placement="endOfLine",l(...A)||(h?ne(h,p):y?re(y,p):U(g||E,p));else if(p.placement="remaining",!F(...A))if(h&&y){let N=r.length;N>0&&r[N-1].followingNode!==y&&Au(r,m),r.push(f)}else h?ne(h,p):y?re(y,p):U(g||E,p)}if(Au(r,u),!o)for(let d of t)delete d.precedingNode,delete d.enclosingNode,delete d.followingNode}var ft=e=>!/[\S\n\u2028\u2029]/u.test(e);function tn(e,u,t,r){let{comment:D,precedingNode:n}=t[r],{locStart:o,locEnd:a}=u,i=o(D);if(n)for(let s=r-1;s>=0;s--){let{comment:l,precedingNode:F}=t[s];if(F!==n||!ft(e.slice(a(l),i)))break;i=o(l)}return V(e,i,{backwards:!0})}function rn(e,u,t,r){let{comment:D,followingNode:n}=t[r],{locStart:o,locEnd:a}=u,i=a(D);if(n)for(let s=r+1;s0;--i){let{comment:s,precedingNode:l,followingNode:F}=e[i-1];Ye.strictEqual(l,n),Ye.strictEqual(F,o);let c=u.originalText.slice(u.locEnd(s),a);if(((r=(t=u.printer).isGap)==null?void 0:r.call(t,c,u))??/^[\s(]*$/u.test(c))a=u.locStart(s);else break}for(let[s,{comment:l}]of e.entries())s1&&s.comments.sort((l,F)=>u.locStart(l)-u.locStart(F));e.length=0}function Le(e,u,t){let r=t.locStart(u)-1;for(let D=1;D!r.has(a)).length===0)return{leading:"",trailing:""};let D=[],n=[],o;return e.each(()=>{let a=e.node;if(r!=null&&r.has(a))return;let{leading:i,trailing:s}=a;i?D.push(Dn(e,u)):s&&(o=on(e,u,o),n.push(o.doc))},"comments"),{leading:D,trailing:n}}function sn(e,u,t){let{leading:r,trailing:D}=an(e,t);return!r&&!D?u:Ee(u,n=>[r,n,D])}function ln(e){let{[Symbol.for("comments")]:u,[Symbol.for("printedComments")]:t}=e;for(let r of u){if(!r.printed&&!t.has(r))throw new Error('Comment "'+r.value.trim()+'" was not printed. Please report this error!');delete r.printed}}var Ft=class extends Error{constructor(){super(...arguments);he(this,"name","ConfigError")}},wu=class extends Error{constructor(){super(...arguments);he(this,"name","UndefinedParserError")}},cn={cursorOffset:{category:"Special",type:"int",default:-1,range:{start:-1,end:1/0,step:1},description:"Print (to stderr) where a cursor at the given position would move to after formatting.",cliCategory:"Editor"},endOfLine:{category:"Global",type:"choice",default:"lf",description:"Which end of line characters to apply.",choices:[{value:"lf",description:"Line Feed only (\\n), common on Linux and macOS as well as inside git repos"},{value:"crlf",description:"Carriage Return + Line Feed characters (\\r\\n), common on Windows"},{value:"cr",description:"Carriage Return character only (\\r), used very rarely"},{value:"auto",description:`Maintain existing +(mixed values within one file are normalised by looking at what's used after the first line)`}]},filepath:{category:"Special",type:"path",description:"Specify the input filepath. This will be used to do parser inference.",cliName:"stdin-filepath",cliCategory:"Other",cliDescription:"Path to the file to pretend that stdin comes from."},insertPragma:{category:"Special",type:"boolean",default:!1,description:"Insert @format pragma into file's first docblock comment.",cliCategory:"Other"},parser:{category:"Global",type:"choice",default:void 0,description:"Which parser to use.",exception:e=>typeof e=="string"||typeof e=="function",choices:[{value:"flow",description:"Flow"},{value:"babel",description:"JavaScript"},{value:"babel-flow",description:"Flow"},{value:"babel-ts",description:"TypeScript"},{value:"typescript",description:"TypeScript"},{value:"acorn",description:"JavaScript"},{value:"espree",description:"JavaScript"},{value:"meriyah",description:"JavaScript"},{value:"css",description:"CSS"},{value:"less",description:"Less"},{value:"scss",description:"SCSS"},{value:"json",description:"JSON"},{value:"json5",description:"JSON5"},{value:"jsonc",description:"JSON with Comments"},{value:"json-stringify",description:"JSON.stringify"},{value:"graphql",description:"GraphQL"},{value:"markdown",description:"Markdown"},{value:"mdx",description:"MDX"},{value:"vue",description:"Vue"},{value:"yaml",description:"YAML"},{value:"glimmer",description:"Ember / Handlebars"},{value:"html",description:"HTML"},{value:"angular",description:"Angular"},{value:"lwc",description:"Lightning Web Components"}]},plugins:{type:"path",array:!0,default:[{value:[]}],category:"Global",description:"Add a plugin. Multiple plugins can be passed as separate `--plugin`s.",exception:e=>typeof e=="string"||typeof e=="object",cliName:"plugin",cliCategory:"Config"},printWidth:{category:"Global",type:"int",default:80,description:"The line length where Prettier will try wrap.",range:{start:0,end:1/0,step:1}},rangeEnd:{category:"Special",type:"int",default:1/0,range:{start:0,end:1/0,step:1},description:`Format code ending at a given character offset (exclusive). +The range will extend forwards to the end of the selected statement.`,cliCategory:"Editor"},rangeStart:{category:"Special",type:"int",default:0,range:{start:0,end:1/0,step:1},description:`Format code starting at a given character offset. +The range will extend backwards to the start of the first line containing the selected statement.`,cliCategory:"Editor"},requirePragma:{category:"Special",type:"boolean",default:!1,description:`Require either '@prettier' or '@format' to be present in the file's first docblock comment +in order for it to be formatted.`,cliCategory:"Other"},tabWidth:{type:"int",category:"Global",default:2,description:"Number of spaces per indentation level.",range:{start:0,end:1/0,step:1}},useTabs:{category:"Global",type:"boolean",default:!1,description:"Indent with tabs instead of spaces."},embeddedLanguageFormatting:{category:"Global",type:"choice",default:"auto",description:"Control how Prettier formats quoted code embedded in the file.",choices:[{value:"auto",description:"Format embedded code if Prettier can automatically identify it."},{value:"off",description:"Never automatically format embedded code."}]}};function pt({plugins:e=[],showDeprecated:u=!1}={}){let t=e.flatMap(D=>D.languages??[]),r=[];for(let D of dn(Object.assign({},...e.map(({options:n})=>n),cn)))!u&&D.deprecated||(Array.isArray(D.choices)&&(u||(D.choices=D.choices.filter(n=>!n.deprecated)),D.name==="parser"&&(D.choices=[...D.choices,...fn(D.choices,t,e)])),D.pluginDefaults=Object.fromEntries(e.filter(n=>{var o;return((o=n.defaultOptions)==null?void 0:o[D.name])!==void 0}).map(n=>[n.name,n.defaultOptions[D.name]])),r.push(D));return{languages:t,options:r}}function*fn(e,u,t){let r=new Set(e.map(D=>D.value));for(let D of u)if(D.parsers){for(let n of D.parsers)if(!r.has(n)){r.add(n);let o=t.find(i=>i.parsers&&Object.prototype.hasOwnProperty.call(i.parsers,n)),a=D.name;o!=null&&o.name&&(a+=` (plugin: ${o.name})`),yield{value:n,description:a}}}}function dn(e){let u=[];for(let[t,r]of Object.entries(e)){let D={name:t,...r};Array.isArray(D.default)&&(D.default=B(!1,D.default,-1).value),u.push(D)}return u}var Fn=e=>String(e).split(/[/\\]/u).pop();function ku(e,u){if(!u)return;let t=Fn(u).toLowerCase();return e.find(({filenames:r})=>r==null?void 0:r.some(D=>D.toLowerCase()===t))??e.find(({extensions:r})=>r==null?void 0:r.some(D=>t.endsWith(D)))}function pn(e,u){if(u)return e.find(({name:t})=>t.toLowerCase()===u)??e.find(({aliases:t})=>t==null?void 0:t.includes(u))??e.find(({extensions:t})=>t==null?void 0:t.includes(`.${u}`))}function hn(e,u){let t=e.plugins.flatMap(D=>D.languages??[]),r=pn(t,u.language)??ku(t,u.physicalFile)??ku(t,u.file)??(u.physicalFile,void 0);return r==null?void 0:r.parsers[0]}var Cn=hn,De={key:e=>/^[$_a-zA-Z][$_a-zA-Z0-9]*$/.test(e)?e:JSON.stringify(e),value(e){if(e===null||typeof e!="object")return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(t=>De.value(t)).join(", ")}]`;let u=Object.keys(e);return u.length===0?"{}":`{ ${u.map(t=>`${De.key(t)}: ${De.value(e[t])}`).join(", ")} }`},pair:({key:e,value:u})=>De.value({[e]:u})},Su=we(uu()),mn=(e,u,{descriptor:t})=>{let r=[`${Su.default.yellow(typeof e=="string"?t.key(e):t.pair(e))} is deprecated`];return u&&r.push(`we now treat it as ${Su.default.blue(typeof u=="string"?t.key(u):t.pair(u))}`),r.join("; ")+"."},oe=we(uu()),ht=Symbol.for("vnopts.VALUE_NOT_EXIST"),ve=Symbol.for("vnopts.VALUE_UNCHANGED"),xu=" ".repeat(2),gn=(e,u,t)=>{let{text:r,list:D}=t.normalizeExpectedResult(t.schemas[e].expected(t)),n=[];return r&&n.push(Nu(e,u,r,t.descriptor)),D&&n.push([Nu(e,u,D.title,t.descriptor)].concat(D.values.map(o=>Ct(o,t.loggerPrintWidth))).join(` +`)),mt(n,t.loggerPrintWidth)};function Nu(e,u,t,r){return[`Invalid ${oe.default.red(r.key(e))} value.`,`Expected ${oe.default.blue(t)},`,`but received ${u===ht?oe.default.gray("nothing"):oe.default.red(r.value(u))}.`].join(" ")}function Ct({text:e,list:u},t){let r=[];return e&&r.push(`- ${oe.default.blue(e)}`),u&&r.push([`- ${oe.default.blue(u.title)}:`].concat(u.values.map(D=>Ct(D,t-xu.length).replace(/^|\n/g,`$&${xu}`))).join(` +`)),mt(r,t)}function mt(e,u){if(e.length===1)return e[0];let[t,r]=e,[D,n]=e.map(o=>o.split(` +`,1)[0].length);return D>u&&D>n?r:t}var Ou=we(uu()),Me=[],_u=[];function En(e,u){if(e===u)return 0;let t=e;e.length>u.length&&(e=u,u=t);let r=e.length,D=u.length;for(;r>0&&e.charCodeAt(~-r)===u.charCodeAt(~-D);)r--,D--;let n=0;for(;na?s>a?a+1:s:s>i?i+1:s;return a}var gt=(e,u,{descriptor:t,logger:r,schemas:D})=>{let n=[`Ignored unknown option ${Ou.default.yellow(t.pair({key:e,value:u}))}.`],o=Object.keys(D).sort().find(a=>En(e,a)<3);o&&n.push(`Did you mean ${Ou.default.blue(t.key(o))}?`),r.warn(n.join(" "))},yn=["default","expected","validate","deprecated","forward","redirect","overlap","preprocess","postprocess"];function vn(e,u){let t=new e(u),r=Object.create(t);for(let D of yn)D in u&&(r[D]=Bn(u[D],t,J.prototype[D].length));return r}var J=class{static create(e){return vn(this,e)}constructor(e){this.name=e.name}default(e){}expected(e){return"nothing"}validate(e,u){return!1}deprecated(e,u){return!1}forward(e,u){}redirect(e,u){}overlap(e,u,t){return e}preprocess(e,u){return e}postprocess(e,u){return ve}};function Bn(e,u,t){return typeof e=="function"?(...r)=>e(...r.slice(0,t-1),u,...r.slice(t-1)):()=>e}var bn=class extends J{constructor(e){super(e),this._sourceName=e.sourceName}expected(e){return e.schemas[this._sourceName].expected(e)}validate(e,u){return u.schemas[this._sourceName].validate(e,u)}redirect(e,u){return this._sourceName}},An=class extends J{expected(){return"anything"}validate(){return!0}},wn=class extends J{constructor({valueSchema:e,name:u=e.name,...t}){super({...t,name:u}),this._valueSchema=e}expected(e){let{text:u,list:t}=e.normalizeExpectedResult(this._valueSchema.expected(e));return{text:u&&`an array of ${u}`,list:t&&{title:"an array of the following values",values:[{list:t}]}}}validate(e,u){if(!Array.isArray(e))return!1;let t=[];for(let r of e){let D=u.normalizeValidateResult(this._valueSchema.validate(r,u),r);D!==!0&&t.push(D.value)}return t.length===0?!0:{value:t}}deprecated(e,u){let t=[];for(let r of e){let D=u.normalizeDeprecatedResult(this._valueSchema.deprecated(r,u),r);D!==!1&&t.push(...D.map(({value:n})=>({value:[n]})))}return t}forward(e,u){let t=[];for(let r of e){let D=u.normalizeForwardResult(this._valueSchema.forward(r,u),r);t.push(...D.map(ju))}return t}redirect(e,u){let t=[],r=[];for(let D of e){let n=u.normalizeRedirectResult(this._valueSchema.redirect(D,u),D);"remain"in n&&t.push(n.remain),r.push(...n.redirect.map(ju))}return t.length===0?{redirect:r}:{redirect:r,remain:t}}overlap(e,u){return e.concat(u)}};function ju({from:e,to:u}){return{from:[e],to:u}}var kn=class extends J{expected(){return"true or false"}validate(e){return typeof e=="boolean"}};function Sn(e,u){let t=Object.create(null);for(let r of e){let D=r[u];if(t[D])throw new Error(`Duplicate ${u} ${JSON.stringify(D)}`);t[D]=r}return t}function xn(e,u){let t=new Map;for(let r of e){let D=r[u];if(t.has(D))throw new Error(`Duplicate ${u} ${JSON.stringify(D)}`);t.set(D,r)}return t}function Nn(){let e=Object.create(null);return u=>{let t=JSON.stringify(u);return e[t]?!0:(e[t]=!0,!1)}}function On(e,u){let t=[],r=[];for(let D of e)u(D)?t.push(D):r.push(D);return[t,r]}function _n(e){return e===Math.floor(e)}function jn(e,u){if(e===u)return 0;let t=typeof e,r=typeof u,D=["undefined","object","boolean","number","string"];return t!==r?D.indexOf(t)-D.indexOf(r):t!=="string"?Number(e)-Number(u):e.localeCompare(u)}function Tn(e){return(...u)=>{let t=e(...u);return typeof t=="string"?new Error(t):t}}function Tu(e){return e===void 0?{}:e}function Et(e){if(typeof e=="string")return{text:e};let{text:u,list:t}=e;return In((u||t)!==void 0,"Unexpected `expected` result, there should be at least one field."),t?{text:u,list:{title:t.title,values:t.values.map(Et)}}:{text:u}}function Iu(e,u){return e===!0?!0:e===!1?{value:u}:e}function Pu(e,u,t=!1){return e===!1?!1:e===!0?t?!0:[{value:u}]:"value"in e?[e]:e.length===0?!1:e}function $u(e,u){return typeof e=="string"||"key"in e?{from:u,to:e}:"from"in e?{from:e.from,to:e.to}:{from:u,to:e.to}}function Ze(e,u){return e===void 0?[]:Array.isArray(e)?e.map(t=>$u(t,u)):[$u(e,u)]}function Lu(e,u){let t=Ze(typeof e=="object"&&"redirect"in e?e.redirect:e,u);return t.length===0?{remain:u,redirect:t}:typeof e=="object"&&"remain"in e?{remain:e.remain,redirect:t}:{redirect:t}}function In(e,u){if(!e)throw new Error(u)}var Pn=class extends J{constructor(e){super(e),this._choices=xn(e.choices.map(u=>u&&typeof u=="object"?u:{value:u}),"value")}expected({descriptor:e}){let u=Array.from(this._choices.keys()).map(D=>this._choices.get(D)).filter(({hidden:D})=>!D).map(D=>D.value).sort(jn).map(e.value),t=u.slice(0,-2),r=u.slice(-2);return{text:t.concat(r.join(" or ")).join(", "),list:{title:"one of the following values",values:u}}}validate(e){return this._choices.has(e)}deprecated(e){let u=this._choices.get(e);return u&&u.deprecated?{value:e}:!1}forward(e){let u=this._choices.get(e);return u?u.forward:void 0}redirect(e){let u=this._choices.get(e);return u?u.redirect:void 0}},$n=class extends J{expected(){return"a number"}validate(e,u){return typeof e=="number"}},Ln=class extends $n{expected(){return"an integer"}validate(e,u){return u.normalizeValidateResult(super.validate(e,u),e)===!0&&_n(e)}},Mu=class extends J{expected(){return"a string"}validate(e){return typeof e=="string"}},Mn=De,Rn=gt,Wn=gn,zn=mn,Vn=class{constructor(e,u){let{logger:t=console,loggerPrintWidth:r=80,descriptor:D=Mn,unknown:n=Rn,invalid:o=Wn,deprecated:a=zn,missing:i=()=>!1,required:s=()=>!1,preprocess:l=c=>c,postprocess:F=()=>ve}=u||{};this._utils={descriptor:D,logger:t||{warn:()=>{}},loggerPrintWidth:r,schemas:Sn(e,"name"),normalizeDefaultResult:Tu,normalizeExpectedResult:Et,normalizeDeprecatedResult:Pu,normalizeForwardResult:Ze,normalizeRedirectResult:Lu,normalizeValidateResult:Iu},this._unknownHandler=n,this._invalidHandler=Tn(o),this._deprecatedHandler=a,this._identifyMissing=(c,d)=>!(c in d)||i(c,d),this._identifyRequired=s,this._preprocess=l,this._postprocess=F,this.cleanHistory()}cleanHistory(){this._hasDeprecationWarned=Nn()}normalize(e){let u={},t=[this._preprocess(e,this._utils)],r=()=>{for(;t.length!==0;){let D=t.shift(),n=this._applyNormalization(D,u);t.push(...n)}};r();for(let D of Object.keys(this._utils.schemas)){let n=this._utils.schemas[D];if(!(D in u)){let o=Tu(n.default(this._utils));"value"in o&&t.push({[D]:o.value})}}r();for(let D of Object.keys(this._utils.schemas)){if(!(D in u))continue;let n=this._utils.schemas[D],o=u[D],a=n.postprocess(o,this._utils);a!==ve&&(this._applyValidation(a,D,n),u[D]=a)}return this._applyPostprocess(u),this._applyRequiredCheck(u),u}_applyNormalization(e,u){let t=[],{knownKeys:r,unknownKeys:D}=this._partitionOptionKeys(e);for(let n of r){let o=this._utils.schemas[n],a=o.preprocess(e[n],this._utils);this._applyValidation(a,n,o);let i=({from:F,to:c})=>{t.push(typeof c=="string"?{[c]:F}:{[c.key]:c.value})},s=({value:F,redirectTo:c})=>{let d=Pu(o.deprecated(F,this._utils),a,!0);if(d!==!1)if(d===!0)this._hasDeprecationWarned(n)||this._utils.logger.warn(this._deprecatedHandler(n,c,this._utils));else for(let{value:f}of d){let p={key:n,value:f};if(!this._hasDeprecationWarned(p)){let h=typeof c=="string"?{key:c,value:f}:c;this._utils.logger.warn(this._deprecatedHandler(p,h,this._utils))}}};Ze(o.forward(a,this._utils),a).forEach(i);let l=Lu(o.redirect(a,this._utils),a);if(l.redirect.forEach(i),"remain"in l){let F=l.remain;u[n]=n in u?o.overlap(u[n],F,this._utils):F,s({value:F})}for(let{from:F,to:c}of l.redirect)s({value:F,redirectTo:c})}for(let n of D){let o=e[n];this._applyUnknownHandler(n,o,u,(a,i)=>{t.push({[a]:i})})}return t}_applyRequiredCheck(e){for(let u of Object.keys(this._utils.schemas))if(this._identifyMissing(u,e)&&this._identifyRequired(u))throw this._invalidHandler(u,ht,this._utils)}_partitionOptionKeys(e){let[u,t]=On(Object.keys(e).filter(r=>!this._identifyMissing(r,e)),r=>r in this._utils.schemas);return{knownKeys:u,unknownKeys:t}}_applyValidation(e,u,t){let r=Iu(t.validate(e,this._utils),e);if(r!==!0)throw this._invalidHandler(u,r.value,this._utils)}_applyUnknownHandler(e,u,t,r){let D=this._unknownHandler(e,u,this._utils);if(D)for(let n of Object.keys(D)){if(this._identifyMissing(n,D))continue;let o=D[n];n in this._utils.schemas?r(n,o):t[n]=o}}_applyPostprocess(e){let u=this._postprocess(e,this._utils);if(u!==ve){if(u.delete)for(let t of u.delete)delete e[t];if(u.override){let{knownKeys:t,unknownKeys:r}=this._partitionOptionKeys(u.override);for(let D of t){let n=u.override[D];this._applyValidation(n,D,this._utils.schemas[D]),e[D]=n}for(let D of r){let n=u.override[D];this._applyUnknownHandler(D,n,e,(o,a)=>{let i=this._utils.schemas[o];this._applyValidation(a,o,i),e[o]=a})}}}}},Re;function qn(e,u,{logger:t=!1,isCLI:r=!1,passThrough:D=!1,FlagSchema:n,descriptor:o}={}){if(r){if(!n)throw new Error("'FlagSchema' option is required.");if(!o)throw new Error("'descriptor' option is required.")}else o=De;let a=D?Array.isArray(D)?(c,d)=>D.includes(c)?{[c]:d}:void 0:(c,d)=>({[c]:d}):(c,d,f)=>{let{_:p,...h}=f.schemas;return gt(c,d,{...f,schemas:h})},i=Jn(u,{isCLI:r,FlagSchema:n}),s=new Vn(i,{logger:t,unknown:a,descriptor:o}),l=t!==!1;l&&Re&&(s._hasDeprecationWarned=Re);let F=s.normalize(e);return l&&(Re=s._hasDeprecationWarned),F}function Jn(e,{isCLI:u,FlagSchema:t}){let r=[];u&&r.push(An.create({name:"_"}));for(let D of e)r.push(Kn(D,{isCLI:u,optionInfos:e,FlagSchema:t})),D.alias&&u&&r.push(bn.create({name:D.alias,sourceName:D.name}));return r}function Kn(e,{isCLI:u,optionInfos:t,FlagSchema:r}){let{name:D}=e,n={name:D},o,a={};switch(e.type){case"int":o=Ln,u&&(n.preprocess=Number);break;case"string":o=Mu;break;case"choice":o=Pn,n.choices=e.choices.map(i=>i!=null&&i.redirect?{...i,redirect:{to:{key:e.name,value:i.redirect}}}:i);break;case"boolean":o=kn;break;case"flag":o=r,n.flags=t.flatMap(i=>[i.alias,i.description&&i.name,i.oppositeDescription&&`no-${i.name}`].filter(Boolean));break;case"path":o=Mu;break;default:throw new Error(`Unexpected type ${e.type}`)}if(e.exception?n.validate=(i,s,l)=>e.exception(i)||s.validate(i,l):n.validate=(i,s,l)=>i===void 0||s.validate(i,l),e.redirect&&(a.redirect=i=>i?{to:typeof e.redirect=="string"?e.redirect:{key:e.redirect.option,value:e.redirect.value}}:void 0),e.deprecated&&(a.deprecated=!0),u&&!e.array){let i=n.preprocess||(s=>s);n.preprocess=(s,l,F)=>l.preprocess(i(Array.isArray(s)?B(!1,s,-1):s),F)}return e.array?wn.create({...u?{preprocess:i=>Array.isArray(i)?i:[i]}:{},...a,valueSchema:o.create(n)}):o.create({...n,...a})}var Un=qn,Gn=(e,u,t)=>{if(!(e&&u==null)){if(u.findLast)return u.findLast(t);for(let r=u.length-1;r>=0;r--){let D=u[r];if(t(D,r,u))return D}}},yt=Gn;function vt(e,u){if(!u)throw new Error("parserName is required.");let t=yt(!1,e,D=>D.parsers&&Object.prototype.hasOwnProperty.call(D.parsers,u));if(t)return t;let r=`Couldn't resolve parser "${u}".`;throw r+=" Plugins must be explicitly added to the standalone bundle.",new Ft(r)}function Hn(e,u){if(!u)throw new Error("astFormat is required.");let t=yt(!1,e,D=>D.printers&&Object.prototype.hasOwnProperty.call(D.printers,u));if(t)return t;let r=`Couldn't find plugin for AST format "${u}".`;throw r+=" Plugins must be explicitly added to the standalone bundle.",new Ft(r)}function Bt({plugins:e,parser:u}){let t=vt(e,u);return bt(t,u)}function bt(e,u){let t=e.parsers[u];return typeof t=="function"?t():t}function Yn(e,u){let t=e.printers[u];return typeof t=="function"?t():t}var Ru={astFormat:"estree",printer:{},originalText:void 0,locStart:null,locEnd:null};async function Zn(e,u={}){var t;let r={...e};if(!r.parser)if(r.filepath){if(r.parser=Cn(r,{physicalFile:r.filepath}),!r.parser)throw new wu(`No parser could be inferred for file "${r.filepath}".`)}else throw new wu("No parser and no file path given, couldn't infer a parser.");let D=pt({plugins:e.plugins,showDeprecated:!0}).options,n={...Ru,...Object.fromEntries(D.filter(c=>c.default!==void 0).map(c=>[c.name,c.default]))},o=vt(r.plugins,r.parser),a=await bt(o,r.parser);r.astFormat=a.astFormat,r.locEnd=a.locEnd,r.locStart=a.locStart;let i=(t=o.printers)!=null&&t[a.astFormat]?o:Hn(r.plugins,a.astFormat),s=await Yn(i,a.astFormat);r.printer=s;let l=i.defaultOptions?Object.fromEntries(Object.entries(i.defaultOptions).filter(([,c])=>c!==void 0)):{},F={...n,...l};for(let[c,d]of Object.entries(F))(r[c]===null||r[c]===void 0)&&(r[c]=d);return r.parser==="json"&&(r.trailingComma="none"),Un(r,D,{passThrough:Object.keys(Ru),...u})}var se=Zn,Qn=we(Kt());async function Xn(e,u){let t=await Bt(u),r=t.preprocess?t.preprocess(e,u):e;u.originalText=r;let D;try{D=await t.parse(r,u,u)}catch(n){eD(n,e)}return{text:r,ast:D}}function eD(e,u){let{loc:t}=e;if(t){let r=(0,Qn.codeFrameColumns)(u,t,{highlightCode:!0});throw e.message+=` +`+r,e.codeFrame=r,e}throw e}var pe=Xn;async function uD(e,u,t,r,D){let{embeddedLanguageFormatting:n,printer:{embed:o,hasPrettierIgnore:a=()=>!1,getVisitorKeys:i}}=t;if(!o||n!=="auto")return;if(o.length>2)throw new Error("printer.embed has too many parameters. The API changed in Prettier v3. Please update your plugin. See https://prettier.io/docs/en/plugins.html#optional-embed");let s=je(o.getVisitorKeys??i),l=[];d();let F=e.stack;for(let{print:f,node:p,pathStack:h}of l)try{e.stack=h;let g=await f(c,u,e,t);g&&D.set(p,g)}catch(g){if(globalThis.PRETTIER_DEBUG)throw g}e.stack=F;function c(f,p){return tD(f,p,t,r)}function d(){let{node:f}=e;if(f===null||typeof f!="object"||a(e))return;for(let h of s(f))Array.isArray(f[h])?e.each(d,h):e.call(d,h);let p=o(e,t);if(p){if(typeof p=="function"){l.push({print:p,node:f,pathStack:[...e.stack]});return}D.set(f,p)}}}async function tD(e,u,t,r){let D=await se({...t,...u,parentParser:t.parser,originalText:e},{passThrough:!0}),{ast:n}=await pe(e,D),o=await r(n,D);return Dt(o)}function rD(e,u){let{originalText:t,[Symbol.for("comments")]:r,locStart:D,locEnd:n,[Symbol.for("printedComments")]:o}=u,{node:a}=e,i=D(a),s=n(a);for(let l of r)D(l)>=i&&n(l)<=s&&o.add(l);return t.slice(i,s)}var nD=rD;async function Te(e,u){({ast:e}=await At(e,u));let t=new Map,r=new zr(e),D=new Map;await uD(r,o,u,Te,D);let n=await Wu(r,u,o,void 0,D);if(ln(u),u.nodeAfterCursor&&!u.nodeBeforeCursor)return[H,n];if(u.nodeBeforeCursor&&!u.nodeAfterCursor)return[n,H];return n;function o(i,s){return i===void 0||i===r?a(s):Array.isArray(i)?r.call(()=>a(s),...i):r.call(()=>a(s),i)}function a(i){let s=r.node;if(s==null)return"";let l=s&&typeof s=="object"&&i===void 0;if(l&&t.has(s))return t.get(s);let F=Wu(r,u,o,i,D);return l&&t.set(s,F),F}}function Wu(e,u,t,r,D){var n;let{node:o}=e,{printer:a}=u,i;switch((n=a.hasPrettierIgnore)!=null&&n.call(a,e)?i=nD(e,u):D.has(o)?i=D.get(o):i=a.print(e,u,t,r),o){case u.cursorNode:i=Ee(i,s=>[H,s,H]);break;case u.nodeBeforeCursor:i=Ee(i,s=>[s,H]);break;case u.nodeAfterCursor:i=Ee(i,s=>[H,s]);break}return a.printComment&&(!a.willPrintOwnComments||!a.willPrintOwnComments(e,u))&&(i=sn(e,i,u)),i}async function At(e,u){let t=e.comments??[];u[Symbol.for("comments")]=t,u[Symbol.for("tokens")]=e.tokens??[],u[Symbol.for("printedComments")]=new Set,un(e,u);let{printer:{preprocess:r}}=u;return e=r?await r(e,u):e,{ast:e,comments:t}}function DD(e,u){let{cursorOffset:t,locStart:r,locEnd:D}=u,n=je(u.printer.getVisitorKeys),o=d=>r(d)<=t&&D(d)>=t,a=e,i=[e];for(let d of Jr(e,{getVisitorKeys:n,filter:o}))i.push(d),a=d;if(Kr(a,{getVisitorKeys:n}))return{cursorNode:a};let s,l,F=-1,c=Number.POSITIVE_INFINITY;for(;i.length>0&&(s===void 0||l===void 0);){a=i.pop();let d=s!==void 0,f=l!==void 0;for(let p of _e(a,{getVisitorKeys:n})){if(!d){let h=D(p);h<=t&&h>F&&(s=p,F=h)}if(!f){let h=r(p);h>=t&&ho(c,i)).filter(Boolean);let s={},l=new Set(D(a));for(let c in a)!Object.prototype.hasOwnProperty.call(a,c)||n.has(c)||(l.has(c)?s[c]=o(a[c],a):s[c]=a[c]);let F=t(a,s,i);if(F!==null)return F??s}}var iD=aD,sD=(e,u,t)=>{if(!(e&&u==null)){if(u.findLastIndex)return u.findLastIndex(t);for(let r=u.length-1;r>=0;r--){let D=u[r];if(t(D,r,u))return r}return-1}},lD=sD,cD=({parser:e})=>e==="json"||e==="json5"||e==="jsonc"||e==="json-stringify";function fD(e,u){let t=[e.node,...e.parentNodes],r=new Set([u.node,...u.parentNodes]);return t.find(D=>wt.has(D.type)&&r.has(D))}function zu(e){let u=lD(!1,e,t=>t.type!=="Program"&&t.type!=="File");return u===-1?e:e.slice(0,u+1)}function dD(e,u,{locStart:t,locEnd:r}){let D=e.node,n=u.node;if(D===n)return{startNode:D,endNode:n};let o=t(e.node);for(let i of zu(u.parentNodes))if(t(i)>=o)n=i;else break;let a=r(u.node);for(let i of zu(e.parentNodes)){if(r(i)<=a)D=i;else break;if(D===n)break}return{startNode:D,endNode:n}}function Qe(e,u,t,r,D=[],n){let{locStart:o,locEnd:a}=t,i=o(e),s=a(e);if(!(u>s||ur);let a=e.slice(r,D).search(/\S/u),i=a===-1;if(!i)for(r+=a;D>r&&!/\S/u.test(e[D-1]);--D);let s=Qe(t,r,u,(d,f)=>Vu(u,d,f),[],"rangeStart"),l=i?s:Qe(t,D,u,d=>Vu(u,d),[],"rangeEnd");if(!s||!l)return{rangeStart:0,rangeEnd:0};let F,c;if(cD(u)){let d=fD(s,l);F=d,c=d}else({startNode:F,endNode:c}=dD(s,l,u));return{rangeStart:Math.min(n(F),n(c)),rangeEnd:Math.max(o(F),o(c))}}var kt="\uFEFF",qu=Symbol("cursor");async function St(e,u,t=0){if(!e||e.trim().length===0)return{formatted:"",cursorOffset:-1,comments:[]};let{ast:r,text:D}=await pe(e,u);u.cursorOffset>=0&&(u={...u,...oD(r,u)});let n=await Te(r,u);t>0&&(n=nt([Y,n],t,u.tabWidth));let o=Oe(n,u);if(t>0){let i=o.formatted.trim();o.cursorNodeStart!==void 0&&(o.cursorNodeStart-=o.formatted.indexOf(i),o.cursorNodeStart<0&&(o.cursorNodeStart=0,o.cursorNodeText=o.cursorNodeText.trimStart()),o.cursorNodeStart+o.cursorNodeText.length>i.length&&(o.cursorNodeText=o.cursorNodeText.trimEnd())),o.formatted=i+ru(u.endOfLine)}let a=u[Symbol.for("comments")];if(u.cursorOffset>=0){let i,s,l,F;if((u.cursorNode||u.nodeBeforeCursor||u.nodeAfterCursor)&&o.cursorNodeText)if(l=o.cursorNodeStart,F=o.cursorNodeText,u.cursorNode)i=u.locStart(u.cursorNode),s=D.slice(i,u.locEnd(u.cursorNode));else{if(!u.nodeBeforeCursor&&!u.nodeAfterCursor)throw new Error("Cursor location must contain at least one of cursorNode, nodeBeforeCursor, nodeAfterCursor");i=u.nodeBeforeCursor?u.locEnd(u.nodeBeforeCursor):0;let g=u.nodeAfterCursor?u.locStart(u.nodeAfterCursor):D.length;s=D.slice(i,g)}else i=0,s=D,l=0,F=o.formatted;let c=u.cursorOffset-i;if(s===F)return{formatted:o.formatted,cursorOffset:l+c,comments:a};let d=s.split("");d.splice(c,0,qu);let f=F.split(""),p=Xt(d,f),h=l;for(let g of p)if(g.removed){if(g.value.includes(qu))break}else h+=g.count;return{formatted:o.formatted,cursorOffset:h,comments:a}}return{formatted:o.formatted,cursorOffset:-1,comments:a}}async function CD(e,u){let{ast:t,text:r}=await pe(e,u),{rangeStart:D,rangeEnd:n}=hD(r,u,t),o=r.slice(D,n),a=Math.min(D,r.lastIndexOf(` +`,D)+1),i=r.slice(a,D).match(/^\s*/u)[0],s=iu(i,u.tabWidth),l=await St(o,{...u,rangeStart:0,rangeEnd:Number.POSITIVE_INFINITY,cursorOffset:u.cursorOffset>D&&u.cursorOffset<=n?u.cursorOffset-D:-1,endOfLine:"lf"},s),F=l.formatted.trimEnd(),{cursorOffset:c}=u;c>n?c+=F.length-o.length:l.cursorOffset>=0&&(c=l.cursorOffset+D);let d=r.slice(0,D)+F+r.slice(n);if(u.endOfLine!=="lf"){let f=ru(u.endOfLine);c>=0&&f===`\r +`&&(c+=Zu(d.slice(0,c),` +`)),d=ke(!1,d,` +`,f)}return{formatted:d,cursorOffset:c,comments:l.comments}}function We(e,u,t){return typeof u!="number"||Number.isNaN(u)||u<0||u>e.length?t:u}function Ju(e,u){let{cursorOffset:t,rangeStart:r,rangeEnd:D}=u;return t=We(e,t,-1),r=We(e,r,0),D=We(e,D,e.length),{...u,cursorOffset:t,rangeStart:r,rangeEnd:D}}function xt(e,u){let{cursorOffset:t,rangeStart:r,rangeEnd:D,endOfLine:n}=Ju(e,u),o=e.charAt(0)===kt;if(o&&(e=e.slice(1),t--,r--,D--),n==="auto"&&(n=er(e)),e.includes("\r")){let a=i=>Zu(e.slice(0,Math.max(i,0)),`\r +`);t-=a(t),r-=a(r),D-=a(D),e=ur(e)}return{hasBOM:o,text:e,options:Ju(e,{...u,cursorOffset:t,rangeStart:r,rangeEnd:D,endOfLine:n})}}async function Ku(e,u){let t=await Bt(u);return!t.hasPragma||t.hasPragma(e)}async function Nt(e,u){let{hasBOM:t,text:r,options:D}=xt(e,await se(u));if(D.rangeStart>=D.rangeEnd&&r!==""||D.requirePragma&&!await Ku(r,D))return{formatted:e,cursorOffset:u.cursorOffset,comments:[]};let n;return D.rangeStart>0||D.rangeEnd=0&&n.cursorOffset++),n}async function mD(e,u,t){let{text:r,options:D}=xt(e,await se(u)),n=await pe(r,D);return t&&(t.preprocessForPrint&&(n.ast=await At(n.ast,D)),t.massage&&(n.ast=iD(n.ast,D))),n}async function gD(e,u){u=await se(u);let t=await Te(e,u);return Oe(t,u)}async function ED(e,u){let t=Er(e),{formatted:r}=await Nt(t,{...u,parser:"__js_expression"});return r}async function yD(e,u){u=await se(u);let{ast:t}=await pe(e,u);return Te(t,u)}async function vD(e,u){return Oe(e,await se(u))}var Ot={};eu(Ot,{builders:()=>BD,printer:()=>bD,utils:()=>AD});var BD={join:rt,line:ut,softline:mr,hardline:Y,literalline:tt,group:Xu,conditionalGroup:fr,fill:dr,lineSuffix:Ke,lineSuffixBoundary:hr,cursor:H,breakParent:xe,ifBreak:Fr,trim:Cr,indent:Ae,indentIfBreak:pr,align:ie,addAlignmentToDoc:nt,markAsRoot:lr,dedentToRoot:sr,dedent:cr,hardlineWithoutBreakParent:Du,literallineWithoutBreakParent:et,label:gr,concat:e=>e},bD={printDocToString:Oe},AD={willBreak:xr,traverseDoc:nu,findInDoc:au,mapDoc:Ne,removeLines:_r,stripTrailingHardline:Dt,replaceEndOfLine:Ir,canBreak:$r},wD="3.4.1",_t={};eu(_t,{addDanglingComment:()=>U,addLeadingComment:()=>re,addTrailingComment:()=>ne,getAlignmentSize:()=>iu,getIndentSize:()=>_D,getMaxContinuousCount:()=>ID,getNextNonSpaceNonCommentCharacter:()=>$D,getNextNonSpaceNonCommentCharacterIndex:()=>UD,getPreferredQuote:()=>MD,getStringWidth:()=>ou,hasNewline:()=>V,hasNewlineInRange:()=>WD,hasSpaces:()=>VD,isNextLineEmpty:()=>ZD,isNextLineEmptyAfterIndex:()=>pu,isPreviousLineEmpty:()=>HD,makeString:()=>JD,skip:()=>Fe,skipEverythingButNewLine:()=>st,skipInlineComment:()=>fu,skipNewline:()=>Z,skipSpaces:()=>q,skipToLineEnd:()=>it,skipTrailingComment:()=>du,skipWhitespace:()=>Ur});function kD(e,u){if(u===!1)return!1;if(e.charAt(u)==="/"&&e.charAt(u+1)==="*"){for(let t=u+2;tMath.max(r,D.length/u.length),0)}var ID=TD;function PD(e,u){let t=Fu(e,u);return t===!1?"":e.charAt(t)}var $D=PD,ge="'",Uu='"';function LD(e,u){let t=u===!0||u===ge?ge:Uu,r=t===ge?Uu:ge,D=0,n=0;for(let o of e)o===t?D++:o===r&&n++;return D>n?r:t}var MD=LD;function RD(e,u,t){for(let r=u;ro===r?o:a===u?"\\"+a:a||(t&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(o)?o:"\\"+o));return u+D+u}var JD=qD;function KD(e,u,t){return Fu(e,t(u))}function UD(e,u){return arguments.length===2||typeof u=="number"?Fu(e,u):KD(...arguments)}function GD(e,u,t){return cu(e,t(u))}function HD(e,u){return arguments.length===2||typeof u=="number"?cu(e,u):GD(...arguments)}function YD(e,u,t){return pu(e,t(u))}function ZD(e,u){return arguments.length===2||typeof u=="number"?pu(e,u):YD(...arguments)}function G(e,u=1){return async(...t)=>{let r=t[u]??{},D=r.plugins??[];return t[u]={...r,plugins:Array.isArray(D)?D:Object.values(D)},e(...t)}}var jt=G(Nt);async function Tt(e,u){let{formatted:t}=await jt(e,{...u,cursorOffset:-1});return t}async function QD(e,u){return await Tt(e,u)===e}var XD=G(pt,0),eo={parse:G(mD),formatAST:G(gD),formatDoc:G(ED),printToDoc:G(yD),printDocToString:G(vD)},to=Yu;export{eo as __debug,QD as check,to as default,Ot as doc,Tt as format,jt as formatWithCursor,XD as getSupportInfo,_t as util,wD as version}; diff --git a/playground/index.html b/playground/index.html index 986ea25..1e8e25f 100644 --- a/playground/index.html +++ b/playground/index.html @@ -1,18 +1,19 @@ - + + + + + GenomeSpy Playground + + + + + + - - - - GenomeSpy Playground - - - - - - - - - - - \ No newline at end of file + + +