import { Component } from '@angular/core';
import { HeaderService } from '../header/header.service';
import { NavigatorService } from './navigator.service';
import * as i0 from "@angular/core";
import * as i1 from "../header/header.service";
import * as i2 from "./navigator.service";
import * as i3 from "../i18n/c8y-translate.directive";
import * as i4 from "@angular/common";
import * as i5 from "../common/skip-link.directive";
import * as i6 from "./navigator-node.component";
import * as i7 from "../i18n/c8y-translate.pipe";
/**
 * The component shows all nodes that have been added to the navigator.
 * In addition, it allows you to add a header and a footer to the navigator.
 *
 * ```html
 * <c8y-navigator-outlet>
 *   <header class="navigator-slot-top"></header>
 *   <footer class="navigator-slot-bottom"></footer>
 * </c8y-navigator-outlet>
 * ```
 */
export class NavigatorOutletComponent {
    constructor(headerService, navigatorNodes) {
        this.headerService = headerService;
        this.navigatorNodes = navigatorNodes;
        this.nodes$ = this.navigatorNodes.items$;
    }
    /**
     * Closes the navigator menu after clicking an item in the menu, in case of insufficient screen width.
     */
    collapseNavigator(from) {
        if (from === 'link' && !this.headerService.largeWidth) {
            this.headerService.closeNavigator();
        }
    }
    /**
     * @ignore
     */
    trackByPathOrLabel(index, node) {
        return node.path ? node.path : node.label;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NavigatorOutletComponent, deps: [{ token: i1.HeaderService }, { token: i2.NavigatorService }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: NavigatorOutletComponent, selector: "c8y-navigator-outlet, c8y-ui-navigator", host: { classAttribute: "d-contents" }, ngImport: i0, template: "<div class=\"navigatorContent\" role=\"navigation\" [attr.aria-label]=\"'Main navigation' | translate\">\n  <button class=\"sr-only sr-only-focusable btn btn-default btn-sm\" tabindex=\"0\" [c8ySkipLink]=\"'main-content'\" translate>Skip to content</button>\n  <c8y-navigator-node\n    (nodeClick)=\"collapseNavigator($event)\"\n    [node]=\"node\"\n    *ngFor=\"let node of nodes$ | async; trackBy: trackByPathOrLabel\"\n    [isRoot]=\"true\"\n    class=\"d-contents\"\n  ></c8y-navigator-node>\n</div>\n", dependencies: [{ kind: "directive", type: i3.C8yTranslateDirective, selector: "[translate],[ngx-translate]" }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.SkipLinkDirective, selector: "[c8ySkipLink]", inputs: ["c8ySkipLink"] }, { kind: "component", type: i6.NavigatorNodeComponent, selector: "c8y-navigator-node", inputs: ["node", "isRoot"], outputs: ["nodeClick"] }, { kind: "pipe", type: i7.C8yTranslatePipe, name: "translate" }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: NavigatorOutletComponent, decorators: [{
            type: Component,
            args: [{ selector: 'c8y-navigator-outlet, c8y-ui-navigator', host: { class: 'd-contents' }, template: "<div class=\"navigatorContent\" role=\"navigation\" [attr.aria-label]=\"'Main navigation' | translate\">\n  <button class=\"sr-only sr-only-focusable btn btn-default btn-sm\" tabindex=\"0\" [c8ySkipLink]=\"'main-content'\" translate>Skip to content</button>\n  <c8y-navigator-node\n    (nodeClick)=\"collapseNavigator($event)\"\n    [node]=\"node\"\n    *ngFor=\"let node of nodes$ | async; trackBy: trackByPathOrLabel\"\n    [isRoot]=\"true\"\n    class=\"d-contents\"\n  ></c8y-navigator-node>\n</div>\n" }]
        }], ctorParameters: () => [{ type: i1.HeaderService }, { type: i2.NavigatorService }] });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmF2aWdhdG9yLW91dGxldC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9jb3JlL25hdmlnYXRvci9uYXZpZ2F0b3Itb3V0bGV0LmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy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