import * as i0 from '@angular/core';
import { Component, Directive, HostBinding, Input, TemplateRef, ViewChild, NgModule } from '@angular/core';
import * as i4 from '@angular/common';
import { CommonModule } from '@angular/common';
import * as i1 from '@angular/material/bottom-sheet';
import { MatBottomSheetModule } from '@angular/material/bottom-sheet';
import * as i5 from '@aztrix/helpers';
import { HelperPipesModule } from '@aztrix/helpers';
import * as i2 from '@aztrix/icons';
import { IconsModule } from '@aztrix/icons';
import { Subscription } from 'rxjs';

class NavbarComponent {
}
NavbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: NavbarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
NavbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: NavbarComponent, selector: "ax-navbar", ngImport: i0, template: "<div class=\"wings\">\n  <svg width=\"30\" height=\"30\">\n    <path fill=\"#fff\" d=\"M0,0 L0,30 L30,30 C15,30 0,15 0,0\"></path>\n  </svg>\n  <svg width=\"30\" height=\"30\">\n    <path fill=\"#fff\" d=\"M0,30 L30,30 L30,0 C30,15 15,30 0,30\"></path>\n  </svg>\n</div>\n<nav>\n  <ng-content></ng-content>\n</nav>\n", styles: [":host{display:block;overflow:hidden;position:fixed;bottom:0;width:100vw;min-height:60px;z-index:1100;text-align:center;pointer-events:none}.wings{display:flex;height:30px;justify-content:space-between;pointer-events:none}nav{display:grid;grid-template-columns:repeat(auto-fit,minmax(0px,92px));align-items:center;justify-content:center;grid-auto-flow:column;background-color:#fff;height:var(--height-navbar-mobile);pointer-events:all;padding-bottom:var(--safe-area-inset-bottom)}@media only screen and (max-width: 425px){nav{grid-template-columns:repeat(auto-fit,minmax(0px,70px))}}@media only screen and (max-width: 340px){nav{grid-template-columns:repeat(auto-fit,minmax(0px,auto))}}\n"] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: NavbarComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-navbar', template: "<div class=\"wings\">\n  <svg width=\"30\" height=\"30\">\n    <path fill=\"#fff\" d=\"M0,0 L0,30 L30,30 C15,30 0,15 0,0\"></path>\n  </svg>\n  <svg width=\"30\" height=\"30\">\n    <path fill=\"#fff\" d=\"M0,30 L30,30 L30,0 C30,15 15,30 0,30\"></path>\n  </svg>\n</div>\n<nav>\n  <ng-content></ng-content>\n</nav>\n", styles: [":host{display:block;overflow:hidden;position:fixed;bottom:0;width:100vw;min-height:60px;z-index:1100;text-align:center;pointer-events:none}.wings{display:flex;height:30px;justify-content:space-between;pointer-events:none}nav{display:grid;grid-template-columns:repeat(auto-fit,minmax(0px,92px));align-items:center;justify-content:center;grid-auto-flow:column;background-color:#fff;height:var(--height-navbar-mobile);pointer-events:all;padding-bottom:var(--safe-area-inset-bottom)}@media only screen and (max-width: 425px){nav{grid-template-columns:repeat(auto-fit,minmax(0px,70px))}}@media only screen and (max-width: 340px){nav{grid-template-columns:repeat(auto-fit,minmax(0px,auto))}}\n"] }]
        }] });

class NavbarItemDirective {
    constructor() {
        this._class = true;
        this.active = false;
    }
}
NavbarItemDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: NavbarItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
NavbarItemDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.5", type: NavbarItemDirective, selector: "[axNavbarItem]", inputs: { active: "active" }, host: { properties: { "class.ax-navbar-item": "this._class", "class.ax-navbar-item-active": "this.active" } }, ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: NavbarItemDirective, decorators: [{
            type: Directive,
            args: [{ selector: '[axNavbarItem]' }]
        }], propDecorators: { _class: [{
                type: HostBinding,
                args: ['class.ax-navbar-item']
            }], active: [{
                type: Input
            }, {
                type: HostBinding,
                args: ['class.ax-navbar-item-active']
            }] } });

class NavbarBottomSheetComponent {
}
NavbarBottomSheetComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: NavbarBottomSheetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
NavbarBottomSheetComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: NavbarBottomSheetComponent, selector: "ax-navbar-bottom-sheet", inputs: { content: "content" }, ngImport: i0, template: "<nav>\n  <ng-content></ng-content>\n</nav>\n", styles: ["nav{display:flex;flex-direction:column;padding-bottom:60px}nav ::ng-deep>*{color:var(--color);font-size:1rem;text-align:left;padding:0;border:none;background:transparent}nav ::ng-deep .icon{color:var(--primary-color-700);width:18px;height:18px;margin:1rem}\n"] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: NavbarBottomSheetComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-navbar-bottom-sheet', template: "<nav>\n  <ng-content></ng-content>\n</nav>\n", styles: ["nav{display:flex;flex-direction:column;padding-bottom:60px}nav ::ng-deep>*{color:var(--color);font-size:1rem;text-align:left;padding:0;border:none;background:transparent}nav ::ng-deep .icon{color:var(--primary-color-700);width:18px;height:18px;margin:1rem}\n"] }]
        }], propDecorators: { content: [{
                type: Input
            }] } });

class NavbarMoreComponent {
    constructor(_bottomSheet) {
        this._bottomSheet = _bottomSheet;
        this.open = false;
        this._subscription = new Subscription();
    }
    ngOnDestroy() {
        this._subscription.unsubscribe();
    }
    openBottomSheet() {
        if (this.open) {
            if (this._bottomSheetRef) {
                this._bottomSheetRef.dismiss();
            }
        }
        else {
            this._bottomSheetRef = this._bottomSheet.open(this._content, {
                closeOnNavigation: true,
            });
            this._subscription.unsubscribe();
            this._subscription = this._bottomSheetRef.afterDismissed().subscribe(() => {
                this.open = false;
            });
        }
        this.open = !this.open;
    }
}
NavbarMoreComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: NavbarMoreComponent, deps: [{ token: i1.MatBottomSheet }], target: i0.ɵɵFactoryTarget.Component });
NavbarMoreComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: NavbarMoreComponent, selector: "ax-navbar-more", host: { properties: { "class.ax-navbar-item-active": "this.open" } }, viewQueries: [{ propertyName: "_content", first: true, predicate: TemplateRef, descendants: true }], ngImport: i0, template: "<button class=\"button\" (click)=\"openBottomSheet()\">\n  <ax-icon class=\"icon\" [name]=\"open ? 'close' : 'menu'\"></ax-icon>\n  <span>{{ 'label.more' | translate | uppercase }}</span>\n</button>\n\n<ng-template>\n  <ax-navbar-bottom-sheet>\n    <ng-content></ng-content>\n  </ax-navbar-bottom-sheet>\n</ng-template>\n", styles: [":host{display:block;margin:0 auto}.button{display:flex;flex-direction:column;align-items:center;border:none;background-color:transparent;color:#fff;padding:0}\n"], dependencies: [{ kind: "component", type: i2.IconComponent, selector: "ax-icon", inputs: ["name", "inline"] }, { kind: "component", type: NavbarBottomSheetComponent, selector: "ax-navbar-bottom-sheet", inputs: ["content"] }, { kind: "pipe", type: i4.UpperCasePipe, name: "uppercase" }, { kind: "pipe", type: i5.TranslatePipe, name: "translate" }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: NavbarMoreComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-navbar-more', template: "<button class=\"button\" (click)=\"openBottomSheet()\">\n  <ax-icon class=\"icon\" [name]=\"open ? 'close' : 'menu'\"></ax-icon>\n  <span>{{ 'label.more' | translate | uppercase }}</span>\n</button>\n\n<ng-template>\n  <ax-navbar-bottom-sheet>\n    <ng-content></ng-content>\n  </ax-navbar-bottom-sheet>\n</ng-template>\n", styles: [":host{display:block;margin:0 auto}.button{display:flex;flex-direction:column;align-items:center;border:none;background-color:transparent;color:#fff;padding:0}\n"] }]
        }], ctorParameters: function () { return [{ type: i1.MatBottomSheet }]; }, propDecorators: { open: [{
                type: HostBinding,
                args: ['class.ax-navbar-item-active']
            }], _content: [{
                type: ViewChild,
                args: [TemplateRef]
            }] } });

class NavbarModule {
}
NavbarModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: NavbarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
NavbarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.1.5", ngImport: i0, type: NavbarModule, declarations: [NavbarComponent,
        NavbarItemDirective,
        NavbarMoreComponent,
        NavbarBottomSheetComponent], imports: [CommonModule, IconsModule, HelperPipesModule, MatBottomSheetModule], exports: [NavbarComponent, NavbarItemDirective, NavbarMoreComponent] });
NavbarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: NavbarModule, imports: [CommonModule, IconsModule, HelperPipesModule, MatBottomSheetModule] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: NavbarModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [
                        NavbarComponent,
                        NavbarItemDirective,
                        NavbarMoreComponent,
                        NavbarBottomSheetComponent,
                    ],
                    imports: [CommonModule, IconsModule, HelperPipesModule, MatBottomSheetModule],
                    exports: [NavbarComponent, NavbarItemDirective, NavbarMoreComponent],
                }]
        }] });

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

export { NavbarComponent, NavbarItemDirective, NavbarModule, NavbarMoreComponent };
//# sourceMappingURL=aztrix-components-navbar.mjs.map
//# sourceMappingURL=aztrix-components-navbar.mjs.map
