@bespunky/angular-zen
Version:
The Angular tools you always wished were there.
1 lines • 187 kB
Source Map (JSON)
{"version":3,"file":"bespunky-angular-zen-core.mjs","sources":["../../../../libs/angular-zen/core/src/document-ref/document-ref.service.ts","../../../../libs/angular-zen/core/src/window-ref/window-ref.service.ts","../../../../libs/angular-zen/core/src/rxjs/destroyable/destroyable.ts","../../../../libs/angular-zen/core/src/rxjs/observe/abstraction/observe-base.directive.ts","../../../../libs/angular-zen/core/src/rxjs/observe/directives/observe.directive.ts","../../../../libs/angular-zen/core/src/rxjs/observe/abstraction/observe-map-base.directive.ts","../../../../libs/angular-zen/core/src/rxjs/observe/directives/observe-latest.directive.ts","../../../../libs/angular-zen/core/src/rxjs/observe/abstraction/observe-array-base.directive.ts","../../../../libs/angular-zen/core/src/rxjs/observe/directives/observe-concat.directive.ts","../../../../libs/angular-zen/core/src/rxjs/observe/directives/observe-join.directive.ts","../../../../libs/angular-zen/core/src/rxjs/observe/directives/observe-merge.directive.ts","../../../../libs/angular-zen/core/src/rxjs/observe/observe.module.ts","../../../../libs/angular-zen/core/src/rxjs/on-observer/utils/time-utils.ts","../../../../libs/angular-zen/core/src/rxjs/on-observer/abstraction/types/on-observer-context.ts","../../../../libs/angular-zen/core/src/rxjs/on-observer/abstraction/types/observer-call.ts","../../../../libs/angular-zen/core/src/rxjs/on-observer/abstraction/types/view-render-commitment.ts","../../../../libs/angular-zen/core/src/rxjs/on-observer/abstraction/on-observer-base.directive.ts","../../../../libs/angular-zen/core/src/rxjs/on-observer/directives/on-observer.directive.ts","../../../../libs/angular-zen/core/src/rxjs/on-observer/directives/on-observer-resolving.directive.ts","../../../../libs/angular-zen/core/src/rxjs/on-observer/directives/on-observer-next.directive.ts","../../../../libs/angular-zen/core/src/rxjs/on-observer/directives/on-observer-error.directive.ts","../../../../libs/angular-zen/core/src/rxjs/on-observer/directives/on-observer-complete.directive.ts","../../../../libs/angular-zen/core/src/rxjs/on-observer/directives/on-observer-active.directive.ts","../../../../libs/angular-zen/core/src/rxjs/on-observer/directives/on-observer-finalized.directive.ts","../../../../libs/angular-zen/core/src/rxjs/on-observer/on-observer.module.ts","../../../../libs/angular-zen/core/src/core.module.ts","../../../../libs/angular-zen/core/src/head/head.service.ts","../../../../libs/angular-zen/core/src/bespunky-angular-zen-core.ts"],"sourcesContent":["import { ExistingProvider, Inject, Injectable, InjectionToken } from '@angular/core';\nimport { DOCUMENT as ANGULAR_DOCUMENT } from '@angular/common';\n\n/** A token used to provide the native document implementation for `DocumentRef`. By default, `CoreModule` will provide angular's DOCUMENT token. */\nexport const DOCUMENT = new InjectionToken<Document>('DocumentToken');\n\n/**\n * Provides an injectable wrapper for the `document` object.\n * Inject this in your services/components and you will be able to easily mock or spy on the native `document` object in your tests.\n * \n * By default, the `nativeDocument` property will point to angular's DOM adapter, thus facilitating DOM access and manipulation\n * on the different platforms.\n * To mock the native document, provide a value for the `DOCUMENT` token from `@bespunky/angular-zen/core`.\n * You will safely mock it without trashing angular's `DOCUMENT` provider.\n * \n * @see document-ref.service.spec.ts for examples.\n */\n@Injectable({ providedIn: 'root' })\nexport class DocumentRef\n{\n // Treating native document as `any` save users typecasting everytime and deducing if the object is of type `Document` or `object`.\n /**\n * Creates an instance of `DocumentRef`.\n * \n * @param {*} nativeDocument The native document provided by the `DOCUMENT` token of `@bespunky/angular-zen/core`. See `DocumentRef` for details. \n */\n constructor(@Inject(DOCUMENT) public readonly nativeDocument: any) { }\n}\n\n/**\n * The default provider for the `DOCUMENT` token. Uses angular's DOM adapters which will be injected according to the platform.\n */\nexport const DocumentProvider: ExistingProvider = {\n provide : DOCUMENT,\n useExisting: ANGULAR_DOCUMENT\n};\n\n/**\n * A bundle of all providers needed for DocumentRef to work.\n */\nexport const DocumentRefProviders = [DocumentProvider];\n","import { InjectionToken, PLATFORM_ID, FactoryProvider, Inject, Injectable } from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\n\n/**\n * An injectable token that will allow us to replace the provider for the native window object when necessary (e.g. mocking the `window` object).\n */\nexport const WINDOW = new InjectionToken<Window>('WindowToken');\n\n/**\n * Provides an injectable wrapper for the `window` object.\n *\n * Inject this in your services/components and you will be able to easily mock or spy on the native `window` object in your tests.\n * You can replace the default `WINDOW` token provider, which allows you to mock the `window` object.\n *\n * @see window-ref.service.spec.ts for examples.\n */\n@Injectable({ providedIn: 'root' })\nexport class WindowRef\n{\n // Treating native window as `any` save users typecasting everytime and deducing if the object is of type `Window` or `object`.\n /**\n * Creates an instance of WindowRef.\n * \n * @param {*} nativeWindow The native window provided by the `WINDOW` token of `@bespunky/angular-zen/core`. See `WindowRef` for details. \n */\n constructor(@Inject(WINDOW) public readonly nativeWindow: any) { }\n}\n\n/**\n * Provides a platform dependant implementation for retrieving the `window` object.\n *\n * @returns `window` for browser platforms and a new object for non-browser platforms.\n */\nexport function windowFactory(platformId: any): Window | Object\n{\n return isPlatformBrowser(platformId) ? window : new Object();\n}\n\n/**\n * The default provider for the `WINDOW` token. Provides `window` for browser platforms and a new object for non-browser platforms.\n */\nexport const WindowProvider: FactoryProvider = {\n provide: WINDOW,\n useFactory: windowFactory,\n deps: [PLATFORM_ID]\n};\n\n/**\n * A bundle of all providers needed for WindowRef to work.\n */\nexport const WindowRefProviders = [WindowProvider];\n","import { Observable, PartialObserver, Subject, Subscription } from 'rxjs';\nimport { Directive, OnDestroy } from '@angular/core';\n\n/**\n * Facilitates working with components, directives and services which manually subscribe to observables.\n * Extend this class to easily hook into ngOnDestroy and avoid memory leaks.\n *\n * @see [Wiki](https://bs-angular-zen.web.app/docs/zen/additional-documentation/coremodule/destroyable-(abstract).html) for full guide.\n * \n * @export\n * @abstract\n * @class Destroyable\n * @implements {OnDestroy}\n */\n@Directive()\nexport abstract class Destroyable implements OnDestroy\n{\n /**\n * Emits a value when `ngOnDestroy()` is called.\n * Pipe together with `takeUntil()` to auto unsubscribe from your observables.\n *\n * @example\n * observable.pipe(takeUntil(this.destroyed)).subscribe(...);\n * \n * @protected\n * @type {Subject<void>}\n */\n protected readonly destroyed : Subject<void> = new Subject();\n /**\n * A list of all subscriptions manually added using the `subscribe()` method.\n * These are automatically unsubscribed when `ngOnDestroy()` is called.\n *\n * @protected\n * @type {Subscription}\n */\n protected readonly subscriptions: Subscription = new Subscription();\n\n ngOnDestroy()\n {\n this.destroyed.next();\n this.destroyed.complete();\n \n this.subscriptions.unsubscribe();\n }\n \n /**\n * Subscribes to an observable and stores the subscription for automatic disposal.\n * When `ngOnDestroy()` is called, all subscriptions created with this method will unsubscribe.\n *\n * @protected\n * @template T The type of data the observable will emit.\n * @param {Observable<T>} observable The observable to subscribe to.\n * @param {(value: T) => void} [next] (Optional) A callback function to execute on each emission of the observable.\n * @param {(error: any) => void} [error] (Optional) A callback function to execute when the observable errors.\n * @param {() => void} [complete] (Optional) A callback function to execute when the observable completes.\n * @returns {Subscription} The subscription created for the observable.\n */\n protected subscribe<T>(observable: Observable<T>, next?: (value: T) => void, error?: (error: unknown) => void, complete?: () => void): Subscription;\n /**\n * Subscribes to an observable and stores the subscription for automatic disposal.\n * When `ngOnDestroy()` is called, all subscriptions created with this method will unsubscribe.\n *\n * @protected\n * @template T The type of data the observable will emit.\n * @param {Observable<T>} observable The observable to subscribe to.\n * @param {PartialObserver<T>} [observer] The observer that will handle observable events.\n * @returns {Subscription} The subscription created for the observable.\n */\n protected subscribe<T>(observable: Observable<T>, observer?: PartialObserver<T>): Subscription;\n protected subscribe<T>(observable: Observable<T>, observerOrNext?: PartialObserver<T> | ((value: T) => void), error?: (error: unknown) => void, complete?: () => void): Subscription\n {\n // Cast partial observer object\n const observer = observerOrNext instanceof Function ? {\n next: observerOrNext,\n error,\n complete\n } : observerOrNext;\n\n this.subscriptions.add(observable.subscribe(observer));\n\n return this.subscriptions;\n }\n}","import { EMPTY, Observable, Notification, BehaviorSubject } from 'rxjs';\nimport { map, materialize, share, switchMap, tap } from 'rxjs/operators';\nimport { Directive, EmbeddedViewRef, TemplateRef, ViewContainerRef, EventEmitter, Output, OnInit } from '@angular/core';\n\nimport { Destroyable } from '../../destroyable/destroyable';\nimport { ResolvedObserveContext } from './types/general';\n\n/**\n * The base class for all `*observeXXX` directives.\n * This directive bind an observable or a collection of observables with a template, causing the values in the template to be updated whenever the observables emit.\n * \n * Any template assigned with the directive will render immediately, and its view context will be updated with the emitted value on\n * each emission. The directive will be responsible for subscribing on init and unsubscribing on destroy.\n * \n * ## Features\n * \n * #### Shared observable\n * The watched observable will automatically be multicasted so that any child observables created by the template will use the same\n * stream.\n * \n * The shared observable can be accessed using the `let source = source` microsyntax.\n * \n * #### Observer events\n * Whenever the observable changes state or emits a value, the corresponding event is emitted: \n * `nextCalled` - A value has been emitted. `$event` will be the emitted value. \n * `errorCalled` - An error has occured in the pipeline. `$event` will be the error. \n * `completeCalled` - The observable has completed. `$event` will be void.\n *\n * > Because of limitations to Angular's Structural Directives, in order to bind the events the desugared syntax must be used.\n * This, for example, **will trigger** the event:\n * > ```html\n * ><ng-template [observe]=\"x$\" let-source=\"source\" (nextCalled)=\"onNext($event)\">\n * > ...\n * ></ng-template>\n * > ```\n * >\n * >This **will NOT trigger** the event:\n * >```html\n * > <div *observe=\"x$; let source = source\" (nextCalled)=\"onNext($event)\">...</div>\n * >```\n * \n * ## ⚠️ Extending notes:\n * As the base class cannot deduce the directive selector (e.g. `observeLatest`, `observeMerge`, etc.) the extending class\n * is required to do 4 things:\n * 1. Implement the abstract `selector` member and assign it with the directive's selector.\n * 2. Implement and `@Input() public set <selector>(value: T)` which will pass its value to the `input` member.\n * 3. Implement a static context TypeGuard.\n * \n * These will enable Angular features like template type checking and the microsyntax `as` keyword.\n * \n * @export\n * @abstract\n * @class ObserveBaseDirective\n * @extends {Destroyable}\n * @implements {OnInit}\n * @template TInput The type of value this directive will work with. Depends on the extending class.\n * @template TResolved The type of value emitted by the observable. Depends on the extending class.\n * @template TContext The type of the context object the template will work with.\n */\n@Directive()\nexport abstract class ObserveBaseDirective<TInput, TResolved, TContext extends ResolvedObserveContext<TResolved>>\n extends Destroyable implements OnInit\n{\n /**\n * Triggered whenever the observable emits a value. `$event` will be the emitted value.\n *\n * @type {EventEmitter<TResolved>}\n */\n @Output() public nextCalled : EventEmitter<TResolved> = new EventEmitter();\n /**\n * Triggered when an error occurs in the observable's pipeline. `$event` will be the error.\n *\n * @type {EventEmitter<unknown>}\n */\n @Output() public errorCalled : EventEmitter<unknown> = new EventEmitter();\n /**\n * Triggered when the observable completes. `$event` will be the void.\n *\n * @type {EventEmitter<void>}\n */\n @Output() public completeCalled: EventEmitter<void> = new EventEmitter();\n\n private view!: EmbeddedViewRef<TContext>;\n \n /**\n * The selector defined for the directive extending this class. Will be used to create a corresponding\n * property in the view context in order to make the micro-syntax `as` keyword work.\n *\n * @protected\n * @abstract\n * @type {string}\n */\n protected abstract readonly selector: string;\n /**\n * ### Why BehaviorSubject<{@link TInput s} | null> and not Subject<{@link TInput}>\n * `input` is set from @Input properties. For some reason, Angular passes-in the first value BEFORE\n * ngOnInit, even though other @Input properties (e.g. showAfter, showFor) are passed AFTER ngOnInit.\n * If subscription occurs in the constructor, `input` will emit the first observable too fast, which\n * might lead to pipes breaking or misbehaving if they rely on properties to be instantiated first.\n * \n * This leads to subscribing in ngOnInit, to allow Angular time to initialize those.\n * BUT, if `input` is a Subject, as the first value was already emitted BEFORE ngOnInit, it will not be\n * captured by our subscription to `input`. Hence the BehaviorSubject - To allow capturing that first observable.\n */\n protected readonly input: BehaviorSubject<TInput | null> = new BehaviorSubject(null as TInput | null);\n\n constructor(\n private readonly template : TemplateRef<TContext>,\n private readonly viewContainer: ViewContainerRef\n )\n {\n super();\n \n this.renderView();\n }\n \n ngOnInit()\n {\n // See `this.input` documentation for why subscription is done in ngOnInit.\n this.subscribe(this.contextFeed());\n }\n\n /**\n * Takes the input passed to the directive (which might be an observable, a map or an array of observable for example)\n * and creates an observable that combines and represents all the observables in the value.\n * \n * Intended for applying functions like `combineLatest()`, `contact()`, etc.\n * \n * @protected\n * @abstract\n * @param {TInput} input The input passed to the directive (which might be an observable, a map or an array of observable for example).\n * @return {Observable<TResolved>} An observable which combines and represents all the observables in the input value.\n */\n protected abstract observeInput(input: TInput): Observable<TResolved>;\n\n private contextFeed(): Observable<Notification<TResolved>>\n {\n return this.input.pipe(\n // Whenever a new value is provided into the directive use the extender's implementation to observe it and multicast it.\n map (input => input ? this.observeInput(input).pipe(share()) : EMPTY),\n // Replace the source observable in the context with the newly created observable.\n tap (source => this.updateViewContext({ source })),\n // Switch to the new observable and materialize it to watch for state changes and emit events accordingly\n switchMap(source => source.pipe(materialize())),\n // Whenever a materialized notification is emitted, handle it and emit the relevant event\n tap (meta => this.onStateChange(meta))\n );\n }\n\n private onStateChange(meta: Notification<TResolved>): void\n {\n // Call the appropriate handler according to the received notification\n return meta.observe({\n next: value =>\n {\n this.updateViewContext({ value });\n\n this.nextCalled.emit(value);\n },\n error : error => this.errorCalled.emit(error),\n complete: () => this.completeCalled.emit()\n });\n }\n\n private renderView(): void\n {\n const context = this.createViewContext({});\n\n this.view = this.viewContainer.createEmbeddedView(this.template, context);\n }\n\n private updateViewContext(data: { value?: TResolved | null , source?: Observable<TResolved> }): void\n { \n this.view.context = this.createViewContext(data);\n }\n\n protected createViewContext({ value, source }: { value?: TResolved | null , source?: Observable<TResolved> }): TContext\n {\n value ??= this.view?.context.$implicit || null;\n source ??= this.view?.context.source || EMPTY;\n\n return { $implicit: value, [this.selector]: value, source } as TContext;\n }\n}\n","import { Observable } from 'rxjs';\nimport { Directive, Input } from '@angular/core';\n\nimport { ObserveBaseDirective } from '../abstraction/observe-base.directive';\nimport { EmittedTypeOf, ResolvedObserveContext } from '../abstraction/types/general';\n\ntype ObserveContext<T extends Observable<unknown>> = ResolvedObserveContext<EmittedTypeOf<T>> & {\n observe: EmittedTypeOf<T>\n};\n\n/**\n * Documentation in {@link ObserveDirective.observe} to allow in-template tooltips.\n *\n * @export\n * @class ObserveDirective\n * @extends {ObserveBaseDirective<T, EmittedTypeOf<T>, ObserveContext<T>>}\n * @template T The type of observable received by the directive.\n */\n@Directive({\n selector: '[observe]'\n})\nexport class ObserveDirective<T extends Observable<unknown>>\n extends ObserveBaseDirective<T, EmittedTypeOf<T>, ObserveContext<T>>\n{\n protected selector = 'observe';\n\n /**\n * Tracks an observable and updates the template with its emitted value on each emission.\n *\n * Any template assigned with the directive will render immediately, and its view context will be updated with the emitted value on\n * each emission. The directive will be responsible for subscribing on init and unsubscribing on destroy.\n * \n * ## Features\n * \n * #### Shared observable\n * The watched observable will automatically be multicasted so that any child observables created by the template will use the same\n * stream.\n * \n * The shared observable can be accessed using the `let source = source` microsyntax.\n * \n * #### Observer events\n * Whenever the observable changes state or emits a value, the corresponding event is emitted: \n * `nextCalled` - A value has been emitted. `$event` will be the emitted value. \n * `errorCalled` - An error has occured in the pipeline. `$event` will be the error. \n * `completeCalled` - The observable has completed. `$event` will be void.\n *\n * > Because of limitations to Angular's Structural Directives, in order to bind the events the desugared syntax must be used.\n * This, for example, **will trigger** the event:\n * > ```html\n * ><ng-template [observe]=\"x$\" let-source=\"source\" (nextCalled)=\"onNext($event)\">\n * > ...\n * ></ng-template>\n * > ```\n * >\n * >This **will NOT trigger** the event:\n * >```html\n * > <div *observe=\"x$; let source = source\" (nextCalled)=\"onNext($event)\">...</div>\n * >```\n */\n @Input() public set observe(value: T) { this.input.next(value); }\n \n static ngTemplateContextGuard<T extends Observable<unknown>>(directive: ObserveDirective<T>, context: unknown): context is ObserveContext<T> { return true; }\n \n protected observeInput(input: T): Observable<EmittedTypeOf<T>>\n {\n return input as Observable<EmittedTypeOf<T>>;\n }\n}\n","import { Directive } from '@angular/core';\nimport { Observable } from 'rxjs';\n\nimport { ObserveBaseDirective } from './observe-base.directive';\nimport { ObservableMap, EmittedMapOf, ObserveMapContext } from './types/maps';\n\n/**\n * The base class for `*observe` directives combining observables using a map of observable values (i.e. { x: x$, y: y$ }).\n *\n * Emitted values will be available as the implicit context values but will also be spread into the context by key.\n * Meaning, this would work:\n * ```html\n * <div *observeXXX=\"{ x: x$, y: y$ } as result\">{{result.x}}</div>\n * ```\n * \n * And this also:\n * ```\n * <div *observeXXX=\"{ x: x$, y: y$ }; let x = x\">{{x}}</div>\n * ```\n * \n * @export\n * @abstract\n * @class ObserveMapDirective\n * @extends {ObserveBaseDirective<TInput, EmittedMapOf<TInput>, TContext>}\n * @template TInput The type of observable map.\n * @template TContext The the of context the directive will provide to the view.\n */\n@Directive()\nexport abstract class ObserveMapDirective<TInput extends ObservableMap, TContext extends ObserveMapContext<TInput>>\n extends ObserveBaseDirective<TInput, EmittedMapOf<TInput>, TContext>\n{\n protected override createViewContext(data: { value?: EmittedMapOf<TInput> | null , source?: Observable<EmittedMapOf<TInput>> }): TContext\n {\n // Spread the values emitted from the observable to allow `let` microsyntax and directly accessing them\n return { ...super.createViewContext(data), ...data.value };\n }\n}\n","import { Observable, combineLatest } from 'rxjs';\nimport { Directive, Input } from '@angular/core';\n\nimport { ObserveMapDirective } from '../abstraction/observe-map-base.directive';\nimport { ObserveMapContext, EmittedMapOf, ObservableMap } from '../abstraction/types/maps';\n\ntype ObserveLatestContext<T extends ObservableMap> = ObserveMapContext<T> & {\n observeLatest: EmittedMapOf<T>\n};\n\n/**\n * Documentation in {@link ObserveLatestDirective.observeLatest} to allow in-template tooltips.\n * @export\n * @class ObserveLatestDirective\n * @extends {ObserveMapDirective<T, ObserveLatestContext<T>>}\n * @template T The type of observables map received by the directive.\n */\n@Directive({\n selector: '[observeLatest]'\n})\nexport class ObserveLatestDirective<T extends { [key: string]: Observable<unknown> }>\n extends ObserveMapDirective<T, ObserveLatestContext<T>>\n{\n // Seems like for template typechecking to work with a generic type holding `unknown`, the generic type must be flattened\n // and not represented by a new type. When I tried creating an ObservableMap = { ...key: Observable<unknown> } and use it\n // as T extends ObservableMap, the type system failed to infer the inner types of the observables.\n // T extends { ...key: Observable<unknown> } works fine.\n\n protected selector = 'observeLatest';\n\n /**\n * Combines a map of observables using rxjs {@link https://rxjs.dev/api/index/function/combineLatest combineLatest()} and exposes the emitted values to the template.\n * Values are exposed in a map which keys are the same keys as the original observable map and values are\n * the emitted values corresponding to those keys.\n * \n * Emitted values will be available as the implicit context values but will also be spread into the context by key.\n * Meaning, this would work:\n * ```html\n * <div *observeLatest=\"{ x: x$, y: y$ } as result\">{{result.x}}</div>\n * ```\n * \n * And this also:\n * ```\n * <div *observeLatest=\"{ x: x$, y: y$ }; let x = x\">{{x}}</div>\n * ```\n *\n * Any template assigned with the directive will render immediately, and its view context will be updated with the emitted value on\n * each emission. The directive will be responsible for subscribing on init and unsubscribing on destroy.\n * \n * ## Features\n * \n * #### Shared observable\n * The watched observable will automatically be multicasted so that any child observables created by the template will use the same\n * stream.\n * \n * The shared observable can be accessed using the `let source = source` microsyntax.\n * \n * #### Observer events\n * Whenever the observable changes state or emits a value, the corresponding event is emitted: \n * `nextCalled` - A value has been emitted. `$event` will be the emitted value. \n * `errorCalled` - An error has occured in the pipeline. `$event` will be the error. \n * `completeCalled` - The observable has completed. `$event` will be void.\n *\n * > Because of limitations to Angular's Structural Directives, in order to bind the events the desugared syntax must be used.\n * This, for example, **will trigger** the event:\n * > ```html\n * ><ng-template [observe]=\"x$\" let-source=\"source\" (nextCalled)=\"onNext($event)\">\n * > ...\n * ></ng-template>\n * > ```\n * >\n * >This **will NOT trigger** the event:\n * >```html\n * > <div *observe=\"x$; let source = source\" (nextCalled)=\"onNext($event)\">...</div>\n * >```\n */\n @Input() public set observeLatest(value: T) { this.input.next(value); }\n \n static ngTemplateContextGuard<T extends { [key: string]: Observable<unknown> }>(directive: ObserveLatestDirective<T>, context: unknown): context is ObserveLatestContext<T> { return true; }\n \n protected observeInput(input: T): Observable<EmittedMapOf<T>>\n {\n return combineLatest(input) as Observable<EmittedMapOf<T>>;\n }\n}\n","import { Directive } from '@angular/core';\n\nimport { ObserveBaseDirective } from './observe-base.directive';\nimport { ResolvedObserveContext } from './types/general';\nimport { ObservableArray } from './types/arrays';\n\n/**\n * The base class for `*observe` directives combining observables using an array of observable values (i.e. [x$, y$]).\n *\n * @export\n * @abstract\n * @class ObserveArrayDirective\n * @extends {ObserveBaseDirective<TInput, TResolved, TContext>}\n * @template TInput The type of observable array.\n * @template TResolved The type of resolved array.\n * @template TContext The the of context the directive will provide to the view.\n */\n@Directive()\nexport abstract class ObserveArrayDirective<TInput extends ObservableArray, TResolved, TContext extends ResolvedObserveContext<TResolved> = ResolvedObserveContext<TResolved>>\n extends ObserveBaseDirective<TInput, TResolved, TContext>\n{\n\n}\n","import { Observable, concat } from 'rxjs';\nimport { Directive, Input } from '@angular/core';\n\nimport { ObserveArrayDirective } from '../abstraction/observe-array-base.directive';\nimport { ResolvedObserveContext } from '../abstraction/types/general';\nimport { EmittedArrayTypesOf } from '../abstraction/types/arrays';\n\ntype ObserveConcatContext<TInput extends Observable<unknown>[]> = ResolvedObserveContext<EmittedArrayTypesOf<TInput>> & {\n observeConcat: EmittedArrayTypesOf<TInput>\n};\n\n/**\n * Documentation in {@link ObserveConcatDirective.observeConcat} to allow in-template tooltips.\n *\n * @export\n * @class ObserveConcatDirective\n * @extends {ObserveArrayDirective<T, EmittedArrayTypesOf<T>, ObserveConcatContext<T>>}\n * @template T The type of observables tuple received by the directive.\n */\n@Directive({\n selector: '[observeConcat]'\n})\nexport class ObserveConcatDirective<T extends Observable<unknown>[]>\n extends ObserveArrayDirective<T, EmittedArrayTypesOf<T>, ObserveConcatContext<T>>\n{\n protected selector = 'observeConcat';\n\n /**\n * Concats an array of observables using rxjs {@link https://rxjs.dev/api/index/function/concat concat()} and exposes the emitted values to the template.\n * \n * Any template assigned with the directive will render immediately, and its view context will be updated with the emitted value on\n * each emission. The directive will be responsible for subscribing on init and unsubscribing on destroy.\n * \n * ## Features\n * \n * #### Shared observable\n * The watched observable will automatically be multicasted so that any child observables created by the template will use the same\n * stream.\n * \n * The shared observable can be accessed using the `let source = source` microsyntax.\n * \n * #### Observer events\n * Whenever the observable changes state or emits a value, the corresponding event is emitted: \n * `nextCalled` - A value has been emitted. `$event` will be the emitted value. \n * `errorCalled` - An error has occured in the pipeline. `$event` will be the error. \n * `completeCalled` - The observable has completed. `$event` will be void.\n *\n * > Because of limitations to Angular's Structural Directives, in order to bind the events the desugared syntax must be used.\n * This, for example, **will trigger** the event:\n * > ```html\n * ><ng-template [observe]=\"x$\" let-source=\"source\" (nextCalled)=\"onNext($event)\">\n * > ...\n * ></ng-template>\n * > ```\n * >\n * >This **will NOT trigger** the event:\n * >```html\n * > <div *observe=\"x$; let source = source\" (nextCalled)=\"onNext($event)\">...</div>\n * >```\n */\n @Input() public set observeConcat(value: T) { this.input.next(value); }\n\n static ngTemplateContextGuard<T extends Observable<unknown>[]>(directive: ObserveConcatDirective<T>, context: unknown): context is ObserveConcatContext<T> { return true; }\n\n protected observeInput(input: T): Observable<EmittedArrayTypesOf<T>>\n {\n return concat(...input) as Observable<EmittedArrayTypesOf<T>>;\n }\n}\n","import { Observable, forkJoin } from 'rxjs';\nimport { Directive, Input } from '@angular/core';\n\nimport { ObserveMapDirective } from '../abstraction/observe-map-base.directive';\nimport { EmittedMapOf, ObservableMap, ObserveMapContext } from '../abstraction/types/maps';\n\ntype ObserveJoinContext<T extends ObservableMap> = ObserveMapContext<T> & {\n observeJoin: EmittedMapOf<T>\n};\n\n/**\n * Documentation in {@link ObserveJoinDirective.observeJoin} to allow in-template tooltips.\n * @export\n * @class ObserveJoinDirective\n * @extends {ObserveMapDirective<T, ObserveJoinContext<T>>}\n * @template T The type of observables map received by the directive.\n */\n@Directive({\n selector: '[observeJoin]'\n})\nexport class ObserveJoinDirective<T extends { [key: string]: Observable<unknown> }>\n extends ObserveMapDirective<T, ObserveJoinContext<T>>\n{\n protected selector = 'observeJoin';\n\n /**\n * Joins a map of observables using rxjs {@link https://rxjs.dev/api/index/function/forkJoin forkJoin()} and exposes the emitted values to the template.\n * Values are exposed in a map which keys are the same keys as the original observable map and values are\n * the emitted values corresponding to those keys.\n * \n * Emitted values will be available as the implicit context values but will also be spread into the context by key.\n * Meaning, this would work:\n * ```html\n * <div *observeJoin=\"{ x: x$, y: y$ } as result\">{{result.x}}</div>\n * ```\n * \n * And this also:\n * ```\n * <div *observeJoin=\"{ x: x$, y: y$ }; let x = x\">{{x}}</div>\n * ```\n *\n * Any template assigned with the directive will render immediately, and its view context will be updated with the emitted value on\n * each emission. The directive will be responsible for subscribing on init and unsubscribing on destroy.\n * \n * ## Features\n * \n * #### Shared observable\n * The watched observable will automatically be multicasted so that any child observables created by the template will use the same\n * stream.\n * \n * The shared observable can be accessed using the `let source = source` microsyntax.\n * \n * #### Observer events\n * Whenever the observable changes state or emits a value, the corresponding event is emitted: \n * `nextCalled` - A value has been emitted. `$event` will be the emitted value. \n * `errorCalled` - An error has occured in the pipeline. `$event` will be the error. \n * `completeCalled` - The observable has completed. `$event` will be void.\n *\n * > Because of limitations to Angular's Structural Directives, in order to bind the events the desugared syntax must be used.\n * This, for example, **will trigger** the event:\n * > ```html\n * ><ng-template [observe]=\"x$\" let-source=\"source\" (nextCalled)=\"onNext($event)\">\n * > ...\n * ></ng-template>\n * > ```\n * >\n * >This **will NOT trigger** the event:\n * >```html\n * > <div *observe=\"x$; let source = source\" (nextCalled)=\"onNext($event)\">...</div>\n * >```\n */\n @Input() public set observeJoin(value: T) { this.input.next(value); }\n \n static ngTemplateContextGuard<T extends { [key: string]: Observable<unknown> }>(directive: ObserveJoinDirective<T>, context: unknown): context is ObserveJoinContext<T> { return true; }\n \n protected observeInput(input: T): Observable<EmittedMapOf<T>>\n {\n return forkJoin(input) as Observable<EmittedMapOf<T>>;\n }\n}\n","import { Observable, merge } from 'rxjs';\nimport { Directive, Input } from '@angular/core';\n\nimport { ObserveArrayDirective } from '../abstraction/observe-array-base.directive';\nimport { ResolvedObserveContext } from '../abstraction/types/general';\nimport { ObservableArray, EmittedArrayTypesOf } from '../abstraction/types/arrays';\n\ntype ObserveMergeContext<T extends ObservableArray> = ResolvedObserveContext<EmittedArrayTypesOf<T>> & {\n observeMerge: EmittedArrayTypesOf<T>\n};\n\n/**\n * Documentation in {@link ObserveMergeDirective.observeMerge} to allow in-template tooltips.\n *\n * @export\n * @class ObserveMergeDirective\n * @extends {ObserveArrayDirective<T, EmittedArrayTypesOf<T>, ObserveMergeContext<T>>}\n * @template T The type of observables tuple received by the directive.\n */\n@Directive({\n selector: '[observeMerge]'\n})\nexport class ObserveMergeDirective<T extends Observable<unknown>[]>\n extends ObserveArrayDirective<T, EmittedArrayTypesOf<T>, ObserveMergeContext<T>>\n{\n protected selector = 'observeMerge';\n\n /**\n * Combines an array of observables using rxjs {@link https://rxjs.dev/api/index/function/merge merge()} and exposes the emitted values to the template.\n * \n * Any template assigned with the directive will render immediately, and its view context will be updated with the emitted value on\n * each emission. The directive will be responsible for subscribing on init and unsubscribing on destroy.\n * \n * ## Features\n * \n * #### Shared observable\n * The watched observable will automatically be multicasted so that any child observables created by the template will use the same\n * stream.\n * \n * The shared observable can be accessed using the `let source = source` microsyntax.\n * \n * #### Observer events\n * Whenever the observable changes state or emits a value, the corresponding event is emitted: \n * `nextCalled` - A value has been emitted. `$event` will be the emitted value. \n * `errorCalled` - An error has occured in the pipeline. `$event` will be the error. \n * `completeCalled` - The observable has completed. `$event` will be void.\n *\n * > Because of limitations to Angular's Structural Directives, in order to bind the events the desugared syntax must be used.\n * This, for example, **will trigger** the event:\n * > ```html\n * ><ng-template [observe]=\"x$\" let-source=\"source\" (nextCalled)=\"onNext($event)\">\n * > ...\n * ></ng-template>\n * > ```\n * >\n * >This **will NOT trigger** the event:\n * >```html\n * > <div *observe=\"x$; let source = source\" (nextCalled)=\"onNext($event)\">...</div>\n * >```\n */\n @Input() public set observeMerge(value: T) { this.input.next(value); }\n \n static ngTemplateContextGuard<T extends Observable<unknown>[]>(directive: ObserveMergeDirective<T>, context: unknown): context is ObserveMergeContext<T> { return true; }\n \n protected observeInput(input: T): Observable<EmittedArrayTypesOf<T>>\n {\n return merge(...input) as Observable<EmittedArrayTypesOf<T>>;\n }\n}\n","import { NgModule } from '@angular/core';\n\nimport { ObserveDirective } from './directives/observe.directive';\nimport { ObserveLatestDirective } from './directives/observe-latest.directive';\nimport { ObserveConcatDirective } from './directives/observe-concat.directive';\nimport { ObserveJoinDirective } from './directives/observe-join.directive';\nimport { ObserveMergeDirective } from './directives/observe-merge.directive';\n\n/**\n * Provides directives to facilitate in-template subscription management to observables.\n *\n * @export\n * @class ObserveModule\n */\n@NgModule({\n declarations: [\n ObserveDirective,\n ObserveLatestDirective,\n ObserveJoinDirective,\n ObserveMergeDirective,\n ObserveConcatDirective,\n ],\n exports: [\n ObserveDirective,\n ObserveLatestDirective,\n ObserveJoinDirective,\n ObserveMergeDirective,\n ObserveConcatDirective,\n ]\n})\nexport class ObserveModule { }\n","import { DurationAnnotation, DurationUnit, DurationBreakdown } from '../abstraction/types/general';\n\nconst DurationMultipliers: Record<DurationUnit, number> = { ms: 1, s: 1000, m: 60000 };\n\nexport function durationToMs(duration: DurationAnnotation): number\n{\n if (typeof duration === 'number') return duration;\n\n const regex = /(?<value>\\d+(.\\d+)?)(?<units>\\w+)/;\n \n const { value, units } = duration.match(regex)?.groups as { value: string, units: DurationUnit };\n\n return parseInt(value) * (DurationMultipliers[units] || 1);\n}\n\nexport function breakdownTime(showingForMs: number)\n{\n const dummyDate = new Date(showingForMs);\n\n const showingFor: DurationBreakdown = {\n m: dummyDate.getMinutes(),\n s: dummyDate.getSeconds(),\n ms: dummyDate.getMilliseconds(),\n totalMinutes: showingForMs / DurationMultipliers.m,\n totalSeconds: showingForMs / DurationMultipliers.s,\n totalMilliseconds: showingForMs,\n };\n \n return showingFor;\n}\n","import { ObserverName, DurationBreakdown } from './general';\nimport { ViewRenderCommitment } from './view-render-commitment';\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { OnObserverBaseDirective } from '../on-observer-base.directive';\n\n/**\n * Represents the context to be fed into a view rendered by an {@link OnObserverBaseDirective `*onObserver`} directive.\n * The context is immutable.\n *\n * @export\n * @class OnObserverContext\n * @template TResolved The type of value emitted by the observable the directive is observing.\n */\nexport class OnObserverContext<TResolved>\n{\n // Indexer allows `this[selector]`. See `selector` constructor argument for details.\n [key: string]: unknown;\n\n /**\n * The resolved value as emitted by the original observable.\n * This allows assigning the emitted value to a variable using `let varName;`.\n * \n * @type {TResolved}\n */\n public readonly $implicit?: TResolved;\n\n /**\n * Creates an instance of OnObserverContext.\n */\n constructor(\n /**\n * The selector of the directive which is creating this context. This will be used to assign the emitted value to a\n * property matching the selector, thus enabling the use of the microsyntax `as` keyword.\n */\n selector : string,\n /** The index of the view rendered by the directive. If the directive is in `'single'` view mode, this will always be 0. */\n public readonly index : number,\n /** The name of the observer call which triggered this context creation. */\n public readonly call : ObserverName,\n /** (Optional) The value, if any, that was emitted by the original observable. */\n value? : TResolved,\n /**\n * (Optional) The time left for the view to be rendered. Only used when {@link OnObserverBaseDirective.showFor `showFor`}\n * is specified in the directive.\n */\n public readonly remaining?: DurationBreakdown,\n /**\n * @deprecated Use {@link OnObserverContext.remaining `remaining`} instead. This will be removed in v6.0.0.\n */\n public readonly showingFor?: DurationBreakdown,\n /**\n * (Optional) The time elapsed from the moment the view was rendered. Only used when {@link OnObserverBaseDirective.showFor `showFor`}\n * is specified in the directive.\n */\n public readonly elapsed?: DurationBreakdown\n )\n {\n this.$implicit = this[selector] = value;\n }\n\n /**\n * Creates a context object for the specified view render commitment.\n *\n * @static\n * @template T The type of value emitted by the observable.\n * @param {string} onObserverSelector The selector of the directive which is creating this context.\n * @param {number} index The index of the view rendered by the directive.\n * @param {ViewRenderCommitment<T>} commitment The view render commitment from which to create the context.\n * @return {OnObserverContext<T>} A context object for the specified view render commitment.\n */\n static fromCommitment<T>(onObserverSelector: string, index: number, { call: { name, value } }: ViewRenderCommitment<T>): OnObserverContext<T>\n {\n return new OnObserverContext(onObserverSelector, index, name, value);\n }\n};\n","import { Notification } from 'rxjs';\nimport { ObserverName } from './general';\n\n/** Maps RxJS materialized notification states to their observer handler name. */\nconst StateNotificationMap: Record<'N' | 'E' | 'C', ObserverName> = {\n N: 'next',\n E: 'error',\n C: 'complete'\n};\n\n/**\n * Represents an intercepted observer call made by a materialized observable.\n *\n * @export\n * @class ObserverCall\n * @template T The type of value emitted by the materialized observable.\n */\nexport class ObserverCall<T>\n{\n /**\n * Creates an instance of ObserverCall.\n */\n /**\n * Creates an instance of ObserverCall.\n * @param {ObserverName} name \n * @param {T} [value] \n */\n private constructor(\n /**\n * The name of the intercepted observer call.\n * \n * @type {ObserverName}\n **/\n public readonly name: ObserverName,\n /**\n * (Optional) The value, if any, emitted by the observable.\n * \n * @type {T}\n * @template T The type of value emitted by the observable.\n */\n public readonly value?: T\n ) { }\n\n /**\n * Creates an ObserverCall representing the resolving state of an observable.\n *\n * @static\n * @template T The type of value emitted by the observable.\n * @return {ObserverCall<T>} \n */\n public static resolving<T>(): ObserverCall<T>\n {\n return new ObserverCall<T>('resolving');\n }\n\n /**\n * Extracts the data from a materialized observable notification and creates an `ObserverCall` representation for it.\n *\n * @static\n * @template T The type of value emitted by the observable.\n * @param {Notification<T>} notification The notification received from the materialized observable.\n * @return {ObserverCall<T>} An `ObserverCall` representing the notification and its data.\n */\n public static fromNotification<T>({ kind, value, error }: Notification<T>): ObserverCall<T>\n {\n return new ObserverCall(StateNotificationMap[kind], error || value);\n }\n}\n","import { RenderedView } from './general';\nimport { ObserverCall } from './observer-call';\n\n/**\n * Represents a state describing a view to be rendered or a view already rendered. The state holds the parameterization indicating\n * when a view should be rendered and destroyed, and also holds the rendered view if there is any.\n * \n * States are created every time an {@link ObserverCall} is emitted. They are used by {@link OnObserverBaseDirective `*onObserver`} directives\n * to understand how a view should be rendered and initiate a commitment to render flow.\n *\n * The state is immutable.\n * \n * @export\n * @class ViewRenderState\n * @template T The type of value emitted by the observable.\n */\nexport class ViewRenderCommitment<T>\n{\n /**\n * Creates an instance of ViewRenderState.\n */\n private constructor(\n /** The id of the commitment to render. Allows identifying the state within a state map. */\n public readonly commitmentId: string,\n /** The intercepted call which triggered the commitment to render. */\n public readonly call : ObserverCall<T>,\n /** The duration (in milliseconds) specified as the delay before rendering the view. */\n public readonly showAfter : number,\n /** The duration (in milliseconds) specified as the delay before destroying the view. */\n public readonly showFor : number,\n /**\n * The timestamp at which the view should be rendered. This value is manually specified and not calculated automatically using\n * `Date.now()` upon state creation because states might be recreated before the {@link showAfter} delay is finished.\n * When a state is recreated, the time that has already passed should be considered, thus the previous value should be used. \n */\n public readonly renderAt : number,\n /** (Optional) The rendered view. Will be provided only after the recreation of the state once the delay has passed. */\n public readonly view? : RenderedView<T> | null,\n ) { }\n\n /**\n * The timestamp at which the view should be destroyed.\n *\n * @readonly\n * @type {number}\n */\n public get destroyAt (): number | undefined { return this.showFor ? this.renderAt + this.showFor : undefined; }\n /**\n * `true` if the state represents a view that is currently rendered; otherwise `false`.\n *\n * @readonly\n * @type {boolean}\n */\n public get isRendered(): boolean { return !!this.view; }\n /**\n * `true` if the state represents a view that should be auto-destroyed; otherwise `false`.\n *\n * @readonly\n * @type {boolean}\n */\n public get autoDestroys(): boolean { return !!this.destroyAt; }\n\n /**\n * Creates a new state representing a new, fresh, commitment to render.\n * Should be used in multi-view mode, or in single-view mode when there is nothing rendered.\n *\n * @static\n * @template T The type of value emitted by the observable.\n * @param {ObserverCall<T>} call The intercepted call which triggered this state.\n * @param {number} showAfter The duration (in milliseconds) to wait before rendering the view.\n * @param {number} showFor The duration (in milliseconds) to wait before destroying the view.\n * @return {ViewRenderCommitment<T>} A new state representing fresh commitment to render.\n */\n static create<T>(call: ObserverCall<T>, showAfter: number, showFor: number): ViewRenderCommitment<T>\n {\n const now = Date.now();\n\n return new ViewRenderCommitment(now.toString(), call, showAfter, showFor, now + showAfter);\n }\n\n /**\n * Clones the state and replaces the call which triggered it.\n * Should be used in single-view mode when the view is already rendered and a new call is intercepted to make sure the\n * latest emitted value is specified.\n *\n * @static\n * @template T The type of value emitted by the observable.\n * @param {ViewRenderCommitment<T>} state The state to clone.\n * @param {ObserverCall<T>} call The intercepted call which triggered this state.\n * @return {ViewRenderCommitment<T>} A new state representing an updated commitment to render.\n */\n static update<T>(state: ViewRenderCommitment<T>, call: ObserverCall<T>): ViewRenderCommitment<T>\n {\n const now = Date.now();\n\n // In single-view mode, in case the view is already rendered and a new call is intercepted, the latest emitted value should\n // reset renderAt date so the user has a chance to see the latest value.\n return new ViewRenderCommitment(state.commitmentId, call, state.showAfter, state.showFor, now + state.showAfter, state.view);\n }\n\n /**\n * Clones the state and assigns it with a recently rendered view.\n * Should be used whenever a view is rendered.\n *\n * @static\n * @template T The type of value emitted by the observable.\n * @param {ViewRenderCommitment<T>} state The state to clone.\n * @param {RenderedView<T>} view The rendered view to store in the state.\n * @return {ViewRenderCommitment<T>} A new state with the rendered view.\n */\n static rendered<T>(state: ViewRenderCommitment<T>, view: RenderedView<T>): ViewRenderCommitment<T>\n {\n return new ViewRenderCommitment(state.commitmentId, state.call, state.showAfter, state.showFor, state.renderAt, view);\n }\n}\n","import { Observable, of, forkJoin, BehaviorSubject, EMPTY, animationFrames, interval } from 'rxjs';\nimport { delay, finalize, map, mapTo, materialize, switchMap, takeWhile, tap, startWith, filter } from 'rxjs/operators';\nimport { Directive, OnInit, TemplateRef, ViewContainerRef } from '@angular/core';\n\nimport { Destroyable } from '../../destroyable/destroyable';\nimport { ObserverName, DurationAnnotation, RenderCommitmentMap, ViewMode, RenderedView } from '../abstraction/types/general';\nimport { breakdownTime, durationToMs } from '../utils/time-utils';\nimport { OnObserverContext } from './types/on-observer-context';\nimport { ObserverCall } from './types/observer-call';\nimport { ViewRenderCommitment } from './types/view-render-commitment';\n\n/**\n * The default number of times the countdown will be updated in a rendered view waiting to be auto-destroyed.\n * To change this, the user will have to specify a value for the {@link OnObserverBaseDirective.countdownInterval `countdownInterval`} property.\n **/\nconst DefaultCountdownUpdateCount = 30;\n\n/**\n * Provides functionality for `*onObserver<state>` directives that render templates according to the state of an observable.\n * \n * Any template assigned with the directive will render when the defined observer calls are intercepted, and destroyed when any other calls are\n * intercepted. For example, if the directive intercepts `next` calls, the view will render on the first value emission, then destroy on\n * `complete` or `error`.\n * \n * ## Features\n * \n * #### View Context\n * Use the microsyntax `as` keyword to assign resolved values to a variable.\n * Use the microsyntax `let` keyword to assign the {@link OnObserverContext full context object} to a variable (e.g. `let context`).\n * \n * #### Delayed rendering\n * Specify a value for {@link OnObserverBaseDirective.showAfter `showAfter`} to delay rendering.\n * \n * #### Auto destroy\n * Specify {@link OnObserverBaseDirective.showFor `showFor`} to automatically destroy the view after a certain duration.\n * \n * #### Countdown updates\n * When {@link OnObserverBaseDirective.showFor `showFor`} is specified, the view context will be updated with the time remaining until the view\n * is destroyed and the time elapsed since it was rendered. This allows giving the user feedback in a progress bar, a spinner, a textual timer\n * or any other UI component. \n * \n * Remaining is provided by the {@link OnObserverContext.remaining `remaining`} property. Elapsed time is provided by the {@link OnObserverContext.elapsed `elapsed`}\n * property. Access it by assigning a variable using `let`, like so: \n * `let remaining = remaining`\n * \n * #### Multi view mode\n * Specify {@link OnObserverBaseDirective.viewMode `viewMode = 'multiple'`} to enable rendering a new view for each intercepted call\n * instead of updating a single rendered view. This allows stacking logs, notification snackbars, or any other aggregation functionality.\n * Combined with {@link OnObserverBaseDirective.showFor `showFor`}, this is great for disappearing messages/notifications.\n * \n * #### View index\n * In multi-view mode, the context will contain the index of the view, which can be used for calculations and styling.\n *\n * #### Multi call interception\n * Create different interception combinations by specifying more than one call name in {@link OnObserverBaseDirective.renderOnCallsTo `renderOnCallsTo`}.\n * This allows, for example, the combination of `'error'` and `'complete'` to create a directive named `*onObserverFinalized`.\n * \n * ## Extending\n * As this base class doesn't know what the properties of the extending class will be, extending classes must:\n * 1. Define their selector in the abstract {@link OnObserverBaseDirective.selector `selector`} property. This will allow the directive to\n * assign the view context with a property which will enable the microsyntax `as` keyword.\n * 2. Define the call(s) to intercept and render the view for in the abstract {@link OnObserverBaseDirective.renderOnCallsTo `renderOnCallsTo`}.\n * 3. Define an `@Input() set <selector>` property which will call `this.input.next(value)`.\n * 4. Define an `@Input() set <selector>ViewMode` property which will set `this.viewMode`.\n * 5. Define an `@Input() set <selector>ShowAfter` property which will set `this.showAfter`.\n * 6. Define an `@Input() set <selector>ShowFor` property which will set `this.showFor`.\n * 7. Define an `@Input() set <selector>CountdownInterval` property which will set `this.countdownInterval`.\n * 8. Define this static context type guard to allow strong typing the template:\n * ```ts\n * static ngTemplateContextGuard<T>(directive: ___DIRECTIVE_NAME___<T>, context: unknown): context is OnObserverContext<T>\n * { return true; }\n * ```\n * \n * @export\n * @abstract\n * @class OnObserverBaseDirective\n * @extends {Destroyable}\n * @implements {OnInit}\n * @template T The type of value the observable will emit.\n */\n@Directive()\nexport abstract class OnObserverBaseDirective<T> extends Destroyable implements OnInit\n{\n /**\n * A global commitment map holding all commitments to render for which the directive has created commitment observables.\n * Ids are the timestamp of the observed calls and values are the commitments with their rendering parameters.\n *\n * @private\n * @type {RenderCommitmentMap<T>}\n */\n private commitments: RenderCommitmentMap<T> = new Map();\n\n /**\n * The first commitment in the {@link OnObserverBaseDirective.commitments global commitments map}. Used when working with a single view\n * to retrieve its corresponding single commitment.\n *\n * @readonly\n * @private\n * @type {ViewRenderCommitment<T> | undefined}\n */\n private get mainCommitment(): ViewRenderCommitment<T> | undefined { return this.commitments.values().next().value; }\n\n /**\n * The selector defined for the directive extending this class. Will be used to create a corresponding\n * property in the view context in order to make the micro-syntax `as` keyword work.\n *\n * @protected\n * @abstract\n * @type {string}\n */\n protected abstract readonly selector: string;\n /**\n * The observer name(s) for which to intercept calls.\n *\n * @protected\n * @abstract\n * @type {(ObserverName | ObserverName[])}\n */\n protected abstract renderOnCallsTo : ObserverName | ObserverName[];\n \n /**\n * (Optional) The view mode the directive will operate in: \n * `'single'` - A single view will be rendered on intercepted calls. If a view has already been rendered when a call is intercepted,\n * the existing view will be updated with data from the new call.\n * \n * `'multiple'` - Every new intercepted call will render a new view with its own context and data encapsulated from the current call.\n * \n * Default is `'single'`.\n * \n * ⚠️ Extending classes should:\n * 1. Declare an `@Input()` setter named `{selector}ViewMode` (e.g. onObserverCompleteViewMode) which will set this value.\n * 2. Provide the above documentation for the setter property.\n *\n * @default 'single'\n * @protected\n * @type {ViewMode}\n */\n protected viewMode : ViewMode = 'single';\n /**\n * (Optional) The duration for which the directive should wait before rendering the view once an intercepted call is made.\n * \n * You can specify a number, which will be treated as milliseconds, or a string with the format of `<number><ms | s | ms>`.\n * Numbers can be either integers or floats.\n * For example:\n * - `3000` - Wait for 3 seconds, then render the view.\n * - `'10s'` - Wait for 10 seconds, then render the view.\n * - `'0.5m'` - Wait for 30 seconds, then render the view.\n * - `'100ms'` - Wait for 100 milliseconds, then render the view.\n * \n * Default is `0`, meaning immediately render the view.\n *\n * TODO: ADD LINK TO TOUR OR FULL WIKI PAGE\n * Read more {@link OnObserverBaseDirective About render flow}.\n * \n * ⚠️ Extending classes should:\n * 1. Declare an `@Input()` setter named `{selector}ShowAfter` (e.g. onObserverCompleteShowAfter) which will set this value.\n * 2. Provide the above documentation for the setter property.\n * \n * @protected\n * @type {DurationAnnotation}\n */\n protected showAfter : DurationAnnotation = 0;\n /**\n * (Optional) The duration for which the view should be rendered. When the duration passes, the view will be auto destroyed.\n *\n * You can specify a number, which will be treated as milliseconds, or a string with the format of `<number><ms | s | ms>`.\n * Numbers can be either integers or floats.\n * For example:\n * - `3000` - The view will be destroyed after 3 seconds.\n * - `'10s'` - The view will be destroyed after 10 seconds.\n * - `'0.5m'` - The view will be destroyed after 30 seconds.\n * - `'100ms'` - The view will be destroyed after 100 milliseconds.\n * \n * During the time the view is rendered, the context will be updated with a countdown object to facilitate any UI part used to\n * indicate countdown to the user. The countdown will be exposed through the {@link OnObserverContext.remaining `remaining`}\n * property and the elapsed time through {@link OnObserverContext.elapsed `elapsed`} property in the view context and can both\n * be accessed be declaring a `let` variable (e.g. `let remaining = remaining`).\n * See {@link OnObserverBaseDirective.countdownInterval `countdownInterval`} for changing the updates interval.\n * \n * When unspecified, the view will be destroyed immediately once the observer detects a call different to the intercepted ones.\n * \n * TODO: ADD LINK TO TOUR OR FULL WIKI PAGE\n * Read more {@link OnObserverBaseDirective About render flow}.\n * \n * ⚠️ Extending classes should:\n * 1. Declare an `@Input()` setter named `{selector}ShowFor` (e.g. onObserverCompleteShowFor) which will set this value.\n * 2. Provide the above documentation for the setter property.\n *\n * @protected\n * @type {DurationAnnotation}\n */\n protected showFor? : DurationAnnotation;\n /**\n * ### Only used when passing a value to {@link OnObserverBaseDirective.showFor `showFor`}.\n * \n * (Optional) The interval with which countdown updates should be made to the view's context before it auto destroys.\n * The lower the value, the more updates will be made to the context, but the more resources your directive will consume.\n * \n * You can specify a number, which will be treated as milliseconds, or a string with the format of `<number><ms | s | ms>`.\n * Numbers can be either integers or floats.\n * For example:\n * - `3000` - 3 seconds between each update.\n * - `'10s'` - 10 seconds between each update.\n * - `'0.5m'` - 30 seconds between each update.\n * - `'100ms'` - 100 milliseconds between each update.\n * \n * You can also specify `'animationFrames'` so the countdown gets updated each time the browser is working on animations.\n * \n * When unspecified, the total duration of the countdown will be divided by {@link DefaultCountdownUpdateCount `DefaultCountdownUpdateCount`}\n * to get a fixed interval which will make for {@link DefaultCountdownUpdateCount `DefaultCountdownUpdateCount`} countdown updates.\n * \n * ⚠️ Extending classes should:\n * 1. Declare an `@Input()` setter named `{selector}CountdownInterval` (e.g. onObserverCompleteCountdownInterval) which will set this value.\n * 2. Provide the above documentation for the setter property.\n *\n * @protected\n * @type {DurationAnnotation}\n */\n protected countdownInterval?: DurationAnnotation | 'animationFrames';\n \n /**\n * ### Why BehaviorSubject<... | null> and not Subject<...>\n * `input` is set from @Input properties. For some reason, Angular passes-in the first value BEFORE\n * ngOnInit, even though other @Input properties (e.g. showAfter, showFor) are passed AFTER ngOnInit.\n * If subscription occurs in the constructor, `input` will emit the first observable too fast, which\n * might lead to pipes breaking or misbehaving if they rely on properties to be instantiated first.\n * \n * This leads to subscribing in ngOnInit, to allow Angular time to initialize those.\n * BUT, if `input` is a Subject, as the first value was already emitted BEFORE ngOnInit, it will not be\n * captured by our subscription to `input`. Hence the BehaviorSubject - To allow capturing that first observable.\n */\n protected readonly input: BehaviorSubject<Observable<T> | null> = new BehaviorSubject(null as Observable<T> | null);\n\n /**\n * `true` if {@link OnObserverBaseDirective.viewMode viewMode} is `'single'`; otherwise, `false`.\n *\n * @readonly\n * @type {boolean}\n */\n public get isSingleView(): boolean { return this.viewMode === 'single' ; }\n /**\n * `true` if {@link OnObserverBaseDirective.viewMode viewMode} is `'multiple'`; otherwise, `false`.\n *\n * @readonly\n * @type {boolean}\n */\n public get isMultiView (): boolean { return this.viewMode === 'multiple'; }\n\n constructor(private readonly template: TemplateRef<OnObserverContext<T>>, private readonly viewContainer: ViewContainerRef)\n {\n super();\n }\n \n ngOnInit()\n {\n // See `this.input` documentation for why subscription is done in ngOnInit.\n this.subscribe(this.renderFeed());\n }\n\n /**\n * Destroys any rendered view.\n *\n * @private\n */\n private destroyAll(): void\n {\n this.commitments.forEach(({ view }) => view?.destroy());\n }\n\n /**\n * Creates the main feed the directive will subscribe to. The feed will listen to changed to {@link OnObserverBaseDirective.input `input`},\n * then switch to the newly received observable in order to start observing it.\n * The newly received observable will then be materialized and calls will be aggregated as commitment objects with information about\n * what to render and when. Those commitments will pass through the {@link OnObserverBaseDirective.onCommitmentsChanged onCommitmentsChanged()} method\n * which will update the global commitment and create observables with commitments to render and auto destroy views according to the\n * given commitments.\n * \n * This feed is the single reactive entrypoint, meaning any observable created by the directive will be created inside of this\n * observable or its nested observables. Any time a nested observable is created it will be switched to. This allows the pipeline to\n * completely startover when a new call is made or a new {@link OnObserverBaseDirective.input `input`} observable is provided, thus keeping\n * a consistent stream of data to the {@link OnObserverBaseDirective.commitments global commitments map}.\n *\n * @private\n * @return {Observable<ViewRenderCommitment<T>[]>} An observable as described above.\n */\n private renderFeed(): Observable<ViewRenderCommitment<T>[]>\n {\n return this.input.pipe(\n // Make sure views are reset if a new observable is passed-in to the directive\n tap (() => this.destroyAll()),\n // Free memory once the directive is destroyed and the subscription closed\n // TODO: Will this actually execute? `this.subscribe()` doesn't complete the observable but unsubscribes on component destruction\n finalize (() => this.destroyAll()),\n switchMap(input => input ? this.observeInput(input) : EMPTY),\n map (call => this.shouldRender(call) ? this.aggregateCommitments(call) : this.deaggregateCommitments()),\n switchMap(commitments => this.onCommitmentsChanged(commitments)),\n );\n }\n\n /**\n * Materializes the observable and converts notifications to an {@link ObserverCall} object.\n * The returned observable will always start with a `'resolving'` call.\n *\n * @private\n * @param {Observable<T>} input The observable to watch.\n * @return {Observable<ObserverCall<T>>} A materialized observable which describes each observable notification as an {@link ObserverCall} object.\n */\n private observeInput(input: Observable<T>): Observable<ObserverCall<T>>\n {\n return input.pipe(\n materialize(),\n map (ObserverCall.fromNotification),\n startWith (ObserverCall.resolving<T>())\n );\n }\n\n /**\n * Checks whether the given observer call should be rendered according to the interception config in {@link OnObserverBaseDirective.renderOnCallsTo renderOnCallsTo}.\n *\n * @private\n * @param {ObserverCall<T>} The call to check.\n * @return {boolean} `true` if the call should be rendered; otherwise `false`.\n */\n private shouldRender({ name }: ObserverCall<T>): boolean\n {\n const observeOn = Array.isArray(this.renderOnCallsTo) ? this.renderOnCallsTo : [this.renderOnCallsTo];\n \n return observeOn.includes(name);\n }\n \n /**\n * Creates the new commitments map when a new commitment should render.\n * \n * When `viewMode` is `'single'` the map will always contain a single commitment. If the commitment hasn't been rendered yet, a new commitment will be created.\n * Otherwise, the existing commitment will be replaced by a clone with updated parameters (i.e. delay and countdown).\n * \n * When `viewMode` is `'multiple'` a new commitment will always be added to the map.\n *\n * @private\n * @param {ObserverCall<T>} call The new call which should render.\n * @return {RenderCommitmentMap<T>} The new map of commitments to render.\n */\n private aggregateCommitments(call: ObserverCall<T>): RenderCommitmentMap<T>\n {\n const commitments = this.commitments;\n // In single-view mode, if there's already a commitment, we'll replace it with a new one. Otherwise, we'll create a fresh one.\n const newCommitment = this.isSingleView && this.mainCommitment\n ? ViewRenderCommitment.update(this.mainCommitment, call)\n : ViewRenderCommitment.create(call, durationToMs(this.showAfter), durationToMs(this.showFor || 0));\n\n return new Map(commitments.set(newCommitment.commitmentId, newCommitment));\n }\n\n /**\n * Creates the new commitments map when a new commitment shouldn't render.\n *\n * @private\n * @return {RenderCommitmentMap<T>} If `showFor` is specified, meaning views should be auto destroyed after a certain duration,\n * the current commitments will kept alive by returning them as a new map. This will allow recommiting to the same render parameters (i.e. delay and countdown).\n * Otherwise, when views should destroy immediately, an empty map will be returned.\n */\n private deaggregateCommitments(): RenderCommitmentMap<T>\n {\n return this.showFor ? new Map(this.commitments) : new Map();\n }\n \n /**\n * Handles the changes to the current commitment of the watched observable and creates and commits to render all commitments.\n * \n * This will update the global commitment map. If an empty map is passed, all previous commitments will be destroyed.\n *\n * @private\n * @param {RenderCommitmentMap<T>} commitments The current commitment map.\n * @return {Observable<ViewRenderCommitment<T>[]>} An observable joining all render commitments.\n */\n private onCommitmentsChanged(commitments: RenderCommitmentMap<T>): Observable<ViewRenderCommitment<T>[]>\n {\n // If the commitment map has been reset, destroy any previously rendered view\n if (!commitments.size) this.destroyAll();\n\n // Update the global commitment map\n this.commitments = commitments;\n // Map all commitments to a commitment to render observable\n const runCommitments = Array.from(commitments.keys())\n .map((commitmentId, index) => this.commitToRender(commitments, commitmentId, index));\n \n return forkJoin(runCommitments);\n }\n \n /**\n * Creates an observable that initiates the render flow for an emission. Render flow is as follows:\n * 1. Delay render until the time for render (i.e. {@link ViewRenderCommitment.renderAt}) has come.\n * 2. Render the view.\n * 3. Update the {@link OnObserverBaseDirective.commitments global commitments map} with the rendered commitment.\n * 4. Initiate an auto destroy timer. See {@link OnObserverBaseDirective.autoDestroy autoDestroy()}.\n * 5. Remove the destroyed commitment from the {@link OnObserverBaseDirective.commitments global commitments map}.\n *\n * @private\n * @param {RenderCommitmentMap<T>} commitments The current commitment map holding all commitments to render.\n * @param {string} commitmentId The id of the commitment to render.\n * @param {number} index The index of the view to be rendered.\n * @return {Observable<ViewRenderCommitment<T>>} An observable that initiates the render flow for an emission.\n */\n private commitToRender(commitments: RenderCommitmentMap<T>, commitmentId: string, index: number): Observable<ViewRenderCommitment<T>>\n {\n if (!commitments.has(commitmentId)) throw new Error(`\n *${ this.selector } has encountered an inconsistency issue. Tried to commit to rendering commitment with ID ${ commitmentId }, but no commitment object exists with that ID.\n Please consider filing an issue and providing a stack trace here: https://github.com/BeSpunky/angular-zen/issues/new?assignees=BeSpunky&labels=%F0%9F%90%9B+Bug&template=bug_report.md&title=%F0%9F%90%9B+\n `);\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return of(commitments.get(commitmentId)!).pipe(\n switchMap(commitment => this.delayRender(commitment)),\n // Actually perform rendering (or update the view if already rendered)\n switchMap(commitment => this.renderCommitment(commitment, index)),\n // The commitment returned from `renderCommitment()` now contains the view, so update the global map\n tap (renderedCommitment => commitments.set(commitmentId, renderedCommitment)),\n // Initiate the auto-destroy mechanism (will skip if `showFor` wasn't specified)\n switchMap(renderedCommitment => this.autoDestroy(renderedCommitment)),\n // Commitment has completed successfully. Remove it from the global map.\n tap (renderedCommitment => renderedCommitment.autoDestroys ? commitments.delete(commitmentId) : void 0)\n );\n }\n\n /**\n * Creates an observable which delays the pipeline until the time to render the view (i.e. {@link ViewRenderCommitment.renderAt}) comes.\n *\n * @private\n * @param {ViewRenderCommitment<T>} commitment The commitment to delay.\n * @return {Observable<ViewRenderCommitment<T>>} An observable which delays the pipeline until the time to render the view (i.e. {@link ViewRenderCommitment.renderAt}) comes.\n */\n private delayRender(commitment: ViewRenderCommitment<T>): Observable<ViewRenderCommitment<T>>\n {\n return of(commitment).pipe(\n delay(new Date(commitment.renderAt)),\n );\n }\n\n /**\n * Creates a new context for the given commitment and renders (or updates) the view.\n *\n * @private\n * @param {ViewRenderCommitment<T>} commitment The commitment for which to create the context and render the view.\n * @param {number} index The index of the view. If `viewMode` is `'single'` this should always be `0` as there is only one view.\n * @return {Observable<ViewRenderCommitment<T>>} An observable which renderes the commitment, then emits a new updated commitment referencing the rendered view.\n */\n private renderCommitment(commitment: ViewRenderCommitment<T>, index: number): Observable<ViewRenderCommitment<T>>\n {\n const context = OnObserverContext.fromCommitment<T>(this.selector, index, commitment);\n const renderedCommitment = this.renderOrUpdateView(commitment, context);\n\n return of(renderedCommitment);\n }\n\n /**\n * Creates an interval observable which counts down until the time to destroy the view is reached, then destroys the view.\n * While the timer is running, the rendered view's context will be updated in fixed intervals with the time left before destruction.\n * \n * @see {@link OnObserverBaseDirective.defineCountdownInterval defineCountdownInterval()} for more about the fixed countdown interval.\n * \n * If {@link OnObserverBaseDirective.countdownInterval `countdownInterval`} is `'animationFrames'`, the rxjs `animationFrames()` function\n * will be used instead of the interval.\n * \n * @private\n * @param {ViewRenderCommitment<T>} commitment The rendered commitment for which to initiate auto destroy.\n * @return {Observable<ViewRenderCommitment<T>>} A timer observable which counts down until the time to destroy the view is reached, then destroys the view, while\n * updating the context with the time left for destruction. The observable will emit the commitment \n */\n private autoDestroy(commitment: ViewRenderCommitment<T>): Observable<ViewRenderCommitment<T>>\n {\n const { destroyAt, view } = commitment;\n\n if (!(destroyAt && view)) return of(commitment);\n\n const countdownInterval = this.defineCountdownInterval();\n const countdown: Observable<unknown> = countdownInterval === 'animationFrames' ? animationFrames() : interval(countdownInterval);\n\n return countdown.pipe(\n map (() => destroyAt - Date.now()),\n map (timeLeftMs => [timeLeftMs < 0 ? 0 : timeLeftMs, commitment.showFor - timeLeftMs]),\n tap (([timeLeftMs, elapsedTimeMs]) => this.updateViewContextCountdown(view, timeLeftMs, elapsedTimeMs)),\n takeWhile(([timeLeftMs]) => timeLeftMs > 0, true),\n filter (([timeLeftMs]) => timeLeftMs <= 0),\n tap (() => view.destroy()),\n mapTo (commitment)\n );\n }\n\n /**\n * Makes sure the specified commitment is rendered and its context is updated, then returns an updated commitment with the rendered (or updated) view.\n * If the view has been previously rendered, its context will be updated. Otherwise, the view will be rendered for the first time.\n * \n * The new commitment will be used further down the pipeline to update the internal `commitments` map.\n * \n * @see {@link OnObserverBaseDirective.commitToRender `commitToRender()`}.\n *\n * @private\n * @param {ViewRenderCommitment<T>} commitment The commitment for which the view should be rendered.countdown\n * @param {OnObserverContext<T>} context The context object to feed into the view.\n * @return {ViewRenderCommitment<T>} The new commitment containing the rendered (or updated) view.\n */\n private renderOrUpdateView(commitment: ViewRenderCommitment<T>, context: OnObserverContext<T>): ViewRenderCommitment<T>\n {\n if (commitment.view)\n {\n commitment.view.context = context;\n \n return ViewRenderCommitment.rendered(commitment, commitment.view);\n }\n \n return ViewRenderCommitment.rendered(commitment, this.viewContainer.createEmbeddedView(this.template, context));\n }\n\n /**\n * Breaks down the time left before the view is destroyed to its parts and updates the view context so that the user may present\n * a countdown or any other UI component indicating when the view will be destroyed.\n *\n * @private\n * @param {RenderedView<T>} view The view in which to update the countdown.\n * @param {number} timeLeftMs The time left (in milliseconds) for the view before being destroyed.\n * @param {number} timeElapsedMs The time elapsed (in milliseconds) from the moment the view was rendered.\n */\n private updateViewContextCountdown(view: RenderedView<T>, timeLeftMs: number, timeElapsedMs: number): void\n { \n const remaining = breakdownTime(timeLeftMs);\n const elapsed = breakdownTime(timeElapsedMs);\n\n const { $implicit, call, index } = view.context;\n\n // TODO: Remove the `showingFor` argument when launching v6.0.0\n view.context = new OnObserverContext(this.selector, index, call, $implicit, remaining, remaining, elapsed);\n }\n\n /**\n * Defines the interval (in milliseconds) with which countdown updates should be made to the view's context.\n * If the user has defined a value through {@link OnObserverBaseDirective.countdownInterval `countdownInterval`}, that value will be used.\n * If the user has defined `'animationFrames'` as the value for {@link OnObserverBaseDirective.countdownInterval `countdownInterval`}, this will return `'animationFrames'`.\n * Otherwise, {@link OnObserverBaseDirective.showFor `showFor`} will be divided by a fixed number defined by {@link DefaultCountdownUpdateCount `DefaultCountdownUpdateCount`}, currently 30, meaning the user will get\n * 30 countdown updates with fixed intervals between them before the view is destroyed.\n *\n * @private\n * @return {number} The interval with which countdown updates should be made to the view's context.\n */\n private defineCountdownInterval(): number | 'animationFrames'\n {\n // If the view should persist, or it should auto-destroy but percision has been manually specified, do nothing\n if (!this.showFor) throw new Error(`\n Auto-destroy countdown seems to have been initiated when 'showFor' hasn't been set. This shouldn't have happend.\n Please consider filing an issue and providing a stack trace here: https://github.com/BeSpunky/angular-zen/issues/new?assignees=BeSpunky&labels=%F0%9F%90%9B+Bug&template=bug_report.md&title=%F0%9F%90%9B+\n `);\n \n if (this.countdownInterval === 'animationFrames') return 'animationFrames';\n\n if (this.countdownInterval) return durationToMs(this.countdownInterval);\n\n const showForMs = durationToMs(this.showFor);\n\n return showForMs / DefaultCountdownUpdateCount;\n }\n}\n","import { Observable } from 'rxjs';\nimport { Directive, Input } from '@angular/core';\n\nimport { DurationAnnotation, ObserverName, ViewMode } from '../abstraction/types/general';\nimport { OnObserverContext } from '../abstraction/types/on-observer-context';\nimport { OnObserverBaseDirective } from '../abstraction/on-observer-base.directive';\n\n/**\n * Documentation in {@link OnObserverActiveDirective.onObserver} to allow in-template tooltips.\n *\n * @export\n * @class OnObserverDirective\n * @extends {OnObserverBaseDirective<T>}\n * @template T The type of value the observable emits.\n */\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: '[onObserver]'\n})\nexport class OnObserverDirective<T> extends OnObserverBaseDirective<T>\n{\n protected selector = 'onObserver';\n protected renderOnCallsTo!: ObserverName | ObserverName[];\n \n /**\n * Renders the template when the specified observable makes any of the calls specified using {@link OnObserverDirective.onObserverCalls `calls`}.\n * \n * ## Features\n * \n * #### View Context\n * Use the microsyntax `as` keyword to assign resolved values to a variable.\n * Use the microsyntax `let` keyword to assign the {@link OnObserverContext full context object} to a variable (e.g. `let context`).\n * \n * #### Delayed rendering\n * Specify a value for {@link OnObserverBaseDirective.showAfter `showAfter`} to delay rendering.\n * \n * #### Auto destroy\n * Specify {@link OnObserverBaseDirective.showFor `showFor`} to automatically destroy the view after a certain duration.\n * \n * #### Countdown updates\n * When {@link OnObserverBaseDirective.showFor `showFor`} is specified, the view context will be updated with the time remaining until the view\n * is destroyed and the time elapsed since it was rendered. This allows giving the user feedback in a progress bar, a spinner, a textual timer\n * or any other UI component. \n * \n * Remaining is provided by the {@link OnObserverContext.remaining `remaining`} property. Elapsed time is provided by the {@link OnObserverContext.elapsed `elapsed`}\n * property. Access it by assigning a variable using `let`, like so: \n * `let remaining = remaining`\n * \n * #### Multi view mode\n * Specify {@link OnObserverBaseDirective.viewMode `viewMode = 'multiple'`} to enable rendering a new view for each intercepted call\n * instead of updating a single rendered view. This allows stacking logs, notification snackbars, or any other aggregation functionality.\n * Combined with {@link OnObserverBaseDirective.showFor `showFor`}, this is great for disappearing messages/notifications.\n * \n * #### View index\n * In multi-view mode, the context will contain the index of the view, which can be used for calculations and styling.\n *\n * #### Multi call interception\n * Create different interception combinations by specifying more than one call name using {@link OnObserverDirective.onObserverCalls `calls`}.\n * This is how, for example, the combination of `'error'` and `'complete'` was used to create the `*onObserverFinalized` directive.\n */\n @Input() public set onObserver(value: Observable<T>) { this.input.next(value); }\n\n /**\n * Defines the calls to intercept from the observable. Only intercepted calls will render the template.\n */\n @Input() public set onObserverCalls(calls: ObserverName | ObserverName[]) { this.renderOnCallsTo = calls; }\n\n /**\n * (Optional) The view mode the directive will operate in: \n * `'single'` - A single view will be rendered on intercepted calls. If a view has already been rendered when a call is intercepted,\n * the existing view will be updated with data from the new call.\n * \n * `'multiple'` - Every new intercepted call will render a new view with its own context and data encapsulated from the current call.\n * \n * Default is `'single'`.\n */\n @Input() public set onObserverViewMode (viewMode: ViewMode ) { this.viewMode = viewMode; }\n /**\n * (Optional) The duration for which the directive should wait before rendering the view once an intercepted call is made.\n * \n * You can specify a number, which will be treated as milliseconds, or a string with the format of `<number><ms | s | ms>`.\n * Numbers can be either integers or floats.\n * For example:\n * - `3000` - Wait for 3 seconds, then render the view.\n * - `'10s'` - Wait for 10 seconds, then render the view.\n * - `'0.5m'` - Wait for 30 seconds, then render the view.\n * - `'100ms'` - Wait for 100 milliseconds, then render the view.\n * \n * Default is `0`, meaning immediately render the view.\n *\n * TODO: ADD LINK TO TOUR OR FULL WIKI PAGE\n * Read more {@link OnObserverBaseDirective About render flow}.\n **/\n @Input() public set onObserverShowAfter (duration: DurationAnnotation) { this.showAfter = duration; }\n /**\n * (Optional) The duration for which the view should be rendered. When the duration passes, the view will be auto destroyed.\n *\n * You can specify a number, which will be treated as milliseconds, or a string with the format of `<number><ms | s | ms>`.\n * Numbers can be either integers or floats.\n * For example:\n * - `3000` - The view will be destroyed after 3 seconds.\n * - `'10s'` - The view will be destroyed after 10 seconds.\n * - `'0.5m'` - The view will be destroyed after 30 seconds.\n * - `'100ms'` - The view will be destroyed after 100 milliseconds.\n * \n * During the time the view is rendered, the context will be updated with a countdown object to facilitate any UI part used to\n * indicate countdown to the user. The countdown will be exposed through the {@link OnObserverContext.remaining `remaining`}\n * property and the elapsed time through {@link OnObserverContext.elapsed `elapsed`} property in the view context and can both\n * be accessed be declaring a `let` variable (e.g. `let remaining = remaining`).\n * See {@link OnObserverBaseDirective.countdownInterval `countdownInterval`} for changing the updates interval.\n * \n * When unspecified, the view will be destroyed immediately once the observer detects a call different to the intercepted ones.\n * \n * TODO: ADD LINK TO TOUR OR FULL WIKI PAGE\n * Read more {@link OnObserverBaseDirective About render flow}.\n **/\n @Input() public set onObserverShowFor (duration: DurationAnnotation) { this.showFor = duration; };\n /**\n * ### Only used when passing a value to {@link OnObserverBaseDirective.showFor `showFor`}.\n * \n * (Optional) The interval with which countdown updates should be made to the view's context before it auto destroys.\n * The lower the value, the more updates will be made to the context, but the more resources your directive will consume.\n * \n * You can specify a number, which will be treated as milliseconds, or a string with the format of `<number><ms | s | ms>`.\n * Numbers can be either integers or floats.\n * For example:\n * - `3000` - 3 seconds between each update.\n * - `'10s'` - 10 seconds between each update.\n * - `'0.5m'` - 30 seconds between each update.\n * - `'100ms'` - 100 milliseconds between each update.\n * \n * You can also specify `'animationFrames'` so the countdown gets updated each time the browser is working on animations.\n * \n * When unspecified, the total duration of the countdown will be divided by {@link DefaultCountdownUpdateCount `DefaultCountdownUpdateCount`}\n * to get a fixed interval which will make for {@link DefaultCountdownUpdateCount `DefaultCountdownUpdateCount`} countdown updates.\n */\n @Input() public set onObserverCountdownInterval(duration: DurationAnnotation | 'animationFrames') { this.countdownInterval = duration; };\n \n static ngTemplateContextGuard<T>(directive: OnObserverDirective<T>, context: unknown): context is OnObserverContext<T> { return true; }\n}","import { Observable } from 'rxjs';\nimport { Directive, Input } from '@angular/core';\n\nimport { DurationAnnotation, ObserverName, ViewMode } from '../abstraction/types/general';\nimport { OnObserverContext } from '../abstraction/types/on-observer-context';\nimport { OnObserverBaseDirective } from '../abstraction/on-observer-base.directive';\n\n/**\n * Documentation in {@link OnObserverResolvingDirective.onObserverResolving} to allow in-template tooltips.\n *\n * @export\n * @class OnObserverResolvingDirective\n * @extends {OnObserverBaseDirective<T>}\n * @template T The type of value the observable emits.\n */\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: '[onObserverResolving]'\n})\nexport class OnObserverResolvingDirective<T> extends OnObserverBaseDirective<T>\n{\n protected selector = 'onObserverResolving';\n protected renderOnCallsTo: ObserverName = 'resolving';\n \n /**\n * Renders the template when the specified observable is resolving its first value.\n * \n * ## Features\n * \n * #### View Context\n * Use the microsyntax `as` keyword to assign resolved values to a variable.\n * Use the microsyntax `let` keyword to assign the {@link OnObserverContext full context object} to a variable (e.g. `let context`).\n * \n * #### Delayed rendering\n * Specify a value for {@link OnObserverBaseDirective.showAfter `showAfter`} to delay rendering.\n * \n * #### Auto destroy\n * Specify {@link OnObserverBaseDirective.showFor `showFor`} to automatically destroy the view after a certain duration.\n * \n * #### Countdown updates\n * When {@link OnObserverBaseDirective.showFor `showFor`} is specified, the view context will be updated with the time remaining until the view\n * is destroyed and the time elapsed since it was rendered. This allows giving the user feedback in a progress bar, a spinner, a textual timer\n * or any other UI component. \n * \n * Remaining is provided by the {@link OnObserverContext.remaining `remaining`} property. Elapsed time is provided by the {@link OnObserverContext.elapsed `elapsed`}\n * property. Access it by assigning a variable using `let`, like so: \n * `let remaining = remaining`\n * \n * #### Multi view mode\n * Specify {@link OnObserverBaseDirective.viewMode `viewMode = 'multiple'`} to enable rendering a new view for each intercepted call\n * instead of updating a single rendered view. This allows stacking logs, notification snackbars, or any other aggregation functionality.\n * Combined with {@link OnObserverBaseDirective.showFor `showFor`}, this is great for disappearing messages/notifications.\n * \n * #### View index\n * In multi-view mode, the context will contain the index of the view, which can be used for calculations and styling.\n */\n @Input() public set onObserverResolving(value: Observable<T>) { this.input.next(value); }\n\n /**\n * (Optional) The view mode the directive will operate in: \n * `'single'` - A single view will be rendered on intercepted calls. If a view has already been rendered when a call is intercepted,\n * the existing view will be updated with data from the new call.\n * \n * `'multiple'` - Every new intercepted call will render a new view with its own context and data encapsulated from the current call.\n * \n * Default is `'single'`.\n */\n @Input() public set onObserverResolvingViewMode (viewMode: ViewMode ) { this.viewMode = viewMode; }\n /**\n * (Optional) The duration for which the directive should wait before rendering the view once an intercepted call is made.\n * \n * You can specify a number, which will be treated as milliseconds, or a string with the format of `<number><ms | s | ms>`.\n * Numbers can be either integers or floats.\n * For example:\n * - `3000` - Wait for 3 seconds, then render the view.\n * - `'10s'` - Wait for 10 seconds, then render the view.\n * - `'0.5m'` - Wait for 30 seconds, then render the view.\n * - `'100ms'` - Wait for 100 milliseconds, then render the view.\n * \n * Default is `0`, meaning immediately render the view.\n *\n * TODO: ADD LINK TO TOUR OR FULL WIKI PAGE\n * Read more {@link OnObserverBaseDirective About render flow}.\n **/\n @Input() public set onObserverResolvingShowAfter (duration: DurationAnnotation) { this.showAfter = duration; }\n /**\n * (Optional) The duration for which the view should be rendered. When the duration passes, the view will be auto destroyed.\n *\n * You can specify a number, which will be treated as milliseconds, or a string with the format of `<number><ms | s | ms>`.\n * Numbers can be either integers or floats.\n * For example:\n * - `3000` - The view will be destroyed after 3 seconds.\n * - `'10s'` - The view will be destroyed after 10 seconds.\n * - `'0.5m'` - The view will be destroyed after 30 seconds.\n * - `'100ms'` - The view will be destroyed after 100 milliseconds.\n * \n * During the time the view is rendered, the context will be updated with a countdown object to facilitate any UI part used to\n * indicate countdown to the user. The countdown will be exposed through the {@link OnObserverContext.remaining `remaining`}\n * property and the elapsed time through {@link OnObserverContext.elapsed `elapsed`} property in the view context and can both\n * be accessed be declaring a `let` variable (e.g. `let remaining = remaining`).\n * See {@link OnObserverBaseDirective.countdownInterval `countdownInterval`} for changing the updates interval.\n * \n * When unspecified, the view will be destroyed immediately once the observer detects a call different to the intercepted ones.\n * \n * TODO: ADD LINK TO TOUR OR FULL WIKI PAGE\n * Read more {@link OnObserverBaseDirective About render flow}.\n **/\n @Input() public set onObserverResolvingShowFor (duration: DurationAnnotation) { this.showFor = duration; };\n /**\n * ### Only used when passing a value to {@link OnObserverBaseDirective.showFor `showFor`}.\n * \n * (Optional) The interval with which countdown updates should be made to the view's context before it auto destroys.\n * The lower the value, the more updates will be made to the context, but the more resources your directive will consume.\n * \n * You can specify a number, which will be treated as milliseconds, or a string with the format of `<number><ms | s | ms>`.\n * Numbers can be either integers or floats.\n * For example:\n * - `3000` - 3 seconds between each update.\n * - `'10s'` - 10 seconds between each update.\n * - `'0.5m'` - 30 seconds between each update.\n * - `'100ms'` - 100 milliseconds between each update.\n * \n * You can also specify `'animationFrames'` so the countdown gets updated each time the browser is working on animations.\n * \n * When unspecified, the total duration of the countdown will be divided by {@link DefaultCountdownUpdateCount `DefaultCountdownUpdateCount`}\n * to get a fixed interval which will make for {@link DefaultCountdownUpdateCount `DefaultCountdownUpdateCount`} countdown updates.\n */\n @Input() public set onObserverResolvingCountdownInterval(duration: DurationAnnotation | 'animationFrames') { this.countdownInterval = duration; };\n \n static ngTemplateContextGuard<T>(directive: OnObserverResolvingDirective<T>, context: unknown): context is OnObserverContext<T> { return true; }\n}","import { Observable } from 'rxjs';\nimport { Directive, Input } from '@angular/core';\n\nimport { DurationAnnotation, ObserverName, ViewMode } from '../abstraction/types/general';\nimport { OnObserverContext } from '../abstraction/types/on-observer-context';\nimport { OnObserverBaseDirective } from '../abstraction/on-observer-base.directive';\n\n/**\n * Documentation in {@link OnObserverNextDirective.onObserverNext} to allow in-template tooltips.\n *\n * @export\n * @class OnObserverNextDirective\n * @extends {OnObserverBaseDirective<T>}\n * @template T The type of value the observable emits.\n */\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: '[onObserverNext]'\n})\nexport class OnObserverNextDirective<T> extends OnObserverBaseDirective<T>\n{\n protected selector = 'onObserverNext';\n protected renderOnCallsTo: ObserverName = 'next';\n \n /**\n * Renders the template when the specified observable emits a value.\n * \n * ## Features\n * \n * #### View Context\n * Use the microsyntax `as` keyword to assign resolved values to a variable.\n * Use the microsyntax `let` keyword to assign the {@link OnObserverContext full context object} to a variable (e.g. `let context`).\n * \n * #### Delayed rendering\n * Specify a value for {@link OnObserverBaseDirective.showAfter `showAfter`} to delay rendering.\n * \n * #### Auto destroy\n * Specify {@link OnObserverBaseDirective.showFor `showFor`} to automatically destroy the view after a certain duration.\n * \n * #### Countdown updates\n * When {@link OnObserverBaseDirective.showFor `showFor`} is specified, the view context will be updated with the time remaining until the view\n * is destroyed and the time elapsed since it was rendered. This allows giving the user feedback in a progress bar, a spinner, a textual timer\n * or any other UI component. \n * \n * Remaining is provided by the {@link OnObserverContext.remaining `remaining`} property. Elapsed time is provided by the {@link OnObserverContext.elapsed `elapsed`}\n * property. Access it by assigning a variable using `let`, like so: \n * `let remaining = remaining`\n * \n * #### Multi view mode\n * Specify {@link OnObserverBaseDirective.viewMode `viewMode = 'multiple'`} to enable rendering a new view for each intercepted call\n * instead of updating a single rendered view. This allows stacking logs, notification snackbars, or any other aggregation functionality.\n * Combined with {@link OnObserverBaseDirective.showFor `showFor`}, this is great for disappearing messages/notifications.\n * \n * #### View index\n * In multi-view mode, the context will contain the index of the view, which can be used for calculations and styling.\n */\n @Input() public set onObserverNext(value: Observable<T>) { this.input.next(value); }\n\n /**\n * (Optional) The view mode the directive will operate in: \n * `'single'` - A single view will be rendered on intercepted calls. If a view has already been rendered when a call is intercepted,\n * the existing view will be updated with data from the new call.\n * \n * `'multiple'` - Every new intercepted call will render a new view with its own context and data encapsulated from the current call.\n * \n * Default is `'single'`.\n */\n @Input() public set onObserverNextViewMode (viewMode: ViewMode ) { this.viewMode = viewMode; }\n /**\n * (Optional) The duration for which the directive should wait before rendering the view once an intercepted call is made.\n * \n * You can specify a number, which will be treated as milliseconds, or a string with the format of `<number><ms | s | ms>`.\n * Numbers can be either integers or floats.\n * For example:\n * - `3000` - Wait for 3 seconds, then render the view.\n * - `'10s'` - Wait for 10 seconds, then render the view.\n * - `'0.5m'` - Wait for 30 seconds, then render the view.\n * - `'100ms'` - Wait for 100 milliseconds, then render the view.\n * \n * Default is `0`, meaning immediately render the view.\n *\n * TODO: ADD LINK TO TOUR OR FULL WIKI PAGE\n * Read more {@link OnObserverBaseDirective About render flow}.\n **/\n @Input() public set onObserverNextShowAfter (duration: DurationAnnotation) { this.showAfter = duration; }\n /**\n * (Optional) The duration for which the view should be rendered. When the duration passes, the view will be auto destroyed.\n *\n * You can specify a number, which will be treated as milliseconds, or a string with the format of `<number><ms | s | ms>`.\n * Numbers can be either integers or floats.\n * For example:\n * - `3000` - The view will be destroyed after 3 seconds.\n * - `'10s'` - The view will be destroyed after 10 seconds.\n * - `'0.5m'` - The view will be destroyed after 30 seconds.\n * - `'100ms'` - The view will be destroyed after 100 milliseconds.\n * \n * During the time the view is rendered, the context will be updated with a countdown object to facilitate any UI part used to\n * indicate countdown to the user. The countdown will be exposed through the {@link OnObserverContext.remaining `remaining`}\n * property and the elapsed time through {@link OnObserverContext.elapsed `elapsed`} property in the view context and can both\n * be accessed be declaring a `let` variable (e.g. `let remaining = remaining`).\n * See {@link OnObserverBaseDirective.countdownInterval `countdownInterval`} for changing the updates interval.\n * \n * When unspecified, the view will be destroyed immediately once the observer detects a call different to the intercepted ones.\n * \n * TODO: ADD LINK TO TOUR OR FULL WIKI PAGE\n * Read more {@link OnObserverBaseDirective About render flow}.\n **/\n @Input() public set onObserverNextShowFor (duration: DurationAnnotation) { this.showFor = duration; };\n /**\n * ### Only used when passing a value to {@link OnObserverBaseDirective.showFor `showFor`}.\n * \n * (Optional) The interval with which countdown updates should be made to the view's context before it auto destroys.\n * The lower the value, the more updates will be made to the context, but the more resources your directive will consume.\n * \n * You can specify a number, which will be treated as milliseconds, or a string with the format of `<number><ms | s | ms>`.\n * Numbers can be either integers or floats.\n * For example:\n * - `3000` - 3 seconds between each update.\n * - `'10s'` - 10 seconds between each update.\n * - `'0.5m'` - 30 seconds between each update.\n * - `'100ms'` - 100 milliseconds between each update.\n * \n * You can also specify `'animationFrames'` so the countdown gets updated each time the browser is working on animations.\n * \n * When unspecified, the total duration of the countdown will be divided by {@link DefaultCountdownUpdateCount `DefaultCountdownUpdateCount`}\n * to get a fixed interval which will make for {@link DefaultCountdownUpdateCount `DefaultCountdownUpdateCount`} countdown updates.\n */\n @Input() public set onObserverNextCountdownInterval(duration: DurationAnnotation | 'animationFrames') { this.countdownInterval = duration; };\n \n static ngTemplateContextGuard<T>(directive: OnObserverNextDirective<T>, context: unknown): context is OnObserverContext<T> { return true; }\n}","import { Observable } from 'rxjs';\nimport { Directive, Input } from '@angular/core';\n\nimport { DurationAnnotation, ObserverName, ViewMode } from '../abstraction/types/general';\nimport { OnObserverContext } from '../abstraction/types/on-observer-context';\nimport { OnObserverBaseDirective } from '../abstraction/on-observer-base.directive';\n\n/**\n * Documentation in {@link OnObserverErrorDirective.onObserverError} to allow in-template tooltips.\n *\n * @export\n * @class OnObserverErrorDirective\n * @extends {OnObserverBaseDirective<T>}\n * @template T The type of value the observable emits.\n */\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: '[onObserverError]'\n})\nexport class OnObserverErrorDirective<T> extends OnObserverBaseDirective<T>\n{\n protected selector = 'onObserverError';\n protected renderOnCallsTo: ObserverName = 'error';\n \n /**\n * Renders the template when the specified observable errors. The error will be provided as the value in context.\n * \n * ## Features\n * \n * #### View Context\n * Use the microsyntax `as` keyword to assign resolved values to a variable.\n * Use the microsyntax `let` keyword to assign the {@link OnObserverContext full context object} to a variable (e.g. `let context`).\n * \n * #### Delayed rendering\n * Specify a value for {@link OnObserverBaseDirective.showAfter `showAfter`} to delay rendering.\n * \n * #### Auto destroy\n * Specify {@link OnObserverBaseDirective.showFor `showFor`} to automatically destroy the view after a certain duration.\n * \n * #### Countdown updates\n * When {@link OnObserverBaseDirective.showFor `showFor`} is specified, the view context will be updated with the time remaining until the view\n * is destroyed and the time elapsed since it was rendered. This allows giving the user feedback in a progress bar, a spinner, a textual timer\n * or any other UI component. \n * \n * Remaining is provided by the {@link OnObserverContext.remaining `remaining`} property. Elapsed time is provided by the {@link OnObserverContext.elapsed `elapsed`}\n * property. Access it by assigning a variable using `let`, like so: \n * `let remaining = remaining`\n * \n * #### Multi view mode\n * Specify {@link OnObserverBaseDirective.viewMode `viewMode = 'multiple'`} to enable rendering a new view for each intercepted call\n * instead of updating a single rendered view. This allows stacking logs, notification snackbars, or any other aggregation functionality.\n * Combined with {@link OnObserverBaseDirective.showFor `showFor`}, this is great for disappearing messages/notifications.\n * \n * #### View index\n * In multi-view mode, the context will contain the index of the view, which can be used for calculations and styling.\n */\n @Input() public set onObserverError(value: Observable<T>) { this.input.next(value); }\n\n /**\n * (Optional) The view mode the directive will operate in: \n * `'single'` - A single view will be rendered on intercepted calls. If a view has already been rendered when a call is intercepted,\n * the existing view will be updated with data from the new call.\n * \n * `'multiple'` - Every new intercepted call will render a new view with its own context and data encapsulated from the current call.\n * \n * Default is `'single'`.\n */\n @Input() public set onObserverErrorViewMode (viewMode: ViewMode ) { this.viewMode = viewMode; }\n /**\n * (Optional) The duration for which the directive should wait before rendering the view once an intercepted call is made.\n * \n * You can specify a number, which will be treated as milliseconds, or a string with the format of `<number><ms | s | ms>`.\n * Numbers can be either integers or floats.\n * For example:\n * - `3000` - Wait for 3 seconds, then render the view.\n * - `'10s'` - Wait for 10 seconds, then render the view.\n * - `'0.5m'` - Wait for 30 seconds, then render the view.\n * - `'100ms'` - Wait for 100 milliseconds, then render the view.\n * \n * Default is `0`, meaning immediately render the view.\n *\n * TODO: ADD LINK TO TOUR OR FULL WIKI PAGE\n * Read more {@link OnObserverBaseDirective About render flow}.\n **/\n @Input() public set onObserverErrorShowAfter (duration: DurationAnnotation) { this.showAfter = duration; }\n /**\n * (Optional) The duration for which the view should be rendered. When the duration passes, the view will be auto destroyed.\n *\n * You can specify a number, which will be treated as milliseconds, or a string with the format of `<number><ms | s | ms>`.\n * Numbers can be either integers or floats.\n * For example:\n * - `3000` - The view will be destroyed after 3 seconds.\n * - `'10s'` - The view will be destroyed after 10 seconds.\n * - `'0.5m'` - The view will be destroyed after 30 seconds.\n * - `'100ms'` - The view will be destroyed after 100 milliseconds.\n * \n * During the time the view is rendered, the context will be updated with a countdown object to facilitate any UI part used to\n * indicate countdown to the user. The countdown will be exposed through the {@link OnObserverContext.remaining `remaining`}\n * property and the elapsed time through {@link OnObserverContext.elapsed `elapsed`} property in the view context and can both\n * be accessed be declaring a `let` variable (e.g. `let remaining = remaining`).\n * See {@link OnObserverBaseDirective.countdownInterval `countdownInterval`} for changing the updates interval.\n * \n * When unspecified, the view will be destroyed immediately once the observer detects a call different to the intercepted ones.\n * \n * TODO: ADD LINK TO TOUR OR FULL WIKI PAGE\n * Read more {@link OnObserverBaseDirective About render flow}.\n **/\n @Input() public set onObserverErrorShowFor (duration: DurationAnnotation) { this.showFor = duration; };\n /**\n * ### Only used when passing a value to {@link OnObserverBaseDirective.showFor `showFor`}.\n * \n * (Optional) The interval with which countdown updates should be made to the view's context before it auto destroys.\n * The lower the value, the more updates will be made to the context, but the more resources your directive will consume.\n * \n * You can specify a number, which will be treated as milliseconds, or a string with the format of `<number><ms | s | ms>`.\n * Numbers can be either integers or floats.\n * For example:\n * - `3000` - 3 seconds between each update.\n * - `'10s'` - 10 seconds between each update.\n * - `'0.5m'` - 30 seconds between each update.\n * - `'100ms'` - 100 milliseconds between each update.\n * \n * You can also specify `'animationFrames'` so the countdown gets updated each time the browser is working on animations.\n * \n * When unspecified, the total duration of the countdown will be divided by {@link DefaultCountdownUpdateCount `DefaultCountdownUpdateCount`}\n * to get a fixed interval which will make for {@link DefaultCountdownUpdateCount `DefaultCountdownUpdateCount`} countdown updates.\n */\n @Input() public set onObserverErrorCountdownInterval(duration: DurationAnnotation | 'animationFrames') { this.countdownInterval = duration; };\n \n static ngTemplateContextGuard<T>(directive: OnObserverErrorDirective<T>, context: unknown): context is OnObserverContext<T> { return true; }\n}","import { Observable } from 'rxjs';\nimport { Directive, Input } from '@angular/core';\n\nimport { DurationAnnotation, ObserverName, ViewMode } from '../abstraction/types/general';\nimport { OnObserverBaseDirective } from '../abstraction/on-observer-base.directive';\nimport { OnObserverContext } from '../abstraction/types/on-observer-context';\n\n/**\n * Documentation in {@link OnObserverCompleteDirective.onObserverComplete} to allow in-template tooltips.\n *\n * @export\n * @class OnObserverCompleteDirective\n * @extends {OnObserverBaseDirective<T>}\n * @template T The type of value the observable emits.\n */\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: '[onObserverComplete]'\n})\nexport class OnObserverCompleteDirective<T> extends OnObserverBaseDirective<T>\n{\n protected selector = 'onObserverComplete';\n protected renderOnCallsTo: ObserverName = 'complete';\n \n /**\n * Renders the template when the specified observable has completed without error.\n * \n * ## Features\n * \n * #### View Context\n * Use the microsyntax `as` keyword to assign resolved values to a variable.\n * Use the microsyntax `let` keyword to assign the {@link OnObserverContext full context object} to a variable (e.g. `let context`).\n * \n * #### Delayed rendering\n * Specify a value for {@link OnObserverBaseDirective.showAfter `showAfter`} to delay rendering.\n * \n * #### Auto destroy\n * Specify {@link OnObserverBaseDirective.showFor `showFor`} to automatically destroy the view after a certain duration.\n * \n * #### Countdown updates\n * When {@link OnObserverBaseDirective.showFor `showFor`} is specified, the view context will be updated with the time remaining until the view\n * is destroyed and the time elapsed since it was rendered. This allows giving the user feedback in a progress bar, a spinner, a textual timer\n * or any other UI component. \n * \n * Remaining is provided by the {@link OnObserverContext.remaining `remaining`} property. Elapsed time is provided by the {@link OnObserverContext.elapsed `elapsed`}\n * property. Access it by assigning a variable using `let`, like so: \n * `let remaining = remaining`\n * \n * #### Multi view mode\n * Specify {@link OnObserverBaseDirective.viewMode `viewMode = 'multiple'`} to enable rendering a new view for each intercepted call\n * instead of updating a single rendered view. This allows stacking logs, notification snackbars, or any other aggregation functionality.\n * Combined with {@link OnObserverBaseDirective.showFor `showFor`}, this is great for disappearing messages/notifications.\n * \n * #### View index\n * In multi-view mode, the context will contain the index of the view, which can be used for calculations and styling.\n */\n @Input() public set onObserverComplete(value: Observable<T>) { this.input.next(value); }\n\n /**\n * (Optional) The view mode the directive will operate in: \n * `'single'` - A single view will be rendered on intercepted calls. If a view has already been rendered when a call is intercepted,\n * the existing view will be updated with data from the new call.\n * \n * `'multiple'` - Every new intercepted call will render a new view with its own context and data encapsulated from the current call.\n * \n * Default is `'single'`.\n */\n @Input() public set onObserverCompleteViewMode (viewMode: ViewMode ) { this.viewMode = viewMode; }\n /**\n * (Optional) The duration for which the directive should wait before rendering the view once an intercepted call is made.\n * \n * You can specify a number, which will be treated as milliseconds, or a string with the format of `<number><ms | s | ms>`.\n * Numbers can be either integers or floats.\n * For example:\n * - `3000` - Wait for 3 seconds, then render the view.\n * - `'10s'` - Wait for 10 seconds, then render the view.\n * - `'0.5m'` - Wait for 30 seconds, then render the view.\n * - `'100ms'` - Wait for 100 milliseconds, then render the view.\n * \n * Default is `0`, meaning immediately render the view.\n *\n * TODO: ADD LINK TO TOUR OR FULL WIKI PAGE\n * Read more {@link OnObserverBaseDirective About render flow}.\n **/\n @Input() public set onObserverCompleteShowAfter (duration: DurationAnnotation) { this.showAfter = duration; }\n /**\n * (Optional) The duration for which the view should be rendered. When the duration passes, the view will be auto destroyed.\n *\n * You can specify a number, which will be treated as milliseconds, or a string with the format of `<number><ms | s | ms>`.\n * Numbers can be either integers or floats.\n * For example:\n * - `3000` - The view will be destroyed after 3 seconds.\n * - `'10s'` - The view will be destroyed after 10 seconds.\n * - `'0.5m'` - The view will be destroyed after 30 seconds.\n * - `'100ms'` - The view will be destroyed after 100 milliseconds.\n * \n * During the time the view is rendered, the context will be updated with a countdown object to facilitate any UI part used to\n * indicate countdown to the user. The countdown will be exposed through the {@link OnObserverContext.remaining `remaining`}\n * property and the elapsed time through {@link OnObserverContext.elapsed `elapsed`} property in the view context and can both\n * be accessed be declaring a `let` variable (e.g. `let remaining = remaining`).\n * See {@link OnObserverBaseDirective.countdownInterval `countdownInterval`} for changing the updates interval.\n * \n * When unspecified, the view will be destroyed immediately once the observer detects a call different to the intercepted ones.\n * \n * TODO: ADD LINK TO TOUR OR FULL WIKI PAGE\n * Read more {@link OnObserverBaseDirective About render flow}.\n **/\n @Input() public set onObserverCompleteShowFor (duration: DurationAnnotation) { this.showFor = duration; };\n /**\n * ### Only used when passing a value to {@link OnObserverBaseDirective.showFor `showFor`}.\n * \n * (Optional) The interval with which countdown updates should be made to the view's context before it auto destroys.\n * The lower the value, the more updates will be made to the context, but the more resources your directive will consume.\n * \n * You can specify a number, which will be treated as milliseconds, or a string with the format of `<number><ms | s | ms>`.\n * Numbers can be either integers or floats.\n * For example:\n * - `3000` - 3 seconds between each update.\n * - `'10s'` - 10 seconds between each update.\n * - `'0.5m'` - 30 seconds between each update.\n * - `'100ms'` - 100 milliseconds between each update.\n * \n * You can also specify `'animationFrames'` so the countdown gets updated each time the browser is working on animations.\n * \n * When unspecified, the total duration of the countdown will be divided by {@link DefaultCountdownUpdateCount `DefaultCountdownUpdateCount`}\n * to get a fixed interval which will make for {@link DefaultCountdownUpdateCount `DefaultCountdownUpdateCount`} countdown updates.\n */\n @Input() public set onObserverCompleteCountdownInterval(duration: DurationAnnotation | 'animationFrames') { this.countdownInterval = duration; };\n \n static ngTemplateContextGuard<T>(directive: OnObserverCompleteDirective<T>, context: unknown): context is OnObserverContext<T> { return true; }\n}","import { Observable } from 'rxjs';\nimport { Directive, Input } from '@angular/core';\n\nimport { DurationAnnotation, ObserverName, ViewMode } from '../abstraction/types/general';\nimport { OnObserverContext } from '../abstraction/types/on-observer-context';\nimport { OnObserverBaseDirective } from '../abstraction/on-observer-base.directive';\n\n/**\n * Documentation in {@link OnObserverActiveDirective.onObserverActive} to allow in-template tooltips.\n * \n * @export\n * @class OnObserverActiveDirective\n * @extends {OnObserverBaseDirective<T>}\n * @template T The type of value the observable emits.\n */\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: '[onObserverActive]'\n})\nexport class OnObserverActiveDirective<T> extends OnObserverBaseDirective<T>\n{\n protected selector = 'onObserverActive';\n protected renderOnCallsTo: ObserverName[] = ['resolving', 'next'];\n \n /**\n * Renders the template when the specified observable is either resolving its first value, or emits a value.\n * \n * ## Features\n * \n * #### View Context\n * Use the microsyntax `as` keyword to assign resolved values to a variable.\n * Use the microsyntax `let` keyword to assign the {@link OnObserverContext full context object} to a variable (e.g. `let context`).\n * \n * #### Delayed rendering\n * Specify a value for {@link OnObserverBaseDirective.showAfter `showAfter`} to delay rendering.\n * \n * #### Auto destroy\n * Specify {@link OnObserverBaseDirective.showFor `showFor`} to automatically destroy the view after a certain duration.\n * \n * #### Countdown updates\n * When {@link OnObserverBaseDirective.showFor `showFor`} is specified, the view context will be updated with the time remaining until the view\n * is destroyed and the time elapsed since it was rendered. This allows giving the user feedback in a progress bar, a spinner, a textual timer\n * or any other UI component. \n * \n * Remaining is provided by the {@link OnObserverContext.remaining `remaining`} property. Elapsed time is provided by the {@link OnObserverContext.elapsed `elapsed`}\n * property. Access it by assigning a variable using `let`, like so: \n * `let remaining = remaining`\n * \n * #### Multi view mode\n * Specify {@link OnObserverBaseDirective.viewMode `viewMode = 'multiple'`} to enable rendering a new view for each intercepted call\n * instead of updating a single rendered view. This allows stacking logs, notification snackbars, or any other aggregation functionality.\n * Combined with {@link OnObserverBaseDirective.showFor `showFor`}, this is great for disappearing messages/notifications.\n * \n * #### View index\n * In multi-view mode, the context will contain the index of the view, which can be used for calculations and styling.\n */\n @Input() public set onObserverActive(value: Observable<T>) { this.input.next(value); }\n\n /**\n * (Optional) The view mode the directive will operate in: \n * `'single'` - A single view will be rendered on intercepted calls. If a view has already been rendered when a call is intercepted,\n * the existing view will be updated with data from the new call.\n * \n * `'multiple'` - Every new intercepted call will render a new view with its own context and data encapsulated from the current call.\n * \n * Default is `'single'`.\n */\n @Input() public set onObserverActiveViewMode (viewMode: ViewMode ) { this.viewMode = viewMode; }\n /**\n * (Optional) The duration for which the directive should wait before rendering the view once an intercepted call is made.\n * \n * You can specify a number, which will be treated as milliseconds, or a string with the format of `<number><ms | s | ms>`.\n * Numbers can be either integers or floats.\n * For example:\n * - `3000` - Wait for 3 seconds, then render the view.\n * - `'10s'` - Wait for 10 seconds, then render the view.\n * - `'0.5m'` - Wait for 30 seconds, then render the view.\n * - `'100ms'` - Wait for 100 milliseconds, then render the view.\n * \n * Default is `0`, meaning immediately render the view.\n *\n * TODO: ADD LINK TO TOUR OR FULL WIKI PAGE\n * Read more {@link OnObserverBaseDirective About render flow}.\n **/\n @Input() public set onObserverActiveShowAfter (duration: DurationAnnotation) { this.showAfter = duration; }\n /**\n * (Optional) The duration for which the view should be rendered. When the duration passes, the view will be auto destroyed.\n *\n * You can specify a number, which will be treated as milliseconds, or a string with the format of `<number><ms | s | ms>`.\n * Numbers can be either integers or floats.\n * For example:\n * - `3000` - The view will be destroyed after 3 seconds.\n * - `'10s'` - The view will be destroyed after 10 seconds.\n * - `'0.5m'` - The view will be destroyed after 30 seconds.\n * - `'100ms'` - The view will be destroyed after 100 milliseconds.\n * \n * During the time the view is rendered, the context will be updated with a countdown object to facilitate any UI part used to\n * indicate countdown to the user. The countdown will be exposed through the {@link OnObserverContext.remaining `remaining`}\n * property and the elapsed time through {@link OnObserverContext.elapsed `elapsed`} property in the view context and can both\n * be accessed be declaring a `let` variable (e.g. `let remaining = remaining`).\n * See {@link OnObserverBaseDirective.countdownInterval `countdownInterval`} for changing the updates interval.\n * \n * When unspecified, the view will be destroyed immediately once the observer detects a call different to the intercepted ones.\n * \n * TODO: ADD LINK TO TOUR OR FULL WIKI PAGE\n * Read more {@link OnObserverBaseDirective About render flow}.\n **/\n @Input() public set onObserverActiveShowFor (duration: DurationAnnotation) { this.showFor = duration; };\n /**\n * ### Only used when passing a value to {@link OnObserverBaseDirective.showFor `showFor`}.\n * \n * (Optional) The interval with which countdown updates should be made to the view's context before it auto destroys.\n * The lower the value, the more updates will be made to the context, but the more resources your directive will consume.\n * \n * You can specify a number, which will be treated as milliseconds, or a string with the format of `<number><ms | s | ms>`.\n * Numbers can be either integers or floats.\n * For example:\n * - `3000` - 3 seconds between each update.\n * - `'10s'` - 10 seconds between each update.\n * - `'0.5m'` - 30 seconds between each update.\n * - `'100ms'` - 100 milliseconds between each update.\n * \n * You can also specify `'animationFrames'` so the countdown gets updated each time the browser is working on animations.\n * \n * When unspecified, the total duration of the countdown will be divided by {@link DefaultCountdownUpdateCount `DefaultCountdownUpdateCount`}\n * to get a fixed interval which will make for {@link DefaultCountdownUpdateCount `DefaultCountdownUpdateCount`} countdown updates.\n */\n @Input() public set onObserverActiveCountdownInterval(duration: DurationAnnotation | 'animationFrames') { this.countdownInterval = duration; };\n\n static ngTemplateContextGuard<T>(directive: OnObserverActiveDirective<T>, context: unknown): context is OnObserverContext<T> { return true; }\n}","import { Observable } from 'rxjs';\nimport { Directive, Input } from '@angular/core';\n\nimport { DurationAnnotation, ObserverName, ViewMode } from '../abstraction/types/general';\nimport { OnObserverContext } from '../abstraction/types/on-observer-context';\nimport { OnObserverBaseDirective } from '../abstraction/on-observer-base.directive';\n\n/**\n * Documentation in {@link OnObserverFinalizedDirective.onObserverFinalized} to allow in-template tooltips.\n *\n * @export\n * @class OnObserverFinalizedDirective\n * @extends {OnObserverBaseDirective<T>}\n * @template T The type of value the observable emits.\n */\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: '[onObserverFinalized]'\n})\nexport class OnObserverFinalizedDirective<T> extends OnObserverBaseDirective<T>\n{\n protected selector = 'onObserverFinalized';\n protected renderOnCallsTo: ObserverName[] = ['error', 'complete'];\n \n /**\n * Renders the template when the specified observable is either completed or errored. In case of an error, the error will be\n * provided as the value in the context.\n * \n * ## Features\n * \n * #### View Context\n * Use the microsyntax `as` keyword to assign resolved values to a variable.\n * Use the microsyntax `let` keyword to assign the {@link OnObserverContext full context object} to a variable (e.g. `let context`).\n * \n * #### Delayed rendering\n * Specify a value for {@link OnObserverBaseDirective.showAfter `showAfter`} to delay rendering.\n * \n * #### Auto destroy\n * Specify {@link OnObserverBaseDirective.showFor `showFor`} to automatically destroy the view after a certain duration.\n * \n * #### Countdown updates\n * When {@link OnObserverBaseDirective.showFor `showFor`} is specified, the view context will be updated with the time remaining until the view\n * is destroyed and the time elapsed since it was rendered. This allows giving the user feedback in a progress bar, a spinner, a textual timer\n * or any other UI component. \n * \n * Remaining is provided by the {@link OnObserverContext.remaining `remaining`} property. Elapsed time is provided by the {@link OnObserverContext.elapsed `elapsed`}\n * property. Access it by assigning a variable using `let`, like so: \n * `let remaining = remaining`\n * \n * #### Multi view mode\n * Specify {@link OnObserverBaseDirective.viewMode `viewMode = 'multiple'`} to enable rendering a new view for each intercepted call\n * instead of updating a single rendered view. This allows stacking logs, notification snackbars, or any other aggregation functionality.\n * Combined with {@link OnObserverBaseDirective.showFor `showFor`}, this is great for disappearing messages/notifications.\n * \n * #### View index\n * In multi-view mode, the context will contain the index of the view, which can be used for calculations and styling.\n */\n @Input() public set onObserverFinalized(value: Observable<T>) { this.input.next(value); }\n\n /**\n * (Optional) The view mode the directive will operate in: \n * `'single'` - A single view will be rendered on intercepted calls. If a view has already been rendered when a call is intercepted,\n * the existing view will be updated with data from the new call.\n * \n * `'multiple'` - Every new intercepted call will render a new view with its own context and data encapsulated from the current call.\n * \n * Default is `'single'`.\n */\n @Input() public set onObserverFinalizedViewMode (viewMode: ViewMode ) { this.viewMode = viewMode; }\n /**\n * (Optional) The duration for which the directive should wait before rendering the view once an intercepted call is made.\n * \n * You can specify a number, which will be treated as milliseconds, or a string with the format of `<number><ms | s | ms>`.\n * Numbers can be either integers or floats.\n * For example:\n * - `3000` - Wait for 3 seconds, then render the view.\n * - `'10s'` - Wait for 10 seconds, then render the view.\n * - `'0.5m'` - Wait for 30 seconds, then render the view.\n * - `'100ms'` - Wait for 100 milliseconds, then render the view.\n * \n * Default is `0`, meaning immediately render the view.\n *\n * TODO: ADD LINK TO TOUR OR FULL WIKI PAGE\n * Read more {@link OnObserverBaseDirective About render flow}.\n **/\n @Input() public set onObserverFinalizedShowAfter (duration: DurationAnnotation) { this.showAfter = duration; }\n /**\n * (Optional) The duration for which the view should be rendered. When the duration passes, the view will be auto destroyed.\n *\n * You can specify a number, which will be treated as milliseconds, or a string with the format of `<number><ms | s | ms>`.\n * Numbers can be either integers or floats.\n * For example:\n * - `3000` - The view will be destroyed after 3 seconds.\n * - `'10s'` - The view will be destroyed after 10 seconds.\n * - `'0.5m'` - The view will be destroyed after 30 seconds.\n * - `'100ms'` - The view will be destroyed after 100 milliseconds.\n * \n * During the time the view is rendered, the context will be updated with a countdown object to facilitate any UI part used to\n * indicate countdown to the user. The countdown will be exposed through the {@link OnObserverContext.remaining `remaining`}\n * property and the elapsed time through {@link OnObserverContext.elapsed `elapsed`} property in the view context and can both\n * be accessed be declaring a `let` variable (e.g. `let remaining = remaining`).\n * See {@link OnObserverBaseDirective.countdownInterval `countdownInterval`} for changing the updates interval.\n * \n * When unspecified, the view will be destroyed immediately once the observer detects a call different to the intercepted ones.\n * \n * TODO: ADD LINK TO TOUR OR FULL WIKI PAGE\n * Read more {@link OnObserverBaseDirective About render flow}.\n **/\n @Input() public set onObserverFinalizedShowFor (duration: DurationAnnotation) { this.showFor = duration; };\n /**\n * ### Only used when passing a value to {@link OnObserverBaseDirective.showFor `showFor`}.\n * \n * (Optional) The interval with which countdown updates should be made to the view's context before it auto destroys.\n * The lower the value, the more updates will be made to the context, but the more resources your directive will consume.\n * \n * You can specify a number, which will be treated as milliseconds, or a string with the format of `<number><ms | s | ms>`.\n * Numbers can be either integers or floats.\n * For example:\n * - `3000` - 3 seconds between each update.\n * - `'10s'` - 10 seconds between each update.\n * - `'0.5m'` - 30 seconds between each update.\n * - `'100ms'` - 100 milliseconds between each update.\n * \n * You can also specify `'animationFrames'` so the countdown gets updated each time the browser is working on animations.\n * \n * When unspecified, the total duration of the countdown will be divided by {@link DefaultCountdownUpdateCount `DefaultCountdownUpdateCount`}\n * to get a fixed interval which will make for {@link DefaultCountdownUpdateCount `DefaultCountdownUpdateCount`} countdown updates.\n */\n @Input() public set onObserverFinalizedCountdownInterval(duration: DurationAnnotation | 'animationFrames') { this.countdownInterval = duration; };\n \n static ngTemplateContextGuard<T>(directive: OnObserverFinalizedDirective<T>, context: unknown): context is OnObserverContext<T> { return true; }\n}","import { NgModule } from '@angular/core';\n\nimport { OnObserverDirective } from './directives/on-observer.directive';\nimport { OnObserverResolvingDirective } from './directives/on-observer-resolving.directive';\nimport { OnObserverNextDirective } from './directives/on-observer-next.directive';\nimport { OnObserverErrorDirective } from './directives/on-observer-error.directive';\nimport { OnObserverCompleteDirective } from './directives/on-observer-complete.directive';\nimport { OnObserverActiveDirective } from './directives/on-observer-active.directive';\nimport { OnObserverFinalizedDirective } from './directives/on-observer-finalized.directive';\n\n@NgModule({\n declarations: [\n OnObserverDirective,\n OnObserverResolvingDirective,\n OnObserverNextDirective,\n OnObserverErrorDirective,\n OnObserverCompleteDirective,\n OnObserverActiveDirective,\n OnObserverFinalizedDirective,\n ],\n exports: [\n OnObserverDirective,\n OnObserverResolvingDirective,\n OnObserverNextDirective,\n OnObserverErrorDirective,\n OnObserverCompleteDirective,\n OnObserverActiveDirective,\n OnObserverFinalizedDirective,\n ]\n})\nexport class OnObserverModule { }\n","import { NgModule } from '@angular/core';\n\nimport { DocumentRefProviders } from './document-ref/document-ref.service';\nimport { WindowRefProviders } from './window-ref/window-ref.service';\nimport { ObserveModule } from './rxjs/observe/observe.module';\nimport { OnObserverModule } from './rxjs/on-observer/on-observer.module';\n\n@NgModule({\n providers: [\n WindowRefProviders,\n DocumentRefProviders\n ],\n imports: [\n ObserveModule,\n OnObserverModule\n ],\n exports: [\n ObserveModule,\n OnObserverModule\n ]\n})\nexport class CoreModule { }\n","import { Injectable, ElementRef } from '@angular/core';\n\nimport { DocumentRef } from '../document-ref/document-ref.service';\nimport { ElementConfig, LoadEventHandlingAttributes } from './element-configs';\n\n/** A function that modifies the attributes of a newly created element before it's added to the document. */\nexport type ElementConfigFn<TElement extends HTMLElement> = (element: TElement) => void;\n\n/** The well-known 'rel' values for a <link> element. */\nexport type LinkRel = 'alternate' | 'author' | 'canonical' | 'dns-prefetch' | 'help' | 'icon' | 'license' | 'next' | 'pingback' | 'preconnect' | 'prefetch' | 'preload' | 'prerender' | 'prev' | 'search' | 'stylesheet';\n\n/**\n * Either a configurating function or a configuration object for new elements.\n * For objects, the element's properties should be overwritten by the configurator's properties.\n * For functions, the function should be run on the element without any other intervention.\n * \n * @type {TElement} The type of html element being configured.\n * @type {TKeep} (Optional) A union type of general html element attributes to keep. See `ElementConfig`.\n */\nexport type ElementConfigurator<TElement extends HTMLElement, TKeep extends keyof HTMLElement = never> = ElementConfig<TElement, TKeep> | ElementConfigFn<TElement>\n/**\n * Either a configurating function or a configuration object for <script> tags.\n * For objects, the element's properties should be overwritten by the configurator's properties.\n * For functions, the function should be run on the element without any other intervention.\n */\nexport type ScriptConfigurator = ElementConfigurator<HTMLScriptElement, LoadEventHandlingAttributes>;\n/**\n * Either a configurating function or a configuration object for <link> tags.\n * For objects, the element's properties should be overwritten by the configurator's properties.\n * For functions, the function should be run on the element without any other intervention.\n */\nexport type LinkConfigurator = ElementConfigurator<HTMLLinkElement, LoadEventHandlingAttributes>;\n\n/**\n * Provides tools for dynamically interacting with the head element.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class HeadService\n{\n constructor(private document: DocumentRef) { }\n\n /**\n * Creates a <script> element, configures it and adds it to the <head> element.\n *\n * @param {string} type The type of script being added (e.g. 'text/javascript', 'application/javascript', etc.).\n * @param {string} src The source of the script being added.\n * @param {ScriptConfigurator} [config] (Optional) The configurator for the element. If an object was specified, the element's properties will be overwritten by the\n * configurator's properties. If a function was specified, the function is run on the element without any other intervention.\n * @returns {ElementRef<HTMLScriptElement>} A reference to the new element which has already been added to the <head> element.\n */\n public addScriptElement(type: string, src: string, config?: ScriptConfigurator): ElementRef<HTMLScriptElement>\n {\n return this.addElement('script', (script) =>\n {\n // Config the script\n script.type = type;\n script.src = src;\n \n this.applyConfiguration(script, config);\n });\n }\n\n /**\n * Creates a <link> element, configures it and adds it to the <head> element.\n *\n * @param {(LinkRel | LinkRel[])} rel The relationship(s) of the link with the current document.\n * @param {LinkConfigurator} [config] (Optional) The configurator for the element. If an object was specified, the element's properties will be overwritten by the\n * configurator's properties. If a function was specified, the function is run on the element without any other intervention.\n * @returns {ElementRef<HTMLLinkElement>} A reference to the new element which has already been added to the <head> element.\n */\n public addLinkElement(rel: LinkRel | LinkRel[], config?: LinkConfigurator): ElementRef<HTMLLinkElement>\n {\n return this.addElement<HTMLLinkElement>('link', link =>\n {\n link.rel = Array.isArray(rel) ? rel.join(' ') : rel;\n\n this.applyConfiguration(link, config);\n });\n }\n\n /**\n * Removes the first <link> element matching the specified params.\n *\n * @param {(LinkRel | LinkRel[])} rel The rel attribute value to look for.\n * @param {ElementConfig<HTMLLinkElement>} lookup A map of attribute names and values to match with the element. All must match for the element to be detected.\n * To match all elements containing a specific attribute regardless of the attribute's value, use the `'**'` value.\n * @returns {(HTMLLinkElement | null)} The removed element, or null if none found.\n */\n public removeLinkElement(rel: LinkRel | LinkRel[], lookup: ElementConfig<HTMLLinkElement>): HTMLLinkElement | null\n {\n return this.removeElement('link', this.buildLinkLookup(rel, lookup));\n }\n\n /**\n * Removes all <link> elements matching the specified params.\n *\n * @param {(LinkRel | LinkRel[])} rel The rel attribute value to look for.\n * @param {ElementConfig<HTMLLinkElement>} lookup A map of attribute names and values to match with the element. All must match for the element to be detected.\n * To match all elements containing a specific attribute regardless of the attribute's value, use the `'**'` value.\n * @returns {NodeListOf<HTMLLinkElement>} The list of removed elements.\n */\n public removeLinkElements(rel: LinkRel | LinkRel[], lookup: ElementConfig<HTMLLinkElement>): NodeListOf<HTMLLinkElement>\n {\n return this.removeElements('link', this.buildLinkLookup(rel, lookup));\n }\n\n private buildLinkLookup(rel: LinkRel | LinkRel[], lookup: ElementConfig<HTMLLinkElement>): ElementConfig<HTMLLinkElement>\n {\n // If rel is an array, join to a space-separated string\n const fullRel = Array.isArray(rel) ? rel.join(' ') : rel;\n\n // Combine with the lookup object and return\n return Object.assign(lookup, { rel: fullRel });\n }\n\n /**\n * Creates an element of the given name, configures it and adds it to the <head> element.\n *\n * @template TElement The type of element being created.\n * @param {string} name The name of the tag to create.\n * @param {ElementConfigurator<TElement>} [config] (Optional) The configurator for the element. If an object was specified, the element's properties will be overwritten by the\n * configurator's properties. If a function was specified, the function is run on the element without any other intervention.\n * @returns {ElementRef<TElement>} A reference to the new element which has already been added to the <head> element.\n */\n public addElement<TElement extends HTMLElement>(name: string, config?: ElementConfigurator<TElement>): ElementRef<TElement>\n {\n // Get DOM elements\n const document = this.document.nativeDocument as Document;\n const head = document.head;\n // Create the element tag\n const element = document.createElement(name) as TElement;\n\n // Apply configuration on the element\n this.applyConfiguration(element, config);\n\n // Add the element tag to the <head> element\n head.appendChild(element);\n\n return new ElementRef(element);\n }\n\n /**\n * Applies a configurator on an element.\n *\n * @private\n * @template TElement The type of html element being configured.\n * @param {TElement} element The element to configure.\n * @param {ElementConfigurator<TElement>} [config] (Optional) The configurator for the element. If an object was specified, the element's properties will be overwritten by the\n * configurator's properties. If a function was specified, the function is run on the element without any other intervention.\n */\n private applyConfiguration<TElement extends HTMLElement>(element: TElement, config?: ElementConfigurator<TElement>): void\n {\n config instanceof Function ? config(element) : Object.assign(element, config);\n }\n\n /**\n * Finds the first element matching in name and attributes to the specified params and removes it from the <head> element.\n *\n * @template TElement The type of element being searched for.\n * @param {string} name The name of the tag to look for.\n * @param {ElementConfig<TElement>} lookup A map of attribute names and values to match with the element. All must match for the element to be detected.\n * To match all elements containing a specific attribute regardless of the attribute's value, use the `'**'` value.\n * @returns The removed element, or null if none found.\n */\n public removeElement<TElement extends HTMLElement>(name: string, lookup: ElementConfig<TElement>): TElement | null\n {\n const element = this.findElements(name, lookup)[0];\n\n element?.remove();\n\n return element || null;\n }\n\n /**\n * Finds all elements matching in name and attributes to the specified params and removes them from the <head> element.\n *\n * @template TElement The type of element being searched for.\n * @param {string} name The name of the tag to look for.\n * @param {ElementConfig<TElement>} lookup A map of attribute names and values to match with the element. All must match for the element to be detected.\n * To match all elements containing a specific attribute regardless of the attribute's value, use the `'**'` value.\n * @returns The list of removed elements.\n */\n public removeElements<TElement extends HTMLElement>(name: string, lookup: ElementConfig<TElement>): NodeListOf<TElement>\n {\n const elements = this.findElements(name, lookup);\n\n elements.forEach(element => element.remove());\n\n return elements;\n }\n\n /**\n * Finds all elements inside of <head> which match in name and attributes to the specified params.\n *\n * @template TElement The type of element being searched for.\n * @param {string} name The name of the tag to look for.\n * @param {ElementConfig<TElement>} lookup A map of attribute names and values to match with the element. All must match for the element to be detected.\n * To match all elements containing a specific attribute regardless of the attribute's value, use the `'**'` value.\n * @returns A node list of all matching elements inside of <head>.\n */\n public findElements<TElement extends HTMLElement>(name: string, lookup: ElementConfig<TElement>): NodeListOf<TElement>\n {\n // Get DOM elements\n const document = this.document.nativeDocument as Document;\n const head = document.head;\n \n const attributes = Object.keys(lookup).map(key =>\n {\n const attribute = key as keyof ElementConfig<TElement>;\n const value = lookup[attribute];\n\n // If a wildcard was specified for the attribute...\n return value === '**' ?\n // ... Query only by attribute name\n `[${String(attribute)}]` :\n // Otherwise, match the exact value\n `[${String(attribute)}=\"${value}\"]`;\n }).join('');\n\n return head.querySelectorAll(`${name}${attributes}`);\n }\n\n /**\n * Checks whether an element with the given tag name and attributes exists in <head>.\n *\n * @template TElement The type of element being searched for.\n * @param {string} name The name of the tag to look for.\n * @param {ElementConfig<TElement>} lookup A map of attribute names and values to match with the element. All must match for the element to be detected.\n * To match all elements containing a specific attribute regardless of the attribute's value, use the `'**'` value.\n * @returns {boolean} `true` if <head> contains a matching element; otherwise `false.\n */\n public contains<TElement extends HTMLElement>(name: string, lookup: ElementConfig<TElement>): boolean\n {\n return !!this.findElements(name, lookup).length;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["ANGULAR_DOCUMENT","i1.DocumentRef"],"mappings":";;;;;;AAGA;MACa,QAAQ,GAAG,IAAI,cAAc,CAAW,eAAe,EAAE;AAEtE;;;;;;;;;;AAUG;MAEU,WAAW,CAAA;;AAGpB;;;;AAIG;AACH,IAAA,WAAA,CAA8C,cAAmB,EAAA;QAAnB,IAAc,CAAA,cAAA,GAAd,cAAc,CAAK;KAAK;;AAR7D,WAAA,CAAA,IAAA,GAAA,EAAA,CAAA,kBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAW,kBAQA,QAAQ,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AARnB,WAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAW,cADE,MAAM,EAAA,CAAA,CAAA;4FACnB,WAAW,EAAA,UAAA,EAAA,CAAA;kBADvB,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAA;;0BASjB,MAAM;2BAAC,QAAQ,CAAA;;AAGhC;;AAEG;AACU,MAAA,gBAAgB,GAAqB;AAC9C,IAAA,OAAO,EAAM,QAAQ;AACrB,IAAA,WAAW,EAAEA,UAAgB;EAC/B;AAEF;;AAEG;AACU,MAAA,oBAAoB,GAAG,CAAC,gBAAgB;;ACrCrD;;AAEG;MACU,MAAM,GAAG,IAAI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