(function (global, factory) {
    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/forms'), require('@ionic/angular'), require('@iotize/ionic/target/common')) :
    typeof define === 'function' && define.amd ? define('@iotize/ionic/target/serial', ['exports', '@angular/core', '@angular/forms', '@ionic/angular', '@iotize/ionic/target/common'], factory) :
    (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.iotize = global.iotize || {}, global.iotize.ionic = global.iotize.ionic || {}, global.iotize.ionic.target = global.iotize.ionic.target || {}, global.iotize.ionic.target.serial = {}), global.ng.core, global.ng.forms, global.i1, global.iotize.ionic.target.common));
}(this, (function (exports, i0, forms, i1, i2) { 'use strict';

    var TapSerialConfigurationFormComponent = /** @class */ (function () {
        function TapSerialConfigurationFormComponent(changeDetector, toastController) {
            this.changeDetector = changeDetector;
            this.toastController = toastController;
            this.SERIAL_SETTINGS_FIELDS = i2.SERIAL_SETTINGS_FIELDS;
            this.valueChanges = new i0.EventEmitter();
        }
        Object.defineProperty(TapSerialConfigurationFormComponent.prototype, "values", {
            set: function (obs) {
                var _this = this;
                var _a;
                (_a = this.valueSub) === null || _a === void 0 ? void 0 : _a.unsubscribe();
                this.valueSub = obs === null || obs === void 0 ? void 0 : obs.subscribe(function (newValue) {
                    _this.formValues = newValue;
                });
            },
            enumerable: false,
            configurable: true
        });
        TapSerialConfigurationFormComponent.prototype.onSerialSettingsChanged = function (event) {
            console.log('Selected', event);
            this.valueChanges.emit(event);
        };
        return TapSerialConfigurationFormComponent;
    }());
    /** @nocollapse */ TapSerialConfigurationFormComponent.ɵfac = function TapSerialConfigurationFormComponent_Factory(t) { return new (t || TapSerialConfigurationFormComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i1.ToastController)); };
    /** @nocollapse */ TapSerialConfigurationFormComponent.ɵcmp = i0.ɵɵdefineComponent({ type: TapSerialConfigurationFormComponent, selectors: [["tap-serial-configuration-form"]], inputs: { values: "values" }, outputs: { valueChanges: "valueChanges" }, decls: 1, vars: 2, consts: [[3, "values", "fields", "valueChanges"]], template: function TapSerialConfigurationFormComponent_Template(rf, ctx) {
            if (rf & 1) {
                i0.ɵɵelementStart(0, "tap-protocol-configuration-form", 0);
                i0.ɵɵlistener("valueChanges", function TapSerialConfigurationFormComponent_Template_tap_protocol_configuration_form_valueChanges_0_listener($event) { return ctx.onSerialSettingsChanged($event); });
                i0.ɵɵelementEnd();
            }
            if (rf & 2) {
                i0.ɵɵproperty("values", ctx.formValues)("fields", ctx.SERIAL_SETTINGS_FIELDS);
            }
        }, directives: [i2.TapProtocolConfigurationFormComponent], styles: [""] });
    (function () {
        (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TapSerialConfigurationFormComponent, [{
                type: i0.Component,
                args: [{
                        selector: 'tap-serial-configuration-form',
                        templateUrl: './tap-serial-configuration-form.component.html',
                        styleUrls: ['./tap-serial-configuration-form.component.scss'],
                    }]
            }], function () { return [{ type: i0.ChangeDetectorRef }, { type: i1.ToastController }]; }, { valueChanges: [{
                    type: i0.Output
                }], values: [{
                    type: i0.Input
                }] });
    })();

    var TapTargetSerialModule = /** @class */ (function () {
        function TapTargetSerialModule() {
        }
        return TapTargetSerialModule;
    }());
    /** @nocollapse */ TapTargetSerialModule.ɵfac = function TapTargetSerialModule_Factory(t) { return new (t || TapTargetSerialModule)(); };
    /** @nocollapse */ TapTargetSerialModule.ɵmod = i0.ɵɵdefineNgModule({ type: TapTargetSerialModule });
    /** @nocollapse */ TapTargetSerialModule.ɵinj = i0.ɵɵdefineInjector({ imports: [[
                i1.IonicModule,
                forms.FormsModule,
                forms.ReactiveFormsModule,
                i2.TapProtocolConfigurationModule,
            ]] });
    (function () {
        (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(TapTargetSerialModule, { declarations: [TapSerialConfigurationFormComponent], imports: [i1.IonicModule,
                forms.FormsModule,
                forms.ReactiveFormsModule,
                i2.TapProtocolConfigurationModule], exports: [TapSerialConfigurationFormComponent] });
    })();
    (function () {
        (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TapTargetSerialModule, [{
                type: i0.NgModule,
                args: [{
                        declarations: [TapSerialConfigurationFormComponent],
                        exports: [TapSerialConfigurationFormComponent],
                        imports: [
                            i1.IonicModule,
                            forms.FormsModule,
                            forms.ReactiveFormsModule,
                            i2.TapProtocolConfigurationModule,
                        ],
                    }]
            }], null, null);
    })();

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

    exports.TapSerialConfigurationFormComponent = TapSerialConfigurationFormComponent;
    exports.TapTargetSerialModule = TapTargetSerialModule;

    Object.defineProperty(exports, '__esModule', { value: true });

})));
//# sourceMappingURL=iotize-ionic-target-serial.umd.js.map
