import * as i1 from '@angular/cdk/a11y';
import { CdkTrapFocus, A11yModule } from '@angular/cdk/a11y';
import * as i0 from '@angular/core';
import { InjectionToken, input, Component, output, inject, ViewContainerRef, ElementRef, Injector, HostListener, HostBinding, Directive, viewChild, DOCUMENT, ChangeDetectionStrategy } from '@angular/core';
import { Overlay } from '@angular/cdk/overlay';
import { TemplatePortal } from '@angular/cdk/portal';
import { Subject, of } from 'rxjs';
import { take, skip, takeUntil, filter } from 'rxjs/operators';
import { elementRecordFilled, elementOk, elementDown2 } from '@siemens/element-icons';
import { addIcons, SiIconComponent } from '@siemens/element-ng/icon';
import { SiLinkDirective } from '@siemens/element-ng/link';
import { SiTranslatePipe } from '@siemens/element-translate-ng/translate';

/** @internal */
const SI_HEADER_WITH_DROPDOWNS = new InjectionToken('si-header.with-dropdowns');
/** @internal */
const SI_HEADER_DROPDOWN_OPTIONS = new InjectionToken('si-header-dropdown.options');

/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
class SiHeaderAnchorComponent {
    ariaOwns = input(...(ngDevMode ? [undefined, { debugName: "ariaOwns" }] : []));
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiHeaderAnchorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.8", type: SiHeaderAnchorComponent, isStandalone: true, selector: "ng-component", inputs: { ariaOwns: { classPropertyName: "ariaOwns", publicName: "ariaOwns", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.aria-owns": "ariaOwns()" } }, ngImport: i0, template: '', isInline: true });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiHeaderAnchorComponent, decorators: [{
            type: Component,
            args: [{ template: '', host: { '[attr.aria-owns]': 'ariaOwns()' } }]
        }], propDecorators: { ariaOwns: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaOwns", required: false }] }] } });
/**
 * Trigger to open dropdowns in a navbar.
 * A dropdown will always be attached to the view, even if not visible.
 *
 * If a dropdown is opened in desktop mode, it will be reattached to an overlay while being opened.
 */
class SiHeaderDropdownTriggerDirective {
    static idCounter = 0;
    /** Template that be rendered inside the dropdown. */
    dropdown = input.required({ ...(ngDevMode ? { debugName: "dropdown" } : {}), alias: 'siHeaderDropdownTriggerFor' });
    /** Data that should be passed as template context to the dropdown. */
    dropdownData = input(...(ngDevMode ? [undefined, { debugName: "dropdownData" }] : []));
    /** Emits whenever a dropdown is opened or closed. */
    openChange = output();
    dropdownClose = new Subject();
    /** Child triggers will set themselves here if they are open. */
    openSubmenu;
    viewContainerRef = inject(ViewContainerRef);
    elementRef = inject(ElementRef);
    overlay = inject(Overlay);
    parent = inject(SiHeaderDropdownTriggerDirective, {
        optional: true,
        skipSelf: true
    });
    /** @internal */
    navbar = inject(SI_HEADER_WITH_DROPDOWNS, { optional: true });
    // we need to create a new injector, so that the parent can be injected properly
    injector = Injector.create({ parent: inject(Injector), providers: [] });
    viewRef;
    portal;
    overlayRef;
    /** @internal */
    level = this.parent ? this.parent.level + 1 : 1;
    // used to prevent immediate re-creation of the overlay if this trigger was clicked while overlay is open
    destroying = false;
    /** @internal */
    id = `si-navbar-dropdown-trigger-${SiHeaderDropdownTriggerDirective.idCounter++}`;
    // eslint-disable-next-line @typescript-eslint/naming-convention
    _isOpen = false;
    /** @internal */
    ariaControls = `si-navbar-dropdown-${SiHeaderDropdownTriggerDirective.idCounter}`;
    headerAnchorComponentRef;
    /** Whether the dropdown is open. */
    get isOpen() {
        return this._isOpen;
    }
    /** @internal */
    get isOverlay() {
        return !!this.overlayRef;
    }
    ngOnChanges() {
        if (this.portal) {
            this.portal.templateRef = this.dropdown();
            this.portal.context = this.dropdownData();
        }
    }
    ngOnInit() {
        // Always attach the dropdown, so that it can be used with routerLinkActive
        this.attachDropdownInline();
    }
    ngOnDestroy() {
        this.close();
        this.dropdownClose.complete();
    }
    /** Opens the dropdown. */
    open() {
        if (this.destroying || this._isOpen) {
            return;
        }
        (this.navbar?.inlineDropdown ?? of(false)).pipe(take(1)).subscribe(inline => {
            this._isOpen = true;
            if (!inline) {
                this.attachDropdownOverlay();
            }
            this.navbar?.inlineDropdown
                ?.pipe(skip(1), takeUntil(this.dropdownClose))
                .subscribe(() => this.close());
        });
        if (this.parent) {
            this.parent.openSubmenu = this;
        }
        if (this.navbar?.dropdownOpened) {
            this.navbar?.dropdownOpened(this);
        }
        this.openChange.emit(true);
    }
    /** Closes the dropdown. */
    close(options) {
        if (!this._isOpen) {
            return;
        }
        if (this.openSubmenu) {
            this.openSubmenu.close();
        }
        this.dropdownClose.next();
        this._isOpen = false;
        if (this.overlayRef) {
            this.destroying = true;
            this.overlayRef.detach();
            this.overlayRef.dispose();
            this.viewRef?.destroy();
            this.portal = undefined;
            this.overlayRef = undefined;
            this.headerAnchorComponentRef?.destroy();
            // do not use queueMicrotask, it executed to early
            setTimeout(() => (this.destroying = false));
            this.attachDropdownInline();
        }
        else {
            this.viewRef?.markForCheck();
        }
        if (this.parent) {
            this.parent.openSubmenu = undefined;
        }
        if (options?.all && this.parent) {
            this.parent.close(options);
        }
        else {
            if (this.navbar?.dropdownClosed) {
                this.navbar?.dropdownClosed(this);
            }
            this.openChange.emit(false);
        }
    }
    click() {
        if (this._isOpen) {
            this.close();
        }
        else {
            this.open();
        }
    }
    attachDropdownInline() {
        this.viewRef = this.viewContainerRef.createEmbeddedView(this.dropdown(), this.dropdownData(), {
            injector: this.injector
        });
        this.viewRef.markForCheck();
    }
    attachDropdownOverlay() {
        this.viewRef?.destroy();
        this.overlayRef = this.overlay.create({
            positionStrategy: this.overlay
                .position()
                .flexibleConnectedTo(this.elementRef)
                .withPositions(this.navbar?.overlayPosition ??
                (this.level > 1
                    ? [
                        {
                            originX: 'end',
                            originY: 'bottom',
                            overlayX: 'end',
                            overlayY: 'top',
                            offsetX: 2
                        }
                    ]
                    : [
                        { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top' },
                        {
                            originX: 'end',
                            originY: 'bottom',
                            overlayX: 'end',
                            overlayY: 'top',
                            offsetX: -4
                        }
                    ]))
        });
        this.portal = new TemplatePortal(this.dropdown(), this.viewContainerRef, this.dropdownData(), this.injector);
        this.viewRef = this.overlayRef.attach(this.portal);
        this.headerAnchorComponentRef = this.viewContainerRef.createComponent(SiHeaderAnchorComponent);
        this.headerAnchorComponentRef.setInput('ariaOwns', this.ariaControls);
        this.overlayRef
            .outsidePointerEvents()
            .pipe(filter(event => event.type === 'click'), filter(() => !this.openSubmenu), takeUntil(this.dropdownClose), take(1))
            .subscribe(() => this.close());
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiHeaderDropdownTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
    static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.8", type: SiHeaderDropdownTriggerDirective, isStandalone: true, selector: "[siHeaderDropdownTriggerFor]", inputs: { dropdown: { classPropertyName: "dropdown", publicName: "siHeaderDropdownTriggerFor", isSignal: true, isRequired: true, transformFunction: null }, dropdownData: { classPropertyName: "dropdownData", publicName: "dropdownData", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { openChange: "openChange" }, host: { listeners: { "click": "click()" }, properties: { "id": "this.id", "class.show": "this._isOpen", "attr.aria-expanded": "this._isOpen", "attr.aria-controls": "this.ariaControls" }, classAttribute: "dropdown-toggle" }, exportAs: ["siHeaderDropdownTrigger"], usesOnChanges: true, ngImport: i0 });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiHeaderDropdownTriggerDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: '[siHeaderDropdownTriggerFor]',
                    host: {
                        class: 'dropdown-toggle'
                    },
                    exportAs: 'siHeaderDropdownTrigger'
                }]
        }], propDecorators: { dropdown: [{ type: i0.Input, args: [{ isSignal: true, alias: "siHeaderDropdownTriggerFor", required: true }] }], dropdownData: [{ type: i0.Input, args: [{ isSignal: true, alias: "dropdownData", required: false }] }], openChange: [{ type: i0.Output, args: ["openChange"] }], id: [{
                type: HostBinding,
                args: ['id']
            }], _isOpen: [{
                type: HostBinding,
                args: ['class.show']
            }, {
                type: HostBinding,
                args: ['attr.aria-expanded']
            }], ariaControls: [{
                type: HostBinding,
                args: ['attr.aria-controls']
            }], click: [{
                type: HostListener,
                args: ['click']
            }] } });

/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
/**
 * Wrapper component for {@link SiHeaderDropdownItemComponent}.
 * Must only be opened using an {@link SiHeaderDropdownTriggerDirective}.
 */
class SiHeaderDropdownComponent {
    /** @internal */
    trigger = inject(SiHeaderDropdownTriggerDirective);
    focusTrap = viewChild.required(CdkTrapFocus);
    previousElement = null;
    document = inject(DOCUMENT);
    options = inject(SI_HEADER_DROPDOWN_OPTIONS, { optional: true });
    constructor() {
        // The autoFocus feature of the focus trap is not enough, as this component is not newly created when opened in mobile (inline).
        // But we still need autofocus in desktop mode, as the close event is never executed (component is destroyed before).
        this.trigger.openChange.subscribe(change => {
            if (!this.trigger.isOverlay && this.trapFocus && change) {
                this.previousElement = this.document.activeElement;
                this.focusTrap().focusTrap.focusFirstTabbableElementWhenReady();
            }
            else {
                if (this.previousElement &&
                    'focus' in this.previousElement &&
                    typeof this.previousElement.focus === 'function') {
                    this.previousElement.focus();
                }
                this.previousElement = null;
            }
        });
    }
    /** @internal */
    get show() {
        return this.trigger.isOpen;
    }
    /** @internal */
    get overlay() {
        return this.trigger.isOverlay;
    }
    /** @internal */
    get submenu() {
        return this.trigger.level > 1;
    }
    /** @internal */
    get trapFocus() {
        return (this.trigger.isOverlay ||
            (!this.options?.disableRootFocusTrapForInlineMode && this.trigger.level === 1));
    }
    /** @internal */
    escape() {
        this.trigger?.close();
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiHeaderDropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.8", type: SiHeaderDropdownComponent, isStandalone: true, selector: "si-header-dropdown", host: { attributes: { "role": "group" }, listeners: { "keydown.escape": "escape()" }, properties: { "id": "trigger.ariaControls", "attr.aria-labelledby": "trigger.id", "class.show": "this.show", "class.header-dropdown-overlay": "this.overlay", "class.sub-menu": "this.submenu" }, classAttribute: "dropdown-menu position-static" }, viewQueries: [{ propertyName: "focusTrap", first: true, predicate: CdkTrapFocus, descendants: true, isSignal: true }], ngImport: i0, template: "<div [cdkTrapFocus]=\"trapFocus\" [cdkTrapFocusAutoCapture]=\"this.trigger.isOverlay\">\n  <ng-content />\n</div>\n", styles: [":host.sub-menu{min-inline-size:200px}\n"], dependencies: [{ kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiHeaderDropdownComponent, decorators: [{
            type: Component,
            args: [{ selector: 'si-header-dropdown', imports: [A11yModule], changeDetection: ChangeDetectionStrategy.OnPush, host: {
                        class: 'dropdown-menu position-static',
                        role: 'group',
                        '[id]': 'trigger.ariaControls',
                        '[attr.aria-labelledby]': 'trigger.id'
                    }, template: "<div [cdkTrapFocus]=\"trapFocus\" [cdkTrapFocusAutoCapture]=\"this.trigger.isOverlay\">\n  <ng-content />\n</div>\n", styles: [":host.sub-menu{min-inline-size:200px}\n"] }]
        }], ctorParameters: () => [], propDecorators: { focusTrap: [{ type: i0.ViewChild, args: [i0.forwardRef(() => CdkTrapFocus), { isSignal: true }] }], show: [{
                type: HostBinding,
                args: ['class.show']
            }], overlay: [{
                type: HostBinding,
                args: ['class.header-dropdown-overlay']
            }], submenu: [{
                type: HostBinding,
                args: ['class.sub-menu']
            }], escape: [{
                type: HostListener,
                args: ['keydown.escape']
            }] } });

/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
/**
 * Creates a dropdown-item. Must be used within an {@link SiHeaderDropdownComponent}.
 */
class SiHeaderDropdownItemComponent {
    icons = addIcons({ elementDown2, elementOk, elementRecordFilled });
    /** Optional icon that will be rendered before the label. */
    icon = input(...(ngDevMode ? [undefined, { debugName: "icon" }] : []));
    /** Badge that is rendered after the label. */
    badge = input(...(ngDevMode ? [undefined, { debugName: "badge" }] : []));
    /** Badge (always red) that is attached to the icon. */
    iconBadge = input(...(ngDevMode ? [undefined, { debugName: "iconBadge" }] : []));
    /** Color of the badge (not iconBadge). */
    badgeColor = input(...(ngDevMode ? [undefined, { debugName: "badgeColor" }] : []));
    /** Whether the icon is checked with a radio or check mark. */
    checked = input(...(ngDevMode ? [undefined, { debugName: "checked" }] : []));
    ownTrigger = inject(SiHeaderDropdownTriggerDirective, {
        self: true,
        optional: true
    });
    parentTrigger = inject(SiHeaderDropdownTriggerDirective, { skipSelf: true });
    navbar = inject(SI_HEADER_WITH_DROPDOWNS, { optional: true });
    click() {
        if (!this.ownTrigger) {
            this.parentTrigger.close({ all: true });
            if (this.navbar?.onDropdownItemTriggered) {
                this.navbar?.onDropdownItemTriggered();
            }
        }
    }
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiHeaderDropdownItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: SiHeaderDropdownItemComponent, isStandalone: true, selector: "si-header-dropdown-item, a[si-header-dropdown-item], button[si-header-dropdown-item]", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, badge: { classPropertyName: "badge", publicName: "badge", isSignal: true, isRequired: false, transformFunction: null }, iconBadge: { classPropertyName: "iconBadge", publicName: "iconBadge", isSignal: true, isRequired: false, transformFunction: null }, badgeColor: { classPropertyName: "badgeColor", publicName: "badgeColor", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "click()" }, classAttribute: "dropdown-item focus-inside" }, ngImport: i0, template: "@if (icon()) {\n  <si-icon class=\"icon\" [icon]=\"icon()!\" />\n}\n@if (iconBadge()) {\n  <div class=\"badge-text\">{{ iconBadge() }}</div>\n}\n<span class=\"item-title text-truncate\">\n  <ng-content />\n</span>\n<div class=\"item-end ps-2 d-flex me-n3 ms-auto gap-1\">\n  @if (badge()) {\n    <span class=\"mx-0 me-1 ms-2 badge\" [class]=\"`bg-${badgeColor() || 'default'}`\">{{\n      badge()\n    }}</span>\n  }\n  @if (checked() === 'check') {\n    <si-icon class=\"icon\" [icon]=\"icons.elementOk\" />\n  }\n  @if (checked() === 'radio') {\n    <si-icon class=\"icon-sm me-2\" [icon]=\"icons.elementRecordFilled\" />\n  }\n  @if (ownTrigger) {\n    <si-icon class=\"dropdown-caret m-0 ps-0\" [icon]=\"icons.elementDown2\" />\n  }\n</div>\n", styles: [".item-end:empty{display:none!important}:host-context(.dropdown-menu .dropdown-menu){padding-inline-start:28px}.dropdown-caret{transform-origin:initial}\n"], dependencies: [{ kind: "component", type: SiIconComponent, selector: "si-icon", inputs: ["icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiHeaderDropdownItemComponent, decorators: [{
            type: Component,
            args: [{ selector: 'si-header-dropdown-item, a[si-header-dropdown-item], button[si-header-dropdown-item]', imports: [SiIconComponent], changeDetection: ChangeDetectionStrategy.OnPush, host: {
                        class: 'dropdown-item focus-inside'
                    }, template: "@if (icon()) {\n  <si-icon class=\"icon\" [icon]=\"icon()!\" />\n}\n@if (iconBadge()) {\n  <div class=\"badge-text\">{{ iconBadge() }}</div>\n}\n<span class=\"item-title text-truncate\">\n  <ng-content />\n</span>\n<div class=\"item-end ps-2 d-flex me-n3 ms-auto gap-1\">\n  @if (badge()) {\n    <span class=\"mx-0 me-1 ms-2 badge\" [class]=\"`bg-${badgeColor() || 'default'}`\">{{\n      badge()\n    }}</span>\n  }\n  @if (checked() === 'check') {\n    <si-icon class=\"icon\" [icon]=\"icons.elementOk\" />\n  }\n  @if (checked() === 'radio') {\n    <si-icon class=\"icon-sm me-2\" [icon]=\"icons.elementRecordFilled\" />\n  }\n  @if (ownTrigger) {\n    <si-icon class=\"dropdown-caret m-0 ps-0\" [icon]=\"icons.elementDown2\" />\n  }\n</div>\n", styles: [".item-end:empty{display:none!important}:host-context(.dropdown-menu .dropdown-menu){padding-inline-start:28px}.dropdown-caret{transform-origin:initial}\n"] }]
        }], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], badge: [{ type: i0.Input, args: [{ isSignal: true, alias: "badge", required: false }] }], iconBadge: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconBadge", required: false }] }], badgeColor: [{ type: i0.Input, args: [{ isSignal: true, alias: "badgeColor", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }], click: [{
                type: HostListener,
                args: ['click']
            }] } });

/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
/**
 * A factory to render multiple {@link MenuItem}.
 * Requires a wrapping {@link SiHeaderDropdownComponent}.
 *
 * @internal
 */
class SiHeaderDropdownItemsFactoryComponent {
    items = input.required(...(ngDevMode ? [{ debugName: "items" }] : []));
    activeChange = output();
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiHeaderDropdownItemsFactoryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: SiHeaderDropdownItemsFactoryComponent, isStandalone: true, selector: "si-header-dropdown-items-factory", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { activeChange: "activeChange" }, ngImport: i0, template: "@for (item of items(); track item) {\n  @if (item.isHeading) {\n    <div class=\"dropdown-item dropdown-header dropdown-item-static\">\n      {{ item.title | translate }}\n    </div>\n  } @else {\n    @if (item.title !== '-') {\n      @if (item.items) {\n        <button\n          type=\"button\"\n          si-header-dropdown-item\n          [icon]=\"item.icon\"\n          [badge]=\"item.badgeStyle !== 'dot' ? item.badge : undefined\"\n          [badgeColor]=\"item.badgeColor\"\n          [iconBadge]=\"item.badgeStyle === 'dot' ? item.badge : undefined\"\n          [siHeaderDropdownTriggerFor]=\"dropdown\"\n        >\n          {{ item.title | translate }}\n        </button>\n        <ng-template #dropdown>\n          <si-header-dropdown>\n            <si-header-dropdown-items-factory [items]=\"item.items\" />\n          </si-header-dropdown>\n        </ng-template>\n      } @else {\n        <a\n          si-header-dropdown-item\n          activeClass=\"active\"\n          [siLink]=\"item\"\n          [icon]=\"item.icon\"\n          [badge]=\"item.badgeStyle !== 'dot' ? item.badge : undefined\"\n          [badgeColor]=\"item.badgeColor\"\n          [iconBadge]=\"item.badgeStyle === 'dot' ? item.badge : undefined\"\n          [checked]=\"item.selectionState\"\n          (activeChange)=\"activeChange.emit($event)\"\n        >\n          {{ item.title | translate }}\n        </a>\n      }\n    } @else {\n      <div class=\"dropdown-divider\"></div>\n    }\n  }\n}\n", dependencies: [{ kind: "component", type: SiHeaderDropdownItemsFactoryComponent, selector: "si-header-dropdown-items-factory", inputs: ["items"], outputs: ["activeChange"] }, { kind: "component", type: SiHeaderDropdownComponent, selector: "si-header-dropdown" }, { kind: "component", type: SiHeaderDropdownItemComponent, selector: "si-header-dropdown-item, a[si-header-dropdown-item], button[si-header-dropdown-item]", inputs: ["icon", "badge", "iconBadge", "badgeColor", "checked"] }, { kind: "directive", type: SiLinkDirective, selector: "[siLink]", inputs: ["siLink", "siLinkDefaultTarget", "actionParam", "activeClass", "exactMatch", "ariaCurrent"], outputs: ["activeChange"], exportAs: ["siLink"] }, { kind: "directive", type: SiHeaderDropdownTriggerDirective, selector: "[siHeaderDropdownTriggerFor]", inputs: ["siHeaderDropdownTriggerFor", "dropdownData"], outputs: ["openChange"], exportAs: ["siHeaderDropdownTrigger"] }, { kind: "pipe", type: SiTranslatePipe, name: "translate" }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: SiHeaderDropdownItemsFactoryComponent, decorators: [{
            type: Component,
            args: [{ selector: 'si-header-dropdown-items-factory', imports: [
                        SiHeaderDropdownComponent,
                        SiHeaderDropdownItemComponent,
                        SiTranslatePipe,
                        SiLinkDirective,
                        SiHeaderDropdownTriggerDirective
                    ], template: "@for (item of items(); track item) {\n  @if (item.isHeading) {\n    <div class=\"dropdown-item dropdown-header dropdown-item-static\">\n      {{ item.title | translate }}\n    </div>\n  } @else {\n    @if (item.title !== '-') {\n      @if (item.items) {\n        <button\n          type=\"button\"\n          si-header-dropdown-item\n          [icon]=\"item.icon\"\n          [badge]=\"item.badgeStyle !== 'dot' ? item.badge : undefined\"\n          [badgeColor]=\"item.badgeColor\"\n          [iconBadge]=\"item.badgeStyle === 'dot' ? item.badge : undefined\"\n          [siHeaderDropdownTriggerFor]=\"dropdown\"\n        >\n          {{ item.title | translate }}\n        </button>\n        <ng-template #dropdown>\n          <si-header-dropdown>\n            <si-header-dropdown-items-factory [items]=\"item.items\" />\n          </si-header-dropdown>\n        </ng-template>\n      } @else {\n        <a\n          si-header-dropdown-item\n          activeClass=\"active\"\n          [siLink]=\"item\"\n          [icon]=\"item.icon\"\n          [badge]=\"item.badgeStyle !== 'dot' ? item.badge : undefined\"\n          [badgeColor]=\"item.badgeColor\"\n          [iconBadge]=\"item.badgeStyle === 'dot' ? item.badge : undefined\"\n          [checked]=\"item.selectionState\"\n          (activeChange)=\"activeChange.emit($event)\"\n        >\n          {{ item.title | translate }}\n        </a>\n      }\n    } @else {\n      <div class=\"dropdown-divider\"></div>\n    }\n  }\n}\n" }]
        }], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }], activeChange: [{ type: i0.Output, args: ["activeChange"] }] } });

/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */

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

export { SI_HEADER_DROPDOWN_OPTIONS, SI_HEADER_WITH_DROPDOWNS, SiHeaderDropdownComponent, SiHeaderDropdownItemComponent, SiHeaderDropdownItemsFactoryComponent, SiHeaderDropdownTriggerDirective };
//# sourceMappingURL=siemens-element-ng-header-dropdown.mjs.map
