"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __assign = (this && this.__assign) || Object.assign || function(t) {
    for (var s, i = 1, n = arguments.length; i < n; i++) {
        s = arguments[i];
        for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
            t[p] = s[p];
    }
    return t;
};
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
var core_1 = require("@angular/core");
var core_2 = require("@jsonforms/core");
var angular_1 = require("@jsonforms/angular");
var JsonFormsIonicLayout = /** @class */ (function (_super) {
    __extends(JsonFormsIonicLayout, _super);
    function JsonFormsIonicLayout(ngRedux) {
        var _this = _super.call(this) || this;
        _this.ngRedux = ngRedux;
        _this.connectLayoutToJsonForms = function (store, ownProps) {
            return store.select().map(function (state) {
                return core_2.mapStateToLayoutProps(state, ownProps);
            });
        };
        return _this;
    }
    JsonFormsIonicLayout.prototype.ngOnInit = function () {
        var _this = this;
        var ownProps = __assign({}, this.getOwnProps(), { path: this.path });
        var state$ = this.connectLayoutToJsonForms(this.ngRedux, ownProps);
        this.subscription = state$.subscribe(function (state) {
            _this.elements = state.uischema.elements;
        });
    };
    JsonFormsIonicLayout.prototype.ngOnDestroy = function () {
        this.subscription.unsubscribe();
    };
    __decorate([
        core_1.Input(),
        __metadata("design:type", String)
    ], JsonFormsIonicLayout.prototype, "path", void 0);
    return JsonFormsIonicLayout;
}(angular_1.JsonFormsBaseRenderer));
exports.JsonFormsIonicLayout = JsonFormsIonicLayout;
//# sourceMappingURL=JsonFormsIonicLayout.js.map