import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@ironsource/fusion-ui/components/icon/v1";
import * as i3 from "@ironsource/fusion-ui/components/dynamic-components/v1";
function LayoutHeaderMenuComponent_div_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 7)(1, "div", 8);
    i0.ɵɵtext(2);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(3, "div", 9);
    i0.ɵɵtext(4);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵclassProp("fu-layout-header-menu-delimiter", !!ctx_r0.menuItems);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(ctx_r0.userData == null ? null : ctx_r0.userData.name);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(ctx_r0.userData == null ? null : ctx_r0.userData.email);
} }
function LayoutHeaderMenuComponent_div_2_ng_container_1_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainer(0);
} }
const _c0 = a0 => ({ item: a0 });
function LayoutHeaderMenuComponent_div_2_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, LayoutHeaderMenuComponent_div_2_ng_container_1_ng_container_1_Template, 1, 0, "ng-container", 12);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const item_r11 = ctx.$implicit;
    i0.ɵɵnextContext(2);
    const _r9 = i0.ɵɵreference(10);
    const _r5 = i0.ɵɵreference(6);
    const _r3 = i0.ɵɵreference(4);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngTemplateOutlet", item_r11.content ? _r9 : item_r11.routeConfigurations ? _r5 : _r3)("ngTemplateOutletContext", i0.ɵɵpureFunction1(2, _c0, item_r11));
} }
function LayoutHeaderMenuComponent_div_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 10);
    i0.ɵɵtemplate(1, LayoutHeaderMenuComponent_div_2_ng_container_1_Template, 2, 4, "ng-container", 11);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngForOf", ctx_r1.menuItems);
} }
function LayoutHeaderMenuComponent_ng_template_3_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainer(0);
} }
function LayoutHeaderMenuComponent_ng_template_3_Template(rf, ctx) { if (rf & 1) {
    const _r16 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 13);
    i0.ɵɵlistener("click", function LayoutHeaderMenuComponent_ng_template_3_Template_div_click_0_listener() { const restoredCtx = i0.ɵɵrestoreView(_r16); const item_r13 = restoredCtx.item; const ctx_r15 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r15.onMenuItemClicked(item_r13)); });
    i0.ɵɵtemplate(1, LayoutHeaderMenuComponent_ng_template_3_ng_container_1_Template, 1, 0, "ng-container", 12);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const item_r13 = ctx.item;
    i0.ɵɵnextContext();
    const _r7 = i0.ɵɵreference(8);
    i0.ɵɵclassMapInterpolate1("fu-layout-header-menu-item ", item_r13 == null ? null : item_r13.class, "");
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngTemplateOutlet", _r7)("ngTemplateOutletContext", i0.ɵɵpureFunction1(5, _c0, item_r13));
} }
function LayoutHeaderMenuComponent_ng_template_5_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainer(0);
} }
function LayoutHeaderMenuComponent_ng_template_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "a", 14);
    i0.ɵɵtemplate(1, LayoutHeaderMenuComponent_ng_template_5_ng_container_1_Template, 1, 0, "ng-container", 12);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const item_r17 = ctx.item;
    i0.ɵɵnextContext();
    const _r7 = i0.ɵɵreference(8);
    i0.ɵɵclassMapInterpolate1("fu-layout-header-menu-item ", item_r17 == null ? null : item_r17.class, "");
    i0.ɵɵpropertyInterpolate("href", item_r17.routeConfigurations == null ? null : item_r17.routeConfigurations.href, i0.ɵɵsanitizeUrl);
    i0.ɵɵpropertyInterpolate("target", (item_r17.routeConfigurations == null ? null : item_r17.routeConfigurations.target) || "_self");
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngTemplateOutlet", _r7)("ngTemplateOutletContext", i0.ɵɵpureFunction1(7, _c0, item_r17));
} }
function LayoutHeaderMenuComponent_ng_template_7_fusion_icon_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "fusion-icon", 17);
} if (rf & 2) {
    const item_r19 = i0.ɵɵnextContext().item;
    i0.ɵɵproperty("name", item_r19 == null ? null : item_r19.icon);
} }
function LayoutHeaderMenuComponent_ng_template_7_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵtemplate(0, LayoutHeaderMenuComponent_ng_template_7_fusion_icon_0_Template, 1, 1, "fusion-icon", 15);
    i0.ɵɵelementStart(1, "span", 16);
    i0.ɵɵtext(2);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const item_r19 = ctx.item;
    i0.ɵɵproperty("ngIf", item_r19 == null ? null : item_r19.icon);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(item_r19.name);
} }
function LayoutHeaderMenuComponent_ng_template_9_Template(rf, ctx) { if (rf & 1) {
    const _r24 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "fusion-dynamic-components", 18);
    i0.ɵɵlistener("click", function LayoutHeaderMenuComponent_ng_template_9_Template_fusion_dynamic_components_click_0_listener() { const restoredCtx = i0.ɵɵrestoreView(_r24); const item_r22 = restoredCtx.item; const ctx_r23 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r23.onMenuItemClicked(item_r22)); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const item_r22 = ctx.item;
    i0.ɵɵclassMapInterpolate1("fu-layout-header-menu-item-content ", item_r22 == null ? null : item_r22.class, "");
    i0.ɵɵproperty("configuration", item_r22.content);
} }
export class LayoutHeaderMenuComponent {
    constructor() {
        this.layoutHeaderMenuItemClicked = new EventEmitter();
        this.isUserMenu = true;
    }
    set configuration(value) {
        this.userData = value.user;
        this.menuItems = value.menuItems;
        this.isUserMenu = !!value?.user?.name || !!value?.user?.email;
    }
    onMenuItemClicked(menuItem) {
        this.layoutHeaderMenuItemClicked.emit(menuItem);
    }
    static { this.ɵfac = function LayoutHeaderMenuComponent_Factory(t) { return new (t || LayoutHeaderMenuComponent)(); }; }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LayoutHeaderMenuComponent, selectors: [["fusion-layout-header-menu"]], inputs: { configuration: "configuration" }, outputs: { layoutHeaderMenuItemClicked: "layoutHeaderMenuItemClicked" }, decls: 11, vars: 2, consts: [[1, "fu-layout-header-menu-holder"], ["class", "fu-layout-header-menu-user", 3, "fu-layout-header-menu-delimiter", 4, "ngIf"], ["class", "fu-layout-header-menu-items", 4, "ngIf"], ["menuItemRegular", ""], ["menuItemLink", ""], ["menuItem", ""], ["menuItemCustom", ""], [1, "fu-layout-header-menu-user"], [1, "fu-layout-header-menu-user-name"], [1, "fu-layout-header-menu-user-email"], [1, "fu-layout-header-menu-items"], [4, "ngFor", "ngForOf"], [4, "ngTemplateOutlet", "ngTemplateOutletContext"], [3, "click"], [3, "href", "target"], ["class", "fu-layout-header-menu-item-icon", 3, "name", 4, "ngIf"], [1, "fu-layout-header-menu-item-text"], [1, "fu-layout-header-menu-item-icon", 3, "name"], [3, "configuration", "click"]], template: function LayoutHeaderMenuComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "div", 0);
            i0.ɵɵtemplate(1, LayoutHeaderMenuComponent_div_1_Template, 5, 4, "div", 1)(2, LayoutHeaderMenuComponent_div_2_Template, 2, 1, "div", 2);
            i0.ɵɵelementEnd();
            i0.ɵɵtemplate(3, LayoutHeaderMenuComponent_ng_template_3_Template, 2, 7, "ng-template", null, 3, i0.ɵɵtemplateRefExtractor)(5, LayoutHeaderMenuComponent_ng_template_5_Template, 2, 9, "ng-template", null, 4, i0.ɵɵtemplateRefExtractor)(7, LayoutHeaderMenuComponent_ng_template_7_Template, 3, 2, "ng-template", null, 5, i0.ɵɵtemplateRefExtractor)(9, LayoutHeaderMenuComponent_ng_template_9_Template, 1, 4, "ng-template", null, 6, i0.ɵɵtemplateRefExtractor);
        } if (rf & 2) {
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", ctx.isUserMenu);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", ctx.menuItems);
        } }, dependencies: [i1.NgForOf, i1.NgIf, i1.NgTemplateOutlet, i2.IconComponent, i3.DynamicComponentsComponent], styles: ["[_nghost-%COMP%]   .fu-layout-header-menu-holder[_ngcontent-%COMP%]   .fu-layout-header-menu-user[_ngcontent-%COMP%]   .fu-layout-header-menu-user-name[_ngcontent-%COMP%]{font-size:13px;font-family:NHaasGroteskDSPro-75Bd,sans-serif;font-weight:400}[_nghost-%COMP%]   .fu-layout-header-menu-holder[_ngcontent-%COMP%]   .fu-layout-header-menu-item[_ngcontent-%COMP%], [_nghost-%COMP%]   .fu-layout-header-menu-holder[_ngcontent-%COMP%]   .fu-layout-header-menu-user[_ngcontent-%COMP%]   .fu-layout-header-menu-user-email[_ngcontent-%COMP%]{font-size:12px;font-family:HelveticaNeue,helvetica,sans-serif;font-weight:400;letter-spacing:.04px}[_nghost-%COMP%]   .fu-layout-header-menu-holder[_ngcontent-%COMP%]   .fu-layout-header-menu-user[_ngcontent-%COMP%]   .fu-layout-header-menu-user-email[_ngcontent-%COMP%], [_nghost-%COMP%]   .fu-layout-header-menu-holder[_ngcontent-%COMP%]   .fu-layout-header-menu-user[_ngcontent-%COMP%]   .fu-layout-header-menu-user-name[_ngcontent-%COMP%]{width:100%;display:inline-block;white-space:nowrap;overflow:hidden!important;text-overflow:ellipsis}[_nghost-%COMP%]{display:none;position:absolute;z-index:1010;width:var(--layout-header-menu-width, 324px);top:6px;right:8px;border-radius:8px;background-color:var(--fu-white, #ffffff);box-shadow:0 4px 24px #00000026;padding:4px}.fu-layout-header-menu[_nghost-%COMP%]{display:initial}[_nghost-%COMP%]   .fu-layout-header-menu-holder[_ngcontent-%COMP%]   .fu-layout-header-menu-user[_ngcontent-%COMP%]{color:var(--layout-header-menu-user-name-color, var(--fu-light-900, #7b838c));padding:11px 21px 4px}[_nghost-%COMP%]   .fu-layout-header-menu-holder[_ngcontent-%COMP%]   .fu-layout-header-menu-user[_ngcontent-%COMP%]   .fu-layout-header-menu-user-name[_ngcontent-%COMP%]{line-height:1}[_nghost-%COMP%]   .fu-layout-header-menu-holder[_ngcontent-%COMP%]   .fu-layout-header-menu-user[_ngcontent-%COMP%]   .fu-layout-header-menu-user-email[_ngcontent-%COMP%]{line-height:1}[_nghost-%COMP%]   .fu-layout-header-menu-holder[_ngcontent-%COMP%]   .fu-layout-header-menu-user.fu-layout-header-menu-delimiter[_ngcontent-%COMP%]:after{content:\"\";display:block;height:8px;border-bottom:var(--header-border-bottom, solid 1px var(--fu-light-300, #e5e7e9));margin:0 -24px}[_nghost-%COMP%]   .fu-layout-header-menu-holder[_ngcontent-%COMP%]   .fu-layout-header-menu-item[_ngcontent-%COMP%]{height:var(--layout-header-menu-item-height, 40px);border-radius:var(--layout-header-menu-item-border-radius, 4px);padding:var(--layout-header-menu-item-border-padding, 0 20px);display:flex;align-items:center;color:var(--layout-header-menu-item-color, var(--fu-dark-300, #313d91));text-decoration:none}[_nghost-%COMP%]   .fu-layout-header-menu-holder[_ngcontent-%COMP%]   .fu-layout-header-menu-item[_ngcontent-%COMP%]   fusion-icon.fu-layout-header-menu-item-icon[_ngcontent-%COMP%]{margin-right:1em;padding-top:.4em}[_nghost-%COMP%]   .fu-layout-header-menu-holder[_ngcontent-%COMP%]   .fu-layout-header-menu-item[_ngcontent-%COMP%]   fusion-icon.fu-layout-header-menu-item-icon[_ngcontent-%COMP%]     svg{width:var(--layout-header-menu-item-icon-size, 15px);height:var(--layout-header-menu-item-icon-size, 15px)}[_nghost-%COMP%]   .fu-layout-header-menu-holder[_ngcontent-%COMP%]   .fu-layout-header-menu-item[_ngcontent-%COMP%]   fusion-icon.fu-layout-header-menu-item-icon[_ngcontent-%COMP%]     svg *{fill:var(--layout-header-menu-item-icon-color, currentColor)}[_nghost-%COMP%]   .fu-layout-header-menu-holder[_ngcontent-%COMP%]   .fu-layout-header-menu-item[_ngcontent-%COMP%]:visited, [_nghost-%COMP%]   .fu-layout-header-menu-holder[_ngcontent-%COMP%]   .fu-layout-header-menu-item[_ngcontent-%COMP%]:active, [_nghost-%COMP%]   .fu-layout-header-menu-holder[_ngcontent-%COMP%]   .fu-layout-header-menu-item[_ngcontent-%COMP%]:hover{color:var(--layout-header-menu-item-color, var(--fu-dark-300, #313d91));background-color:var(--layout-header-menu-item-hover-color, var(--fu-light-100, #f7f8f9));cursor:pointer}", "@media (max-width: 767.98px){[_nghost-%COMP%]{display:none}}"], changeDetection: 0 }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LayoutHeaderMenuComponent, [{
        type: Component,
        args: [{ selector: 'fusion-layout-header-menu', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"fu-layout-header-menu-holder\">\n    <!--user data part-->\n    <div *ngIf=\"isUserMenu\" class=\"fu-layout-header-menu-user\" [class.fu-layout-header-menu-delimiter]=\"!!menuItems\">\n        <div class=\"fu-layout-header-menu-user-name\">{{ userData?.name }}</div>\n        <div class=\"fu-layout-header-menu-user-email\">{{ userData?.email }}</div>\n    </div>\n    <!--user data part-->\n    <!--menu items-->\n    <div class=\"fu-layout-header-menu-items\" *ngIf=\"menuItems\">\n        <ng-container *ngFor=\"let item of menuItems\">\n            <ng-container\n                *ngTemplateOutlet=\"\n                    item.content ? menuItemCustom : item.routeConfigurations ? menuItemLink : menuItemRegular;\n                    context: {item: item}\n                \"\n            ></ng-container>\n        </ng-container>\n    </div>\n    <!--menu items-->\n</div>\n\n<ng-template #menuItemRegular let-item=\"item\">\n    <div class=\"fu-layout-header-menu-item {{ item?.class }}\" (click)=\"onMenuItemClicked(item)\">\n        <ng-container *ngTemplateOutlet=\"menuItem; context: {item: item}\"></ng-container>\n    </div>\n</ng-template>\n\n<ng-template #menuItemLink let-item=\"item\">\n    <a\n        class=\"fu-layout-header-menu-item {{ item?.class }}\"\n        href=\"{{ item.routeConfigurations?.href }}\"\n        target=\"{{ item.routeConfigurations?.target || '_self' }}\"\n    >\n        <ng-container *ngTemplateOutlet=\"menuItem; context: {item: item}\"></ng-container>\n    </a>\n</ng-template>\n\n<ng-template #menuItem let-item=\"item\">\n    <fusion-icon *ngIf=\"item?.icon\" class=\"fu-layout-header-menu-item-icon\" [name]=\"item?.icon\"></fusion-icon>\n    <span class=\"fu-layout-header-menu-item-text\">{{ item.name }}</span>\n</ng-template>\n\n<ng-template #menuItemCustom let-item=\"item\">\n    <fusion-dynamic-components\n        class=\"fu-layout-header-menu-item-content {{ item?.class }}\"\n        (click)=\"onMenuItemClicked(item)\"\n        [configuration]=\"item.content\"\n    ></fusion-dynamic-components>\n</ng-template>\n", styles: [":host .fu-layout-header-menu-holder .fu-layout-header-menu-user .fu-layout-header-menu-user-name{font-size:13px;font-family:NHaasGroteskDSPro-75Bd,sans-serif;font-weight:400}:host .fu-layout-header-menu-holder .fu-layout-header-menu-item,:host .fu-layout-header-menu-holder .fu-layout-header-menu-user .fu-layout-header-menu-user-email{font-size:12px;font-family:HelveticaNeue,helvetica,sans-serif;font-weight:400;letter-spacing:.04px}:host .fu-layout-header-menu-holder .fu-layout-header-menu-user .fu-layout-header-menu-user-email,:host .fu-layout-header-menu-holder .fu-layout-header-menu-user .fu-layout-header-menu-user-name{width:100%;display:inline-block;white-space:nowrap;overflow:hidden!important;text-overflow:ellipsis}:host{display:none;position:absolute;z-index:1010;width:var(--layout-header-menu-width, 324px);top:6px;right:8px;border-radius:8px;background-color:var(--fu-white, #ffffff);box-shadow:0 4px 24px #00000026;padding:4px}:host.fu-layout-header-menu{display:initial}:host .fu-layout-header-menu-holder .fu-layout-header-menu-user{color:var(--layout-header-menu-user-name-color, var(--fu-light-900, #7b838c));padding:11px 21px 4px}:host .fu-layout-header-menu-holder .fu-layout-header-menu-user .fu-layout-header-menu-user-name{line-height:1}:host .fu-layout-header-menu-holder .fu-layout-header-menu-user .fu-layout-header-menu-user-email{line-height:1}:host .fu-layout-header-menu-holder .fu-layout-header-menu-user.fu-layout-header-menu-delimiter:after{content:\"\";display:block;height:8px;border-bottom:var(--header-border-bottom, solid 1px var(--fu-light-300, #e5e7e9));margin:0 -24px}:host .fu-layout-header-menu-holder .fu-layout-header-menu-item{height:var(--layout-header-menu-item-height, 40px);border-radius:var(--layout-header-menu-item-border-radius, 4px);padding:var(--layout-header-menu-item-border-padding, 0 20px);display:flex;align-items:center;color:var(--layout-header-menu-item-color, var(--fu-dark-300, #313d91));text-decoration:none}:host .fu-layout-header-menu-holder .fu-layout-header-menu-item fusion-icon.fu-layout-header-menu-item-icon{margin-right:1em;padding-top:.4em}:host .fu-layout-header-menu-holder .fu-layout-header-menu-item fusion-icon.fu-layout-header-menu-item-icon ::ng-deep svg{width:var(--layout-header-menu-item-icon-size, 15px);height:var(--layout-header-menu-item-icon-size, 15px)}:host .fu-layout-header-menu-holder .fu-layout-header-menu-item fusion-icon.fu-layout-header-menu-item-icon ::ng-deep svg *{fill:var(--layout-header-menu-item-icon-color, currentColor)}:host .fu-layout-header-menu-holder .fu-layout-header-menu-item:visited,:host .fu-layout-header-menu-holder .fu-layout-header-menu-item:active,:host .fu-layout-header-menu-holder .fu-layout-header-menu-item:hover{color:var(--layout-header-menu-item-color, var(--fu-dark-300, #313d91));background-color:var(--layout-header-menu-item-hover-color, var(--fu-light-100, #f7f8f9));cursor:pointer}\n", "@media (max-width: 767.98px){:host{display:none}}\n"] }]
    }], null, { configuration: [{
            type: Input
        }], layoutHeaderMenuItemClicked: [{
            type: Output
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LayoutHeaderMenuComponent, { className: "LayoutHeaderMenuComponent", filePath: "components/layout-header/layout-header-menu/layout-header-menu.component.ts", lineNumber: 12 }); })();
//# sourceMappingURL=data:application/json;base64, 