@vscode/markdown-editor 0.0.2-14 → 0.0.2-16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +170 -21
- package/dist/index.js +1601 -1392
- package/dist/index.js.map +1 -1
- package/dist/observables.js.map +1 -1
- package/dist/runOnChange-C00UIwqQ.js.map +1 -1
- package/package.json +2 -1
- package/src/contrib/comments/commentInput.css +20 -1
- package/src/view/editor.css +59 -8
package/dist/observables.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observables.js","sources":["../../../external/vscode-observables/observables/dist/observableInternal/observables/lazyObservableValue.js","../../../external/vscode-observables/observables/dist/observableInternal/observables/observableValueOpts.js","../../../external/vscode-observables/observables/dist/observableInternal/utils/promise.js","../../../external/vscode-observables/observables/dist/observableInternal/utils/utilsCancellation.js","../../../external/vscode-observables/observables/dist/observableInternal/changeTracker.js","../../../external/vscode-observables/observables/dist/observableInternal/observables/observableSignalFromEvent.js","../../../external/vscode-observables/observables/dist/observableInternal/utils/valueWithChangeEvent.js","../../../external/vscode-observables/observables/dist/observableInternal/experimental/utils.js","../../../external/vscode-observables/observables/dist/observableInternal/experimental/deferUnobserve.js","../../../external/vscode-observables/observables/dist/observableInternal/set.js","../../../external/vscode-observables/observables/dist/observableInternal/map.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 { TransactionImpl } from '../transaction.js';\nimport { getLogger } from '../logging/logging.js';\nimport { BaseObservable } from './baseObservable.js';\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/**\n * Holds off updating observers until the value is actually read.\n*/\nclass LazyObservableValue extends BaseObservable {\n get debugName() {\n return this._debugNameData.getDebugName(this) ?? 'LazyObservableValue';\n }\n constructor(_debugNameData, initialValue, _equalityComparator, debugLocation) {\n super(debugLocation);\n this._debugNameData = _debugNameData;\n this._equalityComparator = _equalityComparator;\n this._isUpToDate = true;\n this._deltas = [];\n this._updateCounter = 0;\n this._value = initialValue;\n }\n get() {\n this._update();\n return this._value;\n }\n _update() {\n if (this._isUpToDate) {\n return;\n }\n this._isUpToDate = true;\n if (this._deltas.length > 0) {\n for (const change of this._deltas) {\n getLogger()?.handleObservableUpdated(this, { change, didChange: true, oldValue: '(unknown)', newValue: this._value, hadValue: true });\n for (const observer of this._observers) {\n observer.handleChange(this, change);\n }\n }\n this._deltas.length = 0;\n }\n else {\n getLogger()?.handleObservableUpdated(this, { change: undefined, didChange: true, oldValue: '(unknown)', newValue: this._value, hadValue: true });\n for (const observer of this._observers) {\n observer.handleChange(this, undefined);\n }\n }\n }\n _beginUpdate() {\n this._updateCounter++;\n if (this._updateCounter === 1) {\n for (const observer of this._observers) {\n observer.beginUpdate(this);\n }\n }\n }\n _endUpdate() {\n this._updateCounter--;\n if (this._updateCounter === 0) {\n this._update();\n // End update could change the observer list.\n const observers = [...this._observers];\n for (const r of observers) {\n r.endUpdate(this);\n }\n }\n }\n addObserver(observer) {\n const shouldCallBeginUpdate = !this._observers.has(observer) && this._updateCounter > 0;\n super.addObserver(observer);\n if (shouldCallBeginUpdate) {\n observer.beginUpdate(this);\n }\n }\n removeObserver(observer) {\n const shouldCallEndUpdate = this._observers.has(observer) && this._updateCounter > 0;\n super.removeObserver(observer);\n if (shouldCallEndUpdate) {\n // Calling end update after removing the observer makes sure endUpdate cannot be called twice here.\n observer.endUpdate(this);\n }\n }\n set(value, tx, change) {\n if (change === undefined && this._equalityComparator(this._value, value)) {\n return;\n }\n let _tx;\n if (!tx) {\n tx = _tx = new TransactionImpl(() => { }, () => `Setting ${this.debugName}`);\n }\n try {\n this._isUpToDate = false;\n this._setValue(value);\n if (change !== undefined) {\n this._deltas.push(change);\n }\n tx.updateObserver({\n beginUpdate: () => this._beginUpdate(),\n endUpdate: () => this._endUpdate(),\n handleChange: (observable, change) => { },\n handlePossibleChange: (observable) => { },\n }, this);\n if (this._updateCounter > 1) {\n // We already started begin/end update, so we need to manually call handlePossibleChange\n for (const observer of this._observers) {\n observer.handlePossibleChange(this);\n }\n }\n }\n finally {\n if (_tx) {\n _tx.finish();\n }\n }\n }\n toString() {\n return `${this.debugName}: ${this._value}`;\n }\n _setValue(newValue) {\n this._value = newValue;\n }\n}\n\nexport { LazyObservableValue };\n//# sourceMappingURL=lazyObservableValue.js.map\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 { DebugNameData } from '../debugName.js';\nimport { strictEquals } from '../commonFacade/deps.js';\nimport { ObservableValue } from './observableValue.js';\nimport { LazyObservableValue } from './lazyObservableValue.js';\nimport { DebugLocation } from '../debugLocation.js';\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 *--------------------------------------------------------------------------------------------*/\nfunction observableValueOpts(options, initialValue, debugLocation = DebugLocation.ofCaller()) {\n if (options.lazy) {\n return new LazyObservableValue(new DebugNameData(options.owner, options.debugName, undefined), initialValue, options.equalsFn ?? strictEquals, debugLocation);\n }\n return new ObservableValue(new DebugNameData(options.owner, options.debugName, undefined), initialValue, options.equalsFn ?? strictEquals, debugLocation);\n}\n\nexport { observableValueOpts };\n//# sourceMappingURL=observableValueOpts.js.map\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 { transaction } from '../transaction.js';\nimport { derived } from '../observables/derived.js';\nimport { observableValue } from '../observables/observableValue.js';\n\nclass ObservableLazy {\n /**\n * The cached value.\n * Does not force a computation of the value.\n */\n get cachedValue() { return this._value; }\n constructor(_computeValue) {\n this._computeValue = _computeValue;\n this._value = observableValue(this, undefined);\n }\n /**\n * Returns the cached value.\n * Computes the value if the value has not been cached yet.\n */\n getValue() {\n let v = this._value.get();\n if (!v) {\n v = this._computeValue();\n this._value.set(v, undefined);\n }\n return v;\n }\n}\n/**\n * A promise whose state is observable.\n */\nclass ObservablePromise {\n static fromFn(fn) {\n return new ObservablePromise(fn());\n }\n constructor(promise) {\n this._value = observableValue(this, undefined);\n /**\n * The current state of the promise.\n * Is `undefined` if the promise didn't resolve yet.\n */\n this.promiseResult = this._value;\n this.resolvedValue = derived(this, reader => {\n const result = this.promiseResult.read(reader);\n if (!result) {\n return undefined;\n }\n return result.getDataOrThrow();\n });\n this.promise = promise.then(value => {\n transaction(tx => {\n /** @description onPromiseResolved */\n this._value.set(new PromiseResult(value, undefined), tx);\n });\n return value;\n }, error => {\n transaction(tx => {\n /** @description onPromiseRejected */\n this._value.set(new PromiseResult(undefined, error), tx);\n });\n throw error;\n });\n }\n}\nclass PromiseResult {\n constructor(\n /**\n * The value of the resolved promise.\n * Undefined if the promise rejected.\n */\n data, \n /**\n * The error in case of a rejected promise.\n * Undefined if the promise resolved.\n */\n error) {\n this.data = data;\n this.error = error;\n }\n /**\n * Returns the value if the promise resolved, otherwise throws the error.\n */\n getDataOrThrow() {\n if (this.error) {\n throw this.error;\n }\n return this.data;\n }\n}\n/**\n * A lazy promise whose state is observable.\n */\nclass ObservableLazyPromise {\n constructor(_computePromise) {\n this._computePromise = _computePromise;\n this._lazyValue = new ObservableLazy(() => new ObservablePromise(this._computePromise()));\n /**\n * Does not enforce evaluation of the promise compute function.\n * Is undefined if the promise has not been computed yet.\n */\n this.cachedPromiseResult = derived(this, reader => this._lazyValue.cachedValue.read(reader)?.promiseResult.read(reader));\n }\n getPromise() {\n return this._lazyValue.getValue().promise;\n }\n}\n\nexport { ObservableLazy, ObservableLazyPromise, ObservablePromise, PromiseResult };\n//# sourceMappingURL=promise.js.map\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 { DebugNameData } from '../debugName.js';\nimport { CancellationError, CancellationTokenSource } from '../commonFacade/cancellation.js';\nimport { strictEquals } from '../commonFacade/deps.js';\nimport { autorun } from '../reactions/autorun.js';\nimport { Derived } from '../observables/derivedImpl.js';\nimport { DebugLocation } from '../debugLocation.js';\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 *--------------------------------------------------------------------------------------------*/\nfunction waitForState(observable, predicate, isError, cancellationToken) {\n if (!predicate) {\n predicate = state => state !== null && state !== undefined;\n }\n return new Promise((resolve, reject) => {\n let isImmediateRun = true;\n let shouldDispose = false;\n const stateObs = observable.map(state => {\n /** @description waitForState.state */\n return {\n isFinished: predicate(state),\n error: isError ? isError(state) : false,\n state\n };\n });\n const d = autorun(reader => {\n /** @description waitForState */\n const { isFinished, error, state } = stateObs.read(reader);\n if (isFinished || error) {\n if (isImmediateRun) {\n // The variable `d` is not initialized yet\n shouldDispose = true;\n }\n else {\n d.dispose();\n }\n if (error) {\n reject(error === true ? state : error);\n }\n else {\n resolve(state);\n }\n }\n });\n if (cancellationToken) {\n const dc = cancellationToken.onCancellationRequested(() => {\n d.dispose();\n dc.dispose();\n reject(new CancellationError());\n });\n if (cancellationToken.isCancellationRequested) {\n d.dispose();\n dc.dispose();\n reject(new CancellationError());\n return;\n }\n }\n isImmediateRun = false;\n if (shouldDispose) {\n d.dispose();\n }\n });\n}\nfunction derivedWithCancellationToken(computeFnOrOwner, computeFnOrUndefined) {\n let computeFn;\n let owner;\n if (computeFnOrUndefined === undefined) {\n computeFn = computeFnOrOwner;\n owner = undefined;\n }\n else {\n owner = computeFnOrOwner;\n computeFn = computeFnOrUndefined;\n }\n let cancellationTokenSource = undefined;\n return new Derived(new DebugNameData(owner, undefined, computeFn), r => {\n if (cancellationTokenSource) {\n cancellationTokenSource.dispose();\n }\n cancellationTokenSource = new CancellationTokenSource();\n return computeFn(r, cancellationTokenSource.token);\n }, undefined, () => cancellationTokenSource?.dispose(), strictEquals, DebugLocation.ofCaller());\n}\n\nexport { derivedWithCancellationToken, waitForState };\n//# sourceMappingURL=utilsCancellation.js.map\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 { BugIndicatingError } from './commonFacade/deps.js';\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/**\n * Subscribes to and records changes and the last value of the given observables.\n * Don't use the key \"changes\", as it is reserved for the changes array!\n*/\nfunction recordChanges(obs) {\n return {\n createChangeSummary: (_previousChangeSummary) => {\n return {\n changes: [],\n };\n },\n handleChange(ctx, changeSummary) {\n for (const key in obs) {\n if (ctx.didChange(obs[key])) {\n changeSummary.changes.push({ key, change: ctx.change });\n }\n }\n return true;\n },\n beforeUpdate(reader, changeSummary) {\n for (const key in obs) {\n if (key === 'changes') {\n throw new BugIndicatingError('property name \"changes\" is reserved for change tracking');\n }\n changeSummary[key] = obs[key].read(reader);\n }\n }\n };\n}\n/**\n * Subscribes to and records changes and the last value of the given observables.\n * Don't use the key \"changes\", as it is reserved for the changes array!\n*/\nfunction recordChangesLazy(getObs) {\n let obs = undefined;\n return {\n createChangeSummary: (_previousChangeSummary) => {\n return {\n changes: [],\n };\n },\n handleChange(ctx, changeSummary) {\n if (!obs) {\n obs = getObs();\n }\n for (const key in obs) {\n if (ctx.didChange(obs[key])) {\n changeSummary.changes.push({ key, change: ctx.change });\n }\n }\n return true;\n },\n beforeUpdate(reader, changeSummary) {\n if (!obs) {\n obs = getObs();\n }\n for (const key in obs) {\n if (key === 'changes') {\n throw new BugIndicatingError('property name \"changes\" is reserved for change tracking');\n }\n changeSummary[key] = obs[key].read(reader);\n }\n }\n };\n}\n\nexport { recordChanges, recordChangesLazy };\n//# sourceMappingURL=changeTracker.js.map\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 { transaction } from '../transaction.js';\nimport { DebugNameData } from '../debugName.js';\nimport { BaseObservable } from './baseObservable.js';\nimport { DebugLocation } from '../debugLocation.js';\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 *--------------------------------------------------------------------------------------------*/\nfunction observableSignalFromEvent(owner, event, debugLocation = DebugLocation.ofCaller()) {\n return new FromEventObservableSignal(typeof owner === 'string' ? owner : new DebugNameData(owner, undefined, undefined), event, debugLocation);\n}\nclass FromEventObservableSignal extends BaseObservable {\n constructor(debugNameDataOrName, event, debugLocation) {\n super(debugLocation);\n this.event = event;\n this.handleEvent = () => {\n transaction((tx) => {\n for (const o of this._observers) {\n tx.updateObserver(o, this);\n o.handleChange(this, undefined);\n }\n }, () => this.debugName);\n };\n this.debugName = typeof debugNameDataOrName === 'string'\n ? debugNameDataOrName\n : debugNameDataOrName.getDebugName(this) ?? 'Observable Signal From Event';\n }\n onFirstObserverAdded() {\n this.subscription = this.event(this.handleEvent);\n }\n onLastObserverRemoved() {\n this.subscription.dispose();\n this.subscription = undefined;\n }\n get() {\n // NO OP\n }\n}\n\nexport { observableSignalFromEvent };\n//# sourceMappingURL=observableSignalFromEvent.js.map\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 { observableFromEvent } from '../observables/observableFromEvent.js';\nimport { autorun } from '../reactions/autorun.js';\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/**\n * Creates an Event from an observable that fires whenever the observable changes.\n */\nfunction eventFromObservable(observable) {\n return (listener) => {\n let isFirst = true;\n return autorun(reader => {\n observable.read(reader);\n if (isFirst) {\n isFirst = false;\n }\n else {\n listener();\n }\n });\n };\n}\nclass ValueWithChangeEventFromObservable {\n constructor(observable) {\n this.observable = observable;\n }\n get onDidChange() {\n return eventFromObservable(this.observable);\n }\n get value() {\n return this.observable.get();\n }\n}\nfunction observableFromValueWithChangeEvent(owner, value) {\n if (value instanceof ValueWithChangeEventFromObservable) {\n return value.observable;\n }\n return observableFromEvent(owner, value.onDidChange, () => value.value);\n}\n\nexport { ValueWithChangeEventFromObservable, observableFromValueWithChangeEvent };\n//# sourceMappingURL=valueWithChangeEvent.js.map\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 { BugIndicatingError } from '../commonFacade/deps.js';\nimport { getDebugName, DebugNameData } from '../debugName.js';\nimport { observableFromEvent } from '../observables/observableFromEvent.js';\nimport { autorunOpts } from '../reactions/autorun.js';\nimport { derivedObservableWithCache } from '../utils/utils.js';\nimport { DisposableStore } from '../../disposables.js';\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/**\n * Creates an observable that has the latest changed value of the given observables.\n * Initially (and when not observed), it has the value of the last observable.\n * When observed and any of the observables change, it has the value of the last changed observable.\n * If multiple observables change in the same transaction, the last observable wins.\n*/\nfunction latestChangedValue(owner, observables) {\n if (observables.length === 0) {\n throw new BugIndicatingError();\n }\n let hasLastChangedValue = false;\n let lastChangedValue = undefined;\n const result = observableFromEvent(owner, cb => {\n const store = new DisposableStore();\n for (const o of observables) {\n store.add(autorunOpts({ debugName: () => getDebugName(result, new DebugNameData(owner, undefined, undefined)) + '.updateLastChangedValue' }, reader => {\n hasLastChangedValue = true;\n lastChangedValue = o.read(reader);\n cb();\n }));\n }\n store.add({\n dispose() {\n hasLastChangedValue = false;\n lastChangedValue = undefined;\n },\n });\n return store;\n }, () => {\n if (hasLastChangedValue) {\n return lastChangedValue;\n }\n else {\n return observables[observables.length - 1].get();\n }\n });\n return result;\n}\n/**\n * Works like a derived.\n * However, if the value is not undefined, it is cached and will not be recomputed anymore.\n * In that case, the derived will unsubscribe from its dependencies.\n*/\nfunction derivedConstOnceDefined(owner, fn) {\n return derivedObservableWithCache(owner, (reader, lastValue) => lastValue ?? fn(reader));\n}\n\nexport { derivedConstOnceDefined, latestChangedValue };\n//# sourceMappingURL=utils.js.map\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 { BugIndicatingError } from '../commonFacade/deps.js';\nimport { derived } from '../observables/derived.js';\nimport { observableSignalFromEvent } from '../observables/observableSignalFromEvent.js';\nimport { keepObserved } from '../utils/utils.js';\n\n/**\n * Wraps an observable so that its source remains observed for a grace period\n * after the wrapping observable loses all its observers.\n *\n * When the wrapping observable has observers, an autorun keeps `obs` observed\n * and forwards changes. When the last observer is removed, `obs` stays observed\n * via `keepObserved` for `maxIdleTimeMs` before being released. If a new observer\n * arrives during the grace period, the keep-alive is cancelled seamlessly.\n *\n * @param store - Controls the hard lifetime; disposing it cancels any pending grace period.\n * @param obs - The source observable to keep alive longer.\n * @param maxIdleTimeMs - Grace period in milliseconds.\n */\nfunction deferUnobserve(store, obs, maxIdleTimeMs) {\n let keepAliveHandle;\n let timeoutHandle;\n let disposed = false;\n const lifetimeTracker = observableSignalFromEvent('deferUnobserve', _ => {\n if (disposed) {\n throw new BugIndicatingError('deferUnobserve: Cannot add observer after disposal');\n }\n // First observer added to `lifetimeTracker`\n if (timeoutHandle !== undefined) {\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n if (!keepAliveHandle) {\n keepAliveHandle = keepObserved(obs);\n }\n return {\n dispose() {\n // Keep source observed during the grace period\t\n timeoutHandle = setTimeout(() => {\n timeoutHandle = undefined;\n keepAliveHandle?.dispose();\n keepAliveHandle = undefined;\n }, maxIdleTimeMs);\n },\n };\n });\n store.add({\n dispose() {\n if (timeoutHandle !== undefined) {\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n keepAliveHandle?.dispose();\n keepAliveHandle = undefined;\n disposed = true;\n },\n });\n return derived(reader => {\n lifetimeTracker.read(reader);\n return obs.read(reader);\n });\n}\n\nexport { deferUnobserve };\n//# sourceMappingURL=deferUnobserve.js.map\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 { observableValueOpts } from './observables/observableValueOpts.js';\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 *--------------------------------------------------------------------------------------------*/\nclass ObservableSet {\n constructor() {\n this._data = new Set();\n this._obs = observableValueOpts({ equalsFn: () => false }, this);\n this.observable = this._obs;\n }\n get size() {\n return this._data.size;\n }\n has(value) {\n return this._data.has(value);\n }\n add(value, tx) {\n const hadValue = this._data.has(value);\n if (!hadValue) {\n this._data.add(value);\n this._obs.set(this, tx);\n }\n return this;\n }\n delete(value, tx) {\n const result = this._data.delete(value);\n if (result) {\n this._obs.set(this, tx);\n }\n return result;\n }\n clear(tx) {\n if (this._data.size > 0) {\n this._data.clear();\n this._obs.set(this, tx);\n }\n }\n forEach(callbackfn, thisArg) {\n this._data.forEach((value, value2, _set) => {\n callbackfn.call(thisArg, value, value2, this);\n });\n }\n *entries() {\n for (const value of this._data) {\n yield [value, value];\n }\n }\n *keys() {\n yield* this._data.keys();\n }\n *values() {\n yield* this._data.values();\n }\n [Symbol.iterator]() {\n return this.values();\n }\n get [Symbol.toStringTag]() {\n return 'ObservableSet';\n }\n}\n\nexport { ObservableSet };\n//# sourceMappingURL=set.js.map\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 { observableValueOpts } from './observables/observableValueOpts.js';\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 *--------------------------------------------------------------------------------------------*/\nclass ObservableMap {\n constructor() {\n this._data = new Map();\n this._obs = observableValueOpts({ equalsFn: () => false }, this);\n this.observable = this._obs;\n }\n get size() {\n return this._data.size;\n }\n has(key) {\n return this._data.has(key);\n }\n get(key) {\n return this._data.get(key);\n }\n set(key, value, tx) {\n const hadKey = this._data.has(key);\n const oldValue = this._data.get(key);\n if (!hadKey || oldValue !== value) {\n this._data.set(key, value);\n this._obs.set(this, tx);\n }\n return this;\n }\n delete(key, tx) {\n const result = this._data.delete(key);\n if (result) {\n this._obs.set(this, tx);\n }\n return result;\n }\n clear(tx) {\n if (this._data.size > 0) {\n this._data.clear();\n this._obs.set(this, tx);\n }\n }\n forEach(callbackfn, thisArg) {\n this._data.forEach((value, key, _map) => {\n callbackfn.call(thisArg, value, key, this);\n });\n }\n *entries() {\n yield* this._data.entries();\n }\n *keys() {\n yield* this._data.keys();\n }\n *values() {\n yield* this._data.values();\n }\n [Symbol.iterator]() {\n return this.entries();\n }\n get [Symbol.toStringTag]() {\n return 'ObservableMap';\n }\n}\n\nexport { ObservableMap };\n//# sourceMappingURL=map.js.map\n"],"names":["LazyObservableValue","BaseObservable","_debugNameData","initialValue","_equalityComparator","debugLocation","change","getLogger","observer","observers","r","shouldCallBeginUpdate","shouldCallEndUpdate","value","tx","_tx","TransactionImpl","observable","newValue","observableValueOpts","options","DebugLocation","DebugNameData","strictEquals","ObservableValue","ObservableLazy","_computeValue","observableValue","v","ObservablePromise","fn","promise","derived","reader","result","transaction","PromiseResult","error","data","ObservableLazyPromise","_computePromise","waitForState","predicate","isError","cancellationToken","state","resolve","reject","isImmediateRun","shouldDispose","stateObs","d","autorun","isFinished","dc","CancellationError","derivedWithCancellationToken","computeFnOrOwner","computeFnOrUndefined","computeFn","owner","cancellationTokenSource","Derived","CancellationTokenSource","recordChanges","obs","_previousChangeSummary","ctx","changeSummary","key","BugIndicatingError","recordChangesLazy","getObs","observableSignalFromEvent","event","FromEventObservableSignal","debugNameDataOrName","o","eventFromObservable","listener","isFirst","ValueWithChangeEventFromObservable","observableFromValueWithChangeEvent","observableFromEvent","latestChangedValue","observables","hasLastChangedValue","lastChangedValue","cb","store","DisposableStore","autorunOpts","getDebugName","derivedConstOnceDefined","derivedObservableWithCache","lastValue","deferUnobserve","maxIdleTimeMs","keepAliveHandle","timeoutHandle","disposed","lifetimeTracker","_","keepObserved","ObservableSet","callbackfn","thisArg","value2","_set","ObservableMap","hadKey","oldValue","_map"],"mappings":";;AAeA,MAAMA,UAA4BC,EAAe;AAAA,EAC7C,IAAI,YAAY;AACZ,WAAO,KAAK,eAAe,aAAa,IAAI,KAAK;AAAA,EACrD;AAAA,EACA,YAAYC,GAAgBC,GAAcC,GAAqBC,GAAe;AAC1E,UAAMA,CAAa,GACnB,KAAK,iBAAiBH,GACtB,KAAK,sBAAsBE,GAC3B,KAAK,cAAc,IACnB,KAAK,UAAU,CAAA,GACf,KAAK,iBAAiB,GACtB,KAAK,SAASD;AAAA,EAClB;AAAA,EACA,MAAM;AACF,gBAAK,QAAO,GACL,KAAK;AAAA,EAChB;AAAA,EACA,UAAU;AACN,QAAI,MAAK;AAIT,UADA,KAAK,cAAc,IACf,KAAK,QAAQ,SAAS,GAAG;AACzB,mBAAWG,KAAU,KAAK,SAAS;AAC/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AOuD,GAAKvD,GAAI;AACZ,UAAMoB,IAAS,KAAK,MAAM,OAAOmC,CAAG;AACpC,WAAInC,KACA,KAAK,KAAK,IAAI,MAAMpB,CAAE,GAEnBoB;AAAA,EACX;AAAA,EACA,MAAMpB,GAAI;AACN,IAAI,KAAK,MAAM,OAAO,MAClB,KAAK,MAAM,MAAK,GAChB,KAAK,KAAK,IAAI,MAAMA,CAAE;AAAA,EAE9B;AAAA,EACA,QAAQ2F,GAAYC,GAAS;AACzB,SAAK,MAAM,QAAQ,CAAC7F,GAAOwD,GAAK2C,MAAS;AACrC,MAAAP,EAAW,KAAKC,GAAS7F,GAAOwD,GAAK,IAAI;AAAA,IAC7C,CAAC;AAAA,EACL;AAAA,EACA,CAAC,UAAU;AACP,WAAO,KAAK,MAAM,QAAO;AAAA,EAC7B;AAAA,EACA,CAAC,OAAO;AACJ,WAAO,KAAK,MAAM,KAAI;AAAA,EAC1B;AAAA,EACA,CAAC,SAAS;AACN,WAAO,KAAK,MAAM,OAAM;AAAA,EAC5B;AAAA,EACA,CAAC,OAAO,QAAQ,IAAI;AAChB,WAAO,KAAK,QAAO;AAAA,EACvB;AAAA,EACA,KAAK,OAAO,WAAW,IAAI;AACvB,WAAO;AAAA,EACX;AACJ;"}
|
|
1
|
+
{"version":3,"file":"observables.js","sources":["../../../../external/vscode-observables/observables/dist/observableInternal/observables/lazyObservableValue.js","../../../../external/vscode-observables/observables/dist/observableInternal/observables/observableValueOpts.js","../../../../external/vscode-observables/observables/dist/observableInternal/utils/promise.js","../../../../external/vscode-observables/observables/dist/observableInternal/utils/utilsCancellation.js","../../../../external/vscode-observables/observables/dist/observableInternal/changeTracker.js","../../../../external/vscode-observables/observables/dist/observableInternal/observables/observableSignalFromEvent.js","../../../../external/vscode-observables/observables/dist/observableInternal/utils/valueWithChangeEvent.js","../../../../external/vscode-observables/observables/dist/observableInternal/experimental/utils.js","../../../../external/vscode-observables/observables/dist/observableInternal/experimental/deferUnobserve.js","../../../../external/vscode-observables/observables/dist/observableInternal/set.js","../../../../external/vscode-observables/observables/dist/observableInternal/map.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 { TransactionImpl } from '../transaction.js';\nimport { getLogger } from '../logging/logging.js';\nimport { BaseObservable } from './baseObservable.js';\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/**\n * Holds off updating observers until the value is actually read.\n*/\nclass LazyObservableValue extends BaseObservable {\n get debugName() {\n return this._debugNameData.getDebugName(this) ?? 'LazyObservableValue';\n }\n constructor(_debugNameData, initialValue, _equalityComparator, debugLocation) {\n super(debugLocation);\n this._debugNameData = _debugNameData;\n this._equalityComparator = _equalityComparator;\n this._isUpToDate = true;\n this._deltas = [];\n this._updateCounter = 0;\n this._value = initialValue;\n }\n get() {\n this._update();\n return this._value;\n }\n _update() {\n if (this._isUpToDate) {\n return;\n }\n this._isUpToDate = true;\n if (this._deltas.length > 0) {\n for (const change of this._deltas) {\n getLogger()?.handleObservableUpdated(this, { change, didChange: true, oldValue: '(unknown)', newValue: this._value, hadValue: true });\n for (const observer of this._observers) {\n observer.handleChange(this, change);\n }\n }\n this._deltas.length = 0;\n }\n else {\n getLogger()?.handleObservableUpdated(this, { change: undefined, didChange: true, oldValue: '(unknown)', newValue: this._value, hadValue: true });\n for (const observer of this._observers) {\n observer.handleChange(this, undefined);\n }\n }\n }\n _beginUpdate() {\n this._updateCounter++;\n if (this._updateCounter === 1) {\n for (const observer of this._observers) {\n observer.beginUpdate(this);\n }\n }\n }\n _endUpdate() {\n this._updateCounter--;\n if (this._updateCounter === 0) {\n this._update();\n // End update could change the observer list.\n const observers = [...this._observers];\n for (const r of observers) {\n r.endUpdate(this);\n }\n }\n }\n addObserver(observer) {\n const shouldCallBeginUpdate = !this._observers.has(observer) && this._updateCounter > 0;\n super.addObserver(observer);\n if (shouldCallBeginUpdate) {\n observer.beginUpdate(this);\n }\n }\n removeObserver(observer) {\n const shouldCallEndUpdate = this._observers.has(observer) && this._updateCounter > 0;\n super.removeObserver(observer);\n if (shouldCallEndUpdate) {\n // Calling end update after removing the observer makes sure endUpdate cannot be called twice here.\n observer.endUpdate(this);\n }\n }\n set(value, tx, change) {\n if (change === undefined && this._equalityComparator(this._value, value)) {\n return;\n }\n let _tx;\n if (!tx) {\n tx = _tx = new TransactionImpl(() => { }, () => `Setting ${this.debugName}`);\n }\n try {\n this._isUpToDate = false;\n this._setValue(value);\n if (change !== undefined) {\n this._deltas.push(change);\n }\n tx.updateObserver({\n beginUpdate: () => this._beginUpdate(),\n endUpdate: () => this._endUpdate(),\n handleChange: (observable, change) => { },\n handlePossibleChange: (observable) => { },\n }, this);\n if (this._updateCounter > 1) {\n // We already started begin/end update, so we need to manually call handlePossibleChange\n for (const observer of this._observers) {\n observer.handlePossibleChange(this);\n }\n }\n }\n finally {\n if (_tx) {\n _tx.finish();\n }\n }\n }\n toString() {\n return `${this.debugName}: ${this._value}`;\n }\n _setValue(newValue) {\n this._value = newValue;\n }\n}\n\nexport { LazyObservableValue };\n//# sourceMappingURL=lazyObservableValue.js.map\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 { DebugNameData } from '../debugName.js';\nimport { strictEquals } from '../commonFacade/deps.js';\nimport { ObservableValue } from './observableValue.js';\nimport { LazyObservableValue } from './lazyObservableValue.js';\nimport { DebugLocation } from '../debugLocation.js';\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 *--------------------------------------------------------------------------------------------*/\nfunction observableValueOpts(options, initialValue, debugLocation = DebugLocation.ofCaller()) {\n if (options.lazy) {\n return new LazyObservableValue(new DebugNameData(options.owner, options.debugName, undefined), initialValue, options.equalsFn ?? strictEquals, debugLocation);\n }\n return new ObservableValue(new DebugNameData(options.owner, options.debugName, undefined), initialValue, options.equalsFn ?? strictEquals, debugLocation);\n}\n\nexport { observableValueOpts };\n//# sourceMappingURL=observableValueOpts.js.map\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 { transaction } from '../transaction.js';\nimport { derived } from '../observables/derived.js';\nimport { observableValue } from '../observables/observableValue.js';\n\nclass ObservableLazy {\n /**\n * The cached value.\n * Does not force a computation of the value.\n */\n get cachedValue() { return this._value; }\n constructor(_computeValue) {\n this._computeValue = _computeValue;\n this._value = observableValue(this, undefined);\n }\n /**\n * Returns the cached value.\n * Computes the value if the value has not been cached yet.\n */\n getValue() {\n let v = this._value.get();\n if (!v) {\n v = this._computeValue();\n this._value.set(v, undefined);\n }\n return v;\n }\n}\n/**\n * A promise whose state is observable.\n */\nclass ObservablePromise {\n static fromFn(fn) {\n return new ObservablePromise(fn());\n }\n constructor(promise) {\n this._value = observableValue(this, undefined);\n /**\n * The current state of the promise.\n * Is `undefined` if the promise didn't resolve yet.\n */\n this.promiseResult = this._value;\n this.resolvedValue = derived(this, reader => {\n const result = this.promiseResult.read(reader);\n if (!result) {\n return undefined;\n }\n return result.getDataOrThrow();\n });\n this.promise = promise.then(value => {\n transaction(tx => {\n /** @description onPromiseResolved */\n this._value.set(new PromiseResult(value, undefined), tx);\n });\n return value;\n }, error => {\n transaction(tx => {\n /** @description onPromiseRejected */\n this._value.set(new PromiseResult(undefined, error), tx);\n });\n throw error;\n });\n }\n}\nclass PromiseResult {\n constructor(\n /**\n * The value of the resolved promise.\n * Undefined if the promise rejected.\n */\n data, \n /**\n * The error in case of a rejected promise.\n * Undefined if the promise resolved.\n */\n error) {\n this.data = data;\n this.error = error;\n }\n /**\n * Returns the value if the promise resolved, otherwise throws the error.\n */\n getDataOrThrow() {\n if (this.error) {\n throw this.error;\n }\n return this.data;\n }\n}\n/**\n * A lazy promise whose state is observable.\n */\nclass ObservableLazyPromise {\n constructor(_computePromise) {\n this._computePromise = _computePromise;\n this._lazyValue = new ObservableLazy(() => new ObservablePromise(this._computePromise()));\n /**\n * Does not enforce evaluation of the promise compute function.\n * Is undefined if the promise has not been computed yet.\n */\n this.cachedPromiseResult = derived(this, reader => this._lazyValue.cachedValue.read(reader)?.promiseResult.read(reader));\n }\n getPromise() {\n return this._lazyValue.getValue().promise;\n }\n}\n\nexport { ObservableLazy, ObservableLazyPromise, ObservablePromise, PromiseResult };\n//# sourceMappingURL=promise.js.map\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 { DebugNameData } from '../debugName.js';\nimport { CancellationError, CancellationTokenSource } from '../commonFacade/cancellation.js';\nimport { strictEquals } from '../commonFacade/deps.js';\nimport { autorun } from '../reactions/autorun.js';\nimport { Derived } from '../observables/derivedImpl.js';\nimport { DebugLocation } from '../debugLocation.js';\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 *--------------------------------------------------------------------------------------------*/\nfunction waitForState(observable, predicate, isError, cancellationToken) {\n if (!predicate) {\n predicate = state => state !== null && state !== undefined;\n }\n return new Promise((resolve, reject) => {\n let isImmediateRun = true;\n let shouldDispose = false;\n const stateObs = observable.map(state => {\n /** @description waitForState.state */\n return {\n isFinished: predicate(state),\n error: isError ? isError(state) : false,\n state\n };\n });\n const d = autorun(reader => {\n /** @description waitForState */\n const { isFinished, error, state } = stateObs.read(reader);\n if (isFinished || error) {\n if (isImmediateRun) {\n // The variable `d` is not initialized yet\n shouldDispose = true;\n }\n else {\n d.dispose();\n }\n if (error) {\n reject(error === true ? state : error);\n }\n else {\n resolve(state);\n }\n }\n });\n if (cancellationToken) {\n const dc = cancellationToken.onCancellationRequested(() => {\n d.dispose();\n dc.dispose();\n reject(new CancellationError());\n });\n if (cancellationToken.isCancellationRequested) {\n d.dispose();\n dc.dispose();\n reject(new CancellationError());\n return;\n }\n }\n isImmediateRun = false;\n if (shouldDispose) {\n d.dispose();\n }\n });\n}\nfunction derivedWithCancellationToken(computeFnOrOwner, computeFnOrUndefined) {\n let computeFn;\n let owner;\n if (computeFnOrUndefined === undefined) {\n computeFn = computeFnOrOwner;\n owner = undefined;\n }\n else {\n owner = computeFnOrOwner;\n computeFn = computeFnOrUndefined;\n }\n let cancellationTokenSource = undefined;\n return new Derived(new DebugNameData(owner, undefined, computeFn), r => {\n if (cancellationTokenSource) {\n cancellationTokenSource.dispose();\n }\n cancellationTokenSource = new CancellationTokenSource();\n return computeFn(r, cancellationTokenSource.token);\n }, undefined, () => cancellationTokenSource?.dispose(), strictEquals, DebugLocation.ofCaller());\n}\n\nexport { derivedWithCancellationToken, waitForState };\n//# sourceMappingURL=utilsCancellation.js.map\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 { BugIndicatingError } from './commonFacade/deps.js';\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/**\n * Subscribes to and records changes and the last value of the given observables.\n * Don't use the key \"changes\", as it is reserved for the changes array!\n*/\nfunction recordChanges(obs) {\n return {\n createChangeSummary: (_previousChangeSummary) => {\n return {\n changes: [],\n };\n },\n handleChange(ctx, changeSummary) {\n for (const key in obs) {\n if (ctx.didChange(obs[key])) {\n changeSummary.changes.push({ key, change: ctx.change });\n }\n }\n return true;\n },\n beforeUpdate(reader, changeSummary) {\n for (const key in obs) {\n if (key === 'changes') {\n throw new BugIndicatingError('property name \"changes\" is reserved for change tracking');\n }\n changeSummary[key] = obs[key].read(reader);\n }\n }\n };\n}\n/**\n * Subscribes to and records changes and the last value of the given observables.\n * Don't use the key \"changes\", as it is reserved for the changes array!\n*/\nfunction recordChangesLazy(getObs) {\n let obs = undefined;\n return {\n createChangeSummary: (_previousChangeSummary) => {\n return {\n changes: [],\n };\n },\n handleChange(ctx, changeSummary) {\n if (!obs) {\n obs = getObs();\n }\n for (const key in obs) {\n if (ctx.didChange(obs[key])) {\n changeSummary.changes.push({ key, change: ctx.change });\n }\n }\n return true;\n },\n beforeUpdate(reader, changeSummary) {\n if (!obs) {\n obs = getObs();\n }\n for (const key in obs) {\n if (key === 'changes') {\n throw new BugIndicatingError('property name \"changes\" is reserved for change tracking');\n }\n changeSummary[key] = obs[key].read(reader);\n }\n }\n };\n}\n\nexport { recordChanges, recordChangesLazy };\n//# sourceMappingURL=changeTracker.js.map\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 { transaction } from '../transaction.js';\nimport { DebugNameData } from '../debugName.js';\nimport { BaseObservable } from './baseObservable.js';\nimport { DebugLocation } from '../debugLocation.js';\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 *--------------------------------------------------------------------------------------------*/\nfunction observableSignalFromEvent(owner, event, debugLocation = DebugLocation.ofCaller()) {\n return new FromEventObservableSignal(typeof owner === 'string' ? owner : new DebugNameData(owner, undefined, undefined), event, debugLocation);\n}\nclass FromEventObservableSignal extends BaseObservable {\n constructor(debugNameDataOrName, event, debugLocation) {\n super(debugLocation);\n this.event = event;\n this.handleEvent = () => {\n transaction((tx) => {\n for (const o of this._observers) {\n tx.updateObserver(o, this);\n o.handleChange(this, undefined);\n }\n }, () => this.debugName);\n };\n this.debugName = typeof debugNameDataOrName === 'string'\n ? debugNameDataOrName\n : debugNameDataOrName.getDebugName(this) ?? 'Observable Signal From Event';\n }\n onFirstObserverAdded() {\n this.subscription = this.event(this.handleEvent);\n }\n onLastObserverRemoved() {\n this.subscription.dispose();\n this.subscription = undefined;\n }\n get() {\n // NO OP\n }\n}\n\nexport { observableSignalFromEvent };\n//# sourceMappingURL=observableSignalFromEvent.js.map\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 { observableFromEvent } from '../observables/observableFromEvent.js';\nimport { autorun } from '../reactions/autorun.js';\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/**\n * Creates an Event from an observable that fires whenever the observable changes.\n */\nfunction eventFromObservable(observable) {\n return (listener) => {\n let isFirst = true;\n return autorun(reader => {\n observable.read(reader);\n if (isFirst) {\n isFirst = false;\n }\n else {\n listener();\n }\n });\n };\n}\nclass ValueWithChangeEventFromObservable {\n constructor(observable) {\n this.observable = observable;\n }\n get onDidChange() {\n return eventFromObservable(this.observable);\n }\n get value() {\n return this.observable.get();\n }\n}\nfunction observableFromValueWithChangeEvent(owner, value) {\n if (value instanceof ValueWithChangeEventFromObservable) {\n return value.observable;\n }\n return observableFromEvent(owner, value.onDidChange, () => value.value);\n}\n\nexport { ValueWithChangeEventFromObservable, observableFromValueWithChangeEvent };\n//# sourceMappingURL=valueWithChangeEvent.js.map\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 { BugIndicatingError } from '../commonFacade/deps.js';\nimport { getDebugName, DebugNameData } from '../debugName.js';\nimport { observableFromEvent } from '../observables/observableFromEvent.js';\nimport { autorunOpts } from '../reactions/autorun.js';\nimport { derivedObservableWithCache } from '../utils/utils.js';\nimport { DisposableStore } from '../../disposables.js';\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/**\n * Creates an observable that has the latest changed value of the given observables.\n * Initially (and when not observed), it has the value of the last observable.\n * When observed and any of the observables change, it has the value of the last changed observable.\n * If multiple observables change in the same transaction, the last observable wins.\n*/\nfunction latestChangedValue(owner, observables) {\n if (observables.length === 0) {\n throw new BugIndicatingError();\n }\n let hasLastChangedValue = false;\n let lastChangedValue = undefined;\n const result = observableFromEvent(owner, cb => {\n const store = new DisposableStore();\n for (const o of observables) {\n store.add(autorunOpts({ debugName: () => getDebugName(result, new DebugNameData(owner, undefined, undefined)) + '.updateLastChangedValue' }, reader => {\n hasLastChangedValue = true;\n lastChangedValue = o.read(reader);\n cb();\n }));\n }\n store.add({\n dispose() {\n hasLastChangedValue = false;\n lastChangedValue = undefined;\n },\n });\n return store;\n }, () => {\n if (hasLastChangedValue) {\n return lastChangedValue;\n }\n else {\n return observables[observables.length - 1].get();\n }\n });\n return result;\n}\n/**\n * Works like a derived.\n * However, if the value is not undefined, it is cached and will not be recomputed anymore.\n * In that case, the derived will unsubscribe from its dependencies.\n*/\nfunction derivedConstOnceDefined(owner, fn) {\n return derivedObservableWithCache(owner, (reader, lastValue) => lastValue ?? fn(reader));\n}\n\nexport { derivedConstOnceDefined, latestChangedValue };\n//# sourceMappingURL=utils.js.map\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 { BugIndicatingError } from '../commonFacade/deps.js';\nimport { derived } from '../observables/derived.js';\nimport { observableSignalFromEvent } from '../observables/observableSignalFromEvent.js';\nimport { keepObserved } from '../utils/utils.js';\n\n/**\n * Wraps an observable so that its source remains observed for a grace period\n * after the wrapping observable loses all its observers.\n *\n * When the wrapping observable has observers, an autorun keeps `obs` observed\n * and forwards changes. When the last observer is removed, `obs` stays observed\n * via `keepObserved` for `maxIdleTimeMs` before being released. If a new observer\n * arrives during the grace period, the keep-alive is cancelled seamlessly.\n *\n * @param store - Controls the hard lifetime; disposing it cancels any pending grace period.\n * @param obs - The source observable to keep alive longer.\n * @param maxIdleTimeMs - Grace period in milliseconds.\n */\nfunction deferUnobserve(store, obs, maxIdleTimeMs) {\n let keepAliveHandle;\n let timeoutHandle;\n let disposed = false;\n const lifetimeTracker = observableSignalFromEvent('deferUnobserve', _ => {\n if (disposed) {\n throw new BugIndicatingError('deferUnobserve: Cannot add observer after disposal');\n }\n // First observer added to `lifetimeTracker`\n if (timeoutHandle !== undefined) {\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n if (!keepAliveHandle) {\n keepAliveHandle = keepObserved(obs);\n }\n return {\n dispose() {\n // Keep source observed during the grace period\t\n timeoutHandle = setTimeout(() => {\n timeoutHandle = undefined;\n keepAliveHandle?.dispose();\n keepAliveHandle = undefined;\n }, maxIdleTimeMs);\n },\n };\n });\n store.add({\n dispose() {\n if (timeoutHandle !== undefined) {\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n keepAliveHandle?.dispose();\n keepAliveHandle = undefined;\n disposed = true;\n },\n });\n return derived(reader => {\n lifetimeTracker.read(reader);\n return obs.read(reader);\n });\n}\n\nexport { deferUnobserve };\n//# sourceMappingURL=deferUnobserve.js.map\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 { observableValueOpts } from './observables/observableValueOpts.js';\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 *--------------------------------------------------------------------------------------------*/\nclass ObservableSet {\n constructor() {\n this._data = new Set();\n this._obs = observableValueOpts({ equalsFn: () => false }, this);\n this.observable = this._obs;\n }\n get size() {\n return this._data.size;\n }\n has(value) {\n return this._data.has(value);\n }\n add(value, tx) {\n const hadValue = this._data.has(value);\n if (!hadValue) {\n this._data.add(value);\n this._obs.set(this, tx);\n }\n return this;\n }\n delete(value, tx) {\n const result = this._data.delete(value);\n if (result) {\n this._obs.set(this, tx);\n }\n return result;\n }\n clear(tx) {\n if (this._data.size > 0) {\n this._data.clear();\n this._obs.set(this, tx);\n }\n }\n forEach(callbackfn, thisArg) {\n this._data.forEach((value, value2, _set) => {\n callbackfn.call(thisArg, value, value2, this);\n });\n }\n *entries() {\n for (const value of this._data) {\n yield [value, value];\n }\n }\n *keys() {\n yield* this._data.keys();\n }\n *values() {\n yield* this._data.values();\n }\n [Symbol.iterator]() {\n return this.values();\n }\n get [Symbol.toStringTag]() {\n return 'ObservableSet';\n }\n}\n\nexport { ObservableSet };\n//# sourceMappingURL=set.js.map\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 { observableValueOpts } from './observables/observableValueOpts.js';\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 *--------------------------------------------------------------------------------------------*/\nclass ObservableMap {\n constructor() {\n this._data = new Map();\n this._obs = observableValueOpts({ equalsFn: () => false }, this);\n this.observable = this._obs;\n }\n get size() {\n return this._data.size;\n }\n has(key) {\n return this._data.has(key);\n }\n get(key) {\n return this._data.get(key);\n }\n set(key, value, tx) {\n const hadKey = this._data.has(key);\n const oldValue = this._data.get(key);\n if (!hadKey || oldValue !== value) {\n this._data.set(key, value);\n this._obs.set(this, tx);\n }\n return this;\n }\n delete(key, tx) {\n const result = this._data.delete(key);\n if (result) {\n this._obs.set(this, tx);\n }\n return result;\n }\n clear(tx) {\n if (this._data.size > 0) {\n this._data.clear();\n this._obs.set(this, tx);\n }\n }\n forEach(callbackfn, thisArg) {\n this._data.forEach((value, key, _map) => {\n callbackfn.call(thisArg, value, key, this);\n });\n }\n *entries() {\n yield* this._data.entries();\n }\n *keys() {\n yield* this._data.keys();\n }\n *values() {\n yield* this._data.values();\n }\n [Symbol.iterator]() {\n return this.entries();\n }\n get [Symbol.toStringTag]() {\n return 'ObservableMap';\n }\n}\n\nexport { ObservableMap };\n//# sourceMappingURL=map.js.map\n"],"names":["LazyObservableValue","BaseObservable","_debugNameData","initialValue","_equalityComparator","debugLocation","change","getLogger","observer","observers","r","shouldCallBeginUpdate","shouldCallEndUpdate","value","tx","_tx","TransactionImpl","observable","newValue","observableValueOpts","options","DebugLocation","DebugNameData","strictEquals","ObservableValue","ObservableLazy","_computeValue","observableValue","v","ObservablePromise","fn","promise","derived","reader","result","transaction","PromiseResult","error","data","ObservableLazyPromise","_computePromise","waitForState","predicate","isError","cancellationToken","state","resolve","reject","isImmediateRun","shouldDispose","stateObs","d","autorun","isFinished","dc","CancellationError","derivedWithCancellationToken","computeFnOrOwner","computeFnOrUndefined","computeFn","owner","cancellationTokenSource","Derived","CancellationTokenSource","recordChanges","obs","_previousChangeSummary","ctx","changeSummary","key","BugIndicatingError","recordChangesLazy","getObs","observableSignalFromEvent","event","FromEventObservableSignal","debugNameDataOrName","o","eventFromObservable","listener","isFirst","ValueWithChangeEventFromObservable","observableFromValueWithChangeEvent","observableFromEvent","latestChangedValue","observables","hasLastChangedValue","lastChangedValue","cb","store","DisposableStore","autorunOpts","getDebugName","derivedConstOnceDefined","derivedObservableWithCache","lastValue","deferUnobserve","maxIdleTimeMs","keepAliveHandle","timeoutHandle","disposed","lifetimeTracker","_","keepObserved","ObservableSet","callbackfn","thisArg","value2","_set","ObservableMap","hadKey","oldValue","_map"],"mappings":";;AAeA,MAAMA,UAA4BC,EAAe;AAAA,EAC7C,IAAI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