import * as i0 from '@angular/core';
import { EventEmitter, Component, Output, Input, NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import * as i1 from '@ionic/angular';
import { IonicModule } from '@ionic/angular';
import * as i2 from '@iotize/ionic/target/common';
import { SERIAL_SETTINGS_FIELDS, TapProtocolConfigurationModule } from '@iotize/ionic/target/common';

class TapSerialConfigurationFormComponent {
    constructor(changeDetector, toastController) {
        this.changeDetector = changeDetector;
        this.toastController = toastController;
        this.SERIAL_SETTINGS_FIELDS = SERIAL_SETTINGS_FIELDS;
        this.valueChanges = new EventEmitter();
    }
    set values(obs) {
        var _a;
        (_a = this.valueSub) === null || _a === void 0 ? void 0 : _a.unsubscribe();
        this.valueSub = obs === null || obs === void 0 ? void 0 : obs.subscribe((newValue) => {
            this.formValues = newValue;
        });
    }
    onSerialSettingsChanged(event) {
        console.log('Selected', event);
        this.valueChanges.emit(event);
    }
}
/** @nocollapse */ /** @nocollapse */ TapSerialConfigurationFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TapSerialConfigurationFormComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.ToastController }], target: i0.ɵɵFactoryTarget.Component });
/** @nocollapse */ /** @nocollapse */ TapSerialConfigurationFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.2", type: TapSerialConfigurationFormComponent, selector: "tap-serial-configuration-form", inputs: { values: "values" }, outputs: { valueChanges: "valueChanges" }, ngImport: i0, template: "<tap-protocol-configuration-form\n  [values]=\"formValues\"\n  (valueChanges)=\"onSerialSettingsChanged($event)\"\n  [fields]=\"SERIAL_SETTINGS_FIELDS\"\n>\n</tap-protocol-configuration-form>\n", styles: [""], components: [{ type: i2.TapProtocolConfigurationFormComponent, selector: "tap-protocol-configuration-form", inputs: ["customBaudRate", "baudRates", "fields", "values"], outputs: ["valueChanges"] }] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TapSerialConfigurationFormComponent, decorators: [{
            type: Component,
            args: [{ selector: 'tap-serial-configuration-form', template: "<tap-protocol-configuration-form\n  [values]=\"formValues\"\n  (valueChanges)=\"onSerialSettingsChanged($event)\"\n  [fields]=\"SERIAL_SETTINGS_FIELDS\"\n>\n</tap-protocol-configuration-form>\n", styles: [""] }]
        }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i1.ToastController }]; }, propDecorators: { valueChanges: [{
                type: Output
            }], values: [{
                type: Input
            }] } });

class TapTargetSerialModule {
}
/** @nocollapse */ /** @nocollapse */ TapTargetSerialModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TapTargetSerialModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
/** @nocollapse */ /** @nocollapse */ TapTargetSerialModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TapTargetSerialModule, declarations: [TapSerialConfigurationFormComponent], imports: [IonicModule,
        FormsModule,
        ReactiveFormsModule,
        TapProtocolConfigurationModule], exports: [TapSerialConfigurationFormComponent] });
/** @nocollapse */ /** @nocollapse */ TapTargetSerialModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TapTargetSerialModule, imports: [[
            IonicModule,
            FormsModule,
            ReactiveFormsModule,
            TapProtocolConfigurationModule,
        ]] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.2", ngImport: i0, type: TapTargetSerialModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [TapSerialConfigurationFormComponent],
                    exports: [TapSerialConfigurationFormComponent],
                    imports: [
                        IonicModule,
                        FormsModule,
                        ReactiveFormsModule,
                        TapProtocolConfigurationModule,
                    ],
                }]
        }] });

/**
 * Generated bundle index. Do not edit.
 */

export { TapSerialConfigurationFormComponent, TapTargetSerialModule };
//# sourceMappingURL=iotize-ionic-target-serial.mjs.map
