import { Component, EventEmitter, Output, Input, NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule, Router } from '@angular/router';
import * as i0 from "@angular/core";
import * as i1 from "@angular/router";
import * as i2 from "@angular/common";
function EuiDashboardCardComponent_div_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 6);
    i0.ɵɵelementStart(1, "div");
    i0.ɵɵelement(2, "span");
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵclassProp("col-4", ctx_r0.isHorizontalLayout);
    i0.ɵɵadvance(1);
    i0.ɵɵclassMapInterpolate1("eui-dashboard-card__icon-wrapper eui-dashboard-card__icon-wrapper--", ctx_r0.iconTypeClass, "");
    i0.ɵɵadvance(1);
    i0.ɵɵclassMapInterpolate1("", ctx_r0.iconClass, " eui-icon-fw eui-dashboard-card__icon-wrapper-icon");
} }
function EuiDashboardCardComponent_div_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 7);
    i0.ɵɵelementStart(1, "div", 8);
    i0.ɵɵelement(2, "img", 9);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵclassProp("col-4", ctx_r1.isHorizontalLayout);
    i0.ɵɵadvance(2);
    i0.ɵɵstyleProp("height", ctx_r1.imageHeight, "px")("width", ctx_r1.imageWidth, "px");
    i0.ɵɵpropertyInterpolate("src", ctx_r1.imageUrl, i0.ɵɵsanitizeUrl);
    i0.ɵɵpropertyInterpolate("alt", ctx_r1.imageUrl);
} }
function EuiDashboardCardComponent_div_9_a_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "a", 13);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r3 = i0.ɵɵnextContext(2);
    i0.ɵɵclassMapInterpolate1("btn ", ctx_r3.buttonStyleClass, "");
    i0.ɵɵpropertyInterpolate("href", ctx_r3.urlExternal, i0.ɵɵsanitizeUrl);
    i0.ɵɵpropertyInterpolate("target", ctx_r3.urlExternalTarget);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(ctx_r3.buttonLinkLabel);
} }
const _c0 = function (a0) { return [a0]; };
function EuiDashboardCardComponent_div_9_a_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "a", 14);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r4 = i0.ɵɵnextContext(2);
    i0.ɵɵclassMapInterpolate1("btn ", ctx_r4.buttonStyleClass, "");
    i0.ɵɵproperty("routerLink", i0.ɵɵpureFunction1(5, _c0, ctx_r4.url));
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(ctx_r4.buttonLinkLabel);
} }
function EuiDashboardCardComponent_div_9_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 10);
    i0.ɵɵtemplate(1, EuiDashboardCardComponent_div_9_a_1_Template, 2, 6, "a", 11);
    i0.ɵɵtemplate(2, EuiDashboardCardComponent_div_9_a_2_Template, 2, 7, "a", 12);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r2 = i0.ɵɵnextContext();
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r2.urlExternal);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r2.url);
} }
export class EuiDashboardCardComponent {
    constructor(router) {
        this.router = router;
        this.imageWidth = '64';
        this.imageHeight = '64';
        this.isIconCompact = true;
        this.urlExternalTarget = '_blank';
        this.buttonStyleClass = 'btn-info';
        this.isClickable = false;
        this.isHorizontalLayout = false;
        this.e2eAttr = 'eui-dashboard-card';
        this.onClicked = new EventEmitter();
    }
    ngOnInit() {
    }
    get stateTypeClass() {
        let classes = '';
        if (this.typeClass) {
            classes = 'eui-dashboard-card--' + this.typeClass;
        }
        return classes;
    }
    onKeyDown(keyCode) {
        if (this.isClickable && keyCode === 13) {
            this.openLink();
        }
    }
    onClick(event) {
        if (this.isClickable) {
            this.openLink();
            this.onClicked.emit(event);
        }
    }
    openLink() {
        if (this.url) {
            this.router.navigate([this.url]);
        }
        if (this.urlExternal) {
            window.open(this.urlExternal, this.urlExternalTarget);
        }
    }
}
/** @nocollapse */ EuiDashboardCardComponent.ɵfac = function EuiDashboardCardComponent_Factory(t) { return new (t || EuiDashboardCardComponent)(i0.ɵɵdirectiveInject(i1.Router)); };
/** @nocollapse */ EuiDashboardCardComponent.ɵcmp = i0.ɵɵdefineComponent({ type: EuiDashboardCardComponent, selectors: [["eui-dashboard-card"]], inputs: { styleClass: "styleClass", typeClass: "typeClass", iconClass: "iconClass", iconTypeClass: "iconTypeClass", imageUrl: "imageUrl", imageWidth: "imageWidth", imageHeight: "imageHeight", isIconCompact: "isIconCompact", label: "label", subLabel: "subLabel", urlExternal: "urlExternal", urlExternalTarget: "urlExternalTarget", url: "url", buttonLinkLabel: "buttonLinkLabel", buttonStyleClass: "buttonStyleClass", isClickable: "isClickable", isHorizontalLayout: "isHorizontalLayout", labelMaxLines: "labelMaxLines", subLabelMaxLines: "subLabelMaxLines", e2eAttr: "e2eAttr" }, outputs: { onClicked: "onClicked" }, decls: 10, vars: 28, consts: [["tabindex", "1", 3, "click", "keydown"], ["class", "eui-dashboard-card__icon-container", 3, "col-4", 4, "ngIf"], ["class", "eui-dashboard-card__image-container", 3, "col-4", 4, "ngIf"], [1, "eui-dashboard-card__content-wrapper"], [1, "eui-dashboard-card__content"], ["class", "eui-dashboard-card__content-link", 4, "ngIf"], [1, "eui-dashboard-card__icon-container"], [1, "eui-dashboard-card__image-container"], [1, "eui-dashboard-card__image-wrapper"], [3, "src", "alt"], [1, "eui-dashboard-card__content-link"], ["tabindex", "1", 3, "href", "target", "class", 4, "ngIf"], ["tabindex", "1", 3, "routerLink", "class", 4, "ngIf"], ["tabindex", "1", 3, "href", "target"], ["tabindex", "1", 3, "routerLink"]], template: function EuiDashboardCardComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵelementStart(0, "div", 0);
        i0.ɵɵlistener("click", function EuiDashboardCardComponent_Template_div_click_0_listener($event) { return ctx.onClick($event); })("keydown", function EuiDashboardCardComponent_Template_div_keydown_0_listener($event) { return ctx.onKeyDown($event.keyCode); });
        i0.ɵɵtemplate(1, EuiDashboardCardComponent_div_1_Template, 3, 8, "div", 1);
        i0.ɵɵtemplate(2, EuiDashboardCardComponent_div_2_Template, 3, 8, "div", 2);
        i0.ɵɵelementStart(3, "div", 3);
        i0.ɵɵelementStart(4, "div", 4);
        i0.ɵɵelementStart(5, "div");
        i0.ɵɵtext(6);
        i0.ɵɵelementEnd();
        i0.ɵɵelementStart(7, "div");
        i0.ɵɵtext(8);
        i0.ɵɵelementEnd();
        i0.ɵɵtemplate(9, EuiDashboardCardComponent_div_9_Template, 3, 2, "div", 5);
        i0.ɵɵelementEnd();
        i0.ɵɵelementEnd();
        i0.ɵɵelementEnd();
    } if (rf & 2) {
        i0.ɵɵclassMapInterpolate2("eui-dashboard-card ", ctx.styleClass, " ", ctx.stateTypeClass, "");
        i0.ɵɵclassProp("row", ctx.isHorizontalLayout)("eui-dashboard-card--clickable", ctx.isClickable)("eui-dashboard-card--icon-compact", ctx.isIconCompact)("eui-dashboard-card--horizontal", ctx.isHorizontalLayout)("eui-dashboard-card--horizontal--icon-compact", ctx.isIconCompact && ctx.isHorizontalLayout);
        i0.ɵɵattribute("data-e2e", ctx.e2eAttr);
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngIf", ctx.iconClass);
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngIf", ctx.imageUrl);
        i0.ɵɵadvance(1);
        i0.ɵɵclassProp("col-8", ctx.isHorizontalLayout);
        i0.ɵɵadvance(2);
        i0.ɵɵclassMapInterpolate1("eui-dashboard-card__content-label eui-dashboard-card__content-label--lines-", ctx.labelMaxLines, "");
        i0.ɵɵadvance(1);
        i0.ɵɵtextInterpolate1(" ", ctx.label, "");
        i0.ɵɵadvance(1);
        i0.ɵɵclassMapInterpolate1("eui-dashboard-card__content-sub-label eui-dashboard-card__content-sub-label--lines-", ctx.subLabelMaxLines, "");
        i0.ɵɵadvance(1);
        i0.ɵɵtextInterpolate1(" ", ctx.subLabel, " ");
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngIf", !ctx.isClickable);
    } }, directives: [i2.NgIf, i1.RouterLinkWithHref], styles: [".eui-dashboard-card[_ngcontent-%COMP%]{background-color:var(--eui-color-white);border-radius:var(--eui-border-radius-base);box-shadow:0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.24);margin-bottom:var(--eui-spacing);padding:var(--eui-spacing);width:100%}.eui-dashboard-card__image-wrapper[_ngcontent-%COMP%]{height:6rem;padding:calc(var(--eui-spacing)/2);width:100%}.eui-dashboard-card__icon-wrapper[_ngcontent-%COMP%], .eui-dashboard-card__image-wrapper[_ngcontent-%COMP%]{align-items:center;display:flex;justify-content:center;margin:var(--eui-spacing) auto var(--eui-spacing) auto}.eui-dashboard-card__icon-wrapper[_ngcontent-%COMP%]{background-color:var(--eui-color-grey-lighter);border:1px solid var(--eui-color-grey-light);border-radius:4rem;height:8rem;padding:var(--eui-spacing);width:8rem}.eui-dashboard-card__icon-wrapper--primary[_ngcontent-%COMP%]{background-color:var(--eui-color-primary-lightest);border-color:var(--eui-color-primary-lighter);color:var(--eui-color-white)}.eui-dashboard-card__icon-wrapper--info[_ngcontent-%COMP%]{background-color:var(--eui-color-info-light);border-color:var(--eui-color-info);color:var(--eui-color-white)}.eui-dashboard-card__icon-wrapper--warning[_ngcontent-%COMP%]{background-color:var(--eui-color-warning-light);border-color:var(--eui-color-warning);color:var(--eui-color-white)}.eui-dashboard-card__icon-wrapper--danger[_ngcontent-%COMP%]{background-color:var(--eui-color-danger-light);border-color:var(--eui-color-danger);color:var(--eui-color-white)}.eui-dashboard-card__icon-wrapper--success[_ngcontent-%COMP%]{background-color:var(--eui-color-success-light);border-color:var(--eui-color-success);color:var(--eui-color-white)}.eui-dashboard-card__icon-wrapper-icon[_ngcontent-%COMP%]{font-size:4rem;width:100%}.eui-dashboard-card__content-wrapper[_ngcontent-%COMP%]{align-items:center;display:flex}.eui-dashboard-card__content[_ngcontent-%COMP%]{text-align:center;width:100%}.eui-dashboard-card__content-label[_ngcontent-%COMP%]{font-size:var(--eui-font-size-xl);margin-bottom:var(--eui-spacing-s)}.eui-dashboard-card__content-label--lines-1[_ngcontent-%COMP%]{height:var(--eui-font-size-xl);overflow:hidden}.eui-dashboard-card__content-label--lines-2[_ngcontent-%COMP%]{height:calc(var(--eui-font-size-xl)*2.33);overflow:hidden}.eui-dashboard-card__content-label--lines-3[_ngcontent-%COMP%]{height:calc(var(--eui-font-size-xl)*3.5);overflow:hidden}.eui-dashboard-card__content-label--lines-4[_ngcontent-%COMP%]{height:calc(var(--eui-font-size-xl)*4.75);overflow:hidden}.eui-dashboard-card__content-label--lines-5[_ngcontent-%COMP%]{height:calc(var(--eui-font-size-xl)*6);overflow:hidden}.eui-dashboard-card__content-sub-label[_ngcontent-%COMP%]{color:var(--eui-color-grey-dark);font-size:var(--eui-font-size-m);margin-bottom:var(--eui-spacing-s)}.eui-dashboard-card__content-sub-label--lines-1[_ngcontent-%COMP%]{height:calc(var(--eui-font-size-m)*1.25);overflow:hidden}.eui-dashboard-card__content-sub-label--lines-2[_ngcontent-%COMP%]{height:calc(var(--eui-font-size-m)*2.5);overflow:hidden}.eui-dashboard-card__content-sub-label--lines-3[_ngcontent-%COMP%]{height:calc(var(--eui-font-size-m)*3.75);overflow:hidden}.eui-dashboard-card__content-sub-label--lines-4[_ngcontent-%COMP%]{height:calc(var(--eui-font-size-m)*4.75);overflow:hidden}.eui-dashboard-card__content-sub-label--lines-5[_ngcontent-%COMP%]{height:calc(var(--eui-font-size-m)*6);overflow:hidden}.eui-dashboard-card__content-link[_ngcontent-%COMP%]{margin-top:var(--eui-spacing)}.eui-dashboard-card--horizontal[_ngcontent-%COMP%]   .eui-dashboard-card__content[_ngcontent-%COMP%]{border-left:2px solid var(--eui-color-grey-lightest);margin-left:var(--eui-spacing);padding-left:var(--eui-spacing)}.eui-dashboard-card--horizontal--icon-compact[_ngcontent-%COMP%]   .eui-dashboard-card__icon-wrapper[_ngcontent-%COMP%], .eui-dashboard-card--horizontal[_ngcontent-%COMP%]   .eui-dashboard-card__icon-wrapper[_ngcontent-%COMP%]{margin:var(--eui-spacing) auto var(--eui-spacing) auto}.eui-dashboard-card--horizontal[_ngcontent-%COMP%]   .eui-dashboard-card__image-wrapper[_ngcontent-%COMP%]{padding:var(--eui-spacing)}.eui-dashboard-card--icon-compact[_ngcontent-%COMP%]   .eui-dashboard-card__icon-wrapper[_ngcontent-%COMP%]{height:5rem;padding:var(--eui-spacing-s);width:5rem}.eui-dashboard-card--icon-compact[_ngcontent-%COMP%]   .eui-dashboard-card__icon-wrapper-icon[_ngcontent-%COMP%]{font-size:2.5rem}.eui-dashboard-card--clickable[_ngcontent-%COMP%]{cursor:pointer}.eui-dashboard-card--clickable[_ngcontent-%COMP%]:focus, .eui-dashboard-card--clickable[_ngcontent-%COMP%]:hover{box-shadow:0 3px 6px rgba(0,0,0,.16),0 3px 6px rgba(0,0,0,.23);cursor:pointer;outline:0}.eui-dashboard-card--primary[_ngcontent-%COMP%]{border-left:var(--eui-spacing-s) solid var(--eui-color-primary);margin-left:var(--eui-spacing-xs)}.eui-dashboard-card--info[_ngcontent-%COMP%]{border-left:var(--eui-spacing-s) solid var(--eui-color-info);margin-left:var(--eui-spacing-xs)}.eui-dashboard-card--warning[_ngcontent-%COMP%]{border-left:var(--eui-spacing-s) solid var(--eui-color-warning);margin-left:var(--eui-spacing-xs)}.eui-dashboard-card--success[_ngcontent-%COMP%]{border-left:var(--eui-spacing-s) solid var(--eui-color-success);margin-left:var(--eui-spacing-xs)}.eui-dashboard-card--danger[_ngcontent-%COMP%]{border-left:var(--eui-spacing-s) solid var(--eui-color-danger);margin-left:var(--eui-spacing-xs)}"] });
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(EuiDashboardCardComponent, [{
        type: Component,
        args: [{
                selector: 'eui-dashboard-card',
                templateUrl: './eui-dashboard-card.component.html',
                styleUrls: ['./styles/_index.scss'],
            }]
    }], function () { return [{ type: i1.Router }]; }, { styleClass: [{
            type: Input
        }], typeClass: [{
            type: Input
        }], iconClass: [{
            type: Input
        }], iconTypeClass: [{
            type: Input
        }], imageUrl: [{
            type: Input
        }], imageWidth: [{
            type: Input
        }], imageHeight: [{
            type: Input
        }], isIconCompact: [{
            type: Input
        }], label: [{
            type: Input
        }], subLabel: [{
            type: Input
        }], urlExternal: [{
            type: Input
        }], urlExternalTarget: [{
            type: Input
        }], url: [{
            type: Input
        }], buttonLinkLabel: [{
            type: Input
        }], buttonStyleClass: [{
            type: Input
        }], isClickable: [{
            type: Input
        }], isHorizontalLayout: [{
            type: Input
        }], labelMaxLines: [{
            type: Input
        }], subLabelMaxLines: [{
            type: Input
        }], e2eAttr: [{
            type: Input
        }], onClicked: [{
            type: Output
        }] }); })();
export class EuiDashboardCardModule {
}
/** @nocollapse */ EuiDashboardCardModule.ɵmod = i0.ɵɵdefineNgModule({ type: EuiDashboardCardModule });
/** @nocollapse */ EuiDashboardCardModule.ɵinj = i0.ɵɵdefineInjector({ factory: function EuiDashboardCardModule_Factory(t) { return new (t || EuiDashboardCardModule)(); }, imports: [[CommonModule, RouterModule]] });
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(EuiDashboardCardModule, { declarations: [EuiDashboardCardComponent], imports: [CommonModule, RouterModule], exports: [EuiDashboardCardComponent] }); })();
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(EuiDashboardCardModule, [{
        type: NgModule,
        args: [{
                imports: [CommonModule, RouterModule],
                exports: [EuiDashboardCardComponent],
                declarations: [EuiDashboardCardComponent],
            }]
    }], null, null); })();
//# sourceMappingURL=data:application/json;base64, 