import { Component, Input } from '@angular/core';
import { Observable } from 'rxjs';
import * as i0 from "@angular/core";
import * as i1 from "@ionic/angular";
import * as i2 from "@angular/common";
function TextCardComponent_ion_item_1_ion_icon_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "ion-icon", 8);
} if (rf & 2) {
    const ctx_r6 = i0.ɵɵnextContext(2);
    i0.ɵɵpropertyInterpolate("name", ctx_r6.icon);
} }
function TextCardComponent_ion_item_1_ion_label_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "ion-label");
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r7 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(ctx_r7.title);
} }
function TextCardComponent_ion_item_1_ion_icon_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "ion-icon", 9);
} }
function TextCardComponent_ion_item_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "ion-item", 5);
    i0.ɵɵtemplate(1, TextCardComponent_ion_item_1_ion_icon_1_Template, 1, 1, "ion-icon", 6);
    i0.ɵɵtemplate(2, TextCardComponent_ion_item_1_ion_label_2_Template, 2, 1, "ion-label", 2);
    i0.ɵɵtemplate(3, TextCardComponent_ion_item_1_ion_icon_3_Template, 1, 0, "ion-icon", 7);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵproperty("color", ctx_r0.color);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r0.icon);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r0.title);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r0.icon);
} }
function TextCardComponent_span_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 10);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(ctx_r1.value);
} }
function TextCardComponent_br_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "br");
} }
function TextCardComponent_span_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 11);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r3 = i0.ɵɵnextContext();
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(ctx_r3.unit);
} }
function TextCardComponent_ion_card_content_6_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "ion-card-content");
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r4 = i0.ɵɵnextContext();
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate1(" ", ctx_r4.error, " ");
} }
function TextCardComponent_ion_card_content_7_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "ion-card-content", 12);
    i0.ɵɵelementStart(1, "ion-text", 13);
    i0.ɵɵtext(2);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r5 = i0.ɵɵnextContext();
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(ctx_r5.subtitle);
} }
export class TextCardComponent {
    constructor() {
        this.options = {
            initialValue: '0',
        };
        this.color = 'dark';
        this.value = this.options.initialValue;
    }
    set inputStream(stream) {
        if (stream) {
            this.subscription = stream.subscribe({
                next: (value) => {
                    if (this.template) {
                        value = this.template.replace('#value#', value);
                    }
                    this.value = value;
                },
                error: (err) => {
                    this.error = err;
                },
            });
        }
    }
}
/** @nocollapse */ TextCardComponent.ɵfac = function TextCardComponent_Factory(t) { return new (t || TextCardComponent)(); };
/** @nocollapse */ TextCardComponent.ɵcmp = i0.ɵɵdefineComponent({ type: TextCardComponent, selectors: [["monitoring-text-card"]], inputs: { options: "options", title: "title", subtitle: "subtitle", template: "template", unit: "unit", icon: "icon", color: "color", inputStream: "inputStream" }, decls: 8, vars: 6, consts: [["lines", "full", 3, "color", 4, "ngIf"], ["class", "variable-value", 4, "ngIf"], [4, "ngIf"], ["class", "unit", 4, "ngIf"], ["class", "text-center", 4, "ngIf"], ["lines", "full", 3, "color"], ["slot", "start", 3, "name", 4, "ngIf"], ["slot", "end", 4, "ngIf"], ["slot", "start", 3, "name"], ["slot", "end"], [1, "variable-value"], [1, "unit"], [1, "text-center"], [1, "description"]], template: function TextCardComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵelementStart(0, "ion-card");
        i0.ɵɵtemplate(1, TextCardComponent_ion_item_1_Template, 4, 4, "ion-item", 0);
        i0.ɵɵelementStart(2, "ion-card-content");
        i0.ɵɵtemplate(3, TextCardComponent_span_3_Template, 2, 1, "span", 1);
        i0.ɵɵtemplate(4, TextCardComponent_br_4_Template, 1, 0, "br", 2);
        i0.ɵɵtemplate(5, TextCardComponent_span_5_Template, 2, 1, "span", 3);
        i0.ɵɵelementEnd();
        i0.ɵɵtemplate(6, TextCardComponent_ion_card_content_6_Template, 2, 1, "ion-card-content", 2);
        i0.ɵɵtemplate(7, TextCardComponent_ion_card_content_7_Template, 3, 1, "ion-card-content", 4);
        i0.ɵɵelementEnd();
    } if (rf & 2) {
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngIf", ctx.title || ctx.icon);
        i0.ɵɵadvance(2);
        i0.ɵɵproperty("ngIf", ctx.value);
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngIf", ctx.unit);
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngIf", ctx.unit);
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngIf", ctx.error);
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngIf", ctx.subtitle);
    } }, directives: [i1.IonCard, i2.NgIf, i1.IonCardContent, i1.IonItem, i1.IonIcon, i1.IonLabel, i1.IonText], styles: [".variable-value[_ngcontent-%COMP%]{font-size:1.4em;font-weight:700}.description[_ngcontent-%COMP%], ion-card[_ngcontent-%COMP%], ion-card-subtitle[_ngcontent-%COMP%], ion-card[_ngcontent-%COMP%]   ion-item[_ngcontent-%COMP%], ion-item[_ngcontent-%COMP%]   ion-card-subtitle[_ngcontent-%COMP%]{text-align:center}.description[_ngcontent-%COMP%]{font-size:.9em;color:#777}"] });
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TextCardComponent, [{
        type: Component,
        args: [{
                selector: 'monitoring-text-card',
                templateUrl: './text-card.component.html',
                styleUrls: ['./text-card.component.scss'],
            }]
    }], function () { return []; }, { options: [{
            type: Input
        }], title: [{
            type: Input
        }], subtitle: [{
            type: Input
        }], template: [{
            type: Input
        }], unit: [{
            type: Input
        }], icon: [{
            type: Input
        }], color: [{
            type: Input
        }], inputStream: [{
            type: Input
        }] }); })();
//# sourceMappingURL=data:application/json;base64, 