import { Component, Input } from '@angular/core';
import { Observable } from 'rxjs';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@ionic/angular";
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 = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TextCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
/** @nocollapse */ TextCardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.3.0", type: TextCardComponent, selector: "monitoring-text-card", inputs: { options: "options", title: "title", subtitle: "subtitle", template: "template", unit: "unit", icon: "icon", color: "color", inputStream: "inputStream" }, ngImport: i0, template: "<ion-card>\n  <ion-item *ngIf=\"title || icon\" lines=\"full\" [color]=\"color\">\n    <ion-icon *ngIf=\"icon\" name=\"{{ icon }}\" slot=\"start\"></ion-icon>\n    <ion-label *ngIf=\"title\">{{ title }}</ion-label>\n    <ion-icon *ngIf=\"icon\" slot=\"end\"></ion-icon>\n  </ion-item>\n  <ion-card-content>\n    <span class=\"variable-value\" *ngIf=\"value\">{{ value }}</span>\n    <br *ngIf=\"unit\" />\n    <span *ngIf=\"unit\" class=\"unit\">{{ unit }}</span>\n  </ion-card-content>\n  <ion-card-content *ngIf=\"error\">\n    {{ error }}\n  </ion-card-content>\n  <ion-card-content *ngIf=\"subtitle\" class=\"text-center\">\n    <ion-text class=\"description\">{{ subtitle }}</ion-text>\n  </ion-card-content>\n</ion-card>\n", styles: [".variable-value{font-size:1.4em;font-weight:700}ion-card,ion-card ion-item,ion-card-subtitle,ion-item ion-card-subtitle{text-align:center}.description{font-size:.9em;color:#777;text-align:center}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.IonCard, selector: "ion-card", inputs: ["button", "color", "disabled", "download", "href", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }, { kind: "component", type: i2.IonCardContent, selector: "ion-card-content", inputs: ["mode"] }, { kind: "component", type: i2.IonIcon, selector: "ion-icon", inputs: ["color", "flipRtl", "icon", "ios", "lazy", "md", "mode", "name", "sanitize", "size", "src"] }, { kind: "component", type: i2.IonItem, selector: "ion-item", inputs: ["button", "color", "counter", "counterFormatter", "detail", "detailIcon", "disabled", "download", "fill", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "shape", "target", "type"] }, { kind: "component", type: i2.IonLabel, selector: "ion-label", inputs: ["color", "mode", "position"] }, { kind: "component", type: i2.IonText, selector: "ion-text", inputs: ["color", "mode"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TextCardComponent, decorators: [{
            type: Component,
            args: [{ selector: 'monitoring-text-card', template: "<ion-card>\n  <ion-item *ngIf=\"title || icon\" lines=\"full\" [color]=\"color\">\n    <ion-icon *ngIf=\"icon\" name=\"{{ icon }}\" slot=\"start\"></ion-icon>\n    <ion-label *ngIf=\"title\">{{ title }}</ion-label>\n    <ion-icon *ngIf=\"icon\" slot=\"end\"></ion-icon>\n  </ion-item>\n  <ion-card-content>\n    <span class=\"variable-value\" *ngIf=\"value\">{{ value }}</span>\n    <br *ngIf=\"unit\" />\n    <span *ngIf=\"unit\" class=\"unit\">{{ unit }}</span>\n  </ion-card-content>\n  <ion-card-content *ngIf=\"error\">\n    {{ error }}\n  </ion-card-content>\n  <ion-card-content *ngIf=\"subtitle\" class=\"text-center\">\n    <ion-text class=\"description\">{{ subtitle }}</ion-text>\n  </ion-card-content>\n</ion-card>\n", styles: [".variable-value{font-size:1.4em;font-weight:700}ion-card,ion-card ion-item,ion-card-subtitle,ion-item ion-card-subtitle{text-align:center}.description{font-size:.9em;color:#777;text-align:center}\n"] }]
        }], ctorParameters: function () { return []; }, propDecorators: { 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, 