import * as i0 from '@angular/core';
import { Directive, InjectionToken, SimpleChange, Injectable, Inject, Optional, SkipSelf, ComponentFactoryResolver, Injector, EventEmitter, Component, ChangeDetectionStrategy, ViewChild, HostListener, NgModule } from '@angular/core';
import * as i2 from '@angular/cdk/layout';
import { BreakpointObserver } from '@angular/cdk/layout';
import * as i1 from '@angular/cdk/overlay';
import { Overlay, OverlayModule as OverlayModule$1 } from '@angular/cdk/overlay';
import { ComponentPortal } from '@angular/cdk/portal';
import * as i3 from '@angular/router';
import { NavigationStart, Router } from '@angular/router';
import * as i4 from 'rxjs';
import { Subscription, filter, startWith, BehaviorSubject } from 'rxjs';
import * as i2$1 from '@angular/common';
import { CommonModule } from '@angular/common';
import * as i3$1 from '@aztrix/icons';
import { IconsModule } from '@aztrix/icons';
import * as i4$1 from '@aztrix/components/button';
import { ButtonModule } from '@aztrix/components/button';
import * as i6 from '@aztrix/helpers';
import { HelperPipesModule } from '@aztrix/helpers';

class OverlayContentDirective {
    constructor(viewContainerRef) {
        this.viewContainerRef = viewContainerRef;
    }
}
OverlayContentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: OverlayContentDirective, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive });
OverlayContentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.5", type: OverlayContentDirective, selector: "[axOverlayContent]", ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: OverlayContentDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: '[axOverlayContent]',
                }]
        }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }]; } });

const OVERLAY_PRIMARY_COLOR = new InjectionToken('OVERLAY_PRIMARY_COLOR');
const OVERLAY_ACCENT_COLOR = new InjectionToken('OVERLAY_ACCENT_COLOR');
const OVERLAY_WARN_COLOR = new InjectionToken('OVERLAY_WARN_COLOR');
const OVERLAY_FONT_COLOR = new InjectionToken('OVERLAY_FONT_COLOR');
const OVERLAY_FONT_FAMILY = new InjectionToken('OVERLAY_FONT_FAMILY');
const OVERLAY_SHADOW_DOM = new InjectionToken('OVERLAY_SHADOW_DOM');

var ModalSize;
(function (ModalSize) {
    ModalSize["DYNAMIC"] = "DYNAMIC";
    ModalSize["EXTRA_SMALL"] = "EXTRA_SMALL";
    ModalSize["SMALL"] = "SMALL";
    ModalSize["MEDIUM"] = "MEDIUM";
    ModalSize["LARGE"] = "LARGE";
})(ModalSize || (ModalSize = {}));
class OverlayService {
    constructor(_overlay, _resolver, _injector, _breakpointObserver, _primaryColor$, _accentColor$, _warnColor$, _fontColor$, _fontFamily$, _shadowDom$, _router) {
        this._overlay = _overlay;
        this._resolver = _resolver;
        this._injector = _injector;
        this._breakpointObserver = _breakpointObserver;
        this._primaryColor$ = _primaryColor$;
        this._accentColor$ = _accentColor$;
        this._warnColor$ = _warnColor$;
        this._fontColor$ = _fontColor$;
        this._fontFamily$ = _fontFamily$;
        this._shadowDom$ = _shadowDom$;
        this._router = _router;
        this.overlays = [];
    }
    createModal(component, config, hostElement) {
        if (hostElement) {
            this._baseVariables = {
                primaryColor: this._primaryColor$.value,
                accentColor: this._accentColor$.value,
                warnColor: this._warnColor$.value,
                fontColor: this._fontColor$.value,
                fontFamily: this._fontFamily$.value,
            };
            const computedStyleHost = getComputedStyle(hostElement.nativeElement);
            this._primaryColor$.next(computedStyleHost.getPropertyValue('--primary-color-500'));
            this._accentColor$.next(computedStyleHost.getPropertyValue('--accent-color-500'));
            this._warnColor$.next(computedStyleHost.getPropertyValue('--warn-color-500'));
            this._fontColor$.next(computedStyleHost.getPropertyValue('--font-color'));
            this._fontFamily$.next(computedStyleHost.getPropertyValue('--font'));
        }
        this._shadowDom$.next(config?.shadowDOM ?? true);
        const componentFactory = this._resolver.resolveComponentFactory(component);
        const componentRef = componentFactory.create(this._injector);
        const previousInstance = { ...componentRef.instance };
        if (config?.init) {
            config?.init(componentRef.instance);
        }
        const { title, titleOpts, hasTitleBar, backgroundColor, modalSize, closeOnBackdropClick, closeOnNavigate, close, } = config || {};
        const size = modalSize || ModalSize.SMALL;
        const overlayRef = this._initOverlay(size);
        const modalComponent = new ComponentPortal(OverlayComponent);
        const overlayWrapperRef = overlayRef.attach(modalComponent);
        const overlayComponent = overlayWrapperRef.instance;
        const subscriptions = new Subscription();
        const overlayConfig = {
            overlayRef,
            componentRef,
            overlayComponent,
            subscriptions,
            close,
        };
        this.overlays.push(overlayConfig);
        if (closeOnBackdropClick !== false) {
            subscriptions.add(overlayRef.backdropClick().subscribe(() => this._closeModal(overlayConfig)));
        }
        if (closeOnNavigate && this._router) {
            subscriptions.add(this._router.events
                .pipe(filter((event) => event instanceof NavigationStart))
                .subscribe(() => this._closeModal(overlayConfig)));
        }
        overlayComponent.init(title, titleOpts, hasTitleBar, backgroundColor, size, componentRef);
        subscriptions.add(overlayComponent.viewContainerInserted.subscribe(() => {
            if (config?.init && componentRef.instance['ngOnChanges']) {
                const changes = {};
                for (const [key, currentValue] of Object.entries(componentRef.instance)) {
                    const previousValue = previousInstance[key];
                    if (previousValue !== currentValue) {
                        changes[key] = new SimpleChange(previousValue, currentValue, true);
                    }
                }
                componentRef.instance['ngOnChanges'](changes);
            }
        }));
        subscriptions.add(overlayComponent.didClickClose.subscribe(() => this._closeModal(overlayConfig)));
        subscriptions.add(overlayComponent.didResize
            .pipe(startWith(undefined))
            .subscribe(() => overlayRef.updatePositionStrategy(this._calculatePositionStrategy(overlayComponent, size))));
        subscriptions.add(overlayComponent.didResize.subscribe(() => overlayRef.updateSize(this._size(size))));
        return overlayComponent;
    }
    _initOverlay(modalSize = ModalSize.SMALL) {
        return this._overlay.create({
            hasBackdrop: true,
            backdropClass: 'cdk-overlay-dark-backdrop',
            positionStrategy: this._calculatePositionStrategy(undefined, modalSize),
            scrollStrategy: this._overlay.scrollStrategies.block(),
            width: this._width(modalSize),
            height: this._height(modalSize),
            disposeOnNavigation: true,
        });
    }
    _closeModal(overlay) {
        if (overlay.close) {
            overlay.close(overlay.componentRef.instance);
        }
        if (this._baseVariables) {
            this._primaryColor$.next(this._baseVariables.primaryColor);
            this._accentColor$.next(this._baseVariables.accentColor);
            this._warnColor$.next(this._baseVariables.warnColor);
            this._fontColor$.next(this._baseVariables.fontColor);
            this._fontFamily$.next(this._baseVariables.fontFamily);
            this._baseVariables = undefined;
        }
        overlay.overlayRef.detach();
        overlay.subscriptions.unsubscribe();
        const foundOverlayIndex = this.overlays.findIndex((o) => o === overlay);
        if (foundOverlayIndex > -1) {
            this.overlays.splice(foundOverlayIndex, 1);
        }
    }
    closeModal(overlayComponent) {
        let overlayConfig = undefined;
        if (overlayComponent) {
            overlayConfig = this.overlays.find((overlay) => overlay.overlayComponent === overlayComponent);
        }
        else {
            overlayConfig = this.overlays[this.overlays.length - 1];
        }
        if (overlayConfig) {
            this._closeModal(overlayConfig);
        }
    }
    closeAllModals() {
        const overlaysCopy = [...this.overlays];
        for (const overlay of overlaysCopy) {
            if (overlay) {
                this._closeModal(overlay);
            }
        }
        this.overlays = [];
    }
    _width(size) {
        if (this._fullscreen(size)) {
            return `100%`;
        }
        else {
            return `${modalSizeToPixels(size)}px`;
        }
    }
    _height(size) {
        if (this._fullscreen(size)) {
            return `100%`;
        }
        else {
            return 'auto';
        }
    }
    _size(size) {
        return { width: this._width(size), height: this._height(size) };
    }
    _calculatePositionStrategy(componentRef, size) {
        const fullscreen = this._fullscreen(size);
        const top = fullscreen ? '0px' : '100px';
        const bottom = fullscreen ? '0px' : '50px';
        if (componentRef) {
            componentRef.elementRef.nativeElement.style.setProperty('--overlay-top', top);
            componentRef.elementRef.nativeElement.style.setProperty('--overlay-bottom', bottom);
        }
        return this._overlay.position().global().centerHorizontally().top(top);
    }
    _breakpointMatched() {
        return this._breakpointObserver.isMatched('(max-width: 424px)');
    }
    _fullscreen(size) {
        return (size !== ModalSize.DYNAMIC &&
            (window.innerWidth <= modalSizeToPixels(size) || this._breakpointMatched()));
    }
}
OverlayService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: OverlayService, deps: [{ token: i1.Overlay }, { token: i0.ComponentFactoryResolver }, { token: i0.Injector }, { token: i2.BreakpointObserver }, { token: OVERLAY_PRIMARY_COLOR }, { token: OVERLAY_ACCENT_COLOR }, { token: OVERLAY_WARN_COLOR }, { token: OVERLAY_FONT_COLOR }, { token: OVERLAY_FONT_FAMILY }, { token: OVERLAY_SHADOW_DOM }, { token: i3.Router, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
OverlayService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: OverlayService });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: OverlayService, decorators: [{
            type: Injectable
        }], ctorParameters: function () { return [{ type: i1.Overlay }, { type: i0.ComponentFactoryResolver }, { type: i0.Injector }, { type: i2.BreakpointObserver }, { type: i4.BehaviorSubject, decorators: [{
                    type: Inject,
                    args: [OVERLAY_PRIMARY_COLOR]
                }] }, { type: i4.BehaviorSubject, decorators: [{
                    type: Inject,
                    args: [OVERLAY_ACCENT_COLOR]
                }] }, { type: i4.BehaviorSubject, decorators: [{
                    type: Inject,
                    args: [OVERLAY_WARN_COLOR]
                }] }, { type: i4.BehaviorSubject, decorators: [{
                    type: Inject,
                    args: [OVERLAY_FONT_COLOR]
                }] }, { type: i4.BehaviorSubject, decorators: [{
                    type: Inject,
                    args: [OVERLAY_FONT_FAMILY]
                }] }, { type: i4.BehaviorSubject, decorators: [{
                    type: Inject,
                    args: [OVERLAY_SHADOW_DOM]
                }] }, { type: i3.Router, decorators: [{
                    type: Optional
                }] }]; } });
function aztrixOverlayServiceProviderFactory(parentOverlayService, overlay, componentFactoryResolver, defaultInjector, breakpointObserver, primaryColor, accentColor, warnColor, fontColor, font, shadowDom, router) {
    return (parentOverlayService ||
        new OverlayService(overlay, componentFactoryResolver, defaultInjector, breakpointObserver, primaryColor, accentColor, warnColor, fontColor, font, shadowDom, router));
}
const AZTRIX_OVERLAY_SERVICE_PROVIDER = {
    provide: OverlayService,
    deps: [
        [new Optional(), new SkipSelf(), OverlayService],
        Overlay,
        ComponentFactoryResolver,
        Injector,
        BreakpointObserver,
        OVERLAY_PRIMARY_COLOR,
        OVERLAY_ACCENT_COLOR,
        OVERLAY_WARN_COLOR,
        OVERLAY_FONT_COLOR,
        OVERLAY_FONT_FAMILY,
        OVERLAY_SHADOW_DOM,
        [new Optional(), Router],
    ],
    useFactory: aztrixOverlayServiceProviderFactory,
};

function modalSizeToPixels(size) {
    switch (size) {
        case ModalSize.EXTRA_SMALL:
            return 300;
        case ModalSize.SMALL:
            return 490;
        case ModalSize.MEDIUM:
            return 780;
        case ModalSize.LARGE:
            return 900;
        default:
            return null;
    }
}

const FOCUSABLE_ELEMENTS_SELECTOR = [
    'a[href]',
    'button:not([disabled])',
    'input:not([disabled]):not([type="hidden"])',
    'select:not([disabled])',
    'textarea:not([disabled])',
    '[contenteditable]',
    '[tabindex]:not([tabindex="-1"])',
].join(', ');
class OverlayComponent {
    constructor(elementRef, _changeDetector, _breakpointObserver) {
        this.elementRef = elementRef;
        this._changeDetector = _changeDetector;
        this._breakpointObserver = _breakpointObserver;
        this.backgroundColor = '#fff';
        this.didClickClose = new EventEmitter();
        this.didResize = new EventEmitter();
        this.viewContainerInserted = new EventEmitter();
    }
    ngAfterViewInit() {
        this._loadComponent();
        this._focusFirstElement();
        this._changeDetector.detectChanges();
    }
    init(title, titleOpts, hasTitleBar = true, backgroundColor = '#fff', modalSize, componentRef) {
        this.title = title;
        this.titleOpts = titleOpts;
        this.hasTitleBar = hasTitleBar;
        this.modalSize = modalSize;
        this.backgroundColor = backgroundColor;
        this.componentRef = componentRef;
    }
    _loadComponent() {
        const viewContainerRef = this.modalContent.viewContainerRef;
        viewContainerRef.clear();
        viewContainerRef.insert(this.componentRef.hostView);
        this.viewContainerInserted.next();
    }
    _focusFirstElement() {
        if (!this.elementRef.nativeElement.contains(document.activeElement)) {
            const autoFocusable = this.elementRef.nativeElement.querySelector(`[autofocus]`);
            const firstFocusable = (this.elementRef.nativeElement.querySelectorAll(FOCUSABLE_ELEMENTS_SELECTOR)[0]);
            const elementToFocus = autoFocusable || firstFocusable || this.elementRef.nativeElement;
            elementToFocus.focus();
        }
    }
    keyboardEventHanlder(event) {
        if (event.key === 'Escape') {
            this.didClickClose.emit();
        }
    }
    didResizeWindow() {
        this.didResize.emit();
    }
    get fullScreenModal() {
        return (this.modalSize !== ModalSize.DYNAMIC &&
            (window.innerWidth <= modalSizeToPixels(this.modalSize) || this._breakpointMatched()));
    }
    _breakpointMatched() {
        return this._breakpointObserver.isMatched('(max-width: 424px)');
    }
}
OverlayComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: OverlayComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i2.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Component });
OverlayComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: OverlayComponent, selector: "ax-overlay", host: { listeners: { "window:keyup": "keyboardEventHanlder($event)", "window:resize": "didResizeWindow()" } }, viewQueries: [{ propertyName: "modalContent", first: true, predicate: OverlayContentDirective, descendants: true }], ngImport: i0, template: "<div\n  class=\"c-modal__dialog fade-in\"\n  [ngClass]=\"{'no-title': !title, 'no-title-bar': !hasTitleBar, full: fullScreenModal}\"\n  [style.background-color]=\"backgroundColor\"\n>\n  <div *ngIf=\"hasTitleBar\" class=\"c-modal__header\">\n    <button axButton class=\"c-modal__close cy-close\" icon-button (click)=\"didClickClose.emit()\">\n      <ax-icon class=\"icon\" name=\"close\"></ax-icon>\n    </button>\n    <div class=\"c-modal__title\" *ngIf=\"title\">\n      <h4>\n        {{ title | translate: titleOpts }}\n      </h4>\n    </div>\n  </div>\n  <div class=\"c-modal__body\" [ngClass]=\"{'top-rounded': !hasTitleBar}\">\n    <ng-template axOverlayContent></ng-template>\n  </div>\n</div>\n", styles: [":host{width:100%;height:100%;--overlay-header-height: 50px}:host ::ng-deep mat-tab-group{padding-bottom:1rem}.fade-in{animation-name:fadeInZoom;animation-iteration-count:1;animation-timing-function:ease-in-out;animation-duration:.2s}@keyframes fadeInZoom{0%{transform:scale(.8);opacity:0}to{transform:scale(1);opacity:1}}.c-modal__body{height:100%;max-height:calc(100dvh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - var(--overlay-top, 0px) - var(--overlay-bottom, 0px) - var(--overlay-header-height, 0px) - var(--overlay-inset-bottom, 0px));width:100%;overflow-y:auto;border-bottom-left-radius:10px;border-bottom-right-radius:10px}.c-modal__body.top-rounded{border-top-left-radius:10px;border-top-right-radius:10px}.c-modal__body ::ng-deep .h-button-wrapper{padding:.5rem 0}.c-modal__dialog{height:100%;border-radius:10px}.c-modal__dialog.no-title-bar .c-modal__body{max-height:calc(100vh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - var(--overlay-top, 0px) - var(--overlay-bottom, 0px) - var(--overlay-inset-bottom, 0px))}.c-modal__dialog.no-title .c-modal__header{background-color:transparent}.c-modal__dialog ::ng-deep ax-snackbar{margin:0}.c-modal__dialog ::ng-deep ax-snackbar .m-snackbar__wrapper{padding:0}.c-modal__dialog.full{border-radius:0;overflow:hidden;margin:initial}.c-modal__dialog.full .c-modal__body{width:100%;border-bottom-left-radius:0;border-bottom-right-radius:0}.c-modal__dialog.full .c-modal__header{border-top-right-radius:0;border-top-left-radius:0}.c-modal__header{height:var(--overlay-header-height);display:grid;grid-template-columns:50px 1fr 50px;align-items:center;justify-content:space-between;text-align:center;width:100%;background-color:#efefef;color:#363f48;border-top-right-radius:10px;border-top-left-radius:10px}.c-modal__title{font-size:1.125rem}.c-modal__title h1,.c-modal__title h2,.c-modal__title h3,.c-modal__title h4,.c-modal__title h5,.c-modal__title h6{font-size:1.125rem;margin:0}.c-modal__title .icon{width:1em;height:1em;line-height:1;margin-right:.25rem}.c-modal__close{margin-left:.5rem;font-size:.875rem}.c-modal__close .icon{cursor:pointer}.close{position:absolute;z-index:2;top:-16px;left:-16px;padding:0;min-width:36px;justify-content:center;color:#000;background-color:#fff}.close:hover{background-color:#27ae600f}\n"], dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$1.IconComponent, selector: "ax-icon", inputs: ["name", "inline"] }, { kind: "directive", type: i4$1.ButtonDirective, selector: "[axButton]", inputs: ["color", "labelHideMobile", "smallButton", "bigButton", "fullWidth", "filled", "outline", "icon-button", "hoverLabel", "hover", "lowercase", "disabled"] }, { kind: "directive", type: OverlayContentDirective, selector: "[axOverlayContent]" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: OverlayComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-overlay', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n  class=\"c-modal__dialog fade-in\"\n  [ngClass]=\"{'no-title': !title, 'no-title-bar': !hasTitleBar, full: fullScreenModal}\"\n  [style.background-color]=\"backgroundColor\"\n>\n  <div *ngIf=\"hasTitleBar\" class=\"c-modal__header\">\n    <button axButton class=\"c-modal__close cy-close\" icon-button (click)=\"didClickClose.emit()\">\n      <ax-icon class=\"icon\" name=\"close\"></ax-icon>\n    </button>\n    <div class=\"c-modal__title\" *ngIf=\"title\">\n      <h4>\n        {{ title | translate: titleOpts }}\n      </h4>\n    </div>\n  </div>\n  <div class=\"c-modal__body\" [ngClass]=\"{'top-rounded': !hasTitleBar}\">\n    <ng-template axOverlayContent></ng-template>\n  </div>\n</div>\n", styles: [":host{width:100%;height:100%;--overlay-header-height: 50px}:host ::ng-deep mat-tab-group{padding-bottom:1rem}.fade-in{animation-name:fadeInZoom;animation-iteration-count:1;animation-timing-function:ease-in-out;animation-duration:.2s}@keyframes fadeInZoom{0%{transform:scale(.8);opacity:0}to{transform:scale(1);opacity:1}}.c-modal__body{height:100%;max-height:calc(100dvh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - var(--overlay-top, 0px) - var(--overlay-bottom, 0px) - var(--overlay-header-height, 0px) - var(--overlay-inset-bottom, 0px));width:100%;overflow-y:auto;border-bottom-left-radius:10px;border-bottom-right-radius:10px}.c-modal__body.top-rounded{border-top-left-radius:10px;border-top-right-radius:10px}.c-modal__body ::ng-deep .h-button-wrapper{padding:.5rem 0}.c-modal__dialog{height:100%;border-radius:10px}.c-modal__dialog.no-title-bar .c-modal__body{max-height:calc(100vh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - var(--overlay-top, 0px) - var(--overlay-bottom, 0px) - var(--overlay-inset-bottom, 0px))}.c-modal__dialog.no-title .c-modal__header{background-color:transparent}.c-modal__dialog ::ng-deep ax-snackbar{margin:0}.c-modal__dialog ::ng-deep ax-snackbar .m-snackbar__wrapper{padding:0}.c-modal__dialog.full{border-radius:0;overflow:hidden;margin:initial}.c-modal__dialog.full .c-modal__body{width:100%;border-bottom-left-radius:0;border-bottom-right-radius:0}.c-modal__dialog.full .c-modal__header{border-top-right-radius:0;border-top-left-radius:0}.c-modal__header{height:var(--overlay-header-height);display:grid;grid-template-columns:50px 1fr 50px;align-items:center;justify-content:space-between;text-align:center;width:100%;background-color:#efefef;color:#363f48;border-top-right-radius:10px;border-top-left-radius:10px}.c-modal__title{font-size:1.125rem}.c-modal__title h1,.c-modal__title h2,.c-modal__title h3,.c-modal__title h4,.c-modal__title h5,.c-modal__title h6{font-size:1.125rem;margin:0}.c-modal__title .icon{width:1em;height:1em;line-height:1;margin-right:.25rem}.c-modal__close{margin-left:.5rem;font-size:.875rem}.c-modal__close .icon{cursor:pointer}.close{position:absolute;z-index:2;top:-16px;left:-16px;padding:0;min-width:36px;justify-content:center;color:#000;background-color:#fff}.close:hover{background-color:#27ae600f}\n"] }]
        }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i2.BreakpointObserver }]; }, propDecorators: { modalContent: [{
                type: ViewChild,
                args: [OverlayContentDirective]
            }], keyboardEventHanlder: [{
                type: HostListener,
                args: ['window:keyup', ['$event']]
            }], didResizeWindow: [{
                type: HostListener,
                args: ['window:resize']
            }] } });

class OverlayModule {
    static forRoot(config) {
        return {
            ngModule: OverlayModule,
            providers: [
                {
                    provide: OVERLAY_PRIMARY_COLOR,
                    useValue: new BehaviorSubject(config?.primaryColor || undefined),
                },
                {
                    provide: OVERLAY_ACCENT_COLOR,
                    useValue: new BehaviorSubject(config?.accentColor || undefined),
                },
                {
                    provide: OVERLAY_WARN_COLOR,
                    useValue: new BehaviorSubject(config?.warnColor || undefined),
                },
                {
                    provide: OVERLAY_FONT_COLOR,
                    useValue: new BehaviorSubject(config?.fontColor || undefined),
                },
                {
                    provide: OVERLAY_FONT_FAMILY,
                    useValue: new BehaviorSubject(config?.fontFamily || undefined),
                },
            ],
        };
    }
}
OverlayModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: OverlayModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
OverlayModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.5", ngImport: i0, type: OverlayModule, declarations: [OverlayComponent, OverlayContentDirective], imports: [CommonModule, IconsModule, ButtonModule, HelperPipesModule, OverlayModule$1] });
OverlayModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: OverlayModule, providers: [
        AZTRIX_OVERLAY_SERVICE_PROVIDER,
        {
            provide: OVERLAY_SHADOW_DOM,
            useValue: new BehaviorSubject(true),
        },
    ], imports: [CommonModule, IconsModule, ButtonModule, HelperPipesModule, OverlayModule$1] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: OverlayModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [OverlayComponent, OverlayContentDirective],
                    imports: [CommonModule, IconsModule, ButtonModule, HelperPipesModule, OverlayModule$1],
                    providers: [
                        AZTRIX_OVERLAY_SERVICE_PROVIDER,
                        {
                            provide: OVERLAY_SHADOW_DOM,
                            useValue: new BehaviorSubject(true),
                        },
                    ],
                }]
        }] });

/**
 * Generated bundle index. Do not edit.
 */

export { AZTRIX_OVERLAY_SERVICE_PROVIDER, ModalSize, OVERLAY_ACCENT_COLOR, OVERLAY_FONT_COLOR, OVERLAY_FONT_FAMILY, OVERLAY_PRIMARY_COLOR, OVERLAY_SHADOW_DOM, OVERLAY_WARN_COLOR, OverlayComponent, OverlayContentDirective, OverlayModule, OverlayService, aztrixOverlayServiceProviderFactory };
//# sourceMappingURL=aztrix-components-overlay.mjs.map
//# sourceMappingURL=aztrix-components-overlay.mjs.map
