// © 2022 SolarWinds Worldwide, LLC. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
//  of this software and associated documentation files (the "Software"), to
//  deal in the Software without restriction, including without limitation the
//  rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
//  sell copies of the Software, and to permit persons to whom the Software is
//  furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
//  all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//  THE SOFTWARE.
import { Component, EventEmitter, Input, Output, ViewEncapsulation, } from "@angular/core";
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "../icon/icon.component";
// <example-url>./../examples/index.html#/breadcrumb</example-url>
export class BreadcrumbComponent {
    constructor() {
        this.ariaLabel = "Breadcrumb";
        this.navigation = new EventEmitter();
    }
    handleClick(event, item) {
        event.preventDefault();
        // We want to only handle the CRTL + Click event separately because Middle Mouse click
        // requires a different way of handling it, and so it doesn't conflict with the regular click event.
        if (event.ctrlKey) {
            if (item?.url) {
                // This opens the url link in a new browser tab
                window.open(item?.url, "_blank");
            }
            return;
        }
        // We only navigate the angular router on regular clicks
        this.navigation.emit(item.routerState);
    }
}
BreadcrumbComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: BreadcrumbComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
BreadcrumbComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: BreadcrumbComponent, selector: "nui-breadcrumb", inputs: { items: "items", ariaLabel: "ariaLabel" }, outputs: { navigation: "navigation" }, host: { properties: { "attr.aria-label": "ariaLabel" } }, ngImport: i0, template: "<div\n    [attr.aria-label]=\"ariaLabel\"\n    class=\"nui-breadcrumb\"\n    *ngIf=\"items?.length > 1\"\n>\n    <span\n        class=\"nui-breadcrumb__wrapper\"\n        *ngFor=\"let item of items; let isLast = last\"\n    >\n        <ng-container *ngIf=\"!isLast\">\n            <a\n                [attr.href]=\"item?.url\"\n                class=\"nui-breadcrumb__crumb nui-breadcrumb__crumb__link\"\n                (click)=\"handleClick($event, item)\"\n                >{{ item.title }}</a\n            >\n            <nui-icon\n                class=\"nui-breadcrumb__caret-icon\"\n                icon=\"caret-right\"\n                iconColor=\"disabled-gray\"\n                iconSize=\"small\"\n            ></nui-icon>\n        </ng-container>\n        <span\n            *ngIf=\"isLast\"\n            aria-current=\"page\"\n            class=\"nui-breadcrumb__crumb nui-breadcrumb__crumb-current-level\"\n            >{{ item.title }}</span\n        >\n    </span>\n</div>\n", styles: [".nui .nui-breadcrumb{align-items:center;display:flex;flex-direction:row;font-size:11px;line-height:14px;overflow:hidden;padding:5px 0}.nui .nui-breadcrumb__crumb{white-space:nowrap}.nui .nui-breadcrumb__crumb__link{cursor:pointer}.nui .nui-breadcrumb__crumb-current-level{color:var(--nui-color-text-secondary,rgba(17, 17, 17, .6));cursor:default}.nui .nui-breadcrumb__caret-icon{padding:0 5px}.nui .nui-breadcrumb__wrapper{align-items:center;display:inline-flex}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.IconComponent, selector: "nui-icon", inputs: ["iconColor", "brushType", "iconHoverColor", "iconSize", "cssClass", "fillContainer", "status", "childStatus", "icon", "counter"] }], encapsulation: i0.ViewEncapsulation.None });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: BreadcrumbComponent, decorators: [{
            type: Component,
            args: [{ selector: "nui-breadcrumb", encapsulation: ViewEncapsulation.None, host: { "[attr.aria-label]": "ariaLabel" }, template: "<div\n    [attr.aria-label]=\"ariaLabel\"\n    class=\"nui-breadcrumb\"\n    *ngIf=\"items?.length > 1\"\n>\n    <span\n        class=\"nui-breadcrumb__wrapper\"\n        *ngFor=\"let item of items; let isLast = last\"\n    >\n        <ng-container *ngIf=\"!isLast\">\n            <a\n                [attr.href]=\"item?.url\"\n                class=\"nui-breadcrumb__crumb nui-breadcrumb__crumb__link\"\n                (click)=\"handleClick($event, item)\"\n                >{{ item.title }}</a\n            >\n            <nui-icon\n                class=\"nui-breadcrumb__caret-icon\"\n                icon=\"caret-right\"\n                iconColor=\"disabled-gray\"\n                iconSize=\"small\"\n            ></nui-icon>\n        </ng-container>\n        <span\n            *ngIf=\"isLast\"\n            aria-current=\"page\"\n            class=\"nui-breadcrumb__crumb nui-breadcrumb__crumb-current-level\"\n            >{{ item.title }}</span\n        >\n    </span>\n</div>\n", styles: [".nui .nui-breadcrumb{align-items:center;display:flex;flex-direction:row;font-size:11px;line-height:14px;overflow:hidden;padding:5px 0}.nui .nui-breadcrumb__crumb{white-space:nowrap}.nui .nui-breadcrumb__crumb__link{cursor:pointer}.nui .nui-breadcrumb__crumb-current-level{color:var(--nui-color-text-secondary,rgba(17, 17, 17, .6));cursor:default}.nui .nui-breadcrumb__caret-icon{padding:0 5px}.nui .nui-breadcrumb__wrapper{align-items:center;display:inline-flex}\n"] }]
        }], propDecorators: { items: [{
                type: Input
            }], ariaLabel: [{
                type: Input
            }], navigation: [{
                type: Output
            }] } });
//# sourceMappingURL=data:application/json;base64, 