{"version":3,"sources":["../src/publishers/Publisher.ts","../src/sinks/BackpressureSink.ts","../src/sinks/OneSink.ts","../src/sinks/ManySink.ts","../src/sinks/ReplaySink.ts","../src/sinks/ReplayAllSink.ts","../src/sinks/ReplayLatestSink.ts","../src/sinks/ReplayLimitSink.ts","../src/sinks/index.ts","../src/publishers/PipePublisher.ts","../src/utils/index.ts","../src/schedulers/MicroScheduler.ts","../src/schedulers/DelayScheduler.ts","../src/publishers/Flux.ts","../src/publishers/Mono.ts","../src/schedulers/ImmediateScheduler.ts","../src/schedulers/MacroScheduler.ts","../src/schedulers/IntervalScheduler.ts","../src/schedulers/index.ts"],"sourcesContent":["import {EmitAction} from \"@/sinks/BackpressureSink\";\nimport {Subscriber} from \"@/subscriptions/Subscriber\";\nimport {Subscription} from \"@/subscriptions/Subscription\";\n\n/**\n * Represents a generic publisher that can subscribe to a data stream.\n * @template T - The type of data being published.\n */\nexport interface Publisher<T> {\n    /**\n     * Subscribes a subscriber to the publisher.\n     * @param {Subscriber<T>} subscriber - The subscriber to receive published data.\n     * @returns {Subscription} A subscription object to manage the subscriber's lifecycle.\n     */\n    subscribe(subscriber: Subscriber<T>): Subscription\n}\n\n/**\n * A publisher that supports backpressure handling.\n * Ensures that the subscriber receives data only as requested, preventing data loss or overflow.\n * @template T - The type of data being published.\n */\nexport class BackpressurePublisher<T> implements Publisher<T> {\n    private backpressure: Array<EmitAction<T>> = []\n    private subscriber?: Subscriber<T>\n    private requested: number = 0;\n    private subscription: Subscription\n\n    public constructor(sink: Publisher<T>) {\n        this.subscription = sink.subscribe({\n            onNext: (value: T) => {\n                this.backpressure.push({emit: 'next', data: value})\n                this.flush()\n            },\n            onError: (error: Error) => {\n                this.backpressure.push({emit: 'error', data: error})\n                this.flush()\n            },\n            onComplete: () => {\n                this.subscription.unsubscribe()\n                this.backpressure.push({emit: 'complete'})\n                this.flush()\n            }\n        })\n        this.subscription.request(Number.MAX_SAFE_INTEGER)\n    }\n\n    /**\n     * Subscribes a subscriber to this publisher.\n     * Throws an error if a subscriber is already registered (unicast).\n     * @param {Subscriber<T>} subscriber - The subscriber to receive data.\n     * @returns {Subscription} A subscription for managing data flow and lifecycle.\n     * @throws {Error} If the publisher already has a subscriber.\n     */\n    public subscribe(subscriber: Subscriber<T>): Subscription {\n        if (this.subscriber != null) throw new Error(\"Backpressure unicast publisher is not accepting new subscribers\")\n        this.subscriber = subscriber;\n        return {\n            request: (count: number) => {\n                this.requested += count\n                this.flush()\n            },\n            unsubscribe: () => {\n                this.backpressure = []\n                this.subscription.unsubscribe()\n            }\n        };\n    }\n\n    private emit(action: EmitAction<T>) {\n        switch (action.emit) {\n            case \"next\": {\n                try {\n                    this.subscriber?.onNext(action.data as T)\n                } catch (error) {\n                    this.subscriber?.onError(error as Error)\n                }\n                break;\n            }\n            case \"error\": {\n                this.subscriber?.onError(action.data as Error)\n                break;\n            }\n            case \"complete\": {\n                this.subscriber?.onComplete()\n            }\n        }\n    }\n\n    private flush() {\n        while (this.requested > 0 && this.backpressure.length > 0) {\n            this.requested--\n            this.emit(this.backpressure.shift() as EmitAction<T>)\n        }\n        if (this.subscriber != null && this.backpressure[0]?.emit == 'complete') {\n            this.emit(this.backpressure.shift() as EmitAction<T>)\n        }\n    }\n\n}","import {Publisher} from \"@/publishers/Publisher\";\nimport {Sink} from \"@/sinks/Sink\";\nimport {Subscriber} from \"@/subscriptions/Subscriber\";\nimport {Subscription} from \"@/subscriptions/Subscription\";\n\n/**\n * Represents a backpressure control structure.\n * Stores the subscriber, buffered data, and the number of requested items.\n *\n * @template T - The type of data being processed.\n */\ntype Backpressure<T> = {\n    subscriber: Subscriber<T>\n    data: EmitAction<T>[]\n    requested: number;\n}\n\n/**\n * Represents an action emitted by the sink.\n * Contains the type of emission (next, error, complete) and the associated data.\n *\n * @template T - The type of data being emitted.\n */\nexport type EmitAction<T> = {\n    emit: 'next' | 'error' | 'complete'\n    data?: T | Error\n}\n\n/**\n * An abstract sink that supports backpressure handling.\n * Manages the flow of data to multiple subscribers while respecting backpressure demands.\n *\n * @template T - The type of data being emitted.\n */\nexport abstract class BackpressureSink<T> implements Sink<T>, Publisher<T> {\n    protected readonly subscribers = new Set<Backpressure<T>>()\n    protected completed = false\n\n    /**\n     * Subscribes a subscriber to the sink with backpressure handling.\n     *\n     * @param {Subscriber<T>} subscriber - The subscriber to add.\n     * @returns {Subscription} The subscription object for managing the subscriber's lifecycle.\n     */\n    public subscribe(subscriber: Subscriber<T>): Subscription {\n        // if (this.completed) throw new Error('The completed sink is not accepting new subscribers.')\n        const backpressure: Backpressure<T> = {\n            subscriber: subscriber,\n            data: [],\n            requested: 0,\n        }\n\n        this.subscribers.add(backpressure)\n\n        return {\n            /**\n             * Requests a specific number of items from the sink.\n             * Increments the requested count and triggers data flushing.\n             * @param {number} count - The number of items to request.\n             */\n            request: (count: number) => {\n                backpressure.requested += count\n                this.flush(backpressure)\n            },\n            /**\n             * Unsubscribes from the sink, clearing the buffered data.\n             */\n            unsubscribe: () => {\n                backpressure.data = []\n                this.subscribers.delete(backpressure)\n            }\n        }\n    }\n\n    /**\n     * Emits the next value to all subscribers.\n     * Validates emission and triggers flushing of buffered data.\n     *\n     * @param {T} value - The value to emit.\n     * @throws {Error} If the sink has already completed.\n     */\n    public next(value: T): void {\n        this.validateEmit()\n        for (const subscriber of this.subscribers) {\n            subscriber.data.push({emit: 'next', data: value})\n            this.flush(subscriber)\n        }\n    }\n\n    /**\n     * Emits an error to all subscribers and marks the sink as completed.\n     *\n     * @param {Error} error - The error to emit.\n     * @throws {Error} If the sink has already completed.\n     */\n    public error(error: Error): void {\n        this.validateEmit()\n        for (const subscriber of this.subscribers) {\n            subscriber.data.push({emit: 'error', data: error})\n            this.flush(subscriber)\n        }\n    }\n\n    /**\n     * Completes the sink, notifying all subscribers.\n     * Prevents further emissions and clears the subscriber set.\n     */\n    public complete(): void {\n        if (this.completed) return\n        this.completed = true;\n        for (const subscriber of this.subscribers) {\n            subscriber.data.push({emit: 'complete'})\n            this.flush(subscriber)\n        }\n        this.subscribers.clear()\n    }\n\n    /**\n     * Emits an action to a specific subscriber.\n     * Handles 'next', 'error', and 'complete' emissions.\n     *\n     * @protected\n     * @param {EmitAction<T>} action - The action to be emitted.\n     * @param {Subscriber<T>} subscriber - The subscriber to receive the action.\n     */\n    protected emit(action: EmitAction<T>, subscriber: Subscriber<T>) {\n        switch (action.emit) {\n            case \"next\": {\n                try {\n                    subscriber.onNext(action.data as T)\n                } catch (error) {\n                    subscriber.onError(error as Error)\n                }\n                break;\n            }\n            case \"error\": {\n                subscriber.onError(action.data as Error)\n                break;\n            }\n            case \"complete\": {\n                subscriber.onComplete()\n            }\n        }\n    }\n\n    /**\n     * Validates whether the sink can emit new data.\n     * Throws an error if the sink has already completed.\n     *\n     * @protected\n     * @throws {Error} If the sink has already completed.\n     */\n    protected validateEmit() {\n        if (this.completed) throw new Error('The completed sink is not accepting new emits.')\n    }\n\n    /**\n     * Flushes buffered data to the subscriber based on the requested count.\n     * Ensures that only the requested number of items are sent.\n     *\n     * @private\n     * @param {Backpressure<T>} backpressure - The backpressure object for the subscriber.\n     */\n    private flush(backpressure: Backpressure<T>) {\n        const data = backpressure.data;\n        while (backpressure.requested > 0 && data.length > 0) {\n            backpressure.requested--\n            this.emit(data.shift() as EmitAction<T>, backpressure.subscriber)\n        }\n        if (data.length > 0 && data[0].emit == \"complete\") {\n            backpressure.requested++\n            this.flush(backpressure)\n        }\n    }\n}","import {BackpressureSink} from \"@/sinks/BackpressureSink\";\nimport {Subscriber} from \"@/subscriptions/Subscriber\";\nimport {Subscription} from \"@/subscriptions/Subscription\";\n\n/**\n * A sink that only allows a single subscriber and emits one value before completing.\n * Extends `BackpressureSink` and enforces a unicast pattern.\n * Suitable for scenarios where only one data emission is expected.\n *\n * @template T - The type of data being emitted.\n */\nexport default class OneSink<T> extends BackpressureSink<T> {\n    /**\n     * Subscribes a single subscriber to the sink.\n     * Throws an error if a second subscriber attempts to subscribe.\n     *\n     * @param {Subscriber<T>} subscriber - The subscriber to add.\n     * @returns {Subscription} The subscription object for managing the subscriber's lifecycle.\n     * @throws {Error} If more than one subscriber attempts to subscribe.\n     */\n    public override subscribe(subscriber: Subscriber<T>): Subscription {\n        if (this.subscribers.size > 0) {\n            throw new Error(\"Only one subscriber is allowed for OneSink.\")\n        }\n        return super.subscribe(subscriber)\n    }\n\n    /**\n     * Emits a single value and immediately completes the stream.\n     * Suitable for cases where only one value is expected.\n     *\n     * @param {T} value - The value to emit.\n     */\n    public override next(value: T): void {\n        super.next(value)\n        this.complete()\n    }\n\n    /**\n     * Emits an error and immediately completes the stream.\n     * Ensures that the stream is closed after an error is emitted.\n     *\n     * @param {Error} error - The error to emit.\n     */\n    public error(error: Error): void {\n        super.error(error)\n        this.complete()\n    }\n}\n","import {BackpressureSink} from \"@/sinks/BackpressureSink\";\n\n/**\n * A sink that supports multiple subscribers and handles backpressure.\n * Extends `BackpressureSink` to allow broadcasting emitted values to multiple subscribers.\n *\n * @template T - The type of data being emitted.\n */\nexport default class ManySink<T> extends BackpressureSink<T> {\n    // Inherits all behavior from BackpressureSink without any modifications.\n}","import ManySink from \"@/sinks/ManySink\";\nimport {EmitAction} from \"@/sinks/BackpressureSink\";\nimport {Subscriber} from \"@/subscriptions/Subscriber\";\nimport {Subscription} from \"@/subscriptions/Subscription\";\n\n/**\n * A sink that stores emitted values and replays them to new subscribers.\n * Extends the `ManySink` to support replaying previously emitted events.\n * Useful in scenarios where late subscribers need to receive historical data.\n *\n * @template T - The type of data being emitted.\n */\nexport abstract class ReplaySink<T> extends ManySink<T> {\n    readonly buffer: EmitAction<T>[] = []\n\n    /**\n     * Emits a value to all current subscribers and stores it in the buffer for future replay.\n     * @param {T} value - The value to emit.\n     */\n    public override next(value: T): void {\n        super.next(value)\n        this.store('next', value)\n    }\n\n    /**\n     * Emits an error to all current subscribers and stores it in the buffer for future replay.\n     * @param {Error} error - The error to emit.\n     */\n    public override error(error: Error) {\n        super.error(error);\n        this.store('error', error)\n    }\n\n    /**\n     * Signals the completion of the data stream to all current subscribers.\n     * Stores the completion event in the buffer for future replay.\n     */\n    public override complete() {\n        super.complete();\n        this.store(\"complete\")\n    }\n\n    /**\n     * Subscribes a subscriber to the sink.\n     * Replays all buffered emits to the new subscriber upon subscription.\n     * @param {Subscriber<T>} subscriber - The subscriber to add.\n     * @returns {Subscription} The subscription object for managing the subscriber's lifecycle.\n     */\n    public override subscribe(subscriber: Subscriber<T>): Subscription {\n        let left = this.buffer.length\n        if(left == 0) return super.subscribe(subscriber)\n        const replay = new ManySink<T>()\n        const i = replay.subscribe(subscriber)\n        for (const action of this.buffer) replay[action.emit](action.data as any)\n        const o = super.subscribe({\n            onNext: value => {\n                replay.next(value)\n            },\n            onError: error => {\n                replay.error(error)\n            },\n            onComplete: () => {\n                replay.complete()\n            }\n        })\n        return {\n            request(count: number) {\n                i.request(count)\n                left = left - count\n                if(left < 0) {\n                    o.request(left * -1)\n                    left = 0\n                }\n            },\n            unsubscribe() {\n                i.unsubscribe()\n                o.unsubscribe()\n            }\n        }\n    }\n\n    /**\n     * Stores an emitted action (next, error, complete) in the buffer.\n     * @protected\n     * @param {'next' | 'error' | 'complete'} emit - The type of emission.\n     * @param {T | Error} [data] - The data associated with the emission, if any.\n     */\n    protected store(emit: 'next' | 'error' | 'complete', data?: T | Error) {\n        this.buffer.push({emit, data})\n    }\n}","import {ReplaySink} from \"@/sinks/ReplaySink\";\n\n/**\n * A replay sink that retains all emitted events indefinitely.\n * Extends `ReplaySink` to store every event without any limitation.\n *\n * @template T - The type of data being emitted.\n */\nexport class ReplayAllSink<T> extends ReplaySink<T> {\n    // Inherits all behavior from ReplaySink without any modifications.\n}\n","import {ReplaySink} from \"@/sinks/ReplaySink\";\n\n/**\n * A replay sink that only retains the latest emitted events up to a specified limit.\n * Extends `ReplaySink` to store a fixed number of the most recent events.\n *\n * @template T - The type of data being emitted.\n */\nexport class ReplayLatestSink<T> extends ReplaySink<T> {\n    /**\n     * Creates a new `ReplayLatestSink` with a specified limit on the number of stored events.\n     * Ensures that only the most recent events are kept, discarding older ones.\n     *\n     * @param {number} limit - The maximum number of recent events to retain.\n     * @throws {Error} If the limit is less than 1.\n     */\n    public constructor(private readonly limit: number) {\n        super()\n        if (limit < 1) throw new Error(\"LatestSink: limit must be > 0\")\n    }\n\n    /**\n     * Stores an emitted action (next, error, complete) in the buffer.\n     * Keeps only the most recent events, removing older ones when the limit is exceeded.\n     *\n     * @protected\n     * @param {'next' | 'error' | 'complete'} emit - The type of emission.\n     * @param {T | Error} [data] - The data associated with the emission, if any.\n     */\n    protected override store(emit: \"next\" | \"error\" | \"complete\", data?: Error | T) {\n        super.store(emit, data)\n        if (this.buffer.length > this.limit) this.buffer.shift()\n    }\n}","import {ReplaySink} from \"@/sinks/ReplaySink\";\n\n/**\n * A replay sink that limits the number of stored events.\n * Extends `ReplaySink` to restrict the buffer size to a specified limit.\n *\n * @template T - The type of data being emitted.\n */\nexport class ReplayLimitSink<T> extends ReplaySink<T> {\n    /**\n     * Creates a new `ReplayLimitSink` with a specified limit on the number of stored events.\n     * Throws an error if the limit is less than 1.\n     *\n     * @param {number} limit - The maximum number of events to retain in the buffer.\n     * @throws {Error} If the limit is less than 1.\n     */\n    public constructor(private readonly limit: number) {\n        super()\n        if (limit < 1) throw new Error(\"LimitSink: limit must be > 0\")\n    }\n\n    /**\n     * Stores an emitted action (next, error, complete) in the buffer.\n     * Ensures that the buffer does not exceed the specified limit.\n     * @protected\n     * @param {'next' | 'error' | 'complete'} emit - The type of emission.\n     * @param {T | Error} [data] - The data associated with the emission, if any.\n     */\n    protected override store(emit: \"next\" | \"error\" | \"complete\", data?: Error | T) {\n        if (this.buffer.length < this.limit) super.store(emit, data)\n    }\n}","import {Sink} from \"@/sinks/Sink\";\nimport OneSink from \"@/sinks/OneSink\";\nimport ManySink from \"@/sinks/ManySink\";\nimport {ReplayAllSink} from \"@/sinks/ReplayAllSink\";\nimport {ReplayLatestSink} from \"@/sinks/ReplayLatestSink\";\nimport {ReplayLimitSink} from \"@/sinks/ReplayLimitSink\";\n\nexport {type Sink, OneSink, ManySink, ReplayAllSink, ReplayLatestSink, ReplayLimitSink}\n/**\n * A collection of commonly used sinks for data emission and subscription management.\n * Provides factory functions for creating instances of various sink types.\n */\nexport const Sinks = {\n    /**\n     * Creates a new `OneSink` instance.\n     * Suitable for single-value emissions with unicast behavior.\n     *\n     * @template T - The type of data being emitted.\n     * @returns {OneSink<T>} An instance of `OneSink`.\n     */\n    one: <T>(): OneSink<T> => new OneSink(),\n    many: () => ({\n        /**\n         * Creates a new `ManySink` instance for multicast data emission.\n         * Allows broadcasting data to multiple subscribers.\n         *\n         * @template T - The type of data being emitted.\n         * @returns {ManySink<T>} An instance of `ManySink`.\n         */\n        multicast: <T>(): ManySink<T> => new ManySink(),\n        replay: () => ({\n            /**\n             * Creates a `ReplayAllSink` instance that stores all emitted events.\n             * Allows replaying the entire event history to new subscribers.\n             *\n             * @template T - The type of data being emitted.\n             * @returns {ReplayAllSink<T>} An instance of `ReplayAllSink`.\n             */\n            all: <T>(): ReplayAllSink<T> => new ReplayAllSink(),\n            /**\n             * Creates a `ReplayLatestSink` instance that stores the most recent N events.\n             * Allows replaying the latest events to new subscribers.\n             *\n             * @template T - The type of data being emitted.\n             * @param {number} limit - The maximum number of recent events to retain.\n             * @returns {ReplayLatestSink<T>} An instance of `ReplayLatestSink`.\n             * @throws {Error} If the limit is less than 1.\n             */\n            latest: <T>(limit: number): ReplayLatestSink<T> => new ReplayLatestSink(limit),\n            /**\n             * Creates a `ReplayLimitSink` instance that stores up to a specified number of events.\n             * Useful when keeping the entire event history is unnecessary.\n             *\n             * @template T - The type of data being emitted.\n             * @param {number} limit - The maximum number of events to retain.\n             * @returns {ReplayLimitSink<T>} An instance of `ReplayLimitSink`.\n             * @throws {Error} If the limit is less than 1.\n             */\n            limit: <T>(limit: number): ReplayLimitSink<T> => new ReplayLimitSink(limit)\n        })\n    })\n}","import {BackpressurePublisher, Publisher} from \"@/publishers/Publisher\";\nimport {Subscriber} from \"@/subscriptions/Subscriber\";\nimport {Subscription} from \"@/subscriptions/Subscription\";\nimport {Scheduler} from \"@/schedulers/Scheduler\";\nimport {OneSink, Sink} from \"@/sinks\";\n\n/**\n * An interface representing a publisher that supports data transformation and manipulation through pipes.\n * @template T - The type of data being published.\n */\nexport interface PipePublisher<T> extends Publisher<T> {\n    /**\n     * Pipes the data through custom transformations.\n     * @template R - The result type after processing.\n     * @param {Function} producer - The function to produce new values.\n     * @param {Function} onSubscribe - Callback on subscription.\n     * @param {Function} onRequest - Callback on request.\n     * @param {Function} onUnsubscribe - Callback on unsubscribe.\n     * @returns {PipePublisher<R>} A new pipe publisher with transformed data.\n     */\n    pipe<R>(producer: (onNext: (value: R) => void, onError: (error: Error) => void, onComplete: () => void) => void, onRequest: (request: number) => void, onUnsubscribe: () => void): PipePublisher<R>\n\n    /**\n     * Transforms each emitted value using the given function.\n     * @template R - The transformed data type.\n     * @param {Function} fn - The mapping function.\n     * @returns {PipePublisher<R>} A new pipe publisher with mapped data.\n     */\n    map<R>(fn: (value: T) => R): PipePublisher<R>\n\n    /**\n     * Transforms each emitted value and filter transform result.\n     * @template R - The transformed data type.\n     * @param {Function} fn - The mapping function that can return null or undefined.\n     * @returns {PipePublisher<R>} A new pipe publisher with mapped non-null data.\n     */\n    mapNotNull<R>(fn: (value: T) => R | null | undefined): PipePublisher<R>\n\n    /**\n     * Transforms the value using a function that returns a new publisher.\n     * @template R - The resulting data type.\n     * @param {Function} fn - The function to transform values into new publishers.\n     * @returns {PipePublisher<R>} A pipe publisher that flattens the result.\n     */\n    flatMap<R>(fn: (value: T) => Publisher<R>): PipePublisher<R>\n\n    /**\n     * Filters emitted values using a given predicate.\n     * @param {Function} predicate - The function to determine whether to emit a value.\n     * @returns {PipePublisher<T>} A new pipe publisher with filtered data.\n     */\n    filter(predicate: (value: T) => boolean): PipePublisher<T>\n\n    /**\n     * Filters emitted values based on a publisher that returns a boolean.\n     * @param {Function} predicate - A function returning a boolean publisher.\n     * @returns {PipePublisher<T>} A new pipe publisher with conditional data.\n     */\n    filterWhen(predicate: (value: T) => Publisher<boolean>): PipePublisher<T>\n\n    /**\n     * Casts the current publisher to another type.\n     * @template R - The target type.\n     * @returns {PipePublisher<R>} The casted pipe publisher.\n     */\n    cast<R>(): PipePublisher<R>\n\n    /**\n     * Switches to an alternative publisher if the current one is empty.\n     * @param {Publisher<T>} alternative - The alternative publisher.\n     * @returns {PipePublisher<T>} A new pipe publisher.\n     */\n    switchIfEmpty(alternative: Publisher<T>): PipePublisher<T>\n\n    /**\n     * Continues with a replacement publisher if an error occurs.\n     * @param {Publisher<T>} replacement - The publisher to switch to on error.\n     * @returns {PipePublisher<T>} A new pipe publisher.\n     */\n    onErrorReturn(replacement: Publisher<T>): PipePublisher<T>\n\n    /**\n     * Continues processing even if an error occurs based on a predicate.\n     * @param {Function} predicate - Function to determine whether to continue on error.\n     * @returns {PipePublisher<T>} A new pipe publisher.\n     */\n    onErrorContinue(predicate: (error: Error) => boolean): PipePublisher<T>\n\n    /**\n     * Executes a function when the first value is emitted.\n     * @param {Function} fn - The function to execute.\n     * @returns {PipePublisher<T>} A new pipe publisher.\n     */\n    doFirst(fn: () => void): PipePublisher<T>\n\n    /**\n     * Executes a function when each value is emitted.\n     * @param {Function} fn - The function to execute on each value.\n     * @returns {PipePublisher<T>} A new pipe publisher.\n     */\n    doOnNext(fn: (value: T) => void): PipePublisher<T>\n\n    /**\n     * Executes a function when each error is emitted.\n     * @param {Function} fn - The function to execute on each error.\n     * @returns {PipePublisher<T>} A new pipe publisher.\n     */\n    doOnError(fn: (value: Error) => void): PipePublisher<T>\n\n    /**\n     * Executes a function when the stream completes.\n     * @param {Function} fn - The function to execute on completion.\n     * @returns {PipePublisher<T>} A new pipe publisher.\n     */\n    doFinally(fn: () => void): PipePublisher<T>\n\n    /**\n     * Executes a function when a subscription occurs.\n     * @param {Function} fn - The function to execute on subscription.\n     * @returns {PipePublisher<T>} A new pipe publisher.\n     */\n    doOnSubscribe(fn: (subscription: Subscription) => void): PipePublisher<T>\n\n    /**\n     * Publishes values on a specified scheduler.\n     * @param {Scheduler} scheduler - The scheduler to use.\n     * @returns {PipePublisher<T>} A new pipe publisher.\n     */\n    publishOn(scheduler: Scheduler): PipePublisher<T>\n\n    /**\n     * Subscribes to the stream on a specified scheduler.\n     * @param {Scheduler} scheduler - The scheduler to use.\n     * @returns {PipePublisher<T>} A new pipe publisher.\n     */\n    subscribeOn(scheduler: Scheduler): PipePublisher<T>\n}\n\n/**\n * Abstract base class for pipe publishers.\n * Implements common functionalities while allowing customization.\n * @template T - The type of data being published.\n */\nexport abstract class AbstractPipePublisher<T> implements PipePublisher<T> {\n    private unsubscribeOnComplete = true\n    private onSubscribe?: (subscription: Subscription) => void\n\n    protected constructor(protected readonly publisher: Publisher<T>) {\n    }\n\n    public subscribe({\n                         onNext = (value: T) => {\n                         },\n                         onError = (error: Error) => {\n                         },\n                         onComplete = () => {\n                         }\n                     } = {}): Subscription {\n        const subscription = this.publisher.subscribe({\n            onNext, onError, onComplete: () => {\n                onComplete()\n                if (this.unsubscribeOnComplete) subscription.unsubscribe()\n            }\n        })\n        this.onSubscribe?.(subscription)\n        return subscription\n    }\n\n    private canEmitMany() {\n        return !(Reflect.construct(Reflect.getPrototypeOf(this)!.constructor, [null]).createSink() instanceof OneSink)\n    }\n\n    public pipe<R>(producer: (onNext: (value: R) => void, onError: (error: Error) => void, onComplete: () => void) => void, onRequest?: (request: number) => void, onUnsubscribe?: () => void, constructor?: new (publisher: Publisher<R>) => AbstractPipePublisher<R>): PipePublisher<R> {\n        // todo сделать так, чтобы конечный пайп мог быть inline, для большего удобства\n        const sink = Reflect.construct(constructor || Reflect.getPrototypeOf(this)!.constructor, [null]).createSink();\n        const many = !(sink instanceof OneSink)\n        const unicast = new class _ extends BackpressurePublisher<R> {\n            public override subscribe(subscriber: Subscriber<R>): Subscription {\n                try {\n                    producer(value => {\n                            if (many && value == null) onRequest?.(1)\n                            else sink.next(value)\n                        },\n                        error => {\n                            sink.error(error)\n                            onRequest?.(1)\n                        },\n                        () => sink.complete())\n                } catch (error) {\n                    sink.error(error as Error)\n                }\n                const sub = super.subscribe(subscriber)\n                return {\n                    request(count: number) {\n                        sub.request(count)\n                        onRequest?.(count)\n                    },\n                    unsubscribe() {\n                        sub.unsubscribe()\n                        onUnsubscribe?.()\n                    }\n                };\n            }\n        }(sink);\n        return this.wrap(unicast, constructor)\n    }\n\n    public map<R>(fn: (value: T) => R): PipePublisher<R> {\n        let sub: Subscription;\n        return this.pipe((onNext, onError, onComplete) =>\n            sub = this.subscribe({\n                onNext: value => onNext(fn(value)),\n                onError,\n                onComplete\n            }), request => sub?.request(request), () => sub?.unsubscribe())\n    }\n\n    public mapNotNull<R>(fn: (value: T) => R | null | undefined): PipePublisher<R> {\n        return this.map(fn).filter((v): v is R => v != null) as PipePublisher<R>\n    }\n\n    public flatMap<R>(fn: (value: T) => Publisher<R>): PipePublisher<R> {\n        // TODO избавится от Promise и сделать синхронно\n        let subscriptions: Subscription[] = [];\n        let promises: Promise<void>[] = []\n        return this.pipe((onNext, onError, onComplete) => {\n            const sub = this.subscribe({\n                onNext: (value) => {\n                    promises.push(new Promise(resolve => {\n                            let s\n                            subscriptions.push(s = fn(value).subscribe({\n                                onNext: value => {\n                                    onNext(value)\n                                }, onError, onComplete: () => {\n                                    if (this.canEmitMany()) {\n                                        sub.request(1)\n                                    }\n                                    resolve()\n                                }\n                            }))\n                            s.request(Number.MAX_SAFE_INTEGER)\n                        }\n                    ))\n                }, onError, onComplete: () => {\n                    Promise.all(promises).then(onComplete)\n                }\n            })\n            subscriptions.push(sub)\n            return sub\n        }, request => subscriptions[0]?.request(request), () => subscriptions.forEach(sub => sub.unsubscribe()))\n    }\n\n    public filter(predicate: (value: T) => boolean): PipePublisher<T> {\n        let sub: Subscription\n        return this.pipe((onNext, onError, onComplete) =>\n            sub = this.subscribe({\n                onNext: (value) => predicate(value) ? onNext(value) : this.canEmitMany() ? onNext(null as T) : onComplete(),\n                onError,\n                onComplete\n            }), request => sub?.request(request + 1), () => sub?.unsubscribe())\n    }\n\n    public filterWhen(predicate: (value: T) => Publisher<boolean>): PipePublisher<T> {\n        let sub: Subscription\n        let req = 0\n        return this.pipe((onNext, onError, onComplete) =>\n            sub = this.subscribe({\n                onNext: (value) => predicate(value).subscribe({\n                    onNext: bool => bool ? onNext(value) : this.canEmitMany() ? onNext(null as T) : onComplete(),\n                    onError,\n                    onComplete: () => this.canEmitMany() ? () => {\n                    } : onComplete\n                }).request(req), onError, onComplete\n            }), request => sub?.request(req = request + 1), () => sub?.unsubscribe())\n    }\n\n    public cast<R>(): PipePublisher<R> {\n        return this as unknown as PipePublisher<R>\n    }\n\n    public switchIfEmpty(alternative: Publisher<T>): PipePublisher<T> {\n        let sub: Subscription\n        let req = 0\n        return this.pipe((onNext, onError, onComplete) => {\n            let emitted = false;\n            sub = this.subscribe({\n                onNext(value: T) {\n                    emitted = true\n                    onNext(value)\n                },\n                onError(error: Error) {\n                    emitted = true\n                    onError(error)\n                },\n                onComplete: () => {\n                    return emitted ? onComplete() : alternative.subscribe({onNext, onError, onComplete}).request(req)\n                }\n            })\n        }, request => sub?.request(req = request), () => sub?.unsubscribe())\n    }\n\n    public onErrorReturn(replacement: Publisher<T>): PipePublisher<T> {\n        let sub: Subscription\n        let req = 0\n        return this.pipe((onNext, onError, onComplete) =>\n            sub = this.subscribe({\n                onNext,\n                onError: () => replacement.subscribe({onNext, onError, onComplete}).request(req),\n                onComplete\n            }), request => sub?.request(req = request), () => sub?.unsubscribe())\n    }\n\n    public onErrorContinue(predicate: (error: Error) => boolean): PipePublisher<T> {\n        let sub: Subscription\n        return this.pipe((onNext, onError, onComplete) =>\n            sub = this.subscribe({\n                onNext,\n                onError: error => predicate(error) ? this.canEmitMany() ? onNext(null as T) : onComplete() : onError(error),\n                onComplete\n            }), request => sub?.request(request + 1), () => sub?.unsubscribe())\n    }\n\n    public doFirst(fn: () => void): PipePublisher<T> {\n        let sub: Subscription\n        return this.pipe((onNext, onError, onComplete) => {\n                fn()\n                sub = this.subscribe({onNext, onError, onComplete})\n            }, request => sub?.request(request), () => sub?.unsubscribe()\n        )\n    }\n\n    public doOnNext(fn: (value: T) => void): PipePublisher<T> {\n        let sub: Subscription\n        return this.pipe((onNext, onError, onComplete) =>\n            sub = this.subscribe({\n                onNext: value => {\n                    fn(value)\n                    onNext(value)\n                }, onError, onComplete\n            }), request => sub?.request(request), () => sub?.unsubscribe())\n    }\n\n    public doOnError(fn: (value: Error) => void): PipePublisher<T> {\n        let sub: Subscription\n        return this.pipe((onNext, onError, onComplete) =>\n            sub = this.subscribe({\n                onNext, onError: error => {\n                    fn(error)\n                    onError(error)\n                }, onComplete\n            }), request => sub?.request(request), () => sub?.unsubscribe())\n    }\n\n    public doFinally(fn: () => void): PipePublisher<T> {\n        let sub: Subscription\n        let called = false;\n        return this.pipe((onNext, onError, onComplete) =>\n            sub = this.subscribe({\n                onNext, onError, onComplete\n            }), request => sub?.request(request), () => {\n            sub?.unsubscribe()\n            if (!called) {\n                called = true\n                fn()\n            }\n        })\n    }\n\n    public doOnSubscribe(fn: (subscription: Subscription) => void): PipePublisher<T> {\n        let sub: Subscription\n        const prev = this.onSubscribe\n        this.onSubscribe = (subscription) => {\n            prev?.(subscription)\n            fn(subscription)\n        }\n        return this.pipe((onNext, onError, onComplete) =>\n            sub = this.subscribe({\n                onNext,\n                onError,\n                onComplete\n            }), request => sub?.request(request), () => sub?.unsubscribe())\n    }\n\n    public publishOn(scheduler: Scheduler): PipePublisher<T> {\n        let sub: Subscription\n        return this.pipe((onNext, onError, onComplete) =>\n            sub = this.subscribe({\n                onNext: value => scheduler.schedule(() => onNext(value)),\n                onError: error => scheduler.schedule(() => onError(error)),\n                onComplete: () => scheduler.schedule(() => onComplete())\n            }), request => sub?.request(request), () => sub?.unsubscribe())\n    }\n\n    public subscribeOn(scheduler: Scheduler): PipePublisher<T> {\n        let sub: Promise<Subscription>\n        return this.pipe((onNext, onError, onComplete) =>\n            sub = new Promise(resolve => scheduler.schedule(() => resolve(this.subscribe({\n                onNext,\n                onError,\n                onComplete\n            })))), request => sub?.then(value => value.request(request)), () => sub?.then(value => value.unsubscribe())\n        )\n    }\n\n    protected abstract createSink(): Sink<T> & Publisher<T>\n\n    private wrap<R>(publisher: Publisher<R>, constructor?: new (publisher: Publisher<R>) => AbstractPipePublisher<R>) {\n        this.unsubscribeOnComplete = false\n        if (constructor == null) constructor = (Reflect.getPrototypeOf(this) as AbstractPipePublisher<R>).constructor as\n            new (publisher: Publisher<R>) => AbstractPipePublisher<R>\n        const wrapped: AbstractPipePublisher<R> = Reflect.construct(constructor, [publisher]);\n        wrapped.unsubscribeOnComplete = true\n        if (this.onSubscribe != undefined) {\n            wrapped.onSubscribe = this.onSubscribe\n            this.onSubscribe = undefined\n        }\n        return wrapped\n    }\n}\n","import {BackpressurePublisher, Publisher} from \"@/publishers/Publisher\";\nimport {Sink} from \"@/sinks/Sink\";\nimport {Subscriber, Subscription} from \"@/subscriptions\";\nimport {ReplayLatestSink} from \"@/sinks\";\nimport {Flux} from \"@/publishers\";\n\n/**\n * Combines a Sink and a generator function into a single Publisher.\n * Uses the BackpressurePublisher as a base to manage data flow and backpressure.\n *\n * @template T - The type of data being published.\n * @param {Sink<T> & Publisher<T>} sink - The sink that acts as both a data consumer and publisher.\n * @param {Function} generator - A function that generates data and pushes it to the sink.\n * @returns {Publisher<T>} A combined Publisher that handles data emission and backpressure.\n */\nexport function combine<T>(sink: Sink<T> & Publisher<T>, generator: ((sink: Sink<T>) => void)): Publisher<T> {\n    return new class CombinedPublisher extends BackpressurePublisher<T> {\n        public override subscribe(subscriber: Subscriber<T>): Subscription {\n            const gen = generator(sink) as unknown as Subscription\n            const sub = super.subscribe(subscriber)\n            const req = typeof gen?.request == 'function'\n            return {\n                request(count: number) {\n                    sub.request(count)\n                    !req || gen?.request(count)\n                },\n                unsubscribe() {\n                    sub.unsubscribe()\n                    !req || gen?.unsubscribe()\n                }\n            };\n        }\n    }(sink)\n}\n\n/**\n * Creates a reactive subject that holds a single mutable value and supports subscriptions.\n * The subject allows updating the value and notifying subscribers of changes.\n *\n * @template T - The type of the value held by the subject.\n * @param {T} value - The initial value of the subject.\n * @returns {Object} An object with methods to interact with the subject.\n * @property {function(T): void} next - Updates the current value and notifies subscribers.\n * @property {function((current: T) => T): void} update - Updates the current value using a function and notifies subscribers.\n * @property {function(): T} get - Returns the current value of the subject.\n * @property {function(Subscriber<T>): Subscription} subscribe - Subscribes to changes and returns a subscription.\n *\n * @example\n * const count = subject(0);\n * count.next(1);  // Update the value to 1\n * count.update(prev => prev + 1);  // Increment the value\n * console.log(count.get());  // Output: 2\n * const subscription = count.subscribe({\n *   onNext: value => console.log('New value:', value),\n *   onComplete: () => console.log('Completed')\n * });\n * subscription.request(1);  // Request the next value\n * subscription.unsubscribe();  // Stop receiving updates\n */\nexport function subject<T>(value: T) {\n    let subject = value;\n    const sink = new ReplayLatestSink<T>(1)\n    sink.next(value)\n    return {\n        next(value: T) {\n            sink.next(subject = value)\n        },\n        update(fn: (current: T) => T) {\n            this.next(fn(subject))\n        },\n        get() {\n            return subject\n        },\n        subscribe({\n                      onNext = (value: T) => {\n                      },\n                      onError = (error: Error) => {\n                      },\n                      onComplete = () => {\n                      }\n                  } = {}): Subscription {\n            return Flux.from(sink).distinctUntilChanged().subscribe({onNext, onError, onComplete})\n        }\n    }\n}","import {Scheduler} from \"@/schedulers/Scheduler\";\n\n/**\n * A scheduler that executes tasks asynchronously using the microtask queue.\n * Implements the `Scheduler` interface and schedules tasks using `Promise.resolve().then(...)`.\n */\nexport class MicroScheduler implements Scheduler {\n    /**\n     * Schedules a task to be executed asynchronously as a microtask.\n     * Uses `Promise.resolve().then(task)` to place the task in the microtask queue.\n     * @param {Function} task - The task function to be executed.\n     */\n    public schedule(task: () => void): void {\n        Promise.resolve().then(task)\n    }\n}\n","import {CancellableScheduler} from \"@/schedulers/Scheduler\";\n\n/**\n * A scheduler that executes tasks after a specified delay.\n * Implements the `CancellableScheduler` interface, allowing scheduled tasks to be canceled.\n */\nexport class DelayScheduler implements CancellableScheduler {\n    private readonly delay: number\n\n    /**\n     * Creates a new DelayScheduler.\n     * @param {number} delay - The delay duration in milliseconds.\n     */\n    constructor(delay: number) {\n        this.delay = delay\n    }\n\n    /**\n     * Schedules a task to be executed after the specified delay.\n     * Returns an object with a cancel method to clear the timeout.\n     * @param {Function} task - The task function to be executed.\n     * @returns {Object} An object with a `cancel` method to stop the execution.\n     */\n    public schedule(task: () => void): { cancel: () => void } {\n        const id = setTimeout(task, this.delay)\n        return {\n            /**\n             * Cancels the scheduled task.\n             */\n            cancel: () => clearTimeout(id)\n        }\n    }\n}\n","import {AbstractPipePublisher} from \"@/publishers/PipePublisher\";\nimport {Publisher} from \"@/publishers/Publisher\";\nimport {Sink} from \"@/sinks/Sink\";\nimport ManySink from \"@/sinks/ManySink\";\nimport {Mono} from \"@/publishers/Mono\";\nimport {Scheduler} from \"@/schedulers/Scheduler\";\nimport {combine} from \"@/utils\";\nimport {MicroScheduler} from \"@/schedulers/MicroScheduler\";\nimport {DelayScheduler} from \"@/schedulers/DelayScheduler\";\nimport {Subscription} from \"@/subscriptions/Subscription\";\nimport {Subscriber} from \"@/subscriptions/Subscriber\";\n\n/**\n * Represents a Flux publisher that can emit multiple values over time.\n * Provides rich reactive programming capabilities such as transformation, filtering, and combination.\n * @template T - The type of data being published.\n */\nexport class Flux<T> extends AbstractPipePublisher<T> {\n    protected constructor(publisher: Publisher<T>) {\n        super(publisher)\n    }\n\n    /**\n     * Generates a Flux instance using a generator function.\n     * @template T - The type of data.\n     * @param {Function} generator - The function to generate values.\n     * @returns {Flux<T>} A new Flux instance.\n     */\n    public static generate<T>(generator: ((sink: Sink<T>) => void)): Flux<T> {\n        return new Flux(combine(new ManySink<T>(), generator))\n    }\n\n    /**\n     * Creates a Flux instance from another publisher.\n     * @template T - The type of data.\n     * @param {Publisher<T>} publisher - The source publisher.\n     * @returns {Flux<T>} A new Flux instance.\n     */\n    public static from<T>(publisher: Publisher<T>): Flux<T> {\n        return Flux.generate(sink => {\n            return publisher.subscribe({\n                onNext(value: T) {\n                    sink.next(value)\n                },\n                onError(error: Error) {\n                    sink.error(error)\n                },\n                onComplete() {\n                    sink.complete()\n                }\n            })\n        })\n    }\n\n    /**\n     * Creates a Flux from an iterable collection.\n     * @template T - The type of data.\n     * @param {Iterable<T>} iterable - An iterable to create the Flux from.\n     * @returns {Flux<T>} A new Flux instance.\n     */\n    public static fromIterable<T>(iterable: Iterable<T>): Flux<T> {\n        return Flux.generate(sink => {\n            for (const value of iterable) {\n                sink.next(value);\n            }\n            sink.complete();\n        })\n    }\n\n    /**\n     * Creates a Flux that emits a range of numbers.\n     * @param {number} start - The starting number.\n     * @param {number} count - The number of elements to emit.\n     * @returns {Flux<number>} A new Flux emitting the range of numbers.\n     */\n    public static range(start: number, count: number): Flux<number> {\n        return Flux.generate(sink => {\n            let current = start;\n            for (let i = 0; i < count; i++) {\n                sink.next(current++);\n            }\n            sink.complete();\n        })\n    }\n\n    /**\n     * Creates an empty Flux that immediately completes.\n     * @template T - The type of data.\n     * @returns {Flux<T>} A new empty Flux instance.\n     */\n    public static empty<T = never>(): Flux<T> {\n        return Flux.generate(sink => {\n            sink.complete()\n        })\n    }\n\n    /**\n     * Defers the creation of a Flux until it is subscribed to.\n     * @template T - The type of data.\n     * @param {Function} factory - A function that returns a Flux.\n     * @returns {Flux<T>} A new deferred Flux instance.\n     */\n    public static defer<T>(factory: () => Flux<T>): Flux<T> {\n        return Flux.generate(sink => factory().subscribe({\n            onNext(value: T) {\n                sink.next(value)\n            },\n            onError(error: Error) {\n                sink.error(error)\n            },\n            onComplete() {\n                sink.complete()\n            }\n        }))\n    }\n\n    /**\n     * Returns a Mono emitting the first element of the Flux.\n     * @returns {Mono<T>} A Mono containing the first element.\n     */\n    public first(): Mono<T> {\n        let pipeSub: Subscription\n        return this.pipe((onNext, onError, onComplete) => {\n            pipeSub = this.subscribe({\n                onNext,\n                onError,\n                onComplete\n            })\n        }, _ => pipeSub?.request(1), () => pipeSub?.unsubscribe(), Mono as any) as unknown as Mono<T>\n    }\n\n    /**\n     * Returns a Mono emitting the last element of the Flux.\n     * @returns {Mono<T>} A Mono containing the last element.\n     */\n    public last(): Mono<T> {\n        let pipeSub: Subscription\n        return this.pipe((onNext, onError, onComplete) => {\n            let lastValue: T | undefined\n            let lastError: Error | undefined\n            pipeSub = this.subscribe({\n                onNext(value: T): void {\n                    lastError = undefined\n                    lastValue = value\n                },\n                onError(error: Error): void {\n                    lastValue = undefined\n                    lastError = error\n                },\n                onComplete(): void {\n                    if (lastValue != undefined) onNext(lastValue)\n                    else if (lastError != undefined) onError(lastError)\n                    else onComplete()\n                }\n            })\n        }, _ => pipeSub?.request(Number.MAX_SAFE_INTEGER), () => pipeSub?.unsubscribe(), Mono as any) as unknown as Mono<T>\n    }\n\n    /**\n     * Returns a Mono that emits the count of elements in the Flux.\n     * @returns {Mono<number>} A Mono containing the number of elements.\n     */\n    public count(): Mono<number> {\n        return this.collect().map(value => value.length)\n    }\n\n    /**\n     * Checks whether the Flux has any elements.\n     * @returns {Mono<boolean>} A Mono emitting true if there are elements, false otherwise.\n     */\n    public hasElements(): Mono<boolean> {\n        return this.count().map(value => value > 0)\n    }\n\n    /**\n     * Collects all emitted items into an array.\n     * @param {boolean} [force=false] - Forces immediate collection.\n     * @returns {Mono<T[]>} A Mono containing an array of collected items.\n     */\n    public collect(force: boolean = false): Mono<T[]> {\n        let pipeSub: Subscription\n        return this.pipe((onNext, onError, _) => {\n            const buffer: T[] = []\n            pipeSub = this.subscribe({\n                onNext(value: T): void {\n                    buffer.push(value)\n                },\n                onError(error: Error): void {\n                    onError(error)\n                },\n                onComplete() {\n                    onNext(buffer)\n                }\n            })\n            if (force) new MicroScheduler().schedule(() => {\n                try {\n                    onNext(buffer)\n                } catch (e) {\n                }\n                pipeSub.unsubscribe()\n            })\n        }, _ => pipeSub?.request(Number.MAX_SAFE_INTEGER), () => pipeSub?.unsubscribe(), Mono as any) as unknown as Mono<T[]>\n    }\n\n    /**\n     * Attaches an index to each emitted value.\n     * @returns {Flux<[number, T]>} A new Flux containing tuples of (index, value).\n     */\n    public indexed(): Flux<[number, T]> {\n        let pipeSub: Subscription\n        return this.pipe((onNext, onError, onComplete) => {\n            let index = 0\n            pipeSub = this.subscribe({\n                onNext(value: T): void {\n                    onNext([index++, value])\n                },\n                onError,\n                onComplete\n            })\n        }, request => pipeSub?.request(request), () => pipeSub?.unsubscribe())\n    }\n\n    /**\n     * Skips the first `n` emitted elements.\n     * @param {number} n - The number of elements to skip.\n     * @returns {Flux<T>} A new Flux without the skipped elements.\n     */\n    public skip(n: number): Flux<T> {\n        return this.indexed()\n            .filter(value => value[0] >= n)\n            .map(value => value[1])\n    }\n\n    /**\n     * Skips elements while the given predicate returns true.\n     * @param {Function} predicate - A function that takes a value and returns a boolean.\n     * @returns {Flux<T>} A new Flux without the skipped elements.\n     */\n    public skipWhile(predicate: (value: T) => boolean): Flux<T> {\n        let pipeSub: Subscription\n        return this.pipe((onNext, onError, onComplete) => {\n            let skipping = true\n            pipeSub = this.subscribe({\n                onNext(value: T): void {\n                    if (!skipping || !predicate(value)) {\n                        skipping = false\n                        onNext(value)\n                    } else onNext(null as T)\n                },\n                onError,\n                onComplete\n            })\n        }, request => pipeSub?.request(request + 1), () => pipeSub?.unsubscribe())\n    }\n\n    /**\n     * Skips elements until another Publisher emits an item.\n     * @param {Publisher<any>} other - The publisher to wait for.\n     * @returns {Flux<T>} A new Flux that skips elements until the other publisher emits.\n     */\n    public skipUntil(other: Publisher<any>): Flux<T> {\n        let pipeSub: Subscription\n        return this.pipe((onNext, onError, onComplete) => {\n            let open = false;\n            const sub = this.subscribe({\n                onNext: (value) => {\n                    if (open) onNext(value)\n                    else onNext(null as T)\n                },\n                onError,\n                onComplete\n            })\n            const sub2 = other.subscribe({\n                onNext(_: any): void {\n                    open = true\n                },\n                onError,\n                onComplete(): void {\n                }\n            })\n            pipeSub = {\n                request(count: number) {\n                    sub.request(count)\n                    sub2.request(count)\n                },\n                unsubscribe() {\n                    sub.unsubscribe()\n                    sub2.unsubscribe()\n                }\n            } as Subscription\n        }, request => pipeSub?.request(request + 1), () => pipeSub?.unsubscribe())\n    }\n\n    /**\n     * Emits only distinct elements, discarding duplicates.\n     * @returns {Flux<T>} A new Flux containing only distinct elements.\n     */\n    public distinct(): Flux<T> {\n        let sub: Subscription\n        return this.pipe((onNext, onError, onComplete) => {\n            const seen = new Set<T>()\n            sub = this.subscribe({\n                onNext: (value) => {\n                    if (!seen.has(value)) {\n                        seen.add(value)\n                        onNext(value)\n                    } else onNext(null as T)\n                },\n                onError,\n                onComplete\n            })\n        }, request => sub?.request(request + 1), () => sub?.unsubscribe())\n    }\n\n    /**\n     * Emits items only when they differ from the previous item.\n     * @param {Function} comparator - A function to compare previous and current items.\n     * @returns {Flux<T>} A new Flux with distinct consecutive items.\n     */\n    public distinctUntilChanged(comparator: (previous: T, current: T) => boolean = (previous, current) => previous != current): Flux<T> {\n        let sub: Subscription\n        return this.pipe((onNext, onError, onComplete) => {\n            let previous: T | null = null\n            sub = this.subscribe({\n                onNext(value: T) {\n                    if (previous == null || comparator(previous, value)) {\n                        onNext(previous = value);\n                    } else onNext(null as T)\n                },\n                onError(error: Error) {\n                    onError(error)\n                },\n                onComplete() {\n                    onComplete()\n                }\n            })\n        }, request => sub?.request(request + 1), () => sub?.unsubscribe())\n    }\n\n    /**\n     * Delays each emitted element by a specified duration.\n     * @param {number} ms - The delay duration in milliseconds.\n     * @returns {Flux<T>} A new Flux with delayed elements.\n     */\n    public delayElements(ms: number): Flux<T> {\n        let sub: Subscription\n        return this.pipe((onNext, onError, onComplete) => {\n            let promise = Promise.resolve()\n            const emit = (fn: () => void) => {\n                promise = promise.then(() => new Promise<void>(resolve => {\n                    new DelayScheduler(ms).schedule(() => {\n                        fn()\n                        resolve()\n                    })\n                }))\n            }\n            sub = this.subscribe({\n                onNext(value: T) {\n                    emit(() => onNext(value))\n                },\n                onError(error: Error) {\n                    emit(() => onError(error))\n                },\n                onComplete() {\n                    emit(() => onComplete())\n                }\n            })\n        }, request => sub?.request(request), () => sub?.unsubscribe())\n    }\n\n    /**\n     * Concatenates the current Flux with another Publisher.\n     * The current Flux is emitted first, and once it completes, the second Publisher starts emitting.\n     *\n     * @param {Publisher<T>} other - The Publisher to concatenate after the current one completes.\n     * @returns {Flux<T>} A new Flux that first emits the values from the current Flux and then from the other Publisher.\n     */\n    public concatWith(other: Publisher<T>): Flux<T> {\n        let pipeSub: Subscription\n        return this.pipe((onNext, onError, onComplete) => {\n            let second: Subscription | undefined\n            const first = this.subscribe({\n                onNext(value: T) {\n                    onNext(value)\n                },\n                onError(error: Error) {\n                    onError(error)\n                },\n                onComplete() {\n                    second = other.subscribe({\n                        onNext,\n                        onError,\n                        onComplete\n                    })\n                }\n            })\n            pipeSub = {\n                request(count: number) {\n                    first.request(count)\n                    second?.request(count)\n                },\n                unsubscribe() {\n                    first.unsubscribe()\n                    second?.unsubscribe()\n                }\n            } as Subscription\n        }, request => pipeSub?.request(request), () => pipeSub?.unsubscribe())\n    }\n\n    /**\n     * Merges the current Flux with another Publisher.\n     * Both Publishers emit values concurrently as they become available.\n     *\n     * @param {Publisher<T>} other - The other Publisher to merge with.\n     * @returns {Flux<T>} A new Flux that emits values from both Publishers as they arrive.\n     */\n    public mergeWith(other: Publisher<T>): Flux<T> {\n        let pipeSub: Subscription\n        return this.pipe((onNext, onError, onComplete) => {\n            let left = 2\n            const subscriber = {\n                onNext,\n                onError,\n                onComplete() {\n                    if (--left <= 0) {\n                        onComplete()\n                    }\n                }\n            } as Subscriber<T>\n            const first = this.subscribe(subscriber)\n            const second = other.subscribe(subscriber)\n            pipeSub = {\n                request(count: number) {\n                    first.request(count)\n                    second.request(count)\n                },\n                unsubscribe() {\n                    first.unsubscribe()\n                    second.unsubscribe()\n                }\n            } as Subscription\n        }, request => pipeSub?.request(request), () => pipeSub?.unsubscribe())\n    }\n\n    /**\n     * Reduces the items emitted by this Flux using a given accumulator function.\n     * Aggregates the items into a single result.\n     *\n     * @param {Function} reducer - A function that combines the accumulated value and the next item.\n     * @returns {Mono<T>} A Mono that emits the final accumulated value.\n     */\n    public reduce(reducer: (acc: T, next: T) => T): Mono<T> {\n        return this.collect().map(value => value.reduce(reducer))\n    }\n\n    /**\n     * Reduces the items emitted by this Flux using a given accumulator function and a seed value.\n     * Allows providing an initial seed for the accumulation.\n     *\n     * @template A - The type of the accumulated value.\n     * @param {Function} seedFactory - A function that provides the initial accumulated value.\n     * @param {Function} reducer - A function that combines the accumulated value and the next item.\n     * @returns {Mono<A>} A Mono that emits the final accumulated value.\n     */\n    public reduceWith<A>(seedFactory: () => A, reducer: (acc: A, next: T) => A): Mono<A> {\n        let pipeSub: Subscription\n        return this.pipe((onNext, onError, _) => {\n            let acc = seedFactory()\n            pipeSub = this.subscribe({\n                onNext(value: T): void {\n                    acc = reducer(acc, value)\n                },\n                onError,\n                onComplete(): void {\n                    onNext(acc)\n                }\n            })\n        }, _ => pipeSub?.request(Number.MAX_SAFE_INTEGER), () => pipeSub?.unsubscribe(), Mono as any) as unknown as Mono<A>\n    }\n\n    /**\n     * Returns a Mono that completes when the current Flux completes.\n     * Does not emit any value, just completes.\n     *\n     * @returns {Mono<void>} A Mono that completes when the Flux completes.\n     */\n    public then(): Mono<void> {\n        let pipeSub: Subscription\n        return this.pipe((_, onError, onComplete) => {\n            pipeSub = this.subscribe({\n                onNext(_: T): void {\n                },\n                onError,\n                onComplete\n            })\n        }, _ => pipeSub?.request(Number.MAX_SAFE_INTEGER), () => pipeSub?.unsubscribe(), Mono as any) as unknown as Mono<void>\n    }\n\n    /**\n     * Returns a Mono that completes when the current Flux completes, and then triggers the completion of another Publisher.\n     *\n     * @param {Publisher<any>} other - Another Publisher to complete after the current Flux.\n     * @returns {Mono<void>} A Mono that completes after both Flux and the given Publisher complete.\n     */\n    public thenEmpty(other: Publisher<any>): Mono<void> {\n        return this.collect()\n            .flatMap(_ => other)\n            .flatMap(_ => Mono.empty())\n    }\n\n    /**\n     * Pipes the data through custom transformations.\n     * @template R - The result type after processing.\n     * @param {Function} producer - The function to produce new values.\n     * @param {Function} onRequest - Callback on request.\n     * @param {Function} onUnsubscribe - Callback on unsubscribe.\n     * @param constructor - Constructor for generating new Publisher\n     * @returns {Flux<R>} A new Flux with transformed data.\n     */\n    public override pipe<R>(producer: (onNext: (value: R) => void, onError: (error: Error) => void, onComplete: () => void) => void, onRequest?: (request: number) => void, onUnsubscribe?: () => void, constructor?: new (publisher: Publisher<R>) => AbstractPipePublisher<R>): Flux<R> {\n        return super.pipe(producer, onRequest, onUnsubscribe, constructor) as Flux<R>;\n    }\n\n    /**\n     * Transforms each emitted value using the given function.\n     * @template R - The transformed data type.\n     * @param {Function} fn - The mapping function.\n     * @returns {Flux<R>} A new Flux with mapped data.\n     */\n    public override map<R>(fn: (value: T) => R): Flux<R> {\n        return super.map(fn) as Flux<R>;\n    }\n\n    /**\n     * Transforms each emitted value and filter transform result.\n     * @template R - The transformed data type.\n     * @param {Function} fn - The mapping function that can return null or undefined.\n     * @returns {Flux<R>} A new Flux with mapped non-null data.\n     */\n    public override mapNotNull<R>(fn: (value: T) => (R | null | undefined)): Flux<R> {\n        return super.mapNotNull(fn) as Flux<R>;\n    }\n\n    /**\n     * Transforms the value using a function that returns a new publisher.\n     * @template R - The resulting data type.\n     * @param {Function} fn - The function to transform values into new publishers.\n     * @returns {Flux<R>} A Flux that flattens the result.\n     */\n    public override flatMap<R>(fn: (value: T) => Publisher<R>): Flux<R> {\n        return super.flatMap(fn) as Flux<R>;\n    }\n\n    /**\n     * Filters emitted values using a given predicate.\n     * @param {Function} predicate - The function to determine whether to emit a value.\n     * @returns {Flux<T>} A new Flux with filtered data.\n     */\n    public override filter(predicate: (value: T) => boolean): Flux<T> {\n        return super.filter(predicate) as Flux<T>;\n    }\n\n    /**\n     * Filters emitted values based on a publisher that returns a boolean.\n     * @param {Function} predicate - A function returning a boolean publisher.\n     * @returns {Flux<T>} A new Flux with conditional data.\n     */\n    public override filterWhen(predicate: (value: T) => Publisher<boolean>): Flux<T> {\n        return super.filterWhen(predicate) as Flux<T>;\n    }\n\n    /**\n     * Casts the current publisher to another type.\n     * @template R - The target type.\n     * @returns {Flux<R>} The casted Flux.\n     */\n    public override cast<R>(): Flux<R> {\n        return super.cast() as Flux<R>;\n    }\n\n    /**\n     * Switches to an alternative publisher if the current one is empty.\n     * @param {Publisher<T>} alternative - The alternative publisher.\n     * @returns {Flux<T>} A new Flux.\n     */\n    public override switchIfEmpty(alternative: Publisher<T>): Flux<T> {\n        return super.switchIfEmpty(alternative) as Flux<T>;\n    }\n\n    /**\n     * Continues with a replacement publisher if an error occurs.\n     * @param {Publisher<T>} replacement - The publisher to switch to on error.\n     * @returns {Flux<T>} A new Flux.\n     */\n    public override onErrorReturn(replacement: Publisher<T>): Flux<T> {\n        return super.onErrorReturn(replacement) as Flux<T>;\n    }\n\n    /**\n     * Continues processing even if an error occurs based on a predicate.\n     * @param {Function} predicate - Function to determine whether to continue on error.\n     * @returns {Flux<T>} A new Flux.\n     */\n    public override onErrorContinue(predicate: (error: Error) => boolean): Flux<T> {\n        return super.onErrorContinue(predicate) as Flux<T>;\n    }\n\n    /**\n     * Executes a function when the first value is emitted.\n     * @param {Function} fn - The function to execute.\n     * @returns {Flux<T>} A new Flux.\n     */\n    public override doFirst(fn: () => void): Flux<T> {\n        return super.doFirst(fn) as Flux<T>;\n    }\n\n    /**\n     * Executes a function when each value is emitted.\n     * @param {Function} fn - The function to execute on each value.\n     * @returns {Flux<T>} A new Flux.\n     */\n    public override doOnNext(fn: (value: T) => void): Flux<T> {\n        return super.doOnNext(fn) as Flux<T>;\n    }\n\n    /**\n     * Executes a function when each error is emitted.\n     * @param {Function} fn - The function to execute on each error.\n     * @returns {Flux<T>} A new Flux.\n     */\n    public override doOnError(fn: (value: Error) => void): Flux<T> {\n        return super.doOnError(fn) as Flux<T>;\n    }\n\n    /**\n     * Executes a function when the stream completes.\n     * @param {Function} fn - The function to execute on completion.\n     * @returns {Flux<T>} A new Flux.\n     */\n    public override doFinally(fn: () => void): Flux<T> {\n        return super.doFinally(fn) as Flux<T>;\n    }\n\n    /**\n     * Executes a function when a subscription occurs.\n     * @param {Function} fn - The function to execute on subscription.\n     * @returns {Flux<T>} A new Flux.\n     */\n    public override doOnSubscribe(fn: (subscription: Subscription) => void): Flux<T> {\n        return super.doOnSubscribe(fn) as Flux<T>;\n    }\n\n    /**\n     * Publishes values on a specified scheduler.\n     * @param {Scheduler} scheduler - The scheduler to use.\n     * @returns {Flux<T>} A new Flux.\n     */\n    public override publishOn(scheduler: Scheduler): Flux<T> {\n        return super.publishOn(scheduler) as Flux<T>;\n    }\n\n    /**\n     * Subscribes to the stream on a specified scheduler.\n     * @param {Scheduler} scheduler - The scheduler to use.\n     * @returns {Flux<T>} A new Flux.\n     */\n    public override subscribeOn(scheduler: Scheduler): Flux<T> {\n        return super.subscribeOn(scheduler) as Flux<T>;\n    }\n\n    protected createSink(): Sink<T> & Publisher<T> {\n        return new ManySink();\n    }\n}","import {AbstractPipePublisher} from \"@/publishers/PipePublisher\";\nimport {Publisher} from \"@/publishers/Publisher\";\nimport OneSink from \"@/sinks/OneSink\";\nimport {Sink} from \"@/sinks/Sink\";\nimport {Scheduler} from \"@/schedulers/Scheduler\";\nimport {combine} from \"@/utils\";\nimport {Flux} from \"@/publishers/Flux\";\nimport {Subscription} from \"@/subscriptions/Subscription\";\n\n/**\n * Represents a Mono publisher that emits at most one item.\n * Suitable for scenarios where a single value or an empty result is expected.\n * @template T - The type of data being published.\n */\nexport class Mono<T> extends AbstractPipePublisher<T> {\n\n    protected constructor(publisher: Publisher<T>) {\n        super(publisher)\n    }\n\n    /**\n     * Creates a Mono instance from a value generator function.\n     * @template T - The type of data being generated.\n     * @param {Function} generator - A function to generate the data.\n     * @returns {Mono<T>} A Mono instance.\n     */\n    public static generate<T>(generator: ((sink: Sink<T>) => void)): Mono<T> {\n        return new Mono(combine(new OneSink<T>(), generator))\n    }\n\n    /**\n     * Creates a Mono instance from an existing publisher.\n     * @template T - The type of data being published.\n     * @param {Publisher<T>} publisher - The source publisher.\n     * @returns {Mono<T>} A Mono instance.\n     */\n    public static from<T>(publisher: Publisher<T>): Mono<T> {\n        return Mono.generate(sink => {\n                const subscription = publisher.subscribe({\n                    onNext(value: T) {\n                        sink.next(value)\n                        subscription.unsubscribe()\n                    },\n                    onError(error: Error) {\n                        sink.error(error)\n                        subscription.unsubscribe()\n                    },\n                    onComplete() {\n                        sink.complete()\n                        subscription.unsubscribe()\n                    }\n                })\n                return subscription\n            }\n        )\n    }\n\n    /**\n     * Creates a Mono instance that emits a single value.\n     * @template T - The type of data.\n     * @param {T} value - The value to emit.\n     * @returns {Mono<T>} A Mono instance.\n     */\n    public static just<T>(value: T): Mono<T> {\n        return Mono.generate(sink => sink.next(value))\n    }\n\n    /**\n     * Creates a Mono instance that emits the given value or completes if null/undefined.\n     * @template T - The type of data.\n     * @param {T | null | undefined} value - The value to emit.\n     * @returns {Mono<T>} A Mono instance.\n     */\n    public static justOrEmpty<T>(value: T | null | undefined): Mono<T> {\n        return value == null ? Mono.empty() : Mono.just(value)\n    }\n\n    /**\n     * Creates an empty Mono instance.\n     * @template T - The type of data.\n     * @returns {Mono<T>} A Mono instance that completes without emitting.\n     */\n    public static empty<T = never>(): Mono<T> {\n        return Mono.generate(sink => sink.complete())\n    }\n\n    /**\n     * Creates a Mono instance that emits an error.\n     * @template T - The type of data.\n     * @param {any} error - The error to emit.\n     * @returns {Mono<T>} A Mono instance that emits an error.\n     */\n    public static error<T = never>(error: any): Mono<T> {\n        return Mono.generate(sink => sink.error(error))\n    }\n\n    /**\n     * Creates a Mono instance from a Promise.\n     * @template T - The type of data.\n     * @param {Promise<T>} promise - The promise to wrap.\n     * @returns {Mono<T>} A Mono instance.\n     */\n    public static fromPromise<T>(promise: Promise<T>): Mono<T> {\n        return Mono.generate(sink => promise\n            .then((value) => sink.next(value))\n            .catch((err) => sink.error(err)))\n    }\n\n    /**\n     * Subscribes to the Mono and triggers the provided callbacks on events.\n     * @param {() => Mono<T>} factory - The event handlers.\n     * @returns {Subscription} The subscription object.\n     */\n    public static defer<T>(factory: () => Mono<T>): Mono<T> {\n        return Mono.generate(sink => factory().subscribe({\n            onNext(value: T) {\n                sink.next(value)\n            },\n            onError(error: Error) {\n                sink.error(error)\n            },\n            onComplete() {\n                sink.complete()\n            }\n        }))\n    }\n\n    /**\n     * Transforms the value emitted by the Mono into a Flux using the provided mapper function.\n     * The resulting Flux can emit multiple items from the transformation of a single Mono item.\n     *\n     * @template R - The result type after mapping.\n     * @param {Function} mapper - A function that takes a value of type `T` and returns a `Publisher<R>`.\n     * @returns {Flux<R>} A new Flux containing the transformed values.\n     */\n    public flatMapMany<R>(mapper: (value: T) => Publisher<R>): Flux<R> {\n        let pipeSub: Subscription | undefined\n        let pipeSub2: Subscription | undefined\n        return this.pipe((onNext, onError, onComplete) => {\n                pipeSub = this.subscribe({\n                    onNext: (val) => {\n                        pipeSub2 = mapper(val).subscribe({\n                            onNext,\n                            onError,\n                            onComplete\n                        })\n                    },\n                    onError,\n                    onComplete: () => {\n                        if (pipeSub2 == undefined) onComplete()\n                    }\n                })\n            }, request => {\n                pipeSub?.request(request)\n                pipeSub2?.request(request)\n            },\n            () => {\n                pipeSub?.unsubscribe()\n                pipeSub2?.unsubscribe()\n            }, Flux as any) as unknown as Flux<R>\n    }\n\n    /**\n     * Combines the values emitted by this Mono and another Mono into a pair.\n     *\n     * @template R - The type of the other Mono.\n     * @param {Mono<R>} other - The other Mono to zip with.\n     * @returns {Mono<[T, R]>} A new Mono emitting a tuple of values from both Monos.\n     */\n    public zipWith<R>(other: Mono<R>): Mono<[T, R]> {\n        return this.flatMap(left => other.map(right => [left, right]))\n    }\n\n    /**\n     * Combines the value emitted by this Mono with a value produced by a function.\n     * The function returns another Mono, and the resulting Mono contains a pair of values.\n     *\n     * @template R - The result type produced by the function.\n     * @param {Function} fn - A function that takes a value of type `T` and returns a `Mono<R>`.\n     * @returns {Mono<[T, R]>} A new Mono containing the combined pair.\n     */\n    public zipWhen<R>(fn: (value: T) => Mono<R>): Mono<[T, R]> {\n        return this.flatMap((left) => fn(left).map((right) => [left, right]))\n    }\n\n    /**\n     * Checks if the Mono contains an element.\n     * @returns {Mono<boolean>} A Mono that emits true if an element exists, false otherwise.\n     */\n    public hasElement(): Mono<boolean> {\n        return this.onErrorContinue(_error => true)\n            .map(_value => true)\n            .switchIfEmpty(Mono.defer(() => Mono.just(false)))\n    }\n\n    /**\n     * Converts the Mono to a Promise.\n     * @returns {Promise<T | null>} A promise that resolves when the Mono completes.\n     */\n    public toPromise(): Promise<T | null> {\n        return new Promise((resolve, reject) => {\n            let value: T | null = null\n            this.subscribe({\n                onNext: (v) => value = v,\n                onError: reject,\n                onComplete: () => resolve(value)\n            }).request(1)\n        })\n    }\n\n    /**\n     * Pipes the data through custom transformations.\n     * @template R - The result type after processing.\n     * @param {Function} producer - The function to produce new values.\n     * @param {Function} onRequest - Callback on request.\n     * @param {Function} onUnsubscribe - Callback on unsubscribe.\n     * @param constructor - Constructor for generating new Publisher\n     * @returns {Mono<R>} A new Mono with transformed data.\n     */\n    public override pipe<R>(producer: (onNext: (value: R) => void, onError: (error: Error) => void, onComplete: () => void) => void, onRequest?: (request: number) => void, onUnsubscribe?: () => void, constructor?: new (publisher: Publisher<R>) => AbstractPipePublisher<R>): Mono<R> {\n        return super.pipe(producer, onRequest, onUnsubscribe, constructor) as Mono<R>;\n    }\n\n    /**\n     * Transforms each emitted value using the given function.\n     * @template R - The transformed data type.\n     * @param {Function} fn - The mapping function.\n     * @returns {Mono<R>} A new Mono with mapped data.\n     */\n    public override map<R>(fn: (value: T) => R): Mono<R> {\n        return super.map(fn) as Mono<R>;\n    }\n\n    /**\n     * Transforms each emitted value and filter transform result.\n     * @template R - The transformed data type.\n     * @param {Function} fn - The mapping function that can return null or undefined.\n     * @returns {Mono<R>} A new Mono with mapped non-null data.\n     */\n    public override mapNotNull<R>(fn: (value: T) => (R | null | undefined)): Mono<R> {\n        return super.mapNotNull(fn) as Mono<R>;\n    }\n\n    /**\n     * Transforms the value using a function that returns a new publisher.\n     * @template R - The resulting data type.\n     * @param {Function} fn - The function to transform values into new publishers.\n     * @returns {Mono<R>} A Mono that flattens the result.\n     */\n    public override flatMap<R>(fn: (value: T) => Publisher<R>): Mono<R> {\n        return super.flatMap(fn) as Mono<R>;\n    }\n\n    /**\n     * Filters emitted values using a given predicate.\n     * @param {Function} predicate - The function to determine whether to emit a value.\n     * @returns {Mono<T>} A new Mono with filtered data.\n     */\n    public override filter(predicate: (value: T) => boolean): Mono<T> {\n        return super.filter(predicate) as Mono<T>;\n    }\n\n    /**\n     * Filters emitted values based on a publisher that returns a boolean.\n     * @param {Function} predicate - A function returning a boolean publisher.\n     * @returns {Mono<T>} A new Mono with conditional data.\n     */\n    public override filterWhen(predicate: (value: T) => Publisher<boolean>): Mono<T> {\n        return super.filterWhen(predicate) as Mono<T>;\n    }\n\n    /**\n     * Casts the current publisher to another type.\n     * @template R - The target type.\n     * @returns {Mono<R>} The casted Mono.\n     */\n    public override cast<R>(): Mono<R> {\n        return super.cast() as Mono<R>;\n    }\n\n    /**\n     * Switches to an alternative publisher if the current one is empty.\n     * @param {Publisher<T>} alternative - The alternative publisher.\n     * @returns {Mono<T>} A new Mono.\n     */\n    public override switchIfEmpty(alternative: Publisher<T>): Mono<T> {\n        return super.switchIfEmpty(alternative) as Mono<T>;\n    }\n\n    /**\n     * Continues with a replacement publisher if an error occurs.\n     * @param {Publisher<T>} replacement - The publisher to switch to on error.\n     * @returns {Mono<T>} A new Mono.\n     */\n    public override onErrorReturn(replacement: Publisher<T>): Mono<T> {\n        return super.onErrorReturn(replacement) as Mono<T>;\n    }\n\n    /**\n     * Continues processing even if an error occurs based on a predicate.\n     * @param {Function} predicate - Function to determine whether to continue on error.\n     * @returns {Mono<T>} A new Mono.\n     */\n    public override onErrorContinue(predicate: (error: Error) => boolean): Mono<T> {\n        return super.onErrorContinue(predicate) as Mono<T>;\n    }\n\n    /**\n     * Executes a function when the first value is emitted.\n     * @param {Function} fn - The function to execute.\n     * @returns {Mono<T>} A new Mono.\n     */\n    public override doFirst(fn: () => void): Mono<T> {\n        return super.doFirst(fn) as Mono<T>;\n    }\n\n    /**\n     * Executes a function when each value is emitted.\n     * @param {Function} fn - The function to execute on each value.\n     * @returns {Mono<T>} A new Mono.\n     */\n    public override doOnNext(fn: (value: T) => void): Mono<T> {\n        return super.doOnNext(fn) as Mono<T>;\n    }\n\n    /**\n     * Executes a function when each error is emitted.\n     * @param {Function} fn - The function to execute on each error.\n     * @returns {Mono<T>} A new Mono.\n     */\n    public override doOnError(fn: (value: Error) => void): Mono<T> {\n        return super.doOnError(fn) as Mono<T>;\n    }\n\n    /**\n     * Executes a function when the stream completes.\n     * @param {Function} fn - The function to execute on completion.\n     * @returns {Mono<T>} A new Mono.\n     */\n    public override doFinally(fn: () => void): Mono<T> {\n        return super.doFinally(fn) as Mono<T>;\n    }\n\n    /**\n     * Executes a function when a subscription occurs.\n     * @param {Function} fn - The function to execute on subscription.\n     * @returns {Mono<T>} A new Mono.\n     */\n    public override doOnSubscribe(fn: (subscription: Subscription) => void): Mono<T> {\n        return super.doOnSubscribe(fn) as Mono<T>;\n    }\n\n    /**\n     * Publishes values on a specified scheduler.\n     * @param {Scheduler} scheduler - The scheduler to use.\n     * @returns {Mono<T>} A new Mono.\n     */\n    public override publishOn(scheduler: Scheduler): Mono<T> {\n        return super.publishOn(scheduler) as Mono<T>;\n    }\n\n    /**\n     * Subscribes to the stream on a specified scheduler.\n     * @param {Scheduler} scheduler - The scheduler to use.\n     * @returns {Mono<T>} A new Mono.\n     */\n    public override subscribeOn(scheduler: Scheduler): Mono<T> {\n        return super.subscribeOn(scheduler) as Mono<T>;\n    }\n\n    protected createSink(): Sink<T> & Publisher<T> {\n        return new OneSink();\n    }\n}\n","import {Scheduler} from '@/schedulers/Scheduler'\n\n/**\n * A scheduler that immediately executes tasks.\n * Implements the `Scheduler` interface to execute tasks without any delay.\n */\n\nexport class ImmediateScheduler implements Scheduler {\n    /**\n     * Schedules a task to be executed immediately.\n     * @param {Function} task - The task function to be executed.\n     */\n    public schedule(task: () => void): void {\n        task()\n    }\n}\n","import {Scheduler} from \"@/schedulers/Scheduler\";\n\n/**\n * A scheduler that executes tasks asynchronously using the macro task queue.\n * Implements the `Scheduler` interface and schedules tasks using `setTimeout` with a delay of `0`.\n */\nexport class MacroScheduler implements Scheduler {\n    /**\n     * Schedules a task to be executed asynchronously.\n     * Uses `setTimeout` with a delay of `0` to place the task in the macro task queue.\n     * @param {Function} task - The task function to be executed.\n     */\n    public schedule(task: () => void): void {\n        setTimeout(task, 0)\n    }\n}\n","import {CancellableScheduler} from \"@/schedulers/Scheduler\";\n\n/**\n * A scheduler that executes tasks multiple times with a specified interval.\n * Implements the `CancellableScheduler` interface, allowing scheduled tasks to be canceled.\n */\nexport class IntervalScheduler implements CancellableScheduler {\n    private readonly interval: number\n\n    /**\n     * Creates a new IntervalScheduler.\n     * @param {number} delay - The interval duration in milliseconds.\n     */\n    constructor(delay: number) {\n        this.interval = delay\n    }\n\n    /**\n     * Schedules a task to be executed multiple times with a specified interval.\n     * Returns an object with a cancel method to clear the timeout.\n     * @param {Function} task - The task function to be executed.\n     * @returns {Object} An object with a `cancel` method to stop the execution.\n     */\n    public schedule(task: () => void): { cancel: () => void } {\n        const id = setInterval(task, this.interval)\n        return {\n            /**\n             * Cancels the scheduled task.\n             */\n            cancel: () => clearInterval(id)\n        }\n    }\n}\n","import {ImmediateScheduler} from \"@/schedulers/ImmediateScheduler\";\nimport {MicroScheduler} from \"@/schedulers/MicroScheduler\";\nimport {MacroScheduler} from \"@/schedulers/MacroScheduler\";\nimport {DelayScheduler} from \"@/schedulers/DelayScheduler\";\nimport {IntervalScheduler} from \"@/schedulers/IntervalScheduler\";\n\nexport * from '@/schedulers/Scheduler'\n\n/**\n * A collection of commonly used schedulers for task execution.\n * Provides methods to create instances of various scheduler types.\n */\nexport const Schedulers = {\n    /**\n     * Creates an instance of `ImmediateScheduler`.\n     * Executes tasks immediately without any delay.\n     * @returns {ImmediateScheduler} An instance of ImmediateScheduler.\n     */\n    immediate: (): ImmediateScheduler => new ImmediateScheduler(),\n    /**\n     * Creates an instance of `MicroScheduler`.\n     * Executes tasks asynchronously using the microtask queue.\n     * @returns {MicroScheduler} An instance of MicroScheduler.\n     */\n    micro: (): MicroScheduler => new MicroScheduler(),\n    /**\n     * Creates an instance of `MacroScheduler`.\n     * Executes tasks asynchronously using the macro task queue (via `setTimeout`).\n     * @returns {MacroScheduler} An instance of MacroScheduler.\n     */\n    macro: (): MacroScheduler => new MacroScheduler(),\n    /**\n     * Creates an instance of `DelayScheduler` with a specified delay.\n     * Executes tasks after a given delay using `setTimeout`.\n     * @param {number} ms - The delay in milliseconds before executing the task.\n     * @returns {DelayScheduler} An instance of DelayScheduler.\n     */\n    delay: (ms: number): DelayScheduler => new DelayScheduler(ms),\n    /**\n     * Creates an instance of `IntervalScheduler` with a specified interval.\n     * Executes tasks multiple times with a given interval using `setInterval`.\n     * @param {number} ms - The interval in milliseconds between task executing.\n     * @returns {IntervalScheduler} An instance of IntervalScheduler.\n     */\n    interval: (ms: number): IntervalScheduler => new IntervalScheduler(ms)\n}"],"mappings":"AAsBO,IAAMA,EAAN,KAAuD,CAMnD,YAAYC,EAAoB,CALvC,KAAQ,aAAqC,CAAC,EAE9C,KAAQ,UAAoB,EAIxB,KAAK,aAAeA,EAAK,UAAU,CAC/B,OAASC,GAAa,CAClB,KAAK,aAAa,KAAK,CAAC,KAAM,OAAQ,KAAMA,CAAK,CAAC,EAClD,KAAK,MAAM,CACf,EACA,QAAUC,GAAiB,CACvB,KAAK,aAAa,KAAK,CAAC,KAAM,QAAS,KAAMA,CAAK,CAAC,EACnD,KAAK,MAAM,CACf,EACA,WAAY,IAAM,CACd,KAAK,aAAa,YAAY,EAC9B,KAAK,aAAa,KAAK,CAAC,KAAM,UAAU,CAAC,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,IAAIC,EAOjC,MAAQC,GAA+B,IAAIC,EAAeD,CAAE,EAO5D,SAAWA,GAAkC,IAAIE,EAAkBF,CAAE,CACzE","names":["BackpressurePublisher","sink","value","error","subscriber","count","action","BackpressureSink","subscriber","backpressure","count","value","error","action","data","OneSink","BackpressureSink","subscriber","value","error","ManySink","BackpressureSink","ReplaySink","ManySink","value","error","subscriber","left","replay","i","action","o","count","emit","data","ReplayAllSink","ReplaySink","ReplayLatestSink","ReplaySink","limit","emit","data","ReplayLimitSink","ReplaySink","limit","emit","data","Sinks","OneSink","ManySink","ReplayAllSink","limit","ReplayLatestSink","ReplayLimitSink","AbstractPipePublisher","publisher","onNext","value","onError","error","onComplete","subscription","OneSink","producer","onRequest","onUnsubscribe","constructor","sink","many","unicast","BackpressurePublisher","subscriber","sub","count","fn","request","v","subscriptions","promises","resolve","s","predicate","req","bool","alternative","emitted","replacement","called","prev","scheduler","wrapped","combine","sink","generator","BackpressurePublisher","subscriber","gen","sub","req","count","subject","value","ReplayLatestSink","fn","onNext","onError","error","onComplete","Flux","MicroScheduler","task","DelayScheduler","delay","task","id","Flux","_Flux","AbstractPipePublisher","publisher","generator","combine","ManySink","sink","value","error","iterable","start","count","current","i","factory","pipeSub","onNext","onError","onComplete","_","Mono","lastValue","lastError","force","buffer","MicroScheduler","index","request","n","predicate","skipping","other","open","sub","sub2","seen","comparator","previous","ms","promise","emit","fn","resolve","DelayScheduler","second","first","left","subscriber","reducer","seedFactory","acc","producer","onRequest","onUnsubscribe","constructor","alternative","replacement","scheduler","Mono","_Mono","AbstractPipePublisher","publisher","generator","combine","OneSink","sink","subscription","value","error","promise","err","factory","mapper","pipeSub","pipeSub2","onNext","onError","onComplete","val","request","Flux","other","left","right","fn","_error","_value","resolve","reject","v","producer","onRequest","onUnsubscribe","constructor","predicate","alternative","replacement","scheduler","ImmediateScheduler","task","MacroScheduler","task","IntervalScheduler","delay","task","id","Schedulers","ImmediateScheduler","MicroScheduler","MacroScheduler","ms","DelayScheduler","IntervalScheduler"]}