System.register(["reflect-metadata", "lodash", "@angular/core", "./responsive.component", "@stratusjs/core/misc"], function (exports_1, context_1) {
    "use strict";
    var lodash_1, core_1, responsive_component_1, misc_1, RootComponent;
    var __moduleName = context_1 && context_1.id;
    return {
        setters: [
            function (_1) {
            },
            function (lodash_1_1) {
                lodash_1 = lodash_1_1;
            },
            function (core_1_1) {
                core_1 = core_1_1;
            },
            function (responsive_component_1_1) {
                responsive_component_1 = responsive_component_1_1;
            },
            function (misc_1_1) {
                misc_1 = misc_1_1;
            }
        ],
        execute: function () {
            RootComponent = class RootComponent extends responsive_component_1.ResponsiveComponent {
                hydrate(elementRef, sanitizer, attrs) {
                    lodash_1.default.forEach(attrs, (attr) => {
                        const metaDataKeys = Reflect.getMetadataKeys(this, attr);
                        if (!lodash_1.default.includes(metaDataKeys, 'design:type')) {
                            return;
                        }
                        const attrKebab = lodash_1.default.kebabCase(attr);
                        const variants = [
                            attrKebab,
                            `data-${attrKebab}`
                        ];
                        const variant = lodash_1.default.find(variants, (v) => elementRef.nativeElement.hasAttribute(v));
                        if (lodash_1.default.isEmpty(variant)) {
                            return;
                        }
                        const value = sanitizer.sanitize(core_1.SecurityContext.STYLE, elementRef.nativeElement.getAttribute(variant));
                        lodash_1.default.set(this, attr, misc_1.isJSON(value) ? JSON.parse(value) : value);
                    });
                }
            };
            exports_1("RootComponent", RootComponent);
        }
    };
});

//# sourceMappingURL=root.component.js.map
