{"version":3,"file":"nw-style-guide-tooltips.mjs","sources":["../../../projects/nw-style-guide/tooltips/config/tooltip-context-token.ts","../../../projects/nw-style-guide/tooltips/tooltip-container.component.ts","../../../projects/nw-style-guide/tooltips/config/placement-flip-map.ts","../../../projects/nw-style-guide/tooltips/callout-base.directive.ts","../../../projects/nw-style-guide/tooltips/tooltip.directive.ts","../../../projects/nw-style-guide/tooltips/popover.directive.ts","../../../projects/nw-style-guide/tooltips/nw-style-guide-tooltips.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { ITooltipData } from '../models/ITooltipData';\n\nexport const TOOLTIP_CONTEXT_TOKEN = new InjectionToken<ITooltipData>('tooltip-context');\n","import { Component, ChangeDetectionStrategy, TemplateRef, EventEmitter, inject } from '@angular/core';\nimport { ITooltipData } from './models/ITooltipData';\nimport { TOOLTIP_CONTEXT_TOKEN } from './config/tooltip-context-token';\nimport { NgClass, NgTemplateOutlet } from '@angular/common';\n\n@Component({\n    selector: 'nw-tooltip-container',\n    template: `\n        <div\n            class=\"tooltip\"\n            [id]=\"data.id\"\n            [ngClass]=\"data.containerClass\">\n            @if (data.withArrow) {\n                <div class=\"tooltip-arrow\"></div>\n            }\n            <!--\n                Carries an id so that a dialog panel can point aria-describedby at it, and a class when there is a\n                close button, so that the styles can reserve room for one\n            -->\n            <div\n                class=\"tooltip-inner\"\n                [class.with-close]=\"data.withClose\"\n                [id]=\"data.id + '-content'\">\n                @if (isTemplateRef) {\n                    <ng-container *ngTemplateOutlet=\"data.tooltip; context: data.templateRefContext\"></ng-container>\n                } @else {\n                    <div [outerHTML]=\"data.tooltip\"></div>\n                }\n                <!--\n                    Inside .tooltip-inner, which the styles position it against, and last so that a dialog panel's\n                    description ends with \"Close\" rather than starting with it\n                -->\n                @if (data.withClose) {\n                    <button\n                        (click)=\"close.emit()\"\n                        aria-label=\"Close\"\n                        class=\"btn btn-ghost-alt btn-sm btn-close close-button\"></button>\n                }\n            </div>\n        </div>\n    `,\n    changeDetection: ChangeDetectionStrategy.OnPush,\n    imports: [NgClass, NgTemplateOutlet]\n})\nexport class TooltipContainerComponent {\n    data = inject<ITooltipData>(TOOLTIP_CONTEXT_TOKEN);\n\n    public close = new EventEmitter<void>();\n    public isTemplateRef: boolean = false;\n\n    constructor() {\n        const data = this.data;\n\n        this.isTemplateRef = data.tooltip instanceof TemplateRef;\n    }\n}\n","import { PlacementFlipMap } from '../models/PlacementFlipMap.type';\n\nexport const placementFlipMap: PlacementFlipMap = {\n    top: 'bottom',\n    'top-start': 'bottom-start',\n    'top-end': 'bottom-end',\n    bottom: 'top',\n    'bottom-start': 'top-start',\n    'bottom-end': 'top-end',\n    right: 'left',\n    'right-start': 'left-start',\n    'right-end': 'left-end',\n    left: 'right',\n    'left-start': 'right-start',\n    'left-end': 'right-end'\n};\n","import {\n    CloseScrollStrategy,\n    ConnectionPositionPair,\n    FlexibleConnectedPositionStrategy,\n    Overlay,\n    OverlayRef,\n    RepositionScrollStrategy\n} from '@angular/cdk/overlay';\nimport { _IdGenerator } from '@angular/cdk/a11y';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport {\n    ComponentRef,\n    Directive,\n    ElementRef,\n    Injector,\n    OnDestroy,\n    OnInit,\n    Signal,\n    TemplateRef,\n    ViewContainerRef,\n    computed,\n    effect,\n    inject,\n    input,\n    output\n} from '@angular/core';\nimport { Placement } from './models/Placement.type';\nimport { Subject, fromEvent, merge, EMPTY, of, Observable, animationFrameScheduler, timer, interval } from 'rxjs';\nimport { takeUntil, filter, tap, map, debounce, switchMap, delay } from 'rxjs/operators';\nimport { TOOLTIP_CONTEXT_TOKEN } from './config/tooltip-context-token';\nimport { TooltipContainerComponent } from './tooltip-container.component';\nimport { ITooltipData } from './models/ITooltipData';\nimport { ICalloutTriggers } from './models/ICalloutTriggers';\nimport { placementFlipMap } from './config/placement-flip-map';\nimport { toObservable } from '@angular/core/rxjs-interop';\n\n/**\n * The overlay engine behind `nwTooltip` and `nwPopover`: it positions a callout against a host element, opens and\n * closes it on the configured events, and renders the content into a `TooltipContainerComponent`.\n *\n * It has no selector and is abstract, so it cannot be attached to an element. What a callout *means* - whether it is\n * a description of its host or a dialog the user opens - is decided by the subclass through `_onCalloutOpened`. Neither\n * subclass can reach the other's behaviour\n */\n@Directive()\nexport abstract class CalloutBaseDirective implements OnInit, OnDestroy {\n    protected _elRef = inject<ElementRef<HTMLElement>>(ElementRef);\n    private _overlay = inject(Overlay);\n    private _vcRef = inject(ViewContainerRef);\n    private _injector = inject(Injector);\n\n    /**\n     * The id of the callout element, so that it can be referenced by `aria-describedby`. From the CDK generator\n     * rather than a module-level counter, so that ids stay unique across two copies of the library on one page and\n     * stable between a server render and its hydration\n     */\n    protected readonly _calloutId = inject(_IdGenerator).getId('nw-callout-');\n\n    /**\n     * An object that can be passed when the content is a `TemplateRef`\n     * ref: https://angular.io/api/core/ng-template#context\n     */\n    readonly context = input<any>();\n    /** One or more preferred placement options */\n    readonly placement = input<Placement | Placement[]>();\n    /** Manually control the opening and closing of the callout */\n    readonly isOpen = input<boolean>();\n    /**\n     * When true, the callout will not respond to any open or close events. Nor will it respond to changes to the\n     * `isOpen` input\n     */\n    readonly isDisabled = input(false);\n    /** Number of ms to wait before opening. Defaults per kind of callout - see `_getTriggerDefaults` */\n    readonly delay = input<number>();\n    /** Change the placement of the callout to its opposite position when it moves outside the viewport */\n    readonly autoFlip = input(true);\n    /** A list of events that open the callout */\n    readonly openEvents = input<string[]>();\n    /** A list of events that close the callout */\n    readonly closeEvents = input<string[]>();\n    /** A class to apply to the callout container */\n    readonly containerClass = input<string>();\n    /** Display an arrow or not. The location of the arrow is dependant on the current `placement` */\n    readonly withArrow = input(true);\n    readonly closeOnScroll = input<boolean>();\n    /**\n     * WARNING: Use with caution - there are potential performance issues with this\n     *\n     * Update the position of the callout before the next browser repaint. An example of where this may be required is\n     * if the callout is attached (and open) to an element that transitions or animates to a new position\n     */\n    readonly updatePositionOnAnimationFrame = input(false);\n    /**\n     * In the case where the callout should not be attached to the host element, a reference to another element can be\n     * used\n     */\n    readonly connectedTo = input<ElementRef<HTMLElement> | Element>();\n    /** Determines whether pointer events are enabled on the cdk-overlay-pane element */\n    readonly pointerEvents = input<'auto' | 'none'>();\n    readonly hostElementZIndex = input<number>();\n\n    readonly nwShown = output<void>();\n    readonly nwHidden = output<void>();\n    readonly nwClose = output<void>();\n\n    /**\n     * `isOpen` as a stream, so that manual control joins the same pipeline as every other open and close event.\n     * Undefined is filtered out: an unbound `isOpen` should say nothing rather than assert that it is closed\n     */\n    private readonly _isOpen$: Observable<boolean> = toObservable(this.isOpen).pipe(\n        filter(isOpen => isOpen !== undefined)\n    );\n\n    /**\n     * The strategies the CDK needs, derived rather than rebuilt on demand. Both are memoised, and the CDK ignores\n     * an update that hands it the strategy it already has\n     */\n    private readonly _positionStrategy = computed(() => this._getPositionStrategy(this.placement()));\n    private readonly _scrollStrategy = computed(() => this._getScrollStrategy(this._triggers().closeOnScroll));\n\n    /**\n     * The events and timings this callout actually opens with: what the consumer bound, falling back to the\n     * defaults for its kind. Derived rather than assigned, so that a rebound input still wins\n     */\n    protected readonly _triggers: Signal<ICalloutTriggers> = computed(() => {\n        const defaults = this._getTriggerDefaults();\n\n        return {\n            delay: this.delay() ?? defaults.delay,\n            openEvents: this.openEvents() ?? defaults.openEvents,\n            closeEvents: this.closeEvents() ?? defaults.closeEvents,\n            closeOnScroll: this.closeOnScroll() ?? defaults.closeOnScroll,\n            pointerEvents: this.pointerEvents() ?? defaults.pointerEvents\n        };\n    });\n\n    private _overlayRef: OverlayRef | null = null;\n    private _destroyed$ = new Subject<void>();\n    private _cancelDelayedOpen$ = new Subject<void>();\n    /** The `.tooltip` element of the open callout */\n    protected _calloutEl: HTMLElement | null = null;\n    private _manualToggleEvent$ = new Subject<boolean>();\n    /** Emits only where the subclass opted into outside-click dismissal - see `_open` */\n    private _outsideClick$ = new Subject<boolean>();\n    /** Set while the directive is being torn down, so that closing does not act on a host that is going away */\n    protected _isDestroyed: boolean = false;\n\n    /** The content, which each subclass declares as its own input under its own selector */\n    protected abstract readonly _content: Signal<string | TemplateRef<any>>;\n\n    /** The events, delay and pointer behaviour this kind of callout opens with */\n    protected abstract _getTriggerDefaults(): ICalloutTriggers;\n\n    /**\n     * Expose the callout to assistive technology, once its content has rendered. This is the whole of the difference\n     * between a tooltip and a popover\n     */\n    protected abstract _onCalloutOpened(calloutEl: HTMLElement): void;\n\n    /** Any key other than Escape that this kind of callout responds to, while it is open */\n    protected _onCalloutKeydown(_event: KeyboardEvent): void {\n        // nothing by default\n    }\n\n    /** Undo whatever `_onCalloutOpened` did, as the callout closes */\n    protected _onCalloutClosing(): void {\n        // nothing by default\n    }\n\n    /** Whether the callout renders a close button. Only a popover does */\n    protected _hasCloseButton(): boolean {\n        return false;\n    }\n\n    /** Whether a pointer event outside the callout closes it */\n    protected _dismissesOnOutsideClick(): boolean {\n        return false;\n    }\n\n    /** Any further open or close events the subclass contributes, e.g. a tooltip opening on keyboard focus */\n    protected _getAdditionalToggleEvents(): Observable<boolean> {\n        return EMPTY;\n    }\n\n    constructor() {\n        effect(() => {\n            const positionStrategy = this._positionStrategy();\n\n            this._overlayRef?.updatePositionStrategy(positionStrategy);\n        });\n\n        effect(() => {\n            const scrollStrategy = this._scrollStrategy();\n\n            this._overlayRef?.updateScrollStrategy(scrollStrategy);\n        });\n    }\n\n    ngOnInit() {\n        this._subscribeToEvents();\n        this._repositionOnEveryFrame();\n    }\n\n    /**\n     * Can be called manually from the exported directive to open the callout\n     */\n    show(): void {\n        this._manualToggleEvent$.next(true);\n    }\n\n    /**\n     * Can be called manually from the exported directive to close the callout\n     */\n    hide(): void {\n        this._manualToggleEvent$.next(false);\n    }\n\n    /**\n     * Can be called manually from the exported directive to toggle the callout\n     */\n    toggle(): void {\n        const isOpen = this._overlayRef?.hasAttached();\n        this._manualToggleEvent$.next(!isOpen);\n    }\n\n    /** Attaches the callout, returning its container - or null where it was already open */\n    private _open(): ComponentRef<TooltipContainerComponent> | null {\n        /**\n         * Create the overlay, and subscribe to what it alone can tell us, the first time the callout is opened\n         */\n        if (!this._overlayRef) {\n            this._createOverlay();\n            this._subscribeToCalloutKeydown();\n\n            if (this._dismissesOnOutsideClick()) {\n                this._subscribeToOutsidePointerEvents();\n            }\n        }\n\n        if (this._overlayRef.hasAttached()) {\n            return null;\n        }\n\n        const portal = new ComponentPortal(TooltipContainerComponent, this._vcRef, this._createInjector());\n        const ref = this._overlayRef.attach(portal);\n        this.nwShown.emit();\n\n        return ref;\n    }\n\n    /**\n     * Escape closes any callout, which is required of content that appears on hover or focus\n     * ref: https://www.w3.org/WAI/WCAG21/Understanding/content-on-hover-or-focus.html\n     *\n     * Every other key is the subclass's to answer, if it answers any\n     */\n    private _subscribeToCalloutKeydown(): void {\n        this._overlayRef\n            .keydownEvents()\n            .pipe(\n                filter(_ => this._overlayRef?.hasAttached()),\n                takeUntil(this._destroyed$)\n            )\n            .subscribe(event => {\n                if (event.key === 'Escape') {\n                    this.nwClose.emit();\n                    this._close();\n\n                    return;\n                }\n\n                this._onCalloutKeydown(event);\n            });\n    }\n\n    /**\n     * A pointer event anywhere but the callout and its host closes the callout, for the subclasses that ask for it\n     */\n    private _subscribeToOutsidePointerEvents(): void {\n        this._overlayRef\n            .outsidePointerEvents()\n            .pipe(\n                filter(_ => this._overlayRef?.hasAttached()),\n                filter(event => event.target !== this._elRef.nativeElement),\n                map(_ => false),\n                takeUntil(this._destroyed$)\n            )\n            .subscribe(v => this._outsideClick$.next(v));\n    }\n\n    protected _close(): void {\n        if (this._overlayRef?.hasAttached()) {\n            this._onCalloutClosing();\n            this._overlayRef.detach();\n            this._calloutEl = null;\n            this.nwHidden.emit();\n        }\n    }\n\n    private _createOverlay() {\n        const positionStrategy = this._positionStrategy();\n        const scrollStrategy = this._scrollStrategy();\n        const disposeOnNavigation = true;\n        const panelClasses: string[] = ['tooltip-overlay', `pointer-events-${this._triggers().pointerEvents}`];\n        this._overlayRef = this._overlay.create({\n            positionStrategy,\n            scrollStrategy,\n            disposeOnNavigation,\n            panelClass: panelClasses\n        });\n\n        if (this.hostElementZIndex()) {\n            this._overlayRef.hostElement.style.zIndex = this.hostElementZIndex().toString();\n        }\n    }\n\n    /**\n     * Create and return a custom injector that provides the callout content as an injectable dependency\n     */\n    private _createInjector(): Injector {\n        const tooltipData: ITooltipData = {\n            tooltip: this._content(),\n            id: this._calloutId,\n            containerClass: this.containerClass(),\n            withArrow: this.withArrow(),\n            withClose: this._hasCloseButton(),\n            templateRefContext: this.context()\n        };\n\n        return Injector.create({\n            parent: this._injector,\n            providers: [{ provide: TOOLTIP_CONTEXT_TOKEN, useValue: tooltipData }]\n        });\n    }\n\n    /**\n     * The one subscription that opens and closes the callout, from every source that can ask for either\n     */\n    private _subscribeToEvents(): void {\n        this._getToggleEvents$()\n            .pipe(\n                debounce(() => (this._hasOverlappingToggleEvents() ? timer(5) : of(0))),\n                filter(_ => !this.isDisabled()),\n                switchMap(isOpenEvent => this._delayIfOpening(isOpenEvent)),\n                takeUntil(this._destroyed$)\n            )\n            .subscribe(isOpenEvent => (isOpenEvent ? this._openAndExpose() : this._close()));\n    }\n\n    /**\n     * Every source that can open or close the callout, as a single stream of whether it should now be open.\n     * `_outsideClick$` is included unconditionally, as `_open` is what decides whether anything pushes into it\n     */\n    private _getToggleEvents$(): Observable<boolean> {\n        return merge(\n            ...this._getOpenEvents$().concat(\n                this._getCloseEvents$(),\n                this._manualToggleEvent$,\n                this._isOpen$,\n                this._outsideClick$,\n                this._getAdditionalToggleEvents()\n            )\n        );\n    }\n\n    /** The host events that open the callout, ignored while it is already open */\n    private _getOpenEvents$(): Observable<boolean>[] {\n        return this._triggers().openEvents.map(eventName =>\n            fromEvent(this._elRef.nativeElement, eventName).pipe(\n                filter(_ => !this._overlayRef?.hasAttached()),\n                map(_ => true)\n            )\n        );\n    }\n\n    /** The host events that close the callout. They also cancel an open that is still waiting out its delay */\n    private _getCloseEvents$(): Observable<boolean>[] {\n        return this._triggers().closeEvents.map(eventName =>\n            fromEvent(this._elRef.nativeElement, eventName).pipe(\n                tap(_ => this._cancelDelayedOpen$.next()),\n                filter(_ => this._overlayRef?.hasAttached()),\n                map(_ => false)\n            )\n        );\n    }\n\n    /**\n     * Whether the same event both opens and closes the callout - \"click\" in both lists, say - which fires the\n     * merged stream twice within a few ms. The debounce this feeds keeps that from opening and instantly closing\n     */\n    private _hasOverlappingToggleEvents(): boolean {\n        return this._triggers().openEvents.some(e => this._triggers().closeEvents.includes(e));\n    }\n\n    /** Hold an open event for `delay`, cancellable by a close event in the meantime. Closing is never delayed */\n    private _delayIfOpening(isOpenEvent: boolean): Observable<boolean> {\n        if (!isOpenEvent || !this._triggers().delay) {\n            return of(isOpenEvent);\n        }\n\n        return of(isOpenEvent).pipe(delay(this._triggers().delay), takeUntil(this._cancelDelayedOpen$));\n    }\n\n    /**\n     * Open the callout and hand it to the subclass to expose, which can only happen once its content has rendered\n     */\n    private _openAndExpose(): void {\n        const ref = this._open();\n\n        /**\n         * No ref is returned where the overlay is already attached\n         */\n        if (!ref) {\n            return;\n        }\n\n        ref.changeDetectorRef.detectChanges();\n        this._calloutEl = this._overlayRef.overlayElement.querySelector('.tooltip');\n\n        if (this._calloutEl) {\n            this._onCalloutOpened(this._calloutEl);\n        }\n\n        this._subscribeToContainerClose(ref);\n    }\n\n    /**\n     * Close on the container's own close button. Released with the container it belongs to, so that a callout\n     * opened and closed repeatedly does not leave a subscription behind on each destroyed instance\n     */\n    private _subscribeToContainerClose(ref: ComponentRef<TooltipContainerComponent>): void {\n        const closeSub = ref.instance.close.subscribe(_ => {\n            this.nwClose.emit();\n            this._close();\n        });\n\n        ref.onDestroy(() => closeSub.unsubscribe());\n    }\n\n    /**\n     * Follow a host that moves under its own steam - one that transitions or animates to a new position - by\n     * repositioning before every repaint. Off by default: it costs a reposition per frame while the callout is open\n     */\n    private _repositionOnEveryFrame(): void {\n        if (!this.updatePositionOnAnimationFrame()) {\n            return;\n        }\n\n        interval(0, animationFrameScheduler)\n            .pipe(\n                filter(_ => this.updatePositionOnAnimationFrame() && this._overlayRef?.hasAttached()),\n                takeUntil(this._destroyed$)\n            )\n            .subscribe(() => {\n                this._overlayRef?.updatePosition();\n            });\n    }\n\n    /**\n     * The size of the arrow the callout has to be offset by, read from the `--tooltip-arrow-size` custom property\n     * that `_tooltip.scss` publishes off `$tooltip-arrow-width`, so that overriding that variable moves the arrow\n     * and the space reserved for it together.\n     *\n     * Read from the host rather than measured off the arrow itself, which is a zero-size CSS triangle that does\n     * not exist yet: the offsets are baked into the position pairs before the callout is ever attached.\n     *\n     * Read once per strategy build rather than cached for the directive's life, so that a theme that retunes the\n     * property at runtime is picked up the next time the strategy is rebuilt, while a single build still only asks\n     * the one time for all of its candidate placements\n     */\n    private _readArrowSize(): number {\n        const declared = getComputedStyle(this._elRef.nativeElement).getPropertyValue('--tooltip-arrow-size');\n\n        /**\n         * Falls back where the library stylesheet has not been included, as in a test that renders the directive\n         * alone. Kept in step with `$tooltip-arrow-width` in `_variables.scss`, which is what the property carries\n         */\n        return parseFloat(declared) || 5;\n    }\n\n    private _getPositionPair(placement: Placement, arrowSize: number): ConnectionPositionPair {\n        /** Enough to clear the arrow, plus 3px so that the callout is not flush with its host */\n        const offset = arrowSize + 3;\n        const getXOffset = (placement: Placement) => {\n            if (!this.withArrow()) {\n                return 0;\n            }\n            if (placement.startsWith('right')) {\n                return offset;\n            }\n            if (placement.startsWith('left')) {\n                return -offset;\n            }\n        };\n        const getYOffset = (placement: Placement) => {\n            if (!this.withArrow()) {\n                return 0;\n            }\n            if (placement.startsWith('top')) {\n                return -offset;\n            }\n            if (placement.startsWith('bottom')) {\n                return offset;\n            }\n        };\n        const getCalloutClass = (placement: Placement): string => `tooltip-${placement}`;\n        /**\n         * The default position when no placement is specified\n         */\n        const bottom = new ConnectionPositionPair(\n            { originX: 'center', originY: 'bottom' },\n            { overlayX: 'center', overlayY: 'top' },\n            null,\n            getYOffset('bottom'),\n            getCalloutClass('bottom')\n        );\n\n        switch (placement) {\n            case 'top':\n                return new ConnectionPositionPair(\n                    { originX: 'center', originY: 'top' },\n                    { overlayX: 'center', overlayY: 'bottom' },\n                    null,\n                    getYOffset(placement),\n                    getCalloutClass(placement)\n                );\n\n            case 'top-start':\n                return new ConnectionPositionPair(\n                    { originX: 'start', originY: 'top' },\n                    { overlayX: 'start', overlayY: 'bottom' },\n                    null,\n                    getYOffset(placement),\n                    getCalloutClass(placement)\n                );\n\n            case 'top-end':\n                return new ConnectionPositionPair(\n                    { originX: 'end', originY: 'top' },\n                    { overlayX: 'end', overlayY: 'bottom' },\n                    null,\n                    getYOffset(placement),\n                    getCalloutClass(placement)\n                );\n\n            case 'bottom':\n                return bottom;\n\n            case 'bottom-start':\n                return new ConnectionPositionPair(\n                    { originX: 'start', originY: 'bottom' },\n                    { overlayX: 'start', overlayY: 'top' },\n                    null,\n                    getYOffset(placement),\n                    getCalloutClass(placement)\n                );\n\n            case 'bottom-end':\n                return new ConnectionPositionPair(\n                    { originX: 'end', originY: 'bottom' },\n                    { overlayX: 'end', overlayY: 'top' },\n                    null,\n                    getYOffset(placement),\n                    getCalloutClass(placement)\n                );\n\n            case 'right':\n                return new ConnectionPositionPair(\n                    { originX: 'end', originY: 'center' },\n                    { overlayX: 'start', overlayY: 'center' },\n                    getXOffset(placement),\n                    null,\n                    getCalloutClass(placement)\n                );\n\n            case 'right-start':\n                return new ConnectionPositionPair(\n                    { originX: 'end', originY: 'top' },\n                    { overlayX: 'start', overlayY: 'top' },\n                    getXOffset(placement),\n                    null,\n                    getCalloutClass(placement)\n                );\n\n            case 'right-end':\n                return new ConnectionPositionPair(\n                    { originX: 'end', originY: 'bottom' },\n                    { overlayX: 'start', overlayY: 'bottom' },\n                    getXOffset(placement),\n                    null,\n                    getCalloutClass(placement)\n                );\n\n            case 'left':\n                return new ConnectionPositionPair(\n                    { originX: 'start', originY: 'center' },\n                    { overlayX: 'end', overlayY: 'center' },\n                    getXOffset(placement),\n                    null,\n                    getCalloutClass(placement)\n                );\n\n            case 'left-start':\n                return new ConnectionPositionPair(\n                    { originX: 'start', originY: 'top' },\n                    { overlayX: 'end', overlayY: 'top' },\n                    getXOffset(placement),\n                    null,\n                    getCalloutClass(placement)\n                );\n\n            case 'left-end':\n                return new ConnectionPositionPair(\n                    { originX: 'start', originY: 'bottom' },\n                    { overlayX: 'end', overlayY: 'bottom' },\n                    getXOffset(placement),\n                    null,\n                    getCalloutClass(placement)\n                );\n\n            default:\n                return bottom;\n        }\n    }\n\n    private _getPositionStrategy(placement: Placement | Placement[]): FlexibleConnectedPositionStrategy {\n        /**\n         * Format `placement` into a consistent data type of `Placement[]`\n         */\n        const placementsList: Placement[] = [placement].flat();\n        const arrowSize = this._readArrowSize();\n        /**\n         * Get positions from preferred placements\n         */\n        const primaryPositions = placementsList.map(p => this._getPositionPair(p, arrowSize));\n        /**\n         * If `autoFlip` is enabled, include the inverse position of each `placement` input. Each of this inverse positions\n         * will have a lower priority than each of the preferred positions generated from the `placement` input\n         */\n        const positions = this.autoFlip()\n            ? [...primaryPositions, ...placementsList.map(p => this._getPositionPair(placementFlipMap[p], arrowSize))]\n            : [...primaryPositions];\n\n        return this._overlay\n            .position()\n            .flexibleConnectedTo(this.connectedTo() || this._elRef)\n            .withFlexibleDimensions(false)\n            .withPositions(positions)\n            .withPush(false);\n    }\n\n    private _getScrollStrategy(closeOnScroll: boolean): RepositionScrollStrategy | CloseScrollStrategy {\n        if (closeOnScroll) {\n            return this._overlay.scrollStrategies.close();\n        }\n        return this._overlay.scrollStrategies.reposition();\n    }\n\n    /**\n     * `_close` rather than `hide`, which only asks the debounced pipeline to close and so would never arrive before\n     * the subscription is torn down below. Going straight there also runs `_onCalloutClosing` exactly once, and only\n     * where the callout was actually open - `hide` followed by an unconditional `_onCalloutClosing` did neither\n     */\n    ngOnDestroy() {\n        this._isDestroyed = true;\n        this._close();\n        this._destroyed$.next();\n        this._destroyed$.complete();\n        this._overlayRef?.dispose();\n    }\n}\n","import { AriaDescriber, FocusMonitor, addAriaReferencedId, removeAriaReferencedId } from '@angular/cdk/a11y';\nimport { Directive, OnDestroy, Signal, TemplateRef, computed, effect, inject, input } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { filter, map, tap } from 'rxjs/operators';\nimport { CalloutBaseDirective } from './callout-base.directive';\nimport { ICalloutTriggers } from './models/ICalloutTriggers';\n\n/**\n * A callout holding no interactive content, just a short piece of supplementary text about the element it is\n * attached to, opened by hovering the host or focusing it from the keyboard.\n *\n * The content reaches assistive technology through the host's `aria-describedby` whether the tooltip is open or not,\n * which matters because a screen reader user cannot hover to open it. A tooltip never takes focus, so anything in it\n * that could be operated would be unreachable - a callout holding a link or a button is a `nwPopover`\n */\n@Directive({\n    selector: '[nwTooltip]',\n    exportAs: 'nw-tooltip'\n})\nexport class TooltipDirective extends CalloutBaseDirective implements OnDestroy {\n    private _ariaDescriber = inject(AriaDescriber);\n    private _focusMonitor = inject(FocusMonitor);\n\n    readonly nwTooltip = input<string | TemplateRef<any>>();\n    /**\n     * Describe the host element with the content, so that screen reader users get it without opening the tooltip.\n     * When not set, the description is skipped where the host's accessible name - its `aria-label`, or failing\n     * that its visible text - is already the same text, so that it is not announced twice. Set it explicitly to\n     * force the description on or off. Note that a description identical to the host's `aria-label` is dropped\n     * by the CDK `AriaDescriber` itself, so `true` cannot force that case\n     */\n    readonly withAriaDescription = input<boolean | undefined>(undefined);\n    /**\n     * The screen width below which the tooltip opens on tap rather than on hover, as touch devices have no hover.\n     * It stays a tooltip either way - only its events change. Set to 0 to always use the hover events\n     */\n    readonly breakpoint = input(767);\n\n    /** The last text handed to `_registerDescription`. Only registered with the `AriaDescriber` where it is non-empty */\n    private _describedText: string | null = null;\n\n    protected readonly _content: Signal<string | TemplateRef<any>> = this.nwTooltip;\n\n    /**\n     * Whether focus opens this tooltip: the keyboard equivalent of `mouseenter`, so it follows the hover events\n     * rather than being bound separately. A manually controlled tooltip - one with no open events - is opened by\n     * its host component alone, and a tap-to-open one below the `breakpoint` is opened by activating the host\n     */\n    private readonly _opensOnFocus = computed(() => this._triggers().openEvents.includes('mouseenter'));\n\n    /** The content as plain text, falsy where there is nothing to describe the host with */\n    private readonly _describableText = computed(() => {\n        const content = this.nwTooltip();\n        const withDescription = this.withAriaDescription();\n\n        if (withDescription === false || typeof content !== 'string') {\n            return null;\n        }\n\n        const text = this._toPlainText(content);\n\n        /**\n         * A description that repeats the host's accessible name verbatim would be announced twice, so it is\n         * skipped unless withAriaDescription demands it\n         */\n        if (withDescription === undefined && text === this._hostAccessibleName()) {\n            return null;\n        }\n\n        return text;\n    });\n\n    constructor() {\n        super();\n        effect(() => this._registerDescription(this._describableText()));\n    }\n\n    protected _getTriggerDefaults(): ICalloutTriggers {\n        /**\n         * There are no hover events on touch, so a tooltip on a small screen opens on tap instead\n         */\n        if (window.innerWidth < this.breakpoint()) {\n            return {\n                delay: 0,\n                openEvents: ['click'],\n                closeEvents: ['click'],\n                closeOnScroll: false,\n                pointerEvents: 'auto'\n            };\n        }\n\n        return {\n            delay: 500,\n            openEvents: ['mouseenter'],\n            closeEvents: ['click', 'mouseleave'],\n            closeOnScroll: true,\n            pointerEvents: 'none'\n        };\n    }\n\n    /**\n     * A tooltip has no outside-click behaviour of its own, but a tap-opened one on touch has no hover to end it,\n     * so tapping elsewhere has to dismiss it\n     */\n    protected override _dismissesOnOutsideClick(): boolean {\n        return window.innerWidth < this.breakpoint();\n    }\n\n    protected _onCalloutOpened(calloutEl: HTMLElement): void {\n        calloutEl.setAttribute('role', 'tooltip');\n        this._setDescribedByCallout(true);\n    }\n\n    protected override _onCalloutClosing(): void {\n        this._setDescribedByCallout(false);\n    }\n\n    protected override _getAdditionalToggleEvents(): Observable<boolean> {\n        return this._opensOnFocus() ? this._getFocusEvents$() : super._getAdditionalToggleEvents();\n    }\n\n    /**\n     * Emits true when the host is focused from the keyboard, and false when focus leaves it again\n     */\n    private _getFocusEvents$(): Observable<boolean> {\n        /** Only close on blur what focus opened, so that a hover- or `isOpen`-opened tooltip survives blur */\n        let isOpenedByFocus: boolean = false;\n\n        return this._focusMonitor.monitor(this._elRef).pipe(\n            filter(origin => origin === 'keyboard' || (origin === null && isOpenedByFocus)),\n            tap(origin => (isOpenedByFocus = origin === 'keyboard')),\n            map(origin => origin === 'keyboard')\n        );\n    }\n\n    /** Point `aria-describedby` at the open callout. Only needed for a `TemplateRef`, which cannot be described */\n    private _setDescribedByCallout(isOpen: boolean): void {\n        if (this.withAriaDescription() === false || this._describedText) {\n            return;\n        }\n\n        const host = this._elRef.nativeElement;\n\n        if (isOpen) {\n            addAriaReferencedId(host, 'aria-describedby', this._calloutId);\n        } else {\n            removeAriaReferencedId(host, 'aria-describedby', this._calloutId);\n        }\n    }\n\n    /** Register text with the `AriaDescriber`, which adds it to the accessibility tree as a hidden node */\n    private _registerDescription(text: string | null): void {\n        if (text === this._describedText) {\n            return;\n        }\n\n        if (this._describedText) {\n            this._ariaDescriber.removeDescription(this._elRef.nativeElement, this._describedText);\n        }\n\n        if (text) {\n            this._ariaDescriber.describe(this._elRef.nativeElement, text);\n        }\n\n        this._describedText = text;\n    }\n\n    /**\n     * An approximation of the host's accessible name: its `aria-label`, or failing that its visible text. Read\n     * when the content changes, which covers hosts whose label and tooltip are bound to the same value; a label\n     * that changes independently of the content is not re-read\n     */\n    private _hostAccessibleName(): string | null {\n        const host = this._elRef.nativeElement;\n\n        return this._normalize(host.getAttribute('aria-label') || host.textContent || '') || null;\n    }\n\n    private _normalize(text: string): string {\n        return text.replace(/\\s+/g, ' ').trim();\n    }\n\n    /**\n     * String content is rendered as HTML, so parse out its text. `DOMParser` in preference to an element's\n     * `innerHTML`, as it creates an inert document that loads no resources.\n     *\n     * Normalised on the way out, so that it is directly comparable with the host's accessible name and so that\n     * the indentation of multi-line content does not reach the description\n     */\n    private _toPlainText(content: string): string {\n        const text =\n            typeof content !== 'string'\n                ? new DOMParser().parseFromString(content, 'text/html').body.textContent\n                : content;\n\n        return this._normalize(text);\n    }\n\n    override ngOnDestroy(): void {\n        super.ngOnDestroy();\n        this._focusMonitor.stopMonitoring(this._elRef);\n\n        if (this._describedText) {\n            this._ariaDescriber.removeDescription(this._elRef.nativeElement, this._describedText);\n            this._describedText = null;\n        }\n    }\n}\n","import { FocusTrap, FocusTrapFactory, InteractivityChecker } from '@angular/cdk/a11y';\nimport { Directive, Signal, TemplateRef, inject, input } from '@angular/core';\nimport { CalloutBaseDirective } from './callout-base.directive';\nimport { ICalloutTriggers } from './models/ICalloutTriggers';\n\n/**\n * A callout that can hold interactive content - formatted text, links and buttons - toggled by clicking its host,\n * which should be a button and which the keyboard fires from Enter and Space.\n *\n * It is exposed as a small dialog, named after its trigger and described by its own content, and it announces\n * itself by taking focus. Focus is trapped there until it closes - on Escape, on the close button, or on a click\n * outside - and then returns to where it came from. Content that is only text and only needs describing belongs in\n * a `nwTooltip` instead\n */\n@Directive({\n    selector: '[nwPopover]',\n    exportAs: 'nw-popover'\n})\nexport class PopoverDirective extends CalloutBaseDirective {\n    private _focusTrapFactory = inject(FocusTrapFactory);\n    private _interactivityChecker = inject(InteractivityChecker);\n\n    readonly nwPopover = input<string | TemplateRef<any>>();\n    /** Display a close button or not */\n    readonly withClose = input(false);\n    readonly closeOnOutsideClick = input(false);\n\n    private _focusTrap: FocusTrap | null = null;\n    /** The element focused before focus was moved into the callout */\n    private _previouslyFocusedEl: HTMLElement | null = null;\n\n    protected readonly _content: Signal<string | TemplateRef<any>> = this.nwPopover;\n\n    protected override _hasCloseButton(): boolean {\n        return this.withClose();\n    }\n\n    protected override _dismissesOnOutsideClick(): boolean {\n        return this.closeOnOutsideClick();\n    }\n\n    protected _getTriggerDefaults(): ICalloutTriggers {\n        return {\n            delay: 0,\n            openEvents: ['click'],\n            closeEvents: ['click'],\n            closeOnScroll: false,\n            pointerEvents: 'auto'\n        };\n    }\n\n    /**\n     * Announce the trigger as one that opens a dialog, and as currently closed. Done up front rather than on the\n     * first open, so that a screen reader user is told the control does something before they operate it.\n     *\n     * Only where the host is a control. On a generic element, such as a wrapper that holds the real button,\n     * `aria-expanded` is not an allowed attribute, and it would announce something that is not operable as though it\n     * were\n     */\n    override ngOnInit(): void {\n        super.ngOnInit();\n\n        if (!this._hostIsControl()) {\n            return;\n        }\n\n        const host = this._elRef.nativeElement;\n\n        host.setAttribute('aria-haspopup', 'dialog');\n        host.setAttribute('aria-expanded', 'false');\n    }\n\n    /**\n     * Name the callout after the host, announce it on the host, and move focus into it\n     */\n    protected _onCalloutOpened(calloutEl: HTMLElement): void {\n        calloutEl.setAttribute('role', 'dialog');\n        calloutEl.setAttribute('aria-labelledby', this._getHostId());\n        /**\n         * A dialog, unlike a tooltip, does not take its name from its contents, so the content has to be pointed\n         * at explicitly or focusing the callout announces its name and nothing else\n         */\n        calloutEl.setAttribute('aria-describedby', `${this._calloutId}-content`);\n\n        if (this._hostIsControl()) {\n            this._elRef.nativeElement.setAttribute('aria-expanded', 'true');\n        }\n\n        if (this._focusCalloutIfOpenedFromHost(calloutEl)) {\n            this._trapFocusIfThereIsSomethingToTrap(calloutEl);\n        }\n    }\n\n    /**\n     * Release the focus trap, restoring focus unless the user has already moved it, e.g. by clicking outside\n     */\n    protected override _onCalloutClosing(): void {\n        /**\n         * Restore only focus that is still ours to move. Not where the user has already taken it elsewhere, and not\n         * while the directive is being destroyed - the trigger is on its way out of the document, so focusing it\n         * would strand focus on a removed element rather than hand it back\n         */\n        const shouldRestoreFocus =\n            !this._isDestroyed &&\n            this._previouslyFocusedEl?.isConnected &&\n            this._calloutEl?.contains(document.activeElement);\n\n        this._focusTrap?.destroy();\n        this._focusTrap = null;\n\n        if (this._hostIsControl()) {\n            this._elRef.nativeElement.setAttribute('aria-expanded', 'false');\n        }\n\n        if (shouldRestoreFocus) {\n            this._previouslyFocusedEl.focus();\n        }\n\n        this._previouslyFocusedEl = null;\n    }\n\n    /**\n     * Tabbing out of an untrapped callout would land at the end of the document, as the overlay is appended to the\n     * body. Close and hand focus back to the host instead, so that tabbing carries on from where it left off\n     */\n    protected override _onCalloutKeydown(event: KeyboardEvent): void {\n        if (event.key !== 'Tab' || !this._calloutEl?.contains(document.activeElement)) {\n            return;\n        }\n\n        /**\n         * Content can turn interactive after the callout opened - something that loaded in, or an `@if` that\n         * flipped - so the decision not to trap is revisited here rather than left as it was found at open time.\n         * A trap created now still has its anchors in place before the browser acts on this Tab\n         */\n        if (this._focusTrap || this._trapFocusIfThereIsSomethingToTrap(this._calloutEl)) {\n            return;\n        }\n\n        event.preventDefault();\n        this.nwClose.emit();\n        this._close();\n    }\n\n    /**\n     * Trap focus, but only where there is something to trap it on: a trap around content with nothing tabbable in\n     * it holds focus on its own hidden anchor, which reads as focus disappearing. Returns whether it trapped\n     */\n    private _trapFocusIfThereIsSomethingToTrap(calloutEl: HTMLElement): boolean {\n        const hasTabbableContent = Array.from(calloutEl.querySelectorAll<HTMLElement>('*')).some(el =>\n            this._interactivityChecker.isTabbable(el)\n        );\n\n        if (hasTabbableContent) {\n            this._focusTrap = this._focusTrapFactory.create(calloutEl);\n        }\n\n        return hasTabbableContent;\n    }\n\n    /**\n     * Move focus to the callout, which is the only thing that announces it: a description added while it is open is\n     * not read, as nothing re-reads a changed attribute. The callout itself is focused rather than the first thing\n     * in it, so that its name is announced before its content, and so that long content can be read at the user's\n     * own pace rather than in one unstoppable burst.\n     *\n     * Only done when focus is on the host, which means the user has just acted on it and following the callout\n     * continues what they were doing. An open from the `isOpen` input or from `show()` while focus is elsewhere\n     * must not take it - the docs page alone has popovers that are open from the moment it loads\n     */\n    private _focusCalloutIfOpenedFromHost(calloutEl: HTMLElement): boolean {\n        if (!this._elRef.nativeElement.contains(document.activeElement)) {\n            return false;\n        }\n\n        this._previouslyFocusedEl = document.activeElement as HTMLElement;\n        calloutEl.setAttribute('tabindex', '-1');\n        calloutEl.focus();\n\n        return true;\n    }\n\n    /** Whether the host is a button or has been given a role, which are the hosts `aria-expanded` is valid on */\n    private _hostIsControl(): boolean {\n        const host = this._elRef.nativeElement;\n        return host.tagName === 'BUTTON' || host.hasAttribute('role');\n    }\n\n    /** An id for the host, so that the dialog can be labelled by it. Only generated if it has none */\n    private _getHostId(): string {\n        const host = this._elRef.nativeElement;\n\n        if (!host.id) {\n            host.id = `${this._calloutId}-trigger`;\n        }\n\n        return host.id;\n    }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;AAGO,MAAM,qBAAqB,GAAG,IAAI,cAAc,CAAe,iBAAiB,CAAC;;MCyC3E,yBAAyB,CAAA;AAMlC,IAAA,WAAA,GAAA;AALA,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAe,qBAAqB,CAAC;AAE3C,QAAA,IAAA,CAAA,KAAK,GAAG,IAAI,YAAY,EAAQ;QAChC,IAAA,CAAA,aAAa,GAAY,KAAK;AAGjC,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI;QAEtB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,OAAO,YAAY,WAAW;IAC5D;8GAVS,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAzB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,yBAAyB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,sBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EArCxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiCT,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAES,OAAO,oFAAE,gBAAgB,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,CAAA,yBAAA,EAAA,kBAAA,EAAA,0BAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAA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