import { AlRoute } from '@al/core';
import { Component, Input, TemplateRef, } from '@angular/core';
import { Router } from '@angular/router';
import { AlNavigationService } from '../../services/al-navigation.service';
import * as i0 from "@angular/core";
import * as i1 from "@angular/router";
import * as i2 from "../../services/al-navigation.service";
import * as i3 from "@angular/common";
var _c0 = function (a0) { return { "active": a0 }; };
function AlArchipeligo17TertiaryMenuComponent_div_1_ul_4_ng_template_1_li_0_Template(rf, ctx) { if (rf & 1) {
    var _r9 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "li", 10);
    i0.ɵɵlistener("click", function AlArchipeligo17TertiaryMenuComponent_div_1_ul_4_ng_template_1_li_0_Template_li_click_0_listener($event) { i0.ɵɵrestoreView(_r9); var menuItem_r5 = i0.ɵɵnextContext().$implicit; var ctx_r7 = i0.ɵɵnextContext(3); return ctx_r7.onClick(menuItem_r5, $event); })("mouseover", function AlArchipeligo17TertiaryMenuComponent_div_1_ul_4_ng_template_1_li_0_Template_li_mouseover_0_listener($event) { i0.ɵɵrestoreView(_r9); var menuItem_r5 = i0.ɵɵnextContext().$implicit; var ctx_r10 = i0.ɵɵnextContext(3); return ctx_r10.onHoverStart(menuItem_r5, $event); });
    i0.ɵɵelementStart(1, "a", 11);
    i0.ɵɵlistener("click", function AlArchipeligo17TertiaryMenuComponent_div_1_ul_4_ng_template_1_li_0_Template_a_click_1_listener($event) { i0.ɵɵrestoreView(_r9); var menuItem_r5 = i0.ɵɵnextContext().$implicit; var ctx_r12 = i0.ɵɵnextContext(3); return ctx_r12.onClick(menuItem_r5, $event); });
    i0.ɵɵtext(2);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    var menuItem_r5 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(4, _c0, menuItem_r5.activated));
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(6, _c0, menuItem_r5.activated))("href", menuItem_r5.href || "", i0.ɵɵsanitizeUrl);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(menuItem_r5.caption);
} }
function AlArchipeligo17TertiaryMenuComponent_div_1_ul_4_ng_template_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵtemplate(0, AlArchipeligo17TertiaryMenuComponent_div_1_ul_4_ng_template_1_li_0_Template, 3, 8, "li", 9);
} if (rf & 2) {
    var menuItem_r5 = ctx.$implicit;
    i0.ɵɵproperty("ngIf", menuItem_r5.visible);
} }
function AlArchipeligo17TertiaryMenuComponent_div_1_ul_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "ul");
    i0.ɵɵtemplate(1, AlArchipeligo17TertiaryMenuComponent_div_1_ul_4_ng_template_1_Template, 1, 1, "ng-template", 8);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    var ctx_r2 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngForOf", ctx_r2.menu.children);
} }
function AlArchipeligo17TertiaryMenuComponent_div_1_ng_container_5_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵprojection(0, 1, ["*ngTemplateOutlet", "contentRef"]);
} }
function AlArchipeligo17TertiaryMenuComponent_div_1_ng_container_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, AlArchipeligo17TertiaryMenuComponent_div_1_ng_container_5_1_Template, 1, 0, undefined, 12);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    var ctx_r3 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngTemplateOutlet", ctx_r3.contentRef);
} }
var _c1 = function (a0) { return { "open": a0 }; };
function AlArchipeligo17TertiaryMenuComponent_div_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 4);
    i0.ɵɵelementStart(1, "section", 5);
    i0.ɵɵelementStart(2, "aside");
    i0.ɵɵelementStart(3, "nav", 6);
    i0.ɵɵtemplate(4, AlArchipeligo17TertiaryMenuComponent_div_1_ul_4_Template, 2, 1, "ul", 7);
    i0.ɵɵtemplate(5, AlArchipeligo17TertiaryMenuComponent_div_1_ng_container_5_Template, 2, 1, "ng-container", 7);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    var ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(3, _c1, ctx_r0.sidenavOpen));
    i0.ɵɵadvance(4);
    i0.ɵɵproperty("ngIf", ctx_r0.menu);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r0.renderCustomSidenav);
} }
var _c2 = function (a0, a1) { return { "active": a0, "disabled": a1 }; };
function AlArchipeligo17TertiaryMenuComponent_section_4_ng_template_2_div_0_Template(rf, ctx) { if (rf & 1) {
    var _r21 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 10);
    i0.ɵɵlistener("click", function AlArchipeligo17TertiaryMenuComponent_section_4_ng_template_2_div_0_Template_div_click_0_listener($event) { i0.ɵɵrestoreView(_r21); var tab_r17 = i0.ɵɵnextContext().$implicit; var ctx_r19 = i0.ɵɵnextContext(2); return ctx_r19.onClick(tab_r17, $event); })("mouseover", function AlArchipeligo17TertiaryMenuComponent_section_4_ng_template_2_div_0_Template_div_mouseover_0_listener($event) { i0.ɵɵrestoreView(_r21); var tab_r17 = i0.ɵɵnextContext().$implicit; var ctx_r22 = i0.ɵɵnextContext(2); return ctx_r22.onHoverStart(tab_r17, $event); });
    i0.ɵɵelementStart(1, "a", 11);
    i0.ɵɵlistener("click", function AlArchipeligo17TertiaryMenuComponent_section_4_ng_template_2_div_0_Template_a_click_1_listener($event) { i0.ɵɵrestoreView(_r21); var tab_r17 = i0.ɵɵnextContext().$implicit; var ctx_r24 = i0.ɵɵnextContext(2); return ctx_r24.onClick(tab_r17, $event); });
    i0.ɵɵtext(2);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    var tab_r17 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵproperty("ngClass", tab_r17.properties.consolidated_css_classes);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction2(4, _c2, tab_r17.activated, !tab_r17.enabled))("href", tab_r17._href || "", i0.ɵɵsanitizeUrl);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(tab_r17.caption);
} }
function AlArchipeligo17TertiaryMenuComponent_section_4_ng_template_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵtemplate(0, AlArchipeligo17TertiaryMenuComponent_section_4_ng_template_2_div_0_Template, 3, 7, "div", 9);
} if (rf & 2) {
    var tab_r17 = ctx.$implicit;
    i0.ɵɵproperty("ngIf", tab_r17.visible);
} }
function AlArchipeligo17TertiaryMenuComponent_section_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "section", 13);
    i0.ɵɵelementStart(1, "div", 14);
    i0.ɵɵtemplate(2, AlArchipeligo17TertiaryMenuComponent_section_4_ng_template_2_Template, 1, 1, "ng-template", 8);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    var ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngForOf", ctx_r1.activeTabs.children);
} }
var _c3 = ["*", [["", 8, "custom-tertiary"]]];
var _c4 = ["*", ".custom-tertiary"];
var AlArchipeligo17TertiaryMenuComponent = /** @class */ (function () {
    function AlArchipeligo17TertiaryMenuComponent(router, alNavigation) {
        var _this = this;
        this.router = router;
        this.alNavigation = alNavigation;
        this.visible = true;
        this.menu = null;
        this.contentRef = null;
        this.renderCustomSidenav = false;
        this.showQuaternaryMenu = true;
        this.activeTabs = null;
        this.sidenavOpen = false;
        this.stateChanges = null;
        this.onMenuChanged = function () {
            if ((_this.menu && _this.menu.children.length > 0) || _this.renderCustomSidenav) {
                _this.sidenavOpen = true;
                _this.onLocationChange();
            }
            else {
                _this.sidenavOpen = false;
            }
        };
        this.onLocationChange = function () {
            _this.activeTabs = null;
            _this.checkMenu();
            if (_this.menu) {
                for (var i = 0; i < _this.menu.children.length; i++) {
                    _this.setMenuItemClasses(_this.menu.children[i]);
                    if (_this.menu.children[i].activated) {
                        _this.activeTabs = _this.menu.children[i];
                        for (var j = 0; j < _this.activeTabs.children.length; j++) {
                            _this.setMenuItemClasses(_this.activeTabs.children[j], true);
                        }
                    }
                }
            }
        };
    }
    AlArchipeligo17TertiaryMenuComponent.prototype.ngOnChanges = function (changes) {
        this.activeTabs = null;
        if (changes.hasOwnProperty("menu") || changes.hasOwnProperty("contentRef") || changes.hasOwnProperty("renderCustomSidenav")) {
            this.onMenuChanged();
        }
    };
    AlArchipeligo17TertiaryMenuComponent.prototype.onClick = function (menuItem, $event) {
        var _this = this;
        if ($event) {
            $event.stopPropagation();
            $event.preventDefault();
        }
        menuItem.dispatch();
        setTimeout(function () {
            _this.onMenuChanged();
        }, 500);
    };
    AlArchipeligo17TertiaryMenuComponent.prototype.onHoverStart = function (menuItem, $event) {
        menuItem.refresh(true);
    };
    AlArchipeligo17TertiaryMenuComponent.prototype.setMenuItemClasses = function (route, hasCuartoTab) {
        if (hasCuartoTab === void 0) { hasCuartoTab = false; }
        var classes = [route.getProperty("css_class", "default")];
        if (route.activated) {
            classes.push('active');
        }
        if (!route.activated) {
            classes.push("disabled");
        }
        if (hasCuartoTab) {
            classes.push("cuarto-tab");
        }
        classes.push(route.definition.id ? route.definition.id.replace(/\:/g, "_") : route.caption.replace(/\s/g, "_"));
        route.setProperty("consolidated_css_classes", classes.join(" "));
    };
    AlArchipeligo17TertiaryMenuComponent.prototype.checkMenu = function () {
        if (this.menu) {
            this.menu = !this.menu.getProperty("childOutletOnly") ? this.menu : null;
        }
    };
    /** @nocollapse */ AlArchipeligo17TertiaryMenuComponent.ɵfac = function AlArchipeligo17TertiaryMenuComponent_Factory(t) { return new (t || AlArchipeligo17TertiaryMenuComponent)(i0.ɵɵdirectiveInject(i1.Router), i0.ɵɵdirectiveInject(i2.AlNavigationService)); };
    /** @nocollapse */ AlArchipeligo17TertiaryMenuComponent.ɵcmp = i0.ɵɵdefineComponent({ type: AlArchipeligo17TertiaryMenuComponent, selectors: [["al-archipeligo17-tertiary-menu"]], inputs: { visible: "visible", menu: "menu", contentRef: "contentRef", renderCustomSidenav: "renderCustomSidenav", showQuaternaryMenu: "showQuaternaryMenu" }, features: [i0.ɵɵNgOnChangesFeature], ngContentSelectors: _c4, decls: 7, vars: 5, consts: [[1, "embedded-layout"], ["class", "tertiary-navigation-left", 3, "ngClass", 4, "ngIf"], [1, "tertiary-content", 3, "ngClass"], ["class", "navigation-tabs", 4, "ngIf"], [1, "tertiary-navigation-left", 3, "ngClass"], [1, "tertiary-navigation-bar"], [1, "sideNav"], [4, "ngIf"], ["ngFor", "", 3, "ngForOf"], [3, "ngClass", "click", "mouseover", 4, "ngIf"], [3, "ngClass", "click", "mouseover"], [3, "ngClass", "href", "click"], [4, "ngTemplateOutlet"], [1, "navigation-tabs"], [1, "tab-container"]], template: function AlArchipeligo17TertiaryMenuComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵprojectionDef(_c3);
            i0.ɵɵelementStart(0, "div", 0);
            i0.ɵɵtemplate(1, AlArchipeligo17TertiaryMenuComponent_div_1_Template, 6, 5, "div", 1);
            i0.ɵɵelementStart(2, "div", 2);
            i0.ɵɵpipe(3, "async");
            i0.ɵɵtemplate(4, AlArchipeligo17TertiaryMenuComponent_section_4_Template, 3, 1, "section", 3);
            i0.ɵɵelementStart(5, "section");
            i0.ɵɵprojection(6);
            i0.ɵɵelementEnd();
            i0.ɵɵelementEnd();
            i0.ɵɵelementEnd();
        } if (rf & 2) {
            i0.ɵɵadvance(1);
            i0.ɵɵproperty("ngIf", ctx.visible);
            i0.ɵɵadvance(1);
            i0.ɵɵproperty("ngClass", i0.ɵɵpipeBind1(3, 3, ctx.alNavigation.tertiaryContentClass$));
            i0.ɵɵadvance(2);
            i0.ɵɵproperty("ngIf", ctx.showQuaternaryMenu && ctx.activeTabs && ctx.activeTabs.children.length > 1);
        } }, directives: [i3.NgIf, i3.NgClass, i3.NgForOf, i3.NgTemplateOutlet], pipes: [i3.AsyncPipe], styles: ["[_nghost-%COMP%]     div.embedded-layout{display:flex}[_nghost-%COMP%]     div.embedded-layout div.tertiary-navigation-left{width:0;transform:scaleX(0);flex-flow:column;display:flex;justify-content:stretch}[_nghost-%COMP%]     div.embedded-layout div.tertiary-navigation-left.open{width:280px;min-width:280px;transform:scaleX(1)}[_nghost-%COMP%]     div.embedded-layout div.tertiary-navigation-left h2{margin:0;font-size:1em;align-items:center;display:flex;color:#fff;padding:7px 35px}[_nghost-%COMP%]     div.embedded-layout div.tertiary-navigation-left h2>i{font-size:2.571em;display:flex;margin-right:10px}[_nghost-%COMP%]     div.embedded-layout div.tertiary-navigation-left section.tertiary-navigation-bar{display:flex;flex-flow:column}[_nghost-%COMP%]     div.embedded-layout div.tertiary-navigation-left section.tertiary-navigation-bar .title{display:flex;flex-flow:column;padding-top:24px;padding-bottom:24px;border-bottom:1px solid #ededed}[_nghost-%COMP%]     div.embedded-layout div.tertiary-navigation-left section.tertiary-navigation-bar .title>h3{height:60px;padding:2px;margin:0 30px;font-size:1em;display:flex;font-weight:700;word-wrap:break-word;overflow:hidden}[_nghost-%COMP%]     div.embedded-layout div.tertiary-navigation-left section.tertiary-navigation-bar nav .active{background-color:#535353;color:#fff;font-weight:700}[_nghost-%COMP%]     div.embedded-layout div.tertiary-navigation-left section.tertiary-navigation-bar nav .active:hover{background:#535353}[_nghost-%COMP%]     div.embedded-layout div.tertiary-navigation-left section.tertiary-navigation-bar nav .left-nav ul, [_nghost-%COMP%]     div.embedded-layout div.tertiary-navigation-left section.tertiary-navigation-bar nav>ul{display:flex;flex-flow:column;margin:0;width:100%;list-style:none;padding:0;text-align:left}[_nghost-%COMP%]     div.embedded-layout div.tertiary-navigation-left section.tertiary-navigation-bar nav .left-nav ul>ul>li, [_nghost-%COMP%]     div.embedded-layout div.tertiary-navigation-left section.tertiary-navigation-bar nav>ul>ul>li{padding-left:60px}[_nghost-%COMP%]     div.embedded-layout div.tertiary-navigation-left section.tertiary-navigation-bar nav .left-nav ul>li, [_nghost-%COMP%]     div.embedded-layout div.tertiary-navigation-left section.tertiary-navigation-bar nav>ul>li{display:flex;justify-content:space-between;align-items:center;padding:9px 20px 10px 40px;cursor:pointer}[_nghost-%COMP%]     div.embedded-layout div.tertiary-navigation-left section.tertiary-navigation-bar nav .left-nav ul>li>a, [_nghost-%COMP%]     div.embedded-layout div.tertiary-navigation-left section.tertiary-navigation-bar nav>ul>li>a{font-weight:400;color:#212121;text-decoration:none}[_nghost-%COMP%]     div.embedded-layout div.tertiary-navigation-left section.tertiary-navigation-bar nav .left-nav ul>li>a.active, [_nghost-%COMP%]     div.embedded-layout div.tertiary-navigation-left section.tertiary-navigation-bar nav>ul>li>a.active{background-color:#535353;color:#fff;font-weight:700}[_nghost-%COMP%]     div.embedded-layout div.tertiary-navigation-left section.tertiary-navigation-bar nav .left-nav ul>li>a.active:hover, [_nghost-%COMP%]     div.embedded-layout div.tertiary-navigation-left section.tertiary-navigation-bar nav>ul>li>a.active:hover{background:#535353}[_nghost-%COMP%]     div.embedded-layout div.tertiary-navigation-left section.tertiary-navigation-bar nav .left-nav ul>li:hover, [_nghost-%COMP%]     div.embedded-layout div.tertiary-navigation-left section.tertiary-navigation-bar nav>ul>li:hover{background:#ededed}[_nghost-%COMP%]     div.embedded-layout div.tertiary-navigation-left section.tertiary-navigation-bar nav .left-nav ul>li:hover.active, [_nghost-%COMP%]     div.embedded-layout div.tertiary-navigation-left section.tertiary-navigation-bar nav>ul>li:hover.active{background-color:#535353;color:#fff;font-weight:700}[_nghost-%COMP%]     div.embedded-layout div.tertiary-navigation-left section.tertiary-navigation-bar nav .left-nav ul>li:hover.active:hover, [_nghost-%COMP%]     div.embedded-layout div.tertiary-navigation-left section.tertiary-navigation-bar nav>ul>li:hover.active:hover{background:#535353}[_nghost-%COMP%]     div.embedded-layout div.tertiary-navigation-left section.tertiary-navigation-bar nav .left-nav ul .optionLabel, [_nghost-%COMP%]     div.embedded-layout div.tertiary-navigation-left section.tertiary-navigation-bar nav>ul .optionLabel{margin-left:10px}[_nghost-%COMP%]     div.embedded-layout div.tertiary-navigation-left section.tertiary-navigation-bar nav path{fill:none}[_nghost-%COMP%]     div.embedded-layout div.tertiary-content{width:100%;border-left:1px solid #ededed;box-sizing:border-box}[_nghost-%COMP%]     div.embedded-layout div.tertiary-content.with-padding{padding:36px 40px}[_nghost-%COMP%]     div.embedded-layout div.tertiary-content section.navigation-tabs{display:block;margin:36px 40px 10px;border-bottom:3px solid #ededed}[_nghost-%COMP%]     div.embedded-layout div.tertiary-content section.navigation-tabs div.tab-container{display:flex;flex-direction:columns}[_nghost-%COMP%]     div.embedded-layout div.tertiary-content section.navigation-tabs div.tab-container div.cuarto-tab{padding:5px 15px;margin-bottom:-3px}[_nghost-%COMP%]     div.embedded-layout div.tertiary-content section.navigation-tabs div.tab-container div.cuarto-tab.active{font-weight:700;border-bottom:3px solid #ffb74d}[_nghost-%COMP%]     div.embedded-layout div.tertiary-content section.navigation-tabs div.tab-container div.cuarto-tab.active>a{color:#535353}[_nghost-%COMP%]     div.embedded-layout div.tertiary-content section.navigation-tabs div.tab-container div.cuarto-tab a{text-decoration:none;color:#a8a8a8}[_nghost-%COMP%]     div.embedded-layout div.tertiary-content section.content{display:flex;flex:1 1;min-height:200px}"] });
    return AlArchipeligo17TertiaryMenuComponent;
}());
export { AlArchipeligo17TertiaryMenuComponent };
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(AlArchipeligo17TertiaryMenuComponent, [{
        type: Component,
        args: [{
                selector: 'al-archipeligo17-tertiary-menu',
                templateUrl: './al-archipeligo17-tertiary-menu.component.html',
                styleUrls: ['./al-archipeligo17-tertiary-menu.component.scss']
            }]
    }], function () { return [{ type: i1.Router }, { type: i2.AlNavigationService }]; }, { visible: [{
            type: Input
        }], menu: [{
            type: Input
        }], contentRef: [{
            type: Input
        }], renderCustomSidenav: [{
            type: Input
        }], showQuaternaryMenu: [{
            type: Input
        }] }); })();
//# sourceMappingURL=data:application/json;base64, 