import { Component, Input } from '@angular/core';
import { gettext } from '@c8y/ngx-components';
import * as i0 from "@angular/core";
import * as i1 from "@c8y/ngx-components";
import * as i2 from "@angular/common";
import * as i3 from "ngx-bootstrap/tooltip";
import * as i4 from "@ngx-translate/core";
import * as i5 from "./alarm-severity-to-icon.pipe";
import * as i6 from "./alarm-status-to-icon.pipe";
import * as i7 from "./alarm-severity-to-label.pipe";
import * as i8 from "./alarm-status-to-label.pipe";
export class AlarmsIconComponent {
    constructor() {
        this.iconBackgroundColor = 'none';
        this.isFilterApplied = false;
        this.alarmSeverityLabel = gettext('Severity: {{ alarmSeverity }}');
        this.alarmStatusLabel = gettext('Status: {{ alarmStatus }}');
        this.alarmStatusType = gettext('Type: {{ alarmType }}');
    }
    ngOnInit() {
        this.isFilterApplied = this.typeFilters.length > 0;
        this.iconBackgroundColor =
            this.typeFilters.find(filter => filter.filters.type === this.alarm.type)?.color || 'none';
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AlarmsIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: AlarmsIconComponent, selector: "c8y-alarms-icon", inputs: { alarm: "alarm", typeFilters: "typeFilters" }, ngImport: i0, template: "<button\n  class=\"btn-clean severity\"\n  [attr.aria-label]=\"\n    alarmSeverityLabel | translate: { alarmSeverity: alarm.severity | AlarmSeverityToLabel }\n  \"\n  [tooltip]=\"\n    alarmSeverityLabel | translate: { alarmSeverity: alarm.severity | AlarmSeverityToLabel }\n  \"\n  placement=\"right\"\n  container=\"body\"\n  type=\"button\"\n  (click)=\"$event.stopPropagation()\"\n  [delay]=\"500\"\n>\n  <i\n    class=\"status stroked-icon\"\n    [c8yIcon]=\"alarm.severity | AlarmSeverityToIcon\"\n    [ngClass]=\"alarm.severity | lowercase\"\n  ></i>\n</button>\n<button\n  class=\"btn-clean status\"\n  [ngStyle]=\"{ 'background-color': iconBackgroundColor }\"\n  [attr.aria-label]=\"\n    alarmStatusLabel | translate: { alarmStatus: alarm.status | AlarmStatusToLabel }\n  \"\n  [tooltip]=\"\n    (alarmStatusLabel | translate: { alarmStatus: alarm.status | AlarmStatusToLabel }) +\n    '\\n' +\n    (alarmStatusType | translate: { alarmType: alarm.type })\n  \"\n  placement=\"right\"\n  container=\"body\"\n  type=\"button\"\n  [ngClass]=\"{ 'circle-icon-wrapper': isFilterApplied }\"\n  data-cy=\"c8y-alarms-icon--status-icon\"\n  (click)=\"$event.stopPropagation()\"\n  [delay]=\"500\"\n>\n  <i\n    [c8yIcon]=\"alarm.status | AlarmStatusToIcon\"\n    [ngClass]=\"{ 'stroked-icon': isFilterApplied }\"\n  ></i>\n</button>\n", dependencies: [{ kind: "directive", type: i1.IconDirective, selector: "[c8yIcon]", inputs: ["c8yIcon"] }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i3.TooltipDirective, selector: "[tooltip], [tooltipHtml]", inputs: ["adaptivePosition", "tooltip", "placement", "triggers", "container", "containerClass", "boundariesElement", "isOpen", "isDisabled", "delay", "tooltipHtml", "tooltipPlacement", "tooltipIsOpen", "tooltipEnable", "tooltipAppendToBody", "tooltipAnimation", "tooltipClass", "tooltipContext", "tooltipPopupDelay", "tooltipFadeDuration", "tooltipTrigger"], outputs: ["tooltipChange", "onShown", "onHidden", "tooltipStateChanged"], exportAs: ["bs-tooltip"] }, { kind: "pipe", type: i2.LowerCasePipe, name: "lowercase" }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }, { kind: "pipe", type: i5.AlarmSeverityToIconPipe, name: "AlarmSeverityToIcon" }, { kind: "pipe", type: i6.AlarmStatusToIconPipe, name: "AlarmStatusToIcon" }, { kind: "pipe", type: i7.AlarmSeverityToLabelPipe, name: "AlarmSeverityToLabel" }, { kind: "pipe", type: i8.AlarmStatusToLabelPipe, name: "AlarmStatusToLabel" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: AlarmsIconComponent, decorators: [{
            type: Component,
            args: [{ selector: 'c8y-alarms-icon', template: "<button\n  class=\"btn-clean severity\"\n  [attr.aria-label]=\"\n    alarmSeverityLabel | translate: { alarmSeverity: alarm.severity | AlarmSeverityToLabel }\n  \"\n  [tooltip]=\"\n    alarmSeverityLabel | translate: { alarmSeverity: alarm.severity | AlarmSeverityToLabel }\n  \"\n  placement=\"right\"\n  container=\"body\"\n  type=\"button\"\n  (click)=\"$event.stopPropagation()\"\n  [delay]=\"500\"\n>\n  <i\n    class=\"status stroked-icon\"\n    [c8yIcon]=\"alarm.severity | AlarmSeverityToIcon\"\n    [ngClass]=\"alarm.severity | lowercase\"\n  ></i>\n</button>\n<button\n  class=\"btn-clean status\"\n  [ngStyle]=\"{ 'background-color': iconBackgroundColor }\"\n  [attr.aria-label]=\"\n    alarmStatusLabel | translate: { alarmStatus: alarm.status | AlarmStatusToLabel }\n  \"\n  [tooltip]=\"\n    (alarmStatusLabel | translate: { alarmStatus: alarm.status | AlarmStatusToLabel }) +\n    '\\n' +\n    (alarmStatusType | translate: { alarmType: alarm.type })\n  \"\n  placement=\"right\"\n  container=\"body\"\n  type=\"button\"\n  [ngClass]=\"{ 'circle-icon-wrapper': isFilterApplied }\"\n  data-cy=\"c8y-alarms-icon--status-icon\"\n  (click)=\"$event.stopPropagation()\"\n  [delay]=\"500\"\n>\n  <i\n    [c8yIcon]=\"alarm.status | AlarmStatusToIcon\"\n    [ngClass]=\"{ 'stroked-icon': isFilterApplied }\"\n  ></i>\n</button>\n" }]
        }], propDecorators: { alarm: [{
                type: Input
            }], typeFilters: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64, 