(function (global, factory) {
    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/platform-browser'), require('@sd-angular/core/utility'), require('uuid')) :
    typeof define === 'function' && define.amd ? define('@sd-angular/core/dynamic-report', ['exports', '@angular/core', '@angular/platform-browser', '@sd-angular/core/utility', 'uuid'], factory) :
    (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global['sd-angular'] = global['sd-angular'] || {}, global['sd-angular'].core = global['sd-angular'].core || {}, global['sd-angular'].core['dynamic-report'] = {}), global.ng.core, global.ng.platformBrowser, global['sd-angular'].core.utility, global.uuid));
}(this, (function (exports, core, platformBrowser, utility, uuid) { 'use strict';

    var SdDynamicReportComponent = /** @class */ (function () {
        function SdDynamicReportComponent(ref, sanitizer, utilityService) {
            this.ref = ref;
            this.sanitizer = sanitizer;
            this.utilityService = utilityService;
            this.printId = 'sd' + uuid.v4();
            this.print = function () {
                //  this.utilityService.printHtml(this.printId);
            };
        }
        Object.defineProperty(SdDynamicReportComponent.prototype, "html", {
            set: function (value) {
                // tslint:disable-next-line: max-line-length
                var regex = /\{[a-zA-ZÀÁÂÃÈÉÊÌÍÒÓÔÕÙÚĂĐĨŨƠàáâãèéêìíòóôõùúăđĩũơƯĂẠẢẤẦẨẪẬẮẰẲẴẶẸẺẼỀỀỂẾưăạảấầẩẫậắằẳẵặẹẻẽềềểếỄỆỈỊỌỎỐỒỔỖỘỚỜỞỠỢỤỦỨỪễệỉịọỏốồổỗộớờởỡợụủứừỬỮỰỲỴÝỶỸửữựỳỵỷỹ0-9 ]*\}/g;
                // tslint:disable-next-line: max-line-length
                var style = 'border-top: none !important; border-left: none !important;  border-right: none !important;border-bottom: dotted 1px black !important;background-color: lightgray !important;outline: none !important;';
                var result = value;
                if (typeof (value) === 'string') {
                    while (1) {
                        var strs = regex.exec(value);
                        if (!strs) {
                            break;
                        }
                        var placeholder = strs[0].substr(1, strs[0].length - 2);
                        result = result.replace(strs[0], "<input id=\"sd" + uuid.v4() + "\" placeholder=\"" + placeholder + "\" style=\"" + style + "\">");
                    }
                }
                this.cHtml = this.sanitizer.bypassSecurityTrustHtml(result);
            },
            enumerable: false,
            configurable: true
        });
        SdDynamicReportComponent.prototype.ngOnInit = function () {
        };
        SdDynamicReportComponent.prototype.ngAfterViewInit = function () {
            this.ref.detectChanges();
        };
        return SdDynamicReportComponent;
    }());
    SdDynamicReportComponent.decorators = [
        { type: core.Component, args: [{
                    selector: 'sd-dynamic-report',
                    template: "<div [id]=\"printId\" [innerHtml]=\"cHtml\">\r\n  <div [innerHtml]=\"cHtml\"></div>\r\n</div>"
                },] }
    ];
    SdDynamicReportComponent.ctorParameters = function () { return [
        { type: core.ChangeDetectorRef },
        { type: platformBrowser.DomSanitizer },
        { type: utility.SdUtilityService }
    ]; };
    SdDynamicReportComponent.propDecorators = {
        title: [{ type: core.Input }],
        html: [{ type: core.Input }]
    };

    var SdDynamicReportModule = /** @class */ (function () {
        function SdDynamicReportModule() {
        }
        return SdDynamicReportModule;
    }());
    SdDynamicReportModule.decorators = [
        { type: core.NgModule, args: [{
                    imports: [
                        utility.SdUtilityModule
                    ],
                    declarations: [
                        SdDynamicReportComponent
                    ],
                    exports: [
                        SdDynamicReportComponent
                    ],
                    providers: []
                },] }
    ];

    /*
     * Public API Surface of superdev-angular-core
     */

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

    exports.SdDynamicReportComponent = SdDynamicReportComponent;
    exports.SdDynamicReportModule = SdDynamicReportModule;

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

})));
//# sourceMappingURL=sd-angular-core-dynamic-report.umd.js.map
