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OAAS,EACvB,IAAK,MAAMoe,KAAiBD,EAAe,CACvC,MAAME,EAAwBb,EAAuBY,IAC7CP,eAAgBS,EAAqBR,WAAYS,EAAiBR,oBAAqBS,GAA6BR,EAAeI,GACvIG,IACKhC,IACDA,EAAS,IAEbA,EAAOrX,KAAK,CACR4X,SAAUsB,EACVrB,kBAAmBqB,EAAcxL,cACjCiL,eAAgBS,EAChBR,WAAYS,EACZR,oBAAqBS,EACrBC,sBAAuBJ,IAGnC,CAEJ,MAAO,CAAEvB,WAAUC,oBAAmBc,iBAAgBC,aAAYC,sBAAqBxB,SAAQ0B,wBAAuBQ,sBAAuBP,EACjJ,CACA,SAASF,EAAelB,GACpB,IAAIe,EAEAA,EADA,KACiBf,EAAS/L,QAAQ,MAAO,MAGxB+L,EAAS/L,QAAQ,MAAO,MAG7C,MAAM+M,GAAa,QAAeD,GAAgB9M,QAAQ,QAAS,IACnE,MAAO,CACH8M,iBACAC,aACAC,oBAAqBD,EAAWlL,cAExC,CACO,SAAS8L,EAAaC,GACzB,OAAItf,MAAMC,QAAQqf,GACPf,EAAae,EAAK7b,KAAI8b,GAASA,EAAM9B,WAAUvd,KAAKoe,IAExDC,EAAae,EAAK7B,SAC7B,C","sources":["file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/base/common/equals.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/base/common/errorMessage.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/base/common/errors.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/base/common/event.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/base/common/extpath.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/base/common/filters.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/base/common/functional.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/base/common/fuzzyScorer.js"],"sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as arrays from './arrays.js';\nexport const strictEquals = (a, b) => a === b;\n/**\n * Checks if the items of two arrays are equal.\n * By default, strict equality is used to compare elements, but a custom equality comparer can be provided.\n */\nexport function itemsEquals(itemEquals = strictEquals) {\n return (a, b) => arrays.equals(a, b, itemEquals);\n}\n/**\n * Uses `item.equals(other)` to determine equality.\n */\nexport function itemEquals() {\n return (a, b) => a.equals(b);\n}\nexport function equalsIfDefined(v1, v2, equals) {\n if (!v1 || !v2) {\n return v1 === v2;\n }\n return equals(v1, v2);\n}\nconst objIds = new WeakMap();\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as arrays from './arrays.js';\nimport * as types from './types.js';\nimport * as nls from '../../nls.js';\nfunction exceptionToErrorMessage(exception, verbose) {\n if (verbose && (exception.stack || exception.stacktrace)) {\n return nls.localize('stackTrace.format', \"{0}: {1}\", detectSystemErrorMessage(exception), stackToString(exception.stack) || stackToString(exception.stacktrace));\n }\n return detectSystemErrorMessage(exception);\n}\nfunction stackToString(stack) {\n if (Array.isArray(stack)) {\n return stack.join('\\n');\n }\n return stack;\n}\nfunction detectSystemErrorMessage(exception) {\n // Custom node.js error from us\n if (exception.code === 'ERR_UNC_HOST_NOT_ALLOWED') {\n return `${exception.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`;\n }\n // See https://nodejs.org/api/errors.html#errors_class_system_error\n if (typeof exception.code === 'string' && typeof exception.errno === 'number' && typeof exception.syscall === 'string') {\n return nls.localize('nodeExceptionMessage', \"A system error occurred ({0})\", exception.message);\n }\n return exception.message || nls.localize('error.defaultMessage', \"An unknown error occurred. Please consult the log for more details.\");\n}\n/**\n * Tries to generate a human readable error message out of the error. If the verbose parameter\n * is set to true, the error message will include stacktrace details if provided.\n *\n * @returns A string containing the error message.\n */\nexport function toErrorMessage(error = null, verbose = false) {\n if (!error) {\n return nls.localize('error.defaultMessage', \"An unknown error occurred. Please consult the log for more details.\");\n }\n if (Array.isArray(error)) {\n const errors = arrays.coalesce(error);\n const msg = toErrorMessage(errors[0], verbose);\n if (errors.length > 1) {\n return nls.localize('error.moreErrors', \"{0} ({1} errors in total)\", msg, errors.length);\n }\n return msg;\n }\n if (types.isString(error)) {\n return error;\n }\n if (error.detail) {\n const detail = error.detail;\n if (detail.error) {\n return exceptionToErrorMessage(detail.error, verbose);\n }\n if (detail.exception) {\n return exceptionToErrorMessage(detail.exception, verbose);\n }\n }\n if (error.stack) {\n return exceptionToErrorMessage(error, verbose);\n }\n if (error.message) {\n return error.message;\n }\n return nls.localize('error.defaultMessage', \"An unknown error occurred. Please consult the log for more details.\");\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n// Avoid circular dependency on EventEmitter by implementing a subset of the interface.\nexport class ErrorHandler {\n constructor() {\n this.listeners = [];\n this.unexpectedErrorHandler = function (e) {\n setTimeout(() => {\n if (e.stack) {\n if (ErrorNoTelemetry.isErrorNoTelemetry(e)) {\n throw new ErrorNoTelemetry(e.message + '\\n\\n' + e.stack);\n }\n throw new Error(e.message + '\\n\\n' + e.stack);\n }\n throw e;\n }, 0);\n };\n }\n emit(e) {\n this.listeners.forEach((listener) => {\n listener(e);\n });\n }\n onUnexpectedError(e) {\n this.unexpectedErrorHandler(e);\n this.emit(e);\n }\n // For external errors, we don't want the listeners to be called\n onUnexpectedExternalError(e) {\n this.unexpectedErrorHandler(e);\n }\n}\nexport const errorHandler = new ErrorHandler();\nexport function onUnexpectedError(e) {\n // ignore errors from cancelled promises\n if (!isCancellationError(e)) {\n errorHandler.onUnexpectedError(e);\n }\n return undefined;\n}\nexport function onUnexpectedExternalError(e) {\n // ignore errors from cancelled promises\n if (!isCancellationError(e)) {\n errorHandler.onUnexpectedExternalError(e);\n }\n return undefined;\n}\nexport function transformErrorForSerialization(error) {\n if (error instanceof Error) {\n const { name, message } = error;\n const stack = error.stacktrace || error.stack;\n return {\n $isError: true,\n name,\n message,\n stack,\n noTelemetry: ErrorNoTelemetry.isErrorNoTelemetry(error)\n };\n }\n // return as is\n return error;\n}\nconst canceledName = 'Canceled';\n/**\n * Checks if the given error is a promise in canceled state\n */\nexport function isCancellationError(error) {\n if (error instanceof CancellationError) {\n return true;\n }\n return error instanceof Error && error.name === canceledName && error.message === canceledName;\n}\n// !!!IMPORTANT!!!\n// Do NOT change this class because it is also used as an API-type.\nexport class CancellationError extends Error {\n constructor() {\n super(canceledName);\n this.name = this.message;\n }\n}\n/**\n * @deprecated use {@link CancellationError `new CancellationError()`} instead\n */\nexport function canceled() {\n const error = new Error(canceledName);\n error.name = error.message;\n return error;\n}\nexport function illegalArgument(name) {\n if (name) {\n return new Error(`Illegal argument: ${name}`);\n }\n else {\n return new Error('Illegal argument');\n }\n}\nexport function illegalState(name) {\n if (name) {\n return new Error(`Illegal state: ${name}`);\n }\n else {\n return new Error('Illegal state');\n }\n}\nexport class NotSupportedError extends Error {\n constructor(message) {\n super('NotSupported');\n if (message) {\n this.message = message;\n }\n }\n}\n/**\n * Error that when thrown won't be logged in telemetry as an unhandled error.\n */\nexport class ErrorNoTelemetry extends Error {\n constructor(msg) {\n super(msg);\n this.name = 'CodeExpectedError';\n }\n static fromError(err) {\n if (err instanceof ErrorNoTelemetry) {\n return err;\n }\n const result = new ErrorNoTelemetry();\n result.message = err.message;\n result.stack = err.stack;\n return result;\n }\n static isErrorNoTelemetry(err) {\n return err.name === 'CodeExpectedError';\n }\n}\n/**\n * This error indicates a bug.\n * Do not throw this for invalid user input.\n * Only catch this error to recover gracefully from bugs.\n */\nexport class BugIndicatingError extends Error {\n constructor(message) {\n super(message || 'An unexpected bug occurred.');\n Object.setPrototypeOf(this, BugIndicatingError.prototype);\n // Because we know for sure only buggy code throws this,\n // we definitely want to break here and fix the bug.\n // eslint-disable-next-line no-debugger\n // debugger;\n }\n}\n","import { onUnexpectedError } from './errors.js';\nimport { createSingleCallFunction } from './functional.js';\nimport { combinedDisposable, Disposable, DisposableStore, toDisposable } from './lifecycle.js';\nimport { LinkedList } from './linkedList.js';\nimport { StopWatch } from './stopwatch.js';\n// -----------------------------------------------------------------------------------------------------------------------\n// Uncomment the next line to print warnings whenever a listener is GC'ed without having been disposed. This is a LEAK.\n// -----------------------------------------------------------------------------------------------------------------------\nconst _enableListenerGCedWarning = false;\n// -----------------------------------------------------------------------------------------------------------------------\n// Uncomment the next line to print warnings whenever an emitter with listeners is disposed. That is a sign of code smell.\n// -----------------------------------------------------------------------------------------------------------------------\nconst _enableDisposeWithListenerWarning = false;\n// -----------------------------------------------------------------------------------------------------------------------\n// Uncomment the next line to print warnings whenever a snapshotted event is used repeatedly without cleanup.\n// See https://github.com/microsoft/vscode/issues/142851\n// -----------------------------------------------------------------------------------------------------------------------\nconst _enableSnapshotPotentialLeakWarning = false;\nexport var Event;\n(function (Event) {\n Event.None = () => Disposable.None;\n function _addLeakageTraceLogic(options) {\n if (_enableSnapshotPotentialLeakWarning) {\n const { onDidAddListener: origListenerDidAdd } = options;\n const stack = Stacktrace.create();\n let count = 0;\n options.onDidAddListener = () => {\n if (++count === 2) {\n console.warn('snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here');\n stack.print();\n }\n origListenerDidAdd === null || origListenerDidAdd === void 0 ? void 0 : origListenerDidAdd();\n };\n }\n }\n /**\n * Given an event, returns another event which debounces calls and defers the listeners to a later task via a shared\n * `setTimeout`. The event is converted into a signal (`Event`) to avoid additional object creation as a\n * result of merging events and to try prevent race conditions that could arise when using related deferred and\n * non-deferred events.\n *\n * This is useful for deferring non-critical work (eg. general UI updates) to ensure it does not block critical work\n * (eg. latency of keypress to text rendered).\n *\n * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned\n * event is accessible to \"third parties\", e.g the event is a public property. Otherwise a leaked listener on the\n * returned event causes this utility to leak a listener on the original event.\n *\n * @param event The event source for the new event.\n * @param disposable A disposable store to add the new EventEmitter to.\n */\n function defer(event, disposable) {\n return debounce(event, () => void 0, 0, undefined, true, undefined, disposable);\n }\n Event.defer = defer;\n /**\n * Given an event, returns another event which only fires once.\n *\n * @param event The event source for the new event.\n */\n function once(event) {\n return (listener, thisArgs = null, disposables) => {\n // we need this, in case the event fires during the listener call\n let didFire = false;\n let result = undefined;\n result = event(e => {\n if (didFire) {\n return;\n }\n else if (result) {\n result.dispose();\n }\n else {\n didFire = true;\n }\n return listener.call(thisArgs, e);\n }, null, disposables);\n if (didFire) {\n result.dispose();\n }\n return result;\n };\n }\n Event.once = once;\n /**\n * Maps an event of one type into an event of another type using a mapping function, similar to how\n * `Array.prototype.map` works.\n *\n * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned\n * event is accessible to \"third parties\", e.g the event is a public property. Otherwise a leaked listener on the\n * returned event causes this utility to leak a listener on the original event.\n *\n * @param event The event source for the new event.\n * @param map The mapping function.\n * @param disposable A disposable store to add the new EventEmitter to.\n */\n function map(event, map, disposable) {\n return snapshot((listener, thisArgs = null, disposables) => event(i => listener.call(thisArgs, map(i)), null, disposables), disposable);\n }\n Event.map = map;\n /**\n * Wraps an event in another event that performs some function on the event object before firing.\n *\n * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned\n * event is accessible to \"third parties\", e.g the event is a public property. Otherwise a leaked listener on the\n * returned event causes this utility to leak a listener on the original event.\n *\n * @param event The event source for the new event.\n * @param each The function to perform on the event object.\n * @param disposable A disposable store to add the new EventEmitter to.\n */\n function forEach(event, each, disposable) {\n return snapshot((listener, thisArgs = null, disposables) => event(i => { each(i); listener.call(thisArgs, i); }, null, disposables), disposable);\n }\n Event.forEach = forEach;\n function filter(event, filter, disposable) {\n return snapshot((listener, thisArgs = null, disposables) => event(e => filter(e) && listener.call(thisArgs, e), null, disposables), disposable);\n }\n Event.filter = filter;\n /**\n * Given an event, returns the same event but typed as `Event`.\n */\n function signal(event) {\n return event;\n }\n Event.signal = signal;\n function any(...events) {\n return (listener, thisArgs = null, disposables) => {\n const disposable = combinedDisposable(...events.map(event => event(e => listener.call(thisArgs, e))));\n return addAndReturnDisposable(disposable, disposables);\n };\n }\n Event.any = any;\n /**\n * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned\n * event is accessible to \"third parties\", e.g the event is a public property. Otherwise a leaked listener on the\n * returned event causes this utility to leak a listener on the original event.\n */\n function reduce(event, merge, initial, disposable) {\n let output = initial;\n return map(event, e => {\n output = merge(output, e);\n return output;\n }, disposable);\n }\n Event.reduce = reduce;\n function snapshot(event, disposable) {\n let listener;\n const options = {\n onWillAddFirstListener() {\n listener = event(emitter.fire, emitter);\n },\n onDidRemoveLastListener() {\n listener === null || listener === void 0 ? void 0 : listener.dispose();\n }\n };\n if (!disposable) {\n _addLeakageTraceLogic(options);\n }\n const emitter = new Emitter(options);\n disposable === null || disposable === void 0 ? void 0 : disposable.add(emitter);\n return emitter.event;\n }\n /**\n * Adds the IDisposable to the store if it's set, and returns it. Useful to\n * Event function implementation.\n */\n function addAndReturnDisposable(d, store) {\n if (store instanceof Array) {\n store.push(d);\n }\n else if (store) {\n store.add(d);\n }\n return d;\n }\n function debounce(event, merge, delay = 100, leading = false, flushOnListenerRemove = false, leakWarningThreshold, disposable) {\n let subscription;\n let output = undefined;\n let handle = undefined;\n let numDebouncedCalls = 0;\n let doFire;\n const options = {\n leakWarningThreshold,\n onWillAddFirstListener() {\n subscription = event(cur => {\n numDebouncedCalls++;\n output = merge(output, cur);\n if (leading && !handle) {\n emitter.fire(output);\n output = undefined;\n }\n doFire = () => {\n const _output = output;\n output = undefined;\n handle = undefined;\n if (!leading || numDebouncedCalls > 1) {\n emitter.fire(_output);\n }\n numDebouncedCalls = 0;\n };\n if (typeof delay === 'number') {\n clearTimeout(handle);\n handle = setTimeout(doFire, delay);\n }\n else {\n if (handle === undefined) {\n handle = 0;\n queueMicrotask(doFire);\n }\n }\n });\n },\n onWillRemoveListener() {\n if (flushOnListenerRemove && numDebouncedCalls > 0) {\n doFire === null || doFire === void 0 ? void 0 : doFire();\n }\n },\n onDidRemoveLastListener() {\n doFire = undefined;\n subscription.dispose();\n }\n };\n if (!disposable) {\n _addLeakageTraceLogic(options);\n }\n const emitter = new Emitter(options);\n disposable === null || disposable === void 0 ? void 0 : disposable.add(emitter);\n return emitter.event;\n }\n Event.debounce = debounce;\n /**\n * Debounces an event, firing after some delay (default=0) with an array of all event original objects.\n *\n * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned\n * event is accessible to \"third parties\", e.g the event is a public property. Otherwise a leaked listener on the\n * returned event causes this utility to leak a listener on the original event.\n */\n function accumulate(event, delay = 0, disposable) {\n return Event.debounce(event, (last, e) => {\n if (!last) {\n return [e];\n }\n last.push(e);\n return last;\n }, delay, undefined, true, undefined, disposable);\n }\n Event.accumulate = accumulate;\n /**\n * Filters an event such that some condition is _not_ met more than once in a row, effectively ensuring duplicate\n * event objects from different sources do not fire the same event object.\n *\n * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned\n * event is accessible to \"third parties\", e.g the event is a public property. Otherwise a leaked listener on the\n * returned event causes this utility to leak a listener on the original event.\n *\n * @param event The event source for the new event.\n * @param equals The equality condition.\n * @param disposable A disposable store to add the new EventEmitter to.\n *\n * @example\n * ```\n * // Fire only one time when a single window is opened or focused\n * Event.latch(Event.any(onDidOpenWindow, onDidFocusWindow))\n * ```\n */\n function latch(event, equals = (a, b) => a === b, disposable) {\n let firstCall = true;\n let cache;\n return filter(event, value => {\n const shouldEmit = firstCall || !equals(value, cache);\n firstCall = false;\n cache = value;\n return shouldEmit;\n }, disposable);\n }\n Event.latch = latch;\n /**\n * Splits an event whose parameter is a union type into 2 separate events for each type in the union.\n *\n * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned\n * event is accessible to \"third parties\", e.g the event is a public property. Otherwise a leaked listener on the\n * returned event causes this utility to leak a listener on the original event.\n *\n * @example\n * ```\n * const event = new EventEmitter().event;\n * const [numberEvent, undefinedEvent] = Event.split(event, isUndefined);\n * ```\n *\n * @param event The event source for the new event.\n * @param isT A function that determines what event is of the first type.\n * @param disposable A disposable store to add the new EventEmitter to.\n */\n function split(event, isT, disposable) {\n return [\n Event.filter(event, isT, disposable),\n Event.filter(event, e => !isT(e), disposable),\n ];\n }\n Event.split = split;\n /**\n * Buffers an event until it has a listener attached.\n *\n * *NOTE* that this function returns an `Event` and it MUST be called with a `DisposableStore` whenever the returned\n * event is accessible to \"third parties\", e.g the event is a public property. Otherwise a leaked listener on the\n * returned event causes this utility to leak a listener on the original event.\n *\n * @param event The event source for the new event.\n * @param flushAfterTimeout Determines whether to flush the buffer after a timeout immediately or after a\n * `setTimeout` when the first event listener is added.\n * @param _buffer Internal: A source event array used for tests.\n *\n * @example\n * ```\n * // Start accumulating events, when the first listener is attached, flush\n * // the event after a timeout such that multiple listeners attached before\n * // the timeout would receive the event\n * this.onInstallExtension = Event.buffer(service.onInstallExtension, true);\n * ```\n */\n function buffer(event, flushAfterTimeout = false, _buffer = [], disposable) {\n let buffer = _buffer.slice();\n let listener = event(e => {\n if (buffer) {\n buffer.push(e);\n }\n else {\n emitter.fire(e);\n }\n });\n if (disposable) {\n disposable.add(listener);\n }\n const flush = () => {\n buffer === null || buffer === void 0 ? void 0 : buffer.forEach(e => emitter.fire(e));\n buffer = null;\n };\n const emitter = new Emitter({\n onWillAddFirstListener() {\n if (!listener) {\n listener = event(e => emitter.fire(e));\n if (disposable) {\n disposable.add(listener);\n }\n }\n },\n onDidAddFirstListener() {\n if (buffer) {\n if (flushAfterTimeout) {\n setTimeout(flush);\n }\n else {\n flush();\n }\n }\n },\n onDidRemoveLastListener() {\n if (listener) {\n listener.dispose();\n }\n listener = null;\n }\n });\n if (disposable) {\n disposable.add(emitter);\n }\n return emitter.event;\n }\n Event.buffer = buffer;\n /**\n * Wraps the event in an {@link IChainableEvent}, allowing a more functional programming style.\n *\n * @example\n * ```\n * // Normal\n * const onEnterPressNormal = Event.filter(\n * Event.map(onKeyPress.event, e => new StandardKeyboardEvent(e)),\n * e.keyCode === KeyCode.Enter\n * ).event;\n *\n * // Using chain\n * const onEnterPressChain = Event.chain(onKeyPress.event, $ => $\n * .map(e => new StandardKeyboardEvent(e))\n * .filter(e => e.keyCode === KeyCode.Enter)\n * );\n * ```\n */\n function chain(event, sythensize) {\n const fn = (listener, thisArgs, disposables) => {\n const cs = sythensize(new ChainableSynthesis());\n return event(function (value) {\n const result = cs.evaluate(value);\n if (result !== HaltChainable) {\n listener.call(thisArgs, result);\n }\n }, undefined, disposables);\n };\n return fn;\n }\n Event.chain = chain;\n const HaltChainable = Symbol('HaltChainable');\n class ChainableSynthesis {\n constructor() {\n this.steps = [];\n }\n map(fn) {\n this.steps.push(fn);\n return this;\n }\n forEach(fn) {\n this.steps.push(v => {\n fn(v);\n return v;\n });\n return this;\n }\n filter(fn) {\n this.steps.push(v => fn(v) ? v : HaltChainable);\n return this;\n }\n reduce(merge, initial) {\n let last = initial;\n this.steps.push(v => {\n last = merge(last, v);\n return last;\n });\n return this;\n }\n latch(equals = (a, b) => a === b) {\n let firstCall = true;\n let cache;\n this.steps.push(value => {\n const shouldEmit = firstCall || !equals(value, cache);\n firstCall = false;\n cache = value;\n return shouldEmit ? value : HaltChainable;\n });\n return this;\n }\n evaluate(value) {\n for (const step of this.steps) {\n value = step(value);\n if (value === HaltChainable) {\n break;\n }\n }\n return value;\n }\n }\n /**\n * Creates an {@link Event} from a node event emitter.\n */\n function fromNodeEventEmitter(emitter, eventName, map = id => id) {\n const fn = (...args) => result.fire(map(...args));\n const onFirstListenerAdd = () => emitter.on(eventName, fn);\n const onLastListenerRemove = () => emitter.removeListener(eventName, fn);\n const result = new Emitter({ onWillAddFirstListener: onFirstListenerAdd, onDidRemoveLastListener: onLastListenerRemove });\n return result.event;\n }\n Event.fromNodeEventEmitter = fromNodeEventEmitter;\n /**\n * Creates an {@link Event} from a DOM event emitter.\n */\n function fromDOMEventEmitter(emitter, eventName, map = id => id) {\n const fn = (...args) => result.fire(map(...args));\n const onFirstListenerAdd = () => emitter.addEventListener(eventName, fn);\n const onLastListenerRemove = () => emitter.removeEventListener(eventName, fn);\n const result = new Emitter({ onWillAddFirstListener: onFirstListenerAdd, onDidRemoveLastListener: onLastListenerRemove });\n return result.event;\n }\n Event.fromDOMEventEmitter = fromDOMEventEmitter;\n /**\n * Creates a promise out of an event, using the {@link Event.once} helper.\n */\n function toPromise(event) {\n return new Promise(resolve => once(event)(resolve));\n }\n Event.toPromise = toPromise;\n /**\n * Creates an event out of a promise that fires once when the promise is\n * resolved with the result of the promise or `undefined`.\n */\n function fromPromise(promise) {\n const result = new Emitter();\n promise.then(res => {\n result.fire(res);\n }, () => {\n result.fire(undefined);\n }).finally(() => {\n result.dispose();\n });\n return result.event;\n }\n Event.fromPromise = fromPromise;\n function runAndSubscribe(event, handler, initial) {\n handler(initial);\n return event(e => handler(e));\n }\n Event.runAndSubscribe = runAndSubscribe;\n class EmitterObserver {\n constructor(_observable, store) {\n this._observable = _observable;\n this._counter = 0;\n this._hasChanged = false;\n const options = {\n onWillAddFirstListener: () => {\n _observable.addObserver(this);\n },\n onDidRemoveLastListener: () => {\n _observable.removeObserver(this);\n }\n };\n if (!store) {\n _addLeakageTraceLogic(options);\n }\n this.emitter = new Emitter(options);\n if (store) {\n store.add(this.emitter);\n }\n }\n beginUpdate(_observable) {\n // assert(_observable === this.obs);\n this._counter++;\n }\n handlePossibleChange(_observable) {\n // assert(_observable === this.obs);\n }\n handleChange(_observable, _change) {\n // assert(_observable === this.obs);\n this._hasChanged = true;\n }\n endUpdate(_observable) {\n // assert(_observable === this.obs);\n this._counter--;\n if (this._counter === 0) {\n this._observable.reportChanges();\n if (this._hasChanged) {\n this._hasChanged = false;\n this.emitter.fire(this._observable.get());\n }\n }\n }\n }\n /**\n * Creates an event emitter that is fired when the observable changes.\n * Each listeners subscribes to the emitter.\n */\n function fromObservable(obs, store) {\n const observer = new EmitterObserver(obs, store);\n return observer.emitter.event;\n }\n Event.fromObservable = fromObservable;\n /**\n * Each listener is attached to the observable directly.\n */\n function fromObservableLight(observable) {\n return (listener, thisArgs, disposables) => {\n let count = 0;\n let didChange = false;\n const observer = {\n beginUpdate() {\n count++;\n },\n endUpdate() {\n count--;\n if (count === 0) {\n observable.reportChanges();\n if (didChange) {\n didChange = false;\n listener.call(thisArgs);\n }\n }\n },\n handlePossibleChange() {\n // noop\n },\n handleChange() {\n didChange = true;\n }\n };\n observable.addObserver(observer);\n observable.reportChanges();\n const disposable = {\n dispose() {\n observable.removeObserver(observer);\n }\n };\n if (disposables instanceof DisposableStore) {\n disposables.add(disposable);\n }\n else if (Array.isArray(disposables)) {\n disposables.push(disposable);\n }\n return disposable;\n };\n }\n Event.fromObservableLight = fromObservableLight;\n})(Event || (Event = {}));\nexport class EventProfiling {\n constructor(name) {\n this.listenerCount = 0;\n this.invocationCount = 0;\n this.elapsedOverall = 0;\n this.durations = [];\n this.name = `${name}_${EventProfiling._idPool++}`;\n EventProfiling.all.add(this);\n }\n start(listenerCount) {\n this._stopWatch = new StopWatch();\n this.listenerCount = listenerCount;\n }\n stop() {\n if (this._stopWatch) {\n const elapsed = this._stopWatch.elapsed();\n this.durations.push(elapsed);\n this.elapsedOverall += elapsed;\n this.invocationCount += 1;\n this._stopWatch = undefined;\n }\n }\n}\nEventProfiling.all = new Set();\nEventProfiling._idPool = 0;\nlet _globalLeakWarningThreshold = -1;\nclass LeakageMonitor {\n constructor(_errorHandler, threshold, name = Math.random().toString(18).slice(2, 5)) {\n this._errorHandler = _errorHandler;\n this.threshold = threshold;\n this.name = name;\n this._warnCountdown = 0;\n }\n dispose() {\n var _a;\n (_a = this._stacks) === null || _a === void 0 ? void 0 : _a.clear();\n }\n check(stack, listenerCount) {\n const threshold = this.threshold;\n if (threshold <= 0 || listenerCount < threshold) {\n return undefined;\n }\n if (!this._stacks) {\n this._stacks = new Map();\n }\n const count = (this._stacks.get(stack.value) || 0);\n this._stacks.set(stack.value, count + 1);\n this._warnCountdown -= 1;\n if (this._warnCountdown <= 0) {\n // only warn on first exceed and then every time the limit\n // is exceeded by 50% again\n this._warnCountdown = threshold * 0.5;\n const [topStack, topCount] = this.getMostFrequentStack();\n const message = `[${this.name}] potential listener LEAK detected, having ${listenerCount} listeners already. MOST frequent listener (${topCount}):`;\n console.warn(message);\n console.warn(topStack);\n const error = new ListenerLeakError(message, topStack);\n this._errorHandler(error);\n }\n return () => {\n const count = (this._stacks.get(stack.value) || 0);\n this._stacks.set(stack.value, count - 1);\n };\n }\n getMostFrequentStack() {\n if (!this._stacks) {\n return undefined;\n }\n let topStack;\n let topCount = 0;\n for (const [stack, count] of this._stacks) {\n if (!topStack || topCount < count) {\n topStack = [stack, count];\n topCount = count;\n }\n }\n return topStack;\n }\n}\nclass Stacktrace {\n static create() {\n var _a;\n const err = new Error();\n return new Stacktrace((_a = err.stack) !== null && _a !== void 0 ? _a : '');\n }\n constructor(value) {\n this.value = value;\n }\n print() {\n console.warn(this.value.split('\\n').slice(2).join('\\n'));\n }\n}\n// error that is logged when going over the configured listener threshold\nexport class ListenerLeakError extends Error {\n constructor(message, stack) {\n super(message);\n this.name = 'ListenerLeakError';\n this.stack = stack;\n }\n}\n// SEVERE error that is logged when having gone way over the configured listener\n// threshold so that the emitter refuses to accept more listeners\nexport class ListenerRefusalError extends Error {\n constructor(message, stack) {\n super(message);\n this.name = 'ListenerRefusalError';\n this.stack = stack;\n }\n}\nclass UniqueContainer {\n constructor(value) {\n this.value = value;\n }\n}\nconst compactionThreshold = 2;\nconst forEachListener = (listeners, fn) => {\n if (listeners instanceof UniqueContainer) {\n fn(listeners);\n }\n else {\n for (let i = 0; i < listeners.length; i++) {\n const l = listeners[i];\n if (l) {\n fn(l);\n }\n }\n }\n};\nconst _listenerFinalizers = _enableListenerGCedWarning\n ? new FinalizationRegistry(heldValue => {\n if (typeof heldValue === 'string') {\n console.warn('[LEAKING LISTENER] GC\\'ed a listener that was NOT yet disposed. This is where is was created:');\n console.warn(heldValue);\n }\n })\n : undefined;\n/**\n * The Emitter can be used to expose an Event to the public\n * to fire it from the insides.\n * Sample:\n class Document {\n\n private readonly _onDidChange = new Emitter<(value:string)=>any>();\n\n public onDidChange = this._onDidChange.event;\n\n // getter-style\n // get onDidChange(): Event<(value:string)=>any> {\n // \treturn this._onDidChange.event;\n // }\n\n private _doIt() {\n //...\n this._onDidChange.fire(value);\n }\n }\n */\nexport class Emitter {\n constructor(options) {\n var _a, _b, _c, _d, _e, _f;\n this._size = 0;\n this._options = options;\n this._leakageMon = (_globalLeakWarningThreshold > 0 || ((_a = this._options) === null || _a === void 0 ? void 0 : _a.leakWarningThreshold))\n ? new LeakageMonitor((_b = options === null || options === void 0 ? void 0 : options.onListenerError) !== null && _b !== void 0 ? _b : onUnexpectedError, (_d = (_c = this._options) === null || _c === void 0 ? void 0 : _c.leakWarningThreshold) !== null && _d !== void 0 ? _d : _globalLeakWarningThreshold) :\n undefined;\n this._perfMon = ((_e = this._options) === null || _e === void 0 ? void 0 : _e._profName) ? new EventProfiling(this._options._profName) : undefined;\n this._deliveryQueue = (_f = this._options) === null || _f === void 0 ? void 0 : _f.deliveryQueue;\n }\n dispose() {\n var _a, _b, _c, _d;\n if (!this._disposed) {\n this._disposed = true;\n // It is bad to have listeners at the time of disposing an emitter, it is worst to have listeners keep the emitter\n // alive via the reference that's embedded in their disposables. Therefore we loop over all remaining listeners and\n // unset their subscriptions/disposables. Looping and blaming remaining listeners is done on next tick because the\n // the following programming pattern is very popular:\n //\n // const someModel = this._disposables.add(new ModelObject()); // (1) create and register model\n // this._disposables.add(someModel.onDidChange(() => { ... }); // (2) subscribe and register model-event listener\n // ...later...\n // this._disposables.dispose(); disposes (1) then (2): don't warn after (1) but after the \"overall dispose\" is done\n if (((_a = this._deliveryQueue) === null || _a === void 0 ? void 0 : _a.current) === this) {\n this._deliveryQueue.reset();\n }\n if (this._listeners) {\n if (_enableDisposeWithListenerWarning) {\n const listeners = this._listeners;\n queueMicrotask(() => {\n forEachListener(listeners, l => { var _a; return (_a = l.stack) === null || _a === void 0 ? void 0 : _a.print(); });\n });\n }\n this._listeners = undefined;\n this._size = 0;\n }\n (_c = (_b = this._options) === null || _b === void 0 ? void 0 : _b.onDidRemoveLastListener) === null || _c === void 0 ? void 0 : _c.call(_b);\n (_d = this._leakageMon) === null || _d === void 0 ? void 0 : _d.dispose();\n }\n }\n /**\n * For the public to allow to subscribe\n * to events from this Emitter\n */\n get event() {\n var _a;\n (_a = this._event) !== null && _a !== void 0 ? _a : (this._event = (callback, thisArgs, disposables) => {\n var _a, _b, _c, _d, _e, _f, _g;\n if (this._leakageMon && this._size > this._leakageMon.threshold ** 2) {\n const message = `[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;\n console.warn(message);\n const tuple = (_a = this._leakageMon.getMostFrequentStack()) !== null && _a !== void 0 ? _a : ['UNKNOWN stack', -1];\n const error = new ListenerRefusalError(`${message}. HINT: Stack shows most frequent listener (${tuple[1]}-times)`, tuple[0]);\n const errorHandler = ((_b = this._options) === null || _b === void 0 ? void 0 : _b.onListenerError) || onUnexpectedError;\n errorHandler(error);\n return Disposable.None;\n }\n if (this._disposed) {\n // todo: should we warn if a listener is added to a disposed emitter? This happens often\n return Disposable.None;\n }\n if (thisArgs) {\n callback = callback.bind(thisArgs);\n }\n const contained = new UniqueContainer(callback);\n let removeMonitor;\n let stack;\n if (this._leakageMon && this._size >= Math.ceil(this._leakageMon.threshold * 0.2)) {\n // check and record this emitter for potential leakage\n contained.stack = Stacktrace.create();\n removeMonitor = this._leakageMon.check(contained.stack, this._size + 1);\n }\n if (_enableDisposeWithListenerWarning) {\n contained.stack = stack !== null && stack !== void 0 ? stack : Stacktrace.create();\n }\n if (!this._listeners) {\n (_d = (_c = this._options) === null || _c === void 0 ? void 0 : _c.onWillAddFirstListener) === null || _d === void 0 ? void 0 : _d.call(_c, this);\n this._listeners = contained;\n (_f = (_e = this._options) === null || _e === void 0 ? void 0 : _e.onDidAddFirstListener) === null || _f === void 0 ? void 0 : _f.call(_e, this);\n }\n else if (this._listeners instanceof UniqueContainer) {\n (_g = this._deliveryQueue) !== null && _g !== void 0 ? _g : (this._deliveryQueue = new EventDeliveryQueuePrivate());\n this._listeners = [this._listeners, contained];\n }\n else {\n this._listeners.push(contained);\n }\n this._size++;\n const result = toDisposable(() => {\n _listenerFinalizers === null || _listenerFinalizers === void 0 ? void 0 : _listenerFinalizers.unregister(result);\n removeMonitor === null || removeMonitor === void 0 ? void 0 : removeMonitor();\n this._removeListener(contained);\n });\n if (disposables instanceof DisposableStore) {\n disposables.add(result);\n }\n else if (Array.isArray(disposables)) {\n disposables.push(result);\n }\n if (_listenerFinalizers) {\n const stack = new Error().stack.split('\\n').slice(2).join('\\n').trim();\n _listenerFinalizers.register(result, stack, result);\n }\n return result;\n });\n return this._event;\n }\n _removeListener(listener) {\n var _a, _b, _c, _d;\n (_b = (_a = this._options) === null || _a === void 0 ? void 0 : _a.onWillRemoveListener) === null || _b === void 0 ? void 0 : _b.call(_a, this);\n if (!this._listeners) {\n return; // expected if a listener gets disposed\n }\n if (this._size === 1) {\n this._listeners = undefined;\n (_d = (_c = this._options) === null || _c === void 0 ? void 0 : _c.onDidRemoveLastListener) === null || _d === void 0 ? void 0 : _d.call(_c, this);\n this._size = 0;\n return;\n }\n // size > 1 which requires that listeners be a list:\n const listeners = this._listeners;\n const index = listeners.indexOf(listener);\n if (index === -1) {\n console.log('disposed?', this._disposed);\n console.log('size?', this._size);\n console.log('arr?', JSON.stringify(this._listeners));\n throw new Error('Attempted to dispose unknown listener');\n }\n this._size--;\n listeners[index] = undefined;\n const adjustDeliveryQueue = this._deliveryQueue.current === this;\n if (this._size * compactionThreshold <= listeners.length) {\n let n = 0;\n for (let i = 0; i < listeners.length; i++) {\n if (listeners[i]) {\n listeners[n++] = listeners[i];\n }\n else if (adjustDeliveryQueue) {\n this._deliveryQueue.end--;\n if (n < this._deliveryQueue.i) {\n this._deliveryQueue.i--;\n }\n }\n }\n listeners.length = n;\n }\n }\n _deliver(listener, value) {\n var _a;\n if (!listener) {\n return;\n }\n const errorHandler = ((_a = this._options) === null || _a === void 0 ? void 0 : _a.onListenerError) || onUnexpectedError;\n if (!errorHandler) {\n listener.value(value);\n return;\n }\n try {\n listener.value(value);\n }\n catch (e) {\n errorHandler(e);\n }\n }\n /** Delivers items in the queue. Assumes the queue is ready to go. */\n _deliverQueue(dq) {\n const listeners = dq.current._listeners;\n while (dq.i < dq.end) {\n // important: dq.i is incremented before calling deliver() because it might reenter deliverQueue()\n this._deliver(listeners[dq.i++], dq.value);\n }\n dq.reset();\n }\n /**\n * To be kept private to fire an event to\n * subscribers\n */\n fire(event) {\n var _a, _b, _c, _d;\n if ((_a = this._deliveryQueue) === null || _a === void 0 ? void 0 : _a.current) {\n this._deliverQueue(this._deliveryQueue);\n (_b = this._perfMon) === null || _b === void 0 ? void 0 : _b.stop(); // last fire() will have starting perfmon, stop it before starting the next dispatch\n }\n (_c = this._perfMon) === null || _c === void 0 ? void 0 : _c.start(this._size);\n if (!this._listeners) {\n // no-op\n }\n else if (this._listeners instanceof UniqueContainer) {\n this._deliver(this._listeners, event);\n }\n else {\n const dq = this._deliveryQueue;\n dq.enqueue(this, event, this._listeners.length);\n this._deliverQueue(dq);\n }\n (_d = this._perfMon) === null || _d === void 0 ? void 0 : _d.stop();\n }\n hasListeners() {\n return this._size > 0;\n }\n}\nexport const createEventDeliveryQueue = () => new EventDeliveryQueuePrivate();\nclass EventDeliveryQueuePrivate {\n constructor() {\n /**\n * Index in current's listener list.\n */\n this.i = -1;\n /**\n * The last index in the listener's list to deliver.\n */\n this.end = 0;\n }\n enqueue(emitter, value, end) {\n this.i = 0;\n this.end = end;\n this.current = emitter;\n this.value = value;\n }\n reset() {\n this.i = this.end; // force any current emission loop to stop, mainly for during dispose\n this.current = undefined;\n this.value = undefined;\n }\n}\nexport class PauseableEmitter extends Emitter {\n constructor(options) {\n super(options);\n this._isPaused = 0;\n this._eventQueue = new LinkedList();\n this._mergeFn = options === null || options === void 0 ? void 0 : options.merge;\n }\n pause() {\n this._isPaused++;\n }\n resume() {\n if (this._isPaused !== 0 && --this._isPaused === 0) {\n if (this._mergeFn) {\n // use the merge function to create a single composite\n // event. make a copy in case firing pauses this emitter\n if (this._eventQueue.size > 0) {\n const events = Array.from(this._eventQueue);\n this._eventQueue.clear();\n super.fire(this._mergeFn(events));\n }\n }\n else {\n // no merging, fire each event individually and test\n // that this emitter isn't paused halfway through\n while (!this._isPaused && this._eventQueue.size !== 0) {\n super.fire(this._eventQueue.shift());\n }\n }\n }\n }\n fire(event) {\n if (this._size) {\n if (this._isPaused !== 0) {\n this._eventQueue.push(event);\n }\n else {\n super.fire(event);\n }\n }\n }\n}\nexport class DebounceEmitter extends PauseableEmitter {\n constructor(options) {\n var _a;\n super(options);\n this._delay = (_a = options.delay) !== null && _a !== void 0 ? _a : 100;\n }\n fire(event) {\n if (!this._handle) {\n this.pause();\n this._handle = setTimeout(() => {\n this._handle = undefined;\n this.resume();\n }, this._delay);\n }\n super.fire(event);\n }\n}\n/**\n * An emitter which queue all events and then process them at the\n * end of the event loop.\n */\nexport class MicrotaskEmitter extends Emitter {\n constructor(options) {\n super(options);\n this._queuedEvents = [];\n this._mergeFn = options === null || options === void 0 ? void 0 : options.merge;\n }\n fire(event) {\n if (!this.hasListeners()) {\n return;\n }\n this._queuedEvents.push(event);\n if (this._queuedEvents.length === 1) {\n queueMicrotask(() => {\n if (this._mergeFn) {\n super.fire(this._mergeFn(this._queuedEvents));\n }\n else {\n this._queuedEvents.forEach(e => super.fire(e));\n }\n this._queuedEvents = [];\n });\n }\n }\n}\n/**\n * An event emitter that multiplexes many events into a single event.\n *\n * @example Listen to the `onData` event of all `Thing`s, dynamically adding and removing `Thing`s\n * to the multiplexer as needed.\n *\n * ```typescript\n * const anythingDataMultiplexer = new EventMultiplexer<{ data: string }>();\n *\n * const thingListeners = DisposableMap();\n *\n * thingService.onDidAddThing(thing => {\n * thingListeners.set(thing, anythingDataMultiplexer.add(thing.onData);\n * });\n * thingService.onDidRemoveThing(thing => {\n * thingListeners.deleteAndDispose(thing);\n * });\n *\n * anythingDataMultiplexer.event(e => {\n * console.log('Something fired data ' + e.data)\n * });\n * ```\n */\nexport class EventMultiplexer {\n constructor() {\n this.hasListeners = false;\n this.events = [];\n this.emitter = new Emitter({\n onWillAddFirstListener: () => this.onFirstListenerAdd(),\n onDidRemoveLastListener: () => this.onLastListenerRemove()\n });\n }\n get event() {\n return this.emitter.event;\n }\n add(event) {\n const e = { event: event, listener: null };\n this.events.push(e);\n if (this.hasListeners) {\n this.hook(e);\n }\n const dispose = () => {\n if (this.hasListeners) {\n this.unhook(e);\n }\n const idx = this.events.indexOf(e);\n this.events.splice(idx, 1);\n };\n return toDisposable(createSingleCallFunction(dispose));\n }\n onFirstListenerAdd() {\n this.hasListeners = true;\n this.events.forEach(e => this.hook(e));\n }\n onLastListenerRemove() {\n this.hasListeners = false;\n this.events.forEach(e => this.unhook(e));\n }\n hook(e) {\n e.listener = e.event(r => this.emitter.fire(r));\n }\n unhook(e) {\n var _a;\n (_a = e.listener) === null || _a === void 0 ? void 0 : _a.dispose();\n e.listener = null;\n }\n dispose() {\n var _a;\n this.emitter.dispose();\n for (const e of this.events) {\n (_a = e.listener) === null || _a === void 0 ? void 0 : _a.dispose();\n }\n this.events = [];\n }\n}\n/**\n * The EventBufferer is useful in situations in which you want\n * to delay firing your events during some code.\n * You can wrap that code and be sure that the event will not\n * be fired during that wrap.\n *\n * ```\n * const emitter: Emitter;\n * const delayer = new EventDelayer();\n * const delayedEvent = delayer.wrapEvent(emitter.event);\n *\n * delayedEvent(console.log);\n *\n * delayer.bufferEvents(() => {\n * emitter.fire(); // event will not be fired yet\n * });\n *\n * // event will only be fired at this point\n * ```\n */\nexport class EventBufferer {\n constructor() {\n this.data = [];\n }\n wrapEvent(event, reduce, initial) {\n return (listener, thisArgs, disposables) => {\n return event(i => {\n var _a;\n const data = this.data[this.data.length - 1];\n // Non-reduce scenario\n if (!reduce) {\n // Buffering case\n if (data) {\n data.buffers.push(() => listener.call(thisArgs, i));\n }\n else {\n // Not buffering case\n listener.call(thisArgs, i);\n }\n return;\n }\n // Reduce scenario\n const reduceData = data;\n // Not buffering case\n if (!reduceData) {\n // TODO: Is there a way to cache this reduce call for all listeners?\n listener.call(thisArgs, reduce(initial, i));\n return;\n }\n // Buffering case\n (_a = reduceData.items) !== null && _a !== void 0 ? _a : (reduceData.items = []);\n reduceData.items.push(i);\n if (reduceData.buffers.length === 0) {\n // Include a single buffered function that will reduce all events when we're done buffering events\n data.buffers.push(() => {\n var _a;\n // cache the reduced result so that the value can be shared across all listeners\n (_a = reduceData.reducedResult) !== null && _a !== void 0 ? _a : (reduceData.reducedResult = initial\n ? reduceData.items.reduce(reduce, initial)\n : reduceData.items.reduce(reduce));\n listener.call(thisArgs, reduceData.reducedResult);\n });\n }\n }, undefined, disposables);\n };\n }\n bufferEvents(fn) {\n const data = { buffers: new Array() };\n this.data.push(data);\n const r = fn();\n this.data.pop();\n data.buffers.forEach(flush => flush());\n return r;\n }\n}\n/**\n * A Relay is an event forwarder which functions as a replugabble event pipe.\n * Once created, you can connect an input event to it and it will simply forward\n * events from that input event through its own `event` property. The `input`\n * can be changed at any point in time.\n */\nexport class Relay {\n constructor() {\n this.listening = false;\n this.inputEvent = Event.None;\n this.inputEventListener = Disposable.None;\n this.emitter = new Emitter({\n onDidAddFirstListener: () => {\n this.listening = true;\n this.inputEventListener = this.inputEvent(this.emitter.fire, this.emitter);\n },\n onDidRemoveLastListener: () => {\n this.listening = false;\n this.inputEventListener.dispose();\n }\n });\n this.event = this.emitter.event;\n }\n set input(event) {\n this.inputEvent = event;\n if (this.listening) {\n this.inputEventListener.dispose();\n this.inputEventListener = event(this.emitter.fire, this.emitter);\n }\n }\n dispose() {\n this.inputEventListener.dispose();\n this.emitter.dispose();\n }\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { posix, sep } from './path.js';\nimport { isWindows } from './platform.js';\nimport { startsWithIgnoreCase } from './strings.js';\nexport function isPathSeparator(code) {\n return code === 47 /* CharCode.Slash */ || code === 92 /* CharCode.Backslash */;\n}\n/**\n * Takes a Windows OS path and changes backward slashes to forward slashes.\n * This should only be done for OS paths from Windows (or user provided paths potentially from Windows).\n * Using it on a Linux or MaxOS path might change it.\n */\nexport function toSlashes(osPath) {\n return osPath.replace(/[\\\\/]/g, posix.sep);\n}\n/**\n * Takes a Windows OS path (using backward or forward slashes) and turns it into a posix path:\n * - turns backward slashes into forward slashes\n * - makes it absolute if it starts with a drive letter\n * This should only be done for OS paths from Windows (or user provided paths potentially from Windows).\n * Using it on a Linux or MaxOS path might change it.\n */\nexport function toPosixPath(osPath) {\n if (osPath.indexOf('/') === -1) {\n osPath = toSlashes(osPath);\n }\n if (/^[a-zA-Z]:(\\/|$)/.test(osPath)) { // starts with a drive letter\n osPath = '/' + osPath;\n }\n return osPath;\n}\n/**\n * Computes the _root_ this path, like `getRoot('c:\\files') === c:\\`,\n * `getRoot('files:///files/path') === files:///`,\n * or `getRoot('\\\\server\\shares\\path') === \\\\server\\shares\\`\n */\nexport function getRoot(path, sep = posix.sep) {\n if (!path) {\n return '';\n }\n const len = path.length;\n const firstLetter = path.charCodeAt(0);\n if (isPathSeparator(firstLetter)) {\n if (isPathSeparator(path.charCodeAt(1))) {\n // UNC candidate \\\\localhost\\shares\\ddd\n // ^^^^^^^^^^^^^^^^^^^\n if (!isPathSeparator(path.charCodeAt(2))) {\n let pos = 3;\n const start = pos;\n for (; pos < len; pos++) {\n if (isPathSeparator(path.charCodeAt(pos))) {\n break;\n }\n }\n if (start !== pos && !isPathSeparator(path.charCodeAt(pos + 1))) {\n pos += 1;\n for (; pos < len; pos++) {\n if (isPathSeparator(path.charCodeAt(pos))) {\n return path.slice(0, pos + 1) // consume this separator\n .replace(/[\\\\/]/g, sep);\n }\n }\n }\n }\n }\n // /user/far\n // ^\n return sep;\n }\n else if (isWindowsDriveLetter(firstLetter)) {\n // check for windows drive letter c:\\ or c:\n if (path.charCodeAt(1) === 58 /* CharCode.Colon */) {\n if (isPathSeparator(path.charCodeAt(2))) {\n // C:\\fff\n // ^^^\n return path.slice(0, 2) + sep;\n }\n else {\n // C:\n // ^^\n return path.slice(0, 2);\n }\n }\n }\n // check for URI\n // scheme://authority/path\n // ^^^^^^^^^^^^^^^^^^^\n let pos = path.indexOf('://');\n if (pos !== -1) {\n pos += 3; // 3 -> \"://\".length\n for (; pos < len; pos++) {\n if (isPathSeparator(path.charCodeAt(pos))) {\n return path.slice(0, pos + 1); // consume this separator\n }\n }\n }\n return '';\n}\n/**\n * @deprecated please use `IUriIdentityService.extUri.isEqualOrParent` instead. If\n * you are in a context without services, consider to pass down the `extUri` from the\n * outside, or use `extUriBiasedIgnorePathCase` if you know what you are doing.\n */\nexport function isEqualOrParent(base, parentCandidate, ignoreCase, separator = sep) {\n if (base === parentCandidate) {\n return true;\n }\n if (!base || !parentCandidate) {\n return false;\n }\n if (parentCandidate.length > base.length) {\n return false;\n }\n if (ignoreCase) {\n const beginsWith = startsWithIgnoreCase(base, parentCandidate);\n if (!beginsWith) {\n return false;\n }\n if (parentCandidate.length === base.length) {\n return true; // same path, different casing\n }\n let sepOffset = parentCandidate.length;\n if (parentCandidate.charAt(parentCandidate.length - 1) === separator) {\n sepOffset--; // adjust the expected sep offset in case our candidate already ends in separator character\n }\n return base.charAt(sepOffset) === separator;\n }\n if (parentCandidate.charAt(parentCandidate.length - 1) !== separator) {\n parentCandidate += separator;\n }\n return base.indexOf(parentCandidate) === 0;\n}\nexport function isWindowsDriveLetter(char0) {\n return char0 >= 65 /* CharCode.A */ && char0 <= 90 /* CharCode.Z */ || char0 >= 97 /* CharCode.a */ && char0 <= 122 /* CharCode.z */;\n}\nexport function hasDriveLetter(path, isWindowsOS = isWindows) {\n if (isWindowsOS) {\n return isWindowsDriveLetter(path.charCodeAt(0)) && path.charCodeAt(1) === 58 /* CharCode.Colon */;\n }\n return false;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { LRUCache } from './map.js';\nimport { getKoreanAltChars } from './naturalLanguage/korean.js';\nimport * as strings from './strings.js';\n// Combined filters\n/**\n * @returns A filter which combines the provided set\n * of filters with an or. The *first* filters that\n * matches defined the return value of the returned\n * filter.\n */\nexport function or(...filter) {\n return function (word, wordToMatchAgainst) {\n for (let i = 0, len = filter.length; i < len; i++) {\n const match = filter[i](word, wordToMatchAgainst);\n if (match) {\n return match;\n }\n }\n return null;\n };\n}\n// Prefix\nexport const matchesStrictPrefix = _matchesPrefix.bind(undefined, false);\nexport const matchesPrefix = _matchesPrefix.bind(undefined, true);\nfunction _matchesPrefix(ignoreCase, word, wordToMatchAgainst) {\n if (!wordToMatchAgainst || wordToMatchAgainst.length < word.length) {\n return null;\n }\n let matches;\n if (ignoreCase) {\n matches = strings.startsWithIgnoreCase(wordToMatchAgainst, word);\n }\n else {\n matches = wordToMatchAgainst.indexOf(word) === 0;\n }\n if (!matches) {\n return null;\n }\n return word.length > 0 ? [{ start: 0, end: word.length }] : [];\n}\n// Contiguous Substring\nexport function matchesContiguousSubString(word, wordToMatchAgainst) {\n const index = wordToMatchAgainst.toLowerCase().indexOf(word.toLowerCase());\n if (index === -1) {\n return null;\n }\n return [{ start: index, end: index + word.length }];\n}\n// Substring\nexport function matchesSubString(word, wordToMatchAgainst) {\n return _matchesSubString(word.toLowerCase(), wordToMatchAgainst.toLowerCase(), 0, 0);\n}\nfunction _matchesSubString(word, wordToMatchAgainst, i, j) {\n if (i === word.length) {\n return [];\n }\n else if (j === wordToMatchAgainst.length) {\n return null;\n }\n else {\n if (word[i] === wordToMatchAgainst[j]) {\n let result = null;\n if (result = _matchesSubString(word, wordToMatchAgainst, i + 1, j + 1)) {\n return join({ start: j, end: j + 1 }, result);\n }\n return null;\n }\n return _matchesSubString(word, wordToMatchAgainst, i, j + 1);\n }\n}\n// CamelCase\nfunction isLower(code) {\n return 97 /* CharCode.a */ <= code && code <= 122 /* CharCode.z */;\n}\nexport function isUpper(code) {\n return 65 /* CharCode.A */ <= code && code <= 90 /* CharCode.Z */;\n}\nfunction isNumber(code) {\n return 48 /* CharCode.Digit0 */ <= code && code <= 57 /* CharCode.Digit9 */;\n}\nfunction isWhitespace(code) {\n return (code === 32 /* CharCode.Space */\n || code === 9 /* CharCode.Tab */\n || code === 10 /* CharCode.LineFeed */\n || code === 13 /* CharCode.CarriageReturn */);\n}\nconst wordSeparators = new Set();\n// These are chosen as natural word separators based on writen text.\n// It is a subset of the word separators used by the monaco editor.\n'()[]{}<>`\\'\"-/;:,.?!'\n .split('')\n .forEach(s => wordSeparators.add(s.charCodeAt(0)));\nfunction isWordSeparator(code) {\n return isWhitespace(code) || wordSeparators.has(code);\n}\nfunction charactersMatch(codeA, codeB) {\n return (codeA === codeB) || (isWordSeparator(codeA) && isWordSeparator(codeB));\n}\nconst alternateCharsCache = new Map();\n/**\n * Gets alternative codes to the character code passed in. This comes in the\n * form of an array of character codes, all of which must match _in order_ to\n * successfully match.\n *\n * @param code The character code to check.\n */\nfunction getAlternateCodes(code) {\n if (alternateCharsCache.has(code)) {\n return alternateCharsCache.get(code);\n }\n // NOTE: This function is written in such a way that it can be extended in\n // the future, but right now the return type takes into account it's only\n // supported by a single \"alt codes provider\".\n // `ArrayLike>` is a more appropriate type if changed.\n let result;\n const codes = getKoreanAltChars(code);\n if (codes) {\n result = codes;\n }\n alternateCharsCache.set(code, result);\n return result;\n}\nfunction isAlphanumeric(code) {\n return isLower(code) || isUpper(code) || isNumber(code);\n}\nfunction join(head, tail) {\n if (tail.length === 0) {\n tail = [head];\n }\n else if (head.end === tail[0].start) {\n tail[0].start = head.start;\n }\n else {\n tail.unshift(head);\n }\n return tail;\n}\nfunction nextAnchor(camelCaseWord, start) {\n for (let i = start; i < camelCaseWord.length; i++) {\n const c = camelCaseWord.charCodeAt(i);\n if (isUpper(c) || isNumber(c) || (i > 0 && !isAlphanumeric(camelCaseWord.charCodeAt(i - 1)))) {\n return i;\n }\n }\n return camelCaseWord.length;\n}\nfunction _matchesCamelCase(word, camelCaseWord, i, j) {\n if (i === word.length) {\n return [];\n }\n else if (j === camelCaseWord.length) {\n return null;\n }\n else if (word[i] !== camelCaseWord[j].toLowerCase()) {\n return null;\n }\n else {\n let result = null;\n let nextUpperIndex = j + 1;\n result = _matchesCamelCase(word, camelCaseWord, i + 1, j + 1);\n while (!result && (nextUpperIndex = nextAnchor(camelCaseWord, nextUpperIndex)) < camelCaseWord.length) {\n result = _matchesCamelCase(word, camelCaseWord, i + 1, nextUpperIndex);\n nextUpperIndex++;\n }\n return result === null ? null : join({ start: j, end: j + 1 }, result);\n }\n}\n// Heuristic to avoid computing camel case matcher for words that don't\n// look like camelCaseWords.\nfunction analyzeCamelCaseWord(word) {\n let upper = 0, lower = 0, alpha = 0, numeric = 0, code = 0;\n for (let i = 0; i < word.length; i++) {\n code = word.charCodeAt(i);\n if (isUpper(code)) {\n upper++;\n }\n if (isLower(code)) {\n lower++;\n }\n if (isAlphanumeric(code)) {\n alpha++;\n }\n if (isNumber(code)) {\n numeric++;\n }\n }\n const upperPercent = upper / word.length;\n const lowerPercent = lower / word.length;\n const alphaPercent = alpha / word.length;\n const numericPercent = numeric / word.length;\n return { upperPercent, lowerPercent, alphaPercent, numericPercent };\n}\nfunction isUpperCaseWord(analysis) {\n const { upperPercent, lowerPercent } = analysis;\n return lowerPercent === 0 && upperPercent > 0.6;\n}\nfunction isCamelCaseWord(analysis) {\n const { upperPercent, lowerPercent, alphaPercent, numericPercent } = analysis;\n return lowerPercent > 0.2 && upperPercent < 0.8 && alphaPercent > 0.6 && numericPercent < 0.2;\n}\n// Heuristic to avoid computing camel case matcher for words that don't\n// look like camel case patterns.\nfunction isCamelCasePattern(word) {\n let upper = 0, lower = 0, code = 0, whitespace = 0;\n for (let i = 0; i < word.length; i++) {\n code = word.charCodeAt(i);\n if (isUpper(code)) {\n upper++;\n }\n if (isLower(code)) {\n lower++;\n }\n if (isWhitespace(code)) {\n whitespace++;\n }\n }\n if ((upper === 0 || lower === 0) && whitespace === 0) {\n return word.length <= 30;\n }\n else {\n return upper <= 5;\n }\n}\nexport function matchesCamelCase(word, camelCaseWord) {\n if (!camelCaseWord) {\n return null;\n }\n camelCaseWord = camelCaseWord.trim();\n if (camelCaseWord.length === 0) {\n return null;\n }\n if (!isCamelCasePattern(word)) {\n return null;\n }\n // TODO: Consider removing this check\n if (camelCaseWord.length > 60) {\n camelCaseWord = camelCaseWord.substring(0, 60);\n }\n const analysis = analyzeCamelCaseWord(camelCaseWord);\n if (!isCamelCaseWord(analysis)) {\n if (!isUpperCaseWord(analysis)) {\n return null;\n }\n camelCaseWord = camelCaseWord.toLowerCase();\n }\n let result = null;\n let i = 0;\n word = word.toLowerCase();\n while (i < camelCaseWord.length && (result = _matchesCamelCase(word, camelCaseWord, 0, i)) === null) {\n i = nextAnchor(camelCaseWord, i + 1);\n }\n return result;\n}\n// Matches beginning of words supporting non-ASCII languages\n// If `contiguous` is true then matches word with beginnings of the words in the target. E.g. \"pul\" will match \"Git: Pull\"\n// Otherwise also matches sub string of the word with beginnings of the words in the target. E.g. \"gp\" or \"g p\" will match \"Git: Pull\"\n// Useful in cases where the target is words (e.g. command labels)\nexport function matchesWords(word, target, contiguous = false) {\n if (!target || target.length === 0) {\n return null;\n }\n let result = null;\n let targetIndex = 0;\n word = word.toLowerCase();\n target = target.toLowerCase();\n while (targetIndex < target.length) {\n result = _matchesWords(word, target, 0, targetIndex, contiguous);\n if (result !== null) {\n break;\n }\n targetIndex = nextWord(target, targetIndex + 1);\n }\n return result;\n}\nfunction _matchesWords(word, target, wordIndex, targetIndex, contiguous) {\n let targetIndexOffset = 0;\n if (wordIndex === word.length) {\n return [];\n }\n else if (targetIndex === target.length) {\n return null;\n }\n else if (!charactersMatch(word.charCodeAt(wordIndex), target.charCodeAt(targetIndex))) {\n // Verify alternate characters before exiting\n const altChars = getAlternateCodes(word.charCodeAt(wordIndex));\n if (!altChars) {\n return null;\n }\n for (let k = 0; k < altChars.length; k++) {\n if (!charactersMatch(altChars[k], target.charCodeAt(targetIndex + k))) {\n return null;\n }\n }\n targetIndexOffset += altChars.length - 1;\n }\n let result = null;\n let nextWordIndex = targetIndex + targetIndexOffset + 1;\n result = _matchesWords(word, target, wordIndex + 1, nextWordIndex, contiguous);\n if (!contiguous) {\n while (!result && (nextWordIndex = nextWord(target, nextWordIndex)) < target.length) {\n result = _matchesWords(word, target, wordIndex + 1, nextWordIndex, contiguous);\n nextWordIndex++;\n }\n }\n if (!result) {\n return null;\n }\n // If the characters don't exactly match, then they must be word separators (see charactersMatch(...)).\n // We don't want to include this in the matches but we don't want to throw the target out all together so we return `result`.\n if (word.charCodeAt(wordIndex) !== target.charCodeAt(targetIndex)) {\n // Verify alternate characters before exiting\n const altChars = getAlternateCodes(word.charCodeAt(wordIndex));\n if (!altChars) {\n return result;\n }\n for (let k = 0; k < altChars.length; k++) {\n if (altChars[k] !== target.charCodeAt(targetIndex + k)) {\n return result;\n }\n }\n }\n return join({ start: targetIndex, end: targetIndex + targetIndexOffset + 1 }, result);\n}\nfunction nextWord(word, start) {\n for (let i = start; i < word.length; i++) {\n if (isWordSeparator(word.charCodeAt(i)) ||\n (i > 0 && isWordSeparator(word.charCodeAt(i - 1)))) {\n return i;\n }\n }\n return word.length;\n}\n// Fuzzy\nconst fuzzyContiguousFilter = or(matchesPrefix, matchesCamelCase, matchesContiguousSubString);\nconst fuzzySeparateFilter = or(matchesPrefix, matchesCamelCase, matchesSubString);\nconst fuzzyRegExpCache = new LRUCache(10000); // bounded to 10000 elements\nexport function matchesFuzzy(word, wordToMatchAgainst, enableSeparateSubstringMatching = false) {\n if (typeof word !== 'string' || typeof wordToMatchAgainst !== 'string') {\n return null; // return early for invalid input\n }\n // Form RegExp for wildcard matches\n let regexp = fuzzyRegExpCache.get(word);\n if (!regexp) {\n regexp = new RegExp(strings.convertSimple2RegExpPattern(word), 'i');\n fuzzyRegExpCache.set(word, regexp);\n }\n // RegExp Filter\n const match = regexp.exec(wordToMatchAgainst);\n if (match) {\n return [{ start: match.index, end: match.index + match[0].length }];\n }\n // Default Filter\n return enableSeparateSubstringMatching ? fuzzySeparateFilter(word, wordToMatchAgainst) : fuzzyContiguousFilter(word, wordToMatchAgainst);\n}\n/**\n * Match pattern against word in a fuzzy way. As in IntelliSense and faster and more\n * powerful than `matchesFuzzy`\n */\nexport function matchesFuzzy2(pattern, word) {\n const score = fuzzyScore(pattern, pattern.toLowerCase(), 0, word, word.toLowerCase(), 0, { firstMatchCanBeWeak: true, boostFullMatch: true });\n return score ? createMatches(score) : null;\n}\nexport function anyScore(pattern, lowPattern, patternPos, word, lowWord, wordPos) {\n const max = Math.min(13, pattern.length);\n for (; patternPos < max; patternPos++) {\n const result = fuzzyScore(pattern, lowPattern, patternPos, word, lowWord, wordPos, { firstMatchCanBeWeak: true, boostFullMatch: true });\n if (result) {\n return result;\n }\n }\n return [0, wordPos];\n}\n//#region --- fuzzyScore ---\nexport function createMatches(score) {\n if (typeof score === 'undefined') {\n return [];\n }\n const res = [];\n const wordPos = score[1];\n for (let i = score.length - 1; i > 1; i--) {\n const pos = score[i] + wordPos;\n const last = res[res.length - 1];\n if (last && last.end === pos) {\n last.end = pos + 1;\n }\n else {\n res.push({ start: pos, end: pos + 1 });\n }\n }\n return res;\n}\nconst _maxLen = 128;\nfunction initTable() {\n const table = [];\n const row = [];\n for (let i = 0; i <= _maxLen; i++) {\n row[i] = 0;\n }\n for (let i = 0; i <= _maxLen; i++) {\n table.push(row.slice(0));\n }\n return table;\n}\nfunction initArr(maxLen) {\n const row = [];\n for (let i = 0; i <= maxLen; i++) {\n row[i] = 0;\n }\n return row;\n}\nconst _minWordMatchPos = initArr(2 * _maxLen); // min word position for a certain pattern position\nconst _maxWordMatchPos = initArr(2 * _maxLen); // max word position for a certain pattern position\nconst _diag = initTable(); // the length of a contiguous diagonal match\nconst _table = initTable();\nconst _arrows = initTable();\nconst _debug = false;\nfunction printTable(table, pattern, patternLen, word, wordLen) {\n function pad(s, n, pad = ' ') {\n while (s.length < n) {\n s = pad + s;\n }\n return s;\n }\n let ret = ` | |${word.split('').map(c => pad(c, 3)).join('|')}\\n`;\n for (let i = 0; i <= patternLen; i++) {\n if (i === 0) {\n ret += ' |';\n }\n else {\n ret += `${pattern[i - 1]}|`;\n }\n ret += table[i].slice(0, wordLen + 1).map(n => pad(n.toString(), 3)).join('|') + '\\n';\n }\n return ret;\n}\nfunction printTables(pattern, patternStart, word, wordStart) {\n pattern = pattern.substr(patternStart);\n word = word.substr(wordStart);\n console.log(printTable(_table, pattern, pattern.length, word, word.length));\n console.log(printTable(_arrows, pattern, pattern.length, word, word.length));\n console.log(printTable(_diag, pattern, pattern.length, word, word.length));\n}\nfunction isSeparatorAtPos(value, index) {\n if (index < 0 || index >= value.length) {\n return false;\n }\n const code = value.codePointAt(index);\n switch (code) {\n case 95 /* CharCode.Underline */:\n case 45 /* CharCode.Dash */:\n case 46 /* CharCode.Period */:\n case 32 /* CharCode.Space */:\n case 47 /* CharCode.Slash */:\n case 92 /* CharCode.Backslash */:\n case 39 /* CharCode.SingleQuote */:\n case 34 /* CharCode.DoubleQuote */:\n case 58 /* CharCode.Colon */:\n case 36 /* CharCode.DollarSign */:\n case 60 /* CharCode.LessThan */:\n case 62 /* CharCode.GreaterThan */:\n case 40 /* CharCode.OpenParen */:\n case 41 /* CharCode.CloseParen */:\n case 91 /* CharCode.OpenSquareBracket */:\n case 93 /* CharCode.CloseSquareBracket */:\n case 123 /* CharCode.OpenCurlyBrace */:\n case 125 /* CharCode.CloseCurlyBrace */:\n return true;\n case undefined:\n return false;\n default:\n if (strings.isEmojiImprecise(code)) {\n return true;\n }\n return false;\n }\n}\nfunction isWhitespaceAtPos(value, index) {\n if (index < 0 || index >= value.length) {\n return false;\n }\n const code = value.charCodeAt(index);\n switch (code) {\n case 32 /* CharCode.Space */:\n case 9 /* CharCode.Tab */:\n return true;\n default:\n return false;\n }\n}\nfunction isUpperCaseAtPos(pos, word, wordLow) {\n return word[pos] !== wordLow[pos];\n}\nexport function isPatternInWord(patternLow, patternPos, patternLen, wordLow, wordPos, wordLen, fillMinWordPosArr = false) {\n while (patternPos < patternLen && wordPos < wordLen) {\n if (patternLow[patternPos] === wordLow[wordPos]) {\n if (fillMinWordPosArr) {\n // Remember the min word position for each pattern position\n _minWordMatchPos[patternPos] = wordPos;\n }\n patternPos += 1;\n }\n wordPos += 1;\n }\n return patternPos === patternLen; // pattern must be exhausted\n}\nexport var FuzzyScore;\n(function (FuzzyScore) {\n /**\n * No matches and value `-100`\n */\n FuzzyScore.Default = ([-100, 0]);\n function isDefault(score) {\n return !score || (score.length === 2 && score[0] === -100 && score[1] === 0);\n }\n FuzzyScore.isDefault = isDefault;\n})(FuzzyScore || (FuzzyScore = {}));\nexport class FuzzyScoreOptions {\n constructor(firstMatchCanBeWeak, boostFullMatch) {\n this.firstMatchCanBeWeak = firstMatchCanBeWeak;\n this.boostFullMatch = boostFullMatch;\n }\n}\nFuzzyScoreOptions.default = { boostFullMatch: true, firstMatchCanBeWeak: false };\nexport function fuzzyScore(pattern, patternLow, patternStart, word, wordLow, wordStart, options = FuzzyScoreOptions.default) {\n const patternLen = pattern.length > _maxLen ? _maxLen : pattern.length;\n const wordLen = word.length > _maxLen ? _maxLen : word.length;\n if (patternStart >= patternLen || wordStart >= wordLen || (patternLen - patternStart) > (wordLen - wordStart)) {\n return undefined;\n }\n // Run a simple check if the characters of pattern occur\n // (in order) at all in word. If that isn't the case we\n // stop because no match will be possible\n if (!isPatternInWord(patternLow, patternStart, patternLen, wordLow, wordStart, wordLen, true)) {\n return undefined;\n }\n // Find the max matching word position for each pattern position\n // NOTE: the min matching word position was filled in above, in the `isPatternInWord` call\n _fillInMaxWordMatchPos(patternLen, wordLen, patternStart, wordStart, patternLow, wordLow);\n let row = 1;\n let column = 1;\n let patternPos = patternStart;\n let wordPos = wordStart;\n const hasStrongFirstMatch = [false];\n // There will be a match, fill in tables\n for (row = 1, patternPos = patternStart; patternPos < patternLen; row++, patternPos++) {\n // Reduce search space to possible matching word positions and to possible access from next row\n const minWordMatchPos = _minWordMatchPos[patternPos];\n const maxWordMatchPos = _maxWordMatchPos[patternPos];\n const nextMaxWordMatchPos = (patternPos + 1 < patternLen ? _maxWordMatchPos[patternPos + 1] : wordLen);\n for (column = minWordMatchPos - wordStart + 1, wordPos = minWordMatchPos; wordPos < nextMaxWordMatchPos; column++, wordPos++) {\n let score = Number.MIN_SAFE_INTEGER;\n let canComeDiag = false;\n if (wordPos <= maxWordMatchPos) {\n score = _doScore(pattern, patternLow, patternPos, patternStart, word, wordLow, wordPos, wordLen, wordStart, _diag[row - 1][column - 1] === 0, hasStrongFirstMatch);\n }\n let diagScore = 0;\n if (score !== Number.MAX_SAFE_INTEGER) {\n canComeDiag = true;\n diagScore = score + _table[row - 1][column - 1];\n }\n const canComeLeft = wordPos > minWordMatchPos;\n const leftScore = canComeLeft ? _table[row][column - 1] + (_diag[row][column - 1] > 0 ? -5 : 0) : 0; // penalty for a gap start\n const canComeLeftLeft = wordPos > minWordMatchPos + 1 && _diag[row][column - 1] > 0;\n const leftLeftScore = canComeLeftLeft ? _table[row][column - 2] + (_diag[row][column - 2] > 0 ? -5 : 0) : 0; // penalty for a gap start\n if (canComeLeftLeft && (!canComeLeft || leftLeftScore >= leftScore) && (!canComeDiag || leftLeftScore >= diagScore)) {\n // always prefer choosing left left to jump over a diagonal because that means a match is earlier in the word\n _table[row][column] = leftLeftScore;\n _arrows[row][column] = 3 /* Arrow.LeftLeft */;\n _diag[row][column] = 0;\n }\n else if (canComeLeft && (!canComeDiag || leftScore >= diagScore)) {\n // always prefer choosing left since that means a match is earlier in the word\n _table[row][column] = leftScore;\n _arrows[row][column] = 2 /* Arrow.Left */;\n _diag[row][column] = 0;\n }\n else if (canComeDiag) {\n _table[row][column] = diagScore;\n _arrows[row][column] = 1 /* Arrow.Diag */;\n _diag[row][column] = _diag[row - 1][column - 1] + 1;\n }\n else {\n throw new Error(`not possible`);\n }\n }\n }\n if (_debug) {\n printTables(pattern, patternStart, word, wordStart);\n }\n if (!hasStrongFirstMatch[0] && !options.firstMatchCanBeWeak) {\n return undefined;\n }\n row--;\n column--;\n const result = [_table[row][column], wordStart];\n let backwardsDiagLength = 0;\n let maxMatchColumn = 0;\n while (row >= 1) {\n // Find the column where we go diagonally up\n let diagColumn = column;\n do {\n const arrow = _arrows[row][diagColumn];\n if (arrow === 3 /* Arrow.LeftLeft */) {\n diagColumn = diagColumn - 2;\n }\n else if (arrow === 2 /* Arrow.Left */) {\n diagColumn = diagColumn - 1;\n }\n else {\n // found the diagonal\n break;\n }\n } while (diagColumn >= 1);\n // Overturn the \"forwards\" decision if keeping the \"backwards\" diagonal would give a better match\n if (backwardsDiagLength > 1 // only if we would have a contiguous match of 3 characters\n && patternLow[patternStart + row - 1] === wordLow[wordStart + column - 1] // only if we can do a contiguous match diagonally\n && !isUpperCaseAtPos(diagColumn + wordStart - 1, word, wordLow) // only if the forwards chose diagonal is not an uppercase\n && backwardsDiagLength + 1 > _diag[row][diagColumn] // only if our contiguous match would be longer than the \"forwards\" contiguous match\n ) {\n diagColumn = column;\n }\n if (diagColumn === column) {\n // this is a contiguous match\n backwardsDiagLength++;\n }\n else {\n backwardsDiagLength = 1;\n }\n if (!maxMatchColumn) {\n // remember the last matched column\n maxMatchColumn = diagColumn;\n }\n row--;\n column = diagColumn - 1;\n result.push(column);\n }\n if (wordLen - wordStart === patternLen && options.boostFullMatch) {\n // the word matches the pattern with all characters!\n // giving the score a total match boost (to come up ahead other words)\n result[0] += 2;\n }\n // Add 1 penalty for each skipped character in the word\n const skippedCharsCount = maxMatchColumn - patternLen;\n result[0] -= skippedCharsCount;\n return result;\n}\nfunction _fillInMaxWordMatchPos(patternLen, wordLen, patternStart, wordStart, patternLow, wordLow) {\n let patternPos = patternLen - 1;\n let wordPos = wordLen - 1;\n while (patternPos >= patternStart && wordPos >= wordStart) {\n if (patternLow[patternPos] === wordLow[wordPos]) {\n _maxWordMatchPos[patternPos] = wordPos;\n patternPos--;\n }\n wordPos--;\n }\n}\nfunction _doScore(pattern, patternLow, patternPos, patternStart, word, wordLow, wordPos, wordLen, wordStart, newMatchStart, outFirstMatchStrong) {\n if (patternLow[patternPos] !== wordLow[wordPos]) {\n return Number.MIN_SAFE_INTEGER;\n }\n let score = 1;\n let isGapLocation = false;\n if (wordPos === (patternPos - patternStart)) {\n // common prefix: `foobar <-> foobaz`\n // ^^^^^\n score = pattern[patternPos] === word[wordPos] ? 7 : 5;\n }\n else if (isUpperCaseAtPos(wordPos, word, wordLow) && (wordPos === 0 || !isUpperCaseAtPos(wordPos - 1, word, wordLow))) {\n // hitting upper-case: `foo <-> forOthers`\n // ^^ ^\n score = pattern[patternPos] === word[wordPos] ? 7 : 5;\n isGapLocation = true;\n }\n else if (isSeparatorAtPos(wordLow, wordPos) && (wordPos === 0 || !isSeparatorAtPos(wordLow, wordPos - 1))) {\n // hitting a separator: `. <-> foo.bar`\n // ^\n score = 5;\n }\n else if (isSeparatorAtPos(wordLow, wordPos - 1) || isWhitespaceAtPos(wordLow, wordPos - 1)) {\n // post separator: `foo <-> bar_foo`\n // ^^^\n score = 5;\n isGapLocation = true;\n }\n if (score > 1 && patternPos === patternStart) {\n outFirstMatchStrong[0] = true;\n }\n if (!isGapLocation) {\n isGapLocation = isUpperCaseAtPos(wordPos, word, wordLow) || isSeparatorAtPos(wordLow, wordPos - 1) || isWhitespaceAtPos(wordLow, wordPos - 1);\n }\n //\n if (patternPos === patternStart) { // first character in pattern\n if (wordPos > wordStart) {\n // the first pattern character would match a word character that is not at the word start\n // so introduce a penalty to account for the gap preceding this match\n score -= isGapLocation ? 3 : 5;\n }\n }\n else {\n if (newMatchStart) {\n // this would be the beginning of a new match (i.e. there would be a gap before this location)\n score += isGapLocation ? 2 : 0;\n }\n else {\n // this is part of a contiguous match, so give it a slight bonus, but do so only if it would not be a preferred gap location\n score += isGapLocation ? 0 : 1;\n }\n }\n if (wordPos + 1 === wordLen) {\n // we always penalize gaps, but this gives unfair advantages to a match that would match the last character in the word\n // so pretend there is a gap after the last character in the word to normalize things\n score -= isGapLocation ? 3 : 5;\n }\n return score;\n}\n//#endregion\n//#region --- graceful ---\nexport function fuzzyScoreGracefulAggressive(pattern, lowPattern, patternPos, word, lowWord, wordPos, options) {\n return fuzzyScoreWithPermutations(pattern, lowPattern, patternPos, word, lowWord, wordPos, true, options);\n}\nfunction fuzzyScoreWithPermutations(pattern, lowPattern, patternPos, word, lowWord, wordPos, aggressive, options) {\n let top = fuzzyScore(pattern, lowPattern, patternPos, word, lowWord, wordPos, options);\n if (top && !aggressive) {\n // when using the original pattern yield a result we`\n // return it unless we are aggressive and try to find\n // a better alignment, e.g. `cno` -> `^co^ns^ole` or `^c^o^nsole`.\n return top;\n }\n if (pattern.length >= 3) {\n // When the pattern is long enough then try a few (max 7)\n // permutations of the pattern to find a better match. The\n // permutations only swap neighbouring characters, e.g\n // `cnoso` becomes `conso`, `cnsoo`, `cnoos`.\n const tries = Math.min(7, pattern.length - 1);\n for (let movingPatternPos = patternPos + 1; movingPatternPos < tries; movingPatternPos++) {\n const newPattern = nextTypoPermutation(pattern, movingPatternPos);\n if (newPattern) {\n const candidate = fuzzyScore(newPattern, newPattern.toLowerCase(), patternPos, word, lowWord, wordPos, options);\n if (candidate) {\n candidate[0] -= 3; // permutation penalty\n if (!top || candidate[0] > top[0]) {\n top = candidate;\n }\n }\n }\n }\n }\n return top;\n}\nfunction nextTypoPermutation(pattern, patternPos) {\n if (patternPos + 1 >= pattern.length) {\n return undefined;\n }\n const swap1 = pattern[patternPos];\n const swap2 = pattern[patternPos + 1];\n if (swap1 === swap2) {\n return undefined;\n }\n return pattern.slice(0, patternPos)\n + swap2\n + swap1\n + pattern.slice(patternPos + 2);\n}\n//#endregion\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n/**\n * Given a function, returns a function that is only calling that function once.\n */\nexport function createSingleCallFunction(fn, fnDidRunCallback) {\n const _this = this;\n let didCall = false;\n let result;\n return function () {\n if (didCall) {\n return result;\n }\n didCall = true;\n if (fnDidRunCallback) {\n try {\n result = fn.apply(_this, arguments);\n }\n finally {\n fnDidRunCallback();\n }\n }\n else {\n result = fn.apply(_this, arguments);\n }\n return result;\n };\n}\n","import { createMatches as createFuzzyMatches, fuzzyScore } from './filters.js';\nimport { sep } from './path.js';\nimport { isWindows } from './platform.js';\nimport { stripWildcards } from './strings.js';\nconst NO_SCORE2 = [undefined, []];\nexport function scoreFuzzy2(target, query, patternStart = 0, wordStart = 0) {\n // Score: multiple inputs\n const preparedQuery = query;\n if (preparedQuery.values && preparedQuery.values.length > 1) {\n return doScoreFuzzy2Multiple(target, preparedQuery.values, patternStart, wordStart);\n }\n // Score: single input\n return doScoreFuzzy2Single(target, query, patternStart, wordStart);\n}\nfunction doScoreFuzzy2Multiple(target, query, patternStart, wordStart) {\n let totalScore = 0;\n const totalMatches = [];\n for (const queryPiece of query) {\n const [score, matches] = doScoreFuzzy2Single(target, queryPiece, patternStart, wordStart);\n if (typeof score !== 'number') {\n // if a single query value does not match, return with\n // no score entirely, we require all queries to match\n return NO_SCORE2;\n }\n totalScore += score;\n totalMatches.push(...matches);\n }\n // if we have a score, ensure that the positions are\n // sorted in ascending order and distinct\n return [totalScore, normalizeMatches(totalMatches)];\n}\nfunction doScoreFuzzy2Single(target, query, patternStart, wordStart) {\n const score = fuzzyScore(query.original, query.originalLowercase, patternStart, target, target.toLowerCase(), wordStart, { firstMatchCanBeWeak: true, boostFullMatch: true });\n if (!score) {\n return NO_SCORE2;\n }\n return [score[0], createFuzzyMatches(score)];\n}\nconst NO_ITEM_SCORE = Object.freeze({ score: 0 });\nfunction normalizeMatches(matches) {\n // sort matches by start to be able to normalize\n const sortedMatches = matches.sort((matchA, matchB) => {\n return matchA.start - matchB.start;\n });\n // merge matches that overlap\n const normalizedMatches = [];\n let currentMatch = undefined;\n for (const match of sortedMatches) {\n // if we have no current match or the matches\n // do not overlap, we take it as is and remember\n // it for future merging\n if (!currentMatch || !matchOverlaps(currentMatch, match)) {\n currentMatch = match;\n normalizedMatches.push(match);\n }\n // otherwise we merge the matches\n else {\n currentMatch.start = Math.min(currentMatch.start, match.start);\n currentMatch.end = Math.max(currentMatch.end, match.end);\n }\n }\n return normalizedMatches;\n}\nfunction matchOverlaps(matchA, matchB) {\n if (matchA.end < matchB.start) {\n return false; // A ends before B starts\n }\n if (matchB.end < matchA.start) {\n return false; // B ends before A starts\n }\n return true;\n}\n/*\n * If a query is wrapped in quotes, the user does not want to\n * use fuzzy search for this query.\n */\nfunction queryExpectsExactMatch(query) {\n return query.startsWith('\"') && query.endsWith('\"');\n}\n/**\n * Helper function to prepare a search value for scoring by removing unwanted characters\n * and allowing to score on multiple pieces separated by whitespace character.\n */\nconst MULTIPLE_QUERY_VALUES_SEPARATOR = ' ';\nexport function prepareQuery(original) {\n if (typeof original !== 'string') {\n original = '';\n }\n const originalLowercase = original.toLowerCase();\n const { pathNormalized, normalized, normalizedLowercase } = normalizeQuery(original);\n const containsPathSeparator = pathNormalized.indexOf(sep) >= 0;\n const expectExactMatch = queryExpectsExactMatch(original);\n let values = undefined;\n const originalSplit = original.split(MULTIPLE_QUERY_VALUES_SEPARATOR);\n if (originalSplit.length > 1) {\n for (const originalPiece of originalSplit) {\n const expectExactMatchPiece = queryExpectsExactMatch(originalPiece);\n const { pathNormalized: pathNormalizedPiece, normalized: normalizedPiece, normalizedLowercase: normalizedLowercasePiece } = normalizeQuery(originalPiece);\n if (normalizedPiece) {\n if (!values) {\n values = [];\n }\n values.push({\n original: originalPiece,\n originalLowercase: originalPiece.toLowerCase(),\n pathNormalized: pathNormalizedPiece,\n normalized: normalizedPiece,\n normalizedLowercase: normalizedLowercasePiece,\n expectContiguousMatch: expectExactMatchPiece\n });\n }\n }\n }\n return { original, originalLowercase, pathNormalized, normalized, normalizedLowercase, values, containsPathSeparator, expectContiguousMatch: expectExactMatch };\n}\nfunction normalizeQuery(original) {\n let pathNormalized;\n if (isWindows) {\n pathNormalized = original.replace(/\\//g, sep); // Help Windows users to search for paths when using slash\n }\n else {\n pathNormalized = original.replace(/\\\\/g, sep); // Help macOS/Linux users to search for paths when using backslash\n }\n // we remove quotes here because quotes are used for exact match search\n const normalized = stripWildcards(pathNormalized).replace(/\\s|\"/g, '');\n return {\n pathNormalized,\n normalized,\n normalizedLowercase: normalized.toLowerCase()\n };\n}\nexport function pieceToQuery(arg1) {\n if (Array.isArray(arg1)) {\n return prepareQuery(arg1.map(piece => piece.original).join(MULTIPLE_QUERY_VALUES_SEPARATOR));\n }\n return prepareQuery(arg1.original);\n}\n//#endregion\n"],"names":["strictEquals","a","b","itemsEquals","itemEquals","equals","equalsIfDefined","v1","v2","WeakMap","exceptionToErrorMessage","exception","verbose","stack","stacktrace","detectSystemErrorMessage","stackToString","Array","isArray","join","code","message","errno","syscall","toErrorMessage","error","errors","msg","length","detail","errorHandler","constructor","this","listeners","unexpectedErrorHandler","e","setTimeout","ErrorNoTelemetry","isErrorNoTelemetry","Error","emit","forEach","listener","onUnexpectedError","onUnexpectedExternalError","isCancellationError","transformErrorForSerialization","name","$isError","noTelemetry","canceledName","CancellationError","super","canceled","illegalArgument","illegalState","NotSupportedError","fromError","err","result","BugIndicatingError","Object","setPrototypeOf","prototype","Event","_addLeakageTraceLogic","options","once","event","thisArgs","disposables","didFire","dispose","call","map","disposable","snapshot","i","filter","onWillAddFirstListener","emitter","fire","onDidRemoveLastListener","Emitter","add","debounce","merge","delay","leading","flushOnListenerRemove","leakWarningThreshold","subscription","output","handle","doFire","numDebouncedCalls","cur","undefined","_output","clearTimeout","queueMicrotask","onWillRemoveListener","None","defer","each","signal","any","events","d","store","push","addAndReturnDisposable","reduce","initial","accumulate","last","latch","cache","firstCall","value","shouldEmit","split","isT","buffer","flushAfterTimeout","_buffer","slice","flush","onDidAddFirstListener","chain","sythensize","cs","ChainableSynthesis","evaluate","HaltChainable","Symbol","steps","fn","v","step","fromNodeEventEmitter","eventName","id","args","on","removeListener","fromDOMEventEmitter","addEventListener","removeEventListener","toPromise","Promise","resolve","fromPromise","promise","then","res","finally","runAndSubscribe","handler","EmitterObserver","_observable","_counter","_hasChanged","addObserver","removeObserver","beginUpdate","handlePossibleChange","handleChange","_change","endUpdate","reportChanges","get","fromObservable","obs","fromObservableLight","observable","count","didChange","observer","EventProfiling","listenerCount","invocationCount","elapsedOverall","durations","_idPool","all","start","_stopWatch","stop","elapsed","Set","LeakageMonitor","_errorHandler","threshold","Math","random","toString","_warnCountdown","_a","_stacks","clear","check","Map","set","topStack","topCount","getMostFrequentStack","console","warn","ListenerLeakError","Stacktrace","create","print","ListenerRefusalError","UniqueContainer","_listenerFinalizers","_b","_c","_d","_e","_f","_size","_options","_leakageMon","onListenerError","_perfMon","_profName","_deliveryQueue","deliveryQueue","_disposed","current","reset","_listeners","_event","callback","_g","tuple","bind","contained","removeMonitor","ceil","EventDeliveryQueuePrivate","unregister","_removeListener","trim","register","index","indexOf","log","JSON","stringify","adjustDeliveryQueue","n","end","_deliver","_deliverQueue","dq","enqueue","hasListeners","createEventDeliveryQueue","PauseableEmitter","_isPaused","_eventQueue","_mergeFn","pause","resume","size","from","shift","DebounceEmitter","_delay","_handle","MicrotaskEmitter","_queuedEvents","EventMultiplexer","onFirstListenerAdd","onLastListenerRemove","hook","unhook","idx","splice","r","EventBufferer","data","wrapEvent","buffers","reduceData","items","reducedResult","bufferEvents","pop","Relay","listening","inputEvent","inputEventListener","input","isPathSeparator","toSlashes","osPath","replace","toPosixPath","test","getRoot","path","sep","len","firstLetter","charCodeAt","pos","isWindowsDriveLetter","isEqualOrParent","base","parentCandidate","ignoreCase","separator","sepOffset","charAt","char0","hasDriveLetter","isWindowsOS","or","word","wordToMatchAgainst","match","_matchesPrefix","matchesPrefix","matches","matchesContiguousSubString","toLowerCase","matchesSubString","_matchesSubString","j","isLower","isUpper","isNumber","isWhitespace","wordSeparators","isWordSeparator","has","charactersMatch","codeA","codeB","s","alternateCharsCache","getAlternateCodes","codes","isAlphanumeric","head","tail","unshift","nextAnchor","camelCaseWord","c","_matchesCamelCase","nextUpperIndex","matchesCamelCase","upper","lower","whitespace","isCamelCasePattern","substring","analysis","alpha","numeric","upperPercent","lowerPercent","alphaPercent","numericPercent","analyzeCamelCaseWord","isCamelCaseWord","isUpperCaseWord","matchesWords","target","contiguous","targetIndex","_matchesWords","nextWord","wordIndex","targetIndexOffset","altChars","k","nextWordIndex","fuzzyContiguousFilter","fuzzySeparateFilter","fuzzyRegExpCache","matchesFuzzy","enableSeparateSubstringMatching","regexp","RegExp","exec","matchesFuzzy2","pattern","score","fuzzyScore","firstMatchCanBeWeak","boostFullMatch","createMatches","anyScore","lowPattern","patternPos","lowWord","wordPos","max","min","_maxLen","initTable","table","row","initArr","maxLen","_minWordMatchPos","_maxWordMatchPos","_diag","_table","_arrows","_debug","printTable","patternLen","wordLen","pad","ret","isSeparatorAtPos","codePointAt","isWhitespaceAtPos","isUpperCaseAtPos","wordLow","FuzzyScore","Default","isDefault","FuzzyScoreOptions","patternLow","patternStart","wordStart","default","fillMinWordPosArr","isPatternInWord","_fillInMaxWordMatchPos","column","hasStrongFirstMatch","minWordMatchPos","maxWordMatchPos","nextMaxWordMatchPos","Number","MIN_SAFE_INTEGER","canComeDiag","_doScore","diagScore","MAX_SAFE_INTEGER","canComeLeft","leftScore","canComeLeftLeft","leftLeftScore","substr","printTables","backwardsDiagLength","maxMatchColumn","diagColumn","arrow","skippedCharsCount","newMatchStart","outFirstMatchStrong","isGapLocation","fuzzyScoreGracefulAggressive","aggressive","top","tries","movingPatternPos","newPattern","nextTypoPermutation","candidate","fuzzyScoreWithPermutations","swap1","swap2","createSingleCallFunction","fnDidRunCallback","_this","didCall","apply","arguments","NO_SCORE2","scoreFuzzy2","query","preparedQuery","values","totalScore","totalMatches","queryPiece","doScoreFuzzy2Single","normalizeMatches","doScoreFuzzy2Multiple","original","originalLowercase","freeze","sortedMatches","sort","matchA","matchB","normalizedMatches","currentMatch","matchOverlaps","queryExpectsExactMatch","startsWith","endsWith","MULTIPLE_QUERY_VALUES_SEPARATOR","prepareQuery","pathNormalized","normalized","normalizedLowercase","normalizeQuery","containsPathSeparator","expectExactMatch","originalSplit","originalPiece","expectExactMatchPiece","pathNormalizedPiece","normalizedPiece","normalizedLowercasePiece","expectContiguousMatch","pieceToQuery","arg1","piece"],"sourceRoot":""}