(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["app-pages-especificos-cli-cadastros-template-template-module"],{

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/cli/cadastros/template/template-form/template-form.component.html":
/*!*******************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/cli/cadastros/template/template-form/template-form.component.html ***!
  \*******************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<app-menu-command-bar [botoesComando]=\"constantes.listaForm\" [formAction]=\"actionForm\"\n    [sisFormularioId]=\"constantes.sisFormularioId\" [itemData]=\"data.regTemplate\">\n</app-menu-command-bar>\n\n<div class=\"row\">\n    <div class=\"col-lg-12\">\n        <div class=\"section-comand-bar\">\n            <app-form-legenda></app-form-legenda>\n            <div class=\"card-body widget-body\">\n                <form class=\"form\" #form=\"ngForm\" (ngSubmit)=\"onSubmit(form)\">\n                    <app-validacoes></app-validacoes>\n                    <div class=\"row\">\n                        <div class=\"col-lg-3\">\n                            <div class=\"form-group form-group-sm\">\n                                <label class=\"required\" for=\"descricao\">{{ 'labels.descricao' | translate}}</label>\n                                <input id=\"descricao\" name=\"descricao\" [(ngModel)]=\"data.descrTemplate\"\n                                    [disabled]=\"funcoesService.isDetail(actionForm)\"\n                                    class=\"form-control form-control-sm\" type=\"text\" required=\"true\">\n                            </div>\n                        </div>\n                    </div>\n                    <div class=\"row\">\n                        <div class=\"col-lg-3\">\n                            <div class=\"form-group form-group-sm\">\n                                <label class=\"required\" for=\"idioma\">{{\"labels.idioma\" | translate }}</label>\n                                <select id=\"idioma\" name=\"idioma\" class=\"form-control form-control-sm\" required=\"true\"\n                                    [(ngModel)]=\"data.idioma\" [disabled]=\"funcoesService.isDetail(actionForm)\">\n                                    <option value=\"Português\">{{ 'labels.portugues' | translate }}</option>\n                                    <option value=\"Inglês\">{{ 'labels.ingles' | translate }}</option>\n                                </select>\n                            </div>\n                        </div>\n                    </div>\n                    <div class=\"row\">\n                        <div class=\"col-lg-6 col-md-10 col-sm-12\">\n                            <div class=\"form-group form-group-sm\">\n                                <label class=\"required\" for=\"modeloDaCarta\">{{'labels.modeloDaCarta' | translate}}</label>\n                                <div class=\"custom-file\">\n                                    <input type=\"file\" class=\"custom-file-input campo\" id=\"modeloDaCarta\"\n                                        name=\"modeloDaCarta\" accept=\".docx\" (change)=\"fileChange($event)\"\n                                        [disabled]=\"funcoesService.isDetail(actionForm)\"\n                                        required=\"true\">\n                                    <label class=\"custom-file-label\" for=\"modeloDaCarta\">{{data.modCarta}}</label>\n                                </div>\n                            </div>\n                        </div>\n                    </div>\n                    <div class=\"clearfix\">&nbsp;</div>\n                    <div class=\"row\">\n                        <div class=\"col-12\">\n                            <div class=\"form-group\">\n                                <button class=\"btn btn-success mr-2\" type=\"submit\"\n                                    [disabled]=\"funcoesService.isDetail(actionForm)\">\n                                    {{ 'buttons.salvar' | translate }}\n                                </button>\n                            </div>\n                        </div>\n                    </div>\n                </form>\n            </div>\n        </div>\n    </div>\n</div>\n\n<app-liberar-acesso-supervisor></app-liberar-acesso-supervisor>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/cli/cadastros/template/template-index/template-index.component.html":
/*!*********************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/cli/cadastros/template/template-index/template-index.component.html ***!
  \*********************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<app-menu-command-bar [botoesComando]=\"constantes.listaIndex\" [formAction]=\"actionForm\"\n    [sisFormularioId]=\"constantes.sisFormularioId\" [itemData]=\"data.regTemplate\">\n</app-menu-command-bar>\n\n<div class=\"section-comand-bar\">\n    <div class=\"row mt-2\">\n        <div class=\"col-12\">\n            <table id=\"dtTemplate\"\n                class=\"table table-striped table-bordered table-hover nowrap table-sm\">\n            </table>\n        </div>\n    </div>\n</div>\n\n<app-propriedades></app-propriedades>\n<app-liberar-acesso-supervisor></app-liberar-acesso-supervisor>\n<app-permissoes-rotina [constantes]=\"constantes\"></app-permissoes-rotina>");

/***/ }),

/***/ "./src/app/pages/especificos/cli/cadastros/template/template-form/template-form.component.ts":
/*!***************************************************************************************************!*\
  !*** ./src/app/pages/especificos/cli/cadastros/template/template-form/template-form.component.ts ***!
  \***************************************************************************************************/
/*! exports provided: TemplateFormComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TemplateFormComponent", function() { return TemplateFormComponent; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm5/router.js");
/* harmony import */ var _shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../../../shared/components/corporate/base/base.permissoes */ "./src/app/shared/components/corporate/base/base.permissoes.ts");
/* harmony import */ var _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../../../shared/services/event-emitter/event-emitter.service */ "./src/app/shared/services/event-emitter/event-emitter.service.ts");
/* harmony import */ var _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../../../shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../../../shared/services/funcoes/permissoes-utils/permissoes-utils.service */ "./src/app/shared/services/funcoes/permissoes-utils/permissoes-utils.service.ts");
/* harmony import */ var _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../../../shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! app/shared/services/funcoes/number-utils/number-utils.static.service */ "./src/app/shared/services/funcoes/number-utils/number-utils.static.service.ts");
/* harmony import */ var _template_model__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../template.model */ "./src/app/pages/especificos/cli/cadastros/template/template.model.ts");
/* harmony import */ var _template_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../template.constants */ "./src/app/pages/especificos/cli/cadastros/template/template.constants.ts");
/* harmony import */ var _template_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../template.service */ "./src/app/pages/especificos/cli/cadastros/template/template.service.ts");
/* harmony import */ var app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! app/pages/login/login.service */ "./src/app/pages/login/login.service.ts");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        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 extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__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 = (undefined && undefined.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};












var TemplateFormComponent = /** @class */ (function (_super) {
    __extends(TemplateFormComponent, _super);
    function TemplateFormComponent(router, messageService, activatedRoute, service, funcoesService, permissoesUtils, loginService) {
        var _this = _super.call(this, new _template_constants__WEBPACK_IMPORTED_MODULE_9__["TemplateConstants"](), funcoesService) || this;
        _this.router = router;
        _this.messageService = messageService;
        _this.activatedRoute = activatedRoute;
        _this.service = service;
        _this.funcoesService = funcoesService;
        _this.permissoesUtils = permissoesUtils;
        _this.loginService = loginService;
        _this.data = new _template_model__WEBPACK_IMPORTED_MODULE_8__["Template"]();
        _this.mensagens = [];
        _this.constantes = new _template_constants__WEBPACK_IMPORTED_MODULE_9__["TemplateConstants"]();
        _this.selectedFile = null;
        _this.target = _this.funcoesService.getTargetLocation();
        _this.pageRoute = "/especificos/cli/cadastros/template";
        router.events.subscribe(function (event) {
            var params = _this.funcoesService.formParams.getParams(router, event);
            if (params) {
                _this.actionForm = params.action;
            }
        });
        return _this;
    }
    TemplateFormComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, this.permissoesUtils.getLibRotina(this.actionForm), function () {
            var id = _this.activatedRoute.snapshot.paramMap.get("id");
            if (id) {
                _this.service.getById(app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_7__["NumberUtilsStaticService"].toNumber(id)).subscribe(function (resp) {
                    _this.data = resp;
                });
            }
            else {
                _this.data = new _template_model__WEBPACK_IMPORTED_MODULE_8__["Template"]();
            }
        }, function () {
            _this.permissoesUtils.back();
        });
    };
    TemplateFormComponent.prototype.onSubmit = function (form, create) {
        var _this = this;
        if (create === void 0) { create = false; }
        _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_3__["EventEmitterService"].get("formError").emit(form);
        if (form.invalid) {
            return;
        }
        this.data.logRotina = 'Man. Template';
        this.service._save(this.data, this.funcoesService.isEdit(this.actionForm))
            .subscribe(function (result) {
            _this.mensagens = _this.messageService.validationResult(result.validationResult);
            if (!result.validationResult.isValid) {
                _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_3__["EventEmitterService"].get("backError").emit(_this.mensagens);
            }
            else {
                _this.messageService.saveSuccess("titles.template");
                if (create) {
                    _this.data = new _template_model__WEBPACK_IMPORTED_MODULE_8__["Template"]();
                    _this.fileName["template"] = "";
                    _this.router.navigate(["" + _this.target + _this.pageRoute + "/create"]);
                }
                else {
                    _this.back();
                }
            }
        });
    };
    TemplateFormComponent.prototype.fileChange = function ($event) {
        this.readThis($event.target);
    };
    TemplateFormComponent.prototype.readThis = function (inputValue) {
        var _this = this;
        var file = inputValue.files[0];
        var myReader = new FileReader();
        myReader.onloadend = function (e) {
            _this.data.modCartaB64 = myReader.result;
            _this.data.modCarta = file.name;
            _this.fileName = "C:\\fakepath\\" + file.name;
        };
        myReader.readAsDataURL(file);
    };
    TemplateFormComponent.prototype.saveAndCreate = function (form) {
        this.onSubmit(form, true);
    };
    TemplateFormComponent.prototype.edit = function () {
        var _this = this;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 2, function () {
            _this.router.navigate([_this.target + "/especificos/cli/cadastros/template/edit/" + _this.data.regTemplate]);
        });
    };
    TemplateFormComponent.prototype.back = function () {
        this.router.navigate(["" + this.target + this.pageRoute]);
    };
    TemplateFormComponent.ctorParameters = function () { return [
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"] },
        { type: _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_6__["MessageService"] },
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["ActivatedRoute"] },
        { type: _template_service__WEBPACK_IMPORTED_MODULE_10__["TemplateService"] },
        { type: _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_4__["FuncoesService"] },
        { type: _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_5__["PermissoesUtilsService"] },
        { type: app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_11__["LoginService"] }
    ]; };
    TemplateFormComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-template-form",
            template: __importDefault(__webpack_require__(/*! raw-loader!./template-form.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/cli/cadastros/template/template-form/template-form.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"],
            _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_6__["MessageService"],
            _angular_router__WEBPACK_IMPORTED_MODULE_1__["ActivatedRoute"],
            _template_service__WEBPACK_IMPORTED_MODULE_10__["TemplateService"],
            _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_4__["FuncoesService"],
            _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_5__["PermissoesUtilsService"],
            app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_11__["LoginService"]])
    ], TemplateFormComponent);
    return TemplateFormComponent;
}(_shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_2__["BasePermissoes"]));



/***/ }),

/***/ "./src/app/pages/especificos/cli/cadastros/template/template-index/template-index.component.ts":
/*!*****************************************************************************************************!*\
  !*** ./src/app/pages/especificos/cli/cadastros/template/template-index/template-index.component.ts ***!
  \*****************************************************************************************************/
/*! exports provided: TemplateIndexComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TemplateIndexComponent", function() { return TemplateIndexComponent; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm5/router.js");
/* harmony import */ var _shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../../../shared/components/corporate/base/base.permissoes */ "./src/app/shared/components/corporate/base/base.permissoes.ts");
/* harmony import */ var _shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../../../shared/services/datatables/datatables.service */ "./src/app/shared/services/datatables/datatables.service.ts");
/* harmony import */ var _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../../../shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../../../shared/services/funcoes/permissoes-utils/permissoes-utils.service */ "./src/app/shared/services/funcoes/permissoes-utils/permissoes-utils.service.ts");
/* harmony import */ var _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../../../shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _login_login_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../../../login/login.service */ "./src/app/pages/login/login.service.ts");
/* harmony import */ var _template_model__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../template.model */ "./src/app/pages/especificos/cli/cadastros/template/template.model.ts");
/* harmony import */ var _template_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../template.constants */ "./src/app/pages/especificos/cli/cadastros/template/template.constants.ts");
/* harmony import */ var _template_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../template.service */ "./src/app/pages/especificos/cli/cadastros/template/template.service.ts");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        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 extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__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 = (undefined && undefined.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};











var TemplateIndexComponent = /** @class */ (function (_super) {
    __extends(TemplateIndexComponent, _super);
    function TemplateIndexComponent(router, service, datatablesService, funcoesService, messageService, permissoesUtils, loginService) {
        var _this = _super.call(this, new _template_constants__WEBPACK_IMPORTED_MODULE_9__["TemplateConstants"](), funcoesService) || this;
        _this.router = router;
        _this.service = service;
        _this.datatablesService = datatablesService;
        _this.funcoesService = funcoesService;
        _this.messageService = messageService;
        _this.permissoesUtils = permissoesUtils;
        _this.loginService = loginService;
        _this.constantes = new _template_constants__WEBPACK_IMPORTED_MODULE_9__["TemplateConstants"]();
        _this.data = new _template_model__WEBPACK_IMPORTED_MODULE_8__["Template"]();
        _this.dataRemove = new _template_model__WEBPACK_IMPORTED_MODULE_8__["Template"]();
        _this.mensagens = [];
        _this.target = _this.funcoesService.getTargetLocation();
        router.events.subscribe(function (event) {
            var params = _this.funcoesService.formParams.getParams(router, event);
            if (params) {
                _this.actionForm = params.action;
            }
        });
        return _this;
    }
    TemplateIndexComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 4, function () {
            if (!_this.loginService.isTokenExpired()) {
                _this.refresh();
            }
        }, function () {
            _this.permissoesUtils.back();
        }, true);
    };
    TemplateIndexComponent.prototype.refresh = function () {
        var _this = this;
        this.service.getAllDados().subscribe(function (data) {
            var columns = [
                _this.datatablesService.getDataString("descrTemplate", "descricao"),
                _this.datatablesService.getDataString("idioma", "idioma"),
                _this.datatablesService.getDataString("modCarta", "modelo")
            ];
            _this.datatablesService.toDataTable({ tableId: "dtTemplate", columns: columns, data: data }, function (aData) {
                _this.data = aData;
            });
        });
    };
    TemplateIndexComponent.prototype.permissoes = function () {
        var _this = this;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 7, function () {
            _super.prototype.permissoes.call(_this, _this.constantes);
        });
    };
    TemplateIndexComponent.prototype.create = function () {
        var _this = this;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 1, function () {
            _this.router.navigate([_this.target + "/especificos/cli/cadastros/template/create"]);
        });
    };
    TemplateIndexComponent.prototype.detail = function () {
        var _this = this;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 4, function () {
            _this.router.navigate([_this.target + "/especificos/cli/cadastros/template/detail/" + _this.data.regTemplate]);
        });
    };
    TemplateIndexComponent.prototype.edit = function () {
        var _this = this;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 2, function () {
            _this.router.navigate([_this.target + "/especificos/cli/cadastros/template/edit/" + _this.data.regTemplate]);
        });
    };
    TemplateIndexComponent.prototype.remove = function () {
        var _this = this;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 3, function () {
            _this.messageService.removeConfirm(function () {
                _this.service.remove(_this.data).subscribe(function () {
                    _this.refresh();
                });
            });
        });
    };
    TemplateIndexComponent.prototype.print = function () {
        var _this = this;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 5, function () {
            _this.constantes.paramRelatorio = {
                FilialId: _this.loginService.getLogin().filialId
            };
            _super.prototype.print.call(_this, null, true);
        });
    };
    TemplateIndexComponent.prototype.properties = function () {
        var _this = this;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 6, function () {
            _super.prototype.properties.call(_this, _this.data);
        });
    };
    TemplateIndexComponent.ctorParameters = function () { return [
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"] },
        { type: _template_service__WEBPACK_IMPORTED_MODULE_10__["TemplateService"] },
        { type: _shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_3__["DatatablesService"] },
        { type: _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_4__["FuncoesService"] },
        { type: _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_6__["MessageService"] },
        { type: _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_5__["PermissoesUtilsService"] },
        { type: _login_login_service__WEBPACK_IMPORTED_MODULE_7__["LoginService"] }
    ]; };
    TemplateIndexComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-template-index",
            template: __importDefault(__webpack_require__(/*! raw-loader!./template-index.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/especificos/cli/cadastros/template/template-index/template-index.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"],
            _template_service__WEBPACK_IMPORTED_MODULE_10__["TemplateService"],
            _shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_3__["DatatablesService"],
            _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_4__["FuncoesService"],
            _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_6__["MessageService"],
            _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_5__["PermissoesUtilsService"],
            _login_login_service__WEBPACK_IMPORTED_MODULE_7__["LoginService"]])
    ], TemplateIndexComponent);
    return TemplateIndexComponent;
}(_shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_2__["BasePermissoes"]));



/***/ }),

/***/ "./src/app/pages/especificos/cli/cadastros/template/template.constants.ts":
/*!********************************************************************************!*\
  !*** ./src/app/pages/especificos/cli/cadastros/template/template.constants.ts ***!
  \********************************************************************************/
/*! exports provided: TemplateConstants */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TemplateConstants", function() { return TemplateConstants; });
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};
var TemplateConstants = /** @class */ (function () {
    function TemplateConstants() {
        this.sisFormularioId = 375275;
        this.permissoes = [
            { sisFormularioId: this.sisFormularioId, libRotina: 1, acao: "labels.inclusao" },
            { sisFormularioId: this.sisFormularioId, libRotina: 2, acao: "labels.alteracao" },
            { sisFormularioId: this.sisFormularioId, libRotina: 3, acao: "labels.exclusao" },
            { sisFormularioId: this.sisFormularioId, libRotina: 4, acao: "labels.consulta" },
            { sisFormularioId: this.sisFormularioId, libRotina: 5, acao: "labels.impressao" },
            { sisFormularioId: this.sisFormularioId, libRotina: 6, acao: "labels.propriedades" },
            { sisFormularioId: this.sisFormularioId, libRotina: 7, acao: "labels.permissoes" }
        ];
        this.sisSistemaId = "CAD";
        this.nomeForm = "titles.template";
        this.reportId = "CLI0006";
        this.reportTitulo = { "titulo": "Template", "subTitulo": "" };
        this.listaIndex = [
            { title: 'Novo', action: 'create', icon: "icon-plus", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'Visualizar', action: 'detail', icon: "icon-eye", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'Editar', action: 'edit', icon: "icon-pencil", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'Excluir', action: 'remove', icon: "icon-close", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'Atualizar', action: 'refresh', icon: "icon-reload", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'Imprimir', action: 'print', icon: "icon-printer", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'Propriedade', action: 'properties', icon: "icon-menu", exibeButton: true, eximeMenu: true, menuName: 'Movimento' },
            { title: 'Permissao', action: 'permissoes', icon: "icon-unlock", exibeButton: true, eximeMenu: true, menuName: 'Movimento' },
        ];
        this.listaForm = [
            { title: 'Editar', action: 'edit', icon: "icon-pencil", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' },
            { title: 'Voltar', action: 'back', icon: "icon-arrow-left", exibeButton: true, eximeMenu: true, menuName: 'Arquivo' }
        ];
    }
    return TemplateConstants;
}());



/***/ }),

/***/ "./src/app/pages/especificos/cli/cadastros/template/template.model.ts":
/*!****************************************************************************!*\
  !*** ./src/app/pages/especificos/cli/cadastros/template/template.model.ts ***!
  \****************************************************************************/
/*! exports provided: Template */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Template", function() { return Template; });
/* harmony import */ var _shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../../../../shared/services/base/base.model */ "./src/app/shared/services/base/base.model.ts");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        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 extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};

var Template = /** @class */ (function (_super) {
    __extends(Template, _super);
    function Template() {
        return _super.call(this) || this;
    }
    return Template;
}(_shared_services_base_base_model__WEBPACK_IMPORTED_MODULE_0__["BaseModel"]));



/***/ }),

/***/ "./src/app/pages/especificos/cli/cadastros/template/template.module.ts":
/*!*****************************************************************************!*\
  !*** ./src/app/pages/especificos/cli/cadastros/template/template.module.ts ***!
  \*****************************************************************************/
/*! exports provided: TemplateModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TemplateModule", function() { return TemplateModule; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _shared_shared_module__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../shared/shared.module */ "./src/app/shared/shared.module.ts");
/* harmony import */ var _template_routing_module__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./template.routing.module */ "./src/app/pages/especificos/cli/cadastros/template/template.routing.module.ts");
/* harmony import */ var _template_form_template_form_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./template-form/template-form.component */ "./src/app/pages/especificos/cli/cadastros/template/template-form/template-form.component.ts");
/* harmony import */ var _template_index_template_index_component__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./template-index/template-index.component */ "./src/app/pages/especificos/cli/cadastros/template/template-index/template-index.component.ts");
var __decorate = (undefined && undefined.__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 __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};





var TemplateModule = /** @class */ (function () {
    function TemplateModule() {
    }
    TemplateModule = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"])({
            declarations: [
                _template_index_template_index_component__WEBPACK_IMPORTED_MODULE_4__["TemplateIndexComponent"],
                _template_form_template_form_component__WEBPACK_IMPORTED_MODULE_3__["TemplateFormComponent"]
            ],
            imports: [
                _shared_shared_module__WEBPACK_IMPORTED_MODULE_1__["SharedModule"],
                _template_routing_module__WEBPACK_IMPORTED_MODULE_2__["TemplateRoutingModule"]
            ]
        })
    ], TemplateModule);
    return TemplateModule;
}());



/***/ }),

/***/ "./src/app/pages/especificos/cli/cadastros/template/template.routing.module.ts":
/*!*************************************************************************************!*\
  !*** ./src/app/pages/especificos/cli/cadastros/template/template.routing.module.ts ***!
  \*************************************************************************************/
/*! exports provided: TemplateRoutingModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TemplateRoutingModule", function() { return TemplateRoutingModule; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/router */ "./node_modules/@angular/router/fesm5/router.js");
/* harmony import */ var _config_enumerables__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../../../../config/enumerables */ "./src/app/config/enumerables.ts");
/* harmony import */ var _template_index_template_index_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./template-index/template-index.component */ "./src/app/pages/especificos/cli/cadastros/template/template-index/template-index.component.ts");
/* harmony import */ var _template_form_template_form_component__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./template-form/template-form.component */ "./src/app/pages/especificos/cli/cadastros/template/template-form/template-form.component.ts");
var __decorate = (undefined && undefined.__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 __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};





var TemplateRoutes = [
    {
        path: "",
        component: _template_index_template_index_component__WEBPACK_IMPORTED_MODULE_3__["TemplateIndexComponent"],
        data: {
            breadcrumb: "template",
            formParams: { action: _config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].index }
        }
    },
    {
        path: "create",
        component: _template_form_template_form_component__WEBPACK_IMPORTED_MODULE_4__["TemplateFormComponent"],
        data: {
            breadcrumb: "template",
            formParams: { action: _config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].create }
        }
    },
    {
        path: "detail/:id",
        component: _template_form_template_form_component__WEBPACK_IMPORTED_MODULE_4__["TemplateFormComponent"],
        data: {
            breadcrumb: "template",
            formParams: { action: _config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].detail }
        }
    },
    {
        path: "edit/:id",
        component: _template_form_template_form_component__WEBPACK_IMPORTED_MODULE_4__["TemplateFormComponent"],
        data: {
            breadcrumb: "template",
            formParams: { action: _config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].edit }
        }
    }
];
var TemplateRoutingModule = /** @class */ (function () {
    function TemplateRoutingModule() {
    }
    TemplateRoutingModule = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"])({
            imports: [_angular_router__WEBPACK_IMPORTED_MODULE_1__["RouterModule"].forChild(TemplateRoutes)],
            exports: [_angular_router__WEBPACK_IMPORTED_MODULE_1__["RouterModule"]]
        })
    ], TemplateRoutingModule);
    return TemplateRoutingModule;
}());



/***/ }),

/***/ "./src/app/pages/especificos/cli/cadastros/template/template.service.ts":
/*!******************************************************************************!*\
  !*** ./src/app/pages/especificos/cli/cadastros/template/template.service.ts ***!
  \******************************************************************************/
/*! exports provided: TemplateService */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TemplateService", function() { return TemplateService; });
/* harmony import */ var _angular_common_http__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/common/http */ "./node_modules/@angular/common/fesm5/http.js");
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _shared_services_base_specifics_base_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../../../../../shared/services/base/specifics.base.service */ "./src/app/shared/services/base/specifics.base.service.ts");
/* harmony import */ var _template_model__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./template.model */ "./src/app/pages/especificos/cli/cadastros/template/template.model.ts");
/* harmony import */ var environments_environment__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! environments/environment */ "./src/environments/environment.ts");
/* harmony import */ var rxjs_internal_operators_catchError__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! rxjs/internal/operators/catchError */ "./node_modules/rxjs/internal/operators/catchError.js");
/* harmony import */ var rxjs_internal_operators_catchError__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(rxjs_internal_operators_catchError__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var app_app_error_handler__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! app/app.error-handler */ "./src/app/app.error-handler.ts");
var __extends = (undefined && undefined.__extends) || (function () {
    var extendStatics = function (d, b) {
        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 extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (undefined && undefined.__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 = (undefined && undefined.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};







var TemplateService = /** @class */ (function (_super) {
    __extends(TemplateService, _super);
    function TemplateService(http) {
        var _this = _super.call(this, http, "cli/cadastros/template") || this;
        _this.http = http;
        _this.data = new _template_model__WEBPACK_IMPORTED_MODULE_3__["Template"]();
        return _this;
    }
    TemplateService.prototype.getAllDados = function () {
        return this.http
            .get(environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].specifics_service_url + "/api/v1/cli/cadastros/template/getAllDados")
            .pipe(Object(rxjs_internal_operators_catchError__WEBPACK_IMPORTED_MODULE_5__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_6__["ErrorHandler"].handleError));
    };
    TemplateService.prototype._save = function (data, edit) {
        var formData = new FormData();
        for (var key in data) {
            if (data.hasOwnProperty(key)) {
                if (Array.isArray(data[key])) {
                    formData.append(key, JSON.stringify(data[key]));
                }
                else {
                    formData.append(key, data[key]);
                }
            }
        }
        if (edit) {
            return this._update(formData);
        }
        else {
            return this._add(formData);
        }
    };
    TemplateService.prototype._add = function (formData) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].specifics_service_url + "/api/v1/cli/cadastros/template", formData)
            .pipe(Object(rxjs_internal_operators_catchError__WEBPACK_IMPORTED_MODULE_5__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_6__["ErrorHandler"].handleError));
    };
    TemplateService.prototype._update = function (formData) {
        return this.http
            .put(environments_environment__WEBPACK_IMPORTED_MODULE_4__["environment"].specifics_service_url + "/api/v1/cli/cadastros/template", formData)
            .pipe(Object(rxjs_internal_operators_catchError__WEBPACK_IMPORTED_MODULE_5__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_6__["ErrorHandler"].handleError));
    };
    TemplateService.ctorParameters = function () { return [
        { type: _angular_common_http__WEBPACK_IMPORTED_MODULE_0__["HttpClient"] }
    ]; };
    TemplateService = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"])({
            providedIn: "root"
        }),
        __metadata("design:paramtypes", [_angular_common_http__WEBPACK_IMPORTED_MODULE_0__["HttpClient"]])
    ], TemplateService);
    return TemplateService;
}(_shared_services_base_specifics_base_service__WEBPACK_IMPORTED_MODULE_2__["SpecificsBaseService"]));



/***/ })

}]);
//# sourceMappingURL=app-pages-especificos-cli-cadastros-template-template-module.js.map