import { Component, Input } 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";
const _c0 = () => ({ iconName: "arrow-right", iconVersion: "v1" });
function MenuItemComponent_fusion_icon_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "fusion-icon", 3);
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵproperty("name", ctx_r0.item.icon);
} }
function MenuItemComponent_i_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "i", 4);
    i0.ɵɵelement(1, "fusion-icon", 5);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    i0.ɵɵadvance();
    i0.ɵɵproperty("name", i0.ɵɵpureFunction0(1, _c0));
} }
export class MenuItemComponent {
    constructor() { }
    onMenuItemClicked($event) {
        if (!$event.metaKey) {
            $event.preventDefault();
        }
        else {
            $event.stopPropagation();
        }
    }
    static { this.ɵfac = function MenuItemComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MenuItemComponent)(); }; }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MenuItemComponent, selectors: [["fusion-menu-item"]], inputs: { item: "item" }, decls: 5, vars: 5, consts: [["class", "item-icon", 3, "name", 4, "ngIf"], [1, "fu-menu-item-link", 3, "click", "href", "target"], ["class", "icon-expand", 4, "ngIf"], [1, "item-icon", 3, "name"], [1, "icon-expand"], [3, "name"]], template: function MenuItemComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵtemplate(0, MenuItemComponent_fusion_icon_0_Template, 1, 1, "fusion-icon", 0);
            i0.ɵɵelementStart(1, "a", 1);
            i0.ɵɵlistener("click", function MenuItemComponent_Template_a_click_1_listener($event) { return ctx.onMenuItemClicked($event); });
            i0.ɵɵelementStart(2, "label");
            i0.ɵɵtext(3);
            i0.ɵɵelementEnd()();
            i0.ɵɵtemplate(4, MenuItemComponent_i_4_Template, 2, 2, "i", 2);
        } if (rf & 2) {
            let tmp_2_0;
            i0.ɵɵproperty("ngIf", ctx.item.icon);
            i0.ɵɵadvance();
            i0.ɵɵproperty("href", ctx.item.route || ctx.item.redirect, i0.ɵɵsanitizeUrl)("target", (tmp_2_0 = ctx.item.target) !== null && tmp_2_0 !== undefined ? tmp_2_0 : "_self");
            i0.ɵɵadvance(2);
            i0.ɵɵtextInterpolate(ctx.item.name);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", ctx.item.children);
        } }, dependencies: [i1.NgIf, i2.IconComponent], styles: ["[_nghost-%COMP%]   .link-container[_ngcontent-%COMP%]{position:absolute;right:21px}[_nghost-%COMP%]   a.fu-menu-item-link[_ngcontent-%COMP%]{text-decoration:none;color:var(--layout-menu-item-color, var(--light-color-100, #F9FAFB));font-size:13px;font-weight:400}[_nghost-%COMP%]   a.fu-menu-item-link[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{cursor:pointer}.active[_nghost-%COMP%]   a.fu-menu-item-link[_ngcontent-%COMP%]{color:var(--layout-menu-item-active-color, var(--primary-color, #3091F6))}.active[_nghost-%COMP%]   a.fu-menu-item-link[_ngcontent-%COMP%]   label[_ngcontent-%COMP%]{cursor:default}[_nghost-%COMP%]   fusion-icon[_ngcontent-%COMP%]{left:20px;top:17px;position:absolute}[_nghost-%COMP%]   fusion-icon[_ngcontent-%COMP%]     svg{width:15px;height:15px}[_nghost-%COMP%]   fusion-icon[_ngcontent-%COMP%]     svg *{fill:currentColor}fusion-menu.collapsed[_nghost-%COMP%]   label[_ngcontent-%COMP%], fusion-menu.collapsed   [_nghost-%COMP%]   label[_ngcontent-%COMP%]{transition:opacity .3s ease;opacity:0}fusion-menu.collapsed.opened[_nghost-%COMP%]   label[_ngcontent-%COMP%], fusion-menu.collapsed.opened   [_nghost-%COMP%]   label[_ngcontent-%COMP%]{opacity:1}"] }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MenuItemComponent, [{
        type: Component,
        args: [{ selector: 'fusion-menu-item', template: "<fusion-icon class=\"item-icon\" *ngIf=\"item.icon\" [name]=\"item.icon\"></fusion-icon>\n<a [href]=\"item.route || item.redirect\"\n   [target]=\"item.target ?? '_self'\"\n   (click)=\"onMenuItemClicked($event)\"\n   class=\"fu-menu-item-link\"\n>\n    <label>{{item.name}}</label>\n</a>\n<i class=\"icon-expand\" *ngIf=\"item.children\">\n    <fusion-icon [name]=\"{iconName: 'arrow-right', iconVersion: 'v1'}\"></fusion-icon>\n</i>\n", styles: [":host .link-container{position:absolute;right:21px}:host a.fu-menu-item-link{text-decoration:none;color:var(--layout-menu-item-color, var(--light-color-100, #F9FAFB));font-size:13px;font-weight:400}:host a.fu-menu-item-link label{cursor:pointer}:host.active a.fu-menu-item-link{color:var(--layout-menu-item-active-color, var(--primary-color, #3091F6))}:host.active a.fu-menu-item-link label{cursor:default}:host fusion-icon{left:20px;top:17px;position:absolute}:host fusion-icon ::ng-deep svg{width:15px;height:15px}:host fusion-icon ::ng-deep svg *{fill:currentColor}:host-context(fusion-menu.collapsed) label{transition:opacity .3s ease;opacity:0}:host-context(fusion-menu.collapsed.opened) label{opacity:1}\n"] }]
    }], () => [], { item: [{
            type: Input
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MenuItemComponent, { className: "MenuItemComponent", filePath: "components/menu-item/menu-item.component.ts", lineNumber: 9 }); })();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVudS1pdGVtLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2Z1c2lvbi11aS9jb21wb25lbnRzL21lbnUvdjEvY29tcG9uZW50cy9tZW51LWl0ZW0vbWVudS1pdGVtLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2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